diff --git a/app/lish/[did]/[publication]/[rkey]/PostContent.tsx b/app/lish/[did]/[publication]/[rkey]/PostContent.tsx
index 9c794300..58096e70 100644
--- a/app/lish/[did]/[publication]/[rkey]/PostContent.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/PostContent.tsx
@@ -346,7 +346,7 @@ export let Block = ({
case PubLeafletBlocksText.isMain(b.block):
return (
;
@@ -190,7 +195,9 @@ export function BaseTextBlock(props: BlockProps & { className?: string }) {
let textStyle =
textSize?.data.value === "small"
? "text-sm text-secondary"
- : "text-base text-primary";
+ : textSize?.data.value === "large"
+ ? "text-lg text-primary"
+ : "text-base text-primary";
let editorState = useEditorStates(
(s) => s.editorStates[props.entityID],
diff --git a/components/Toolbar/TextBlockTypeToolbar.tsx b/components/Toolbar/TextBlockTypeToolbar.tsx
index 931edc6a..8883f56a 100644
--- a/components/Toolbar/TextBlockTypeToolbar.tsx
+++ b/components/Toolbar/TextBlockTypeToolbar.tsx
@@ -145,12 +145,42 @@ export const TextBlockTypeToolbar = (props: {
}
}}
active={
- blockType?.data.value === "text" && textSize?.data.value !== "small"
+ blockType?.data.value === "text" &&
+ textSize?.data.value !== "small" &&
+ textSize?.data.value !== "large"
}
tooltipContent={
Normal Text
}
>
Text
+ {
+ if (!focusedBlock || !blockType) return;
+ if (blockType.data.value !== "text") {
+ // Convert to text block first if it's a heading
+ if (headingLevel)
+ await rep?.mutate.retractFact({ factID: headingLevel.id });
+ await rep?.mutate.assertFact({
+ entity: focusedBlock.entityID,
+ attribute: "block/type",
+ data: { type: "block-type-union", value: "text" },
+ });
+ }
+ // Set text size to large
+ await rep?.mutate.assertFact({
+ entity: focusedBlock.entityID,
+ attribute: "block/text-size",
+ data: { type: "text-size-union", value: "large" },
+ });
+ }}
+ active={
+ blockType?.data.value === "text" && textSize?.data.value === "large"
+ }
+ tooltipContent={Large Text
}
+ >
+ Large
+
{
@@ -177,7 +207,7 @@ export const TextBlockTypeToolbar = (props: {
}
tooltipContent={Small Text
}
>
- Small
+ Small
>
);
diff --git a/lexicons/src/blocks.ts b/lexicons/src/blocks.ts
index 96c8ad99..dd3ff4ec 100644
--- a/lexicons/src/blocks.ts
+++ b/lexicons/src/blocks.ts
@@ -10,7 +10,7 @@ export const PubLeafletBlocksText: LexiconDoc = {
required: ["plaintext"],
properties: {
plaintext: { type: "string" },
- textSize: { type: "string", enum: ["default", "small"] },
+ textSize: { type: "string", enum: ["default", "small", "large"] },
facets: {
type: "array",
items: { type: "ref", ref: PubLeafletRichTextFacet.id },
diff --git a/src/replicache/attributes.ts b/src/replicache/attributes.ts
index dc0425ee..4f00e8e9 100644
--- a/src/replicache/attributes.ts
+++ b/src/replicache/attributes.ts
@@ -328,7 +328,7 @@ export type Data = {
};
"text-size-union": {
type: "text-size-union";
- value: "default" | "small";
+ value: "default" | "small" | "large";
};
"page-type-union": { type: "page-type-union"; value: "doc" | "canvas" };
"block-type-union": {