@payloadcms/richtext-lexical 3.0.0-canary.ff8c8fd → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/dist/cell/rscEntry.d.ts +12 -0
- package/dist/cell/rscEntry.d.ts.map +1 -0
- package/dist/cell/rscEntry.js +82 -0
- package/dist/cell/rscEntry.js.map +1 -0
- package/dist/exports/client/Field-KKSJXHR7.js +2 -0
- package/dist/exports/client/Field-KKSJXHR7.js.map +7 -0
- package/dist/exports/client/RelationshipComponent-2RT3YXUT.js +2 -0
- package/dist/exports/client/RelationshipComponent-2RT3YXUT.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-2CYU43GM.js +2 -0
- package/dist/exports/client/chunk-2CYU43GM.js.map +7 -0
- package/dist/exports/client/chunk-5PBXL4HT.js +2 -0
- package/dist/exports/client/chunk-5PBXL4HT.js.map +7 -0
- package/dist/exports/client/chunk-C7S3V4EB.js +2 -0
- package/dist/exports/client/chunk-C7S3V4EB.js.map +7 -0
- package/dist/exports/client/chunk-CUIBIFW2.js +2 -0
- package/dist/exports/client/chunk-CUIBIFW2.js.map +7 -0
- package/dist/exports/client/{chunk-UJDWBQ2K.js → chunk-MI5HS4QX.js} +2 -2
- package/dist/exports/client/{chunk-UJDWBQ2K.js.map → chunk-MI5HS4QX.js.map} +2 -2
- package/dist/exports/client/chunk-QPPOQTHD.js +2 -0
- package/dist/exports/client/chunk-QPPOQTHD.js.map +7 -0
- package/dist/exports/client/chunk-U7O7EYCP.js +2 -0
- package/dist/exports/client/chunk-U7O7EYCP.js.map +7 -0
- package/dist/exports/client/{chunk-V2LKLT2F.js → chunk-XCEM47RI.js} +3 -3
- package/dist/exports/client/{chunk-V2LKLT2F.js.map → chunk-XCEM47RI.js.map} +3 -3
- package/dist/exports/client/component-ANB7VZLA.js +2 -0
- package/dist/exports/client/component-ANB7VZLA.js.map +7 -0
- package/dist/exports/client/component-H3EYQ5KG.js +2 -0
- package/dist/exports/client/component-H3EYQ5KG.js.map +7 -0
- package/dist/exports/client/componentInline-ZGO3K4TA.js +2 -0
- package/dist/exports/client/componentInline-ZGO3K4TA.js.map +7 -0
- package/dist/exports/client/index.d.ts +10 -4
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +10 -8
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/server/ast/mdx.d.ts +7 -0
- package/dist/exports/server/ast/mdx.d.ts.map +1 -0
- package/dist/exports/server/ast/mdx.js +37 -0
- package/dist/exports/server/ast/mdx.js.map +1 -0
- package/dist/exports/server/rsc.d.ts +3 -0
- package/dist/exports/server/rsc.d.ts.map +1 -0
- package/dist/exports/server/rsc.js +3 -0
- package/dist/exports/server/rsc.js.map +1 -0
- package/dist/exports/shared.d.ts +4 -0
- package/dist/exports/shared.d.ts.map +1 -0
- package/dist/exports/shared.js +4 -0
- package/dist/exports/shared.js.map +1 -0
- package/dist/features/align/client/index.d.ts +1 -4
- package/dist/features/align/client/index.d.ts.map +1 -1
- package/dist/features/blockquote/client/index.d.ts +1 -4
- package/dist/features/blockquote/client/index.d.ts.map +1 -1
- package/dist/features/blockquote/markdownTransformer.js.map +1 -1
- package/dist/features/blockquote/server/index.d.ts +1 -1
- package/dist/features/blockquote/server/index.d.ts.map +1 -1
- package/dist/features/blockquote/server/index.js +5 -1
- package/dist/features/blockquote/server/index.js.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.d.ts +34 -8
- package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.js +66 -170
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/blocks/client/component/components/BlockCollapsible.d.ts +11 -0
- package/dist/features/blocks/client/component/components/BlockCollapsible.d.ts.map +1 -0
- package/dist/features/blocks/client/component/components/BlockCollapsible.js +37 -0
- package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -0
- package/dist/features/blocks/client/component/components/BlockEditButton.d.ts +3 -0
- package/dist/features/blocks/client/component/components/BlockEditButton.d.ts.map +1 -0
- package/dist/features/blocks/client/component/components/BlockEditButton.js +22 -0
- package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -0
- package/dist/features/blocks/client/component/components/BlockRemoveButton.d.ts +3 -0
- package/dist/features/blocks/client/component/components/BlockRemoveButton.d.ts.map +1 -0
- package/dist/features/blocks/client/component/components/BlockRemoveButton.js +22 -0
- package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -0
- package/dist/features/blocks/client/component/index.d.ts +1 -1
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +294 -93
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts +5 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js +28 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.d.ts +3 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js +22 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.d.ts +3 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js +22 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.d.ts +3 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js +22 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -0
- package/dist/features/blocks/client/componentInline/index.d.ts +14 -2
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +237 -63
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/index.d.ts +1 -8
- package/dist/features/blocks/client/index.d.ts.map +1 -1
- package/dist/features/blocks/client/index.js +140 -147
- package/dist/features/blocks/client/index.js.map +1 -1
- package/dist/features/blocks/client/markdownTransformer.d.ts +16 -0
- package/dist/features/blocks/client/markdownTransformer.d.ts.map +1 -0
- package/dist/features/blocks/client/markdownTransformer.js +144 -0
- package/dist/features/blocks/client/markdownTransformer.js.map +1 -0
- 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 +1 -3
- package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/client/plugin/commands.d.ts +0 -4
- package/dist/features/blocks/client/plugin/commands.d.ts.map +1 -1
- package/dist/features/blocks/client/plugin/commands.js +0 -1
- package/dist/features/blocks/client/plugin/commands.js.map +1 -1
- package/dist/features/blocks/client/plugin/index.d.ts +3 -4
- package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
- package/dist/features/blocks/client/plugin/index.js +25 -129
- package/dist/features/blocks/client/plugin/index.js.map +1 -1
- package/dist/features/blocks/server/index.d.ts +1 -2
- package/dist/features/blocks/server/index.d.ts.map +1 -1
- package/dist/features/blocks/server/index.js +72 -35
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.d.ts +22 -0
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.d.ts.map +1 -0
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js +136 -0
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js.map +1 -0
- package/dist/features/blocks/server/markdownTransformer.d.ts +22 -0
- package/dist/features/blocks/server/markdownTransformer.d.ts.map +1 -0
- package/dist/features/blocks/server/markdownTransformer.js +400 -0
- package/dist/features/blocks/server/markdownTransformer.js.map +1 -0
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts +11 -5
- 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 +3 -3
- 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/validate.d.ts.map +1 -1
- package/dist/features/blocks/server/validate.js +8 -5
- package/dist/features/blocks/server/validate.js.map +1 -1
- package/dist/features/converters/html/converter/converters/paragraph.d.ts.map +1 -1
- package/dist/features/converters/html/converter/converters/paragraph.js +4 -0
- package/dist/features/converters/html/converter/converters/paragraph.js.map +1 -1
- package/dist/features/converters/html/converter/converters/text.d.ts.map +1 -1
- package/dist/features/converters/html/converter/converters/text.js +2 -1
- package/dist/features/converters/html/converter/converters/text.js.map +1 -1
- package/dist/features/converters/html/converter/index.d.ts +11 -7
- package/dist/features/converters/html/converter/index.d.ts.map +1 -1
- package/dist/features/converters/html/converter/index.js +17 -1
- package/dist/features/converters/html/converter/index.js.map +1 -1
- package/dist/features/converters/html/converter/types.d.ts +3 -1
- package/dist/features/converters/html/converter/types.d.ts.map +1 -1
- package/dist/features/converters/html/converter/types.js.map +1 -1
- package/dist/features/converters/html/field/index.d.ts.map +1 -1
- package/dist/features/converters/html/field/index.js +7 -1
- package/dist/features/converters/html/field/index.js.map +1 -1
- package/dist/features/debug/testRecorder/client/index.d.ts +1 -4
- package/dist/features/debug/testRecorder/client/index.d.ts.map +1 -1
- package/dist/features/debug/testRecorder/client/plugin/index.js +25 -14
- package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
- package/dist/features/debug/treeView/client/index.d.ts +1 -4
- package/dist/features/debug/treeView/client/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/index.d.ts +1 -1
- package/dist/features/experimental_table/client/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/index.js +2 -0
- package/dist/features/experimental_table/client/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +49 -51
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +55 -42
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +58 -19
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +52 -50
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/utils/debounce.js +4 -4
- package/dist/features/experimental_table/client/utils/debounce.js.map +1 -1
- package/dist/features/experimental_table/client/utils/useDebounce.js.map +1 -1
- package/dist/features/experimental_table/markdownTransformer.d.ts +5 -0
- package/dist/features/experimental_table/markdownTransformer.d.ts.map +1 -0
- package/dist/features/experimental_table/markdownTransformer.js +127 -0
- package/dist/features/experimental_table/markdownTransformer.js.map +1 -0
- package/dist/features/experimental_table/server/index.d.ts.map +1 -1
- package/dist/features/experimental_table/server/index.js +22 -4
- package/dist/features/experimental_table/server/index.js.map +1 -1
- package/dist/features/format/bold/feature.client.d.ts +1 -4
- package/dist/features/format/bold/feature.client.d.ts.map +1 -1
- package/dist/features/format/bold/feature.client.js +2 -1
- package/dist/features/format/bold/feature.client.js.map +1 -1
- package/dist/features/format/inlineCode/feature.client.d.ts +1 -4
- package/dist/features/format/inlineCode/feature.client.d.ts.map +1 -1
- package/dist/features/format/inlineCode/feature.client.js +2 -1
- package/dist/features/format/inlineCode/feature.client.js.map +1 -1
- package/dist/features/format/italic/feature.client.d.ts +1 -4
- package/dist/features/format/italic/feature.client.d.ts.map +1 -1
- package/dist/features/format/italic/feature.client.js +2 -1
- package/dist/features/format/italic/feature.client.js.map +1 -1
- package/dist/features/format/strikethrough/feature.client.d.ts +1 -4
- package/dist/features/format/strikethrough/feature.client.d.ts.map +1 -1
- package/dist/features/format/strikethrough/feature.client.js +2 -1
- package/dist/features/format/strikethrough/feature.client.js.map +1 -1
- package/dist/features/format/subscript/feature.client.d.ts +1 -4
- package/dist/features/format/subscript/feature.client.d.ts.map +1 -1
- package/dist/features/format/subscript/feature.client.js +2 -1
- package/dist/features/format/subscript/feature.client.js.map +1 -1
- package/dist/features/format/superscript/feature.client.d.ts +1 -4
- package/dist/features/format/superscript/feature.client.d.ts.map +1 -1
- package/dist/features/format/superscript/feature.client.js +2 -1
- package/dist/features/format/superscript/feature.client.js.map +1 -1
- package/dist/features/format/underline/feature.client.d.ts +1 -4
- package/dist/features/format/underline/feature.client.d.ts.map +1 -1
- package/dist/features/format/underline/feature.client.js +2 -1
- package/dist/features/format/underline/feature.client.js.map +1 -1
- package/dist/features/heading/client/index.d.ts +1 -4
- package/dist/features/heading/client/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.js +4 -0
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/horizontalRule/client/component/index.d.ts +1 -1
- package/dist/features/horizontalRule/client/component/index.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/component/index.js +12 -9
- package/dist/features/horizontalRule/client/component/index.js.map +1 -1
- package/dist/features/horizontalRule/client/index.d.ts +1 -4
- package/dist/features/horizontalRule/client/index.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +2 -2
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/indent/client/index.d.ts +1 -4
- package/dist/features/indent/client/index.d.ts.map +1 -1
- package/dist/features/indent/client/index.js +2 -1
- package/dist/features/indent/client/index.js.map +1 -1
- package/dist/features/link/client/index.d.ts +1 -13
- package/dist/features/link/client/index.d.ts.map +1 -1
- package/dist/features/link/client/index.js +2 -2
- 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 +3 -1
- package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +78 -40
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
- package/dist/features/link/nodes/AutoLinkNode.js +2 -2
- package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
- package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/LinkNode.js +12 -7
- package/dist/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/features/link/nodes/types.d.ts +3 -3
- package/dist/features/link/nodes/types.d.ts.map +1 -1
- package/dist/features/link/nodes/types.js.map +1 -1
- package/dist/features/link/server/baseFields.d.ts +1 -1
- package/dist/features/link/server/baseFields.d.ts.map +1 -1
- package/dist/features/link/server/baseFields.js +15 -3
- package/dist/features/link/server/baseFields.js.map +1 -1
- package/dist/features/link/server/i18n.d.ts.map +1 -1
- package/dist/features/link/server/i18n.js +64 -32
- package/dist/features/link/server/i18n.js.map +1 -1
- package/dist/features/link/server/index.d.ts.map +1 -1
- package/dist/features/link/server/index.js +17 -4
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/link/server/transformExtraFields.d.ts +1 -1
- package/dist/features/link/server/transformExtraFields.d.ts.map +1 -1
- package/dist/features/link/server/transformExtraFields.js.map +1 -1
- package/dist/features/link/server/validate.d.ts.map +1 -1
- package/dist/features/link/server/validate.js +8 -5
- package/dist/features/link/server/validate.js.map +1 -1
- package/dist/features/lists/checklist/client/index.d.ts +1 -4
- package/dist/features/lists/checklist/client/index.d.ts.map +1 -1
- package/dist/features/lists/htmlConverter.d.ts.map +1 -1
- package/dist/features/lists/htmlConverter.js +8 -0
- package/dist/features/lists/htmlConverter.js.map +1 -1
- package/dist/features/lists/orderedList/client/index.d.ts +1 -4
- package/dist/features/lists/orderedList/client/index.d.ts.map +1 -1
- package/dist/features/lists/shared/markdown.js.map +1 -1
- package/dist/features/lists/unorderedList/client/index.d.ts +1 -4
- package/dist/features/lists/unorderedList/client/index.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +1 -0
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts +1 -4
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/index.js +1 -0
- package/dist/features/migrations/slateToLexical/converter/index.js.map +1 -1
- package/dist/features/migrations/slateToLexical/feature.client.d.ts +1 -4
- package/dist/features/migrations/slateToLexical/feature.client.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/feature.client.js +1 -3
- package/dist/features/migrations/slateToLexical/feature.client.js.map +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/features/paragraph/client/index.d.ts +1 -4
- package/dist/features/paragraph/client/index.d.ts.map +1 -1
- package/dist/features/paragraph/server/index.d.ts +1 -1
- package/dist/features/paragraph/server/index.d.ts.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.js +34 -24
- package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
- package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
- package/dist/features/relationship/client/drawer/index.js +27 -26
- package/dist/features/relationship/client/drawer/index.js.map +1 -1
- package/dist/features/relationship/client/index.d.ts +2 -17
- package/dist/features/relationship/client/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.js +1 -1
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +1 -1
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +1 -1
- package/dist/features/relationship/server/index.d.ts +1 -1
- package/dist/features/relationship/server/index.d.ts.map +1 -1
- package/dist/features/relationship/server/index.js +50 -40
- package/dist/features/relationship/server/index.js.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +2 -2
- 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/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +93 -66
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/fixed/client/index.d.ts +1 -4
- package/dist/features/toolbars/fixed/client/index.d.ts.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.js +135 -97
- package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/index.d.ts +1 -4
- package/dist/features/toolbars/inline/client/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +5 -2
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +5 -4
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +24 -10
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +4 -5
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +127 -127
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/features/toolbars/types.d.ts +23 -11
- 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 +22 -30
- package/dist/features/typesClient.d.ts.map +1 -1
- package/dist/features/typesClient.js.map +1 -1
- package/dist/features/typesServer.d.ts +23 -28
- package/dist/features/typesServer.d.ts.map +1 -1
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/component/index.d.ts.map +1 -1
- package/dist/features/upload/client/component/index.js +66 -58
- 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/drawer/index.js +34 -32
- package/dist/features/upload/client/drawer/index.js.map +1 -1
- package/dist/features/upload/client/feature.client.d.ts +1 -4
- package/dist/features/upload/client/feature.client.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.js +1 -1
- package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/client/plugin/index.js +1 -1
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/feature.server.d.ts.map +1 -1
- package/dist/features/upload/server/feature.server.js +17 -8
- package/dist/features/upload/server/feature.server.js.map +1 -1
- package/dist/features/upload/server/validate.d.ts.map +1 -1
- package/dist/features/upload/server/validate.js +7 -4
- package/dist/features/upload/server/validate.js.map +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +39 -65
- package/dist/field/Field.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js +74 -74
- package/dist/field/index.js.map +1 -1
- package/dist/field/rscEntry.d.ts +9 -0
- package/dist/field/rscEntry.d.ts.map +1 -0
- package/dist/field/rscEntry.js +56 -0
- package/dist/field/rscEntry.js.map +1 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +101 -105
- package/dist/index.js.map +1 -1
- package/dist/lexical/EditorPlugin.d.ts.map +1 -1
- package/dist/lexical/EditorPlugin.js +2 -1
- package/dist/lexical/EditorPlugin.js.map +1 -1
- package/dist/lexical/LexicalEditor.d.ts +1 -1
- package/dist/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/lexical/LexicalEditor.js +10 -10
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/LexicalProvider.d.ts +2 -2
- package/dist/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/lexical/LexicalProvider.js +18 -25
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.d.ts +6 -5
- package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.js +14 -13
- package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
- package/dist/lexical/config/client/loader.d.ts +5 -2
- package/dist/lexical/config/client/loader.d.ts.map +1 -1
- package/dist/lexical/config/client/loader.js +12 -18
- 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 +19 -18
- package/dist/lexical/config/client/sanitize.js.map +1 -1
- package/dist/lexical/config/server/loader.d.ts +2 -1
- package/dist/lexical/config/server/loader.d.ts.map +1 -1
- package/dist/lexical/config/server/loader.js +2 -0
- package/dist/lexical/config/server/loader.js.map +1 -1
- package/dist/lexical/config/server/sanitize.d.ts +1 -1
- package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/server/sanitize.js +27 -13
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/config/types.d.ts +2 -2
- 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 +4 -0
- package/dist/lexical/nodes/index.d.ts.map +1 -1
- package/dist/lexical/nodes/index.js +8 -1
- package/dist/lexical/nodes/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +6 -6
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +19 -8
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +2 -2
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +7 -7
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +3 -2
- 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/SlashMenu/index.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.js +24 -30
- package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +11 -9
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +15 -8
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +9 -7
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +3 -1
- package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js +3 -4
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -1
- package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
- package/dist/lexical/theme/EditorTheme.js +1 -2
- package/dist/lexical/theme/EditorTheme.js.map +1 -1
- package/dist/lexical/utils/nodeFormat.d.ts +2 -2
- package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
- package/dist/lexical/utils/nodeFormat.js.map +1 -1
- package/dist/lexical/utils/rect.d.ts +4 -4
- package/dist/lexical/utils/rect.d.ts.map +1 -1
- package/dist/lexical/utils/rect.js.map +1 -1
- package/dist/lexical/utils/setFloatingElemPosition.d.ts +1 -1
- package/dist/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
- package/dist/lexical/utils/setFloatingElemPosition.js.map +1 -1
- package/dist/lexical/utils/url.d.ts +5 -0
- package/dist/lexical/utils/url.d.ts.map +1 -1
- package/dist/lexical/utils/url.js +25 -5
- package/dist/lexical/utils/url.js.map +1 -1
- package/dist/lexical-proxy/@lexical-headless.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-headless.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-headless.js +2 -0
- package/dist/lexical-proxy/@lexical-headless.js.map +1 -0
- package/dist/lexical-proxy/@lexical-link.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-link.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-link.js +2 -0
- package/dist/lexical-proxy/@lexical-link.js.map +1 -0
- package/dist/lexical-proxy/@lexical-list.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-list.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-list.js +2 -0
- package/dist/lexical-proxy/@lexical-list.js.map +1 -0
- package/dist/lexical-proxy/@lexical-mark.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-mark.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-mark.js +2 -0
- package/dist/lexical-proxy/@lexical-mark.js.map +1 -0
- package/dist/lexical-proxy/@lexical-markdown.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-markdown.js +2 -0
- package/dist/lexical-proxy/@lexical-markdown.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposer.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposer.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposer.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposer.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTreeView.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTreeView.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTreeView.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTreeView.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalEditable.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalEditable.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalEditable.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalEditable.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.js.map +1 -0
- package/dist/lexical-proxy/@lexical-rich-text.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-rich-text.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-rich-text.js +2 -0
- package/dist/lexical-proxy/@lexical-rich-text.js.map +1 -0
- package/dist/lexical-proxy/@lexical-selection.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-selection.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-selection.js +2 -0
- package/dist/lexical-proxy/@lexical-selection.js.map +1 -0
- package/dist/lexical-proxy/@lexical-utils.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-utils.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-utils.js +2 -0
- package/dist/lexical-proxy/@lexical-utils.js.map +1 -0
- package/dist/lexical-proxy/lexical.d.ts +2 -0
- package/dist/lexical-proxy/lexical.d.ts.map +1 -0
- package/dist/lexical-proxy/lexical.js +2 -0
- package/dist/lexical-proxy/lexical.js.map +1 -0
- package/dist/populateGraphQL/populate.d.ts +3 -2
- package/dist/populateGraphQL/populate.d.ts.map +1 -1
- package/dist/populateGraphQL/populate.js +3 -1
- package/dist/populateGraphQL/populate.js.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 +5 -4
- package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -1
- package/dist/types.d.ts +23 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utilities/buildInitialState.d.ts +27 -0
- package/dist/utilities/buildInitialState.d.ts.map +1 -0
- package/dist/utilities/buildInitialState.js +53 -0
- package/dist/utilities/buildInitialState.js.map +1 -0
- package/dist/utilities/createClientFeature.d.ts +8 -5
- package/dist/utilities/createClientFeature.d.ts.map +1 -1
- package/dist/utilities/createClientFeature.js +7 -4
- package/dist/utilities/createClientFeature.js.map +1 -1
- package/dist/utilities/createServerFeature.d.ts +1 -0
- package/dist/utilities/createServerFeature.d.ts.map +1 -1
- package/dist/utilities/createServerFeature.js +2 -0
- package/dist/utilities/createServerFeature.js.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.d.ts +1 -0
- package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.js +68 -27
- package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.js +102 -138
- package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts +13 -0
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -0
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +129 -0
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -0
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts +10 -0
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -0
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.js +136 -0
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -0
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts +16 -0
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -0
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js +144 -0
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -0
- package/dist/utilities/generateImportMap.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.js +2 -3
- package/dist/utilities/generateImportMap.js.map +1 -1
- package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
- package/dist/utilities/generateSchemaMap.js +13 -10
- package/dist/utilities/generateSchemaMap.js.map +1 -1
- package/dist/utilities/initLexicalFeatures.d.ts +18 -0
- package/dist/utilities/initLexicalFeatures.d.ts.map +1 -0
- package/dist/utilities/initLexicalFeatures.js +96 -0
- package/dist/utilities/initLexicalFeatures.js.map +1 -0
- package/dist/utilities/jsx/collectTopLevelJSXInLines.d.ts +52 -0
- package/dist/utilities/jsx/collectTopLevelJSXInLines.d.ts.map +1 -0
- package/dist/utilities/jsx/collectTopLevelJSXInLines.js +79 -0
- package/dist/utilities/jsx/collectTopLevelJSXInLines.js.map +1 -0
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.d.ts +12 -0
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.d.ts.map +1 -0
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.js +125 -0
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.js.map +1 -0
- package/dist/utilities/jsx/jsx.d.ts +26 -0
- package/dist/utilities/jsx/jsx.d.ts.map +1 -0
- package/dist/utilities/jsx/jsx.js +105 -0
- package/dist/utilities/jsx/jsx.js.map +1 -0
- package/dist/utilities/jsx/jsx.spec.d.ts +2 -0
- package/dist/utilities/jsx/jsx.spec.d.ts.map +1 -0
- package/dist/utilities/jsx/jsx.spec.js +142 -0
- package/dist/utilities/jsx/jsx.spec.js.map +1 -0
- package/dist/utilities/jsx/lexicalMarkdownCopy.d.ts +11 -0
- package/dist/utilities/jsx/lexicalMarkdownCopy.d.ts.map +1 -0
- package/dist/utilities/jsx/lexicalMarkdownCopy.js +61 -0
- package/dist/utilities/jsx/lexicalMarkdownCopy.js.map +1 -0
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +5 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
- package/dist/utilities/useLexicalFeature.js +12 -4
- package/dist/utilities/useLexicalFeature.js.map +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +2 -2
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/validateNodes.d.ts +2 -2
- package/dist/validate/validateNodes.d.ts.map +1 -1
- package/dist/validate/validateNodes.js +4 -4
- package/dist/validate/validateNodes.js.map +1 -1
- package/package.json +332 -46
- package/dist/cell/index.d.ts +0 -9
- package/dist/cell/index.d.ts.map +0 -1
- package/dist/cell/index.js +0 -135
- package/dist/cell/index.js.map +0 -1
- package/dist/exports/client/Field-SUWHJ4HF.js +0 -2
- package/dist/exports/client/Field-SUWHJ4HF.js.map +0 -7
- package/dist/exports/client/RelationshipComponent-EZORSGUZ.js +0 -2
- package/dist/exports/client/RelationshipComponent-EZORSGUZ.js.map +0 -7
- package/dist/exports/client/chunk-OLSILJA6.js +0 -2
- package/dist/exports/client/chunk-OLSILJA6.js.map +0 -7
- package/dist/exports/client/chunk-TD7O23AB.js +0 -2
- package/dist/exports/client/chunk-TD7O23AB.js.map +0 -7
- package/dist/exports/client/chunk-YL453UOS.js +0 -2
- package/dist/exports/client/chunk-YL453UOS.js.map +0 -7
- package/dist/exports/client/chunk-YSI2QILQ.js +0 -2
- package/dist/exports/client/chunk-YSI2QILQ.js.map +0 -7
- package/dist/exports/client/component-2YLEVOFH.js +0 -2
- package/dist/exports/client/component-2YLEVOFH.js.map +0 -7
- package/dist/exports/client/component-7RAP75FW.js +0 -2
- package/dist/exports/client/component-7RAP75FW.js.map +0 -7
- package/dist/exports/client/component-LLWMZU6K.js +0 -2
- package/dist/exports/client/component-LLWMZU6K.js.map +0 -7
- package/dist/exports/client/componentInline-YSHGRL2J.js +0 -2
- package/dist/exports/client/componentInline-YSHGRL2J.js.map +0 -7
- package/dist/features/blocks/client/component/FormSavePlugin.d.ts +0 -11
- package/dist/features/blocks/client/component/FormSavePlugin.d.ts.map +0 -1
- package/dist/features/blocks/client/component/FormSavePlugin.js +0 -53
- package/dist/features/blocks/client/component/FormSavePlugin.js.map +0 -1
- package/dist/features/createClientComponent.d.ts +0 -7
- package/dist/features/createClientComponent.d.ts.map +0 -1
- package/dist/features/createClientComponent.js +0 -13
- package/dist/features/createClientComponent.js.map +0 -1
- package/dist/features/createFeaturePropComponent.d.ts +0 -6
- package/dist/features/createFeaturePropComponent.d.ts.map +0 -1
- package/dist/features/createFeaturePropComponent.js +0 -19
- package/dist/features/createFeaturePropComponent.js.map +0 -1
- package/dist/utilities/generateComponentMap.d.ts +0 -6
- package/dist/utilities/generateComponentMap.d.ts.map +0 -1
- package/dist/utilities/generateComponentMap.js +0 -99
- package/dist/utilities/generateComponentMap.js.map +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { UseListDrawer } from '@payloadcms/ui';
|
|
2
|
+
import type { BaseSelection } from 'lexical';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* Wrapper around useListDrawer that restores and saves selection state (cursor position) when opening and closing the drawer.
|
|
6
|
+
* By default, the lexical cursor position may be lost when opening a drawer and clicking somewhere on that drawer.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useLexicalListDrawer: (args: Parameters<UseListDrawer>[0]) => {
|
|
9
|
+
closeListDrawer: () => void;
|
|
10
|
+
isListDrawerOpen: boolean;
|
|
11
|
+
ListDrawer: ReturnType<UseListDrawer>[0];
|
|
12
|
+
listDrawerSlug: string;
|
|
13
|
+
ListDrawerToggler: ReturnType<UseListDrawer>[1];
|
|
14
|
+
openListDrawer: (selection?: BaseSelection) => void;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useLexicalListDrawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLexicalListDrawer.d.ts","sourceRoot":"","sources":["../../../src/utilities/fieldsDrawer/useLexicalListDrawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAO5C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,SACzB,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KACjC;IACD,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,gBAAgB,EAAE,OAAO,CAAA;IACzB,UAAU,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;IACxC,cAAc,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,cAAc,EAAE,CAAC,SAAS,CAAC,EAAE,aAAa,KAAK,IAAI,CAAA;CA6EpD,CAAA"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
6
|
+
import { useListDrawer, useModal } from '@payloadcms/ui';
|
|
7
|
+
import { $getPreviousSelection, $getSelection, $setSelection } from 'lexical';
|
|
8
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* Wrapper around useListDrawer that restores and saves selection state (cursor position) when opening and closing the drawer.
|
|
12
|
+
* By default, the lexical cursor position may be lost when opening a drawer and clicking somewhere on that drawer.
|
|
13
|
+
*/
|
|
14
|
+
export const useLexicalListDrawer = args => {
|
|
15
|
+
const $ = _c(23);
|
|
16
|
+
const [editor] = useLexicalComposerContext();
|
|
17
|
+
const [selectionState, setSelectionState] = useState(null);
|
|
18
|
+
const [wasOpen, setWasOpen] = useState(false);
|
|
19
|
+
const [BaseListDrawer, BaseListDrawerToggler, t0] = useListDrawer(args);
|
|
20
|
+
const {
|
|
21
|
+
closeDrawer: baseCloseDrawer,
|
|
22
|
+
drawerSlug: listDrawerSlug,
|
|
23
|
+
isDrawerOpen,
|
|
24
|
+
openDrawer: baseOpenDrawer
|
|
25
|
+
} = t0;
|
|
26
|
+
const {
|
|
27
|
+
modalState
|
|
28
|
+
} = useModal();
|
|
29
|
+
let t1;
|
|
30
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
+
t1 = () => {
|
|
32
|
+
const selection = $getSelection() ?? $getPreviousSelection();
|
|
33
|
+
setSelectionState(selection);
|
|
34
|
+
};
|
|
35
|
+
$[0] = t1;
|
|
36
|
+
} else {
|
|
37
|
+
t1 = $[0];
|
|
38
|
+
}
|
|
39
|
+
const $storeSelection = t1;
|
|
40
|
+
let t2;
|
|
41
|
+
if ($[1] !== selectionState || $[2] !== editor) {
|
|
42
|
+
t2 = () => {
|
|
43
|
+
if (selectionState) {
|
|
44
|
+
editor.update(() => {
|
|
45
|
+
$setSelection(selectionState.clone());
|
|
46
|
+
}, {
|
|
47
|
+
discrete: true,
|
|
48
|
+
skipTransforms: true
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
$[1] = selectionState;
|
|
53
|
+
$[2] = editor;
|
|
54
|
+
$[3] = t2;
|
|
55
|
+
} else {
|
|
56
|
+
t2 = $[3];
|
|
57
|
+
}
|
|
58
|
+
const restoreSelection = t2;
|
|
59
|
+
let t3;
|
|
60
|
+
if ($[4] !== baseCloseDrawer) {
|
|
61
|
+
t3 = () => {
|
|
62
|
+
baseCloseDrawer();
|
|
63
|
+
};
|
|
64
|
+
$[4] = baseCloseDrawer;
|
|
65
|
+
$[5] = t3;
|
|
66
|
+
} else {
|
|
67
|
+
t3 = $[5];
|
|
68
|
+
}
|
|
69
|
+
const closeListDrawer = t3;
|
|
70
|
+
let t4;
|
|
71
|
+
let t5;
|
|
72
|
+
if ($[6] !== wasOpen || $[7] !== modalState || $[8] !== listDrawerSlug || $[9] !== restoreSelection) {
|
|
73
|
+
t4 = () => {
|
|
74
|
+
if (!wasOpen) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const thisModalState = modalState[listDrawerSlug];
|
|
78
|
+
if (thisModalState && !thisModalState?.isOpen) {
|
|
79
|
+
setWasOpen(false);
|
|
80
|
+
setTimeout(() => {
|
|
81
|
+
restoreSelection();
|
|
82
|
+
}, 1);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
t5 = [modalState, listDrawerSlug, restoreSelection, wasOpen];
|
|
86
|
+
$[6] = wasOpen;
|
|
87
|
+
$[7] = modalState;
|
|
88
|
+
$[8] = listDrawerSlug;
|
|
89
|
+
$[9] = restoreSelection;
|
|
90
|
+
$[10] = t4;
|
|
91
|
+
$[11] = t5;
|
|
92
|
+
} else {
|
|
93
|
+
t4 = $[10];
|
|
94
|
+
t5 = $[11];
|
|
95
|
+
}
|
|
96
|
+
useEffect(t4, t5);
|
|
97
|
+
let t6;
|
|
98
|
+
if ($[12] !== BaseListDrawerToggler) {
|
|
99
|
+
t6 = props => _jsx(BaseListDrawerToggler, {
|
|
100
|
+
...props,
|
|
101
|
+
onClick: () => {
|
|
102
|
+
$storeSelection();
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
$[12] = BaseListDrawerToggler;
|
|
106
|
+
$[13] = t6;
|
|
107
|
+
} else {
|
|
108
|
+
t6 = $[13];
|
|
109
|
+
}
|
|
110
|
+
let t7;
|
|
111
|
+
if ($[14] !== baseOpenDrawer) {
|
|
112
|
+
t7 = () => {
|
|
113
|
+
$storeSelection();
|
|
114
|
+
baseOpenDrawer();
|
|
115
|
+
setWasOpen(true);
|
|
116
|
+
};
|
|
117
|
+
$[14] = baseOpenDrawer;
|
|
118
|
+
$[15] = t7;
|
|
119
|
+
} else {
|
|
120
|
+
t7 = $[15];
|
|
121
|
+
}
|
|
122
|
+
let t8;
|
|
123
|
+
if ($[16] !== closeListDrawer || $[17] !== isDrawerOpen || $[18] !== BaseListDrawer || $[19] !== listDrawerSlug || $[20] !== t6 || $[21] !== t7) {
|
|
124
|
+
t8 = {
|
|
125
|
+
closeListDrawer,
|
|
126
|
+
isListDrawerOpen: isDrawerOpen,
|
|
127
|
+
ListDrawer: BaseListDrawer,
|
|
128
|
+
listDrawerSlug,
|
|
129
|
+
ListDrawerToggler: t6,
|
|
130
|
+
openListDrawer: t7
|
|
131
|
+
};
|
|
132
|
+
$[16] = closeListDrawer;
|
|
133
|
+
$[17] = isDrawerOpen;
|
|
134
|
+
$[18] = BaseListDrawer;
|
|
135
|
+
$[19] = listDrawerSlug;
|
|
136
|
+
$[20] = t6;
|
|
137
|
+
$[21] = t7;
|
|
138
|
+
$[22] = t8;
|
|
139
|
+
} else {
|
|
140
|
+
t8 = $[22];
|
|
141
|
+
}
|
|
142
|
+
return t8;
|
|
143
|
+
};
|
|
144
|
+
//# sourceMappingURL=useLexicalListDrawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLexicalListDrawer.js","names":["c","_c","useLexicalComposerContext","useListDrawer","useModal","$getPreviousSelection","$getSelection","$setSelection","useCallback","useEffect","useState","useLexicalListDrawer","args","$","editor","selectionState","setSelectionState","wasOpen","setWasOpen","BaseListDrawer","BaseListDrawerToggler","t0","closeDrawer","baseCloseDrawer","drawerSlug","listDrawerSlug","isDrawerOpen","openDrawer","baseOpenDrawer","modalState","t1","Symbol","for","selection","$storeSelection","t2","update","clone","discrete","skipTransforms","restoreSelection","t3","closeListDrawer","t4","t5","thisModalState","isOpen","setTimeout","t6","props","_jsx","onClick","t7","t8","isListDrawerOpen","ListDrawer","ListDrawerToggler"],"sources":["../../../src/utilities/fieldsDrawer/useLexicalListDrawer.tsx"],"sourcesContent":["'use client'\nimport type { UseListDrawer } from '@payloadcms/ui'\nimport type { BaseSelection } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useListDrawer, useModal } from '@payloadcms/ui'\nimport { $getPreviousSelection, $getSelection, $setSelection } from 'lexical'\nimport { useCallback, useEffect, useState } from 'react'\n\n/**\n *\n * Wrapper around useListDrawer that restores and saves selection state (cursor position) when opening and closing the drawer.\n * By default, the lexical cursor position may be lost when opening a drawer and clicking somewhere on that drawer.\n */\nexport const useLexicalListDrawer = (\n args: Parameters<UseListDrawer>[0],\n): {\n closeListDrawer: () => void\n isListDrawerOpen: boolean\n ListDrawer: ReturnType<UseListDrawer>[0]\n listDrawerSlug: string\n ListDrawerToggler: ReturnType<UseListDrawer>[1]\n openListDrawer: (selection?: BaseSelection) => void\n} => {\n const [editor] = useLexicalComposerContext()\n const [selectionState, setSelectionState] = useState<BaseSelection | null>(null)\n const [wasOpen, setWasOpen] = useState<boolean>(false)\n\n const [\n BaseListDrawer,\n BaseListDrawerToggler,\n {\n closeDrawer: baseCloseDrawer,\n drawerSlug: listDrawerSlug,\n isDrawerOpen,\n openDrawer: baseOpenDrawer,\n },\n ] = useListDrawer(args)\n const { modalState } = useModal()\n\n const $storeSelection = useCallback(() => {\n // editor.read() causes an error here when creating a new upload node from the slash menu. It seems like we can omit it here though, as all\n // invocations of that functions are wrapped in editor.read() or editor.update() somewhere in the call stack.\n const selection = $getSelection() ?? $getPreviousSelection()\n setSelectionState(selection)\n }, [])\n\n const restoreSelection = useCallback(() => {\n if (selectionState) {\n editor.update(\n () => {\n $setSelection(selectionState.clone())\n },\n { discrete: true, skipTransforms: true },\n )\n }\n }, [editor, selectionState])\n\n const closeListDrawer = () => {\n //restoreSelection() // Should already be stored by the useEffect below\n baseCloseDrawer()\n }\n\n // We need to handle drawer closing via a useEffect, as toggleDrawer / closeDrawer will not be triggered if the drawer\n // is closed by clicking outside of the drawer. This useEffect will handle everything.\n useEffect(() => {\n if (!wasOpen) {\n return\n }\n\n const thisModalState = modalState[listDrawerSlug]\n // Exists in modalState (thus has opened at least once before) and is closed\n if (thisModalState && !thisModalState?.isOpen) {\n setWasOpen(false)\n setTimeout(() => {\n restoreSelection()\n }, 1)\n }\n }, [modalState, listDrawerSlug, restoreSelection, wasOpen])\n\n return {\n closeListDrawer,\n isListDrawerOpen: isDrawerOpen,\n ListDrawer: BaseListDrawer,\n listDrawerSlug,\n ListDrawerToggler: (props) => (\n <BaseListDrawerToggler\n {...props}\n onClick={() => {\n $storeSelection()\n }}\n />\n ),\n openListDrawer: () => {\n $storeSelection()\n baseOpenDrawer()\n setWasOpen(true)\n },\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateImportMap.d.ts","sourceRoot":"","sources":["../../src/utilities/generateImportMap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAE1E,eAAO,MAAM,oBAAoB,SACxB;IAAE,kBAAkB,EAAE,wBAAwB,CAAA;CAAE,KAAG,eAAe,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"generateImportMap.d.ts","sourceRoot":"","sources":["../../src/utilities/generateImportMap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAE1E,eAAO,MAAM,oBAAoB,SACxB;IAAE,kBAAkB,EAAE,wBAAwB,CAAA;CAAE,KAAG,eAAe,CAAC,mBAAmB,CAkD5F,CAAA"}
|
|
@@ -6,9 +6,8 @@ export const getGenerateImportMap = args => ({
|
|
|
6
6
|
importMap,
|
|
7
7
|
imports
|
|
8
8
|
}) => {
|
|
9
|
-
addToImportMap('@payloadcms/richtext-lexical/
|
|
10
|
-
addToImportMap('@payloadcms/richtext-lexical/
|
|
11
|
-
addToImportMap('@payloadcms/richtext-lexical/generateComponentMap#getGenerateComponentMap');
|
|
9
|
+
addToImportMap('@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell');
|
|
10
|
+
addToImportMap('@payloadcms/richtext-lexical/rsc#RscEntryLexicalField');
|
|
12
11
|
// iterate just through args.resolvedFeatureMap.values()
|
|
13
12
|
for (const resolvedFeature of args.resolvedFeatureMap.values()) {
|
|
14
13
|
if ('componentImports' in resolvedFeature) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateImportMap.js","names":["genImportMapIterateFields","getGenerateImportMap","args","addToImportMap","baseDir","config","importMap","imports","resolvedFeature","resolvedFeatureMap","values","componentImports","length","forEach","component","ClientComponent","ClientFeature","nodes","node","getSubFields","subFields","fields"],"sources":["../../src/utilities/generateImportMap.tsx"],"sourcesContent":["import type { RichTextAdapter } from 'payload'\n\nimport { genImportMapIterateFields } from 'payload'\n\nimport type { ResolvedServerFeatureMap } from '../features/typesServer.js'\n\nexport const getGenerateImportMap =\n (args: { resolvedFeatureMap: ResolvedServerFeatureMap }): RichTextAdapter['generateImportMap'] =>\n ({ addToImportMap, baseDir, config, importMap, imports }) => {\n addToImportMap('@payloadcms/richtext-lexical/
|
|
1
|
+
{"version":3,"file":"generateImportMap.js","names":["genImportMapIterateFields","getGenerateImportMap","args","addToImportMap","baseDir","config","importMap","imports","resolvedFeature","resolvedFeatureMap","values","componentImports","length","forEach","component","ClientComponent","ClientFeature","nodes","node","getSubFields","subFields","fields"],"sources":["../../src/utilities/generateImportMap.tsx"],"sourcesContent":["import type { RichTextAdapter } from 'payload'\n\nimport { genImportMapIterateFields } from 'payload'\n\nimport type { ResolvedServerFeatureMap } from '../features/typesServer.js'\n\nexport const getGenerateImportMap =\n (args: { resolvedFeatureMap: ResolvedServerFeatureMap }): RichTextAdapter['generateImportMap'] =>\n ({ addToImportMap, baseDir, config, importMap, imports }) => {\n addToImportMap('@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell')\n addToImportMap('@payloadcms/richtext-lexical/rsc#RscEntryLexicalField')\n\n // iterate just through args.resolvedFeatureMap.values()\n for (const resolvedFeature of args.resolvedFeatureMap.values()) {\n if ('componentImports' in resolvedFeature) {\n if (typeof resolvedFeature.componentImports === 'function') {\n resolvedFeature.componentImports({\n addToImportMap,\n baseDir,\n config,\n importMap,\n imports,\n })\n } else if (resolvedFeature.componentImports?.length) {\n resolvedFeature.componentImports.forEach((component) => {\n addToImportMap(component)\n })\n }\n }\n\n const ClientComponent = resolvedFeature.ClientFeature\n if (ClientComponent) {\n addToImportMap(ClientComponent)\n }\n\n /*\n Now run for all possible sub-fields\n */\n if (resolvedFeature.nodes?.length) {\n for (const node of resolvedFeature.nodes) {\n if (typeof node?.getSubFields !== 'function') {\n continue\n }\n const subFields = node.getSubFields({})\n if (subFields?.length) {\n genImportMapIterateFields({\n addToImportMap,\n baseDir,\n config,\n fields: subFields,\n importMap,\n imports,\n })\n }\n }\n }\n }\n }\n"],"mappings":"AAEA,SAASA,yBAAyB,QAAQ;AAI1C,OAAO,MAAMC,oBAAA,GACVC,IAAA,IACD,CAAC;EAAEC,cAAc;EAAEC,OAAO;EAAEC,MAAM;EAAEC,SAAS;EAAEC;AAAO,CAAE;EACtDJ,cAAA,CAAe;EACfA,cAAA,CAAe;EAEf;EACA,KAAK,MAAMK,eAAA,IAAmBN,IAAA,CAAKO,kBAAkB,CAACC,MAAM,IAAI;IAC9D,IAAI,sBAAsBF,eAAA,EAAiB;MACzC,IAAI,OAAOA,eAAA,CAAgBG,gBAAgB,KAAK,YAAY;QAC1DH,eAAA,CAAgBG,gBAAgB,CAAC;UAC/BR,cAAA;UACAC,OAAA;UACAC,MAAA;UACAC,SAAA;UACAC;QACF;MACF,OAAO,IAAIC,eAAA,CAAgBG,gBAAgB,EAAEC,MAAA,EAAQ;QACnDJ,eAAA,CAAgBG,gBAAgB,CAACE,OAAO,CAAEC,SAAA;UACxCX,cAAA,CAAeW,SAAA;QACjB;MACF;IACF;IAEA,MAAMC,eAAA,GAAkBP,eAAA,CAAgBQ,aAAa;IACrD,IAAID,eAAA,EAAiB;MACnBZ,cAAA,CAAeY,eAAA;IACjB;IAEA;;;IAGA,IAAIP,eAAA,CAAgBS,KAAK,EAAEL,MAAA,EAAQ;MACjC,KAAK,MAAMM,IAAA,IAAQV,eAAA,CAAgBS,KAAK,EAAE;QACxC,IAAI,OAAOC,IAAA,EAAMC,YAAA,KAAiB,YAAY;UAC5C;QACF;QACA,MAAMC,SAAA,GAAYF,IAAA,CAAKC,YAAY,CAAC,CAAC;QACrC,IAAIC,SAAA,EAAWR,MAAA,EAAQ;UACrBZ,yBAAA,CAA0B;YACxBG,cAAA;YACAC,OAAA;YACAC,MAAA;YACAgB,MAAA,EAAQD,SAAA;YACRd,SAAA;YACAC;UACF;QACF;MACF;IACF;EACF;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSchemaMap.d.ts","sourceRoot":"","sources":["../../src/utilities/generateSchemaMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAE1E,eAAO,MAAM,oBAAoB,SACxB;IAAE,kBAAkB,EAAE,wBAAwB,CAAA;CAAE,KAAG,eAAe,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"generateSchemaMap.d.ts","sourceRoot":"","sources":["../../src/utilities/generateSchemaMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAE1E,eAAO,MAAM,oBAAoB,SACxB;IAAE,kBAAkB,EAAE,wBAAwB,CAAA;CAAE,KAAG,eAAe,CAAC,mBAAmB,CAsC5F,CAAA"}
|
|
@@ -19,16 +19,19 @@ export const getGenerateSchemaMap = args => ({
|
|
|
19
19
|
schemaPath
|
|
20
20
|
});
|
|
21
21
|
if (schemas) {
|
|
22
|
-
for (const [schemaKey,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
for (const [schemaKey, field] of schemas.entries()) {
|
|
23
|
+
if ('fields' in field) {
|
|
24
|
+
// generate schema map entries for sub-fields using traverseFields
|
|
25
|
+
traverseFields({
|
|
26
|
+
config,
|
|
27
|
+
fields: field.fields,
|
|
28
|
+
i18n,
|
|
29
|
+
parentIndexPath: '',
|
|
30
|
+
parentSchemaPath: `${schemaPath}.lexical_internal_feature.${featureKey}.${schemaKey}`,
|
|
31
|
+
schemaMap
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
schemaMap.set(`${schemaPath}.lexical_internal_feature.${featureKey}.${schemaKey}`, field);
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSchemaMap.js","names":["traverseFields","getGenerateSchemaMap","args","config","field","i18n","schemaMap","schemaPath","featureKey","resolvedFeature","resolvedFeatureMap","entries","generateSchemaMap","schemas","props","sanitizedServerFeatureProps","schemaKey","fields","set"],"sources":["../../src/utilities/generateSchemaMap.ts"],"sourcesContent":["import type { RichTextAdapter } from 'payload'\n\nimport { traverseFields } from '@payloadcms/ui/utilities/buildFieldSchemaMap/traverseFields'\n\nimport type { ResolvedServerFeatureMap } from '../features/typesServer.js'\n\nexport const getGenerateSchemaMap =\n (args: { resolvedFeatureMap: ResolvedServerFeatureMap }): RichTextAdapter['generateSchemaMap'] =>\n ({ config, field, i18n, schemaMap, schemaPath }) => {\n for (const [featureKey, resolvedFeature] of args.resolvedFeatureMap.entries()) {\n if (\n !('generateSchemaMap' in resolvedFeature) ||\n typeof resolvedFeature.generateSchemaMap !== 'function'\n ) {\n continue\n }\n const schemas = resolvedFeature.generateSchemaMap({\n config,\n field,\n i18n,\n props: resolvedFeature.sanitizedServerFeatureProps,\n schemaMap,\n schemaPath,\n })\n\n if (schemas) {\n for (const [schemaKey,
|
|
1
|
+
{"version":3,"file":"generateSchemaMap.js","names":["traverseFields","getGenerateSchemaMap","args","config","field","i18n","schemaMap","schemaPath","featureKey","resolvedFeature","resolvedFeatureMap","entries","generateSchemaMap","schemas","props","sanitizedServerFeatureProps","schemaKey","fields","parentIndexPath","parentSchemaPath","set"],"sources":["../../src/utilities/generateSchemaMap.ts"],"sourcesContent":["import type { RichTextAdapter } from 'payload'\n\nimport { traverseFields } from '@payloadcms/ui/utilities/buildFieldSchemaMap/traverseFields'\n\nimport type { ResolvedServerFeatureMap } from '../features/typesServer.js'\n\nexport const getGenerateSchemaMap =\n (args: { resolvedFeatureMap: ResolvedServerFeatureMap }): RichTextAdapter['generateSchemaMap'] =>\n ({ config, field, i18n, schemaMap, schemaPath }) => {\n for (const [featureKey, resolvedFeature] of args.resolvedFeatureMap.entries()) {\n if (\n !('generateSchemaMap' in resolvedFeature) ||\n typeof resolvedFeature.generateSchemaMap !== 'function'\n ) {\n continue\n }\n const schemas = resolvedFeature.generateSchemaMap({\n config,\n field,\n i18n,\n props: resolvedFeature.sanitizedServerFeatureProps,\n schemaMap,\n schemaPath,\n })\n\n if (schemas) {\n for (const [schemaKey, field] of schemas.entries()) {\n if ('fields' in field) {\n // generate schema map entries for sub-fields using traverseFields\n traverseFields({\n config,\n fields: field.fields,\n i18n,\n parentIndexPath: '',\n parentSchemaPath: `${schemaPath}.lexical_internal_feature.${featureKey}.${schemaKey}`,\n schemaMap,\n })\n }\n\n schemaMap.set(`${schemaPath}.lexical_internal_feature.${featureKey}.${schemaKey}`, field)\n }\n }\n }\n\n return schemaMap\n }\n"],"mappings":"AAEA,SAASA,cAAc,QAAQ;AAI/B,OAAO,MAAMC,oBAAA,GACVC,IAAA,IACD,CAAC;EAAEC,MAAM;EAAEC,KAAK;EAAEC,IAAI;EAAEC,SAAS;EAAEC;AAAU,CAAE;EAC7C,KAAK,MAAM,CAACC,UAAA,EAAYC,eAAA,CAAgB,IAAIP,IAAA,CAAKQ,kBAAkB,CAACC,OAAO,IAAI;IAC7E,IACE,EAAE,uBAAuBF,eAAc,KACvC,OAAOA,eAAA,CAAgBG,iBAAiB,KAAK,YAC7C;MACA;IACF;IACA,MAAMC,OAAA,GAAUJ,eAAA,CAAgBG,iBAAiB,CAAC;MAChDT,MAAA;MACAC,KAAA;MACAC,IAAA;MACAS,KAAA,EAAOL,eAAA,CAAgBM,2BAA2B;MAClDT,SAAA;MACAC;IACF;IAEA,IAAIM,OAAA,EAAS;MACX,KAAK,MAAM,CAACG,SAAA,EAAWZ,KAAA,CAAM,IAAIS,OAAA,CAAQF,OAAO,IAAI;QAClD,IAAI,YAAYP,KAAA,EAAO;UACrB;UACAJ,cAAA,CAAe;YACbG,MAAA;YACAc,MAAA,EAAQb,KAAA,CAAMa,MAAM;YACpBZ,IAAA;YACAa,eAAA,EAAiB;YACjBC,gBAAA,EAAkB,GAAGZ,UAAA,6BAAuCC,UAAA,IAAcQ,SAAA,EAAW;YACrFV;UACF;QACF;QAEAA,SAAA,CAAUc,GAAG,CAAC,GAAGb,UAAA,6BAAuCC,UAAA,IAAcQ,SAAA,EAAW,EAAEZ,KAAA;MACrF;IACF;EACF;EAEA,OAAOE,SAAA;AACT","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { I18nClient } from '@payloadcms/translations';
|
|
2
|
+
import { type FieldSchemaMap, type Payload } from 'payload';
|
|
3
|
+
import type { SanitizedServerEditorConfig } from '../lexical/config/types.js';
|
|
4
|
+
import type { FeatureClientSchemaMap, LexicalRichTextFieldProps } from '../types.js';
|
|
5
|
+
type Args = {
|
|
6
|
+
fieldSchemaMap: FieldSchemaMap;
|
|
7
|
+
i18n: I18nClient;
|
|
8
|
+
path: string;
|
|
9
|
+
payload: Payload;
|
|
10
|
+
sanitizedEditorConfig: SanitizedServerEditorConfig;
|
|
11
|
+
schemaPath: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function initLexicalFeatures(args: Args): {
|
|
14
|
+
clientFeatures: LexicalRichTextFieldProps['clientFeatures'];
|
|
15
|
+
featureClientSchemaMap: FeatureClientSchemaMap;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=initLexicalFeatures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initLexicalFeatures.d.ts","sourceRoot":"","sources":["../../src/utilities/initLexicalFeatures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,OAAO,EACb,MAAM,SAAS,CAAA;AAIhB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AACpF,KAAK,IAAI,GAAG;IACV,cAAc,EAAE,cAAc,CAAA;IAC9B,IAAI,EAAE,UAAU,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;IAChB,qBAAqB,EAAE,2BAA2B,CAAA;IAClD,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG;IAC/C,cAAc,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,CAAA;IAC3D,sBAAsB,EAAE,sBAAsB,CAAA;CAC/C,CA4HA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { createClientFields, deepCopyObjectSimple } from 'payload';
|
|
2
|
+
import { getFromImportMap } from 'payload/shared';
|
|
3
|
+
export function initLexicalFeatures(args) {
|
|
4
|
+
const clientFeatures = {};
|
|
5
|
+
const fieldSchemaMap = Object.fromEntries(new Map(args.fieldSchemaMap));
|
|
6
|
+
//&const value = deepCopyObjectSimple(args.fieldState.value)
|
|
7
|
+
// turn args.resolvedFeatureMap into an array of [key, value] pairs, ordered by value.order, lowest order first:
|
|
8
|
+
const resolvedFeatureMapArray = Array.from(args.sanitizedEditorConfig.resolvedFeatureMap.entries()).sort((a, b) => a[1].order - b[1].order);
|
|
9
|
+
const featureClientSchemaMap = {};
|
|
10
|
+
for (const [featureKey, resolvedFeature] of resolvedFeatureMapArray) {
|
|
11
|
+
clientFeatures[featureKey] = {};
|
|
12
|
+
/**
|
|
13
|
+
* Handle client features
|
|
14
|
+
*/
|
|
15
|
+
const ClientFeaturePayloadComponent = resolvedFeature.ClientFeature;
|
|
16
|
+
if (ClientFeaturePayloadComponent) {
|
|
17
|
+
const clientFeatureProvider = getFromImportMap({
|
|
18
|
+
importMap: args.payload.importMap,
|
|
19
|
+
PayloadComponent: ClientFeaturePayloadComponent,
|
|
20
|
+
schemaPath: 'lexical-clientComponent',
|
|
21
|
+
silent: true
|
|
22
|
+
});
|
|
23
|
+
if (!clientFeatureProvider) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const clientFeatureProps = resolvedFeature.clientFeatureProps ?? {};
|
|
27
|
+
clientFeatureProps.featureKey = resolvedFeature.key;
|
|
28
|
+
clientFeatureProps.order = resolvedFeature.order;
|
|
29
|
+
if (typeof ClientFeaturePayloadComponent === 'object' && ClientFeaturePayloadComponent.clientProps) {
|
|
30
|
+
clientFeatureProps.clientProps = ClientFeaturePayloadComponent.clientProps;
|
|
31
|
+
}
|
|
32
|
+
// As clientFeatureProvider is a client function, we cannot execute it on the server here. Thus, the client will have to execute clientFeatureProvider with its props
|
|
33
|
+
clientFeatures[featureKey] = {
|
|
34
|
+
clientFeatureProps,
|
|
35
|
+
clientFeatureProvider
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Handle sub-fields (formstate of those)ttt
|
|
40
|
+
*/ // The args.fieldSchemaMap generated before in buildFormState should contain all of lexical features' sub-field schemas
|
|
41
|
+
// as well, as it already called feature.generateSchemaMap for each feature.
|
|
42
|
+
// We will check for the existance resolvedFeature.generateSchemaMap to skip unnecessary loops for constructing featureSchemaMap, but we don't run it here
|
|
43
|
+
if (resolvedFeature.generateSchemaMap) {
|
|
44
|
+
const featureSchemaPath = [...args.schemaPath.split('.'), 'lexical_internal_feature', featureKey].join('.');
|
|
45
|
+
const featurePath = [...args.path.split('.'), 'lexical_internal_feature', featureKey].join('.');
|
|
46
|
+
// Like args.fieldSchemaMap, we only want to include the sub-fields of the current feature
|
|
47
|
+
const featureSchemaMap = {};
|
|
48
|
+
for (const key in fieldSchemaMap) {
|
|
49
|
+
const state = fieldSchemaMap[key];
|
|
50
|
+
if (key.startsWith(featureSchemaPath)) {
|
|
51
|
+
featureSchemaMap[key] = state;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
featureClientSchemaMap[featureKey] = {};
|
|
55
|
+
for (const key in featureSchemaMap) {
|
|
56
|
+
const state = featureSchemaMap[key];
|
|
57
|
+
const clientFields = createClientFields({
|
|
58
|
+
clientFields: 'fields' in state ? deepCopyObjectSimple(state.fields) : [deepCopyObjectSimple(state)],
|
|
59
|
+
defaultIDType: args.payload.config.db.defaultIDType,
|
|
60
|
+
disableAddingID: true,
|
|
61
|
+
fields: 'fields' in state ? state.fields : [state],
|
|
62
|
+
i18n: args.i18n,
|
|
63
|
+
importMap: args.payload.importMap
|
|
64
|
+
});
|
|
65
|
+
featureClientSchemaMap[featureKey][key] = clientFields;
|
|
66
|
+
}
|
|
67
|
+
/*
|
|
68
|
+
This is for providing an initial form state. Right now we only want to provide the clientfields though
|
|
69
|
+
const schemaMap: {
|
|
70
|
+
[key: string]: FieldState
|
|
71
|
+
} = {}
|
|
72
|
+
const lexicalDeepIterate = (editorState) => {
|
|
73
|
+
console.log('STATE', editorState)
|
|
74
|
+
if (
|
|
75
|
+
editorState &&
|
|
76
|
+
typeof editorState === 'object' &&
|
|
77
|
+
'children' in editorState &&
|
|
78
|
+
Array.isArray(editorState.children)
|
|
79
|
+
) {
|
|
80
|
+
for (const childKey in editorState.children) {
|
|
81
|
+
const childState = editorState.children[childKey]
|
|
82
|
+
if (childState && typeof childState === 'object') {
|
|
83
|
+
lexicalDeepIterate(childState)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
lexicalDeepIterate(value.root)*/
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
clientFeatures,
|
|
93
|
+
featureClientSchemaMap
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=initLexicalFeatures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initLexicalFeatures.js","names":["createClientFields","deepCopyObjectSimple","getFromImportMap","initLexicalFeatures","args","clientFeatures","fieldSchemaMap","Object","fromEntries","Map","resolvedFeatureMapArray","Array","from","sanitizedEditorConfig","resolvedFeatureMap","entries","sort","a","b","order","featureClientSchemaMap","featureKey","resolvedFeature","ClientFeaturePayloadComponent","ClientFeature","clientFeatureProvider","importMap","payload","PayloadComponent","schemaPath","silent","clientFeatureProps","key","clientProps","generateSchemaMap","featureSchemaPath","split","join","featurePath","path","featureSchemaMap","state","startsWith","clientFields","fields","defaultIDType","config","db","disableAddingID","i18n"],"sources":["../../src/utilities/initLexicalFeatures.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\n\nimport {\n type ClientField,\n createClientFields,\n deepCopyObjectSimple,\n type FieldSchemaMap,\n type Payload,\n} from 'payload'\nimport { getFromImportMap } from 'payload/shared'\n\nimport type { FeatureProviderProviderClient } from '../features/typesClient.js'\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type { FeatureClientSchemaMap, LexicalRichTextFieldProps } from '../types.js'\ntype Args = {\n fieldSchemaMap: FieldSchemaMap\n i18n: I18nClient\n path: string\n payload: Payload\n sanitizedEditorConfig: SanitizedServerEditorConfig\n schemaPath: string\n}\n\nexport function initLexicalFeatures(args: Args): {\n clientFeatures: LexicalRichTextFieldProps['clientFeatures']\n featureClientSchemaMap: FeatureClientSchemaMap\n} {\n const clientFeatures: LexicalRichTextFieldProps['clientFeatures'] = {}\n\n const fieldSchemaMap = Object.fromEntries(new Map(args.fieldSchemaMap))\n //&const value = deepCopyObjectSimple(args.fieldState.value)\n\n // turn args.resolvedFeatureMap into an array of [key, value] pairs, ordered by value.order, lowest order first:\n const resolvedFeatureMapArray = Array.from(\n args.sanitizedEditorConfig.resolvedFeatureMap.entries(),\n ).sort((a, b) => a[1].order - b[1].order)\n\n const featureClientSchemaMap: FeatureClientSchemaMap = {}\n\n for (const [featureKey, resolvedFeature] of resolvedFeatureMapArray) {\n clientFeatures[featureKey] = {}\n\n /**\n * Handle client features\n */\n const ClientFeaturePayloadComponent = resolvedFeature.ClientFeature\n\n if (ClientFeaturePayloadComponent) {\n const clientFeatureProvider = getFromImportMap<FeatureProviderProviderClient>({\n importMap: args.payload.importMap,\n PayloadComponent: ClientFeaturePayloadComponent,\n schemaPath: 'lexical-clientComponent',\n silent: true,\n })\n\n if (!clientFeatureProvider) {\n continue\n }\n\n const clientFeatureProps = resolvedFeature.clientFeatureProps ?? {}\n clientFeatureProps.featureKey = resolvedFeature.key\n clientFeatureProps.order = resolvedFeature.order\n if (\n typeof ClientFeaturePayloadComponent === 'object' &&\n ClientFeaturePayloadComponent.clientProps\n ) {\n clientFeatureProps.clientProps = ClientFeaturePayloadComponent.clientProps\n }\n\n // As clientFeatureProvider is a client function, we cannot execute it on the server here. Thus, the client will have to execute clientFeatureProvider with its props\n clientFeatures[featureKey] = { clientFeatureProps, clientFeatureProvider }\n }\n\n /**\n * Handle sub-fields (formstate of those)ttt\n */\n // The args.fieldSchemaMap generated before in buildFormState should contain all of lexical features' sub-field schemas\n // as well, as it already called feature.generateSchemaMap for each feature.\n // We will check for the existance resolvedFeature.generateSchemaMap to skip unnecessary loops for constructing featureSchemaMap, but we don't run it here\n if (resolvedFeature.generateSchemaMap) {\n const featureSchemaPath = [\n ...args.schemaPath.split('.'),\n 'lexical_internal_feature',\n featureKey,\n ].join('.')\n\n const featurePath = [...args.path.split('.'), 'lexical_internal_feature', featureKey].join(\n '.',\n )\n\n // Like args.fieldSchemaMap, we only want to include the sub-fields of the current feature\n const featureSchemaMap: typeof fieldSchemaMap = {}\n for (const key in fieldSchemaMap) {\n const state = fieldSchemaMap[key]\n\n if (key.startsWith(featureSchemaPath)) {\n featureSchemaMap[key] = state\n }\n }\n\n featureClientSchemaMap[featureKey] = {}\n\n for (const key in featureSchemaMap) {\n const state = featureSchemaMap[key]\n\n const clientFields = createClientFields({\n clientFields: ('fields' in state\n ? deepCopyObjectSimple(state.fields)\n : [deepCopyObjectSimple(state)]) as ClientField[],\n defaultIDType: args.payload.config.db.defaultIDType,\n disableAddingID: true,\n fields: 'fields' in state ? state.fields : [state],\n i18n: args.i18n,\n importMap: args.payload.importMap,\n })\n featureClientSchemaMap[featureKey][key] = clientFields\n }\n\n /*\n This is for providing an initial form state. Right now we only want to provide the clientfields though\n const schemaMap: {\n [key: string]: FieldState\n } = {}\n\n const lexicalDeepIterate = (editorState) => {\n console.log('STATE', editorState)\n\n if (\n editorState &&\n typeof editorState === 'object' &&\n 'children' in editorState &&\n Array.isArray(editorState.children)\n ) {\n for (const childKey in editorState.children) {\n const childState = editorState.children[childKey]\n\n if (childState && typeof childState === 'object') {\n lexicalDeepIterate(childState)\n }\n }\n }\n }\n\n lexicalDeepIterate(value.root)*/\n }\n }\n return {\n clientFeatures,\n featureClientSchemaMap,\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpful utility for parsing out all matching top-level JSX tags in a given string.
|
|
3
|
+
* This will collect them in a list, that contains the content of the JSX tag and the props string.
|
|
4
|
+
*
|
|
5
|
+
* While this is not used within payload, this can be used for certain payload blocks that need to
|
|
6
|
+
* be serializable and deserializable to and from JSX.
|
|
7
|
+
*
|
|
8
|
+
* @example:
|
|
9
|
+
*
|
|
10
|
+
* Say you have Steps block that contains a steps array. Its JSX representation may look like this:
|
|
11
|
+
*
|
|
12
|
+
* <Steps>
|
|
13
|
+
* <Step title="Step1">
|
|
14
|
+
* <h1>Step 1</h1>
|
|
15
|
+
* </Step>
|
|
16
|
+
* <Step title="Step2">
|
|
17
|
+
* <h1>Step 2</h1>
|
|
18
|
+
* </Step>
|
|
19
|
+
* </Steps>
|
|
20
|
+
*
|
|
21
|
+
* In this case, the Steps block would have the following content as its children string:
|
|
22
|
+
* <Step title="Step1">
|
|
23
|
+
* <h1>Step 1</h1>
|
|
24
|
+
* </Step>
|
|
25
|
+
* <Step title="Step2">
|
|
26
|
+
* <h1>Step 2</h1>
|
|
27
|
+
* </Step>
|
|
28
|
+
*
|
|
29
|
+
* It could then use this function to collect all the top-level JSX tags (= the steps):
|
|
30
|
+
*
|
|
31
|
+
* collectTopLevelJSXInLines(children.split('\n'), 'Step')
|
|
32
|
+
*
|
|
33
|
+
* This will return:
|
|
34
|
+
*
|
|
35
|
+
* [
|
|
36
|
+
* {
|
|
37
|
+
* content: '<h1>Step 1</h1>',
|
|
38
|
+
* propsString: 'title="Step1"',
|
|
39
|
+
* },
|
|
40
|
+
* {
|
|
41
|
+
* content: '<h1>Step 2</h1>',
|
|
42
|
+
* propsString: 'title="Step2"',
|
|
43
|
+
* },
|
|
44
|
+
* ]
|
|
45
|
+
*
|
|
46
|
+
* You can then map this data to construct the data for this blocks array field.
|
|
47
|
+
*/
|
|
48
|
+
export declare function collectTopLevelJSXInLines(lines: Array<string>, jsxToMatch: string): {
|
|
49
|
+
content: string;
|
|
50
|
+
propsString: string;
|
|
51
|
+
}[];
|
|
52
|
+
//# sourceMappingURL=collectTopLevelJSXInLines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectTopLevelJSXInLines.d.ts","sourceRoot":"","sources":["../../../src/utilities/jsx/collectTopLevelJSXInLines.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpB,UAAU,EAAE,MAAM,GACjB;IACD,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACpB,EAAE,CAiCF"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { linesFromStartToContentAndPropsString } from '../../features/blocks/server/linesFromMatchToContentAndPropsString.js';
|
|
2
|
+
import { createTagRegexes } from '../../features/blocks/server/markdownTransformer.js';
|
|
3
|
+
/**
|
|
4
|
+
* Helpful utility for parsing out all matching top-level JSX tags in a given string.
|
|
5
|
+
* This will collect them in a list, that contains the content of the JSX tag and the props string.
|
|
6
|
+
*
|
|
7
|
+
* While this is not used within payload, this can be used for certain payload blocks that need to
|
|
8
|
+
* be serializable and deserializable to and from JSX.
|
|
9
|
+
*
|
|
10
|
+
* @example:
|
|
11
|
+
*
|
|
12
|
+
* Say you have Steps block that contains a steps array. Its JSX representation may look like this:
|
|
13
|
+
*
|
|
14
|
+
* <Steps>
|
|
15
|
+
* <Step title="Step1">
|
|
16
|
+
* <h1>Step 1</h1>
|
|
17
|
+
* </Step>
|
|
18
|
+
* <Step title="Step2">
|
|
19
|
+
* <h1>Step 2</h1>
|
|
20
|
+
* </Step>
|
|
21
|
+
* </Steps>
|
|
22
|
+
*
|
|
23
|
+
* In this case, the Steps block would have the following content as its children string:
|
|
24
|
+
* <Step title="Step1">
|
|
25
|
+
* <h1>Step 1</h1>
|
|
26
|
+
* </Step>
|
|
27
|
+
* <Step title="Step2">
|
|
28
|
+
* <h1>Step 2</h1>
|
|
29
|
+
* </Step>
|
|
30
|
+
*
|
|
31
|
+
* It could then use this function to collect all the top-level JSX tags (= the steps):
|
|
32
|
+
*
|
|
33
|
+
* collectTopLevelJSXInLines(children.split('\n'), 'Step')
|
|
34
|
+
*
|
|
35
|
+
* This will return:
|
|
36
|
+
*
|
|
37
|
+
* [
|
|
38
|
+
* {
|
|
39
|
+
* content: '<h1>Step 1</h1>',
|
|
40
|
+
* propsString: 'title="Step1"',
|
|
41
|
+
* },
|
|
42
|
+
* {
|
|
43
|
+
* content: '<h1>Step 2</h1>',
|
|
44
|
+
* propsString: 'title="Step2"',
|
|
45
|
+
* },
|
|
46
|
+
* ]
|
|
47
|
+
*
|
|
48
|
+
* You can then map this data to construct the data for this blocks array field.
|
|
49
|
+
*/
|
|
50
|
+
export function collectTopLevelJSXInLines(lines, jsxToMatch) {
|
|
51
|
+
const finds = [];
|
|
52
|
+
const regex = createTagRegexes(jsxToMatch);
|
|
53
|
+
const linesLength = lines.length;
|
|
54
|
+
for (let i = 0; i < linesLength; i++) {
|
|
55
|
+
const startMatch = lines[i].match(regex.regExpStart);
|
|
56
|
+
if (!startMatch) {
|
|
57
|
+
continue; // Try next transformer
|
|
58
|
+
}
|
|
59
|
+
const {
|
|
60
|
+
content,
|
|
61
|
+
endLineIndex,
|
|
62
|
+
propsString
|
|
63
|
+
} = linesFromStartToContentAndPropsString({
|
|
64
|
+
isEndOptional: false,
|
|
65
|
+
lines,
|
|
66
|
+
regexpEndRegex: regex.regExpEnd,
|
|
67
|
+
startLineIndex: i,
|
|
68
|
+
startMatch
|
|
69
|
+
});
|
|
70
|
+
finds.push({
|
|
71
|
+
content,
|
|
72
|
+
propsString
|
|
73
|
+
});
|
|
74
|
+
i = endLineIndex;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
return finds;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=collectTopLevelJSXInLines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectTopLevelJSXInLines.js","names":["linesFromStartToContentAndPropsString","createTagRegexes","collectTopLevelJSXInLines","lines","jsxToMatch","finds","regex","linesLength","length","i","startMatch","match","regExpStart","content","endLineIndex","propsString","isEndOptional","regexpEndRegex","regExpEnd","startLineIndex","push"],"sources":["../../../src/utilities/jsx/collectTopLevelJSXInLines.ts"],"sourcesContent":["import { linesFromStartToContentAndPropsString } from '../../features/blocks/server/linesFromMatchToContentAndPropsString.js'\nimport { createTagRegexes } from '../../features/blocks/server/markdownTransformer.js'\n\n/**\n * Helpful utility for parsing out all matching top-level JSX tags in a given string.\n * This will collect them in a list, that contains the content of the JSX tag and the props string.\n *\n * While this is not used within payload, this can be used for certain payload blocks that need to\n * be serializable and deserializable to and from JSX.\n *\n * @example:\n *\n * Say you have Steps block that contains a steps array. Its JSX representation may look like this:\n *\n * <Steps>\n * <Step title=\"Step1\">\n * <h1>Step 1</h1>\n * </Step>\n * <Step title=\"Step2\">\n * <h1>Step 2</h1>\n * </Step>\n * </Steps>\n *\n * In this case, the Steps block would have the following content as its children string:\n * <Step title=\"Step1\">\n * <h1>Step 1</h1>\n * </Step>\n * <Step title=\"Step2\">\n * <h1>Step 2</h1>\n * </Step>\n *\n * It could then use this function to collect all the top-level JSX tags (= the steps):\n *\n * collectTopLevelJSXInLines(children.split('\\n'), 'Step')\n *\n * This will return:\n *\n * [\n * {\n * content: '<h1>Step 1</h1>',\n * propsString: 'title=\"Step1\"',\n * },\n * {\n * content: '<h1>Step 2</h1>',\n * propsString: 'title=\"Step2\"',\n * },\n * ]\n *\n * You can then map this data to construct the data for this blocks array field.\n */\nexport function collectTopLevelJSXInLines(\n lines: Array<string>,\n jsxToMatch: string,\n): {\n content: string\n propsString: string\n}[] {\n const finds: {\n content: string\n propsString: string\n }[] = []\n const regex = createTagRegexes(jsxToMatch)\n\n const linesLength = lines.length\n\n for (let i = 0; i < linesLength; i++) {\n const startMatch = lines[i].match(regex.regExpStart)\n if (!startMatch) {\n continue // Try next transformer\n }\n\n const { content, endLineIndex, propsString } = linesFromStartToContentAndPropsString({\n isEndOptional: false,\n lines,\n regexpEndRegex: regex.regExpEnd,\n startLineIndex: i,\n startMatch,\n })\n\n finds.push({\n content,\n propsString,\n })\n\n i = endLineIndex\n continue\n }\n\n return finds\n}\n"],"mappings":"AAAA,SAASA,qCAAqC,QAAQ;AACtD,SAASC,gBAAgB,QAAQ;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,OAAO,SAASC,0BACdC,KAAoB,EACpBC,UAAkB;EAKlB,MAAMC,KAAA,GAGA,EAAE;EACR,MAAMC,KAAA,GAAQL,gBAAA,CAAiBG,UAAA;EAE/B,MAAMG,WAAA,GAAcJ,KAAA,CAAMK,MAAM;EAEhC,KAAK,IAAIC,CAAA,GAAI,GAAGA,CAAA,GAAIF,WAAA,EAAaE,CAAA,IAAK;IACpC,MAAMC,UAAA,GAAaP,KAAK,CAACM,CAAA,CAAE,CAACE,KAAK,CAACL,KAAA,CAAMM,WAAW;IACnD,IAAI,CAACF,UAAA,EAAY;MACf,UAAS;IACX;IAEA,MAAM;MAAEG,OAAO;MAAEC,YAAY;MAAEC;IAAW,CAAE,GAAGf,qCAAA,CAAsC;MACnFgB,aAAA,EAAe;MACfb,KAAA;MACAc,cAAA,EAAgBX,KAAA,CAAMY,SAAS;MAC/BC,cAAA,EAAgBV,CAAA;MAChBC;IACF;IAEAL,KAAA,CAAMe,IAAI,CAAC;MACTP,OAAA;MACAE;IACF;IAEAN,CAAA,GAAIK,YAAA;IACJ;EACF;EAEA,OAAOT,KAAA;AACT","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns a JSX props string into an object.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
*
|
|
6
|
+
* Input: type="info" hello={{heyyy: 'test', someNumber: 2}}
|
|
7
|
+
* Output: { type: 'info', hello: { heyyy: 'test', someNumber: 2 } }
|
|
8
|
+
*/
|
|
9
|
+
export declare function extractPropsFromJSXPropsString({ propsString, }: {
|
|
10
|
+
propsString: string;
|
|
11
|
+
}): Record<string, any>;
|
|
12
|
+
//# sourceMappingURL=extractPropsFromJSXPropsString.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractPropsFromJSXPropsString.d.ts","sourceRoot":"","sources":["../../../src/utilities/jsx/extractPropsFromJSXPropsString.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,EAC7C,WAAW,GACZ,EAAE;IACD,WAAW,EAAE,MAAM,CAAA;CACpB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAmCtB"}
|