@payloadcms/richtext-lexical 4.0.0-internal.38b7f1d → 4.0.0-internal.5f0cd13
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/dist/cell/rscEntry.d.ts +1 -1
- package/dist/cell/rscEntry.d.ts.map +1 -1
- package/dist/cell/rscEntry.js.map +1 -1
- package/dist/exports/client/{Field-PJW7KUJG.js → Field-G5Z2HM5Y.js} +2 -2
- package/dist/exports/client/Field-G5Z2HM5Y.js.map +7 -0
- package/dist/exports/client/{RelationshipComponent-5RONAYJM.js → RelationshipComponent-YCPAKOL7.js} +2 -2
- package/dist/exports/client/RelationshipComponent-YCPAKOL7.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/{chunk-QJ5EETIB.js → chunk-6QWQ7JV4.js} +2 -2
- package/dist/exports/client/{chunk-FTT5KJ6W.js → chunk-LH634DPU.js} +1 -1
- package/dist/exports/client/chunk-LH634DPU.js.map +7 -0
- package/dist/exports/client/{chunk-BZZVLW4U.js → chunk-RJ5MAOKZ.js} +1 -1
- package/dist/exports/client/chunk-RJ5MAOKZ.js.map +7 -0
- package/dist/exports/client/{chunk-44G3K3W7.js → chunk-UAKNDD6R.js} +2 -2
- package/dist/exports/client/chunk-UAKNDD6R.js.map +7 -0
- package/dist/exports/client/component-HKTAZ77E.js +2 -0
- package/dist/exports/client/component-HKTAZ77E.js.map +7 -0
- package/dist/exports/client/componentInline-D3A6OW76.js +2 -0
- package/dist/exports/client/index.js +16 -16
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/react/index.d.ts +1 -1
- package/dist/exports/react/index.d.ts.map +1 -1
- package/dist/exports/react/index.js.map +1 -1
- package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
- package/dist/features/blockquote/server/index.d.ts +1 -4
- package/dist/features/blockquote/server/index.d.ts.map +1 -1
- package/dist/features/blockquote/server/index.js +2 -0
- package/dist/features/blockquote/server/index.js.map +1 -1
- package/dist/features/blockquote/server/schema.d.ts +8 -0
- package/dist/features/blockquote/server/schema.d.ts.map +1 -0
- package/dist/features/blockquote/server/schema.js +15 -0
- package/dist/features/blockquote/server/schema.js.map +1 -0
- package/dist/features/blocks/client/component/index.d.ts +2 -2
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +2 -2
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.d.ts +2 -2
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +2 -2
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
- package/dist/features/blocks/client/markdown/markdownTransformer.js +4 -4
- package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts +2 -2
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +2 -2
- package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/blocks/client/plugin/index.d.ts +1 -1
- package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
- package/dist/features/blocks/client/plugin/index.js.map +1 -1
- package/dist/features/blocks/server/graphQLPopulationPromise.d.ts +1 -2
- package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/blocks/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/blocks/server/index.d.ts +1 -0
- package/dist/features/blocks/server/index.d.ts.map +1 -1
- package/dist/features/blocks/server/index.js +20 -66
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
- package/dist/features/blocks/server/markdown/markdownTransformer.js +4 -4
- package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts +1 -18
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +2 -10
- package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/blocks/server/schema.d.ts +45 -0
- package/dist/features/blocks/server/schema.d.ts.map +1 -0
- package/dist/features/blocks/server/schema.js +136 -0
- package/dist/features/blocks/server/schema.js.map +1 -0
- package/dist/features/blocks/server/validate.d.ts +1 -2
- package/dist/features/blocks/server/validate.d.ts.map +1 -1
- package/dist/features/blocks/server/validate.js.map +1 -1
- package/dist/features/converters/htmlToLexical/index.d.ts +1 -1
- package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
- package/dist/features/converters/htmlToLexical/index.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/blockquote.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/linebreak.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/link.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/paragraph.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/tab.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/table.js +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/table.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/text.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/defaultConverters.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/types.d.ts +2 -1
- package/dist/features/converters/lexicalToHtml/async/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/types.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/link.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/tab.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/table.js +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/table.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/text.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/defaultConverters.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/types.d.ts +2 -1
- package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/Component/index.d.ts +4 -2
- package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/link.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/tab.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/table.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/text.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/defaultConverters.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/index.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/types.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
- package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
- package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +1 -1
- package/dist/features/converters/lexicalToPlaintext/shared/findConverterForNode.js.map +1 -1
- package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts +1 -1
- package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToPlaintext/sync/types.js.map +1 -1
- package/dist/features/converters/markdownToLexical/index.d.ts +1 -1
- package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
- package/dist/features/converters/markdownToLexical/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.css +4 -4
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.css +1 -1
- package/dist/features/experimental_table/server/index.d.ts +1 -6
- package/dist/features/experimental_table/server/index.d.ts.map +1 -1
- package/dist/features/experimental_table/server/index.js +4 -0
- package/dist/features/experimental_table/server/index.js.map +1 -1
- package/dist/features/experimental_table/server/schema.d.ts +27 -0
- package/dist/features/experimental_table/server/schema.d.ts.map +1 -0
- package/dist/features/experimental_table/server/schema.js +104 -0
- package/dist/features/experimental_table/server/schema.js.map +1 -0
- package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
- package/dist/features/heading/server/index.d.ts +2 -4
- package/dist/features/heading/server/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.js +2 -0
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/heading/server/schema.d.ts +10 -0
- package/dist/features/heading/server/schema.d.ts.map +1 -0
- package/dist/features/heading/server/schema.js +37 -0
- package/dist/features/heading/server/schema.js.map +1 -0
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/horizontalRule/server/index.d.ts +1 -0
- package/dist/features/horizontalRule/server/index.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/index.js +2 -0
- package/dist/features/horizontalRule/server/index.js.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -5
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/horizontalRule/server/schema.d.ts +7 -0
- package/dist/features/horizontalRule/server/schema.d.ts.map +1 -0
- package/dist/features/horizontalRule/server/schema.js +25 -0
- package/dist/features/horizontalRule/server/schema.js.map +1 -0
- package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
- package/dist/features/link/client/index.d.ts.map +1 -1
- package/dist/features/link/client/index.js.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.d.ts +1 -1
- package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.css +2 -2
- package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/types.js.map +1 -1
- package/dist/features/link/client/plugins/link/index.js.map +1 -1
- package/dist/features/link/markdownTransformer.d.ts +1 -1
- package/dist/features/link/markdownTransformer.d.ts.map +1 -1
- package/dist/features/link/markdownTransformer.js.map +1 -1
- package/dist/features/link/markdownTransformer.spec.js.map +1 -1
- package/dist/features/link/nodes/AutoLinkNode.d.ts +3 -3
- package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/AutoLinkNode.js +2 -1
- package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
- package/dist/features/link/nodes/LinkNode.d.ts +3 -3
- package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/LinkNode.js +2 -1
- package/dist/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/features/link/server/baseFields.d.ts.map +1 -1
- package/dist/features/link/server/baseFields.js.map +1 -1
- package/dist/features/link/server/graphQLPopulationPromise.d.ts +1 -1
- package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/link/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/link/server/index.d.ts +2 -1
- package/dist/features/link/server/index.d.ts.map +1 -1
- package/dist/features/link/server/index.js +3 -0
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/link/server/schema.d.ts +32 -0
- package/dist/features/link/server/schema.d.ts.map +1 -0
- package/dist/features/link/server/schema.js +166 -0
- package/dist/features/link/server/schema.js.map +1 -0
- package/dist/features/link/server/validate.d.ts +1 -1
- package/dist/features/link/server/validate.d.ts.map +1 -1
- package/dist/features/link/server/validate.js.map +1 -1
- package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
- package/dist/features/lists/checklist/server/index.js +3 -0
- package/dist/features/lists/checklist/server/index.js.map +1 -1
- package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/orderedList/server/index.js +3 -0
- package/dist/features/lists/orderedList/server/index.js.map +1 -1
- package/dist/features/lists/plugin/index.d.ts +0 -9
- package/dist/features/lists/plugin/index.d.ts.map +1 -1
- package/dist/features/lists/plugin/index.js.map +1 -1
- package/dist/features/lists/shared/markdown.d.ts.map +1 -1
- package/dist/features/lists/shared/schema.d.ts +18 -0
- package/dist/features/lists/shared/schema.d.ts.map +1 -0
- package/dist/features/lists/shared/schema.js +62 -0
- package/dist/features/lists/shared/schema.js.map +1 -0
- package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/unorderedList/server/index.js +3 -0
- package/dist/features/lists/unorderedList/server/index.js.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.d.ts +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.js +2 -2
- package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
- package/dist/features/relationship/client/components/index.css +2 -2
- package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.d.ts +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.d.ts +1 -1
- package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.js +9 -40
- package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/relationship/server/index.d.ts +1 -0
- package/dist/features/relationship/server/index.d.ts.map +1 -1
- package/dist/features/relationship/server/index.js +2 -0
- package/dist/features/relationship/server/index.js.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +1 -10
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/relationship/server/schema.d.ts +28 -0
- package/dist/features/relationship/server/schema.d.ts.map +1 -0
- package/dist/features/relationship/server/schema.js +83 -0
- package/dist/features/relationship/server/schema.js.map +1 -0
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +23 -0
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -0
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +34 -0
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -0
- package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
- package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
- package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +1 -2
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.css +4 -4
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/features/toolbars/types.d.ts +1 -1
- package/dist/features/toolbars/types.d.ts.map +1 -1
- package/dist/features/toolbars/types.js.map +1 -1
- package/dist/features/typesClient.d.ts +1 -1
- package/dist/features/typesClient.d.ts.map +1 -1
- package/dist/features/typesClient.js.map +1 -1
- package/dist/features/typesServer.d.ts +18 -41
- package/dist/features/typesServer.d.ts.map +1 -1
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/component/index.css +14 -18
- package/dist/features/upload/client/component/index.d.ts +1 -1
- package/dist/features/upload/client/component/index.d.ts.map +1 -1
- package/dist/features/upload/client/component/index.js +4 -4
- package/dist/features/upload/client/component/index.js.map +1 -1
- package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.d.ts +1 -1
- package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/client/plugin/index.d.ts +1 -1
- package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/upload/server/index.d.ts +1 -0
- package/dist/features/upload/server/index.d.ts.map +1 -1
- package/dist/features/upload/server/index.js +3 -2
- package/dist/features/upload/server/index.js.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.d.ts +1 -55
- package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/server/nodes/conversions.d.ts.map +1 -1
- package/dist/features/upload/server/nodes/conversions.js.map +1 -1
- package/dist/features/upload/server/schema.d.ts +52 -0
- package/dist/features/upload/server/schema.d.ts.map +1 -0
- package/dist/features/upload/server/schema.js +113 -0
- package/dist/features/upload/server/schema.js.map +1 -0
- package/dist/features/upload/server/validate.d.ts +1 -1
- package/dist/features/upload/server/validate.d.ts.map +1 -1
- package/dist/features/upload/server/validate.js.map +1 -1
- package/dist/field/Diff/converters/link.d.ts +1 -1
- package/dist/field/Diff/converters/link.d.ts.map +1 -1
- package/dist/field/Diff/converters/link.js.map +1 -1
- package/dist/field/Diff/converters/listitem/index.css +44 -8
- package/dist/field/Diff/converters/listitem/index.d.ts +1 -1
- package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/listitem/index.js.map +1 -1
- package/dist/field/Diff/converters/relationship/index.css +76 -36
- package/dist/field/Diff/converters/relationship/index.d.ts +1 -1
- package/dist/field/Diff/converters/relationship/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/relationship/index.js +10 -28
- package/dist/field/Diff/converters/relationship/index.js.map +1 -1
- package/dist/field/Diff/converters/unknown/index.js.map +1 -1
- package/dist/field/Diff/converters/upload/index.css +106 -43
- package/dist/field/Diff/converters/upload/index.d.ts +1 -1
- package/dist/field/Diff/converters/upload/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/upload/index.js +6 -2
- package/dist/field/Diff/converters/upload/index.js.map +1 -1
- package/dist/field/Diff/index.css +116 -61
- package/dist/field/Diff/index.js.map +1 -1
- package/dist/field/Field.d.ts +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +3 -4
- package/dist/field/Field.js.map +1 -1
- package/dist/field/RenderLexical/index.d.ts +2 -2
- package/dist/field/RenderLexical/index.d.ts.map +1 -1
- package/dist/field/RenderLexical/index.js.map +1 -1
- package/dist/field/RichTextViewProvider.d.ts +1 -1
- package/dist/field/RichTextViewProvider.d.ts.map +1 -1
- package/dist/field/RichTextViewProvider.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js.map +1 -1
- package/dist/field/rscEntry.d.ts +1 -1
- package/dist/field/rscEntry.d.ts.map +1 -1
- package/dist/field/rscEntry.js.map +1 -1
- package/dist/hooks.d.ts +6 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +548 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +11 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -618
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalProvider.d.ts +1 -1
- package/dist/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.d.ts +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
- package/dist/lexical/config/client/loader.d.ts +1 -1
- package/dist/lexical/config/client/loader.d.ts.map +1 -1
- package/dist/lexical/config/client/loader.js.map +1 -1
- package/dist/lexical/config/client/sanitize.d.ts +1 -1
- package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/client/sanitize.js.map +1 -1
- package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/server/sanitize.js +9 -11
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/config/types.d.ts +1 -1
- package/dist/lexical/config/types.d.ts.map +1 -1
- package/dist/lexical/config/types.js.map +1 -1
- package/dist/lexical/nodes/index.d.ts +1 -1
- package/dist/lexical/nodes/index.d.ts.map +1 -1
- package/dist/lexical/nodes/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
- package/dist/lexical/theme/EditorTheme.css +4 -4
- package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
- package/dist/types/builtInNodes.d.ts +14 -0
- package/dist/types/builtInNodes.d.ts.map +1 -0
- package/dist/types/builtInNodes.js +203 -0
- package/dist/types/builtInNodes.js.map +1 -0
- package/dist/{types.d.ts → types/index.d.ts} +9 -10
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/jsonSchemaHelpers.d.ts +28 -0
- package/dist/types/jsonSchemaHelpers.d.ts.map +1 -0
- package/dist/types/jsonSchemaHelpers.js +54 -0
- package/dist/types/jsonSchemaHelpers.js.map +1 -0
- package/dist/types/nodeTypes.d.ts +86 -0
- package/dist/types/nodeTypes.d.ts.map +1 -0
- package/dist/types/nodeTypes.js +6 -0
- package/dist/types/nodeTypes.js.map +1 -0
- package/dist/types/schema.d.ts +6 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/schema.js +73 -0
- package/dist/types/schema.js.map +1 -0
- package/dist/utilities/buildEditorState.d.ts +1 -1
- package/dist/utilities/buildEditorState.d.ts.map +1 -1
- package/dist/utilities/buildEditorState.js.map +1 -1
- package/dist/utilities/buildInitialState.js.map +1 -1
- package/dist/utilities/createClientFeature.d.ts +1 -1
- package/dist/utilities/createClientFeature.d.ts.map +1 -1
- package/dist/utilities/createClientFeature.js.map +1 -1
- package/dist/utilities/editorConfigFactory.d.ts +1 -1
- package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
- package/dist/utilities/editorConfigFactory.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.d.ts +1 -1
- package/dist/utilities/generateImportMap.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.js.map +1 -1
- package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
- package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
- package/dist/utilities/initLexicalFeatures.d.ts +1 -1
- package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
- package/dist/utilities/initLexicalFeatures.js.map +1 -1
- package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/package.json +13 -13
- package/dist/exports/client/Field-PJW7KUJG.js.map +0 -7
- package/dist/exports/client/RelationshipComponent-5RONAYJM.js.map +0 -7
- package/dist/exports/client/chunk-44G3K3W7.js.map +0 -7
- package/dist/exports/client/chunk-BZZVLW4U.js.map +0 -7
- package/dist/exports/client/chunk-FTT5KJ6W.js.map +0 -7
- package/dist/exports/client/component-53Y3RYR5.js +0 -2
- package/dist/exports/client/component-53Y3RYR5.js.map +0 -7
- package/dist/exports/client/componentInline-PM4PLNUK.js +0 -2
- package/dist/features/link/nodes/types.d.ts +0 -27
- package/dist/features/link/nodes/types.d.ts.map +0 -1
- package/dist/features/link/nodes/types.js +0 -2
- package/dist/features/link/nodes/types.js.map +0 -1
- package/dist/nodeTypes.d.ts +0 -74
- package/dist/nodeTypes.d.ts.map +0 -1
- package/dist/nodeTypes.js +0 -5
- package/dist/nodeTypes.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- /package/dist/exports/client/{chunk-QJ5EETIB.js.map → chunk-6QWQ7JV4.js.map} +0 -0
- /package/dist/exports/client/{componentInline-PM4PLNUK.js.map → componentInline-D3A6OW76.js.map} +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { fieldsToJSONSchema, flattenAllFields, toWords } from 'payload';
|
|
2
|
+
import { formatSchema } from '../../../types/jsonSchemaHelpers.js';
|
|
3
|
+
/**
|
|
4
|
+
* MUST stay byte-for-byte in sync with the runtime `SerializedBlockNode` and
|
|
5
|
+
* `SerializedInlineBlockNode` declared above.
|
|
6
|
+
*/
|
|
7
|
+
const BLOCK_NODES_TS = `export type SerializedBlockNode<TFields extends { blockType: string }> = {
|
|
8
|
+
type: 'block';
|
|
9
|
+
format: LexicalElementFormat;
|
|
10
|
+
version: number;
|
|
11
|
+
fields: { id: string; blockName?: string | null } & Omit<TFields, 'id' | 'blockName'>;
|
|
12
|
+
};
|
|
13
|
+
export type SerializedInlineBlockNode<TFields extends { blockType: string }> = {
|
|
14
|
+
type: 'inlineBlock';
|
|
15
|
+
version: number;
|
|
16
|
+
fields: { id: string } & Omit<TFields, 'id'>;
|
|
17
|
+
};`;
|
|
18
|
+
/** Block `interfaceName` if set, otherwise a PascalCase form of the slug. */
|
|
19
|
+
const blockFieldsInterfaceName = block => block.interfaceName ?? toWords(block.slug, true);
|
|
20
|
+
/**
|
|
21
|
+
* JSON Schema for one block's `fields:` payload. Strips Payload's auto-added
|
|
22
|
+
* `id`/`blockName` and re-adds them with strict runtime types: required
|
|
23
|
+
* non-null `id`, optional `blockName?: string | null` (omitted for inline
|
|
24
|
+
* blocks). Always registers as a top-level `$ref`.
|
|
25
|
+
*/
|
|
26
|
+
const buildBlockFieldsSchema = (block, args, {
|
|
27
|
+
isInlineBlock
|
|
28
|
+
}) => {
|
|
29
|
+
const flattened = flattenAllFields({
|
|
30
|
+
fields: block.fields
|
|
31
|
+
});
|
|
32
|
+
const userFieldsSchema = args.config ? fieldsToJSONSchema({
|
|
33
|
+
collectionIDFieldTypes: args.collectionIDFieldTypes,
|
|
34
|
+
config: args.config,
|
|
35
|
+
fields: flattened,
|
|
36
|
+
i18n: args.i18n,
|
|
37
|
+
interfaceNameDefinitions: args.interfaceNameDefinitions,
|
|
38
|
+
typeStringDefinitions: args.typeStringDefinitions
|
|
39
|
+
}) : {
|
|
40
|
+
properties: {},
|
|
41
|
+
required: []
|
|
42
|
+
};
|
|
43
|
+
const {
|
|
44
|
+
id: _stripId,
|
|
45
|
+
blockName: _stripBlockName,
|
|
46
|
+
...userOnlyProperties
|
|
47
|
+
} = userFieldsSchema.properties ?? {};
|
|
48
|
+
const userOnlyRequired = (userFieldsSchema.required ?? []).filter(r => r !== 'id' && r !== 'blockName');
|
|
49
|
+
const properties = {
|
|
50
|
+
id: {
|
|
51
|
+
type: 'string'
|
|
52
|
+
},
|
|
53
|
+
blockType: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
const: block.slug
|
|
56
|
+
},
|
|
57
|
+
...userOnlyProperties
|
|
58
|
+
};
|
|
59
|
+
const required = ['id', 'blockType', ...userOnlyRequired];
|
|
60
|
+
if (!isInlineBlock) {
|
|
61
|
+
properties.blockName = {
|
|
62
|
+
type: ['string', 'null']
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const fieldsSchema = {
|
|
66
|
+
type: 'object',
|
|
67
|
+
additionalProperties: false,
|
|
68
|
+
properties,
|
|
69
|
+
required
|
|
70
|
+
};
|
|
71
|
+
const definitionName = blockFieldsInterfaceName(block);
|
|
72
|
+
args.interfaceNameDefinitions.set(definitionName, fieldsSchema);
|
|
73
|
+
return {
|
|
74
|
+
$ref: `#/definitions/${definitionName}`
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
export const createBlockNodeJSONSchema = blockConfigs => args => {
|
|
78
|
+
args.typeStringDefinitions.add(BLOCK_NODES_TS);
|
|
79
|
+
const blockFieldsSchemas = blockConfigs.map(block => buildBlockFieldsSchema(block, args, {
|
|
80
|
+
isInlineBlock: false
|
|
81
|
+
}));
|
|
82
|
+
const fieldsSchema = blockFieldsSchemas.length === 0 ? {
|
|
83
|
+
type: 'object',
|
|
84
|
+
additionalProperties: true
|
|
85
|
+
} : blockFieldsSchemas.length === 1 ? blockFieldsSchemas[0] : {
|
|
86
|
+
oneOf: blockFieldsSchemas
|
|
87
|
+
};
|
|
88
|
+
const tsType = blockConfigs.length > 0 ? `SerializedBlockNode<${blockConfigs.map(b => blockFieldsInterfaceName(b)).join(' | ')}>` : `SerializedBlockNode<{ blockType: string }>`;
|
|
89
|
+
return {
|
|
90
|
+
type: 'object',
|
|
91
|
+
additionalProperties: false,
|
|
92
|
+
properties: {
|
|
93
|
+
type: {
|
|
94
|
+
type: 'string',
|
|
95
|
+
const: 'block'
|
|
96
|
+
},
|
|
97
|
+
fields: fieldsSchema,
|
|
98
|
+
format: formatSchema,
|
|
99
|
+
version: {
|
|
100
|
+
type: 'integer'
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
required: ['fields', 'format', 'type', 'version'],
|
|
104
|
+
tsType
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
export const createInlineBlockNodeJSONSchema = inlineBlockConfigs => args => {
|
|
108
|
+
args.typeStringDefinitions.add(BLOCK_NODES_TS);
|
|
109
|
+
const blockFieldsSchemas = inlineBlockConfigs.map(block => buildBlockFieldsSchema(block, args, {
|
|
110
|
+
isInlineBlock: true
|
|
111
|
+
}));
|
|
112
|
+
const fieldsSchema = blockFieldsSchemas.length === 0 ? {
|
|
113
|
+
type: 'object',
|
|
114
|
+
additionalProperties: true
|
|
115
|
+
} : blockFieldsSchemas.length === 1 ? blockFieldsSchemas[0] : {
|
|
116
|
+
oneOf: blockFieldsSchemas
|
|
117
|
+
};
|
|
118
|
+
const tsType = inlineBlockConfigs.length > 0 ? `SerializedInlineBlockNode<${inlineBlockConfigs.map(b => blockFieldsInterfaceName(b)).join(' | ')}>` : `SerializedInlineBlockNode<{ blockType: string }>`;
|
|
119
|
+
return {
|
|
120
|
+
type: 'object',
|
|
121
|
+
additionalProperties: false,
|
|
122
|
+
properties: {
|
|
123
|
+
type: {
|
|
124
|
+
type: 'string',
|
|
125
|
+
const: 'inlineBlock'
|
|
126
|
+
},
|
|
127
|
+
fields: fieldsSchema,
|
|
128
|
+
version: {
|
|
129
|
+
type: 'integer'
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
required: ['fields', 'type', 'version'],
|
|
133
|
+
tsType
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","names":["fieldsToJSONSchema","flattenAllFields","toWords","formatSchema","BLOCK_NODES_TS","blockFieldsInterfaceName","block","interfaceName","slug","buildBlockFieldsSchema","args","isInlineBlock","flattened","fields","userFieldsSchema","config","collectionIDFieldTypes","i18n","interfaceNameDefinitions","typeStringDefinitions","properties","required","id","_stripId","blockName","_stripBlockName","userOnlyProperties","userOnlyRequired","filter","r","type","blockType","const","fieldsSchema","additionalProperties","definitionName","set","$ref","createBlockNodeJSONSchema","blockConfigs","add","blockFieldsSchemas","map","length","oneOf","tsType","b","join","format","version","createInlineBlockNodeJSONSchema","inlineBlockConfigs"],"sources":["../../../../src/features/blocks/server/schema.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type { Block, JsonObject } from 'payload'\n\nimport { fieldsToJSONSchema, flattenAllFields, toWords } from 'payload'\n\nimport type { LexicalElementFormat } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaArgs, JSONSchemaFn } from '../../typesServer.js'\n\nimport { formatSchema } from '../../../types/jsonSchemaHelpers.js'\n\ntype BaseBlockFields<TFields extends JsonObject = JsonObject> = {\n blockName?: null | string\n blockType: string\n} & TFields\n\nexport type BlockFields<TFields extends JsonObject = JsonObject> = {\n id: string\n} & BaseBlockFields<TFields>\n\nexport type BlockFieldsOptionalID<TFields extends JsonObject = JsonObject> = {\n id?: string\n} & BaseBlockFields<TFields>\n\nexport type InlineBlockFields<TFields extends JsonObject = JsonObject> = {\n blockType: string\n id: string\n} & TFields\n\nexport type SerializedBlockNode<TFields extends { blockType: string } = { blockType: string }> = {\n fields: { blockName?: string | null; id: string } & Omit<TFields, 'blockName' | 'id'>\n format: LexicalElementFormat\n type: 'block'\n version: number\n}\n\nexport type SerializedInlineBlockNode<\n TFields extends { blockType: string } = { blockType: string },\n> = {\n fields: { id: string } & Omit<TFields, 'id'>\n type: 'inlineBlock'\n version: number\n}\n\n/**\n * MUST stay byte-for-byte in sync with the runtime `SerializedBlockNode` and\n * `SerializedInlineBlockNode` declared above.\n */\nconst BLOCK_NODES_TS = `export type SerializedBlockNode<TFields extends { blockType: string }> = {\n type: 'block';\n format: LexicalElementFormat;\n version: number;\n fields: { id: string; blockName?: string | null } & Omit<TFields, 'id' | 'blockName'>;\n};\nexport type SerializedInlineBlockNode<TFields extends { blockType: string }> = {\n type: 'inlineBlock';\n version: number;\n fields: { id: string } & Omit<TFields, 'id'>;\n};`\n\n/** Block `interfaceName` if set, otherwise a PascalCase form of the slug. */\nconst blockFieldsInterfaceName = (block: Block) => block.interfaceName ?? toWords(block.slug, true)\n\n/**\n * JSON Schema for one block's `fields:` payload. Strips Payload's auto-added\n * `id`/`blockName` and re-adds them with strict runtime types: required\n * non-null `id`, optional `blockName?: string | null` (omitted for inline\n * blocks). Always registers as a top-level `$ref`.\n */\nconst buildBlockFieldsSchema = (\n block: Block,\n args: JSONSchemaArgs,\n { isInlineBlock }: { isInlineBlock: boolean },\n): JSONSchema4 => {\n const flattened = flattenAllFields({ fields: block.fields })\n const userFieldsSchema = args.config\n ? fieldsToJSONSchema({\n collectionIDFieldTypes: args.collectionIDFieldTypes,\n config: args.config,\n fields: flattened,\n i18n: args.i18n,\n interfaceNameDefinitions: args.interfaceNameDefinitions,\n typeStringDefinitions: args.typeStringDefinitions,\n })\n : { properties: {}, required: [] }\n\n const {\n id: _stripId,\n blockName: _stripBlockName,\n ...userOnlyProperties\n } = (userFieldsSchema.properties ?? {}) as { [k: string]: JSONSchema4 }\n const userOnlyRequired = (userFieldsSchema.required ?? []).filter(\n (r) => r !== 'id' && r !== 'blockName',\n )\n\n const properties: { [k: string]: JSONSchema4 } = {\n id: { type: 'string' },\n blockType: { type: 'string', const: block.slug },\n ...userOnlyProperties,\n }\n const required = ['id', 'blockType', ...userOnlyRequired]\n\n if (!isInlineBlock) {\n properties.blockName = { type: ['string', 'null'] }\n }\n\n const fieldsSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties,\n required,\n }\n\n const definitionName = blockFieldsInterfaceName(block)\n args.interfaceNameDefinitions.set(definitionName, fieldsSchema)\n return { $ref: `#/definitions/${definitionName}` }\n}\n\nexport const createBlockNodeJSONSchema =\n (blockConfigs: Block[]): JSONSchemaFn =>\n (args) => {\n args.typeStringDefinitions.add(BLOCK_NODES_TS)\n const blockFieldsSchemas = blockConfigs.map((block) =>\n buildBlockFieldsSchema(block, args, { isInlineBlock: false }),\n )\n\n const fieldsSchema: JSONSchema4 =\n blockFieldsSchemas.length === 0\n ? { type: 'object', additionalProperties: true }\n : blockFieldsSchemas.length === 1\n ? blockFieldsSchemas[0]!\n : { oneOf: blockFieldsSchemas }\n\n const tsType =\n blockConfigs.length > 0\n ? `SerializedBlockNode<${blockConfigs.map((b) => blockFieldsInterfaceName(b)).join(' | ')}>`\n : `SerializedBlockNode<{ blockType: string }>`\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'block' },\n fields: fieldsSchema,\n format: formatSchema,\n version: { type: 'integer' },\n },\n required: ['fields', 'format', 'type', 'version'],\n tsType,\n }\n }\n\nexport const createInlineBlockNodeJSONSchema =\n (inlineBlockConfigs: Block[]): JSONSchemaFn =>\n (args) => {\n args.typeStringDefinitions.add(BLOCK_NODES_TS)\n const blockFieldsSchemas = inlineBlockConfigs.map((block) =>\n buildBlockFieldsSchema(block, args, { isInlineBlock: true }),\n )\n\n const fieldsSchema: JSONSchema4 =\n blockFieldsSchemas.length === 0\n ? { type: 'object', additionalProperties: true }\n : blockFieldsSchemas.length === 1\n ? blockFieldsSchemas[0]!\n : { oneOf: blockFieldsSchemas }\n\n const tsType =\n inlineBlockConfigs.length > 0\n ? `SerializedInlineBlockNode<${inlineBlockConfigs.map((b) => blockFieldsInterfaceName(b)).join(' | ')}>`\n : `SerializedInlineBlockNode<{ blockType: string }>`\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'inlineBlock' },\n fields: fieldsSchema,\n version: { type: 'integer' },\n },\n required: ['fields', 'type', 'version'],\n tsType,\n }\n }\n"],"mappings":"AAGA,SAASA,kBAAkB,EAAEC,gBAAgB,EAAEC,OAAO,QAAQ;AAK9D,SAASC,YAAY,QAAQ;AAmC7B;;;;AAIA,MAAMC,cAAA,GAAiB;;;;;;;;;;GAUpB;AAEH;AACA,MAAMC,wBAAA,GAA4BC,KAAA,IAAiBA,KAAA,CAAMC,aAAa,IAAIL,OAAA,CAAQI,KAAA,CAAME,IAAI,EAAE;AAE9F;;;;;;AAMA,MAAMC,sBAAA,GAAyBA,CAC7BH,KAAA,EACAI,IAAA,EACA;EAAEC;AAAa,CAA8B;EAE7C,MAAMC,SAAA,GAAYX,gBAAA,CAAiB;IAAEY,MAAA,EAAQP,KAAA,CAAMO;EAAO;EAC1D,MAAMC,gBAAA,GAAmBJ,IAAA,CAAKK,MAAM,GAChCf,kBAAA,CAAmB;IACjBgB,sBAAA,EAAwBN,IAAA,CAAKM,sBAAsB;IACnDD,MAAA,EAAQL,IAAA,CAAKK,MAAM;IACnBF,MAAA,EAAQD,SAAA;IACRK,IAAA,EAAMP,IAAA,CAAKO,IAAI;IACfC,wBAAA,EAA0BR,IAAA,CAAKQ,wBAAwB;IACvDC,qBAAA,EAAuBT,IAAA,CAAKS;EAC9B,KACA;IAAEC,UAAA,EAAY,CAAC;IAAGC,QAAA,EAAU;EAAG;EAEnC,MAAM;IACJC,EAAA,EAAIC,QAAQ;IACZC,SAAA,EAAWC,eAAe;IAC1B,GAAGC;EAAA,CACJ,GAAIZ,gBAAA,CAAiBM,UAAU,IAAI,CAAC;EACrC,MAAMO,gBAAA,GAAmB,CAACb,gBAAA,CAAiBO,QAAQ,IAAI,EAAE,EAAEO,MAAM,CAC9DC,CAAA,IAAMA,CAAA,KAAM,QAAQA,CAAA,KAAM;EAG7B,MAAMT,UAAA,GAA2C;IAC/CE,EAAA,EAAI;MAAEQ,IAAA,EAAM;IAAS;IACrBC,SAAA,EAAW;MAAED,IAAA,EAAM;MAAUE,KAAA,EAAO1B,KAAA,CAAME;IAAK;IAC/C,GAAGkB;EACL;EACA,MAAML,QAAA,GAAW,CAAC,MAAM,a,GAAgBM,gBAAA,CAAiB;EAEzD,IAAI,CAAChB,aAAA,EAAe;IAClBS,UAAA,CAAWI,SAAS,GAAG;MAAEM,IAAA,EAAM,CAAC,UAAU;IAAQ;EACpD;EAEA,MAAMG,YAAA,GAA4B;IAChCH,IAAA,EAAM;IACNI,oBAAA,EAAsB;IACtBd,UAAA;IACAC;EACF;EAEA,MAAMc,cAAA,GAAiB9B,wBAAA,CAAyBC,KAAA;EAChDI,IAAA,CAAKQ,wBAAwB,CAACkB,GAAG,CAACD,cAAA,EAAgBF,YAAA;EAClD,OAAO;IAAEI,IAAA,EAAM,iBAAiBF,cAAA;EAAiB;AACnD;AAEA,OAAO,MAAMG,yBAAA,GACVC,YAAA,IACA7B,IAAA;EACCA,IAAA,CAAKS,qBAAqB,CAACqB,GAAG,CAACpC,cAAA;EAC/B,MAAMqC,kBAAA,GAAqBF,YAAA,CAAaG,GAAG,CAAEpC,KAAA,IAC3CG,sBAAA,CAAuBH,KAAA,EAAOI,IAAA,EAAM;IAAEC,aAAA,EAAe;EAAM;EAG7D,MAAMsB,YAAA,GACJQ,kBAAA,CAAmBE,MAAM,KAAK,IAC1B;IAAEb,IAAA,EAAM;IAAUI,oBAAA,EAAsB;EAAK,IAC7CO,kBAAA,CAAmBE,MAAM,KAAK,IAC5BF,kBAAkB,CAAC,EAAE,GACrB;IAAEG,KAAA,EAAOH;EAAmB;EAEpC,MAAMI,MAAA,GACJN,YAAA,CAAaI,MAAM,GAAG,IAClB,uBAAuBJ,YAAA,CAAaG,GAAG,CAAEI,CAAA,IAAMzC,wBAAA,CAAyByC,CAAA,GAAIC,IAAI,CAAC,SAAS,GAC1F,4CAA4C;EAElD,OAAO;IACLjB,IAAA,EAAM;IACNI,oBAAA,EAAsB;IACtBd,UAAA,EAAY;MACVU,IAAA,EAAM;QAAEA,IAAA,EAAM;QAAUE,KAAA,EAAO;MAAQ;MACvCnB,MAAA,EAAQoB,YAAA;MACRe,MAAA,EAAQ7C,YAAA;MACR8C,OAAA,EAAS;QAAEnB,IAAA,EAAM;MAAU;IAC7B;IACAT,QAAA,EAAU,CAAC,UAAU,UAAU,QAAQ,UAAU;IACjDwB;EACF;AACF;AAEF,OAAO,MAAMK,+BAAA,GACVC,kBAAA,IACAzC,IAAA;EACCA,IAAA,CAAKS,qBAAqB,CAACqB,GAAG,CAACpC,cAAA;EAC/B,MAAMqC,kBAAA,GAAqBU,kBAAA,CAAmBT,GAAG,CAAEpC,KAAA,IACjDG,sBAAA,CAAuBH,KAAA,EAAOI,IAAA,EAAM;IAAEC,aAAA,EAAe;EAAK;EAG5D,MAAMsB,YAAA,GACJQ,kBAAA,CAAmBE,MAAM,KAAK,IAC1B;IAAEb,IAAA,EAAM;IAAUI,oBAAA,EAAsB;EAAK,IAC7CO,kBAAA,CAAmBE,MAAM,KAAK,IAC5BF,kBAAkB,CAAC,EAAE,GACrB;IAAEG,KAAA,EAAOH;EAAmB;EAEpC,MAAMI,MAAA,GACJM,kBAAA,CAAmBR,MAAM,GAAG,IACxB,6BAA6BQ,kBAAA,CAAmBT,GAAG,CAAEI,CAAA,IAAMzC,wBAAA,CAAyByC,CAAA,GAAIC,IAAI,CAAC,SAAS,GACtG,kDAAkD;EAExD,OAAO;IACLjB,IAAA,EAAM;IACNI,oBAAA,EAAsB;IACtBd,UAAA,EAAY;MACVU,IAAA,EAAM;QAAEA,IAAA,EAAM;QAAUE,KAAA,EAAO;MAAc;MAC7CnB,MAAA,EAAQoB,YAAA;MACRgB,OAAA,EAAS;QAAEnB,IAAA,EAAM;MAAU;IAC7B;IACAT,QAAA,EAAU,CAAC,UAAU,QAAQ,UAAU;IACvCwB;EACF;AACF","ignoreList":[]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Block } from 'payload';
|
|
2
2
|
import type { NodeValidation } from '../../typesServer.js';
|
|
3
|
-
import type { SerializedBlockNode } from './
|
|
4
|
-
import type { SerializedInlineBlockNode } from './nodes/InlineBlocksNode.js';
|
|
3
|
+
import type { SerializedBlockNode, SerializedInlineBlockNode } from './schema.js';
|
|
5
4
|
/**
|
|
6
5
|
* Runs validation for blocks. This function will determine if the rich text field itself is valid. It does not handle
|
|
7
6
|
* block field error paths - this is done by the `beforeChangeTraverseFields` call in the `beforeChange` hook, called from the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/features/blocks/server/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAIpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAe,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/features/blocks/server/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAIpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAe,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE9F;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,KAAK,EAAE,KACd,cAAc,CAAC,mBAAmB,GAAG,yBAAyB,CAqDhE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","names":["fieldSchemasToFormState","blockValidationHOC","blocks","node","validation","blockFieldData","fields","options","id","collectionSlug","data","operation","preferences","req","block","find","slug","blockType","result","documentData","fieldSchemaMap","undefined","initialBlockData","permissions","renderAllFields","schemaPath","errorPathsSet","Set","fieldKey","fieldState","errorPaths","length","errorPath","add","Array","from","join"],"sources":["../../../../src/features/blocks/server/validate.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { fieldSchemasToFormState } from '@payloadcms/ui/forms/fieldSchemasToFormState'\n\nimport type { NodeValidation } from '../../typesServer.js'\nimport type { BlockFields, SerializedBlockNode
|
|
1
|
+
{"version":3,"file":"validate.js","names":["fieldSchemasToFormState","blockValidationHOC","blocks","node","validation","blockFieldData","fields","options","id","collectionSlug","data","operation","preferences","req","block","find","slug","blockType","result","documentData","fieldSchemaMap","undefined","initialBlockData","permissions","renderAllFields","schemaPath","errorPathsSet","Set","fieldKey","fieldState","errorPaths","length","errorPath","add","Array","from","join"],"sources":["../../../../src/features/blocks/server/validate.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { fieldSchemasToFormState } from '@payloadcms/ui/forms/fieldSchemasToFormState'\n\nimport type { NodeValidation } from '../../typesServer.js'\nimport type { BlockFields, SerializedBlockNode, SerializedInlineBlockNode } from './schema.js'\n\n/**\n * Runs validation for blocks. This function will determine if the rich text field itself is valid. It does not handle\n * block field error paths - this is done by the `beforeChangeTraverseFields` call in the `beforeChange` hook, called from the\n * rich text adapter.\n */\nexport const blockValidationHOC = (\n blocks: Block[],\n): NodeValidation<SerializedBlockNode | SerializedInlineBlockNode> => {\n return async ({ node, validation }) => {\n const blockFieldData = node.fields ?? ({} as BlockFields)\n\n const {\n options: { id, collectionSlug, data, operation, preferences, req },\n } = validation\n\n // find block\n const block = blocks.find((block) => block.slug === blockFieldData.blockType)\n\n // validate block\n if (!block) {\n return `Block ${blockFieldData.blockType} not found`\n }\n\n /**\n * Run fieldSchemasToFormState as that properly validates block and block sub-fields\n */\n\n const result = await fieldSchemasToFormState({\n id,\n collectionSlug,\n data: blockFieldData,\n documentData: data,\n fields: block.fields,\n fieldSchemaMap: undefined,\n initialBlockData: blockFieldData,\n operation: operation === 'create' || operation === 'update' ? operation : 'update',\n permissions: {},\n preferences,\n renderAllFields: false,\n req,\n schemaPath: '',\n })\n\n const errorPathsSet = new Set<string>()\n for (const fieldKey in result) {\n const fieldState = result[fieldKey]\n if (fieldState?.errorPaths?.length) {\n for (const errorPath of fieldState.errorPaths) {\n errorPathsSet.add(errorPath)\n }\n }\n }\n const errorPaths = Array.from(errorPathsSet)\n\n if (errorPaths.length) {\n return 'The following fields are invalid: ' + errorPaths.join(', ')\n }\n\n return true\n }\n}\n"],"mappings":"AAEA,SAASA,uBAAuB,QAAQ;AAKxC;;;;;AAKA,OAAO,MAAMC,kBAAA,GACXC,MAAA;EAEA,OAAO,OAAO;IAAEC,IAAI;IAAEC;EAAU,CAAE;IAChC,MAAMC,cAAA,GAAiBF,IAAA,CAAKG,MAAM,IAAK,CAAC;IAExC,MAAM;MACJC,OAAA,EAAS;QAAEC,EAAE;QAAEC,cAAc;QAAEC,IAAI;QAAEC,SAAS;QAAEC,WAAW;QAAEC;MAAG;IAAE,CACnE,GAAGT,UAAA;IAEJ;IACA,MAAMU,KAAA,GAAQZ,MAAA,CAAOa,IAAI,CAAED,KAAA,IAAUA,KAAA,CAAME,IAAI,KAAKX,cAAA,CAAeY,SAAS;IAE5E;IACA,IAAI,CAACH,KAAA,EAAO;MACV,OAAO,SAAST,cAAA,CAAeY,SAAS,YAAY;IACtD;IAEA;;;IAIA,MAAMC,MAAA,GAAS,MAAMlB,uBAAA,CAAwB;MAC3CQ,EAAA;MACAC,cAAA;MACAC,IAAA,EAAML,cAAA;MACNc,YAAA,EAAcT,IAAA;MACdJ,MAAA,EAAQQ,KAAA,CAAMR,MAAM;MACpBc,cAAA,EAAgBC,SAAA;MAChBC,gBAAA,EAAkBjB,cAAA;MAClBM,SAAA,EAAWA,SAAA,KAAc,YAAYA,SAAA,KAAc,WAAWA,SAAA,GAAY;MAC1EY,WAAA,EAAa,CAAC;MACdX,WAAA;MACAY,eAAA,EAAiB;MACjBX,GAAA;MACAY,UAAA,EAAY;IACd;IAEA,MAAMC,aAAA,GAAgB,IAAIC,GAAA;IAC1B,KAAK,MAAMC,QAAA,IAAYV,MAAA,EAAQ;MAC7B,MAAMW,UAAA,GAAaX,MAAM,CAACU,QAAA,CAAS;MACnC,IAAIC,UAAA,EAAYC,UAAA,EAAYC,MAAA,EAAQ;QAClC,KAAK,MAAMC,SAAA,IAAaH,UAAA,CAAWC,UAAU,EAAE;UAC7CJ,aAAA,CAAcO,GAAG,CAACD,SAAA;QACpB;MACF;IACF;IACA,MAAMF,UAAA,GAAaI,KAAA,CAAMC,IAAI,CAACT,aAAA;IAE9B,IAAII,UAAA,CAAWC,MAAM,EAAE;MACrB,OAAO,uCAAuCD,UAAA,CAAWM,IAAI,CAAC;IAChE;IAEA,OAAO;EACT;AACF","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SerializedLexicalNode } from 'lexical';
|
|
2
2
|
import type { SanitizedServerEditorConfig } from '../../../lexical/config/types.js';
|
|
3
|
-
import type { DefaultNodeTypes, TypedEditorState } from '../../../nodeTypes.js';
|
|
3
|
+
import type { DefaultNodeTypes, TypedEditorState } from '../../../types/nodeTypes.js';
|
|
4
4
|
export declare const convertHTMLToLexical: <TNodeTypes extends SerializedLexicalNode = DefaultNodeTypes>({ editorConfig, html, JSDOM, }: {
|
|
5
5
|
editorConfig: SanitizedServerEditorConfig;
|
|
6
6
|
html: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/converters/htmlToLexical/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE7E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/converters/htmlToLexical/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE7E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAKrF,eAAO,MAAM,oBAAoB,GAAI,UAAU,SAAS,qBAAqB,GAAG,gBAAgB,EAAE,gCAI/F;IACD,YAAY,EAAE,2BAA2B,CAAA;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,KAAK;QAC3B,MAAM,EAAE;YACN,QAAQ,EAAE,QAAQ,CAAA;SACnB,CAAA;KACF,CAAA;CACF,KAAG,gBAAgB,CAAC,UAAU,CA2B9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["createHeadlessEditor","$getRoot","$getSelection","getEnabledNodes","$generateNodesFromDOM","convertHTMLToLexical","editorConfig","html","JSDOM","headlessEditor","nodes","update","dom","window","document","select","selection","Error","insertNodes","discrete","editorJSON","getEditorState","toJSON"],"sources":["../../../../src/features/converters/htmlToLexical/index.ts"],"sourcesContent":["import { createHeadlessEditor } from '@lexical/headless'\nimport { $getRoot, $getSelection, type SerializedLexicalNode } from 'lexical'\n\nimport type { SanitizedServerEditorConfig } from '../../../lexical/config/types.js'\nimport type { DefaultNodeTypes, TypedEditorState } from '../../../nodeTypes.js'\n\nimport { getEnabledNodes } from '../../../lexical/nodes/index.js'\nimport { $generateNodesFromDOM } from '../../../lexical-proxy/@lexical-html.js'\n\nexport const convertHTMLToLexical = <TNodeTypes extends SerializedLexicalNode = DefaultNodeTypes>({\n editorConfig,\n html,\n JSDOM,\n}: {\n editorConfig: SanitizedServerEditorConfig\n html: string\n JSDOM: new (html: string) => {\n window: {\n document: Document\n }\n }\n}): TypedEditorState<TNodeTypes> => {\n const headlessEditor = createHeadlessEditor({\n nodes: getEnabledNodes({\n editorConfig,\n }),\n })\n\n headlessEditor.update(\n () => {\n const dom = new JSDOM(html)\n\n const nodes = $generateNodesFromDOM(headlessEditor, dom.window.document)\n\n $getRoot().select()\n\n const selection = $getSelection()\n if (selection === null) {\n throw new Error('Selection is null')\n }\n selection.insertNodes(nodes)\n },\n { discrete: true },\n )\n\n const editorJSON = headlessEditor.getEditorState().toJSON()\n\n return editorJSON as TypedEditorState<TNodeTypes>\n}\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ;AACrC,SAASC,QAAQ,EAAEC,aAAa,QAAoC;AAKpE,SAASC,eAAe,QAAQ;AAChC,SAASC,qBAAqB,QAAQ;AAEtC,OAAO,MAAMC,oBAAA,GAAuBA,CAA8D;EAChGC,YAAY;EACZC,IAAI;EACJC;AAAK,CASN;EACC,MAAMC,cAAA,GAAiBT,oBAAA,CAAqB;IAC1CU,KAAA,EAAOP,eAAA,CAAgB;MACrBG;IACF;EACF;EAEAG,cAAA,CAAeE,MAAM,CACnB;IACE,MAAMC,GAAA,GAAM,IAAIJ,KAAA,CAAMD,IAAA;IAEtB,MAAMG,KAAA,GAAQN,qBAAA,CAAsBK,cAAA,EAAgBG,GAAA,CAAIC,MAAM,CAACC,QAAQ;IAEvEb,QAAA,GAAWc,MAAM;IAEjB,MAAMC,SAAA,GAAYd,aAAA;IAClB,IAAIc,SAAA,KAAc,MAAM;MACtB,MAAM,IAAIC,KAAA,CAAM;IAClB;IACAD,SAAA,CAAUE,WAAW,CAACR,KAAA;EACxB,GACA;IAAES,QAAA,EAAU;EAAK;EAGnB,MAAMC,UAAA,GAAaX,cAAA,CAAeY,cAAc,GAAGC,MAAM;EAEzD,OAAOF,UAAA;AACT","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["createHeadlessEditor","$getRoot","$getSelection","getEnabledNodes","$generateNodesFromDOM","convertHTMLToLexical","editorConfig","html","JSDOM","headlessEditor","nodes","update","dom","window","document","select","selection","Error","insertNodes","discrete","editorJSON","getEditorState","toJSON"],"sources":["../../../../src/features/converters/htmlToLexical/index.ts"],"sourcesContent":["import { createHeadlessEditor } from '@lexical/headless'\nimport { $getRoot, $getSelection, type SerializedLexicalNode } from 'lexical'\n\nimport type { SanitizedServerEditorConfig } from '../../../lexical/config/types.js'\nimport type { DefaultNodeTypes, TypedEditorState } from '../../../types/nodeTypes.js'\n\nimport { getEnabledNodes } from '../../../lexical/nodes/index.js'\nimport { $generateNodesFromDOM } from '../../../lexical-proxy/@lexical-html.js'\n\nexport const convertHTMLToLexical = <TNodeTypes extends SerializedLexicalNode = DefaultNodeTypes>({\n editorConfig,\n html,\n JSDOM,\n}: {\n editorConfig: SanitizedServerEditorConfig\n html: string\n JSDOM: new (html: string) => {\n window: {\n document: Document\n }\n }\n}): TypedEditorState<TNodeTypes> => {\n const headlessEditor = createHeadlessEditor({\n nodes: getEnabledNodes({\n editorConfig,\n }),\n })\n\n headlessEditor.update(\n () => {\n const dom = new JSDOM(html)\n\n const nodes = $generateNodesFromDOM(headlessEditor, dom.window.document)\n\n $getRoot().select()\n\n const selection = $getSelection()\n if (selection === null) {\n throw new Error('Selection is null')\n }\n selection.insertNodes(nodes)\n },\n { discrete: true },\n )\n\n const editorJSON = headlessEditor.getEditorState().toJSON()\n\n return editorJSON as TypedEditorState<TNodeTypes>\n}\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ;AACrC,SAASC,QAAQ,EAAEC,aAAa,QAAoC;AAKpE,SAASC,eAAe,QAAQ;AAChC,SAASC,qBAAqB,QAAQ;AAEtC,OAAO,MAAMC,oBAAA,GAAuBA,CAA8D;EAChGC,YAAY;EACZC,IAAI;EACJC;AAAK,CASN;EACC,MAAMC,cAAA,GAAiBT,oBAAA,CAAqB;IAC1CU,KAAA,EAAOP,eAAA,CAAgB;MACrBG;IACF;EACF;EAEAG,cAAA,CAAeE,MAAM,CACnB;IACE,MAAMC,GAAA,GAAM,IAAIJ,KAAA,CAAMD,IAAA;IAEtB,MAAMG,KAAA,GAAQN,qBAAA,CAAsBK,cAAA,EAAgBG,GAAA,CAAIC,MAAM,CAACC,QAAQ;IAEvEb,QAAA,GAAWc,MAAM;IAEjB,MAAMC,SAAA,GAAYd,aAAA;IAClB,IAAIc,SAAA,KAAc,MAAM;MACtB,MAAM,IAAIC,KAAA,CAAM;IAClB;IACAD,SAAA,CAAUE,WAAW,CAACR,KAAA;EACxB,GACA;IAAES,QAAA,EAAU;EAAK;EAGnB,MAAMC,UAAA,GAAaX,cAAA,CAAeY,cAAc,GAAGC,MAAM;EAEzD,OAAOF,UAAA;AACT","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SerializedQuoteNode } from '../../../../../nodeTypes.js';
|
|
1
|
+
import type { SerializedQuoteNode } from '../../../../../types/nodeTypes.js';
|
|
2
2
|
import type { HTMLConvertersAsync } from '../types.js';
|
|
3
3
|
export declare const BlockquoteHTMLConverterAsync: HTMLConvertersAsync<SerializedQuoteNode>;
|
|
4
4
|
//# sourceMappingURL=blockquote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockquote.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/blockquote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"blockquote.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/blockquote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,eAAO,MAAM,4BAA4B,EAAE,mBAAmB,CAAC,mBAAmB,CAUjF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockquote.js","names":["BlockquoteHTMLConverterAsync","quote","node","nodesToHTML","providedStyleTag","children","nodes","join"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/blockquote.ts"],"sourcesContent":["import type { SerializedQuoteNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const BlockquoteHTMLConverterAsync: HTMLConvertersAsync<SerializedQuoteNode> = {\n quote: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n return `<blockquote${providedStyleTag}>${children}</blockquote>`\n },\n}\n"],"mappings":"AAGA,OAAO,MAAMA,4BAAA,GAAyE;EACpFC,KAAA,EAAO,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACnD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,OAAO,cAAcH,gBAAA,IAAoBC,QAAA,eAAuB;EAClE;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"blockquote.js","names":["BlockquoteHTMLConverterAsync","quote","node","nodesToHTML","providedStyleTag","children","nodes","join"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/blockquote.ts"],"sourcesContent":["import type { SerializedQuoteNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const BlockquoteHTMLConverterAsync: HTMLConvertersAsync<SerializedQuoteNode> = {\n quote: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n return `<blockquote${providedStyleTag}>${children}</blockquote>`\n },\n}\n"],"mappings":"AAGA,OAAO,MAAMA,4BAAA,GAAyE;EACpFC,KAAA,EAAO,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACnD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,OAAO,cAAcH,gBAAA,IAAoBC,QAAA,eAAuB;EAClE;AACF","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SerializedHeadingNode } from '../../../../../nodeTypes.js';
|
|
1
|
+
import type { SerializedHeadingNode } from '../../../../../types/nodeTypes.js';
|
|
2
2
|
import type { HTMLConvertersAsync } from '../types.js';
|
|
3
3
|
export declare const HeadingHTMLConverterAsync: HTMLConvertersAsync<SerializedHeadingNode>;
|
|
4
4
|
//# sourceMappingURL=heading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/heading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/heading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAItD,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,CAAC,qBAAqB,CAYhF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.js","names":["ALLOWED_HEADING_TAGS","Set","HeadingHTMLConverterAsync","heading","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/heading.ts"],"sourcesContent":["import type { SerializedHeadingNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nconst ALLOWED_HEADING_TAGS = new Set(['h1', 'h2', 'h3', 'h4', 'h5', 'h6'])\n\nexport const HeadingHTMLConverterAsync: HTMLConvertersAsync<SerializedHeadingNode> = {\n heading: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const tag = ALLOWED_HEADING_TAGS.has(node.tag) ? node.tag : 'h1'\n\n return `<${tag}${providedStyleTag}>${children}</${tag}>`\n },\n}\n"],"mappings":"AAGA,MAAMA,oBAAA,GAAuB,IAAIC,GAAA,CAAI,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK;AAEzE,OAAO,MAAMC,yBAAA,GAAwE;EACnFC,OAAA,EAAS,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACrD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,MAAMC,GAAA,GAAMV,oBAAA,CAAqBW,GAAG,CAACP,IAAA,CAAKM,GAAG,IAAIN,IAAA,CAAKM,GAAG,GAAG;IAE5D,OAAO,IAAIA,GAAA,GAAMJ,gBAAA,IAAoBC,QAAA,KAAaG,GAAA,GAAM;EAC1D;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"heading.js","names":["ALLOWED_HEADING_TAGS","Set","HeadingHTMLConverterAsync","heading","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/heading.ts"],"sourcesContent":["import type { SerializedHeadingNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nconst ALLOWED_HEADING_TAGS = new Set(['h1', 'h2', 'h3', 'h4', 'h5', 'h6'])\n\nexport const HeadingHTMLConverterAsync: HTMLConvertersAsync<SerializedHeadingNode> = {\n heading: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const tag = ALLOWED_HEADING_TAGS.has(node.tag) ? node.tag : 'h1'\n\n return `<${tag}${providedStyleTag}>${children}</${tag}>`\n },\n}\n"],"mappings":"AAGA,MAAMA,oBAAA,GAAuB,IAAIC,GAAA,CAAI,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK;AAEzE,OAAO,MAAMC,yBAAA,GAAwE;EACnFC,OAAA,EAAS,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACrD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,MAAMC,GAAA,GAAMV,oBAAA,CAAqBW,GAAG,CAACP,IAAA,CAAKM,GAAG,IAAIN,IAAA,CAAKM,GAAG,GAAG;IAE5D,OAAO,IAAIA,GAAA,GAAMJ,gBAAA,IAAoBC,QAAA,KAAaG,GAAA,GAAM;EAC1D;AACF","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SerializedHorizontalRuleNode } from '../../../../../nodeTypes.js';
|
|
1
|
+
import type { SerializedHorizontalRuleNode } from '../../../../../types/nodeTypes.js';
|
|
2
2
|
import type { HTMLConvertersAsync } from '../types.js';
|
|
3
3
|
export declare const HorizontalRuleHTMLConverterAsync: HTMLConvertersAsync<SerializedHorizontalRuleNode>;
|
|
4
4
|
//# sourceMappingURL=horizontalRule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"horizontalRule.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/horizontalRule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"horizontalRule.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/horizontalRule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACtD,eAAO,MAAM,gCAAgC,EAAE,mBAAmB,CAAC,4BAA4B,CAE9F,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"horizontalRule.js","names":["HorizontalRuleHTMLConverterAsync","horizontalrule"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/horizontalRule.ts"],"sourcesContent":["import type { SerializedHorizontalRuleNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\nexport const HorizontalRuleHTMLConverterAsync: HTMLConvertersAsync<SerializedHorizontalRuleNode> = {\n horizontalrule: '<hr />',\n}\n"],"mappings":"AAEA,OAAO,MAAMA,gCAAA,GAAsF;EACjGC,cAAA,EAAgB;AAClB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"horizontalRule.js","names":["HorizontalRuleHTMLConverterAsync","horizontalrule"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/horizontalRule.ts"],"sourcesContent":["import type { SerializedHorizontalRuleNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\nexport const HorizontalRuleHTMLConverterAsync: HTMLConvertersAsync<SerializedHorizontalRuleNode> = {\n horizontalrule: '<hr />',\n}\n"],"mappings":"AAEA,OAAO,MAAMA,gCAAA,GAAsF;EACjGC,cAAA,EAAgB;AAClB","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SerializedLineBreakNode } from '../../../../../nodeTypes.js';
|
|
1
|
+
import type { SerializedLineBreakNode } from '../../../../../types/nodeTypes.js';
|
|
2
2
|
import type { HTMLConvertersAsync } from '../types.js';
|
|
3
3
|
export declare const LinebreakHTMLConverterAsync: HTMLConvertersAsync<SerializedLineBreakNode>;
|
|
4
4
|
//# sourceMappingURL=linebreak.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linebreak.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/linebreak.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"linebreak.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/linebreak.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,eAAO,MAAM,2BAA2B,EAAE,mBAAmB,CAAC,uBAAuB,CAEpF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linebreak.js","names":["LinebreakHTMLConverterAsync","linebreak"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/linebreak.ts"],"sourcesContent":["import type { SerializedLineBreakNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const LinebreakHTMLConverterAsync: HTMLConvertersAsync<SerializedLineBreakNode> = {\n linebreak: '<br />',\n}\n"],"mappings":"AAGA,OAAO,MAAMA,2BAAA,GAA4E;EACvFC,SAAA,EAAW;AACb","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"linebreak.js","names":["LinebreakHTMLConverterAsync","linebreak"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/linebreak.ts"],"sourcesContent":["import type { SerializedLineBreakNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const LinebreakHTMLConverterAsync: HTMLConvertersAsync<SerializedLineBreakNode> = {\n linebreak: '<br />',\n}\n"],"mappings":"AAGA,OAAO,MAAMA,2BAAA,GAA4E;EACvFC,SAAA,EAAW;AACb","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SerializedAutoLinkNode, SerializedLinkNode } from '../../../../../nodeTypes.js';
|
|
1
|
+
import type { SerializedAutoLinkNode, SerializedLinkNode } from '../../../../../types/nodeTypes.js';
|
|
2
2
|
import type { HTMLConvertersAsync, HTMLPopulateFn } from '../types.js';
|
|
3
3
|
export declare const LinkHTMLConverterAsync: (args: {
|
|
4
4
|
internalDocToHref?: (args: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/link.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/link.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACnG,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEtE,eAAO,MAAM,sBAAsB,EAAE,CAAC,IAAI,EAAE;IAC1C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QACzB,QAAQ,EAAE,kBAAkB,CAAA;QAC5B,QAAQ,CAAC,EAAE,cAAc,CAAA;KAC1B,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAA;CAC/B,KAAK,mBAAmB,CAAC,sBAAsB,GAAG,kBAAkB,CAsCnE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","names":["escapeHTML","sanitizeUrl","LinkHTMLConverterAsync","internalDocToHref","autolink","node","nodesToHTML","providedStyleTag","children","nodes","join","href","fields","url","newTab","link","populate","linkType","linkNode","console","error","safeHref"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/link.ts"],"sourcesContent":["import escapeHTML from 'escape-html'\nimport { sanitizeUrl } from 'payload/shared'\n\nimport type { SerializedAutoLinkNode, SerializedLinkNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync, HTMLPopulateFn } from '../types.js'\n\nexport const LinkHTMLConverterAsync: (args: {\n internalDocToHref?: (args: {\n linkNode: SerializedLinkNode\n populate?: HTMLPopulateFn\n }) => Promise<string> | string\n}) => HTMLConvertersAsync<SerializedAutoLinkNode | SerializedLinkNode> = ({\n internalDocToHref,\n}) => ({\n autolink: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const href = escapeHTML(sanitizeUrl(node.fields.url ?? ''))\n\n return `<a${providedStyleTag} href=\"${href}\"${node.fields.newTab ? ' rel=\"noopener noreferrer\" target=\"_blank\"' : ''}>${children}</a>`\n },\n link: async ({ node, nodesToHTML, populate, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n let href: string = node.fields.url ?? ''\n if (node.fields.linkType === 'internal') {\n if (internalDocToHref) {\n href = await internalDocToHref({ linkNode: node, populate })\n } else {\n // eslint-disable-next-line no-console\n console.error(\n 'Lexical => HTML converter: Link converter: found internal link, but internalDocToHref is not provided',\n )\n href = '#' // fallback\n }\n }\n\n const safeHref = escapeHTML(sanitizeUrl(href))\n\n return `<a${providedStyleTag} href=\"${safeHref}\"${node.fields.newTab ? ' rel=\"noopener noreferrer\" target=\"_blank\"' : ''}>${children}</a>`\n },\n})\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,WAAW,QAAQ;AAK5B,OAAO,MAAMC,sBAAA,GAK4DA,CAAC;EACxEC;AAAiB,CAClB,MAAM;EACLC,QAAA,EAAU,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACtD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,MAAMC,IAAA,GAAOX,UAAA,CAAWC,WAAA,CAAYI,IAAA,CAAKO,MAAM,CAACC,GAAG,IAAI;IAEvD,OAAO,KAAKN,gBAAA,UAA0BI,IAAA,IAAQN,IAAA,CAAKO,MAAM,CAACE,MAAM,GAAG,+CAA+C,MAAMN,QAAA,MAAc;EACxI;EACAO,IAAA,EAAM,MAAAA,CAAO;IAAEV,IAAI;IAAEC,WAAW;IAAEU,QAAQ;IAAET;EAAgB,CAAE;IAC5D,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,IAAIC,IAAA,GAAeN,IAAA,CAAKO,MAAM,CAACC,GAAG,IAAI;IACtC,IAAIR,IAAA,CAAKO,MAAM,CAACK,QAAQ,KAAK,YAAY;MACvC,IAAId,iBAAA,EAAmB;QACrBQ,IAAA,GAAO,MAAMR,iBAAA,CAAkB;UAAEe,QAAA,EAAUb,IAAA;UAAMW;QAAS;MAC5D,OAAO;QACL;QACAG,OAAA,CAAQC,KAAK,CACX;QAEFT,IAAA,GAAO,KAAI;MACb;IACF;IAEA,MAAMU,QAAA,GAAWrB,UAAA,CAAWC,WAAA,CAAYU,IAAA;IAExC,OAAO,KAAKJ,gBAAA,UAA0Bc,QAAA,IAAYhB,IAAA,CAAKO,MAAM,CAACE,MAAM,GAAG,+CAA+C,MAAMN,QAAA,MAAc;EAC5I;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"link.js","names":["escapeHTML","sanitizeUrl","LinkHTMLConverterAsync","internalDocToHref","autolink","node","nodesToHTML","providedStyleTag","children","nodes","join","href","fields","url","newTab","link","populate","linkType","linkNode","console","error","safeHref"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/link.ts"],"sourcesContent":["import escapeHTML from 'escape-html'\nimport { sanitizeUrl } from 'payload/shared'\n\nimport type { SerializedAutoLinkNode, SerializedLinkNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync, HTMLPopulateFn } from '../types.js'\n\nexport const LinkHTMLConverterAsync: (args: {\n internalDocToHref?: (args: {\n linkNode: SerializedLinkNode\n populate?: HTMLPopulateFn\n }) => Promise<string> | string\n}) => HTMLConvertersAsync<SerializedAutoLinkNode | SerializedLinkNode> = ({\n internalDocToHref,\n}) => ({\n autolink: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const href = escapeHTML(sanitizeUrl(node.fields.url ?? ''))\n\n return `<a${providedStyleTag} href=\"${href}\"${node.fields.newTab ? ' rel=\"noopener noreferrer\" target=\"_blank\"' : ''}>${children}</a>`\n },\n link: async ({ node, nodesToHTML, populate, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n let href: string = node.fields.url ?? ''\n if (node.fields.linkType === 'internal') {\n if (internalDocToHref) {\n href = await internalDocToHref({ linkNode: node, populate })\n } else {\n // eslint-disable-next-line no-console\n console.error(\n 'Lexical => HTML converter: Link converter: found internal link, but internalDocToHref is not provided',\n )\n href = '#' // fallback\n }\n }\n\n const safeHref = escapeHTML(sanitizeUrl(href))\n\n return `<a${providedStyleTag} href=\"${safeHref}\"${node.fields.newTab ? ' rel=\"noopener noreferrer\" target=\"_blank\"' : ''}>${children}</a>`\n },\n})\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,WAAW,QAAQ;AAK5B,OAAO,MAAMC,sBAAA,GAK4DA,CAAC;EACxEC;AAAiB,CAClB,MAAM;EACLC,QAAA,EAAU,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACtD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,MAAMC,IAAA,GAAOX,UAAA,CAAWC,WAAA,CAAYI,IAAA,CAAKO,MAAM,CAACC,GAAG,IAAI;IAEvD,OAAO,KAAKN,gBAAA,UAA0BI,IAAA,IAAQN,IAAA,CAAKO,MAAM,CAACE,MAAM,GAAG,+CAA+C,MAAMN,QAAA,MAAc;EACxI;EACAO,IAAA,EAAM,MAAAA,CAAO;IAAEV,IAAI;IAAEC,WAAW;IAAEU,QAAQ;IAAET;EAAgB,CAAE;IAC5D,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,IAAIC,IAAA,GAAeN,IAAA,CAAKO,MAAM,CAACC,GAAG,IAAI;IACtC,IAAIR,IAAA,CAAKO,MAAM,CAACK,QAAQ,KAAK,YAAY;MACvC,IAAId,iBAAA,EAAmB;QACrBQ,IAAA,GAAO,MAAMR,iBAAA,CAAkB;UAAEe,QAAA,EAAUb,IAAA;UAAMW;QAAS;MAC5D,OAAO;QACL;QACAG,OAAA,CAAQC,KAAK,CACX;QAEFT,IAAA,GAAO,KAAI;MACb;IACF;IAEA,MAAMU,QAAA,GAAWrB,UAAA,CAAWC,WAAA,CAAYU,IAAA;IAExC,OAAO,KAAKJ,gBAAA,UAA0Bc,QAAA,IAAYhB,IAAA,CAAKO,MAAM,CAACE,MAAM,GAAG,+CAA+C,MAAMN,QAAA,MAAc;EAC5I;AACF","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SerializedListItemNode, SerializedListNode } from '../../../../../nodeTypes.js';
|
|
1
|
+
import type { SerializedListItemNode, SerializedListNode } from '../../../../../types/nodeTypes.js';
|
|
2
2
|
import type { HTMLConvertersAsync } from '../types.js';
|
|
3
3
|
export declare const ListHTMLConverterAsync: HTMLConvertersAsync<SerializedListItemNode | SerializedListNode>;
|
|
4
4
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/list.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/list.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACnG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAKtD,eAAO,MAAM,sBAAsB,EAAE,mBAAmB,CACtD,sBAAsB,GAAG,kBAAkB,CAiD5C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","names":["v4","uuidv4","ALLOWED_LIST_TAGS","Set","ALLOWED_LIST_TYPES","ListHTMLConverterAsync","list","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has","listType","listitem","parent","providedCSSString","hasSubLists","some","child","type","uuid","checked","value"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/list.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nconst ALLOWED_LIST_TAGS = new Set(['ol', 'ul'])\nconst ALLOWED_LIST_TYPES = new Set(['bullet', 'check', 'number'])\n\nexport const ListHTMLConverterAsync: HTMLConvertersAsync<\n SerializedListItemNode | SerializedListNode\n> = {\n list: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const tag = ALLOWED_LIST_TAGS.has(node.tag) ? node.tag : 'ul'\n const listType = ALLOWED_LIST_TYPES.has(node.listType) ? node.listType : 'bullet'\n\n return `<${tag}${providedStyleTag} class=\"list-${listType}\">${children}</${tag}>`\n },\n listitem: async ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n return `<li\n aria-checked=\"${node.checked ? 'true' : 'false'}\"\n class=\"list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}\"\n role=\"checkbox\"\n style=\"list-style-type: none;${providedCSSString}\"\n tabIndex=\"-1\"\n value=\"${node.value}\"\n >\n ${\n hasSubLists\n ? children\n : `<input${node.checked ? ' checked' : ''} id=\"${uuid}\" readOnly=\"true\" type=\"checkbox\" />\n <label htmlFor=\"${uuid}\">${children}</label>\n <br />`\n }\n </li>`\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\"${node.value}\"\n >${children}</li>`\n }\n },\n}\n"],"mappings":"AAAA,SAASA,EAAA,IAAMC,MAAM,QAAQ;AAK7B,MAAMC,iBAAA,GAAoB,IAAIC,GAAA,CAAI,CAAC,MAAM,KAAK;AAC9C,MAAMC,kBAAA,GAAqB,IAAID,GAAA,CAAI,CAAC,UAAU,SAAS,SAAS;AAEhE,OAAO,MAAME,sBAAA,GAET;EACFC,IAAA,EAAM,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IAClD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,MAAMC,GAAA,GAAMX,iBAAA,CAAkBY,GAAG,CAACP,IAAA,CAAKM,GAAG,IAAIN,IAAA,CAAKM,GAAG,GAAG;IACzD,MAAME,QAAA,GAAWX,kBAAA,CAAmBU,GAAG,CAACP,IAAA,CAAKQ,QAAQ,IAAIR,IAAA,CAAKQ,QAAQ,GAAG;IAEzE,OAAO,IAAIF,GAAA,GAAMJ,gBAAA,gBAAgCM,QAAA,KAAaL,QAAA,KAAaG,GAAA,GAAM;EACnF;EACAG,QAAA,EAAU,MAAAA,CAAO;IAAET,IAAI;IAAEC,WAAW;IAAES,MAAM;IAAEC;EAAiB,CAAE;IAC/D,MAAMC,WAAA,GAAcZ,IAAA,CAAKG,QAAQ,CAACU,IAAI,CAAEC,KAAA,IAAUA,KAAA,CAAMC,IAAI,KAAK;IAEjE,MAAMZ,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,IAAI,cAAcK,MAAA,IAAUA,MAAA,EAAQF,QAAA,KAAa,SAAS;MACxD,MAAMQ,IAAA,GAAOtB,MAAA;MACb,OAAO;0BACaM,IAAA,CAAKiB,OAAO,GAAG,SAAS;qCACbjB,IAAA,CAAKiB,OAAO,GAAG,gCAAgC,kCAAkCL,WAAA,GAAc,oBAAoB;;yCAE/GD,iBAAA;;mBAEtBX,IAAA,CAAKkB,KAAK;;YAGjBN,WAAA,GACIT,QAAA,GACA,SAASH,IAAA,CAAKiB,OAAO,GAAG,aAAa,UAAUD,IAAA;8BACjCA,IAAA,KAASb,QAAA;mBACpB;cAEL;IACV,OAAO;MACL,OAAO;mBACMS,WAAA,GAAc,mBAAmB;mBACjCA,WAAA,GAAc,yBAAyBD,iBAAA,EAAmB,GAAGA,iBAAA;mBAC7DX,IAAA,CAAKkB,KAAK;WAClBf,QAAA,OAAe;IACtB;EACF;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"list.js","names":["v4","uuidv4","ALLOWED_LIST_TAGS","Set","ALLOWED_LIST_TYPES","ListHTMLConverterAsync","list","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has","listType","listitem","parent","providedCSSString","hasSubLists","some","child","type","uuid","checked","value"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/list.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nconst ALLOWED_LIST_TAGS = new Set(['ol', 'ul'])\nconst ALLOWED_LIST_TYPES = new Set(['bullet', 'check', 'number'])\n\nexport const ListHTMLConverterAsync: HTMLConvertersAsync<\n SerializedListItemNode | SerializedListNode\n> = {\n list: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const tag = ALLOWED_LIST_TAGS.has(node.tag) ? node.tag : 'ul'\n const listType = ALLOWED_LIST_TYPES.has(node.listType) ? node.listType : 'bullet'\n\n return `<${tag}${providedStyleTag} class=\"list-${listType}\">${children}</${tag}>`\n },\n listitem: async ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n return `<li\n aria-checked=\"${node.checked ? 'true' : 'false'}\"\n class=\"list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}\"\n role=\"checkbox\"\n style=\"list-style-type: none;${providedCSSString}\"\n tabIndex=\"-1\"\n value=\"${node.value}\"\n >\n ${\n hasSubLists\n ? children\n : `<input${node.checked ? ' checked' : ''} id=\"${uuid}\" readOnly=\"true\" type=\"checkbox\" />\n <label htmlFor=\"${uuid}\">${children}</label>\n <br />`\n }\n </li>`\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\"${node.value}\"\n >${children}</li>`\n }\n },\n}\n"],"mappings":"AAAA,SAASA,EAAA,IAAMC,MAAM,QAAQ;AAK7B,MAAMC,iBAAA,GAAoB,IAAIC,GAAA,CAAI,CAAC,MAAM,KAAK;AAC9C,MAAMC,kBAAA,GAAqB,IAAID,GAAA,CAAI,CAAC,UAAU,SAAS,SAAS;AAEhE,OAAO,MAAME,sBAAA,GAET;EACFC,IAAA,EAAM,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IAClD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,MAAMC,GAAA,GAAMX,iBAAA,CAAkBY,GAAG,CAACP,IAAA,CAAKM,GAAG,IAAIN,IAAA,CAAKM,GAAG,GAAG;IACzD,MAAME,QAAA,GAAWX,kBAAA,CAAmBU,GAAG,CAACP,IAAA,CAAKQ,QAAQ,IAAIR,IAAA,CAAKQ,QAAQ,GAAG;IAEzE,OAAO,IAAIF,GAAA,GAAMJ,gBAAA,gBAAgCM,QAAA,KAAaL,QAAA,KAAaG,GAAA,GAAM;EACnF;EACAG,QAAA,EAAU,MAAAA,CAAO;IAAET,IAAI;IAAEC,WAAW;IAAES,MAAM;IAAEC;EAAiB,CAAE;IAC/D,MAAMC,WAAA,GAAcZ,IAAA,CAAKG,QAAQ,CAACU,IAAI,CAAEC,KAAA,IAAUA,KAAA,CAAMC,IAAI,KAAK;IAEjE,MAAMZ,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,IAAI,cAAcK,MAAA,IAAUA,MAAA,EAAQF,QAAA,KAAa,SAAS;MACxD,MAAMQ,IAAA,GAAOtB,MAAA;MACb,OAAO;0BACaM,IAAA,CAAKiB,OAAO,GAAG,SAAS;qCACbjB,IAAA,CAAKiB,OAAO,GAAG,gCAAgC,kCAAkCL,WAAA,GAAc,oBAAoB;;yCAE/GD,iBAAA;;mBAEtBX,IAAA,CAAKkB,KAAK;;YAGjBN,WAAA,GACIT,QAAA,GACA,SAASH,IAAA,CAAKiB,OAAO,GAAG,aAAa,UAAUD,IAAA;8BACjCA,IAAA,KAASb,QAAA;mBACpB;cAEL;IACV,OAAO;MACL,OAAO;mBACMS,WAAA,GAAc,mBAAmB;mBACjCA,WAAA,GAAc,yBAAyBD,iBAAA,EAAmB,GAAGA,iBAAA;mBAC7DX,IAAA,CAAKkB,KAAK;WAClBf,QAAA,OAAe;IACtB;EACF;AACF","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SerializedParagraphNode } from '../../../../../nodeTypes.js';
|
|
1
|
+
import type { SerializedParagraphNode } from '../../../../../types/nodeTypes.js';
|
|
2
2
|
import type { HTMLConvertersAsync } from '../types.js';
|
|
3
3
|
export declare const ParagraphHTMLConverterAsync: HTMLConvertersAsync<SerializedParagraphNode>;
|
|
4
4
|
//# sourceMappingURL=paragraph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/paragraph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/paragraph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,eAAO,MAAM,2BAA2B,EAAE,mBAAmB,CAAC,uBAAuB,CAYpF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraph.js","names":["ParagraphHTMLConverterAsync","paragraph","node","nodesToHTML","providedStyleTag","children","nodes","length","join"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/paragraph.ts"],"sourcesContent":["import type { SerializedParagraphNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const ParagraphHTMLConverterAsync: HTMLConvertersAsync<SerializedParagraphNode> = {\n paragraph: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = await nodesToHTML({\n nodes: node.children,\n })\n\n if (!children?.length) {\n return `<p${providedStyleTag}><br /></p>`\n }\n\n return `<p${providedStyleTag}>${children.join('')}</p>`\n },\n}\n"],"mappings":"AAGA,OAAO,MAAMA,2BAAA,GAA4E;EACvFC,SAAA,EAAW,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACvD,MAAMC,QAAA,GAAW,MAAMF,WAAA,CAAY;MACjCG,KAAA,EAAOJ,IAAA,CAAKG;IACd;IAEA,IAAI,CAACA,QAAA,EAAUE,MAAA,EAAQ;MACrB,OAAO,KAAKH,gBAAA,aAA6B;IAC3C;IAEA,OAAO,KAAKA,gBAAA,IAAoBC,QAAA,CAASG,IAAI,CAAC,SAAS;EACzD;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"paragraph.js","names":["ParagraphHTMLConverterAsync","paragraph","node","nodesToHTML","providedStyleTag","children","nodes","length","join"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/paragraph.ts"],"sourcesContent":["import type { SerializedParagraphNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const ParagraphHTMLConverterAsync: HTMLConvertersAsync<SerializedParagraphNode> = {\n paragraph: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = await nodesToHTML({\n nodes: node.children,\n })\n\n if (!children?.length) {\n return `<p${providedStyleTag}><br /></p>`\n }\n\n return `<p${providedStyleTag}>${children.join('')}</p>`\n },\n}\n"],"mappings":"AAGA,OAAO,MAAMA,2BAAA,GAA4E;EACvFC,SAAA,EAAW,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACvD,MAAMC,QAAA,GAAW,MAAMF,WAAA,CAAY;MACjCG,KAAA,EAAOJ,IAAA,CAAKG;IACd;IAEA,IAAI,CAACA,QAAA,EAAUE,MAAA,EAAQ;MACrB,OAAO,KAAKH,gBAAA,aAA6B;IAC3C;IAEA,OAAO,KAAKA,gBAAA,IAAoBC,QAAA,CAASG,IAAI,CAAC,SAAS;EACzD;AACF","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SerializedTabNode } from '../../../../../nodeTypes.js';
|
|
1
|
+
import type { SerializedTabNode } from '../../../../../types/nodeTypes.js';
|
|
2
2
|
import type { HTMLConvertersAsync } from '../types.js';
|
|
3
3
|
export declare const TabHTMLConverterAsync: HTMLConvertersAsync<SerializedTabNode>;
|
|
4
4
|
//# sourceMappingURL=tab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/tab.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/tab.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,eAAO,MAAM,qBAAqB,EAAE,mBAAmB,CAAC,iBAAiB,CAExE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.js","names":["TabHTMLConverterAsync","tab"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/tab.ts"],"sourcesContent":["import type { SerializedTabNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const TabHTMLConverterAsync: HTMLConvertersAsync<SerializedTabNode> = {\n tab: '\\t',\n}\n"],"mappings":"AAGA,OAAO,MAAMA,qBAAA,GAAgE;EAC3EC,GAAA,EAAK;AACP","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"tab.js","names":["TabHTMLConverterAsync","tab"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/tab.ts"],"sourcesContent":["import type { SerializedTabNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const TabHTMLConverterAsync: HTMLConvertersAsync<SerializedTabNode> = {\n tab: '\\t',\n}\n"],"mappings":"AAGA,OAAO,MAAMA,qBAAA,GAAgE;EAC3EC,GAAA,EAAK;AACP","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SerializedTableCellNode, SerializedTableNode, SerializedTableRowNode } from '../../../../../nodeTypes.js';
|
|
1
|
+
import type { SerializedTableCellNode, SerializedTableNode, SerializedTableRowNode } from '../../../../../types/nodeTypes.js';
|
|
2
2
|
import type { HTMLConvertersAsync } from '../types.js';
|
|
3
3
|
export declare const TableHTMLConverterAsync: HTMLConvertersAsync<SerializedTableCellNode | SerializedTableNode | SerializedTableRowNode>;
|
|
4
4
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAItD,eAAO,MAAM,uBAAuB,EAAE,mBAAmB,CACvD,uBAAuB,GAAG,mBAAmB,GAAG,sBAAsB,CAwDvE,CAAA"}
|
|
@@ -24,7 +24,7 @@ export const TableHTMLConverterAsync = {
|
|
|
24
24
|
})).join('');
|
|
25
25
|
const TagName = node.headerState > 0 ? 'th' : 'td';
|
|
26
26
|
const headerStateClass = `lexical-table-cell-header-${node.headerState}`;
|
|
27
|
-
let style = 'border:
|
|
27
|
+
let style = 'border: var(--stroke-width-small) solid #ccc; padding: 8px;' + providedCSSString;
|
|
28
28
|
if (node.backgroundColor && isSafeCssColor(node.backgroundColor)) {
|
|
29
29
|
style += ` background-color: ${node.backgroundColor};`;
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","names":["isSafeCssColor","TableHTMLConverterAsync","table","node","nodesToHTML","providedStyleTag","children","nodes","join","tablecell","providedCSSString","TagName","headerState","headerStateClass","style","backgroundColor","colSpanAttr","colSpan","rowSpanAttr","rowSpan","tablerow"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/table.ts"],"sourcesContent":["import type {\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n} from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nimport { isSafeCssColor } from '../../shared/cssColors.js'\n\nexport const TableHTMLConverterAsync: HTMLConvertersAsync<\n SerializedTableCellNode | SerializedTableNode | SerializedTableRowNode\n> = {\n table: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n return `<div${providedStyleTag} class=\"lexical-table-container\">\n <table class=\"lexical-table\" style=\"border-collapse: collapse;\">\n <tbody>${children}</tbody>\n </table>\n </div>`\n },\n\n tablecell: async ({ node, nodesToHTML, providedCSSString }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const TagName = node.headerState > 0 ? 'th' : 'td'\n const headerStateClass = `lexical-table-cell-header-${node.headerState}`\n\n let style = 'border:
|
|
1
|
+
{"version":3,"file":"table.js","names":["isSafeCssColor","TableHTMLConverterAsync","table","node","nodesToHTML","providedStyleTag","children","nodes","join","tablecell","providedCSSString","TagName","headerState","headerStateClass","style","backgroundColor","colSpanAttr","colSpan","rowSpanAttr","rowSpan","tablerow"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/table.ts"],"sourcesContent":["import type {\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n} from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nimport { isSafeCssColor } from '../../shared/cssColors.js'\n\nexport const TableHTMLConverterAsync: HTMLConvertersAsync<\n SerializedTableCellNode | SerializedTableNode | SerializedTableRowNode\n> = {\n table: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n return `<div${providedStyleTag} class=\"lexical-table-container\">\n <table class=\"lexical-table\" style=\"border-collapse: collapse;\">\n <tbody>${children}</tbody>\n </table>\n </div>`\n },\n\n tablecell: async ({ node, nodesToHTML, providedCSSString }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const TagName = node.headerState > 0 ? 'th' : 'td'\n const headerStateClass = `lexical-table-cell-header-${node.headerState}`\n\n let style = 'border: var(--stroke-width-small) solid #ccc; padding: 8px;' + providedCSSString\n if (node.backgroundColor && isSafeCssColor(node.backgroundColor)) {\n style += ` background-color: ${node.backgroundColor};`\n }\n\n const colSpanAttr = node.colSpan && node.colSpan > 1 ? ` colspan=\"${node.colSpan}\"` : ''\n const rowSpanAttr = node.rowSpan && node.rowSpan > 1 ? ` rowspan=\"${node.rowSpan}\"` : ''\n\n return `<${TagName}\n class=\"lexical-table-cell ${headerStateClass}\"\n ${colSpanAttr}\n ${rowSpanAttr}\n style=\"${style}\"\n >\n ${children}\n </${TagName}>\n `\n },\n\n tablerow: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n return `<tr${providedStyleTag} class=\"lexical-table-row\">\n ${children}\n </tr>`\n },\n}\n"],"mappings":"AAOA,SAASA,cAAc,QAAQ;AAE/B,OAAO,MAAMC,uBAAA,GAET;EACFC,KAAA,EAAO,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACnD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,OAAO,OAAOH,gBAAA;;mBAECC,QAAA;;aAEN;EACX;EAEAG,SAAA,EAAW,MAAAA,CAAO;IAAEN,IAAI;IAAEC,WAAW;IAAEM;EAAiB,CAAE;IACxD,MAAMJ,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,MAAMG,OAAA,GAAUR,IAAA,CAAKS,WAAW,GAAG,IAAI,OAAO;IAC9C,MAAMC,gBAAA,GAAmB,6BAA6BV,IAAA,CAAKS,WAAW,EAAE;IAExE,IAAIE,KAAA,GAAQ,gEAAgEJ,iBAAA;IAC5E,IAAIP,IAAA,CAAKY,eAAe,IAAIf,cAAA,CAAeG,IAAA,CAAKY,eAAe,GAAG;MAChED,KAAA,IAAS,sBAAsBX,IAAA,CAAKY,eAAe,GAAG;IACxD;IAEA,MAAMC,WAAA,GAAcb,IAAA,CAAKc,OAAO,IAAId,IAAA,CAAKc,OAAO,GAAG,IAAI,aAAad,IAAA,CAAKc,OAAO,GAAG,GAAG;IACtF,MAAMC,WAAA,GAAcf,IAAA,CAAKgB,OAAO,IAAIhB,IAAA,CAAKgB,OAAO,GAAG,IAAI,aAAahB,IAAA,CAAKgB,OAAO,GAAG,GAAG;IAEtF,OAAO,IAAIR,OAAA;oCACqBE,gBAAA;UAC1BG,WAAA;UACAE,WAAA;iBACOJ,KAAA;;UAEPR,QAAA;UACAK,OAAA;KACL;EACH;EAEAS,QAAA,EAAU,MAAAA,CAAO;IAAEjB,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACtD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,OAAO,MAAMH,gBAAA;UACPC,QAAA;YACE;EACV;AACF","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SerializedTextNode } from '../../../../../nodeTypes.js';
|
|
1
|
+
import type { SerializedTextNode } from '../../../../../types/nodeTypes.js';
|
|
2
2
|
import type { HTMLConvertersAsync } from '../types.js';
|
|
3
3
|
export declare const TextHTMLConverterAsync: HTMLConvertersAsync<SerializedTextNode>;
|
|
4
4
|
//# sourceMappingURL=text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/text.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/text.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAItD,eAAO,MAAM,sBAAsB,EAAE,mBAAmB,CAAC,kBAAkB,CA4B1E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","names":["escapeHTML","NodeFormat","TextHTMLConverterAsync","text","node","format","IS_BOLD","IS_ITALIC","IS_STRIKETHROUGH","IS_UNDERLINE","IS_CODE","IS_SUBSCRIPT","IS_SUPERSCRIPT"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/text.ts"],"sourcesContent":["import escapeHTML from 'escape-html'\n\nimport type { SerializedTextNode } from '../../../../../nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nimport { NodeFormat } from '../../../../../lexical/utils/nodeFormat.js'\n\nexport const TextHTMLConverterAsync: HTMLConvertersAsync<SerializedTextNode> = {\n text: ({ node }) => {\n let text = escapeHTML(node.text)\n\n if (node.format & NodeFormat.IS_BOLD) {\n text = `<strong>${text}</strong>`\n }\n if (node.format & NodeFormat.IS_ITALIC) {\n text = `<em>${text}</em>`\n }\n if (node.format & NodeFormat.IS_STRIKETHROUGH) {\n text = `<span style=\"text-decoration: line-through;\">${text}</span>`\n }\n if (node.format & NodeFormat.IS_UNDERLINE) {\n text = `<span style=\"text-decoration: underline;\">${text}</span>`\n }\n if (node.format & NodeFormat.IS_CODE) {\n text = `<code>${text}</code>`\n }\n if (node.format & NodeFormat.IS_SUBSCRIPT) {\n text = `<sub>${text}</sub>`\n }\n if (node.format & NodeFormat.IS_SUPERSCRIPT) {\n text = `<sup>${text}</sup>`\n }\n\n return text\n },\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AAKvB,SAASC,UAAU,QAAQ;AAE3B,OAAO,MAAMC,sBAAA,GAAkE;EAC7EC,IAAA,EAAMA,CAAC;IAAEC;EAAI,CAAE;IACb,IAAID,IAAA,GAAOH,UAAA,CAAWI,IAAA,CAAKD,IAAI;IAE/B,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWK,OAAO,EAAE;MACpCH,IAAA,GAAO,WAAWA,IAAA,WAAe;IACnC;IACA,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWM,SAAS,EAAE;MACtCJ,IAAA,GAAO,OAAOA,IAAA,OAAW;IAC3B;IACA,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWO,gBAAgB,EAAE;MAC7CL,IAAA,GAAO,gDAAgDA,IAAA,SAAa;IACtE;IACA,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWQ,YAAY,EAAE;MACzCN,IAAA,GAAO,6CAA6CA,IAAA,SAAa;IACnE;IACA,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWS,OAAO,EAAE;MACpCP,IAAA,GAAO,SAASA,IAAA,SAAa;IAC/B;IACA,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWU,YAAY,EAAE;MACzCR,IAAA,GAAO,QAAQA,IAAA,QAAY;IAC7B;IACA,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWW,cAAc,EAAE;MAC3CT,IAAA,GAAO,QAAQA,IAAA,QAAY;IAC7B;IAEA,OAAOA,IAAA;EACT;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"text.js","names":["escapeHTML","NodeFormat","TextHTMLConverterAsync","text","node","format","IS_BOLD","IS_ITALIC","IS_STRIKETHROUGH","IS_UNDERLINE","IS_CODE","IS_SUBSCRIPT","IS_SUPERSCRIPT"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/text.ts"],"sourcesContent":["import escapeHTML from 'escape-html'\n\nimport type { SerializedTextNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nimport { NodeFormat } from '../../../../../lexical/utils/nodeFormat.js'\n\nexport const TextHTMLConverterAsync: HTMLConvertersAsync<SerializedTextNode> = {\n text: ({ node }) => {\n let text = escapeHTML(node.text)\n\n if (node.format & NodeFormat.IS_BOLD) {\n text = `<strong>${text}</strong>`\n }\n if (node.format & NodeFormat.IS_ITALIC) {\n text = `<em>${text}</em>`\n }\n if (node.format & NodeFormat.IS_STRIKETHROUGH) {\n text = `<span style=\"text-decoration: line-through;\">${text}</span>`\n }\n if (node.format & NodeFormat.IS_UNDERLINE) {\n text = `<span style=\"text-decoration: underline;\">${text}</span>`\n }\n if (node.format & NodeFormat.IS_CODE) {\n text = `<code>${text}</code>`\n }\n if (node.format & NodeFormat.IS_SUBSCRIPT) {\n text = `<sub>${text}</sub>`\n }\n if (node.format & NodeFormat.IS_SUPERSCRIPT) {\n text = `<sup>${text}</sup>`\n }\n\n return text\n },\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AAKvB,SAASC,UAAU,QAAQ;AAE3B,OAAO,MAAMC,sBAAA,GAAkE;EAC7EC,IAAA,EAAMA,CAAC;IAAEC;EAAI,CAAE;IACb,IAAID,IAAA,GAAOH,UAAA,CAAWI,IAAA,CAAKD,IAAI;IAE/B,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWK,OAAO,EAAE;MACpCH,IAAA,GAAO,WAAWA,IAAA,WAAe;IACnC;IACA,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWM,SAAS,EAAE;MACtCJ,IAAA,GAAO,OAAOA,IAAA,OAAW;IAC3B;IACA,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWO,gBAAgB,EAAE;MAC7CL,IAAA,GAAO,gDAAgDA,IAAA,SAAa;IACtE;IACA,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWQ,YAAY,EAAE;MACzCN,IAAA,GAAO,6CAA6CA,IAAA,SAAa;IACnE;IACA,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWS,OAAO,EAAE;MACpCP,IAAA,GAAO,SAASA,IAAA,SAAa;IAC/B;IACA,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWU,YAAY,EAAE;MACzCR,IAAA,GAAO,QAAQA,IAAA,QAAY;IAC7B;IACA,IAAIC,IAAA,CAAKC,MAAM,GAAGJ,UAAA,CAAWW,cAAc,EAAE;MAC3CT,IAAA,GAAO,QAAQA,IAAA,QAAY;IAC7B;IAEA,OAAOA,IAAA;EACT;AACF","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SerializedUploadNode } from '../../../../../nodeTypes.js';
|
|
1
|
+
import type { SerializedUploadNode } from '../../../../../types/nodeTypes.js';
|
|
2
2
|
import type { HTMLConvertersAsync } from '../types.js';
|
|
3
3
|
export declare const UploadHTMLConverterAsync: HTMLConvertersAsync<SerializedUploadNode>;
|
|
4
4
|
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/upload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/upload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAE7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,eAAO,MAAM,wBAAwB,EAAE,mBAAmB,CAAC,oBAAoB,CAoF9E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","names":["escapeHTML","UploadHTMLConverterAsync","upload","node","populate","providedStyleTag","uploadNode","uploadDoc","undefined","value","id","collectionSlug","relationTo","alt","fields","url","mimeType","startsWith","filename","sizes","Object","keys","length","String","height","width","pictureHTML","size","imageSize","filesize"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/upload.ts"],"sourcesContent":["import type { FileData,
|
|
1
|
+
{"version":3,"file":"upload.js","names":["escapeHTML","UploadHTMLConverterAsync","upload","node","populate","providedStyleTag","uploadNode","uploadDoc","undefined","value","id","collectionSlug","relationTo","alt","fields","url","mimeType","startsWith","filename","sizes","Object","keys","length","String","height","width","pictureHTML","size","imageSize","filesize"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/upload.ts"],"sourcesContent":["import type { FileData, FileSize, TypeWithID } from 'payload'\n\nimport escapeHTML from 'escape-html'\n\nimport type { SerializedUploadNode } from '../../../../../types/nodeTypes.js'\nimport type { UploadDataImproved } from '../../../../upload/server/schema.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const UploadHTMLConverterAsync: HTMLConvertersAsync<SerializedUploadNode> = {\n upload: async ({ node, populate, providedStyleTag }) => {\n const uploadNode = node as UploadDataImproved\n\n let uploadDoc: (FileData & TypeWithID) | undefined = undefined\n\n // If there's no valid upload data, populate return an empty string\n if (typeof uploadNode.value !== 'object') {\n if (!populate) {\n return ''\n }\n uploadDoc = await populate<FileData & TypeWithID>({\n id: uploadNode.value,\n collectionSlug: uploadNode.relationTo,\n })\n } else {\n uploadDoc = uploadNode.value as unknown as FileData & TypeWithID\n }\n\n if (!uploadDoc) {\n return ''\n }\n\n const alt = escapeHTML(\n (node.fields?.alt as string) || (uploadDoc as { alt?: string })?.alt || '',\n )\n\n const url = escapeHTML(uploadDoc.url ?? '')\n\n // 1) If upload is NOT an image, return a link\n if (!uploadDoc.mimeType.startsWith('image')) {\n return `<a${providedStyleTag} href=\"${url}\" rel=\"noopener noreferrer\">${escapeHTML(uploadDoc.filename ?? '')}</a>`\n }\n\n // 2) If image has no different sizes, return a simple <img />\n if (!uploadDoc.sizes || !Object.keys(uploadDoc.sizes).length) {\n return `\n <img${providedStyleTag}\n alt=\"${alt}\"\n height=\"${escapeHTML(String(uploadDoc.height ?? ''))}\"\n src=\"${url}\"\n width=\"${escapeHTML(String(uploadDoc.width ?? ''))}\"\n />\n `\n }\n\n // 3) If image has different sizes, build a <picture> element with <source> tags\n let pictureHTML = ''\n\n for (const size in uploadDoc.sizes) {\n const imageSize = uploadDoc.sizes[size] as FileSize\n\n if (\n !imageSize ||\n !imageSize.width ||\n !imageSize.height ||\n !imageSize.mimeType ||\n !imageSize.filesize ||\n !imageSize.filename ||\n !imageSize.url\n ) {\n continue\n }\n\n pictureHTML += `\n <source\n media=\"(max-width: ${escapeHTML(String(imageSize.width))}px)\"\n srcset=\"${escapeHTML(imageSize.url)}\"\n type=\"${escapeHTML(imageSize.mimeType)}\"\n />\n `\n }\n\n pictureHTML += `\n <img\n alt=\"${alt}\"\n height=\"${escapeHTML(String(uploadDoc.height ?? ''))}\"\n src=\"${url}\"\n width=\"${escapeHTML(String(uploadDoc.width ?? ''))}\"\n />\n `\n\n return `<picture${providedStyleTag}>${pictureHTML}</picture>`\n },\n}\n"],"mappings":"AAEA,OAAOA,UAAA,MAAgB;AAMvB,OAAO,MAAMC,wBAAA,GAAsE;EACjFC,MAAA,EAAQ,MAAAA,CAAO;IAAEC,IAAI;IAAEC,QAAQ;IAAEC;EAAgB,CAAE;IACjD,MAAMC,UAAA,GAAaH,IAAA;IAEnB,IAAII,SAAA,GAAiDC,SAAA;IAErD;IACA,IAAI,OAAOF,UAAA,CAAWG,KAAK,KAAK,UAAU;MACxC,IAAI,CAACL,QAAA,EAAU;QACb,OAAO;MACT;MACAG,SAAA,GAAY,MAAMH,QAAA,CAAgC;QAChDM,EAAA,EAAIJ,UAAA,CAAWG,KAAK;QACpBE,cAAA,EAAgBL,UAAA,CAAWM;MAC7B;IACF,OAAO;MACLL,SAAA,GAAYD,UAAA,CAAWG,KAAK;IAC9B;IAEA,IAAI,CAACF,SAAA,EAAW;MACd,OAAO;IACT;IAEA,MAAMM,GAAA,GAAMb,UAAA,CACVG,IAAC,CAAKW,MAAM,EAAED,GAAA,IAAmBN,SAAA,EAAgCM,GAAA,IAAO;IAG1E,MAAME,GAAA,GAAMf,UAAA,CAAWO,SAAA,CAAUQ,GAAG,IAAI;IAExC;IACA,IAAI,CAACR,SAAA,CAAUS,QAAQ,CAACC,UAAU,CAAC,UAAU;MAC3C,OAAO,KAAKZ,gBAAA,UAA0BU,GAAA,+BAAkCf,UAAA,CAAWO,SAAA,CAAUW,QAAQ,IAAI,SAAS;IACpH;IAEA;IACA,IAAI,CAACX,SAAA,CAAUY,KAAK,IAAI,CAACC,MAAA,CAAOC,IAAI,CAACd,SAAA,CAAUY,KAAK,EAAEG,MAAM,EAAE;MAC5D,OAAO;cACCjB,gBAAA;iBACGQ,GAAA;oBACGb,UAAA,CAAWuB,MAAA,CAAOhB,SAAA,CAAUiB,MAAM,IAAI;iBACzCT,GAAA;mBACEf,UAAA,CAAWuB,MAAA,CAAOhB,SAAA,CAAUkB,KAAK,IAAI;;OAEjD;IACH;IAEA;IACA,IAAIC,WAAA,GAAc;IAElB,KAAK,MAAMC,IAAA,IAAQpB,SAAA,CAAUY,KAAK,EAAE;MAClC,MAAMS,SAAA,GAAYrB,SAAA,CAAUY,KAAK,CAACQ,IAAA,CAAK;MAEvC,IACE,CAACC,SAAA,IACD,CAACA,SAAA,CAAUH,KAAK,IAChB,CAACG,SAAA,CAAUJ,MAAM,IACjB,CAACI,SAAA,CAAUZ,QAAQ,IACnB,CAACY,SAAA,CAAUC,QAAQ,IACnB,CAACD,SAAA,CAAUV,QAAQ,IACnB,CAACU,SAAA,CAAUb,GAAG,EACd;QACA;MACF;MAEAW,WAAA,IAAe;;+BAEU1B,UAAA,CAAWuB,MAAA,CAAOK,SAAA,CAAUH,KAAK;oBAC5CzB,UAAA,CAAW4B,SAAA,CAAUb,GAAG;kBAC1Bf,UAAA,CAAW4B,SAAA,CAAUZ,QAAQ;;OAExC;IACH;IAEAU,WAAA,IAAe;;eAEJb,GAAA;kBACGb,UAAA,CAAWuB,MAAA,CAAOhB,SAAA,CAAUiB,MAAM,IAAI;eACzCT,GAAA;iBACEf,UAAA,CAAWuB,MAAA,CAAOhB,SAAA,CAAUkB,KAAK,IAAI;;KAEjD;IAED,OAAO,WAAWpB,gBAAA,IAAoBqB,WAAA,YAAuB;EAC/D;AACF","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DefaultNodeTypes } from '../../../../nodeTypes.js';
|
|
1
|
+
import type { DefaultNodeTypes } from '../../../../types/nodeTypes.js';
|
|
2
2
|
import type { HTMLConvertersAsync } from './types.js';
|
|
3
3
|
export declare const defaultHTMLConvertersAsync: HTMLConvertersAsync<DefaultNodeTypes>;
|
|
4
4
|
//# sourceMappingURL=defaultConverters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultConverters.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToHtml/async/defaultConverters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"defaultConverters.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToHtml/async/defaultConverters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAcrD,eAAO,MAAM,0BAA0B,EAAE,mBAAmB,CAAC,gBAAgB,CAY5E,CAAA"}
|