@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
|
@@ -5,11 +5,13 @@ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext
|
|
|
5
5
|
import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js';
|
|
6
6
|
import { mergeRegister } from '@lexical/utils';
|
|
7
7
|
import { getTranslation } from '@payloadcms/translations';
|
|
8
|
-
import { Button,
|
|
8
|
+
import { Button, File, formatDrawerSlug, useConfig, useEditDepth, usePayloadAPI, useTranslation } from '@payloadcms/ui';
|
|
9
9
|
import { $getNodeByKey, $getSelection, $isNodeSelection, CLICK_COMMAND, COMMAND_PRIORITY_LOW, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND } from 'lexical';
|
|
10
10
|
import React, { useCallback, useEffect, useId, useReducer, useRef, useState } from 'react';
|
|
11
11
|
import { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js';
|
|
12
12
|
import { FieldsDrawer } from '../../../../utilities/fieldsDrawer/Drawer.js';
|
|
13
|
+
import { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js';
|
|
14
|
+
import { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js';
|
|
13
15
|
import { EnabledRelationshipsCondition } from '../../../relationship/client/utils/EnabledRelationshipsCondition.js';
|
|
14
16
|
import { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js';
|
|
15
17
|
import { $isUploadNode } from '../nodes/UploadNode.js';
|
|
@@ -39,9 +41,6 @@ const Component = props => {
|
|
|
39
41
|
}
|
|
40
42
|
} = useConfig();
|
|
41
43
|
const uploadRef = useRef(null);
|
|
42
|
-
const {
|
|
43
|
-
closeModal
|
|
44
|
-
} = useModal();
|
|
45
44
|
const {
|
|
46
45
|
uuid
|
|
47
46
|
} = useEditorConfigContext();
|
|
@@ -50,7 +49,10 @@ const Component = props => {
|
|
|
50
49
|
const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey);
|
|
51
50
|
const {
|
|
52
51
|
editorConfig,
|
|
53
|
-
|
|
52
|
+
fieldProps: {
|
|
53
|
+
readOnly,
|
|
54
|
+
schemaPath
|
|
55
|
+
}
|
|
54
56
|
} = useEditorConfigContext();
|
|
55
57
|
const {
|
|
56
58
|
i18n,
|
|
@@ -59,13 +61,19 @@ const Component = props => {
|
|
|
59
61
|
const [cacheBust, dispatchCacheBust] = useReducer(state => state + 1, 0);
|
|
60
62
|
const [relatedCollection] = useState(() => collections.find(coll => coll.slug === relationTo));
|
|
61
63
|
const componentID = useId();
|
|
62
|
-
const
|
|
64
|
+
const extraFieldsDrawerSlug = formatDrawerSlug({
|
|
63
65
|
slug: `lexical-upload-drawer-` + uuid + componentID,
|
|
64
66
|
depth: editDepth
|
|
65
67
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
// Need to use hook to initialize useEffect that restores cursor position
|
|
69
|
+
const {
|
|
70
|
+
toggleDrawer
|
|
71
|
+
} = useLexicalDrawer(extraFieldsDrawerSlug, true);
|
|
72
|
+
const {
|
|
73
|
+
closeDocumentDrawer,
|
|
74
|
+
DocumentDrawer,
|
|
75
|
+
DocumentDrawerToggler
|
|
76
|
+
} = useLexicalDocumentDrawer({
|
|
69
77
|
id: value,
|
|
70
78
|
collectionSlug: relatedCollection.slug
|
|
71
79
|
});
|
|
@@ -80,7 +88,7 @@ const Component = props => {
|
|
|
80
88
|
const thumbnailSRC = data?.thumbnailURL || data?.url;
|
|
81
89
|
const removeUpload = useCallback(() => {
|
|
82
90
|
editor.update(() => {
|
|
83
|
-
$getNodeByKey(nodeKey)
|
|
91
|
+
$getNodeByKey(nodeKey)?.remove();
|
|
84
92
|
});
|
|
85
93
|
}, [editor, nodeKey]);
|
|
86
94
|
const updateUpload = useCallback(data_0 => {
|
|
@@ -89,37 +97,39 @@ const Component = props => {
|
|
|
89
97
|
cacheBust
|
|
90
98
|
});
|
|
91
99
|
dispatchCacheBust();
|
|
92
|
-
|
|
93
|
-
}, [setParams, cacheBust,
|
|
100
|
+
closeDocumentDrawer();
|
|
101
|
+
}, [setParams, cacheBust, closeDocumentDrawer]);
|
|
94
102
|
const $onDelete = useCallback(event => {
|
|
95
|
-
|
|
103
|
+
const deleteSelection = $getSelection();
|
|
104
|
+
if (isSelected && $isNodeSelection(deleteSelection)) {
|
|
96
105
|
event.preventDefault();
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
106
|
+
editor.update(() => {
|
|
107
|
+
deleteSelection.getNodes().forEach(node => {
|
|
108
|
+
if ($isUploadNode(node)) {
|
|
109
|
+
node.remove();
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
102
113
|
}
|
|
103
114
|
return false;
|
|
104
|
-
}, [
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (event_0.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
115
|
+
}, [editor, isSelected]);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
return mergeRegister(editor.registerCommand(CLICK_COMMAND, event_0 => {
|
|
118
|
+
// Check if uploadRef.target or anything WITHIN uploadRef.target was clicked
|
|
119
|
+
if (event_0.target === uploadRef.current || uploadRef.current?.contains(event_0.target)) {
|
|
120
|
+
if (event_0.shiftKey) {
|
|
121
|
+
setSelected(!isSelected);
|
|
122
|
+
} else {
|
|
123
|
+
if (!isSelected) {
|
|
124
|
+
clearSelection();
|
|
125
|
+
setSelected(true);
|
|
126
|
+
}
|
|
114
127
|
}
|
|
128
|
+
return true;
|
|
115
129
|
}
|
|
116
|
-
return
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
}, [isSelected, setSelected, clearSelection]);
|
|
120
|
-
useEffect(() => {
|
|
121
|
-
return mergeRegister(editor.registerCommand(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW));
|
|
122
|
-
}, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected, onClick]);
|
|
130
|
+
return false;
|
|
131
|
+
}, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW));
|
|
132
|
+
}, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected]);
|
|
123
133
|
const hasExtraFields = editorConfig?.resolvedFeatureMap?.get('upload')?.sanitizedClientFeatureProps.collections?.[relatedCollection.slug]?.hasExtraFields;
|
|
124
134
|
const onExtraFieldsDrawerSubmit = useCallback((_, data_1) => {
|
|
125
135
|
// Update lexical node (with key nodeKey) with new data
|
|
@@ -133,8 +143,7 @@ const Component = props => {
|
|
|
133
143
|
uploadNode.setData(newData);
|
|
134
144
|
}
|
|
135
145
|
});
|
|
136
|
-
|
|
137
|
-
}, [closeModal, editor, drawerSlug, nodeKey]);
|
|
146
|
+
}, [editor, nodeKey]);
|
|
138
147
|
return /*#__PURE__*/_jsxs("div", {
|
|
139
148
|
className: [baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' '),
|
|
140
149
|
contentEditable: false,
|
|
@@ -158,24 +167,22 @@ const Component = props => {
|
|
|
158
167
|
children: getTranslation(relatedCollection.labels.singular, i18n)
|
|
159
168
|
}), editor.isEditable() && /*#__PURE__*/_jsxs("div", {
|
|
160
169
|
className: `${baseClass}__actions`,
|
|
161
|
-
children: [hasExtraFields ? /*#__PURE__*/_jsx(
|
|
170
|
+
children: [hasExtraFields ? /*#__PURE__*/_jsx(Button, {
|
|
171
|
+
buttonStyle: "icon-label",
|
|
162
172
|
className: `${baseClass}__upload-drawer-toggler`,
|
|
163
|
-
disabled:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
round: true,
|
|
173
|
-
tooltip: t('fields:editRelationship')
|
|
174
|
-
})
|
|
173
|
+
disabled: readOnly,
|
|
174
|
+
el: "button",
|
|
175
|
+
icon: "edit",
|
|
176
|
+
onClick: () => {
|
|
177
|
+
toggleDrawer();
|
|
178
|
+
},
|
|
179
|
+
round: true,
|
|
180
|
+
tooltip: t('fields:editRelationship')
|
|
175
181
|
}) : null, /*#__PURE__*/_jsx(Button, {
|
|
176
182
|
buttonStyle: "icon-label",
|
|
177
|
-
|
|
178
|
-
|
|
183
|
+
className: `${baseClass}__swap-drawer-toggler`,
|
|
184
|
+
disabled: readOnly,
|
|
185
|
+
el: "button",
|
|
179
186
|
icon: "swap",
|
|
180
187
|
onClick: () => {
|
|
181
188
|
editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {
|
|
@@ -189,10 +196,10 @@ const Component = props => {
|
|
|
189
196
|
}), /*#__PURE__*/_jsx(Button, {
|
|
190
197
|
buttonStyle: "icon-label",
|
|
191
198
|
className: `${baseClass}__removeButton`,
|
|
192
|
-
disabled:
|
|
199
|
+
disabled: readOnly,
|
|
193
200
|
icon: "x",
|
|
194
|
-
onClick:
|
|
195
|
-
|
|
201
|
+
onClick: e => {
|
|
202
|
+
e.preventDefault();
|
|
196
203
|
removeUpload();
|
|
197
204
|
},
|
|
198
205
|
round: true,
|
|
@@ -209,16 +216,17 @@ const Component = props => {
|
|
|
209
216
|
})
|
|
210
217
|
})
|
|
211
218
|
})]
|
|
212
|
-
}), value
|
|
219
|
+
}), value ? /*#__PURE__*/_jsx(DocumentDrawer, {
|
|
213
220
|
onSave: updateUpload
|
|
214
|
-
}), hasExtraFields ? /*#__PURE__*/_jsx(FieldsDrawer, {
|
|
221
|
+
}) : null, hasExtraFields ? /*#__PURE__*/_jsx(FieldsDrawer, {
|
|
215
222
|
data: fields,
|
|
216
|
-
drawerSlug:
|
|
223
|
+
drawerSlug: extraFieldsDrawerSlug,
|
|
217
224
|
drawerTitle: t('general:editLabel', {
|
|
218
225
|
label: getTranslation(relatedCollection.labels.singular, i18n)
|
|
219
226
|
}),
|
|
220
227
|
featureKey: "upload",
|
|
221
228
|
handleDrawerSubmit: onExtraFieldsDrawerSubmit,
|
|
229
|
+
schemaPath: schemaPath,
|
|
222
230
|
schemaPathSuffix: relatedCollection.slug
|
|
223
231
|
}) : null]
|
|
224
232
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalNodeSelection","mergeRegister","getTranslation","Button","DrawerToggler","File","formatDrawerSlug","useConfig","useDocumentDrawer","useEditDepth","useModal","usePayloadAPI","useTranslation","$getNodeByKey","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","React","useCallback","useEffect","useId","useReducer","useRef","useState","useEditorConfigContext","FieldsDrawer","EnabledRelationshipsCondition","INSERT_UPLOAD_WITH_DRAWER_COMMAND","$isUploadNode","baseClass","initialParams","depth","Component","props","data","fields","relationTo","value","nodeKey","Error","config","collections","routes","api","serverURL","uploadRef","closeModal","uuid","editDepth","editor","isSelected","setSelected","clearSelection","editorConfig","field","i18n","t","cacheBust","dispatchCacheBust","state","relatedCollection","find","coll","slug","componentID","drawerSlug","DocumentDrawer","DocumentDrawerToggler","closeDrawer","id","collectionSlug","setParams","thumbnailSRC","thumbnailURL","url","removeUpload","update","remove","updateUpload","$onDelete","event","preventDefault","node","onClick","target","current","contains","shiftKey","registerCommand","hasExtraFields","resolvedFeatureMap","get","sanitizedClientFeatureProps","onExtraFieldsDrawerSubmit","_","uploadNode","newData","getData","setData","_jsxs","className","filter","Boolean","join","contentEditable","ref","_jsx","alt","filename","src","labels","singular","isEditable","disabled","admin","readOnly","buttonStyle","el","icon","e","round","tooltip","dispatchCommand","replace","onSave","drawerTitle","label","featureKey","handleDrawerSubmit","schemaPathSuffix","UploadComponent","uploads"],"sources":["../../../../../src/features/upload/client/component/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, Data } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n DrawerToggler,\n File,\n formatDrawerSlug,\n useConfig,\n useDocumentDrawer,\n useEditDepth,\n useModal,\n usePayloadAPI,\n useTranslation,\n} from '@payloadcms/ui'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport React, { useCallback, useEffect, useId, useReducer, useRef, useState } from 'react'\n\nimport type { ClientComponentProps } from '../../../typesClient.js'\nimport type { UploadData } from '../../server/nodes/UploadNode.js'\nimport type { UploadFeaturePropsClient } from '../feature.client.js'\nimport type { UploadNode } from '../nodes/UploadNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { FieldsDrawer } from '../../../../utilities/fieldsDrawer/Drawer.js'\nimport { EnabledRelationshipsCondition } from '../../../relationship/client/utils/EnabledRelationshipsCondition.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport { $isUploadNode } from '../nodes/UploadNode.js'\nimport './index.scss'\n\nconst baseClass = 'lexical-upload'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n data: UploadData\n nodeKey: string\n}\n\nconst Component: React.FC<ElementProps> = (props) => {\n const {\n data: { fields, relationTo, value },\n nodeKey,\n } = props\n\n if (typeof value === 'object') {\n throw new Error(\n 'Upload value should be a string or number. The Lexical Upload component should not receive the populated value object.',\n )\n }\n\n const {\n config: {\n collections,\n routes: { api },\n serverURL,\n },\n } = useConfig()\n const uploadRef = useRef<HTMLDivElement | null>(null)\n const { closeModal } = useModal()\n const { uuid } = useEditorConfigContext()\n const editDepth = useEditDepth()\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const { editorConfig, field } = useEditorConfigContext()\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection] = useState<ClientCollectionConfig>(() =>\n collections.find((coll) => coll.slug === relationTo),\n )\n\n const componentID = useId()\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-upload-drawer-` + uuid + componentID, // There can be multiple upload components, each with their own drawer, in one single editor => separate them by componentID\n depth: editDepth,\n })\n\n const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n // Get the referenced document\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${value}`,\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (data: Data) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n dispatchCacheBust()\n closeDrawer()\n },\n [setParams, cacheBust, closeDrawer],\n )\n\n const $onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isUploadNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n const onClick = useCallback(\n (event: MouseEvent) => {\n // Check if uploadRef.target or anything WITHIN uploadRef.target was clicked\n if (event.target === uploadRef.current || uploadRef.current?.contains(event.target as Node)) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n if (!isSelected) {\n clearSelection()\n setSelected(true)\n }\n }\n return true\n }\n\n return false\n },\n [isSelected, setSelected, clearSelection],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW),\n\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected, onClick])\n\n const hasExtraFields = (\n editorConfig?.resolvedFeatureMap?.get('upload')\n ?.sanitizedClientFeatureProps as ClientComponentProps<UploadFeaturePropsClient>\n ).collections?.[relatedCollection.slug]?.hasExtraFields\n\n const onExtraFieldsDrawerSubmit = useCallback(\n (_, data) => {\n // Update lexical node (with key nodeKey) with new data\n editor.update(() => {\n const uploadNode: UploadNode | null = $getNodeByKey(nodeKey)\n if (uploadNode) {\n const newData: UploadData = {\n ...uploadNode.getData(),\n fields: data,\n }\n uploadNode.setData(newData)\n }\n })\n\n closeModal(drawerSlug)\n },\n [closeModal, editor, drawerSlug, nodeKey],\n )\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={uploadRef}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__topRow`}>\n {/* TODO: migrate to use @payloadcms/ui/elements/Thumbnail component */}\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC ? (\n <img\n alt={data?.filename}\n data-lexical-upload-id={value}\n data-lexical-upload-relation-to={relationTo}\n src={thumbnailSRC}\n />\n ) : (\n <File />\n )}\n </div>\n <div className={`${baseClass}__topRowRightPanel`}>\n <div className={`${baseClass}__collectionLabel`}>\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n {hasExtraFields ? (\n <DrawerToggler\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={field?.admin?.readOnly}\n slug={drawerSlug}\n >\n <Button\n buttonStyle=\"icon-label\"\n el=\"div\"\n icon=\"edit\"\n onClick={(e) => {\n e.preventDefault()\n }}\n round\n tooltip={t('fields:editRelationship')}\n />\n </DrawerToggler>\n ) : null}\n\n <Button\n buttonStyle=\"icon-label\"\n disabled={field?.admin?.readOnly}\n el=\"div\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapUpload')}\n />\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 removeUpload()\n }}\n round\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n <div className={`${baseClass}__bottomRow`}>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <strong>{data?.filename}</strong>\n </DocumentDrawerToggler>\n </div>\n </div>\n {value && <DocumentDrawer onSave={updateUpload} />}\n {hasExtraFields ? (\n <FieldsDrawer\n data={fields}\n drawerSlug={drawerSlug}\n drawerTitle={t('general:editLabel', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n featureKey=\"upload\"\n handleDrawerSubmit={onExtraFieldsDrawerSubmit}\n schemaPathSuffix={relatedCollection.slug}\n />\n ) : null}\n </div>\n )\n}\n\nexport const UploadComponent = (props: ElementProps): React.ReactNode => {\n return (\n <EnabledRelationshipsCondition {...props} uploads>\n <Component {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,uBAAuB,QAAQ;AACxC,SAASC,aAAa,QAAQ;AAC9B,SAASC,cAAc,QAAQ;AAC/B,SACEC,MAAM,EACNC,aAAa,EACbC,IAAI,EACJC,gBAAgB,EAChBC,SAAS,EACTC,iBAAiB,EACjBC,YAAY,EACZC,QAAQ,EACRC,aAAa,EACbC,cAAc,QACT;AACP,SACEC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb;AACP,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAOnF,SAASC,sBAAsB,QAAQ;AACvC,SAASC,YAAY,QAAQ;AAC7B,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,iCAAiC,QAAQ;AAClD,SAASC,aAAa,QAAQ;AAG9B,MAAMC,SAAA,GAAY;AAElB,MAAMC,aAA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,eAAA,GAAmBjG,KAAA;EAC9B,oBACEyE,IAAA,CAAChF,6BAAA;IAA+B,GAAGO,KAAK;IAAEkG,OAAO;cAC/C,aAAAzB,IAAA,CAAC1E,SAAA;MAAW,GAAGC;;;AAGrB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalNodeSelection","mergeRegister","getTranslation","Button","File","formatDrawerSlug","useConfig","useEditDepth","usePayloadAPI","useTranslation","$getNodeByKey","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","React","useCallback","useEffect","useId","useReducer","useRef","useState","useEditorConfigContext","FieldsDrawer","useLexicalDocumentDrawer","useLexicalDrawer","EnabledRelationshipsCondition","INSERT_UPLOAD_WITH_DRAWER_COMMAND","$isUploadNode","baseClass","initialParams","depth","Component","props","data","fields","relationTo","value","nodeKey","Error","config","collections","routes","api","serverURL","uploadRef","uuid","editDepth","editor","isSelected","setSelected","clearSelection","editorConfig","fieldProps","readOnly","schemaPath","i18n","t","cacheBust","dispatchCacheBust","state","relatedCollection","find","coll","slug","componentID","extraFieldsDrawerSlug","toggleDrawer","closeDocumentDrawer","DocumentDrawer","DocumentDrawerToggler","id","collectionSlug","setParams","thumbnailSRC","thumbnailURL","url","removeUpload","update","remove","updateUpload","$onDelete","event","deleteSelection","preventDefault","getNodes","forEach","node","registerCommand","target","current","contains","shiftKey","hasExtraFields","resolvedFeatureMap","get","sanitizedClientFeatureProps","onExtraFieldsDrawerSubmit","_","uploadNode","newData","getData","setData","_jsxs","className","filter","Boolean","join","contentEditable","ref","_jsx","alt","filename","src","labels","singular","isEditable","buttonStyle","disabled","el","icon","onClick","round","tooltip","dispatchCommand","replace","e","onSave","drawerSlug","drawerTitle","label","featureKey","handleDrawerSubmit","schemaPathSuffix","UploadComponent","uploads"],"sources":["../../../../../src/features/upload/client/component/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, Data } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n File,\n formatDrawerSlug,\n useConfig,\n useEditDepth,\n usePayloadAPI,\n useTranslation,\n} from '@payloadcms/ui'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport React, { useCallback, useEffect, useId, useReducer, useRef, useState } from 'react'\n\nimport type { BaseClientFeatureProps } from '../../../typesClient.js'\nimport type { UploadData } from '../../server/nodes/UploadNode.js'\nimport type { UploadFeaturePropsClient } from '../feature.client.js'\nimport type { UploadNode } from '../nodes/UploadNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { FieldsDrawer } from '../../../../utilities/fieldsDrawer/Drawer.js'\nimport { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { EnabledRelationshipsCondition } from '../../../relationship/client/utils/EnabledRelationshipsCondition.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport { $isUploadNode } from '../nodes/UploadNode.js'\nimport './index.scss'\n\nconst baseClass = 'lexical-upload'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n data: UploadData\n nodeKey: string\n}\n\nconst Component: React.FC<ElementProps> = (props) => {\n const {\n data: { fields, relationTo, value },\n nodeKey,\n } = props\n\n if (typeof value === 'object') {\n throw new Error(\n 'Upload value should be a string or number. The Lexical Upload component should not receive the populated value object.',\n )\n }\n\n const {\n config: {\n collections,\n routes: { api },\n serverURL,\n },\n } = useConfig()\n const uploadRef = useRef<HTMLDivElement | null>(null)\n const { uuid } = useEditorConfigContext()\n const editDepth = useEditDepth()\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const {\n editorConfig,\n fieldProps: { readOnly, schemaPath },\n } = useEditorConfigContext()\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection] = useState<ClientCollectionConfig>(\n () => collections.find((coll) => coll.slug === relationTo)!,\n )\n\n const componentID = useId()\n\n const extraFieldsDrawerSlug = formatDrawerSlug({\n slug: `lexical-upload-drawer-` + uuid + componentID, // There can be multiple upload components, each with their own drawer, in one single editor => separate them by componentID\n depth: editDepth,\n })\n\n // Need to use hook to initialize useEffect that restores cursor position\n const { toggleDrawer } = useLexicalDrawer(extraFieldsDrawerSlug, true)\n\n const { closeDocumentDrawer, DocumentDrawer, DocumentDrawerToggler } = useLexicalDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n // Get the referenced document\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${value}`,\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (data: Data) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n dispatchCacheBust()\n closeDocumentDrawer()\n },\n [setParams, cacheBust, closeDocumentDrawer],\n )\n\n const $onDelete = useCallback(\n (event: KeyboardEvent) => {\n const deleteSelection = $getSelection()\n if (isSelected && $isNodeSelection(deleteSelection)) {\n event.preventDefault()\n editor.update(() => {\n deleteSelection.getNodes().forEach((node) => {\n if ($isUploadNode(node)) {\n node.remove()\n }\n })\n })\n }\n return false\n },\n [editor, isSelected],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(\n CLICK_COMMAND,\n (event: MouseEvent) => {\n // Check if uploadRef.target or anything WITHIN uploadRef.target was clicked\n if (\n event.target === uploadRef.current ||\n uploadRef.current?.contains(event.target as Node)\n ) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n if (!isSelected) {\n clearSelection()\n setSelected(true)\n }\n }\n return true\n }\n\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected])\n\n const hasExtraFields = (\n editorConfig?.resolvedFeatureMap?.get('upload')\n ?.sanitizedClientFeatureProps as BaseClientFeatureProps<UploadFeaturePropsClient>\n ).collections?.[relatedCollection.slug]?.hasExtraFields\n\n const onExtraFieldsDrawerSubmit = useCallback(\n (_, data) => {\n // Update lexical node (with key nodeKey) with new data\n editor.update(() => {\n const uploadNode: null | UploadNode = $getNodeByKey(nodeKey)\n if (uploadNode) {\n const newData: UploadData = {\n ...uploadNode.getData(),\n fields: data,\n }\n uploadNode.setData(newData)\n }\n })\n },\n [editor, nodeKey],\n )\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={uploadRef}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__topRow`}>\n {/* TODO: migrate to use @payloadcms/ui/elements/Thumbnail component */}\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC ? (\n <img\n alt={data?.filename}\n data-lexical-upload-id={value}\n data-lexical-upload-relation-to={relationTo}\n src={thumbnailSRC}\n />\n ) : (\n <File />\n )}\n </div>\n <div className={`${baseClass}__topRowRightPanel`}>\n <div className={`${baseClass}__collectionLabel`}>\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n {hasExtraFields ? (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={readOnly}\n el=\"button\"\n icon=\"edit\"\n onClick={() => {\n toggleDrawer()\n }}\n round\n tooltip={t('fields:editRelationship')}\n />\n ) : null}\n\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__swap-drawer-toggler`}\n disabled={readOnly}\n el=\"button\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapUpload')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeUpload()\n }}\n round\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n <div className={`${baseClass}__bottomRow`}>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <strong>{data?.filename}</strong>\n </DocumentDrawerToggler>\n </div>\n </div>\n {value ? <DocumentDrawer onSave={updateUpload} /> : null}\n {hasExtraFields ? (\n <FieldsDrawer\n data={fields}\n drawerSlug={extraFieldsDrawerSlug}\n drawerTitle={t('general:editLabel', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n featureKey=\"upload\"\n handleDrawerSubmit={onExtraFieldsDrawerSubmit}\n schemaPath={schemaPath}\n schemaPathSuffix={relatedCollection.slug}\n />\n ) : null}\n </div>\n )\n}\n\nexport const UploadComponent = (props: ElementProps): React.ReactNode => {\n return (\n <EnabledRelationshipsCondition {...props} uploads>\n <Component {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,uBAAuB,QAAQ;AACxC,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E;;;;QAIpB3E,KAAA,gBAAQyE,IAAA,CAACzC,cAAA;MAAe0D,MAAA,EAAQ/C;SAAmB,MACnDa,cAAA,gBACCiB,IAAA,CAACvF,YAAA;MACCW,IAAA,EAAMC,MAAA;MACN6F,UAAA,EAAY9D,qBAAA;MACZ+D,WAAA,EAAaxE,CAAA,CAAE,qBAAqB;QAClCyE,KAAA,EAAOlI,cAAA,CAAe6D,iBAAA,CAAkBqD,MAAM,CAACC,QAAQ,EAAE3D,IAAA;MAC3D;MACA2E,UAAA,EAAW;MACXC,kBAAA,EAAoBnC,yBAAA;MACpB1C,UAAA,EAAYA,UAAA;MACZ8E,gBAAA,EAAkBxE,iBAAA,CAAkBG;SAEpC;;AAGV;AAEA,OAAO,MAAMsE,eAAA,GAAmBrG,KAAA;EAC9B,oBACE6E,IAAA,CAACpF,6BAAA;IAA+B,GAAGO,KAAK;IAAEsG,OAAO;cAC/C,aAAAzB,IAAA,CAAC9E,SAAA;MAAW,GAAGC;;;AAGrB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/drawer/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/drawer/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA2C,MAAM,OAAO,CAAA;AA6C/D,KAAK,KAAK,GAAG;IACX,sBAAsB,EAAE,MAAM,EAAE,CAAA;CACjC,CAAA;AA0CD,eAAO,MAAM,YAAY,UAAW,KAAK,KAAG,KAAK,CAAC,SAMjD,CAAA"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
|
|
6
|
-
import { useListDrawer } from '@payloadcms/ui';
|
|
7
6
|
import { $getNodeByKey, COMMAND_PRIORITY_EDITOR } from 'lexical';
|
|
8
7
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
8
|
+
import { useLexicalListDrawer } from '../../../../utilities/fieldsDrawer/useLexicalListDrawer.js';
|
|
9
9
|
import { EnabledRelationshipsCondition } from '../../../relationship/client/utils/EnabledRelationshipsCondition.js';
|
|
10
10
|
import { $createUploadNode } from '../nodes/UploadNode.js';
|
|
11
11
|
import { INSERT_UPLOAD_COMMAND } from '../plugin/index.js';
|
|
@@ -18,6 +18,7 @@ const insertUpload = ({
|
|
|
18
18
|
}) => {
|
|
19
19
|
if (!replaceNodeKey) {
|
|
20
20
|
editor.dispatchCommand(INSERT_UPLOAD_COMMAND, {
|
|
21
|
+
// @ts-expect-error - TODO: fix this
|
|
21
22
|
fields: null,
|
|
22
23
|
relationTo,
|
|
23
24
|
value
|
|
@@ -28,6 +29,7 @@ const insertUpload = ({
|
|
|
28
29
|
if (node) {
|
|
29
30
|
node.replace($createUploadNode({
|
|
30
31
|
data: {
|
|
32
|
+
// @ts-expect-error - TODO: fix this
|
|
31
33
|
fields: null,
|
|
32
34
|
relationTo,
|
|
33
35
|
value
|
|
@@ -55,64 +57,64 @@ const UploadDrawerComponent = t0 => {
|
|
|
55
57
|
} else {
|
|
56
58
|
t1 = $[1];
|
|
57
59
|
}
|
|
58
|
-
const [ListDrawer, ListDrawerToggler, t2] = useListDrawer(t1);
|
|
59
60
|
const {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
closeListDrawer,
|
|
62
|
+
ListDrawer,
|
|
63
|
+
openListDrawer
|
|
64
|
+
} = useLexicalListDrawer(t1);
|
|
65
|
+
let t2;
|
|
63
66
|
let t3;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
t3 = () => editor.registerCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, payload => {
|
|
67
|
+
if ($[2] !== editor || $[3] !== openListDrawer) {
|
|
68
|
+
t2 = () => editor.registerCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, payload => {
|
|
67
69
|
setReplaceNodeKey(payload?.replace ? payload?.replace.nodeKey : null);
|
|
68
|
-
|
|
70
|
+
openListDrawer();
|
|
69
71
|
return true;
|
|
70
72
|
}, COMMAND_PRIORITY_EDITOR);
|
|
71
|
-
|
|
73
|
+
t3 = [editor, openListDrawer];
|
|
72
74
|
$[2] = editor;
|
|
73
|
-
$[3] =
|
|
74
|
-
$[4] =
|
|
75
|
-
$[5] =
|
|
75
|
+
$[3] = openListDrawer;
|
|
76
|
+
$[4] = t2;
|
|
77
|
+
$[5] = t3;
|
|
76
78
|
} else {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
t2 = $[4];
|
|
80
|
+
t3 = $[5];
|
|
79
81
|
}
|
|
80
|
-
useEffect(
|
|
81
|
-
let
|
|
82
|
-
if ($[6] !==
|
|
83
|
-
|
|
82
|
+
useEffect(t2, t3);
|
|
83
|
+
let t4;
|
|
84
|
+
if ($[6] !== closeListDrawer || $[7] !== editor || $[8] !== replaceNodeKey) {
|
|
85
|
+
t4 = t5 => {
|
|
84
86
|
const {
|
|
85
87
|
collectionSlug,
|
|
86
88
|
docID
|
|
87
|
-
} =
|
|
89
|
+
} = t5;
|
|
90
|
+
closeListDrawer();
|
|
88
91
|
insertUpload({
|
|
89
92
|
editor,
|
|
90
93
|
relationTo: collectionSlug,
|
|
91
94
|
replaceNodeKey,
|
|
92
95
|
value: docID
|
|
93
96
|
});
|
|
94
|
-
closeDrawer();
|
|
95
97
|
};
|
|
96
|
-
$[6] =
|
|
97
|
-
$[7] =
|
|
98
|
-
$[8] =
|
|
99
|
-
$[9] =
|
|
98
|
+
$[6] = closeListDrawer;
|
|
99
|
+
$[7] = editor;
|
|
100
|
+
$[8] = replaceNodeKey;
|
|
101
|
+
$[9] = t4;
|
|
100
102
|
} else {
|
|
101
|
-
|
|
103
|
+
t4 = $[9];
|
|
102
104
|
}
|
|
103
|
-
const onSelect =
|
|
104
|
-
let
|
|
105
|
+
const onSelect = t4;
|
|
106
|
+
let t5;
|
|
105
107
|
if ($[10] !== onSelect || $[11] !== ListDrawer) {
|
|
106
|
-
|
|
108
|
+
t5 = _jsx(ListDrawer, {
|
|
107
109
|
onSelect
|
|
108
110
|
});
|
|
109
111
|
$[10] = onSelect;
|
|
110
112
|
$[11] = ListDrawer;
|
|
111
|
-
$[12] =
|
|
113
|
+
$[12] = t5;
|
|
112
114
|
} else {
|
|
113
|
-
|
|
115
|
+
t5 = $[12];
|
|
114
116
|
}
|
|
115
|
-
return
|
|
117
|
+
return t5;
|
|
116
118
|
};
|
|
117
119
|
export const UploadDrawer = props => {
|
|
118
120
|
return /*#__PURE__*/_jsx(EnabledRelationshipsCondition, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$getNodeByKey","COMMAND_PRIORITY_EDITOR","React","useCallback","useEffect","useState","useLexicalListDrawer","EnabledRelationshipsCondition","$createUploadNode","INSERT_UPLOAD_COMMAND","INSERT_UPLOAD_WITH_DRAWER_COMMAND","insertUpload","editor","relationTo","replaceNodeKey","value","dispatchCommand","fields","update","node","replace","data","UploadDrawerComponent","t0","$","enabledCollectionSlugs","setReplaceNodeKey","t1","collectionSlugs","uploads","closeListDrawer","ListDrawer","openListDrawer","t2","t3","registerCommand","payload","nodeKey","t4","t5","collectionSlug","docID","onSelect","_jsx","UploadDrawer","props"],"sources":["../../../../../src/features/upload/client/drawer/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $getNodeByKey, COMMAND_PRIORITY_EDITOR } from 'lexical'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport { useLexicalListDrawer } from '../../../../utilities/fieldsDrawer/useLexicalListDrawer.js'\nimport { EnabledRelationshipsCondition } from '../../../relationship/client/utils/EnabledRelationshipsCondition.js'\nimport { $createUploadNode } from '../nodes/UploadNode.js'\nimport { INSERT_UPLOAD_COMMAND } from '../plugin/index.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from './commands.js'\n\nconst insertUpload = ({\n editor,\n relationTo,\n replaceNodeKey,\n value,\n}: {\n editor: LexicalEditor\n relationTo: string\n replaceNodeKey: null | string\n value: number | string\n}) => {\n if (!replaceNodeKey) {\n editor.dispatchCommand(INSERT_UPLOAD_COMMAND, {\n // @ts-expect-error - TODO: fix this\n fields: null,\n relationTo,\n value,\n })\n } else {\n editor.update(() => {\n const node = $getNodeByKey(replaceNodeKey)\n if (node) {\n node.replace(\n $createUploadNode({\n data: {\n // @ts-expect-error - TODO: fix this\n fields: null,\n relationTo,\n value,\n },\n }),\n )\n }\n })\n }\n}\n\ntype Props = {\n enabledCollectionSlugs: string[]\n}\n\nconst UploadDrawerComponent: React.FC<Props> = ({ enabledCollectionSlugs }) => {\n const [editor] = useLexicalComposerContext()\n\n const [replaceNodeKey, setReplaceNodeKey] = useState<null | string>(null)\n\n const { closeListDrawer, ListDrawer, openListDrawer } = useLexicalListDrawer({\n collectionSlugs: enabledCollectionSlugs,\n uploads: true,\n })\n\n useEffect(() => {\n return editor.registerCommand<{\n replace: { nodeKey: string } | false\n }>(\n INSERT_UPLOAD_WITH_DRAWER_COMMAND,\n (payload) => {\n setReplaceNodeKey(payload?.replace ? payload?.replace.nodeKey : null)\n openListDrawer()\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor, openListDrawer])\n\n const onSelect = useCallback(\n ({ collectionSlug, docID }) => {\n closeListDrawer()\n insertUpload({\n editor,\n relationTo: collectionSlug,\n replaceNodeKey,\n value: docID,\n })\n },\n [editor, closeListDrawer, replaceNodeKey],\n )\n\n return <ListDrawer onSelect={onSelect} />\n}\n\nexport const UploadDrawer = (props: Props): React.ReactNode => {\n return (\n <EnabledRelationshipsCondition {...props} uploads>\n <UploadDraw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,UAAA;IAGpCQ,EAAA,GAAAI,IAAA,CAACZ,UAAA;MAAAW;IAAA,C;;;;;;;SAADH,E;CACT;AAEA,OAAO,MAAMK,YAAA,GAAgBC,KAAA;EAC3B,oBACEF,IAAA,CAACpC,6BAAA;IAA+B,GAAGsC,KAAK;IAAEhB,OAAO;cAC/C,aAAAc,IAAA,CAACrB,qBAAA;MAAuB,GAAGuB;;;AAGjC","ignoreList":[]}
|
|
@@ -5,8 +5,5 @@ export type UploadFeaturePropsClient = {
|
|
|
5
5
|
};
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
|
-
export declare const UploadFeatureClient: import("
|
|
9
|
-
featureKey: string;
|
|
10
|
-
order: number;
|
|
11
|
-
} & UploadFeaturePropsClient>;
|
|
8
|
+
export declare const UploadFeatureClient: import("../../typesClient.js").FeatureProviderProviderClient<UploadFeaturePropsClient, UploadFeaturePropsClient>;
|
|
12
9
|
//# sourceMappingURL=feature.client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/client/feature.client.tsx"],"names":[],"mappings":"AAYA,MAAM,MAAM,wBAAwB,GAAG;IACrC,WAAW,EAAE;QACX,CAAC,UAAU,EAAE,MAAM,GAAG;YACpB,cAAc,EAAE,OAAO,CAAA;SACxB,CAAA;KACF,CAAA;CACF,CAAA;AAED,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/client/feature.client.tsx"],"names":[],"mappings":"AAYA,MAAM,MAAM,wBAAwB,GAAG;IACrC,WAAW,EAAE;QACX,CAAC,UAAU,EAAE,MAAM,GAAG;YACpB,cAAc,EAAE,OAAO,CAAA;SACxB,CAAA;KACF,CAAA;CACF,CAAA;AAED,eAAO,MAAM,mBAAmB,kHAqD9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/nodes/UploadNode.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAA;AAC/F,OAAO,KAAK,EAAE,gBAAgB,EAAuB,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AACzF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAMhC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,
|
|
1
|
+
{"version":3,"file":"UploadNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/nodes/UploadNode.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAA;AAC/F,OAAO,KAAK,EAAE,gBAAgB,EAAuB,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AACzF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAMhC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,EAA0B,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAkC3F,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,IAAI,EAAE,QAAQ,CAAA;CACf,GAAG,MAAM,CAAC,UAAU,EAAE,4BAA4B,CAAC,CAAA;AAEpD,qBAAa,UAAW,SAAQ,gBAAgB;IAC9C,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,gBAAgB,GAAG,gBAAgB;IAItD,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;IAS3C,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,oBAAoB,GAAG,UAAU;IAsBnE,QAAQ,IAAI,GAAG,CAAC,OAAO;IAIvB,UAAU,IAAI,oBAAoB;CAGnC;AAED,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,GACL,EAAE;IACD,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAA;CAC/D,GAAG,UAAU,CAKb;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,UAAU,CAEtF"}
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import ObjectID from 'bson-objectid';
|
|
5
5
|
import { $applyNodeReplacement } from 'lexical';
|
|
6
6
|
import * as React from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { isGoogleDocCheckboxImg, UploadServerNode } from '../../server/nodes/UploadNode.js';
|
|
8
8
|
const RawUploadComponent = /*#__PURE__*/React.lazy(() => import('../../client/component/index.js').then(module => ({
|
|
9
9
|
default: module.UploadComponent
|
|
10
10
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadNode.js","names":["ObjectID","$applyNodeReplacement","React","
|
|
1
|
+
{"version":3,"file":"UploadNode.js","names":["ObjectID","$applyNodeReplacement","React","isGoogleDocCheckboxImg","UploadServerNode","RawUploadComponent","lazy","then","module","default","UploadComponent","$convertUploadElement","domNode","hasAttribute","id","getAttribute","relationTo","node","$createUploadNode","data","fields","value","img","src","startsWith","UploadNode","clone","getType","importDOM","conversion","priority","importJSON","serializedNode","version","toHexString","importedData","setFormat","format","decorate","_jsx","__data","nodeKey","getKey","exportJSON","$isUploadNode"],"sources":["../../../../../src/features/upload/client/nodes/UploadNode.tsx"],"sourcesContent":["'use client'\nimport type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type { DOMConversionMap, DOMConversionOutput, LexicalNode, Spread } from 'lexical'\nimport type { JSX } from 'react'\n\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nimport type { UploadData } from '../../server/nodes/UploadNode.js'\n\nimport { isGoogleDocCheckboxImg, UploadServerNode } from '../../server/nodes/UploadNode.js'\n\nconst RawUploadComponent = React.lazy(() =>\n import('../../client/component/index.js').then((module) => ({ default: module.UploadComponent })),\n)\n\nfunction $convertUploadElement(domNode: HTMLImageElement): DOMConversionOutput | null {\n if (\n domNode.hasAttribute('data-lexical-upload-relation-to') &&\n domNode.hasAttribute('data-lexical-upload-id')\n ) {\n const id = domNode.getAttribute('data-lexical-upload-id')\n const relationTo = domNode.getAttribute('data-lexical-upload-relation-to')\n\n if (id != null && relationTo != null) {\n const node = $createUploadNode({\n data: {\n fields: {},\n relationTo,\n value: id,\n },\n })\n return { node }\n }\n }\n const img = domNode\n if (img.src.startsWith('file:///') || isGoogleDocCheckboxImg(img)) {\n return null\n }\n // TODO: Auto-upload functionality here!\n //}\n return null\n}\n\nexport type SerializedUploadNode = {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'upload'\n} & Spread<UploadData, SerializedDecoratorBlockNode>\n\nexport class UploadNode extends UploadServerNode {\n static clone(node: UploadServerNode): UploadServerNode {\n return super.clone(node)\n }\n\n static getType(): string {\n return super.getType()\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n img: (node: HTMLImageElement) => ({\n conversion: $convertUploadElement,\n priority: 0,\n }),\n }\n }\n\n static importJSON(serializedNode: SerializedUploadNode): UploadNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n if (serializedNode.version === 2 && !serializedNode?.id) {\n serializedNode.id = new ObjectID.default().toHexString()\n serializedNode.version = 3\n }\n\n const importedData: UploadData = {\n id: serializedNode.id,\n fields: serializedNode.fields,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n decorate(): JSX.Element {\n return <RawUploadComponent data={this.__data} nodeKey={this.getKey()} />\n }\n\n exportJSON(): SerializedUploadNode {\n return super.exportJSON()\n }\n}\n\nexport function $createUploadNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n return $applyNodeReplacement(new UploadNode({ data: data as UploadData }))\n}\n\nexport function $isUploadNode(node: LexicalNode | null | undefined): node is UploadNode {\n return node instanceof UploadNode\n}\n"],"mappings":"AAAA;;;AAKA,OAAOA,QAAA,MAAc;AACrB,SAASC,qBAAqB,QAAQ;AACtC,YAAYC,KAAA,MAAW;AAIvB,SAASC,sBAAsB,EAAEC,gBAAgB,QAAQ;AAEzD,MAAMC,kBAAA,gBAAqBH,KAAA,CAAMI,IAAI,CAAC,MACpC,MAAM,CAAC,mCAAmCC,IAAI,CAAEC,MAAA,KAAY;EAAEC,OAAA,EAASD,MAAA,CAAOE;AAAgB;AAGhG,SAASC,sBAAsBC,OAAyB;EACtD,IACEA,OAAA,CAAQC,YAAY,CAAC,sCACrBD,OAAA,CAAQC,YAAY,CAAC,2BACrB;IACA,MAAMC,EAAA,GAAKF,OAAA,CAAQG,YAAY,CAAC;IAChC,MAAMC,UAAA,GAAaJ,OAAA,CAAQG,YAAY,CAAC;IAExC,IAAID,EAAA,IAAM,QAAQE,UAAA,IAAc,MAAM;MACpC,MAAMC,IAAA,GAAOC,iBAAA,CAAkB;QAC7BC,IAAA,EAAM;UACJC,MAAA,EAAQ,CAAC;UACTJ,UAAA;UACAK,KAAA,EAAOP;QACT;MACF;MACA,OAAO;QAAEG;MAAK;IAChB;EACF;EACA,MAAMK,GAAA,GAAMV,OAAA;EACZ,IAAIU,GAAA,CAAIC,GAAG,CAACC,UAAU,CAAC,eAAerB,sBAAA,CAAuBmB,GAAA,GAAM;IACjE,OAAO;EACT;EACA;EACA;EACA,OAAO;AACT;AAOA,OAAO,MAAMG,UAAA,SAAmBr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AAO,SAASzB,kBAAkB;EAChCC;AAAI,CAGL;EACC,IAAI,CAACA,IAAA,EAAML,EAAA,EAAI;IACbK,IAAA,CAAKL,EAAE,GAAG,IAAId,QAAA,CAASS,OAAO,GAAGyB,WAAW;EAC9C;EACA,OAAOjC,qBAAA,CAAsB,IAAIwB,UAAA,CAAW;IAAEN,IAAA,EAAMA;EAAmB;AACzE;AAEA,OAAO,SAASyB,cAAc3B,IAAoC;EAChE,OAAOA,IAAA,YAAgBQ,UAAA;AACzB","ignoreList":[]}
|
|
@@ -43,7 +43,7 @@ export const UploadPlugin = t0 => {
|
|
|
43
43
|
focus
|
|
44
44
|
} = selection;
|
|
45
45
|
const focusNode = focus.getNode();
|
|
46
|
-
if ($isParagraphNode(focusNode) && focusNode.getTextContentSize() === 0 && focusNode.
|
|
46
|
+
if ($isParagraphNode(focusNode) && focusNode.getTextContentSize() === 0 && focusNode.getParentOrThrow().getChildren().filter(node => $isParagraphNode(node)).length > 1) {
|
|
47
47
|
focusNode.remove();
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$insertNodeToNearestRoot","mergeRegister","useConfig","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","React","useEffect","UploadDrawer","$createUploadNode","UploadNode","INSERT_UPLOAD_COMMAND","UploadPlugin","t0","$","editor","config","t1","collections","t2","t3","hasNodes","Error","registerCommand","payload","update","selection","uploadNode","data","id","fields","relationTo","value","focus","focusNode","getNode","getTextContentSize","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$insertNodeToNearestRoot","mergeRegister","useConfig","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","React","useEffect","UploadDrawer","$createUploadNode","UploadNode","INSERT_UPLOAD_COMMAND","UploadPlugin","t0","$","editor","config","t1","collections","t2","t3","hasNodes","Error","registerCommand","payload","update","selection","uploadNode","data","id","fields","relationTo","value","focus","focusNode","getNode","getTextContentSize","getParentOrThrow","getChildren","filter","node","length","remove","t4","_jsx","enabledCollectionSlugs","map","_temp","slug"],"sources":["../../../../../src/features/upload/client/plugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot, mergeRegister } from '@lexical/utils'\nimport { useConfig } from '@payloadcms/ui'\nimport {\n $getPreviousSelection,\n $getSelection,\n $isParagraphNode,\n $isRangeSelection,\n COMMAND_PRIORITY_EDITOR,\n createCommand,\n} from 'lexical'\nimport React, { useEffect } from 'react'\n\nimport type { PluginComponentWithAnchor } from '../../../typesClient.js'\nimport type { UploadData } from '../../server/nodes/UploadNode.js'\nimport type { UploadFeaturePropsClient } from '../feature.client.js'\n\nimport { UploadDrawer } from '../drawer/index.js'\nimport { $createUploadNode, UploadNode } from '../nodes/UploadNode.js'\n\nexport type InsertUploadPayload = Readonly<Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>>\n\nexport const INSERT_UPLOAD_COMMAND: LexicalCommand<InsertUploadPayload> =\n createCommand('INSERT_UPLOAD_COMMAND')\n\nexport const UploadPlugin: PluginComponentWithAnchor<UploadFeaturePropsClient> = ({\n clientProps,\n}) => {\n const [editor] = useLexicalComposerContext()\n const {\n config: { collections },\n } = useConfig()\n\n useEffect(() => {\n if (!editor.hasNodes([UploadNode])) {\n throw new Error('UploadPlugin: UploadNode not registered on editor')\n }\n\n return mergeRegister(\n editor.registerCommand<InsertUploadPayload>(\n INSERT_UPLOAD_COMMAND,\n (payload: InsertUploadPayload) => {\n editor.update(() => {\n const selection = $getSelection() || $getPreviousSelection()\n\n if ($isRangeSelection(selection)) {\n const uploadNode = $createUploadNode({\n data: {\n id: payload.id,\n fields: payload.fields,\n relationTo: payload.relationTo,\n value: payload.value,\n },\n })\n // Insert upload node BEFORE potentially removing focusNode, as $insertNodeToNearestRoot errors if the focusNode doesn't exist\n $insertNodeToNearestRoot(uploadNode)\n\n const { focus } = selection\n const focusNode = focus.getNode()\n\n // First, delete currently selected node if it's an empty paragraph and if there are sufficient\n // paragraph nodes (more than 1) left in the parent node, so that we don't \"trap\" the user\n if (\n $isParagraphNode(focusNode) &&\n focusNode.getTextContentSize() === 0 &&\n focusNode\n .getParentOrThrow()\n .getChildren()\n .filter((node) => $isParagraphNode(node)).length > 1\n ) {\n focusNode.remove()\n }\n }\n })\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n ),\n )\n }, [editor])\n\n return <UploadDrawer enabledCollectionSlugs={collections.map(({ slug }) => slug)} />\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,wBAAwB,EAAEC,aAAa,QAAQ;AACxD,SAASC,SAAS,QAAQ;AAC1B,SACEC,qBAAqB,EACrBC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,EACjBC,uBAAuB,EACvBC,aAAa,QACR;AACP,OAAOC,KAAA,IAASC,SAAS,QAAQ;AAMjC,SAASC,YAAY,QAAQ;AAC7B,SAASC,iBAAiB,EAAEC,UAAU,QAAQ;AAI9C,OAAO,MAAMC,qBAAA,GACXN,aAAA,CAAc;AAEhB,OAAO,MAAMO,YAAA,GAAoEC,EAAA;EAAA,MAAAC,CAAA,GAAAnB,EAAA;EAG/E,OAAAoB,MAAA,IAAiBnB,yBAAA;EACjB;IAAAoB,MAAA,EAAAC;EAAA,IAEIlB,SAAA;EADM;IAAAmB;EAAA,IAAAD,EAAe;EAAA,IAAAE,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAN,CAAA,QAAAC,MAAA;IAGfI,EAAA,GAAAA,CAAA;MAAA,KACHJ,MAAA,CAAAM,QAAA,EAAAX,UAAA,CAA4B;QAAA,UAAAY,KAAA,CACf;MAAA;MA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;AA1DiF,SAAAI,MAAAlC,EAAA;EAyDjB;IAAAmC;EAAA,IAAAnC,EAAQ;EAAA,OAAKmC,IAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,KAAK,
|
|
1
|
+
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,KAAK,EAMN,MAAM,SAAS,CAAA;AAIhB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAU3E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,CAAC,EAAE;QACZ,CAAC,UAAU,EAAE,cAAc,GAAG;YAC5B,MAAM,EAAE,KAAK,EAAE,CAAA;SAChB,CAAA;KACF,CAAA;IACD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AASD,eAAO,MAAM,aAAa,gIAgPxB,CAAA"}
|