@quickbuilder.io/rich-text 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +122 -2
- package/adapters.d.ts +1 -0
- package/adapters.js +1 -0
- package/collaboration.d.ts +1 -0
- package/collaboration.js +1 -0
- package/commands.d.ts +1 -0
- package/commands.js +1 -0
- package/content.d.ts +1 -0
- package/content.js +1 -0
- package/contracts.d.ts +1 -0
- package/contracts.js +1 -0
- package/dist/adapters.d.mts +11 -0
- package/dist/adapters.d.ts +11 -0
- package/dist/adapters.js +564 -0
- package/dist/adapters.js.map +1 -0
- package/dist/adapters.mjs +557 -0
- package/dist/adapters.mjs.map +1 -0
- package/dist/collaboration.d.mts +29 -0
- package/dist/collaboration.d.ts +29 -0
- package/dist/collaboration.js +758 -0
- package/dist/collaboration.js.map +1 -0
- package/dist/collaboration.mjs +733 -0
- package/dist/collaboration.mjs.map +1 -0
- package/dist/commands.d.mts +8 -0
- package/dist/commands.d.ts +8 -0
- package/dist/commands.js +42 -0
- package/dist/commands.js.map +1 -0
- package/dist/commands.mjs +38 -0
- package/dist/commands.mjs.map +1 -0
- package/dist/content-types-CYHsrMrs.d.mts +27 -0
- package/dist/content-types-CYHsrMrs.d.ts +27 -0
- package/dist/content.d.mts +19 -0
- package/dist/content.d.ts +19 -0
- package/dist/content.js +785 -0
- package/dist/content.js.map +1 -0
- package/dist/content.mjs +775 -0
- package/dist/content.mjs.map +1 -0
- package/dist/contracts.d.mts +199 -0
- package/dist/contracts.d.ts +199 -0
- package/dist/contracts.js +4 -0
- package/dist/contracts.js.map +1 -0
- package/dist/contracts.mjs +3 -0
- package/dist/contracts.mjs.map +1 -0
- package/dist/extensions.d.mts +363 -0
- package/dist/extensions.d.ts +363 -0
- package/dist/extensions.js +153 -0
- package/dist/extensions.js.map +1 -0
- package/dist/extensions.mjs +142 -0
- package/dist/extensions.mjs.map +1 -0
- package/dist/history.d.mts +12 -0
- package/dist/history.d.ts +12 -0
- package/dist/history.js +464 -0
- package/dist/history.js.map +1 -0
- package/dist/history.mjs +459 -0
- package/dist/history.mjs.map +1 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1438 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1372 -0
- package/dist/index.mjs.map +1 -0
- package/dist/markdown.d.mts +32 -0
- package/dist/markdown.d.ts +32 -0
- package/dist/markdown.js +739 -0
- package/dist/markdown.js.map +1 -0
- package/dist/markdown.mjs +735 -0
- package/dist/markdown.mjs.map +1 -0
- package/dist/runtime/dom.d.mts +148 -0
- package/dist/runtime/dom.d.ts +148 -0
- package/dist/runtime/dom.js +2145 -0
- package/dist/runtime/dom.js.map +1 -0
- package/dist/runtime/dom.mjs +2084 -0
- package/dist/runtime/dom.mjs.map +1 -0
- package/dist/schema.d.mts +23 -0
- package/dist/schema.d.ts +23 -0
- package/dist/schema.js +157 -0
- package/dist/schema.js.map +1 -0
- package/dist/schema.mjs +137 -0
- package/dist/schema.mjs.map +1 -0
- package/dist/serializer.d.mts +38 -0
- package/dist/serializer.d.ts +38 -0
- package/dist/serializer.js +504 -0
- package/dist/serializer.js.map +1 -0
- package/dist/serializer.mjs +491 -0
- package/dist/serializer.mjs.map +1 -0
- package/dist/svg-export-BtI8x_mG.d.mts +15 -0
- package/dist/svg-export-BtI8x_mG.d.ts +15 -0
- package/dist/transactions.d.mts +16 -0
- package/dist/transactions.d.ts +16 -0
- package/dist/transactions.js +637 -0
- package/dist/transactions.js.map +1 -0
- package/dist/transactions.mjs +631 -0
- package/dist/transactions.mjs.map +1 -0
- package/extensions.d.ts +1 -0
- package/extensions.js +1 -0
- package/history.d.ts +1 -0
- package/history.js +1 -0
- package/package.json +352 -4
- package/schema.d.ts +1 -0
- package/schema.js +1 -0
- package/serializer.d.ts +1 -0
- package/serializer.js +1 -0
- package/transactions.d.ts +1 -0
- package/transactions.js +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/entities.ts","../src/schema.ts","../src/serializer.ts","../src/view-tree.ts","../src/markdown.ts"],"names":["attributes","source"],"mappings":";AACA,IAAM,QAAA,GAA6C;AAAA,EACjD,GAAA,EAAK,GAAA;AAAA,EACL,EAAA,EAAI,GAAA;AAAA,EACJ,EAAA,EAAI,GAAA;AAAA,EACJ,IAAA,EAAM,GAAA;AAAA,EACN,IAAA,EAAM,GAAA;AAAA,EACN,IAAA,EAAM,MAAA;AAAA,EACN,IAAA,EAAM,MAAA;AAAA,EACN,GAAA,EAAK,MAAA;AAAA,EACL,KAAA,EAAO,QAAA;AAAA,EACP,KAAA,EAAO,QAAA;AAAA,EACP,KAAA,EAAO,QAAA;AAAA,EACP,MAAA,EAAQ,QAAA;AAAA,EACR,KAAA,EAAO,QAAA;AAAA,EACP,KAAA,EAAO,QAAA;AAAA,EACP,KAAA,EAAO,QAAA;AAAA,EACP,KAAA,EAAO,QAAA;AAAA,EACP,IAAA,EAAM,QAAA;AAAA,EACN,MAAA,EAAQ;AACV,CAAA;AACO,SAAS,uBAAuB,KAAA,EAAuB;AAC5D,EAAA,OAAO,KAAA,CAAM,OAAA;AAAA,IACX,qCAAA;AAAA,IACA,CAAC,UAAU,MAAA,KAAmB;AAC5B,MAAA,IAAI,CAAC,MAAA,CAAO,UAAA,CAAW,GAAG,CAAA,EAAG;AAC3B,QAAA,MAAM,OAAA,GAAU,SAAS,MAAM,CAAA;AAC/B,QAAA,IAAI,OAAA,KAAY,MAAA;AACd,UAAA,MAAM,IAAI,KAAA;AAAA,YACR,sCAAsC,QAAQ,CAAA,iCAAA;AAAA,WAChD;AACF,QAAA,OAAO,OAAA;AAAA,MACT;AACA,MAAA,MAAM,QACJ,MAAA,CAAO,CAAC,GAAG,WAAA,EAAY,KAAM,MACzB,MAAA,CAAO,QAAA,CAAS,OAAO,KAAA,CAAM,CAAC,GAAG,EAAE,CAAA,GACnC,OAAO,MAAA,CAAO,K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AAA,EAAM;AACN,EAAA,OAAO,MAAA;AACT;AASO,SAAS,wBAAA,CACd,QAAA,EACA,OAAA,GAAqC,EAAC,EACb;AACzB,EAAA,OAAO,YAAY,iBAAA,CAAkB,QAAA,EAAU,OAAO,CAAA,CAAE,KAAA,CAAM,IAAI,CAAC,CAAA;AACrE;AAEO,SAAS,sBAAA,CACd,QAAA,EACA,OAAA,GAAqC,EAAC,EAC9B;AACR,EAAA,OAAO,eAAA,CAAgB,wBAAA,CAAyB,QAAA,EAAU,OAAO,CAAC,CAAA;AACpE","file":"content.mjs","sourcesContent":["/** Shared, single-pass entity decoding for portable rich-text serializers. */\nconst entities: Readonly<Record<string, string>> = {\n amp: \"&\",\n lt: \"<\",\n gt: \">\",\n quot: '\"',\n apos: \"'\",\n nbsp: \"\\u00a0\",\n copy: \"©\",\n reg: \"®\",\n trade: \"™\",\n mdash: \"—\",\n ndash: \"–\",\n hellip: \"…\",\n lsquo: \"‘\",\n rsquo: \"’\",\n ldquo: \"“\",\n rdquo: \"”\",\n bull: \"•\",\n middot: \"·\",\n};\nexport function decodeRichTextEntities(value: string): string {\n return value.replace(\n /&(#x[\\da-f]+|#\\d+|[a-z][a-z\\d]+);/gi,\n (original, entity: string) => {\n if (!entity.startsWith(\"#\")) {\n const decoded = entities[entity];\n if (decoded === undefined)\n throw new Error(\n `Unsupported named rich-text entity ${original}; use Unicode or a numeric entity`,\n );\n return decoded;\n }\n const point =\n entity[1]?.toLowerCase() === \"x\"\n ? Number.parseInt(entity.slice(2), 16)\n : Number(entity.slice(1));\n if (point < 1 || point > 0x10ffff || (point >= 0xd800 && point <= 0xdfff))\n throw new Error(\"Invalid rich-text character entity\");\n return String.fromCodePoint(point);\n },\n );\n}\n\n","import type {\n RichTextAlignment,\n RichTextBlockFormat,\n RichTextBlockFormatDefinition,\n RichTextBlockTag,\n RichTextColor,\n RichTextFontFamily,\n RichTextFontSize,\n RichTextLineHeight,\n} from './content-types';\n\nexport const QUICK_BUILDER_RICH_TEXT_SCHEMA_VERSION = 2;\n\nexport const richTextAllowedTags = [\n 'a',\n 'b',\n 'blockquote',\n 'br',\n 'code',\n 'em',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'hr',\n 'i',\n 'img',\n 'input',\n 'label',\n 'li',\n 'mark',\n 'ol',\n 'p',\n 'pre',\n 'qb-video',\n 's',\n 'span',\n 'sub',\n 'sup',\n 'strong',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'tr',\n 'u',\n 'ul',\n] as const;\n\nexport const richTextVoidTags = ['br', 'hr', 'img', 'input'] as const;\n\nexport const richTextAllowedTargets = ['_blank', '_self', '_parent', '_top'] as const;\n\nexport const richTextAlignmentTags = [\n 'blockquote',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'li',\n 'ol',\n 'p',\n 'pre',\n 'td',\n 'th',\n 'ul',\n] as const;\n\nexport const richTextAllowedAlignments = ['left', 'center', 'right', 'justify'] as const;\n\nexport const richTextAllowedFontFamilies = [\n 'default',\n 'carlito',\n 'source-sans-3',\n 'noto-sans',\n 'arimo',\n 'tinos',\n 'cousine',\n] as const satisfies readonly RichTextFontFamily[];\n\nexport const richTextAllowedFontSizes = [\n 'default',\n '8',\n '9',\n '10',\n '11',\n '12',\n '14',\n '16',\n '18',\n '24',\n '30',\n '36',\n '48',\n '60',\n '72',\n '96',\n] as const satisfies readonly RichTextFontSize[];\n\nexport const richTextAllowedLineHeights = ['1', '1.15', '1.5', '2'] as const satisfies readonly RichTextLineHeight[];\n\nexport const richTextAllowedColors = [\n 'default',\n 'gray',\n 'brown',\n 'orange',\n 'yellow',\n 'green',\n 'blue',\n 'purple',\n 'pink',\n 'red',\n] as const satisfies readonly RichTextColor[];\n\nexport const richTextBlockSelector = 'p,h1,h2,h3,pre,blockquote,li,ul,ol,td,th';\n\nexport const richTextBlockFormatByTagName: Partial<Record<string, RichTextBlockFormat>> = {\n p: 'paragraph',\n h1: 'heading1',\n h2: 'heading2',\n h3: 'heading3',\n pre: 'codeBlock',\n};\n\nexport const richTextBlockFormats: RichTextBlockFormatDefinition[] = [\n { value: 'paragraph', tagName: 'p' },\n { value: 'heading1', tagName: 'h1' },\n { value: 'heading2', tagName: 'h2' },\n { value: 'heading3', tagName: 'h3' },\n { value: 'codeBlock', tagName: 'pre' },\n];\n\nexport function isRichTextAlignment(value: unknown): value is RichTextAlignment {\n return richTextAllowedAlignments.includes(value as RichTextAlignment);\n}\n\nexport function isRichTextFontFamily(value: unknown): value is RichTextFontFamily {\n return richTextAllowedFontFamilies.includes(value as RichTextFontFamily);\n}\n\nexport function isRichTextFontSize(value: unknown): value is RichTextFontSize {\n return richTextAllowedFontSizes.includes(value as RichTextFontSize);\n}\n\nexport function isRichTextLineHeight(value: unknown): value is RichTextLineHeight {\n return richTextAllowedLineHeights.includes(value as RichTextLineHeight);\n}\n\nexport function isRichTextColor(value: unknown): value is RichTextColor {\n return richTextAllowedColors.includes(value as RichTextColor);\n}\n\nexport function isRichTextBlockTag(value: unknown): value is RichTextBlockTag {\n return value === 'p' || value === 'h1' || value === 'h2' || value === 'h3' || value === 'pre' || value === 'blockquote';\n}\n","import {\n isRichTextAlignment,\n isRichTextColor,\n isRichTextFontFamily,\n isRichTextFontSize,\n isRichTextLineHeight,\n richTextAlignmentTags,\n richTextAllowedTags,\n richTextAllowedTargets,\n richTextVoidTags,\n} from './schema';\nimport { decodeRichTextEntities } from './entities';\n\nconst ACTIVE_CONTENT_TAG_PATTERN = /<\\s*(script|style|iframe|object|embed|form)\\b[^>]*>[\\s\\S]*?<\\s*\\/\\s*\\1\\s*>/gi;\nconst ACTIVE_VOID_TAG_PATTERN = /<\\s*(?:script|style|iframe|object|embed|link|meta|base)\\b[^>]*\\/?\\s*>/gi;\nconst EVENT_HANDLER_ATTRIBUTE_PATTERN = /\\son[a-z]+\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s>]*)/gi;\nconst UNSAFE_URL_ATTRIBUTE_PATTERN = /\\s(?:href|src|xlink:href)\\s*=\\s*([\"']?)\\s*(?:javascript|vbscript|data\\s*:\\s*text\\/html)\\s*:[\\s\\S]*?\\1/gi;\nconst UNSAFE_STYLE_URL_PATTERN = /url\\s*\\(\\s*([\"']?)\\s*(?:javascript|vbscript|data\\s*:\\s*text\\/html)\\s*:/gi;\nconst RICH_TEXT_VIDEO_PATTERN = /<qb-video\\b((?:\"[^\"]*\"|'[^']*'|[^'\">])*)>[\\s\\S]*?<\\/qb-video>/gi;\nconst RICH_TEXT_TAG_PATTERN = /<qb-video\\b((?:\"[^\"]*\"|'[^']*'|[^'\">])*)>[\\s\\S]*?<\\/qb-video>|<\\/?([a-z][a-z0-9-]*)\\b((?:\"[^\"]*\"|'[^']*'|[^'\">])*)>/gi;\nconst ATTRIBUTE_VALUE_PATTERN = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s>]+))/g;\n\nconst allowedTagSet = new Set<string>(richTextAllowedTags);\nconst voidTagSet = new Set<string>(richTextVoidTags);\nconst allowedTargetSet = new Set<string>(richTextAllowedTargets);\nconst alignmentTagSet = new Set<string>(richTextAlignmentTags);\n\nexport const richTextMaximumUrlLength = 4_096;\nexport const richTextMaximumImageTextLength = 512;\n\nexport interface RichTextVideo { src: string; title: string }\n\nexport function validateRichTextVideo(src: string, title: string): RichTextVideo | undefined {\n src = src.trim();\n title = title.trim();\n if (!src || src.length > 2048 || !title || title.length > 200 || /[\\u0000-\\u0020\\u007f\\\\]/u.test(src)) return;\n const relative = /^\\/(?!\\/)/u.test(src);\n if (!relative && !src.startsWith('https://')) return;\n try {\n const url = new URL(src, 'https://rich-text.invalid');\n if (url.protocol !== 'https:' || url.username || url.password) return;\n return { src, title };\n } catch { return; }\n}\n\nfunction readVideoAttributes(raw: string) {\n const attributes = readHtmlAttributes(raw);\n return validateRichTextVideo(attributes.get('data-src') ?? '', attributes.get('data-title') ?? '');\n}\n\nexport function splitRichTextVideoBlocks(html: string): (string | RichTextVideo)[] {\n const content = normalizeRichTextHtml(html);\n const parts: (string | RichTextVideo)[] = [];\n let offset = 0;\n for (const match of content.matchAll(RICH_TEXT_VIDEO_PATTERN)) {\n const video = readVideoAttributes(match[1] ?? '');\n if (!video) continue;\n if (match.index > offset) parts.push(content.slice(offset, match.index));\n parts.push(video);\n offset = match.index + match[0].length;\n }\n if (offset < content.length) parts.push(content.slice(offset));\n return parts;\n}\n\nexport function stripActiveMarkup(value: string): string {\n return value\n .replace(ACTIVE_CONTENT_TAG_PATTERN, '')\n .replace(ACTIVE_VOID_TAG_PATTERN, '')\n .replace(EVENT_HANDLER_ATTRIBUTE_PATTERN, '')\n .replace(UNSAFE_URL_ATTRIBUTE_PATTERN, '')\n .replace(UNSAFE_STYLE_URL_PATTERN, 'url(');\n}\n\nexport interface RichTextSanitizationOptions {\n /** Resolve an untrusted image source to an approved URL, or remove it with null. */\n resolveImageSource?: (source: string) => string | null;\n /** Disable video blocks for content whose host does not authorize embedded media. */\n allowVideos?: boolean;\n /** Render governed videos as links when the destination cannot embed a player. */\n videoPresentation?: 'embed' | 'link';\n /** Retain bounded cid: image references for an explicitly selected email transport. */\n allowContentIdImages?: boolean;\n /** Select anonymous cross-origin requests globally or by the final approved source. */\n imageCrossOrigin?: 'anonymous' | ((source: string) => 'anonymous' | undefined);\n}\n\nexport function sanitizeRichTextMarkup(value: string, options: RichTextSanitizationOptions = {}): string {\n if (options.resolveImageSource !== undefined && typeof options.resolveImageSource !== 'function')\n throw new TypeError('Invalid rich text image resolver.');\n if (options.allowVideos !== undefined && typeof options.allowVideos !== 'boolean')\n throw new TypeError('Invalid rich text video policy.');\n if (options.videoPresentation !== undefined && !['embed', 'link'].includes(options.videoPresentation))\n throw new TypeError('Invalid rich text video presentation.');\n if (options.allowContentIdImages !== undefined && typeof options.allowContentIdImages !== 'boolean')\n throw new TypeError('Invalid rich text Content-ID image policy.');\n if (options.imageCrossOrigin !== undefined && options.imageCrossOrigin !== 'anonymous' && typeof options.imageCrossOrigin !== 'function')\n throw new TypeError('Invalid rich text image credentials policy.');\n return sanitizeMarkup(value, options);\n}\n\n/** Rebind persisted image URLs without modifying text, block identity or other links. */\nexport function rewriteRichTextImageSources(value: string, rewrite: (source: string) => string): string {\n if (value.length > 1_000_000) throw new RangeError('Rich text exceeds the serialization limit');\n return sanitizeMarkup(value, { resolveImageSource: source => isSafeRichTextImageSrc(source) ? rewrite(source) : null });\n}\n\nfunction sanitizeMarkup(value: string, options: RichTextSanitizationOptions = {}): string {\n // Attribute policy is applied to actual tags below. Scanning escaped text\n // for attributes would corrupt code examples such as `onerror=...`.\n return value\n .replace(ACTIVE_CONTENT_TAG_PATTERN, '')\n .replace(ACTIVE_VOID_TAG_PATTERN, '')\n .replace(RICH_TEXT_TAG_PATTERN, (match, rawVideo: string | undefined, rawTagName: string, rawAttributes: string) => {\n if (rawVideo !== undefined) {\n if (options.allowVideos === false) return '';\n const video = readVideoAttributes(rawVideo);\n if (!video) return '';\n if (options.videoPresentation === 'link') {\n return withBlockIdentity('<p>', rawVideo) + `<br><a href=\"${escapeHtmlAttribute(video.src)}\">${escapeHtmlAttribute(video.title)}</a></p>`;\n }\n return withBlockIdentity(`<qb-video data-src=\"${escapeHtmlAttribute(video.src)}\" data-title=\"${escapeHtmlAttribute(video.title)}\" contenteditable=\"false\">`, rawVideo) + '</qb-video>';\n }\n const tagName = rawTagName.toLowerCase();\n if (tagName === 'qb-video') return '';\n\n if (!allowedTagSet.has(tagName)) {\n return '';\n }\n\n if (match.startsWith('</')) {\n return voidTagSet.has(tagName) ? '' : `</${tagName}>`;\n }\n\n if (voidTagSet.has(tagName)) {\n if (tagName === 'img') {\n return withBlockIdentity(renderSafeImageTag(rawAttributes, options),rawAttributes);\n }\n if (tagName === 'input') {\n return withBlockIdentity(renderSafeTaskCheckbox(rawAttributes),rawAttributes);\n }\n return withBlockIdentity(`<${tagName}>`,rawAttributes);\n }\n\n if (tagName !== 'a') {\n return withBlockIdentity(renderSafeRichTextTag(tagName, rawAttributes),rawAttributes);\n }\n\n return renderSafeAnchorTag(rawAttributes);\n });\n}\n\n/** Converts explicitly plain text to the canonical HTML document without interpreting markup. */\nexport function plainTextToRichTextHtml(value: string): string {\n return `<p>${value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\\r\\n?/g, '\\n').replace(/\\n/g, '<br>')}</p>`;\n}\n\nexport function normalizeRichTextHtml(value: string): string {\n const sanitized = sanitizeRichTextMarkup(value);\n return sanitized.trim() ? sanitized : '<p></p>';\n}\n\nexport function richTextHtmlToPlainText(html: string): string {\n if (html.length > 1_000_000) throw new RangeError('Rich text exceeds the serialization limit');\n const text = sanitizeRichTextMarkup(html)\n .replace(RICH_TEXT_VIDEO_PATTERN, (_element, raw: string) => `\\n${escapeHtmlAttribute(readVideoAttributes(raw)?.title ?? '')}\\n`)\n .replace(/<!--[\\s\\S]*?-->/g, '')\n .replace(/<(?:br|hr)\\b[^>]*>/gi, '\\n')\n .replace(/<\\/(?:p|h[1-6]|li|blockquote|pre|tr|table)>/gi, '\\n')\n .replace(/<\\/(?:td|th)>/gi, '\\t')\n .replace(/<[^>]*>/g, '');\n return decodeRichTextEntities(text).replace(/\\t+\\n/g, '\\n').trim();\n}\n\n/** Stable, inert block identity for the owned collaborative DOM projection. */\nfunction withBlockIdentity(tag:string,rawAttributes:string):string {\n const id=readHtmlAttributes(rawAttributes).get('data-qb-block-id');\n if(!tag || tag.startsWith('<span') || !id || !/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(id))return tag;\n return tag.replace(/>$/,` data-qb-block-id=\"${id}\">`);\n}\n\nfunction renderSafeRichTextTag(tagName: string, rawAttributes: string): string {\n if (tagName === 'span') {\n return renderSafeSpanTag(rawAttributes);\n }\n\n if (tagName === 'td' || tagName === 'th') {\n return renderSafeTableCellTag(tagName, rawAttributes);\n }\n\n if (tagName === 'ul') {\n const attributes = readHtmlAttributes(rawAttributes);\n return attributes.get('data-task-list') === 'true' ? '<ul data-task-list=\"true\">' : '<ul>';\n }\n\n if (tagName === 'li') {\n const attributes = readHtmlAttributes(rawAttributes);\n const checked = attributes.get('data-checked');\n return checked === 'true' || checked === 'false' ? `<li data-checked=\"${checked}\">` : '<li>';\n }\n\n if (!alignmentTagSet.has(tagName)) {\n return `<${tagName}>`;\n }\n\n const attributes = readHtmlAttributes(rawAttributes);\n const renderedAttributes: string[] = [];\n const alignment = attributes.get('data-align');\n const lineHeight = attributes.get('data-line-height');\n if (isRichTextAlignment(alignment)) renderedAttributes.push(`data-align=\"${alignment}\"`);\n if (isRichTextLineHeight(lineHeight)) renderedAttributes.push(`data-line-height=\"${lineHeight}\"`);\n return renderedAttributes.length > 0 ? `<${tagName} ${renderedAttributes.join(' ')}>` : `<${tagName}>`;\n}\n\nfunction renderSafeSpanTag(rawAttributes: string): string {\n const attributes = readHtmlAttributes(rawAttributes);\n const renderedAttributes: string[] = [];\n const id = normalizeMentionAttribute(attributes.get('data-mention-id'), 128);\n const label = normalizeMentionAttribute(attributes.get('data-mention-label'), 160);\n const fontFamily = attributes.get('data-font-family');\n const fontSize = attributes.get('data-font-size');\n const textColor = attributes.get('data-text-color');\n const highlightColor = attributes.get('data-highlight-color');\n\n if (id && label) {\n renderedAttributes.push(\n `data-mention-id=\"${escapeHtmlAttribute(id)}\"`,\n `data-mention-label=\"${escapeHtmlAttribute(label)}\"`,\n );\n }\n if (isRichTextFontFamily(fontFamily) && fontFamily !== 'default') renderedAttributes.push(`data-font-family=\"${fontFamily}\"`);\n if (isRichTextFontSize(fontSize) && fontSize !== 'default') renderedAttributes.push(`data-font-size=\"${fontSize}\"`);\n if (isRichTextColor(textColor) && textColor !== 'default') renderedAttributes.push(`data-text-color=\"${textColor}\"`);\n if (isRichTextColor(highlightColor) && highlightColor !== 'default') renderedAttributes.push(`data-highlight-color=\"${highlightColor}\"`);\n\n return renderedAttributes.length > 0 ? `<span ${renderedAttributes.join(' ')}>` : '<span>';\n}\n\nfunction renderSafeTableCellTag(tagName: string, rawAttributes: string): string {\n const attributes = readHtmlAttributes(rawAttributes);\n const renderedAttributes: string[] = [];\n const alignment = attributes.get('data-align');\n const colSpan = normalizeTableSpan(attributes.get('colspan'));\n const rowSpan = normalizeTableSpan(attributes.get('rowspan'));\n const scope = attributes.get('scope');\n\n if (isRichTextAlignment(alignment)) {\n renderedAttributes.push(`data-align=\"${alignment}\"`);\n }\n\n if (colSpan) {\n renderedAttributes.push(`colspan=\"${colSpan}\"`);\n }\n\n if (rowSpan) {\n renderedAttributes.push(`rowspan=\"${rowSpan}\"`);\n }\n\n if (tagName === 'th' && scope && ['col', 'row', 'colgroup', 'rowgroup'].includes(scope)) {\n renderedAttributes.push(`scope=\"${scope}\"`);\n }\n\n return renderedAttributes.length > 0 ? `<${tagName} ${renderedAttributes.join(' ')}>` : `<${tagName}>`;\n}\n\nfunction renderSafeAnchorTag(rawAttributes: string): string {\n const attributes = readHtmlAttributes(rawAttributes);\n const renderedAttributes: string[] = [];\n const href = attributes.get('href');\n const target = attributes.get('target');\n\n if (href && isSafeRichTextHref(href)) {\n renderedAttributes.push(`href=\"${escapeHtmlAttribute(href)}\"`);\n }\n\n if (target && allowedTargetSet.has(target)) {\n renderedAttributes.push(`target=\"${target}\"`);\n if (target === '_blank') {\n renderedAttributes.push('rel=\"noopener noreferrer\"');\n }\n }\n\n return renderedAttributes.length > 0 ? `<a ${renderedAttributes.join(' ')}>` : '<a>';\n}\n\nfunction renderSafeImageTag(rawAttributes: string, options: RichTextSanitizationOptions): string {\n const attributes = readHtmlAttributes(rawAttributes);\n const source = attributes.get('src');\n const resolveSource = options.resolveImageSource;\n if (!source || !resolveSource && !isAllowedImageSource(source, options)) return '';\n const src = resolveSource ? resolveSource(source) : source;\n if (src === null) return '';\n if (!isAllowedImageSource(src, options)) throw new TypeError('Invalid replacement image URL.');\n const renderedAttributes = [\n `src=\"${escapeHtmlAttribute(src)}\"`,\n `alt=\"${escapeHtmlAttribute(normalizeTextAttribute(attributes.get('alt'), 512) ?? '')}\"`,\n ];\n const title = normalizeTextAttribute(attributes.get('title'), 512);\n const width = normalizeImageDimension(attributes.get('width'));\n const height = normalizeImageDimension(attributes.get('height'));\n if (title) renderedAttributes.push(`title=\"${escapeHtmlAttribute(title)}\"`);\n if (width) renderedAttributes.push(`width=\"${width}\"`);\n if (height) renderedAttributes.push(`height=\"${height}\"`);\n const credentials = typeof options.imageCrossOrigin === 'function' ? options.imageCrossOrigin(src) : options.imageCrossOrigin;\n if (credentials !== undefined && credentials !== 'anonymous') throw new TypeError('Invalid resolved image credentials policy.');\n if ((credentials ?? attributes.get('crossorigin')) === 'anonymous') renderedAttributes.push('crossorigin=\"anonymous\"');\n renderedAttributes.push('loading=\"lazy\"', 'decoding=\"async\"');\n return `<img ${renderedAttributes.join(' ')}>`;\n}\n\nfunction isAllowedImageSource(value: string, options: RichTextSanitizationOptions): boolean {\n if (isSafeRichTextImageSrc(value)) return true;\n if (!options.allowContentIdImages || value.length > richTextMaximumUrlLength || !/^cid:/iu.test(value)) return false;\n try {\n const identity = decodeURIComponent(value.slice(4));\n return identity.length > 0 && identity.length <= 200 && !/[^\\u0021-\\u007e]|[<>\"]/u.test(identity);\n } catch { return false; }\n}\n\nfunction renderSafeTaskCheckbox(rawAttributes: string): string {\n const attributes = readHtmlAttributes(rawAttributes);\n if (attributes.get('type')?.toLowerCase() !== 'checkbox') return '';\n const checked = attributes.get('checked') !== undefined || /(?:^|\\s)checked(?:\\s|=|$)/i.test(rawAttributes);\n return `<input type=\"checkbox\"${checked ? ' checked=\"\"' : ''} contenteditable=\"false\">`;\n}\n\nfunction readHtmlAttributes(rawAttributes: string): Map<string, string> {\n const attributes = new Map<string, string>();\n\n for (const match of rawAttributes.matchAll(ATTRIBUTE_VALUE_PATTERN)) {\n const name = match[1]?.toLowerCase();\n const value = match[2] ?? match[3] ?? match[4] ?? '';\n\n if (name) {\n attributes.set(name, decodeHtmlAttribute(value.trim()));\n }\n }\n\n return attributes;\n}\n\n/**\n * Returns whether a link target is accepted by the governed rich-text schema.\n * Relative URLs and document fragments are supported. Absolute URLs must use\n * an explicitly approved protocol so custom application schemes cannot leak\n * through authored content.\n */\nexport function isSafeRichTextHref(value: string): boolean {\n const trimmed = value.trim();\n if (!trimmed || trimmed.length > richTextMaximumUrlLength || /[\\u0000-\\u001f\\u007f]/.test(trimmed)) {\n return false;\n }\n\n if (trimmed.startsWith('//')) {\n return false;\n }\n\n if (/^(?:#|\\/|\\.\\/|\\.\\.\\/|\\?)/.test(trimmed)) {\n return true;\n }\n\n try {\n const url = new URL(trimmed);\n return ['http:', 'https:', 'mailto:', 'tel:'].includes(url.protocol.toLowerCase());\n } catch {\n return false;\n }\n}\n\nexport function isSafeRichTextImageSrc(value: string): boolean {\n const trimmed = value.trim();\n if (!trimmed\n || trimmed.length > richTextMaximumUrlLength\n || /[\\u0000-\\u001f\\u007f]/.test(trimmed)\n || trimmed.startsWith('//')) return false;\n if (/^(?:\\/|\\.\\/|\\.\\.\\/)/.test(trimmed)) return true;\n\n try {\n const url = new URL(trimmed);\n return url.protocol === 'http:' || url.protocol === 'https:';\n } catch {\n return false;\n }\n}\n\nfunction normalizeTableSpan(value: string | undefined): string | null {\n if (!value || !/^\\d{1,3}$/.test(value)) {\n return null;\n }\n\n const numericValue = Number(value);\n return numericValue >= 1 && numericValue <= 100 ? String(numericValue) : null;\n}\n\nfunction normalizeMentionAttribute(value: string | undefined, maxLength: number): string | null {\n const normalized = value?.trim();\n if (!normalized || normalized.length > maxLength || /[<>\"'`]/.test(normalized)) {\n return null;\n }\n\n return normalized;\n}\n\nfunction normalizeTextAttribute(value: string | undefined, maxLength: number): string | null {\n const normalized = value?.trim();\n if (!normalized || normalized.length > maxLength) return null;\n return normalized;\n}\n\nfunction normalizeImageDimension(value: string | undefined): string | null {\n if (!value || !/^\\d{1,5}$/.test(value)) return null;\n const numericValue = Number(value);\n return numericValue >= 1 && numericValue <= 10_000 ? String(numericValue) : null;\n}\n\nfunction escapeHtmlAttribute(value: string): string {\n return value\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n}\n\nfunction decodeHtmlAttribute(value: string): string {\n return value.replace(/&(?:#(\\d+)|#x([0-9a-f]+)|(amp|quot|apos|lt|gt));/gi, (entity, decimal, hexadecimal, named) => {\n if (decimal || hexadecimal) {\n const codePoint = decimal ? Number(decimal) : Number.parseInt(hexadecimal, 16);\n if (!Number.isSafeInteger(codePoint) || codePoint <= 0 || codePoint > 0x10ffff || (codePoint >= 0xd800 && codePoint <= 0xdfff)) {\n return '\\ufffd';\n }\n return String.fromCodePoint(codePoint);\n }\n const namedEntity: Record<string, string> = {\n amp: '&',\n apos: \"'\",\n gt: '>',\n lt: '<',\n quot: '\"',\n };\n return namedEntity[String(named).toLowerCase()] ?? entity;\n });\n}\n","import { decodeRichTextEntities } from \"./entities\";\nimport { normalizeRichTextHtml } from \"./serializer\";\nimport { richTextVoidTags } from \"./schema\";\n\n/** Transient rendering tree. Persist the canonical HTML document, never this tree. */\nexport type RichTextViewNode =\n | { type: \"text\"; value: string }\n | {\n type: \"element\";\n tag: string;\n attributes: Readonly<Record<string, string>>;\n children: RichTextViewNode[];\n };\n/** Parses only schema-sanitized HTML, with bounded work and no DOM dependency. */\nexport function richTextHtmlToViewTree(value: string): RichTextViewNode[] {\n if (value.length > 1_000_000)\n throw new RangeError(\"Rich text exceeds the rendering limit\");\n const html = normalizeRichTextHtml(value).replace(/<!--[\\s\\S]*?-->/g, \"\");\n const root: RichTextViewNode[] = [];\n const stack: { tag: string; children: RichTextViewNode[] }[] = [\n { tag: \"\", children: root },\n ];\n let count = 0;\n const tokens =\n /<\\/?([a-z][a-z\\d-]*)\\b((?:\"[^\"]*\"|'[^']*'|[^'\">])*)>|([^<]+)|</gi;\n for (const match of html.matchAll(tokens)) {\n if (++count > 20_000 || stack.length > 64)\n throw new RangeError(\"Rich text exceeds the rendering complexity limit\");\n const current = stack[stack.length - 1]!;\n if (!match[1]) {\n current.children.push({ type: \"text\", value: decodeRichTextEntities(match[3] ?? \"<\") });\n continue;\n }\n const tag = match[1].toLowerCase();\n if (match[0].startsWith(\"</\")) {\n if (stack.length === 1 || current.tag !== tag)\n throw new Error(`Unbalanced rich-text closing tag ${tag}`);\n stack.pop();\n continue;\n }\n const attributes: Record<string, string> = {};\n for (const attribute of match[2]!.matchAll(/([\\w-]+)=\"([^\"]*)\"/g))\n attributes[attribute[1]!] = decodeRichTextEntities(attribute[2]!);\n const node: RichTextViewNode = {\n type: \"element\",\n tag,\n attributes,\n children: [],\n };\n current.children.push(node);\n if (!richTextVoidTags.some((voidTag) => voidTag === tag)) stack.push(node);\n }\n if (stack.length !== 1) throw new Error(\"Unclosed rich-text element\");\n return root;\n}\n","import type { RichTextDocumentSnapshot } from \"./content-types\";\nimport { QUICK_BUILDER_RICH_TEXT_SCHEMA_VERSION } from \"./schema\";\nimport {\n isSafeRichTextHref,\n isSafeRichTextImageSrc,\n richTextHtmlToPlainText,\n sanitizeRichTextMarkup,\n} from \"./serializer\";\n\nconst DEFAULT_MAX_MARKDOWN_LENGTH = 1_000_000;\nconst MAX_MARKDOWN_LENGTH = 5_000_000;\nconst INLINE_TOKEN_PREFIX = \"\\u0000qb-markdown-inline-\";\nconst HARD_BREAK_TOKEN = \"\\u0000qb-markdown-hard-break\\u0000\";\n\nexport type MarkdownLimitBehavior = \"throw\" | \"truncate\";\n\nexport interface MarkdownToRichTextOptions {\n /**\n * Bounds parser work for untrusted input. Defaults to one million UTF-16\n * code units and may not exceed five million.\n */\n maxLength?: number;\n /** Controls whether over-limit input is rejected or deterministically truncated. */\n limitBehavior?: MarkdownLimitBehavior;\n}\n\nexport type RichTextMarkdownBlock =\n | { type: \"html\"; html: string }\n | { type: \"code\"; value: string; language?: string };\n\nfunction assertMarkdownOptions(options: MarkdownToRichTextOptions): {\n limitBehavior: MarkdownLimitBehavior;\n maxLength: number;\n} {\n const maxLength = options.maxLength ?? DEFAULT_MAX_MARKDOWN_LENGTH;\n const limitBehavior = options.limitBehavior ?? \"throw\";\n\n if (\n !Number.isInteger(maxLength) ||\n maxLength < 1 ||\n maxLength > MAX_MARKDOWN_LENGTH\n ) {\n throw new Error(\n `Unsupported markdown maxLength \"${String(maxLength)}\". ` +\n `Use an integer from 1 to ${MAX_MARKDOWN_LENGTH}.`,\n );\n }\n if (limitBehavior !== \"throw\" && limitBehavior !== \"truncate\") {\n throw new Error(\n `Unsupported markdown limitBehavior \"${String(limitBehavior)}\". ` +\n 'Use \"throw\" or \"truncate\".',\n );\n }\n\n return { limitBehavior, maxLength };\n}\n\nfunction normalizeMarkdown(\n markdown: string,\n options: MarkdownToRichTextOptions,\n): string {\n if (typeof markdown !== \"string\") {\n throw new Error(\"Markdown content must be a string.\");\n }\n\n const { limitBehavior, maxLength } = assertMarkdownOptions(options);\n const normalized = markdown.replace(/\\u0000/g, \"\").replace(/\\r\\n?/g, \"\\n\");\n\n if (normalized.length <= maxLength) return normalized;\n if (limitBehavior === \"truncate\") return normalized.slice(0, maxLength);\n\n throw new Error(\n `Markdown content exceeds the configured ${maxLength} character limit.`,\n );\n}\n\nfunction escapeHtml(value: string): string {\n return value\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\");\n}\n\nfunction renderInlineMarkdown(value: string): string {\n const tokens: { html: string; text: string }[] = [];\n const protect = (html: string, text = html) => {\n const token = `${INLINE_TOKEN_PREFIX}${tokens.length}\\u0000`;\n tokens.push({ html, text });\n return token;\n };\n const restore = (source: string, format: \"html\" | \"text\") =>\n source.replace(\n /\\u0000qb-markdown-inline-(\\d+)\\u0000/g,\n (_match, index: string) => tokens[Number(index)]?.[format] ?? \"\",\n );\n // Protect complete inline constructs before interpreting emphasis. Only our\n // generated markup is restored, so source HTML never becomes executable.\n let source = value\n .replace(\n /\\\\([\\\\`*_[\\]{}()#+\\-.!|>~])|(`+)([\\s\\S]*?[^`])\\2(?!`)/g,\n (_match, character: string | undefined, _ticks: string | undefined, code: string | undefined) => {\n if (character !== undefined) return protect(escapeHtml(character), character);\n const text = code!.trim();\n return protect(`<code>${escapeHtml(text)}</code>`, text);\n },\n )\n .replace(\n /(!?)\\[([^\\]\\n]*)\\]\\(\\s*(<[^>\\n]+>|(?:[^\\s()]|\\([^()]*\\))+)(?:\\s+[\"']([^\"']*)[\"'])?\\s*\\)/g,\n (\n _match,\n image: string,\n label: string,\n destination: string,\n title: string | undefined,\n ) => {\n const url = restore(destination.replace(/^<|>$/g, \"\"), \"text\");\n if (image) {\n const alt = escapeHtml(restore(label, \"text\"));\n const description = title && escapeHtml(restore(title, \"text\"));\n return protect(\n isSafeRichTextImageSrc(url)\n ? `<img src=\"${escapeHtml(url)}\" alt=\"${alt}\"${description ? ` title=\"${description}\"` : \"\"}>`\n : alt,\n );\n }\n const labelHtml = restore(escapeHtml(label), \"html\");\n return protect(\n isSafeRichTextHref(url)\n ? `<a href=\"${escapeHtml(url)}\" target=\"_blank\">${labelHtml}</a>`\n : labelHtml,\n );\n },\n )\n .replace(\n /<(https?:\\/\\/[^<>\\s]+|mailto:[^<>\\s]+)>/gi,\n (_match, url: string) =>\n protect(\n isSafeRichTextHref(url)\n ? `<a href=\"${escapeHtml(url)}\" target=\"_blank\">${escapeHtml(url)}</a>`\n : escapeHtml(url),\n ),\n )\n .replace(/https?:\\/\\/[^\\s<>\\u0000]+/gi, (candidate: string) => {\n const url = candidate.replace(/[.,!?;:)]+$/, \"\");\n return isSafeRichTextHref(url)\n ? protect(\n `<a href=\"${escapeHtml(url)}\" target=\"_blank\">${escapeHtml(url)}</a>`,\n ) + candidate.slice(url.length)\n : candidate;\n });\n source = escapeHtml(source)\n .replace(/\\*\\*([^*\\n]+)\\*\\*/g, \"<strong>$1</strong>\")\n .replace(/__([^_\\n]+)__/g, \"<strong>$1</strong>\")\n .replace(/~~([^~\\n]+)~~/g, \"<s>$1</s>\")\n .replace(/(^|[^\\w])\\*([^*\\n]+)\\*(?!\\*)/g, \"$1<em>$2</em>\")\n .replace(/(^|[^\\w])_([^_\\n]+)_(?!_)/g, \"$1<em>$2</em>\");\n // A single pass prevents protected content from being parsed a second time.\n return restore(source, \"html\");\n}\n\nfunction splitTableRow(line: string): string[] {\n const trimmed = line.trim().replace(/^\\|/, \"\");\n const cells: string[] = [];\n let current = \"\";\n\n for (let index = 0; index < trimmed.length; index += 1) {\n const character = trimmed[index]!;\n const next = trimmed[index + 1];\n if (character === \"\\\\\" && (next === \"\\\\\" || next === \"|\")) {\n // Consume table separator escapes while leaving backslashes for inline parsing.\n current += next === \"|\" ? next : \"\\\\\\\\\";\n index += 1;\n } else if (character === \"|\") {\n cells.push(current.trim());\n if (index === trimmed.length - 1) return cells;\n current = \"\";\n } else {\n current += character;\n }\n }\n cells.push(current.trim());\n return cells;\n}\n\nfunction isTableSeparator(line: string): boolean {\n const cells = splitTableRow(line);\n return (\n cells.length > 0 &&\n cells.every((cell) => /^:?-{3,}:?$/.test(cell.replace(/\\s+/g, \"\")))\n );\n}\n\nfunction renderTable(\n lines: readonly string[],\n startIndex: number,\n): {\n html: string;\n nextIndex: number;\n} | null {\n const header = lines[startIndex];\n const separator = lines[startIndex + 1];\n if (\n header === undefined ||\n separator === undefined ||\n !header.includes(\"|\") ||\n !isTableSeparator(separator)\n ) {\n return null;\n }\n\n const headerCells = splitTableRow(header);\n const bodyRows: string[][] = [];\n let width = headerCells.length;\n let nextIndex = startIndex + 2;\n while (\n nextIndex < lines.length &&\n lines[nextIndex]?.trim() &&\n lines[nextIndex]?.includes(\"|\")\n ) {\n const row = splitTableRow(lines[nextIndex]!);\n bodyRows.push(row);\n width = Math.max(width, row.length);\n nextIndex += 1;\n }\n\n const normalizeRow = (row: readonly string[]) =>\n Array.from({ length: width }, (_unused, index) => row[index] ?? \"\");\n const head = normalizeRow(headerCells)\n .map((cell) => `<th scope=\"col\">${renderInlineMarkdown(cell)}</th>`)\n .join(\"\");\n const body = bodyRows\n .map(\n (row) =>\n `<tr>${normalizeRow(row)\n .map((cell) => `<td>${renderInlineMarkdown(cell)}</td>`)\n .join(\"\")}</tr>`,\n )\n .join(\"\");\n\n return {\n html:\n `<table><thead><tr>${head}</tr></thead>` +\n `${body ? `<tbody>${body}</tbody>` : \"\"}</table>`,\n nextIndex,\n };\n}\n\nconst listPattern = /^( *)(?:(\\d+)[.)]|[-+*]) +(.*)$/;\n\nfunction serializeBlocks(blocks: readonly RichTextMarkdownBlock[]): string {\n return blocks\n .map((block) =>\n block.type === \"html\"\n ? block.html\n : `<pre><code>${escapeHtml(block.value)}</code></pre>`,\n )\n .join(\"\");\n}\n\nfunction parseBlocks(\n lines: readonly string[],\n depth = 0,\n): RichTextMarkdownBlock[] {\n if (depth > 48)\n throw new Error(\"Markdown nesting exceeds the supported 48 levels.\");\n const blocks: RichTextMarkdownBlock[] = [];\n const paragraph: string[] = [];\n const pushHtml = (html: string) =>\n blocks.push({ type: \"html\", html: sanitizeRichTextMarkup(html) });\n const flush = () => {\n if (!paragraph.length) return;\n pushHtml(\n `<p>${paragraph\n .map((line) => renderInlineMarkdown(line.trim()))\n .join(\" \")\n .split(HARD_BREAK_TOKEN)\n .join(\"<br>\")}</p>`,\n );\n paragraph.length = 0;\n };\n for (let index = 0; index < lines.length; index += 1) {\n const line = lines[index] ?? \"\";\n const trimmed = line.trim();\n if (!trimmed) {\n flush();\n continue;\n }\n const fence = /^ {0,3}(`{3,}|~{3,})([^\\n]*)$/.exec(line);\n if (fence && !(fence[1]!.startsWith(\"`\") && fence[2]!.includes(\"`\"))) {\n flush();\n const marker = fence[1]!;\n const language = fence[2]!.trim().split(/\\s+/)[0];\n const code: string[] = [];\n const closing = new RegExp(`^ {0,3}${marker[0]}{${marker.length},} *$`);\n index += 1;\n for (; index < lines.length && !closing.test(lines[index]!); index += 1)\n code.push(lines[index]!);\n // An unclosed fence owns the remaining content, including during a stream.\n blocks.push({\n type: \"code\",\n value: code.join(\"\\n\"),\n language: language || undefined,\n });\n continue;\n }\n const table = renderTable(lines, index);\n if (table) {\n flush();\n pushHtml(table.html);\n index = table.nextIndex - 1;\n continue;\n }\n const heading = /^(#{1,6})\\s+(.+?)\\s*#*$/.exec(trimmed);\n if (heading) {\n flush();\n const level = heading[1]!.length;\n pushHtml(`<h${level}>${renderInlineMarkdown(heading[2]!)}</h${level}>`);\n continue;\n }\n if (/^(?:-{3,}|\\*{3,}|_{3,})$/.test(trimmed.replace(/\\s+/g, \"\"))) {\n flush();\n pushHtml(\"<hr>\");\n continue;\n }\n if (/^>/.test(trimmed)) {\n flush();\n const quote: string[] = [];\n while (index < lines.length && /^\\s*>/.test(lines[index]!)) {\n quote.push(lines[index]!.replace(/^\\s*> ?/, \"\"));\n index += 1;\n }\n index -= 1;\n pushHtml(\n `<blockquote>${serializeBlocks(parseBlocks(quote, depth + 1))}</blockquote>`,\n );\n continue;\n }\n const firstItem = listPattern.exec(line);\n if (firstItem) {\n flush();\n const indent = firstItem[1]!.length;\n const ordered = firstItem[2] !== undefined;\n const items: string[] = [];\n let hasTasks = false;\n while (index < lines.length) {\n const item = listPattern.exec(lines[index]!);\n if (\n !item ||\n item[1]!.length !== indent ||\n (item[2] !== undefined) !== ordered\n )\n break;\n const contentIndent = lines[index]!.length - item[3]!.length;\n const task = /^\\[([ xX])\\] +(.*)$/.exec(item[3]!);\n const content = task ? task[2]! : item[3]!;\n if (task) hasTasks = true;\n const continuation: string[] = [];\n index += 1;\n for (; index < lines.length; index += 1) {\n const next = lines[index]!;\n if (!next.trim()) {\n if (\n (/^ */.exec(lines[index + 1] ?? \"\")?.[0].length ?? 0) >=\n contentIndent\n ) {\n continuation.push(\"\");\n continue;\n }\n break;\n }\n const spaces = /^ */.exec(next)![0].length;\n if (spaces < contentIndent) break;\n continuation.push(next.slice(contentIndent));\n }\n const nested = continuation.length\n ? serializeBlocks(parseBlocks(continuation, depth + 1))\n : \"\";\n const checked = task?.[1]?.toLowerCase() === \"x\";\n const label = task\n ? `<label><input type=\"checkbox\"${checked ? ' checked=\"\"' : \"\"}>${renderInlineMarkdown(content)}</label>`\n : renderInlineMarkdown(content);\n items.push(\n `<li${task ? ` data-checked=\"${checked}\"` : \"\"}>${label}${nested}</li>`,\n );\n }\n index -= 1;\n const tag = ordered ? \"ol\" : \"ul\";\n pushHtml(\n `<${tag}${hasTasks && !ordered ? ' data-task-list=\"true\"' : \"\"}>${items.join(\"\")}</${tag}>`,\n );\n continue;\n }\n paragraph.push(\n / {2,}$/.test(line) ? `${line.trimEnd()}${HARD_BREAK_TOKEN}` : line,\n );\n }\n flush();\n return blocks;\n}\n\n/**\n * Parses governed Markdown into sanitized blocks, preserving top-level fenced\n * code as data for viewer code-block components. No DOM or React is required.\n * Supports headings, paragraphs, quotes, nested lists, tasks, fenced code,\n * tables, links, images, autolinks, emphasis, strike and inline code. Raw HTML\n * is displayed as text. Work and nesting limits also apply to streaming input.\n */\nexport function markdownToRichTextBlocks(\n markdown: string,\n options: MarkdownToRichTextOptions = {},\n): RichTextMarkdownBlock[] {\n return parseBlocks(normalizeMarkdown(markdown, options).split(\"\\n\"));\n}\n\nexport function markdownToRichTextHtml(\n markdown: string,\n options: MarkdownToRichTextOptions = {},\n): string {\n return serializeBlocks(markdownToRichTextBlocks(markdown, options));\n}\n\nexport function createRichTextDocumentFromMarkdown(\n markdown: string,\n options: MarkdownToRichTextOptions = {},\n): RichTextDocumentSnapshot {\n const html = markdownToRichTextHtml(markdown, options);\n return {\n html,\n plainText: richTextHtmlToPlainText(html),\n schemaVersion: QUICK_BUILDER_RICH_TEXT_SCHEMA_VERSION,\n };\n}\n"]}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { h as RichTextInlineTag, j as RichTextListTag, c as RichTextBlockTag, R as RichTextAlignment, e as RichTextDocumentSnapshot, a as RichTextBlockFormat } from './content-types-CYHsrMrs.mjs';
|
|
2
|
+
export { b as RichTextBlockFormatDefinition, d as RichTextColor, f as RichTextFontFamily, g as RichTextFontSize, i as RichTextLineHeight, k as RichTextTypographyState } from './content-types-CYHsrMrs.mjs';
|
|
3
|
+
|
|
4
|
+
type RichTextCommand = 'undo' | 'redo' | 'bold' | 'italic' | 'underline' | 'strike' | 'inlineCode' | 'highlight' | 'subscript' | 'superscript' | 'link' | 'bulletedList' | 'numberedList' | 'taskList' | 'blockquote' | 'horizontalRule' | 'findReplace' | 'clearFormatting' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify';
|
|
5
|
+
type RichTextTableCommand = 'insertTable' | 'deleteTable' | 'addTableRow' | 'deleteTableRow' | 'addTableColumn' | 'deleteTableColumn';
|
|
6
|
+
type RichTextMentionItem = {
|
|
7
|
+
avatarText?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
type RichTextMentionQuery = {
|
|
13
|
+
active: boolean;
|
|
14
|
+
query: string;
|
|
15
|
+
range: Range | null;
|
|
16
|
+
};
|
|
17
|
+
type RichTextCollaborationPresence = {
|
|
18
|
+
color: string;
|
|
19
|
+
documentId: string;
|
|
20
|
+
selection: RichTextSelectionSnapshot | null;
|
|
21
|
+
userId: string;
|
|
22
|
+
userName: string;
|
|
23
|
+
};
|
|
24
|
+
type RichTextCollaborationSnapshot = {
|
|
25
|
+
documentId: string;
|
|
26
|
+
localUserId: string;
|
|
27
|
+
presences: readonly RichTextCollaborationPresence[];
|
|
28
|
+
};
|
|
29
|
+
type RichTextAiAssistantAction = 'improve-writing' | 'fix-spelling' | 'shorten' | 'expand' | 'summarize';
|
|
30
|
+
type RichTextAiAssistantRequest = {
|
|
31
|
+
action: RichTextAiAssistantAction;
|
|
32
|
+
document: RichTextDocumentSnapshot;
|
|
33
|
+
providerId?: string;
|
|
34
|
+
selectedText: string;
|
|
35
|
+
};
|
|
36
|
+
type RichTextAiAssistantSuggestion = {
|
|
37
|
+
action: RichTextAiAssistantAction;
|
|
38
|
+
document: RichTextDocumentSnapshot;
|
|
39
|
+
id: string;
|
|
40
|
+
};
|
|
41
|
+
type RichTextAiAssistantApplyMode = 'replace-document' | 'replace-selection' | 'insert-after-selection';
|
|
42
|
+
type RichTextSlashCommand = 'heading1' | 'heading2' | 'heading3' | 'paragraph' | 'blockquote' | 'bulletedList' | 'numberedList' | 'taskList' | 'codeBlock' | 'horizontalRule' | 'table';
|
|
43
|
+
type RichTextSlashCommandGroup = 'format' | 'insert';
|
|
44
|
+
type RichTextSlashCommandDefinition = {
|
|
45
|
+
command: RichTextSlashCommand;
|
|
46
|
+
group: RichTextSlashCommandGroup;
|
|
47
|
+
keywords: readonly string[];
|
|
48
|
+
label: string;
|
|
49
|
+
};
|
|
50
|
+
type RichTextSlashCommandQuery = {
|
|
51
|
+
active: boolean;
|
|
52
|
+
query: string;
|
|
53
|
+
range: Range | null;
|
|
54
|
+
};
|
|
55
|
+
type RichTextTableNavigationDirection = 'next-cell' | 'previous-cell' | 'up' | 'down' | 'left' | 'right';
|
|
56
|
+
type RichTextTableKeyboardNavigationEvent = {
|
|
57
|
+
key: string;
|
|
58
|
+
preventDefault: () => void;
|
|
59
|
+
shiftKey?: boolean;
|
|
60
|
+
};
|
|
61
|
+
type RichTextTableKeyboardNavigationResult = {
|
|
62
|
+
changed: boolean;
|
|
63
|
+
handled: boolean;
|
|
64
|
+
};
|
|
65
|
+
type RichTextCommandGroup = 'history' | 'inline' | 'structure' | 'alignment' | 'tools';
|
|
66
|
+
type RichTextSearchOptions = {
|
|
67
|
+
matchCase?: boolean;
|
|
68
|
+
wholeWord?: boolean;
|
|
69
|
+
};
|
|
70
|
+
type RichTextSearchResult = {
|
|
71
|
+
activeIndex: number;
|
|
72
|
+
count: number;
|
|
73
|
+
};
|
|
74
|
+
type RichTextImage = {
|
|
75
|
+
alt: string;
|
|
76
|
+
/** Uses same-origin credentials and anonymous cross-origin image requests. */
|
|
77
|
+
crossOrigin?: 'anonymous';
|
|
78
|
+
/** Explicitly marks an image as decorative. Decorative images must use an empty alt value. */
|
|
79
|
+
decorative?: boolean;
|
|
80
|
+
height?: number;
|
|
81
|
+
src: string;
|
|
82
|
+
title?: string;
|
|
83
|
+
width?: number;
|
|
84
|
+
};
|
|
85
|
+
type RichTextReplaceResult = RichTextSearchResult & {
|
|
86
|
+
replaced: number;
|
|
87
|
+
};
|
|
88
|
+
type RichTextCommandDefinition = {
|
|
89
|
+
command: RichTextCommand;
|
|
90
|
+
group: RichTextCommandGroup;
|
|
91
|
+
inlineTagName?: RichTextInlineTag;
|
|
92
|
+
listTagName?: RichTextListTag;
|
|
93
|
+
taskList?: boolean;
|
|
94
|
+
blockTagName?: Extract<RichTextBlockTag, 'blockquote'>;
|
|
95
|
+
alignment?: RichTextAlignment;
|
|
96
|
+
};
|
|
97
|
+
type RichTextEditorState = {
|
|
98
|
+
activeCommands: Set<RichTextCommand>;
|
|
99
|
+
alignment: RichTextAlignment;
|
|
100
|
+
blockFormat: RichTextBlockFormat;
|
|
101
|
+
};
|
|
102
|
+
type RichTextHistory = {
|
|
103
|
+
entries: string[];
|
|
104
|
+
index: number;
|
|
105
|
+
/** Maximum retained snapshots, including the current document. */
|
|
106
|
+
maxEntries?: number;
|
|
107
|
+
};
|
|
108
|
+
type RichTextSelectionDirection = 'forward' | 'backward' | 'none';
|
|
109
|
+
type RichTextSelectionSnapshot = {
|
|
110
|
+
anchorOffset: number;
|
|
111
|
+
focusOffset: number;
|
|
112
|
+
collapsed: boolean;
|
|
113
|
+
direction: RichTextSelectionDirection;
|
|
114
|
+
anchorPath?: readonly number[];
|
|
115
|
+
focusPath?: readonly number[];
|
|
116
|
+
};
|
|
117
|
+
type RichTextTransactionKind = 'initialize' | 'set-html' | 'paste-html' | 'apply-command' | 'undo' | 'redo' | 'sync-selection';
|
|
118
|
+
type RichTextTransactionSource = 'api' | 'user' | 'history' | 'paste' | 'command';
|
|
119
|
+
type RichTextRuntimeState = {
|
|
120
|
+
activeCommands: readonly RichTextCommand[];
|
|
121
|
+
alignment: RichTextAlignment;
|
|
122
|
+
blockFormat: RichTextBlockFormat;
|
|
123
|
+
document: RichTextDocumentSnapshot;
|
|
124
|
+
history: RichTextHistory;
|
|
125
|
+
lastTransactionId: string;
|
|
126
|
+
selection: RichTextSelectionSnapshot | null;
|
|
127
|
+
version: number;
|
|
128
|
+
};
|
|
129
|
+
type RichTextTransaction = {
|
|
130
|
+
addToHistory?: boolean;
|
|
131
|
+
command?: RichTextCommand;
|
|
132
|
+
editorState?: RichTextEditorState;
|
|
133
|
+
html?: string;
|
|
134
|
+
kind: RichTextTransactionKind;
|
|
135
|
+
maxHistoryEntries?: number;
|
|
136
|
+
selection?: RichTextSelectionSnapshot | null;
|
|
137
|
+
source?: RichTextTransactionSource;
|
|
138
|
+
transactionId?: string;
|
|
139
|
+
};
|
|
140
|
+
type RichTextTransactionResult = {
|
|
141
|
+
changed: boolean;
|
|
142
|
+
historyChanged: boolean;
|
|
143
|
+
state: RichTextRuntimeState;
|
|
144
|
+
transaction: Required<Pick<RichTextTransaction, 'kind' | 'source'>> & {
|
|
145
|
+
command?: RichTextCommand;
|
|
146
|
+
transactionId: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
type RichTextFramework = 'react' | 'next' | 'vue' | 'nuxt' | 'angular' | 'astro' | 'svelte' | 'solid' | 'qwik' | 'preact' | 'react-native' | 'webcomponents';
|
|
150
|
+
type RichTextBindingOptions = {
|
|
151
|
+
id?: string;
|
|
152
|
+
className?: string;
|
|
153
|
+
value?: string;
|
|
154
|
+
plainText?: string;
|
|
155
|
+
editable?: boolean;
|
|
156
|
+
placeholder?: string;
|
|
157
|
+
disabled?: boolean;
|
|
158
|
+
schemaVersion?: number;
|
|
159
|
+
};
|
|
160
|
+
type RichTextBinding = {
|
|
161
|
+
target: RichTextFramework;
|
|
162
|
+
attributes: Record<string, string>;
|
|
163
|
+
props?: Record<string, string | boolean | undefined>;
|
|
164
|
+
binding?: {
|
|
165
|
+
attrs: Record<string, string>;
|
|
166
|
+
class?: string;
|
|
167
|
+
};
|
|
168
|
+
hostBinding?: {
|
|
169
|
+
attributes: Record<string, string>;
|
|
170
|
+
className?: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
type RichTextExtensionId = 'tables' | 'mentions' | 'slash-commands' | 'pages' | 'collaboration' | 'ai-assistant';
|
|
174
|
+
type RichTextExtensionTier = 'community' | 'pro';
|
|
175
|
+
type RichTextExtensionAvailability = 'registered' | 'planned';
|
|
176
|
+
type RichTextExtensionCommandGroup = 'insert' | 'structure' | 'navigation' | 'collaboration' | 'assistant';
|
|
177
|
+
type RichTextExtensionCommandDefinition = {
|
|
178
|
+
command: string;
|
|
179
|
+
label: string;
|
|
180
|
+
group: RichTextExtensionCommandGroup;
|
|
181
|
+
};
|
|
182
|
+
type RichTextExtensionSchema = {
|
|
183
|
+
nodes: readonly string[];
|
|
184
|
+
marks?: readonly string[];
|
|
185
|
+
};
|
|
186
|
+
type RichTextExtensionDefinition = {
|
|
187
|
+
id: RichTextExtensionId;
|
|
188
|
+
label: string;
|
|
189
|
+
tier: RichTextExtensionTier;
|
|
190
|
+
availability: RichTextExtensionAvailability;
|
|
191
|
+
schema: RichTextExtensionSchema;
|
|
192
|
+
commands: readonly RichTextExtensionCommandDefinition[];
|
|
193
|
+
};
|
|
194
|
+
type RichTextExtensionRegistry = {
|
|
195
|
+
extensions: readonly RichTextExtensionDefinition[];
|
|
196
|
+
ids: readonly RichTextExtensionId[];
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export { type RichTextAiAssistantAction, type RichTextAiAssistantApplyMode, type RichTextAiAssistantRequest, type RichTextAiAssistantSuggestion, RichTextAlignment, type RichTextBinding, type RichTextBindingOptions, RichTextBlockFormat, RichTextBlockTag, type RichTextCollaborationPresence, type RichTextCollaborationSnapshot, type RichTextCommand, type RichTextCommandDefinition, type RichTextCommandGroup, RichTextDocumentSnapshot, type RichTextEditorState, type RichTextExtensionAvailability, type RichTextExtensionCommandDefinition, type RichTextExtensionCommandGroup, type RichTextExtensionDefinition, type RichTextExtensionId, type RichTextExtensionRegistry, type RichTextExtensionSchema, type RichTextExtensionTier, type RichTextFramework, type RichTextHistory, type RichTextImage, RichTextInlineTag, RichTextListTag, type RichTextMentionItem, type RichTextMentionQuery, type RichTextReplaceResult, type RichTextRuntimeState, type RichTextSearchOptions, type RichTextSearchResult, type RichTextSelectionDirection, type RichTextSelectionSnapshot, type RichTextSlashCommand, type RichTextSlashCommandDefinition, type RichTextSlashCommandGroup, type RichTextSlashCommandQuery, type RichTextTableCommand, type RichTextTableKeyboardNavigationEvent, type RichTextTableKeyboardNavigationResult, type RichTextTableNavigationDirection, type RichTextTransaction, type RichTextTransactionKind, type RichTextTransactionResult, type RichTextTransactionSource };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { h as RichTextInlineTag, j as RichTextListTag, c as RichTextBlockTag, R as RichTextAlignment, e as RichTextDocumentSnapshot, a as RichTextBlockFormat } from './content-types-CYHsrMrs.js';
|
|
2
|
+
export { b as RichTextBlockFormatDefinition, d as RichTextColor, f as RichTextFontFamily, g as RichTextFontSize, i as RichTextLineHeight, k as RichTextTypographyState } from './content-types-CYHsrMrs.js';
|
|
3
|
+
|
|
4
|
+
type RichTextCommand = 'undo' | 'redo' | 'bold' | 'italic' | 'underline' | 'strike' | 'inlineCode' | 'highlight' | 'subscript' | 'superscript' | 'link' | 'bulletedList' | 'numberedList' | 'taskList' | 'blockquote' | 'horizontalRule' | 'findReplace' | 'clearFormatting' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify';
|
|
5
|
+
type RichTextTableCommand = 'insertTable' | 'deleteTable' | 'addTableRow' | 'deleteTableRow' | 'addTableColumn' | 'deleteTableColumn';
|
|
6
|
+
type RichTextMentionItem = {
|
|
7
|
+
avatarText?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
type RichTextMentionQuery = {
|
|
13
|
+
active: boolean;
|
|
14
|
+
query: string;
|
|
15
|
+
range: Range | null;
|
|
16
|
+
};
|
|
17
|
+
type RichTextCollaborationPresence = {
|
|
18
|
+
color: string;
|
|
19
|
+
documentId: string;
|
|
20
|
+
selection: RichTextSelectionSnapshot | null;
|
|
21
|
+
userId: string;
|
|
22
|
+
userName: string;
|
|
23
|
+
};
|
|
24
|
+
type RichTextCollaborationSnapshot = {
|
|
25
|
+
documentId: string;
|
|
26
|
+
localUserId: string;
|
|
27
|
+
presences: readonly RichTextCollaborationPresence[];
|
|
28
|
+
};
|
|
29
|
+
type RichTextAiAssistantAction = 'improve-writing' | 'fix-spelling' | 'shorten' | 'expand' | 'summarize';
|
|
30
|
+
type RichTextAiAssistantRequest = {
|
|
31
|
+
action: RichTextAiAssistantAction;
|
|
32
|
+
document: RichTextDocumentSnapshot;
|
|
33
|
+
providerId?: string;
|
|
34
|
+
selectedText: string;
|
|
35
|
+
};
|
|
36
|
+
type RichTextAiAssistantSuggestion = {
|
|
37
|
+
action: RichTextAiAssistantAction;
|
|
38
|
+
document: RichTextDocumentSnapshot;
|
|
39
|
+
id: string;
|
|
40
|
+
};
|
|
41
|
+
type RichTextAiAssistantApplyMode = 'replace-document' | 'replace-selection' | 'insert-after-selection';
|
|
42
|
+
type RichTextSlashCommand = 'heading1' | 'heading2' | 'heading3' | 'paragraph' | 'blockquote' | 'bulletedList' | 'numberedList' | 'taskList' | 'codeBlock' | 'horizontalRule' | 'table';
|
|
43
|
+
type RichTextSlashCommandGroup = 'format' | 'insert';
|
|
44
|
+
type RichTextSlashCommandDefinition = {
|
|
45
|
+
command: RichTextSlashCommand;
|
|
46
|
+
group: RichTextSlashCommandGroup;
|
|
47
|
+
keywords: readonly string[];
|
|
48
|
+
label: string;
|
|
49
|
+
};
|
|
50
|
+
type RichTextSlashCommandQuery = {
|
|
51
|
+
active: boolean;
|
|
52
|
+
query: string;
|
|
53
|
+
range: Range | null;
|
|
54
|
+
};
|
|
55
|
+
type RichTextTableNavigationDirection = 'next-cell' | 'previous-cell' | 'up' | 'down' | 'left' | 'right';
|
|
56
|
+
type RichTextTableKeyboardNavigationEvent = {
|
|
57
|
+
key: string;
|
|
58
|
+
preventDefault: () => void;
|
|
59
|
+
shiftKey?: boolean;
|
|
60
|
+
};
|
|
61
|
+
type RichTextTableKeyboardNavigationResult = {
|
|
62
|
+
changed: boolean;
|
|
63
|
+
handled: boolean;
|
|
64
|
+
};
|
|
65
|
+
type RichTextCommandGroup = 'history' | 'inline' | 'structure' | 'alignment' | 'tools';
|
|
66
|
+
type RichTextSearchOptions = {
|
|
67
|
+
matchCase?: boolean;
|
|
68
|
+
wholeWord?: boolean;
|
|
69
|
+
};
|
|
70
|
+
type RichTextSearchResult = {
|
|
71
|
+
activeIndex: number;
|
|
72
|
+
count: number;
|
|
73
|
+
};
|
|
74
|
+
type RichTextImage = {
|
|
75
|
+
alt: string;
|
|
76
|
+
/** Uses same-origin credentials and anonymous cross-origin image requests. */
|
|
77
|
+
crossOrigin?: 'anonymous';
|
|
78
|
+
/** Explicitly marks an image as decorative. Decorative images must use an empty alt value. */
|
|
79
|
+
decorative?: boolean;
|
|
80
|
+
height?: number;
|
|
81
|
+
src: string;
|
|
82
|
+
title?: string;
|
|
83
|
+
width?: number;
|
|
84
|
+
};
|
|
85
|
+
type RichTextReplaceResult = RichTextSearchResult & {
|
|
86
|
+
replaced: number;
|
|
87
|
+
};
|
|
88
|
+
type RichTextCommandDefinition = {
|
|
89
|
+
command: RichTextCommand;
|
|
90
|
+
group: RichTextCommandGroup;
|
|
91
|
+
inlineTagName?: RichTextInlineTag;
|
|
92
|
+
listTagName?: RichTextListTag;
|
|
93
|
+
taskList?: boolean;
|
|
94
|
+
blockTagName?: Extract<RichTextBlockTag, 'blockquote'>;
|
|
95
|
+
alignment?: RichTextAlignment;
|
|
96
|
+
};
|
|
97
|
+
type RichTextEditorState = {
|
|
98
|
+
activeCommands: Set<RichTextCommand>;
|
|
99
|
+
alignment: RichTextAlignment;
|
|
100
|
+
blockFormat: RichTextBlockFormat;
|
|
101
|
+
};
|
|
102
|
+
type RichTextHistory = {
|
|
103
|
+
entries: string[];
|
|
104
|
+
index: number;
|
|
105
|
+
/** Maximum retained snapshots, including the current document. */
|
|
106
|
+
maxEntries?: number;
|
|
107
|
+
};
|
|
108
|
+
type RichTextSelectionDirection = 'forward' | 'backward' | 'none';
|
|
109
|
+
type RichTextSelectionSnapshot = {
|
|
110
|
+
anchorOffset: number;
|
|
111
|
+
focusOffset: number;
|
|
112
|
+
collapsed: boolean;
|
|
113
|
+
direction: RichTextSelectionDirection;
|
|
114
|
+
anchorPath?: readonly number[];
|
|
115
|
+
focusPath?: readonly number[];
|
|
116
|
+
};
|
|
117
|
+
type RichTextTransactionKind = 'initialize' | 'set-html' | 'paste-html' | 'apply-command' | 'undo' | 'redo' | 'sync-selection';
|
|
118
|
+
type RichTextTransactionSource = 'api' | 'user' | 'history' | 'paste' | 'command';
|
|
119
|
+
type RichTextRuntimeState = {
|
|
120
|
+
activeCommands: readonly RichTextCommand[];
|
|
121
|
+
alignment: RichTextAlignment;
|
|
122
|
+
blockFormat: RichTextBlockFormat;
|
|
123
|
+
document: RichTextDocumentSnapshot;
|
|
124
|
+
history: RichTextHistory;
|
|
125
|
+
lastTransactionId: string;
|
|
126
|
+
selection: RichTextSelectionSnapshot | null;
|
|
127
|
+
version: number;
|
|
128
|
+
};
|
|
129
|
+
type RichTextTransaction = {
|
|
130
|
+
addToHistory?: boolean;
|
|
131
|
+
command?: RichTextCommand;
|
|
132
|
+
editorState?: RichTextEditorState;
|
|
133
|
+
html?: string;
|
|
134
|
+
kind: RichTextTransactionKind;
|
|
135
|
+
maxHistoryEntries?: number;
|
|
136
|
+
selection?: RichTextSelectionSnapshot | null;
|
|
137
|
+
source?: RichTextTransactionSource;
|
|
138
|
+
transactionId?: string;
|
|
139
|
+
};
|
|
140
|
+
type RichTextTransactionResult = {
|
|
141
|
+
changed: boolean;
|
|
142
|
+
historyChanged: boolean;
|
|
143
|
+
state: RichTextRuntimeState;
|
|
144
|
+
transaction: Required<Pick<RichTextTransaction, 'kind' | 'source'>> & {
|
|
145
|
+
command?: RichTextCommand;
|
|
146
|
+
transactionId: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
type RichTextFramework = 'react' | 'next' | 'vue' | 'nuxt' | 'angular' | 'astro' | 'svelte' | 'solid' | 'qwik' | 'preact' | 'react-native' | 'webcomponents';
|
|
150
|
+
type RichTextBindingOptions = {
|
|
151
|
+
id?: string;
|
|
152
|
+
className?: string;
|
|
153
|
+
value?: string;
|
|
154
|
+
plainText?: string;
|
|
155
|
+
editable?: boolean;
|
|
156
|
+
placeholder?: string;
|
|
157
|
+
disabled?: boolean;
|
|
158
|
+
schemaVersion?: number;
|
|
159
|
+
};
|
|
160
|
+
type RichTextBinding = {
|
|
161
|
+
target: RichTextFramework;
|
|
162
|
+
attributes: Record<string, string>;
|
|
163
|
+
props?: Record<string, string | boolean | undefined>;
|
|
164
|
+
binding?: {
|
|
165
|
+
attrs: Record<string, string>;
|
|
166
|
+
class?: string;
|
|
167
|
+
};
|
|
168
|
+
hostBinding?: {
|
|
169
|
+
attributes: Record<string, string>;
|
|
170
|
+
className?: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
type RichTextExtensionId = 'tables' | 'mentions' | 'slash-commands' | 'pages' | 'collaboration' | 'ai-assistant';
|
|
174
|
+
type RichTextExtensionTier = 'community' | 'pro';
|
|
175
|
+
type RichTextExtensionAvailability = 'registered' | 'planned';
|
|
176
|
+
type RichTextExtensionCommandGroup = 'insert' | 'structure' | 'navigation' | 'collaboration' | 'assistant';
|
|
177
|
+
type RichTextExtensionCommandDefinition = {
|
|
178
|
+
command: string;
|
|
179
|
+
label: string;
|
|
180
|
+
group: RichTextExtensionCommandGroup;
|
|
181
|
+
};
|
|
182
|
+
type RichTextExtensionSchema = {
|
|
183
|
+
nodes: readonly string[];
|
|
184
|
+
marks?: readonly string[];
|
|
185
|
+
};
|
|
186
|
+
type RichTextExtensionDefinition = {
|
|
187
|
+
id: RichTextExtensionId;
|
|
188
|
+
label: string;
|
|
189
|
+
tier: RichTextExtensionTier;
|
|
190
|
+
availability: RichTextExtensionAvailability;
|
|
191
|
+
schema: RichTextExtensionSchema;
|
|
192
|
+
commands: readonly RichTextExtensionCommandDefinition[];
|
|
193
|
+
};
|
|
194
|
+
type RichTextExtensionRegistry = {
|
|
195
|
+
extensions: readonly RichTextExtensionDefinition[];
|
|
196
|
+
ids: readonly RichTextExtensionId[];
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export { type RichTextAiAssistantAction, type RichTextAiAssistantApplyMode, type RichTextAiAssistantRequest, type RichTextAiAssistantSuggestion, RichTextAlignment, type RichTextBinding, type RichTextBindingOptions, RichTextBlockFormat, RichTextBlockTag, type RichTextCollaborationPresence, type RichTextCollaborationSnapshot, type RichTextCommand, type RichTextCommandDefinition, type RichTextCommandGroup, RichTextDocumentSnapshot, type RichTextEditorState, type RichTextExtensionAvailability, type RichTextExtensionCommandDefinition, type RichTextExtensionCommandGroup, type RichTextExtensionDefinition, type RichTextExtensionId, type RichTextExtensionRegistry, type RichTextExtensionSchema, type RichTextExtensionTier, type RichTextFramework, type RichTextHistory, type RichTextImage, RichTextInlineTag, RichTextListTag, type RichTextMentionItem, type RichTextMentionQuery, type RichTextReplaceResult, type RichTextRuntimeState, type RichTextSearchOptions, type RichTextSearchResult, type RichTextSelectionDirection, type RichTextSelectionSnapshot, type RichTextSlashCommand, type RichTextSlashCommandDefinition, type RichTextSlashCommandGroup, type RichTextSlashCommandQuery, type RichTextTableCommand, type RichTextTableKeyboardNavigationEvent, type RichTextTableKeyboardNavigationResult, type RichTextTableNavigationDirection, type RichTextTransaction, type RichTextTransactionKind, type RichTextTransactionResult, type RichTextTransactionSource };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"contracts.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"contracts.mjs"}
|