@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,7 @@
|
|
|
1
|
+
import { fromMarkdown } from 'mdast-util-from-markdown';
|
|
2
|
+
export type AST = ReturnType<typeof fromMarkdown>;
|
|
3
|
+
export declare function parseJSXToAST({ jsxString, keepPositions, }: {
|
|
4
|
+
jsxString: string;
|
|
5
|
+
keepPositions?: boolean;
|
|
6
|
+
}): AST;
|
|
7
|
+
//# sourceMappingURL=mdx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../../../../src/exports/server/ast/mdx.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIvD,MAAM,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA;AAEjD,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,aAAa,GACd,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,GAAG,GAAG,CA6BN"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as acorn from 'acorn';
|
|
2
|
+
import { fromMarkdown } from 'mdast-util-from-markdown';
|
|
3
|
+
import { mdxJsxFromMarkdown } from 'mdast-util-mdx-jsx';
|
|
4
|
+
import { mdxJsx } from 'micromark-extension-mdx-jsx';
|
|
5
|
+
export function parseJSXToAST({
|
|
6
|
+
jsxString,
|
|
7
|
+
keepPositions
|
|
8
|
+
}) {
|
|
9
|
+
const treeComplex = fromMarkdown(jsxString, {
|
|
10
|
+
// @ts-expect-error
|
|
11
|
+
extensions: [mdxJsx({
|
|
12
|
+
acorn,
|
|
13
|
+
addResult: false
|
|
14
|
+
})],
|
|
15
|
+
mdastExtensions: [mdxJsxFromMarkdown()]
|
|
16
|
+
});
|
|
17
|
+
// Remove "position" keys
|
|
18
|
+
const parseTree = tree => {
|
|
19
|
+
for (const key in tree) {
|
|
20
|
+
if (key === 'position' && tree[key].start && tree[key].end) {
|
|
21
|
+
delete tree[key];
|
|
22
|
+
} else if (typeof tree[key] === 'object') {
|
|
23
|
+
parseTree(tree[key]);
|
|
24
|
+
} else if (Array.isArray(tree[key])) {
|
|
25
|
+
for (const item of tree[key]) {
|
|
26
|
+
parseTree(item);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const tree = treeComplex;
|
|
32
|
+
if (keepPositions !== true) {
|
|
33
|
+
parseTree(tree);
|
|
34
|
+
}
|
|
35
|
+
return tree;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=mdx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx.js","names":["acorn","fromMarkdown","mdxJsxFromMarkdown","mdxJsx","parseJSXToAST","jsxString","keepPositions","treeComplex","extensions","addResult","mdastExtensions","parseTree","tree","key","start","end","Array","isArray","item"],"sources":["../../../../src/exports/server/ast/mdx.ts"],"sourcesContent":["import * as acorn from 'acorn'\nimport { fromMarkdown } from 'mdast-util-from-markdown'\nimport { mdxJsxFromMarkdown } from 'mdast-util-mdx-jsx'\nimport { mdxJsx } from 'micromark-extension-mdx-jsx'\n\nexport type AST = ReturnType<typeof fromMarkdown>\n\nexport function parseJSXToAST({\n jsxString,\n keepPositions,\n}: {\n jsxString: string\n keepPositions?: boolean\n}): AST {\n const treeComplex: AST = fromMarkdown(jsxString, {\n // @ts-expect-error\n extensions: [mdxJsx({ acorn, addResult: false })],\n mdastExtensions: [mdxJsxFromMarkdown()],\n })\n\n // Remove \"position\" keys\n const parseTree = (tree: object) => {\n for (const key in tree) {\n if (key === 'position' && tree[key].start && tree[key].end) {\n delete tree[key]\n } else if (typeof tree[key] === 'object') {\n parseTree(tree[key])\n } else if (Array.isArray(tree[key])) {\n for (const item of tree[key]) {\n parseTree(item)\n }\n }\n }\n }\n\n const tree: AST = treeComplex\n\n if (keepPositions !== true) {\n parseTree(tree)\n }\n\n return tree\n}\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,YAAY,QAAQ;AAC7B,SAASC,kBAAkB,QAAQ;AACnC,SAASC,MAAM,QAAQ;AAIvB,OAAO,SAASC,cAAc;EAC5BC,SAAS;EACTC;AAAa,CAId;EACC,MAAMC,WAAA,GAAmBN,YAAA,CAAaI,SAAA,EAAW;IAC/C;IACAG,UAAA,EAAY,CAACL,MAAA,CAAO;MAAEH,KAAA;MAAOS,SAAA,EAAW;IAAM,GAAG;IACjDC,eAAA,EAAiB,CAACR,kBAAA;EACpB;EAEA;EACA,MAAMS,SAAA,GAAaC,IAAA;IACjB,KAAK,MAAMC,GAAA,IAAOD,IAAA,EAAM;MACtB,IAAIC,GAAA,KAAQ,cAAcD,IAAI,CAACC,GAAA,CAAI,CAACC,KAAK,IAAIF,IAAI,CAACC,GAAA,CAAI,CAACE,GAAG,EAAE;QAC1D,OAAOH,IAAI,CAACC,GAAA,CAAI;MAClB,OAAO,IAAI,OAAOD,IAAI,CAACC,GAAA,CAAI,KAAK,UAAU;QACxCF,SAAA,CAAUC,IAAI,CAACC,GAAA,CAAI;MACrB,OAAO,IAAIG,KAAA,CAAMC,OAAO,CAACL,IAAI,CAACC,GAAA,CAAI,GAAG;QACnC,KAAK,MAAMK,IAAA,IAAQN,IAAI,CAACC,GAAA,CAAI,EAAE;UAC5BF,SAAA,CAAUO,IAAA;QACZ;MACF;IACF;EACF;EAEA,MAAMN,IAAA,GAAYL,WAAA;EAElB,IAAID,aAAA,KAAkB,MAAM;IAC1BK,SAAA,CAAUC,IAAA;EACZ;EAEA,OAAOA,IAAA;AACT","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsc.d.ts","sourceRoot":"","sources":["../../../src/exports/server/rsc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsc.js","names":["RscEntryLexicalCell","RscEntryLexicalField"],"sources":["../../../src/exports/server/rsc.ts"],"sourcesContent":["export { RscEntryLexicalCell } from '../../cell/rscEntry.js'\nexport { RscEntryLexicalField } from '../../field/rscEntry.js'\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ;AACpC,SAASC,oBAAoB,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { collectTopLevelJSXInLines } from '../utilities/jsx/collectTopLevelJSXInLines.js';
|
|
2
|
+
export { extractPropsFromJSXPropsString } from '../utilities/jsx/extractPropsFromJSXPropsString.js';
|
|
3
|
+
export { extractFrontmatter, frontmatterToObject, objectToFrontmatter, propsToJSXString, } from '../utilities/jsx/jsx.js';
|
|
4
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/exports/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAA;AAEzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAA;AACnG,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { collectTopLevelJSXInLines } from '../utilities/jsx/collectTopLevelJSXInLines.js';
|
|
2
|
+
export { extractPropsFromJSXPropsString } from '../utilities/jsx/extractPropsFromJSXPropsString.js';
|
|
3
|
+
export { extractFrontmatter, frontmatterToObject, objectToFrontmatter, propsToJSXString } from '../utilities/jsx/jsx.js';
|
|
4
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","names":["collectTopLevelJSXInLines","extractPropsFromJSXPropsString","extractFrontmatter","frontmatterToObject","objectToFrontmatter","propsToJSXString"],"sources":["../../src/exports/shared.ts"],"sourcesContent":["export { collectTopLevelJSXInLines } from '../utilities/jsx/collectTopLevelJSXInLines.js'\n\nexport { extractPropsFromJSXPropsString } from '../utilities/jsx/extractPropsFromJSXPropsString.js'\nexport {\n extractFrontmatter,\n frontmatterToObject,\n objectToFrontmatter,\n propsToJSXString,\n} from '../utilities/jsx/jsx.js'\n"],"mappings":"AAAA,SAASA,yBAAyB,QAAQ;AAE1C,SAASC,8BAA8B,QAAQ;AAC/C,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,mBAAmB,EACnBC,gBAAgB,QACX","ignoreList":[]}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export declare const AlignFeatureClient: import("
|
|
2
|
-
featureKey: string;
|
|
3
|
-
order: number;
|
|
4
|
-
}>;
|
|
1
|
+
export declare const AlignFeatureClient: import("../../typesClient.js").FeatureProviderProviderClient<undefined, undefined>;
|
|
5
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/align/client/index.tsx"],"names":[],"mappings":"AAsJA,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/align/client/index.tsx"],"names":[],"mappings":"AAsJA,eAAO,MAAM,kBAAkB,oFAO7B,CAAA"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export declare const BlockquoteFeatureClient: import("
|
|
2
|
-
featureKey: string;
|
|
3
|
-
order: number;
|
|
4
|
-
}>;
|
|
1
|
+
export declare const BlockquoteFeatureClient: import("../../typesClient.js").FeatureProviderProviderClient<undefined, undefined>;
|
|
5
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/blockquote/client/index.tsx"],"names":[],"mappings":"AA4CA,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/blockquote/client/index.tsx"],"names":[],"mappings":"AA4CA,eAAO,MAAM,uBAAuB,oFA8BlC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdownTransformer.js","names":["$createQuoteNode","$isQuoteNode","QuoteNode","$createLineBreakNode","MarkdownTransformer","type","dependencies","export","node","exportChildren","lines","split","output","line","push","join","regExp","replace","parentNode","children","_match","isImport","previousNode","getPreviousSibling","splice","getChildrenSize","select","remove","append"],"sources":["../../../src/features/blockquote/markdownTransformer.ts"],"sourcesContent":["import type { ElementTransformer } from '@lexical/markdown'\n\nimport { $createQuoteNode, $isQuoteNode, QuoteNode } from '@lexical/rich-text'\nimport { $createLineBreakNode } from 'lexical'\n\nexport const MarkdownTransformer: ElementTransformer = {\n type: 'element',\n dependencies: [QuoteNode],\n export: (node, exportChildren) => {\n if (!$isQuoteNode(node)) {\n return null\n }\n\n const lines = exportChildren(node).split('\\n')\n const output = []\n for (const line of lines) {\n output.push('> ' + line)\n }\n return output.join('\\n')\n },\n regExp: /^>\\s/,\n replace: (parentNode, children, _match, isImport) => {\n if (isImport) {\n const previousNode = parentNode.getPreviousSibling()\n if ($isQuoteNode(previousNode)) {\n previousNode.splice(previousNode.getChildrenSize(), 0, [\n $createLineBreakNode(),\n ...children,\n ])\n previousNode.select(0, 0)\n parentNode.remove()\n return\n }\n }\n\n const node = $createQuoteNode()\n node.append(...children)\n parentNode.replace(node)\n node.select(0, 0)\n },\n}\n"],"mappings":"AAEA,SAASA,gBAAgB,EAAEC,YAAY,EAAEC,SAAS,QAAQ;AAC1D,SAASC,oBAAoB,QAAQ;AAErC,OAAO,MAAMC,mBAAA,GAA0C;EACrDC,IAAA,EAAM;EACNC,YAAA,EAAc,CAACJ,SAAA,CAAU;EACzBK,MAAA,EAAQA,CAACC,IAAA,EAAMC,cAAA;IACb,IAAI,CAACR,YAAA,CAAaO,IAAA,GAAO;MACvB,OAAO;IACT;IAEA,MAAME,KAAA,GAAQD,cAAA,CAAeD,IAAA,EAAMG,KAAK,CAAC;IACzC,MAAMC,MAAA,
|
|
1
|
+
{"version":3,"file":"markdownTransformer.js","names":["$createQuoteNode","$isQuoteNode","QuoteNode","$createLineBreakNode","MarkdownTransformer","type","dependencies","export","node","exportChildren","lines","split","output","line","push","join","regExp","replace","parentNode","children","_match","isImport","previousNode","getPreviousSibling","splice","getChildrenSize","select","remove","append"],"sources":["../../../src/features/blockquote/markdownTransformer.ts"],"sourcesContent":["import type { ElementTransformer } from '@lexical/markdown'\n\nimport { $createQuoteNode, $isQuoteNode, QuoteNode } from '@lexical/rich-text'\nimport { $createLineBreakNode } from 'lexical'\n\nexport const MarkdownTransformer: ElementTransformer = {\n type: 'element',\n dependencies: [QuoteNode],\n export: (node, exportChildren) => {\n if (!$isQuoteNode(node)) {\n return null\n }\n\n const lines = exportChildren(node).split('\\n')\n const output: string[] = []\n for (const line of lines) {\n output.push('> ' + line)\n }\n return output.join('\\n')\n },\n regExp: /^>\\s/,\n replace: (parentNode, children, _match, isImport) => {\n if (isImport) {\n const previousNode = parentNode.getPreviousSibling()\n if ($isQuoteNode(previousNode)) {\n previousNode.splice(previousNode.getChildrenSize(), 0, [\n $createLineBreakNode(),\n ...children,\n ])\n previousNode.select(0, 0)\n parentNode.remove()\n return\n }\n }\n\n const node = $createQuoteNode()\n node.append(...children)\n parentNode.replace(node)\n node.select(0, 0)\n },\n}\n"],"mappings":"AAEA,SAASA,gBAAgB,EAAEC,YAAY,EAAEC,SAAS,QAAQ;AAC1D,SAASC,oBAAoB,QAAQ;AAErC,OAAO,MAAMC,mBAAA,GAA0C;EACrDC,IAAA,EAAM;EACNC,YAAA,EAAc,CAACJ,SAAA,CAAU;EACzBK,MAAA,EAAQA,CAACC,IAAA,EAAMC,cAAA;IACb,IAAI,CAACR,YAAA,CAAaO,IAAA,GAAO;MACvB,OAAO;IACT;IAEA,MAAME,KAAA,GAAQD,cAAA,CAAeD,IAAA,EAAMG,KAAK,CAAC;IACzC,MAAMC,MAAA,GAAmB,EAAE;IAC3B,KAAK,MAAMC,IAAA,IAAQH,KAAA,EAAO;MACxBE,MAAA,CAAOE,IAAI,CAAC,OAAOD,IAAA;IACrB;IACA,OAAOD,MAAA,CAAOG,IAAI,CAAC;EACrB;EACAC,MAAA,EAAQ;EACRC,OAAA,EAASA,CAACC,UAAA,EAAYC,QAAA,EAAUC,MAAA,EAAQC,QAAA;IACtC,IAAIA,QAAA,EAAU;MACZ,MAAMC,YAAA,GAAeJ,UAAA,CAAWK,kBAAkB;MAClD,IAAItB,YAAA,CAAaqB,YAAA,GAAe;QAC9BA,YAAA,CAAaE,MAAM,CAACF,YAAA,CAAaG,eAAe,IAAI,GAAG,CACrDtB,oBAAA,I,GACGgB,QAAA,CACJ;QACDG,YAAA,CAAaI,MAAM,CAAC,GAAG;QACvBR,UAAA,CAAWS,MAAM;QACjB;MACF;IACF;IAEA,MAAMnB,IAAA,GAAOR,gBAAA;IACbQ,IAAA,CAAKoB,MAAM,IAAIT,QAAA;IACfD,UAAA,CAAWD,OAAO,CAACT,IAAA;IACnBA,IAAA,CAAKkB,MAAM,CAAC,GAAG;EACjB;AACF","ignoreList":[]}
|
|
@@ -3,5 +3,5 @@ import type { Spread } from 'lexical';
|
|
|
3
3
|
export type SerializedQuoteNode = Spread<{
|
|
4
4
|
type: 'quote';
|
|
5
5
|
}, _SerializedQuoteNode>;
|
|
6
|
-
export declare const BlockquoteFeature: import("../../typesServer.js").FeatureProviderProviderServer<undefined, undefined,
|
|
6
|
+
export declare const BlockquoteFeature: import("../../typesServer.js").FeatureProviderProviderServer<undefined, undefined, null>;
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/blockquote/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,IAAI,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACrF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAUrC,MAAM,MAAM,mBAAmB,GAAG,MAAM,CACtC;IACE,IAAI,EAAE,OAAO,CAAA;CACd,EACD,oBAAoB,CACrB,CAAA;AAED,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/blockquote/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,IAAI,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACrF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAUrC,MAAM,MAAM,mBAAmB,GAAG,MAAM,CACtC;IACE,IAAI,EAAE,OAAO,CAAA;CACd,EACD,oBAAoB,CACrB,CAAA;AAED,eAAO,MAAM,iBAAiB,0FA8C5B,CAAA"}
|
|
@@ -2,8 +2,8 @@ import { QuoteNode } from '@lexical/rich-text';
|
|
|
2
2
|
import { createServerFeature } from '../../../utilities/createServerFeature.js';
|
|
3
3
|
import { convertLexicalNodesToHTML } from '../../converters/html/converter/index.js';
|
|
4
4
|
import { createNode } from '../../typeUtilities.js';
|
|
5
|
-
import { i18n } from './i18n.js';
|
|
6
5
|
import { MarkdownTransformer } from '../markdownTransformer.js';
|
|
6
|
+
import { i18n } from './i18n.js';
|
|
7
7
|
export const BlockquoteFeature = createServerFeature({
|
|
8
8
|
feature: {
|
|
9
9
|
ClientFeature: '@payloadcms/richtext-lexical/client#BlockquoteFeatureClient',
|
|
@@ -15,6 +15,8 @@ export const BlockquoteFeature = createServerFeature({
|
|
|
15
15
|
html: {
|
|
16
16
|
converter: async ({
|
|
17
17
|
converters,
|
|
18
|
+
currentDepth,
|
|
19
|
+
depth,
|
|
18
20
|
draft,
|
|
19
21
|
node,
|
|
20
22
|
overrideAccess,
|
|
@@ -24,6 +26,8 @@ export const BlockquoteFeature = createServerFeature({
|
|
|
24
26
|
}) => {
|
|
25
27
|
const childrenText = await convertLexicalNodesToHTML({
|
|
26
28
|
converters,
|
|
29
|
+
currentDepth,
|
|
30
|
+
depth,
|
|
27
31
|
draft,
|
|
28
32
|
lexicalNodes: node.children,
|
|
29
33
|
overrideAccess,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["QuoteNode","createServerFeature","convertLexicalNodesToHTML","createNode","
|
|
1
|
+
{"version":3,"file":"index.js","names":["QuoteNode","createServerFeature","convertLexicalNodesToHTML","createNode","MarkdownTransformer","i18n","BlockquoteFeature","feature","ClientFeature","clientFeatureProps","markdownTransformers","nodes","converters","html","converter","currentDepth","depth","draft","node","overrideAccess","parent","req","showHiddenFields","childrenText","lexicalNodes","children","nodeTypes","getType","key"],"sources":["../../../../src/features/blockquote/server/index.ts"],"sourcesContent":["import type { SerializedQuoteNode as _SerializedQuoteNode } from '@lexical/rich-text'\nimport type { Spread } from 'lexical'\n\nimport { QuoteNode } from '@lexical/rich-text'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { convertLexicalNodesToHTML } from '../../converters/html/converter/index.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { MarkdownTransformer } from '../markdownTransformer.js'\nimport { i18n } from './i18n.js'\n\nexport type SerializedQuoteNode = Spread<\n {\n type: 'quote'\n },\n _SerializedQuoteNode\n>\n\nexport const BlockquoteFeature = createServerFeature({\n feature: {\n ClientFeature: '@payloadcms/richtext-lexical/client#BlockquoteFeatureClient',\n clientFeatureProps: null,\n i18n,\n markdownTransformers: [MarkdownTransformer],\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n\n return `<blockquote>${childrenText}</blockquote>`\n },\n nodeTypes: [QuoteNode.getType()],\n },\n },\n node: QuoteNode,\n }),\n ],\n },\n key: 'blockquote',\n})\n"],"mappings":"AAGA,SAASA,SAAS,QAAQ;AAE1B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,IAAI,QAAQ;AASrB,OAAO,MAAMC,iBAAA,GAAoBL,mBAAA,CAAoB;EACnDM,OAAA,EAAS;IACPC,aAAA,EAAe;IACfC,kBAAA,EAAoB;IACpBJ,IAAA;IACAK,oBAAA,EAAsB,CAACN,mBAAA,CAAoB;IAC3CO,KAAA,EAAO,CACLR,UAAA,CAAW;MACTS,UAAA,EAAY;QACVC,IAAA,EAAM;UACJC,SAAA,EAAW,MAAAA,CAAO;YAChBF,UAAU;YACVG,YAAY;YACZC,KAAK;YACLC,KAAK;YACLC,IAAI;YACJC,cAAc;YACdC,MAAM;YACNC,GAAG;YACHC;UAAgB,CACjB;YACC,MAAMC,YAAA,GAAe,MAAMrB,yBAAA,CAA0B;cACnDU,UAAA;cACAG,YAAA;cACAC,KAAA;cACAC,KAAA;cACAO,YAAA,EAAcN,IAAA,CAAKO,QAAQ;cAC3BN,cAAA;cACAC,MAAA,EAAQ;gBACN,GAAGF,IAAI;gBACPE;cACF;cACAC,GAAA;cACAC;YACF;YAEA,OAAO,eAAeC,YAAA,eAA2B;UACnD;UACAG,SAAA,EAAW,CAAC1B,SAAA,CAAU2B,OAAO;QAC/B;MACF;MACAT,IAAA,EAAMlB;IACR;EAEJ;EACA4B,GAAA,EAAK;AACP","ignoreList":[]}
|
|
@@ -1,17 +1,43 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ClientField, FormState } from 'payload';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { LexicalRichTextFieldProps } from '../../../../types.js';
|
|
4
|
-
import type { BlockFields } from '../../server/nodes/BlocksNode.js';
|
|
5
3
|
type Props = {
|
|
6
4
|
baseClass: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
BlockDrawer: React.FC;
|
|
6
|
+
Collapsible: React.FC<{
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
editButton?: boolean;
|
|
9
|
+
errorCount?: number;
|
|
10
|
+
fieldHasErrors?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Override the default label with a custom label
|
|
13
|
+
*/
|
|
14
|
+
Label?: React.ReactNode;
|
|
15
|
+
removeButton?: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
CustomBlock: React.ReactNode;
|
|
18
|
+
EditButton: React.FC;
|
|
19
|
+
errorCount: number;
|
|
10
20
|
formSchema: ClientField[];
|
|
21
|
+
initialState: false | FormState | undefined;
|
|
11
22
|
nodeKey: string;
|
|
12
|
-
|
|
13
|
-
schemaPath: string;
|
|
23
|
+
RemoveButton: React.FC;
|
|
14
24
|
};
|
|
25
|
+
type BlockComponentContextType = {
|
|
26
|
+
BlockCollapsible?: React.FC<{
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
editButton?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Override the default label with a custom label
|
|
31
|
+
*/
|
|
32
|
+
Label?: React.ReactNode;
|
|
33
|
+
removeButton?: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
EditButton?: React.FC;
|
|
36
|
+
initialState: false | FormState | undefined;
|
|
37
|
+
nodeKey?: string;
|
|
38
|
+
RemoveButton?: React.FC;
|
|
39
|
+
};
|
|
40
|
+
export declare const useBlockComponentContext: () => BlockComponentContextType;
|
|
15
41
|
/**
|
|
16
42
|
* The actual content of the Block. This should be INSIDE a Form component,
|
|
17
43
|
* scoped to the block. All format operations in here are thus scoped to the block's form, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/BlockContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"BlockContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/BlockContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGrD,OAAO,KAAiC,MAAM,OAAO,CAAA;AAErD,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,KAAK,CAAC,EAAE,CAAA;IACrB,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;QACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;QAC1B,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,cAAc,CAAC,EAAE,OAAO,CAAA;QACxB;;WAEG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;QACvB,YAAY,CAAC,EAAE,OAAO,CAAA;KACvB,CAAC,CAAA;IACF,WAAW,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,UAAU,EAAE,KAAK,CAAC,EAAE,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,WAAW,EAAE,CAAA;IACzB,YAAY,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAAA;IAE3C,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,KAAK,CAAC,EAAE,CAAA;CACvB,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,gBAAgB,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;QAC1B,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB;;WAEG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;QACvB,YAAY,CAAC,EAAE,OAAO,CAAA;KACvB,CAAC,CAAA;IACF,UAAU,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACrB,YAAY,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAAA;IAE3C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;CACxB,CAAA;AAMD,eAAO,MAAM,wBAAwB,iCAAgD,CAAA;AAErF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAmExC,CAAA"}
|
|
@@ -1,192 +1,88 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// cause isDeepEqual to return false if, for example, formData has a key that fields.data
|
|
13
|
-
// does not have, even if it's undefined.
|
|
14
|
-
// Currently, this happens if a block has another sub-blocks field. Inside formData, that sub-blocks field has an undefined blockName property.
|
|
15
|
-
// Inside of fields.data however, that sub-blocks blockName property does not exist at all.
|
|
16
|
-
function removeUndefinedAndNullAndEmptyArraysRecursively(obj) {
|
|
17
|
-
for (const key in obj) {
|
|
18
|
-
const value = obj[key];
|
|
19
|
-
if (Array.isArray(value) && !value?.length) {
|
|
20
|
-
delete obj[key];
|
|
21
|
-
} else if (value && typeof value === 'object') {
|
|
22
|
-
removeUndefinedAndNullAndEmptyArraysRecursively(value);
|
|
23
|
-
} else if (value === undefined || value === null) {
|
|
24
|
-
delete obj[key];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
5
|
+
import { RenderFields, useFormSubmitted } from '@payloadcms/ui';
|
|
6
|
+
import React, { createContext, useMemo } from 'react';
|
|
7
|
+
const BlockComponentContext = /*#__PURE__*/createContext({
|
|
8
|
+
initialState: false
|
|
9
|
+
});
|
|
10
|
+
export const useBlockComponentContext = () => {
|
|
11
|
+
return React.useContext(BlockComponentContext);
|
|
12
|
+
};
|
|
28
13
|
/**
|
|
29
14
|
* The actual content of the Block. This should be INSIDE a Form component,
|
|
30
15
|
* scoped to the block. All format operations in here are thus scoped to the block's form, and
|
|
31
16
|
* not the whole document.
|
|
32
17
|
*/
|
|
33
18
|
export const BlockContent = props => {
|
|
19
|
+
const $ = _c(13);
|
|
34
20
|
const {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
21
|
+
BlockDrawer,
|
|
22
|
+
Collapsible,
|
|
23
|
+
CustomBlock,
|
|
24
|
+
EditButton,
|
|
25
|
+
errorCount,
|
|
38
26
|
formSchema,
|
|
27
|
+
initialState,
|
|
39
28
|
nodeKey,
|
|
40
|
-
|
|
41
|
-
} = props;
|
|
42
|
-
let {
|
|
43
|
-
formData
|
|
29
|
+
RemoveButton
|
|
44
30
|
} = props;
|
|
45
|
-
const {
|
|
46
|
-
i18n
|
|
47
|
-
} = useTranslation();
|
|
48
|
-
const [editor] = useLexicalComposerContext();
|
|
49
|
-
// Used for saving collapsed to preferences (and gettin' it from there again)
|
|
50
|
-
// Remember, these preferences are scoped to the whole document, not just this form. This
|
|
51
|
-
// is important to consider for the data path used in setDocFieldPreferences
|
|
52
|
-
const {
|
|
53
|
-
getDocPreferences,
|
|
54
|
-
setDocFieldPreferences
|
|
55
|
-
} = useDocumentInfo();
|
|
56
|
-
const [isCollapsed, setIsCollapsed] = React.useState(() => {
|
|
57
|
-
let initialState = false;
|
|
58
|
-
void getDocPreferences().then(currentDocPreferences => {
|
|
59
|
-
const currentFieldPreferences = currentDocPreferences?.fields[field.name];
|
|
60
|
-
const collapsedArray = currentFieldPreferences?.collapsed;
|
|
61
|
-
if (collapsedArray && collapsedArray.includes(formData.id)) {
|
|
62
|
-
initialState = true;
|
|
63
|
-
setIsCollapsed(true);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
return initialState;
|
|
67
|
-
});
|
|
68
31
|
const hasSubmitted = useFormSubmitted();
|
|
69
|
-
const [errorCount, setErrorCount] = React.useState(0);
|
|
70
32
|
const fieldHasErrors = hasSubmitted && errorCount > 0;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// which would trigger the "Leave without saving" dialog unnecessarily
|
|
82
|
-
if (!dequal(formData, newFormData)) {
|
|
83
|
-
// Running this in the next tick in the meantime fixes this issue: https://github.com/payloadcms/payload/issues/4108
|
|
84
|
-
// I don't know why. When this is called immediately, it might focus out of a nested lexical editor field if an update is made there.
|
|
85
|
-
// My hypothesis is that the nested editor might not have fully finished its update cycle yet. By updating in the next tick, we
|
|
86
|
-
// ensure that the nested editor has finished its update cycle before we update the block node.
|
|
87
|
-
setTimeout(() => {
|
|
88
|
-
editor.update(() => {
|
|
89
|
-
const node = $getNodeByKey(nodeKey);
|
|
90
|
-
if (node) {
|
|
91
|
-
formData = newFormData;
|
|
92
|
-
node.setFields(newFormData);
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
}, 0);
|
|
96
|
-
}
|
|
97
|
-
// update error count
|
|
98
|
-
if (hasSubmitted) {
|
|
99
|
-
let rowErrorCount = 0;
|
|
100
|
-
for (const formField of Object.values(fullFieldsWithValues)) {
|
|
101
|
-
if (formField?.valid === false) {
|
|
102
|
-
rowErrorCount++;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
setErrorCount(rowErrorCount);
|
|
106
|
-
}
|
|
107
|
-
}, [editor, nodeKey, hasSubmitted, formData]);
|
|
108
|
-
const onCollapsedChange = useCallback(changedCollapsed => {
|
|
109
|
-
void getDocPreferences().then(currentDocPreferences_0 => {
|
|
110
|
-
const currentFieldPreferences_0 = currentDocPreferences_0?.fields[field.name];
|
|
111
|
-
const collapsedArray_0 = currentFieldPreferences_0?.collapsed;
|
|
112
|
-
const newCollapsed = collapsedArray_0 && collapsedArray_0?.length ? collapsedArray_0 : [];
|
|
113
|
-
if (changedCollapsed) {
|
|
114
|
-
if (!newCollapsed.includes(formData.id)) {
|
|
115
|
-
newCollapsed.push(formData.id);
|
|
116
|
-
}
|
|
117
|
-
} else {
|
|
118
|
-
if (newCollapsed.includes(formData.id)) {
|
|
119
|
-
newCollapsed.splice(newCollapsed.indexOf(formData.id), 1);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
setDocFieldPreferences(field.name, {
|
|
123
|
-
collapsed: newCollapsed,
|
|
124
|
-
hello: 'hi'
|
|
125
|
-
});
|
|
33
|
+
let t0;
|
|
34
|
+
let t1;
|
|
35
|
+
if ($[0] !== Collapsible || $[1] !== errorCount || $[2] !== fieldHasErrors) {
|
|
36
|
+
t1 = props_0 => _jsx(Collapsible, {
|
|
37
|
+
editButton: props_0.editButton,
|
|
38
|
+
errorCount,
|
|
39
|
+
fieldHasErrors,
|
|
40
|
+
Label: props_0.Label,
|
|
41
|
+
removeButton: props_0.removeButton,
|
|
42
|
+
children: props_0.children
|
|
126
43
|
});
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
children: [/*#__PURE__*/_jsxs("div", {
|
|
146
|
-
children: [/*#__PURE__*/_jsx(Pill, {
|
|
147
|
-
className: `${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`,
|
|
148
|
-
pillStyle: "white",
|
|
149
|
-
children: typeof clientBlock?.labels.singular === 'string' ? getTranslation(clientBlock?.labels.singular, i18n) : clientBlock.slug
|
|
150
|
-
}), /*#__PURE__*/_jsx(SectionTitle, {
|
|
151
|
-
path: "blockName",
|
|
152
|
-
readOnly: field?.admin?.readOnly
|
|
153
|
-
}), fieldHasErrors && /*#__PURE__*/_jsx(ErrorPill, {
|
|
154
|
-
count: errorCount,
|
|
155
|
-
i18n: i18n,
|
|
156
|
-
withMessage: true
|
|
157
|
-
})]
|
|
158
|
-
}), editor.isEditable() && /*#__PURE__*/_jsx(Button, {
|
|
159
|
-
buttonStyle: "icon-label",
|
|
160
|
-
className: `${baseClass}__removeButton`,
|
|
161
|
-
disabled: field?.admin?.readOnly,
|
|
162
|
-
icon: "x",
|
|
163
|
-
onClick: e => {
|
|
164
|
-
e.preventDefault();
|
|
165
|
-
removeBlock();
|
|
166
|
-
},
|
|
167
|
-
round: true,
|
|
168
|
-
tooltip: "Remove Block"
|
|
169
|
-
})]
|
|
170
|
-
}),
|
|
171
|
-
isCollapsed: isCollapsed,
|
|
172
|
-
onToggle: incomingCollapsedState => {
|
|
173
|
-
onCollapsedChange(incomingCollapsedState);
|
|
174
|
-
setIsCollapsed(incomingCollapsedState);
|
|
44
|
+
$[0] = Collapsible;
|
|
45
|
+
$[1] = errorCount;
|
|
46
|
+
$[2] = fieldHasErrors;
|
|
47
|
+
$[3] = t1;
|
|
48
|
+
} else {
|
|
49
|
+
t1 = $[3];
|
|
50
|
+
}
|
|
51
|
+
t0 = t1;
|
|
52
|
+
const CollapsibleWithErrorProps = t0;
|
|
53
|
+
let t2;
|
|
54
|
+
if ($[4] !== CustomBlock || $[5] !== CollapsibleWithErrorProps || $[6] !== EditButton || $[7] !== initialState || $[8] !== nodeKey || $[9] !== RemoveButton || $[10] !== BlockDrawer || $[11] !== formSchema) {
|
|
55
|
+
t2 = CustomBlock ? _jsxs(BlockComponentContext.Provider, {
|
|
56
|
+
value: {
|
|
57
|
+
BlockCollapsible: CollapsibleWithErrorProps,
|
|
58
|
+
EditButton,
|
|
59
|
+
initialState,
|
|
60
|
+
nodeKey,
|
|
61
|
+
RemoveButton
|
|
175
62
|
},
|
|
176
|
-
children:
|
|
177
|
-
|
|
63
|
+
children: [CustomBlock, _jsx(BlockDrawer, {})]
|
|
64
|
+
}) : _jsx(CollapsibleWithErrorProps, {
|
|
65
|
+
children: _jsx(RenderFields, {
|
|
178
66
|
fields: formSchema,
|
|
179
67
|
forceRender: true,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
,
|
|
183
|
-
|
|
184
|
-
readOnly: false,
|
|
185
|
-
schemaPath: schemaPath
|
|
68
|
+
parentIndexPath: "",
|
|
69
|
+
parentPath: "",
|
|
70
|
+
parentSchemaPath: "",
|
|
71
|
+
permissions: true
|
|
186
72
|
})
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
73
|
+
});
|
|
74
|
+
$[4] = CustomBlock;
|
|
75
|
+
$[5] = CollapsibleWithErrorProps;
|
|
76
|
+
$[6] = EditButton;
|
|
77
|
+
$[7] = initialState;
|
|
78
|
+
$[8] = nodeKey;
|
|
79
|
+
$[9] = RemoveButton;
|
|
80
|
+
$[10] = BlockDrawer;
|
|
81
|
+
$[11] = formSchema;
|
|
82
|
+
$[12] = t2;
|
|
83
|
+
} else {
|
|
84
|
+
t2 = $[12];
|
|
85
|
+
}
|
|
86
|
+
return t2;
|
|
191
87
|
};
|
|
192
88
|
//# sourceMappingURL=BlockContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockContent.js","names":["useLexicalComposerContext","getTranslation","Button","Collapsible","ErrorPill","Pill","RenderComponent","RenderFields","SectionTitle","useDocumentInfo","useFormSubmitted","useTranslation","dequal","$getNodeByKey","React","useCallback","FormSavePlugin","removeUndefinedAndNullAndEmptyArraysRecursively","obj","key","value","Array","isArray","length","undefined","BlockContent","props","baseClass","clientBlock","field","formSchema","nodeKey","schemaPath","formData","i18n","editor","getDocPreferences","setDocFieldPreferences","isCollapsed","setIsCollapsed","useState","initialState","then","currentDocPreferences","currentFieldPreferences","fields","name","collapsedArray","collapsed","includes","id","hasSubmitted","errorCount","setErrorCount","fieldHasErrors","classNames","filter","Boolean","join","onFormChange","fullFieldsWithValues","newFormData","blockType","setTimeout","update","node","setFields","rowErrorCount","formField","Object","values","valid","onCollapsedChange","changedCollapsed","newCollapsed","push","splice","indexOf","hello","removeBlock","remove","_jsxs","Fragment","_jsx","className","collapsibleStyle","header","admin","components","Label","clientProps","blockKind","mappedComponent","pillStyle","labels","singular","slug","path","readOnly","count","withMessage","isEditable","buttonStyle","disabled","icon","onClick","e","preventDefault","round","tooltip","onToggle","incomingCollapsedState","forceRender","margins","onChange"],"sources":["../../../../../src/features/blocks/client/component/BlockContent.tsx"],"sourcesContent":["'use client'\nimport type { ClientBlock, ClientField, CollapsedPreferences, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Collapsible,\n ErrorPill,\n Pill,\n RenderComponent,\n RenderFields,\n SectionTitle,\n useDocumentInfo,\n useFormSubmitted,\n useTranslation,\n} from '@payloadcms/ui'\nimport { dequal } from 'dequal/lite'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback } from 'react'\n\nimport type { LexicalRichTextFieldProps } from '../../../../types.js'\nimport type { BlockFields } from '../../server/nodes/BlocksNode.js'\nimport type { BlockNode } from '../nodes/BlocksNode.js'\n\nimport { FormSavePlugin } from './FormSavePlugin.js'\n\ntype Props = {\n baseClass: string\n clientBlock: ClientBlock\n field: LexicalRichTextFieldProps['field']\n formData: BlockFields\n formSchema: ClientField[]\n nodeKey: string\n path: string\n schemaPath: string\n}\n\n// Recursively remove all undefined values from even being present in formData, as they will\n// cause isDeepEqual to return false if, for example, formData has a key that fields.data\n// does not have, even if it's undefined.\n// Currently, this happens if a block has another sub-blocks field. Inside formData, that sub-blocks field has an undefined blockName property.\n// Inside of fields.data however, that sub-blocks blockName property does not exist at all.\nfunction removeUndefinedAndNullAndEmptyArraysRecursively(obj: object) {\n for (const key in obj) {\n const value = obj[key]\n if (Array.isArray(value) && !value?.length) {\n delete obj[key]\n } else if (value && typeof value === 'object') {\n removeUndefinedAndNullAndEmptyArraysRecursively(value)\n } else if (value === undefined || value === null) {\n delete obj[key]\n }\n }\n}\n\n/**\n * The actual content of the Block. This should be INSIDE a Form component,\n * scoped to the block. All format operations in here are thus scoped to the block's form, and\n * not the whole document.\n */\nexport const BlockContent: React.FC<Props> = (props) => {\n const { baseClass, clientBlock, field, formSchema, nodeKey, schemaPath } = props\n let { formData } = props\n\n const { i18n } = useTranslation()\n const [editor] = useLexicalComposerContext()\n // Used for saving collapsed to preferences (and gettin' it from there again)\n // Remember, these preferences are scoped to the whole document, not just this form. This\n // is important to consider for the data path used in setDocFieldPreferences\n const { getDocPreferences, setDocFieldPreferences } = useDocumentInfo()\n\n const [isCollapsed, setIsCollapsed] = React.useState<boolean>(() => {\n let initialState = false\n\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences = currentDocPreferences?.fields[field.name]\n\n const collapsedArray = currentFieldPreferences?.collapsed\n\n if (collapsedArray && collapsedArray.includes(formData.id)) {\n initialState = true\n setIsCollapsed(true)\n }\n })\n return initialState\n })\n\n const hasSubmitted = useFormSubmitted()\n\n const [errorCount, setErrorCount] = React.useState(0)\n\n const fieldHasErrors = hasSubmitted && errorCount > 0\n\n const classNames = [\n `${baseClass}__row`,\n fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,\n ]\n .filter(Boolean)\n .join(' ')\n\n const onFormChange = useCallback(\n ({\n fullFieldsWithValues,\n newFormData,\n }: {\n fullFieldsWithValues: FormState\n newFormData: BlockFields\n }) => {\n newFormData.id = formData.id\n newFormData.blockType = formData.blockType\n\n removeUndefinedAndNullAndEmptyArraysRecursively(newFormData)\n removeUndefinedAndNullAndEmptyArraysRecursively(formData)\n\n // Only update if the data has actually changed. Otherwise, we may be triggering an unnecessary value change,\n // which would trigger the \"Leave without saving\" dialog unnecessarily\n if (!dequal(formData, newFormData)) {\n // Running this in the next tick in the meantime fixes this issue: https://github.com/payloadcms/payload/issues/4108\n // I don't know why. When this is called immediately, it might focus out of a nested lexical editor field if an update is made there.\n // My hypothesis is that the nested editor might not have fully finished its update cycle yet. By updating in the next tick, we\n // ensure that the nested editor has finished its update cycle before we update the block node.\n setTimeout(() => {\n editor.update(() => {\n const node: BlockNode = $getNodeByKey(nodeKey)\n if (node) {\n formData = newFormData\n node.setFields(newFormData)\n }\n })\n }, 0)\n }\n\n // update error count\n if (hasSubmitted) {\n let rowErrorCount = 0\n for (const formField of Object.values(fullFieldsWithValues)) {\n if (formField?.valid === false) {\n rowErrorCount++\n }\n }\n setErrorCount(rowErrorCount)\n }\n },\n [editor, nodeKey, hasSubmitted, formData],\n )\n\n const onCollapsedChange = useCallback(\n (changedCollapsed: boolean) => {\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences = currentDocPreferences?.fields[field.name]\n\n const collapsedArray = currentFieldPreferences?.collapsed\n\n const newCollapsed: CollapsedPreferences =\n collapsedArray && collapsedArray?.length ? collapsedArray : []\n\n if (changedCollapsed) {\n if (!newCollapsed.includes(formData.id)) {\n newCollapsed.push(formData.id)\n }\n } else {\n if (newCollapsed.includes(formData.id)) {\n newCollapsed.splice(newCollapsed.indexOf(formData.id), 1)\n }\n }\n\n setDocFieldPreferences(field.name, {\n collapsed: newCollapsed,\n hello: 'hi',\n })\n })\n },\n [getDocPreferences, field.name, setDocFieldPreferences, formData.id],\n )\n\n const removeBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n return (\n <React.Fragment>\n <Collapsible\n className={classNames}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n header={\n clientBlock?.admin?.components?.Label ? (\n <RenderComponent\n clientProps={{ blockKind: 'lexicalBlock', formData }}\n mappedComponent={clientBlock.admin.components.Label}\n />\n ) : (\n <div className={`${baseClass}__block-header`}>\n <div>\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`}\n pillStyle=\"white\"\n >\n {typeof clientBlock?.labels.singular === 'string'\n ? getTranslation(clientBlock?.labels.singular, i18n)\n : clientBlock.slug}\n </Pill>\n <SectionTitle path=\"blockName\" readOnly={field?.admin?.readOnly} />\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n {editor.isEditable() && (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.admin?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeBlock()\n }}\n round\n tooltip=\"Remove Block\"\n />\n )}\n </div>\n )\n }\n isCollapsed={isCollapsed}\n key={0}\n onToggle={(incomingCollapsedState) => {\n onCollapsedChange(incomingCollapsedState)\n setIsCollapsed(incomingCollapsedState)\n }}\n >\n <RenderFields\n className={`${baseClass}__fields`}\n fields={formSchema}\n forceRender\n margins=\"small\"\n path=\"\" // Leaving path empty makes it so field values are not prefixed / scoped by the entire schemaPath. e.g. we can access \"myField\" instead of \"someLexicalField.feature.blocks.someArrayB\" // TODO: Could there be any implications leaving path different than schemaPath?\n readOnly={false}\n schemaPath={schemaPath} // Having the correct schemaPath here allows sub-fields (like array > addRow) to run correct form-state calls and retrieve their needed form state from the server\n />\n </Collapsible>\n\n <FormSavePlugin onChange={onFormChange} />\n </React.Fragment>\n )\n}\n"],"mappings":"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","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"BlockContent.js","names":["c","_c","RenderFields","useFormSubmitted","React","createContext","useMemo","BlockComponentContext","initialState","useBlockComponentContext","useContext","BlockContent","props","$","BlockDrawer","Collapsible","CustomBlock","EditButton","errorCount","formSchema","nodeKey","RemoveButton","hasSubmitted","fieldHasErrors","t0","t1","props_0","_jsx","editButton","Label","removeButton","children","CollapsibleWithErrorProps","t2","_jsxs","Provider","value","BlockCollapsible","fields","forceRender","parentIndexPath","parentPath","parentSchemaPath","permissions"],"sources":["../../../../../src/features/blocks/client/component/BlockContent.tsx"],"sourcesContent":["'use client'\nimport type { ClientField, FormState } from 'payload'\n\nimport { RenderFields, useFormSubmitted } from '@payloadcms/ui'\nimport React, { createContext, useMemo } from 'react'\n\ntype Props = {\n baseClass: string\n BlockDrawer: React.FC\n Collapsible: React.FC<{\n children?: React.ReactNode\n editButton?: boolean\n errorCount?: number\n fieldHasErrors?: boolean\n /**\n * Override the default label with a custom label\n */\n Label?: React.ReactNode\n removeButton?: boolean\n }>\n CustomBlock: React.ReactNode\n EditButton: React.FC\n errorCount: number\n formSchema: ClientField[]\n initialState: false | FormState | undefined\n\n nodeKey: string\n RemoveButton: React.FC\n}\n\ntype BlockComponentContextType = {\n BlockCollapsible?: React.FC<{\n children?: React.ReactNode\n editButton?: boolean\n /**\n * Override the default label with a custom label\n */\n Label?: React.ReactNode\n removeButton?: boolean\n }>\n EditButton?: React.FC\n initialState: false | FormState | undefined\n\n nodeKey?: string\n RemoveButton?: React.FC\n}\n\nconst BlockComponentContext = createContext<BlockComponentContextType>({\n initialState: false,\n})\n\nexport const useBlockComponentContext = () => React.useContext(BlockComponentContext)\n\n/**\n * The actual content of the Block. This should be INSIDE a Form component,\n * scoped to the block. All format operations in here are thus scoped to the block's form, and\n * not the whole document.\n */\nexport const BlockContent: React.FC<Props> = (props) => {\n const {\n BlockDrawer,\n Collapsible,\n CustomBlock,\n EditButton,\n errorCount,\n formSchema,\n initialState,\n nodeKey,\n RemoveButton,\n } = props\n\n const hasSubmitted = useFormSubmitted()\n\n const fieldHasErrors = hasSubmitted && errorCount > 0\n\n const CollapsibleWithErrorProps = useMemo(\n () =>\n (props: {\n children?: React.ReactNode\n editButton?: boolean\n\n /**\n * Override the default label with a custom label\n */\n Label?: React.ReactNode\n removeButton?: boolean\n }) => (\n <Collapsible\n editButton={props.editButton}\n errorCount={errorCount}\n fieldHasErrors={fieldHasErrors}\n Label={props.Label}\n removeButton={props.removeButton}\n >\n {props.children}\n </Collapsible>\n ),\n [Collapsible, fieldHasErrors, errorCount],\n )\n\n return CustomBlock ? (\n <BlockComponentContext.Provider\n value={{\n BlockCollapsible: CollapsibleWithErrorProps,\n EditButton,\n initialState,\n nodeKey,\n RemoveButton,\n }}\n >\n {CustomBlock}\n <BlockDrawer />\n </BlockComponentContext.Provider>\n ) : (\n <CollapsibleWithErrorProps>\n <RenderFields\n fields={formSchema}\n forceRender={true}\n parentIndexPath=\"\"\n parentPath={''}\n parentSchemaPath=\"\"\n permissions={true}\n />\n </CollapsibleWithErrorProps>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,YAAY,EAAEC,gBAAgB,QAAQ;AAC/C,OAAOC,KAAA,IAASC,aAAa,EAAEC,OAAO,QAAQ;AA2C9C,MAAMC,qBAAA,gBAAwBF,aAAA,CAAyC;EACrEG,YAAA,EAAc;AAChB;AAEA,OAAO,MAAMC,wBAAA,GAA2BA,CAAA;EAAA,OAAML,KAAA,CAAAM,UAAA,CAAAH,qBAAiB;AAAA;AAE/D;;;;;AAKA,OAAO,MAAMI,YAAA,GAAgCC,KAAA;EAAA,MAAAC,CAAA,GAAAZ,EAAA;EAC3C;IAAAa,WAAA;IAAAC,WAAA;IAAAC,WAAA;IAAAC,UAAA;IAAAC,UAAA;IAAAC,UAAA;IAAAX,YAAA;IAAAY,OAAA;IAAAC;EAAA,IAUIT,KAAA;EAEJ,MAAAU,YAAA,GAAqBnB,gBAAA;EAErB,MAAAoB,cAAA,GAAuBD,YAAA,IAAgBJ,UAAA,IAAa;EAAA,IAAAM,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAZ,CAAA,QAAAE,WAAA,IAAAF,CAAA,QAAAK,UAAA,IAAAL,CAAA,QAAAU,cAAA;IAIhDE,EAAA,GAAAC,OAAA,IAUEC,IAAA,CAACZ,WAAA;MAAAa,UAAA,EACahB,OAAA,CAAAgB,UAAA;MAAAV,UAAA;MAAAK,cAAA;MAAAM,KAAA,EAGLjB,OAAA,CAAAiB,KAAA;MAAAC,YAAA,EACOlB,OAAA,CAAAkB,YAAA;MAAAC,QAAA,EAEbnB,OAAA,CAAAmB;IAAA,C;;;;;;;;OAjBLN,E;EAFJ,MAAAO,yBAAA,GAAkCR,EAsBS;EAAA,IAAAS,EAAA;EAAA,IAAApB,CAAA,QAAAG,WAAA,IAAAH,CAAA,QAAAmB,yBAAA,IAAAnB,CAAA,QAAAI,UAAA,IAAAJ,CAAA,QAAAL,YAAA,IAAAK,CAAA,QAAAO,OAAA,IAAAP,CAAA,QAAAQ,YAAA,IAAAR,CAAA,SAAAC,WAAA,IAAAD,CAAA,SAAAM,UAAA;IAGpCc,EAAA,GAAAjB,WAAA,GACLkB,KAAA,CAAA3B,qBAAA,CAAA4B,QAAA;MAAAC,KAAA;QAAAC,gBAAA,EAEsBL,yBAAA;QAAAf,UAAA;QAAAT,YAAA;QAAAY,OAAA;QAAAC;MAAA;MAAAU,QAAA,GAOnBf,WAAA,EACDW,IAAA,CAACb,WAAA;IAAA,C,IAGHa,IAAA,CAACK,yBAAA;MAAAD,QAAA,EACCJ,IAAA,CAAAzB,YAAA;QAAAoC,MAAA,EACUnB,UAAA;QAAAoB,WAAA;QAAAC,eAAA,EAEQ;QAAAC,UAAA,EACJ;QAAAC,gBAAA,EACK;QAAAC,WAAA;MAAA,C;;;;;;;;;;;;;;SApBhBV,E;CAyBT","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const BlockCollapsible: React.FC<{
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
editButton?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Override the default label with a custom label
|
|
7
|
+
*/
|
|
8
|
+
Label?: React.ReactNode;
|
|
9
|
+
removeButton?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=BlockCollapsible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockCollapsible.d.ts","sourceRoot":"","sources":["../../../../../../src/features/blocks/client/component/components/BlockCollapsible.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAQA,CAAA"}
|