a tool for shared writing and social publishing

preserve text size when blocks are copy pasted into leaflet

+13 -1
+1 -1
components/Blocks/TextBlock/RenderYJSFragment.tsx
··· 8 8 import { Delta } from "src/utils/yjsFragmentToString"; 9 9 import { ProfilePopover } from "components/ProfilePopover"; 10 10 11 - type BlockElements = "h1" | "h2" | "h3" | null | "blockquote" | "p"; 11 + type BlockElements = "h1" | "h2" | "h3" | null | "blockquote" | "p" | "small"; 12 12 export function RenderYJSFragment({ 13 13 value, 14 14 wrapper,
+11
components/Blocks/TextBlock/useHandlePaste.ts
··· 299 299 }, 300 300 }); 301 301 } 302 + let textSize = child.getAttribute("data-text-size"); 303 + if (textSize && ["default", "small", "large"].includes(textSize)) { 304 + rep.mutate.assertFact({ 305 + entity: entityID, 306 + attribute: "block/text-size", 307 + data: { 308 + type: "text-size-union", 309 + value: textSize as "default" | "small" | "large", 310 + }, 311 + }); 312 + } 302 313 if (child.tagName === "A") { 303 314 let href = child.getAttribute("href"); 304 315 let dataType = child.getAttribute("data-type");
+1
src/utils/getBlocksAsHTML.tsx
··· 172 172 text: async (b, tx, a) => { 173 173 let [value] = await scanIndex(tx).eav(b.value, "block/text"); 174 174 let [textSize] = await scanIndex(tx).eav(b.value, "block/text-size"); 175 + 175 176 return ( 176 177 <RenderYJSFragment 177 178 value={value?.data.value}