@payloadcms/richtext-lexical 3.0.0-beta.78 → 3.0.0-beta.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cell/index.d.ts +2 -2
- package/dist/cell/index.d.ts.map +1 -1
- package/dist/cell/index.js +5 -5
- package/dist/cell/index.js.map +1 -1
- package/dist/exports/client/Field-BYB3WX7J.js +2 -0
- package/dist/exports/client/Field-BYB3WX7J.js.map +7 -0
- package/dist/exports/client/RelationshipComponent-GYUTPDNG.js +2 -0
- package/dist/exports/client/RelationshipComponent-GYUTPDNG.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-4EX7W4UX.js +2 -0
- package/dist/exports/client/chunk-4EX7W4UX.js.map +7 -0
- package/dist/exports/client/chunk-E4HH5PS6.js +2 -0
- package/dist/exports/client/chunk-E4HH5PS6.js.map +7 -0
- package/dist/exports/client/chunk-LTR7V74A.js +2 -0
- package/dist/exports/client/chunk-LTR7V74A.js.map +7 -0
- package/dist/exports/client/chunk-SQHN3N6E.js +2 -0
- package/dist/exports/client/chunk-SQHN3N6E.js.map +7 -0
- package/dist/exports/client/chunk-VMCQSR3T.js +3 -0
- package/dist/exports/client/chunk-VMCQSR3T.js.map +7 -0
- package/dist/exports/client/component-6C5JERGA.js +2 -0
- package/dist/exports/client/component-6C5JERGA.js.map +7 -0
- package/dist/exports/client/component-GUWIGB77.js +2 -0
- package/dist/exports/client/component-GUWIGB77.js.map +7 -0
- package/dist/exports/client/component-UQ2BKD5X.js +2 -0
- package/dist/exports/client/component-UQ2BKD5X.js.map +7 -0
- package/dist/exports/client/componentInline-C2XIK5VZ.js +2 -0
- package/dist/exports/client/componentInline-C2XIK5VZ.js.map +7 -0
- package/dist/exports/client/index.d.ts +21 -22
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +12 -12
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/server/migrate.d.ts +16 -0
- package/dist/exports/server/migrate.d.ts.map +1 -0
- package/dist/exports/server/migrate.js +17 -0
- package/dist/exports/server/migrate.js.map +1 -0
- package/dist/features/align/client/index.d.ts +5 -0
- package/dist/features/align/client/index.d.ts.map +1 -0
- package/dist/features/align/client/index.js +146 -0
- package/dist/features/align/client/index.js.map +1 -0
- package/dist/features/align/client/toolbarAlignGroup.d.ts +3 -0
- package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -0
- package/dist/features/align/client/toolbarAlignGroup.js +12 -0
- package/dist/features/align/client/toolbarAlignGroup.js.map +1 -0
- package/dist/features/align/server/i18n.d.ts.map +1 -0
- package/dist/features/align/server/i18n.js.map +1 -0
- package/dist/features/align/server/index.d.ts +2 -0
- package/dist/features/align/server/index.d.ts.map +1 -0
- package/dist/features/align/server/index.js +11 -0
- package/dist/features/align/server/index.js.map +1 -0
- package/dist/features/blockquote/client/index.d.ts +5 -0
- package/dist/features/blockquote/client/index.d.ts.map +1 -0
- package/dist/features/blockquote/client/index.js +77 -0
- package/dist/features/blockquote/client/index.js.map +1 -0
- package/dist/features/blockquote/server/i18n.d.ts.map +1 -0
- package/dist/features/blockquote/server/i18n.js.map +1 -0
- package/dist/features/blockquote/server/index.d.ts +7 -0
- package/dist/features/blockquote/server/index.d.ts.map +1 -0
- package/dist/features/blockquote/server/index.js +46 -0
- package/dist/features/blockquote/server/index.js.map +1 -0
- package/dist/features/blocks/client/component/BlockContent.d.ts +22 -0
- package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -0
- package/dist/features/blocks/client/component/BlockContent.js +198 -0
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -0
- package/dist/features/blocks/client/component/FormSavePlugin.d.ts.map +1 -0
- package/dist/features/blocks/client/component/FormSavePlugin.js.map +1 -0
- package/dist/features/blocks/client/component/index.d.ts +11 -0
- package/dist/features/blocks/client/component/index.d.ts.map +1 -0
- package/dist/features/blocks/client/component/index.js +157 -0
- package/dist/features/blocks/client/component/index.js.map +1 -0
- package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +1 -0
- package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +1 -0
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/index.js +138 -0
- package/dist/features/blocks/client/componentInline/index.js.map +1 -0
- package/dist/features/blocks/client/index.d.ts +9 -0
- package/dist/features/blocks/client/index.d.ts.map +1 -0
- package/dist/features/blocks/client/index.js +152 -0
- package/dist/features/blocks/client/index.js.map +1 -0
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts +14 -0
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -0
- package/dist/features/blocks/client/nodes/BlocksNode.js +52 -0
- package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -0
- package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +25 -0
- package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -0
- package/dist/features/blocks/client/nodes/InlineBlocksNode.js +41 -0
- package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -0
- package/dist/features/blocks/client/plugin/commands.d.ts.map +1 -0
- package/dist/features/blocks/client/plugin/commands.js.map +1 -0
- package/dist/features/blocks/client/plugin/index.d.ts +6 -0
- package/dist/features/blocks/client/plugin/index.d.ts.map +1 -0
- package/dist/features/blocks/client/plugin/index.js +129 -0
- package/dist/features/blocks/client/plugin/index.js.map +1 -0
- package/dist/features/blocks/server/graphQLPopulationPromise.d.ts +6 -0
- package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -0
- package/dist/features/blocks/server/graphQLPopulationPromise.js +31 -0
- package/dist/features/blocks/server/graphQLPopulationPromise.js.map +1 -0
- package/dist/features/blocks/server/i18n.d.ts.map +1 -0
- package/dist/features/blocks/server/i18n.js.map +1 -0
- package/dist/features/blocks/server/index.d.ts +8 -0
- package/dist/features/blocks/server/index.d.ts.map +1 -0
- package/dist/features/blocks/server/index.js +162 -0
- package/dist/features/blocks/server/index.js.map +1 -0
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts +38 -0
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -0
- package/dist/features/blocks/server/nodes/BlocksNode.js +84 -0
- package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -0
- package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +40 -0
- package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -0
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js +86 -0
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -0
- package/dist/features/blocks/server/validate.d.ts +6 -0
- package/dist/features/blocks/server/validate.d.ts.map +1 -0
- package/dist/features/blocks/server/validate.js.map +1 -0
- package/dist/features/converters/html/field/index.js.map +1 -1
- package/dist/features/converters/html/index.d.ts +8 -0
- package/dist/features/converters/html/index.d.ts.map +1 -0
- package/dist/features/converters/html/index.js +8 -0
- package/dist/features/converters/html/index.js.map +1 -0
- package/dist/features/createClientComponent.d.ts +3 -3
- package/dist/features/createClientComponent.d.ts.map +1 -1
- package/dist/features/createClientComponent.js.map +1 -1
- package/dist/features/createFeaturePropComponent.js +1 -1
- package/dist/features/createFeaturePropComponent.js.map +1 -1
- package/dist/features/debug/testRecorder/client/index.d.ts +5 -0
- package/dist/features/debug/testRecorder/client/index.d.ts.map +1 -0
- package/dist/features/debug/testRecorder/client/index.js +13 -0
- package/dist/features/debug/testRecorder/client/index.js.map +1 -0
- package/dist/features/debug/testRecorder/client/plugin/index.d.ts +5 -0
- package/dist/features/debug/testRecorder/client/plugin/index.d.ts.map +1 -0
- package/dist/features/debug/testRecorder/client/plugin/index.js +471 -0
- package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -0
- package/dist/features/debug/testRecorder/server/index.d.ts +2 -0
- package/dist/features/debug/testRecorder/server/index.d.ts.map +1 -0
- package/dist/features/debug/testRecorder/server/index.js +9 -0
- package/dist/features/debug/testRecorder/server/index.js.map +1 -0
- package/dist/features/debug/treeView/client/index.d.ts +5 -0
- package/dist/features/debug/treeView/client/index.d.ts.map +1 -0
- package/dist/features/debug/treeView/client/index.js +13 -0
- package/dist/features/debug/treeView/client/index.js.map +1 -0
- package/dist/features/debug/treeView/client/plugin/index.d.ts +4 -0
- package/dist/features/debug/treeView/client/plugin/index.d.ts.map +1 -0
- package/dist/features/debug/treeView/client/plugin/index.js.map +1 -0
- package/dist/features/debug/treeView/server/index.d.ts +2 -0
- package/dist/features/debug/treeView/server/index.d.ts.map +1 -0
- package/dist/features/debug/treeView/server/index.js +9 -0
- package/dist/features/debug/treeView/server/index.js.map +1 -0
- package/dist/features/experimental_table/client/index.d.ts +2 -0
- package/dist/features/experimental_table/client/index.d.ts.map +1 -0
- package/dist/features/experimental_table/client/index.js +71 -0
- package/dist/features/experimental_table/client/index.js.map +1 -0
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts +4 -0
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +605 -0
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts +3 -0
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +327 -0
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts +12 -0
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +181 -0
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts +24 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +103 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -0
- package/dist/features/experimental_table/client/utils/debounce.d.ts.map +1 -0
- package/dist/features/experimental_table/client/utils/debounce.js.map +1 -0
- package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +1 -0
- package/dist/features/experimental_table/client/utils/useDebounce.js.map +1 -0
- package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js +1 -1
- package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/server/index.d.ts +13 -0
- package/dist/features/experimental_table/server/index.d.ts.map +1 -0
- package/dist/features/experimental_table/server/index.js +123 -0
- package/dist/features/experimental_table/server/index.js.map +1 -0
- package/dist/features/format/bold/feature.server.d.ts.map +1 -1
- package/dist/features/format/bold/feature.server.js +1 -3
- package/dist/features/format/bold/feature.server.js.map +1 -1
- package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
- package/dist/features/format/inlineCode/feature.server.js +1 -3
- package/dist/features/format/inlineCode/feature.server.js.map +1 -1
- package/dist/features/format/italic/feature.server.d.ts.map +1 -1
- package/dist/features/format/italic/feature.server.js +1 -3
- package/dist/features/format/italic/feature.server.js.map +1 -1
- package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
- package/dist/features/format/strikethrough/feature.server.js +1 -3
- package/dist/features/format/strikethrough/feature.server.js.map +1 -1
- package/dist/features/format/subscript/feature.server.d.ts.map +1 -1
- package/dist/features/format/subscript/feature.server.js +1 -3
- package/dist/features/format/subscript/feature.server.js.map +1 -1
- package/dist/features/format/superscript/feature.server.d.ts.map +1 -1
- package/dist/features/format/superscript/feature.server.js +1 -3
- package/dist/features/format/superscript/feature.server.js.map +1 -1
- package/dist/features/format/underline/feature.server.d.ts.map +1 -1
- package/dist/features/format/underline/feature.server.js +1 -3
- package/dist/features/format/underline/feature.server.js.map +1 -1
- package/dist/features/heading/client/index.d.ts +6 -0
- package/dist/features/heading/client/index.d.ts.map +1 -0
- package/dist/features/heading/client/index.js +112 -0
- package/dist/features/heading/client/index.js.map +1 -0
- package/dist/features/heading/server/i18n.d.ts.map +1 -0
- package/dist/features/heading/server/i18n.js.map +1 -0
- package/dist/features/heading/server/index.d.ts +10 -0
- package/dist/features/heading/server/index.d.ts.map +1 -0
- package/dist/features/heading/server/index.js +60 -0
- package/dist/features/heading/server/index.js.map +1 -0
- package/dist/features/horizontalRule/client/component/index.d.ts.map +1 -0
- package/dist/features/horizontalRule/client/component/index.js.map +1 -0
- package/dist/features/horizontalRule/client/index.d.ts +5 -0
- package/dist/features/horizontalRule/client/index.d.ts.map +1 -0
- package/dist/features/horizontalRule/client/index.js +71 -0
- package/dist/features/horizontalRule/client/index.js.map +1 -0
- package/dist/features/horizontalRule/client/markdownTransformer.d.ts.map +1 -0
- package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -0
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +20 -0
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -0
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +43 -0
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -0
- package/dist/features/horizontalRule/client/plugin/index.d.ts +7 -0
- package/dist/features/horizontalRule/client/plugin/index.d.ts.map +1 -0
- package/dist/features/horizontalRule/client/plugin/index.js +31 -0
- package/dist/features/horizontalRule/client/plugin/index.js.map +1 -0
- package/dist/features/horizontalRule/server/i18n.d.ts.map +1 -0
- package/dist/features/horizontalRule/server/i18n.js.map +1 -0
- package/dist/features/horizontalRule/server/index.d.ts +2 -0
- package/dist/features/horizontalRule/server/index.d.ts.map +1 -0
- package/dist/features/horizontalRule/server/index.js +32 -0
- package/dist/features/horizontalRule/server/index.js.map +1 -0
- package/dist/features/horizontalRule/server/markdownTransformer.d.ts +3 -0
- package/dist/features/horizontalRule/server/markdownTransformer.d.ts.map +1 -0
- package/dist/features/horizontalRule/server/markdownTransformer.js +23 -0
- package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -0
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +53 -0
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -0
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +83 -0
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -0
- package/dist/features/indent/client/index.d.ts +5 -0
- package/dist/features/indent/client/index.d.ts.map +1 -0
- package/dist/features/indent/client/index.js +56 -0
- package/dist/features/indent/client/index.js.map +1 -0
- package/dist/features/indent/client/toolbarIndentGroup.d.ts +3 -0
- package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -0
- package/dist/features/indent/client/toolbarIndentGroup.js.map +1 -0
- package/dist/features/indent/server/i18n.d.ts.map +1 -0
- package/dist/features/indent/server/i18n.js.map +1 -0
- package/dist/features/indent/server/index.d.ts +2 -0
- package/dist/features/indent/server/index.d.ts.map +1 -0
- package/dist/features/indent/server/index.js +11 -0
- package/dist/features/indent/server/index.js.map +1 -0
- package/dist/features/link/client/index.d.ts +16 -0
- package/dist/features/link/client/index.d.ts.map +1 -0
- package/dist/features/link/client/index.js +101 -0
- package/dist/features/link/client/index.js.map +1 -0
- package/dist/features/link/client/plugins/autoLink/index.d.ts +20 -0
- package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -0
- package/dist/features/link/client/plugins/autoLink/index.js +335 -0
- package/dist/features/link/client/plugins/autoLink/index.js.map +1 -0
- package/dist/features/link/client/plugins/clickableLink/index.d.ts +4 -0
- package/dist/features/link/client/plugins/clickableLink/index.d.ts.map +1 -0
- package/dist/features/link/client/plugins/clickableLink/index.js.map +1 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +299 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts +5 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts.map +1 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts +15 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts.map +1 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/types.js.map +1 -0
- package/dist/features/link/client/plugins/link/index.d.ts +4 -0
- package/dist/features/link/client/plugins/link/index.d.ts.map +1 -0
- package/dist/features/link/client/plugins/link/index.js +51 -0
- package/dist/features/link/client/plugins/link/index.js.map +1 -0
- package/dist/features/link/nodes/LinkNode.d.ts +1 -1
- package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/features/link/server/baseFields.d.ts.map +1 -0
- package/dist/features/link/server/baseFields.js.map +1 -0
- package/dist/features/link/server/graphQLPopulationPromise.d.ts +5 -0
- package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -0
- package/dist/features/link/server/graphQLPopulationPromise.js +31 -0
- package/dist/features/link/server/graphQLPopulationPromise.js.map +1 -0
- package/dist/features/link/server/i18n.d.ts.map +1 -0
- package/dist/features/link/server/i18n.js.map +1 -0
- package/dist/features/link/server/index.d.ts +35 -0
- package/dist/features/link/server/index.d.ts.map +1 -0
- package/dist/features/link/server/index.js +132 -0
- package/dist/features/link/server/index.js.map +1 -0
- package/dist/features/link/server/transformExtraFields.d.ts +9 -0
- package/dist/features/link/server/transformExtraFields.d.ts.map +1 -0
- package/dist/features/link/server/transformExtraFields.js +20 -0
- package/dist/features/link/server/transformExtraFields.js.map +1 -0
- package/dist/features/link/server/validate.d.ts +6 -0
- package/dist/features/link/server/validate.d.ts.map +1 -0
- package/dist/features/link/server/validate.js.map +1 -0
- package/dist/features/lists/checklist/client/index.d.ts +5 -0
- package/dist/features/lists/checklist/client/index.d.ts.map +1 -0
- package/dist/features/lists/checklist/client/index.js +100 -0
- package/dist/features/lists/checklist/client/index.js.map +1 -0
- package/dist/features/lists/checklist/client/plugin/index.d.ts +3 -0
- package/dist/features/lists/checklist/client/plugin/index.d.ts.map +1 -0
- package/dist/features/lists/checklist/client/plugin/index.js.map +1 -0
- package/dist/features/lists/checklist/server/i18n.d.ts.map +1 -0
- package/dist/features/lists/checklist/server/i18n.js.map +1 -0
- package/dist/features/lists/checklist/server/index.d.ts +2 -0
- package/dist/features/lists/checklist/server/index.d.ts.map +1 -0
- package/dist/features/lists/checklist/server/index.js +34 -0
- package/dist/features/lists/checklist/server/index.js.map +1 -0
- package/dist/features/lists/orderedList/client/index.d.ts +5 -0
- package/dist/features/lists/orderedList/client/index.d.ts.map +1 -0
- package/dist/features/lists/orderedList/client/index.js +90 -0
- package/dist/features/lists/orderedList/client/index.js.map +1 -0
- package/dist/features/lists/orderedList/server/i18n.d.ts.map +1 -0
- package/dist/features/lists/orderedList/server/i18n.js.map +1 -0
- package/dist/features/lists/orderedList/server/index.d.ts +2 -0
- package/dist/features/lists/orderedList/server/index.d.ts.map +1 -0
- package/dist/features/lists/orderedList/server/index.js +34 -0
- package/dist/features/lists/orderedList/server/index.js.map +1 -0
- package/dist/features/lists/unorderedList/client/index.d.ts +5 -0
- package/dist/features/lists/unorderedList/client/index.d.ts.map +1 -0
- package/dist/features/lists/unorderedList/client/index.js +88 -0
- package/dist/features/lists/unorderedList/client/index.js.map +1 -0
- package/dist/features/lists/unorderedList/server/i18n.d.ts.map +1 -0
- package/dist/features/lists/unorderedList/server/i18n.js.map +1 -0
- package/dist/features/lists/unorderedList/server/index.d.ts +2 -0
- package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -0
- package/dist/features/lists/unorderedList/server/index.js +32 -0
- package/dist/features/lists/unorderedList/server/index.js.map +1 -0
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js +4 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.d.ts +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js +4 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js +4 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js +4 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js +4 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.d.ts +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js +4 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.d.ts +2 -2
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js +7 -7
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts +5 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +15 -9
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts +1 -9
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.js +1 -16
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts +4 -3
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.js +16 -11
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.d.ts +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.d.ts +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.d.ts +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.d.ts +2 -2
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.js +10 -10
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/types.d.ts +0 -9
- package/dist/features/migrations/slateToLexical/converter/types.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/types.js.map +1 -1
- package/dist/features/migrations/slateToLexical/feature.client.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/feature.client.js +0 -15
- package/dist/features/migrations/slateToLexical/feature.client.js.map +1 -1
- package/dist/features/migrations/slateToLexical/feature.server.d.ts +5 -5
- package/dist/features/migrations/slateToLexical/feature.server.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/feature.server.js +15 -11
- package/dist/features/migrations/slateToLexical/feature.server.js.map +1 -1
- package/dist/features/paragraph/client/index.d.ts +5 -0
- package/dist/features/paragraph/client/index.d.ts.map +1 -0
- package/dist/features/paragraph/client/index.js +71 -0
- package/dist/features/paragraph/client/index.js.map +1 -0
- package/dist/features/paragraph/server/i18n.d.ts.map +1 -0
- package/dist/features/paragraph/server/i18n.js.map +1 -0
- package/dist/features/paragraph/server/index.d.ts +2 -0
- package/dist/features/paragraph/server/index.d.ts.map +1 -0
- package/dist/features/paragraph/server/index.js +12 -0
- package/dist/features/paragraph/server/index.js.map +1 -0
- package/dist/features/relationship/client/components/RelationshipComponent.d.ts +13 -0
- package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -0
- package/dist/features/relationship/client/components/RelationshipComponent.js +171 -0
- package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -0
- package/dist/features/relationship/client/drawer/commands.d.ts.map +1 -0
- package/dist/features/relationship/client/drawer/commands.js.map +1 -0
- package/dist/features/relationship/client/drawer/index.d.ts.map +1 -0
- package/dist/features/relationship/client/drawer/index.js.map +1 -0
- package/dist/features/relationship/client/index.d.ts +18 -0
- package/dist/features/relationship/client/index.d.ts.map +1 -0
- package/dist/features/relationship/client/index.js +72 -0
- package/dist/features/relationship/client/index.js.map +1 -0
- package/dist/features/relationship/client/nodes/RelationshipNode.d.ts +15 -0
- package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -0
- package/dist/features/relationship/client/nodes/RelationshipNode.js +74 -0
- package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -0
- package/dist/features/relationship/client/plugins/index.d.ts +7 -0
- package/dist/features/relationship/client/plugins/index.d.ts.map +1 -0
- package/dist/features/relationship/client/plugins/index.js +50 -0
- package/dist/features/relationship/client/plugins/index.js.map +1 -0
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.d.ts.map +1 -0
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +33 -0
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +1 -0
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +5 -0
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -0
- package/dist/features/relationship/server/graphQLPopulationPromise.js +29 -0
- package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -0
- package/dist/features/relationship/server/i18n.d.ts.map +1 -0
- package/dist/features/relationship/server/i18n.js.map +1 -0
- package/dist/features/relationship/server/index.d.ts +27 -0
- package/dist/features/relationship/server/index.d.ts.map +1 -0
- package/dist/features/relationship/server/index.js +53 -0
- package/dist/features/relationship/server/index.js.map +1 -0
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +35 -0
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -0
- package/dist/features/relationship/server/nodes/RelationshipNode.js +101 -0
- package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts +5 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +209 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -0
- package/dist/features/toolbars/fixed/client/index.d.ts +6 -0
- package/dist/features/toolbars/fixed/client/index.d.ts.map +1 -0
- package/dist/features/toolbars/fixed/client/index.js +13 -0
- package/dist/features/toolbars/fixed/client/index.js.map +1 -0
- package/dist/features/toolbars/fixed/server/index.d.ts +18 -0
- package/dist/features/toolbars/fixed/server/index.d.ts.map +1 -0
- package/dist/features/toolbars/fixed/server/index.js +17 -0
- package/dist/features/toolbars/fixed/server/index.js.map +1 -0
- package/dist/features/toolbars/inline/client/Toolbar/index.d.ts +4 -0
- package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -0
- package/dist/features/toolbars/inline/client/Toolbar/index.js +319 -0
- package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -0
- package/dist/features/toolbars/inline/client/index.d.ts +5 -0
- package/dist/features/toolbars/inline/client/index.d.ts.map +1 -0
- package/dist/features/toolbars/inline/client/index.js +13 -0
- package/dist/features/toolbars/inline/client/index.js.map +1 -0
- package/dist/features/toolbars/inline/server/index.d.ts +2 -0
- package/dist/features/toolbars/inline/server/index.d.ts.map +1 -0
- package/dist/features/toolbars/inline/server/index.js +9 -0
- package/dist/features/toolbars/inline/server/index.js.map +1 -0
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +3 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/features/toolbars/types.d.ts +2 -1
- package/dist/features/toolbars/types.d.ts.map +1 -1
- package/dist/features/toolbars/types.js.map +1 -1
- package/dist/features/typesServer.d.ts +17 -13
- 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 +9 -0
- package/dist/features/upload/client/component/index.d.ts.map +1 -0
- package/dist/features/upload/client/component/index.js +248 -0
- package/dist/features/upload/client/component/index.js.map +1 -0
- package/dist/features/upload/client/drawer/commands.d.ts.map +1 -0
- package/dist/features/upload/client/drawer/commands.js.map +1 -0
- package/dist/features/upload/client/drawer/index.d.ts.map +1 -0
- package/dist/features/upload/client/drawer/index.js +77 -0
- package/dist/features/upload/client/drawer/index.js.map +1 -0
- package/dist/features/upload/client/feature.client.d.ts.map +1 -0
- package/dist/features/upload/client/feature.client.js +74 -0
- package/dist/features/upload/client/feature.client.js.map +1 -0
- package/dist/features/upload/client/nodes/UploadNode.d.ts +22 -0
- package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -0
- package/dist/features/upload/client/nodes/UploadNode.js +91 -0
- package/dist/features/upload/client/nodes/UploadNode.js.map +1 -0
- package/dist/features/upload/client/plugin/index.d.ts +8 -0
- package/dist/features/upload/client/plugin/index.d.ts.map +1 -0
- package/dist/features/upload/client/plugin/index.js +53 -0
- package/dist/features/upload/client/plugin/index.js.map +1 -0
- package/dist/features/upload/server/feature.server.d.ts +18 -0
- package/dist/features/upload/server/feature.server.d.ts.map +1 -0
- package/dist/features/upload/server/feature.server.js +189 -0
- package/dist/features/upload/server/feature.server.js.map +1 -0
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts +5 -0
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -0
- package/dist/features/upload/server/graphQLPopulationPromise.js +52 -0
- package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -0
- package/dist/features/upload/server/i18n.d.ts.map +1 -0
- package/dist/features/upload/server/i18n.js.map +1 -0
- package/dist/features/upload/server/nodes/UploadNode.d.ts +40 -0
- package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -0
- package/dist/features/upload/server/nodes/UploadNode.js +128 -0
- package/dist/features/upload/server/nodes/UploadNode.js.map +1 -0
- package/dist/features/upload/server/validate.d.ts +5 -0
- package/dist/features/upload/server/validate.d.ts.map +1 -0
- package/dist/features/upload/server/validate.js.map +1 -0
- package/dist/field/Field.d.ts +7 -7
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +8 -6
- package/dist/field/Field.js.map +1 -1
- package/dist/field/index.d.ts +2 -9
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js +8 -8
- package/dist/field/index.js.map +1 -1
- package/dist/index.d.ts +23 -38
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +83 -68
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalProvider.d.ts +2 -6
- package/dist/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/lexical/LexicalProvider.js +2 -2
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.d.ts +4 -12
- package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.js +3 -3
- package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
- package/dist/lexical/config/server/default.js +13 -13
- package/dist/lexical/config/server/default.js.map +1 -1
- package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/server/sanitize.js +24 -6
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +6 -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 +14 -4
- package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/lexical/theme/EditorTheme.d.ts +0 -1
- package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
- package/dist/lexical/theme/EditorTheme.js.map +1 -1
- package/dist/nodeTypes.d.ts +8 -8
- package/dist/nodeTypes.d.ts.map +1 -1
- package/dist/nodeTypes.js.map +1 -1
- package/dist/types.d.ts +6 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.d.ts +10 -8
- package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.js +3 -1
- 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 +6 -6
- package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
- package/dist/utilities/generateComponentMap.d.ts +2 -2
- package/dist/utilities/generateComponentMap.d.ts.map +1 -1
- package/dist/utilities/generateComponentMap.js +38 -28
- package/dist/utilities/generateComponentMap.js.map +1 -1
- package/dist/utilities/generateImportMap.d.ts +6 -0
- package/dist/utilities/generateImportMap.d.ts.map +1 -0
- package/dist/utilities/generateImportMap.js +50 -0
- package/dist/utilities/generateImportMap.js.map +1 -0
- package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
- package/dist/utilities/generateSchemaMap.js +2 -1
- package/dist/utilities/generateSchemaMap.js.map +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +1 -5
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/useLexicalFeature.js +1 -1
- package/dist/utilities/useLexicalFeature.js.map +1 -1
- package/package.json +21 -11
- package/dist/exports/client/Field-5GGTGCKC.js +0 -2
- package/dist/exports/client/Field-5GGTGCKC.js.map +0 -7
- package/dist/exports/client/RelationshipComponent-ZR2OCBGL.js +0 -2
- package/dist/exports/client/RelationshipComponent-ZR2OCBGL.js.map +0 -7
- package/dist/exports/client/chunk-6QXGZYUK.js +0 -2
- package/dist/exports/client/chunk-6QXGZYUK.js.map +0 -7
- package/dist/exports/client/chunk-IPCJ5EVK.js +0 -2
- package/dist/exports/client/chunk-IPCJ5EVK.js.map +0 -7
- package/dist/exports/client/chunk-IWZVO3AI.js +0 -2
- package/dist/exports/client/chunk-IWZVO3AI.js.map +0 -7
- package/dist/exports/client/chunk-Q5DYR7MH.js +0 -3
- package/dist/exports/client/chunk-Q5DYR7MH.js.map +0 -7
- package/dist/exports/client/chunk-VUVXZJJR.js +0 -2
- package/dist/exports/client/chunk-VUVXZJJR.js.map +0 -7
- package/dist/exports/client/component-D4GWDXK5.js +0 -2
- package/dist/exports/client/component-D4GWDXK5.js.map +0 -7
- package/dist/exports/client/component-KA7FDRMA.js +0 -2
- package/dist/exports/client/component-KA7FDRMA.js.map +0 -7
- package/dist/exports/client/component-VM36FRT2.js +0 -2
- package/dist/exports/client/component-VM36FRT2.js.map +0 -7
- package/dist/exports/client/componentInline-6EKPZSCV.js +0 -2
- package/dist/exports/client/componentInline-6EKPZSCV.js.map +0 -7
- package/dist/features/align/feature.client.d.ts +0 -5
- package/dist/features/align/feature.client.d.ts.map +0 -1
- package/dist/features/align/feature.client.js +0 -146
- package/dist/features/align/feature.client.js.map +0 -1
- package/dist/features/align/feature.server.d.ts +0 -2
- package/dist/features/align/feature.server.d.ts.map +0 -1
- package/dist/features/align/feature.server.js +0 -13
- package/dist/features/align/feature.server.js.map +0 -1
- package/dist/features/align/i18n.d.ts.map +0 -1
- package/dist/features/align/i18n.js.map +0 -1
- package/dist/features/align/toolbarAlignGroup.d.ts +0 -3
- package/dist/features/align/toolbarAlignGroup.d.ts.map +0 -1
- package/dist/features/align/toolbarAlignGroup.js +0 -12
- package/dist/features/align/toolbarAlignGroup.js.map +0 -1
- package/dist/features/blockquote/feature.client.d.ts +0 -5
- package/dist/features/blockquote/feature.client.d.ts.map +0 -1
- package/dist/features/blockquote/feature.client.js +0 -77
- package/dist/features/blockquote/feature.client.js.map +0 -1
- package/dist/features/blockquote/feature.server.d.ts +0 -7
- package/dist/features/blockquote/feature.server.d.ts.map +0 -1
- package/dist/features/blockquote/feature.server.js +0 -48
- package/dist/features/blockquote/feature.server.js.map +0 -1
- package/dist/features/blockquote/i18n.d.ts.map +0 -1
- package/dist/features/blockquote/i18n.js.map +0 -1
- package/dist/features/blocks/component/BlockContent.d.ts +0 -27
- package/dist/features/blocks/component/BlockContent.d.ts.map +0 -1
- package/dist/features/blocks/component/BlockContent.js +0 -196
- package/dist/features/blocks/component/BlockContent.js.map +0 -1
- package/dist/features/blocks/component/FormSavePlugin.d.ts.map +0 -1
- package/dist/features/blocks/component/FormSavePlugin.js.map +0 -1
- package/dist/features/blocks/component/index.d.ts +0 -11
- package/dist/features/blocks/component/index.d.ts.map +0 -1
- package/dist/features/blocks/component/index.js +0 -162
- package/dist/features/blocks/component/index.js.map +0 -1
- package/dist/features/blocks/component/removeEmptyArrayValues.d.ts.map +0 -1
- package/dist/features/blocks/component/removeEmptyArrayValues.js.map +0 -1
- package/dist/features/blocks/componentInline/index.d.ts.map +0 -1
- package/dist/features/blocks/componentInline/index.js +0 -133
- package/dist/features/blocks/componentInline/index.js.map +0 -1
- package/dist/features/blocks/feature.client.d.ts +0 -13
- package/dist/features/blocks/feature.client.d.ts.map +0 -1
- package/dist/features/blocks/feature.client.js +0 -148
- package/dist/features/blocks/feature.client.js.map +0 -1
- package/dist/features/blocks/feature.server.d.ts +0 -8
- package/dist/features/blocks/feature.server.d.ts.map +0 -1
- package/dist/features/blocks/feature.server.js +0 -160
- package/dist/features/blocks/feature.server.js.map +0 -1
- package/dist/features/blocks/graphQLPopulationPromise.d.ts +0 -6
- package/dist/features/blocks/graphQLPopulationPromise.d.ts.map +0 -1
- package/dist/features/blocks/graphQLPopulationPromise.js +0 -31
- package/dist/features/blocks/graphQLPopulationPromise.js.map +0 -1
- package/dist/features/blocks/i18n.d.ts.map +0 -1
- package/dist/features/blocks/i18n.js.map +0 -1
- package/dist/features/blocks/nodes/BlocksNode.d.ts +0 -38
- package/dist/features/blocks/nodes/BlocksNode.d.ts.map +0 -1
- package/dist/features/blocks/nodes/BlocksNode.js +0 -92
- package/dist/features/blocks/nodes/BlocksNode.js.map +0 -1
- package/dist/features/blocks/nodes/InlineBlocksNode.d.ts +0 -39
- package/dist/features/blocks/nodes/InlineBlocksNode.d.ts.map +0 -1
- package/dist/features/blocks/nodes/InlineBlocksNode.js +0 -94
- package/dist/features/blocks/nodes/InlineBlocksNode.js.map +0 -1
- package/dist/features/blocks/plugin/commands.d.ts.map +0 -1
- package/dist/features/blocks/plugin/commands.js.map +0 -1
- package/dist/features/blocks/plugin/index.d.ts +0 -6
- package/dist/features/blocks/plugin/index.d.ts.map +0 -1
- package/dist/features/blocks/plugin/index.js +0 -111
- package/dist/features/blocks/plugin/index.js.map +0 -1
- package/dist/features/blocks/validate.d.ts +0 -6
- package/dist/features/blocks/validate.d.ts.map +0 -1
- package/dist/features/blocks/validate.js.map +0 -1
- package/dist/features/converters/html/feature.server.d.ts +0 -8
- package/dist/features/converters/html/feature.server.d.ts.map +0 -1
- package/dist/features/converters/html/feature.server.js +0 -8
- package/dist/features/converters/html/feature.server.js.map +0 -1
- package/dist/features/debug/testRecorder/feature.client.d.ts +0 -5
- package/dist/features/debug/testRecorder/feature.client.d.ts.map +0 -1
- package/dist/features/debug/testRecorder/feature.client.js +0 -13
- package/dist/features/debug/testRecorder/feature.client.js.map +0 -1
- package/dist/features/debug/testRecorder/feature.server.d.ts +0 -2
- package/dist/features/debug/testRecorder/feature.server.d.ts.map +0 -1
- package/dist/features/debug/testRecorder/feature.server.js +0 -11
- package/dist/features/debug/testRecorder/feature.server.js.map +0 -1
- package/dist/features/debug/testRecorder/plugin/index.d.ts +0 -5
- package/dist/features/debug/testRecorder/plugin/index.d.ts.map +0 -1
- package/dist/features/debug/testRecorder/plugin/index.js +0 -471
- package/dist/features/debug/testRecorder/plugin/index.js.map +0 -1
- package/dist/features/debug/treeView/feature.client.d.ts +0 -5
- package/dist/features/debug/treeView/feature.client.d.ts.map +0 -1
- package/dist/features/debug/treeView/feature.client.js +0 -13
- package/dist/features/debug/treeView/feature.client.js.map +0 -1
- package/dist/features/debug/treeView/feature.server.d.ts +0 -2
- package/dist/features/debug/treeView/feature.server.d.ts.map +0 -1
- package/dist/features/debug/treeView/feature.server.js +0 -11
- package/dist/features/debug/treeView/feature.server.js.map +0 -1
- package/dist/features/debug/treeView/plugin/index.d.ts +0 -4
- package/dist/features/debug/treeView/plugin/index.d.ts.map +0 -1
- package/dist/features/debug/treeView/plugin/index.js.map +0 -1
- package/dist/features/experimental_table/feature.client.d.ts +0 -2
- package/dist/features/experimental_table/feature.client.d.ts.map +0 -1
- package/dist/features/experimental_table/feature.client.js +0 -71
- package/dist/features/experimental_table/feature.client.js.map +0 -1
- package/dist/features/experimental_table/feature.server.d.ts +0 -13
- package/dist/features/experimental_table/feature.server.d.ts.map +0 -1
- package/dist/features/experimental_table/feature.server.js +0 -125
- package/dist/features/experimental_table/feature.server.js.map +0 -1
- package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.d.ts +0 -4
- package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.js +0 -604
- package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.js.map +0 -1
- package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.d.ts +0 -3
- package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.js +0 -327
- package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.js.map +0 -1
- package/dist/features/experimental_table/plugins/TablePlugin/index.d.ts +0 -24
- package/dist/features/experimental_table/plugins/TablePlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/plugins/TablePlugin/index.js +0 -98
- package/dist/features/experimental_table/plugins/TablePlugin/index.js.map +0 -1
- package/dist/features/experimental_table/utils/debounce.d.ts.map +0 -1
- package/dist/features/experimental_table/utils/debounce.js.map +0 -1
- package/dist/features/experimental_table/utils/useDebounce.d.ts.map +0 -1
- package/dist/features/experimental_table/utils/useDebounce.js.map +0 -1
- package/dist/features/heading/feature.client.d.ts +0 -6
- package/dist/features/heading/feature.client.d.ts.map +0 -1
- package/dist/features/heading/feature.client.js +0 -112
- package/dist/features/heading/feature.client.js.map +0 -1
- package/dist/features/heading/feature.server.d.ts +0 -10
- package/dist/features/heading/feature.server.d.ts.map +0 -1
- package/dist/features/heading/feature.server.js +0 -62
- package/dist/features/heading/feature.server.js.map +0 -1
- package/dist/features/heading/i18n.d.ts.map +0 -1
- package/dist/features/heading/i18n.js.map +0 -1
- package/dist/features/horizontalRule/component/index.d.ts.map +0 -1
- package/dist/features/horizontalRule/component/index.js.map +0 -1
- package/dist/features/horizontalRule/feature.client.d.ts +0 -5
- package/dist/features/horizontalRule/feature.client.d.ts.map +0 -1
- package/dist/features/horizontalRule/feature.client.js +0 -70
- package/dist/features/horizontalRule/feature.client.js.map +0 -1
- package/dist/features/horizontalRule/feature.server.d.ts +0 -2
- package/dist/features/horizontalRule/feature.server.d.ts.map +0 -1
- package/dist/features/horizontalRule/feature.server.js +0 -34
- package/dist/features/horizontalRule/feature.server.js.map +0 -1
- package/dist/features/horizontalRule/i18n.d.ts.map +0 -1
- package/dist/features/horizontalRule/i18n.js.map +0 -1
- package/dist/features/horizontalRule/markdownTransformer.d.ts.map +0 -1
- package/dist/features/horizontalRule/markdownTransformer.js.map +0 -1
- package/dist/features/horizontalRule/nodes/HorizontalRuleNode.d.ts +0 -56
- package/dist/features/horizontalRule/nodes/HorizontalRuleNode.d.ts.map +0 -1
- package/dist/features/horizontalRule/nodes/HorizontalRuleNode.js +0 -92
- package/dist/features/horizontalRule/nodes/HorizontalRuleNode.js.map +0 -1
- package/dist/features/horizontalRule/plugin/index.d.ts +0 -7
- package/dist/features/horizontalRule/plugin/index.d.ts.map +0 -1
- package/dist/features/horizontalRule/plugin/index.js +0 -30
- package/dist/features/horizontalRule/plugin/index.js.map +0 -1
- package/dist/features/indent/feature.client.d.ts +0 -5
- package/dist/features/indent/feature.client.d.ts.map +0 -1
- package/dist/features/indent/feature.client.js +0 -56
- package/dist/features/indent/feature.client.js.map +0 -1
- package/dist/features/indent/feature.server.d.ts +0 -2
- package/dist/features/indent/feature.server.d.ts.map +0 -1
- package/dist/features/indent/feature.server.js +0 -13
- package/dist/features/indent/feature.server.js.map +0 -1
- package/dist/features/indent/i18n.d.ts.map +0 -1
- package/dist/features/indent/i18n.js.map +0 -1
- package/dist/features/indent/toolbarIndentGroup.d.ts +0 -3
- package/dist/features/indent/toolbarIndentGroup.d.ts.map +0 -1
- package/dist/features/indent/toolbarIndentGroup.js.map +0 -1
- package/dist/features/link/drawer/baseFields.d.ts.map +0 -1
- package/dist/features/link/drawer/baseFields.js.map +0 -1
- package/dist/features/link/feature.client.d.ts +0 -16
- package/dist/features/link/feature.client.d.ts.map +0 -1
- package/dist/features/link/feature.client.js +0 -101
- package/dist/features/link/feature.client.js.map +0 -1
- package/dist/features/link/feature.server.d.ts +0 -35
- package/dist/features/link/feature.server.d.ts.map +0 -1
- package/dist/features/link/feature.server.js +0 -134
- package/dist/features/link/feature.server.js.map +0 -1
- package/dist/features/link/graphQLPopulationPromise.d.ts +0 -5
- package/dist/features/link/graphQLPopulationPromise.d.ts.map +0 -1
- package/dist/features/link/graphQLPopulationPromise.js +0 -31
- package/dist/features/link/graphQLPopulationPromise.js.map +0 -1
- package/dist/features/link/i18n.d.ts.map +0 -1
- package/dist/features/link/i18n.js.map +0 -1
- package/dist/features/link/plugins/autoLink/index.d.ts +0 -20
- package/dist/features/link/plugins/autoLink/index.d.ts.map +0 -1
- package/dist/features/link/plugins/autoLink/index.js +0 -336
- package/dist/features/link/plugins/autoLink/index.js.map +0 -1
- package/dist/features/link/plugins/clickableLink/index.d.ts +0 -4
- package/dist/features/link/plugins/clickableLink/index.d.ts.map +0 -1
- package/dist/features/link/plugins/clickableLink/index.js.map +0 -1
- package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +0 -1
- package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +0 -1
- package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +0 -1
- package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +0 -299
- package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +0 -1
- package/dist/features/link/plugins/floatingLinkEditor/index.d.ts +0 -5
- package/dist/features/link/plugins/floatingLinkEditor/index.d.ts.map +0 -1
- package/dist/features/link/plugins/floatingLinkEditor/index.js.map +0 -1
- package/dist/features/link/plugins/floatingLinkEditor/types.d.ts +0 -15
- package/dist/features/link/plugins/floatingLinkEditor/types.d.ts.map +0 -1
- package/dist/features/link/plugins/floatingLinkEditor/types.js.map +0 -1
- package/dist/features/link/plugins/floatingLinkEditor/utilities.d.ts +0 -9
- package/dist/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +0 -1
- package/dist/features/link/plugins/floatingLinkEditor/utilities.js +0 -20
- package/dist/features/link/plugins/floatingLinkEditor/utilities.js.map +0 -1
- package/dist/features/link/plugins/link/index.d.ts +0 -4
- package/dist/features/link/plugins/link/index.d.ts.map +0 -1
- package/dist/features/link/plugins/link/index.js +0 -53
- package/dist/features/link/plugins/link/index.js.map +0 -1
- package/dist/features/link/validate.d.ts +0 -6
- package/dist/features/link/validate.d.ts.map +0 -1
- package/dist/features/link/validate.js.map +0 -1
- package/dist/features/lists/checklist/feature.client.d.ts +0 -5
- package/dist/features/lists/checklist/feature.client.d.ts.map +0 -1
- package/dist/features/lists/checklist/feature.client.js +0 -100
- package/dist/features/lists/checklist/feature.client.js.map +0 -1
- package/dist/features/lists/checklist/feature.server.d.ts +0 -2
- package/dist/features/lists/checklist/feature.server.d.ts.map +0 -1
- package/dist/features/lists/checklist/feature.server.js +0 -36
- package/dist/features/lists/checklist/feature.server.js.map +0 -1
- package/dist/features/lists/checklist/i18n.d.ts.map +0 -1
- package/dist/features/lists/checklist/i18n.js.map +0 -1
- package/dist/features/lists/checklist/plugin/index.d.ts +0 -3
- package/dist/features/lists/checklist/plugin/index.d.ts.map +0 -1
- package/dist/features/lists/checklist/plugin/index.js.map +0 -1
- package/dist/features/lists/orderedList/feature.client.d.ts +0 -5
- package/dist/features/lists/orderedList/feature.client.d.ts.map +0 -1
- package/dist/features/lists/orderedList/feature.client.js +0 -90
- package/dist/features/lists/orderedList/feature.client.js.map +0 -1
- package/dist/features/lists/orderedList/feature.server.d.ts +0 -2
- package/dist/features/lists/orderedList/feature.server.d.ts.map +0 -1
- package/dist/features/lists/orderedList/feature.server.js +0 -36
- package/dist/features/lists/orderedList/feature.server.js.map +0 -1
- package/dist/features/lists/orderedList/i18n.d.ts.map +0 -1
- package/dist/features/lists/orderedList/i18n.js.map +0 -1
- package/dist/features/lists/unorderedList/feature.client.d.ts +0 -5
- package/dist/features/lists/unorderedList/feature.client.d.ts.map +0 -1
- package/dist/features/lists/unorderedList/feature.client.js +0 -88
- package/dist/features/lists/unorderedList/feature.client.js.map +0 -1
- package/dist/features/lists/unorderedList/feature.server.d.ts +0 -2
- package/dist/features/lists/unorderedList/feature.server.d.ts.map +0 -1
- package/dist/features/lists/unorderedList/feature.server.js +0 -34
- package/dist/features/lists/unorderedList/feature.server.js.map +0 -1
- package/dist/features/lists/unorderedList/i18n.d.ts.map +0 -1
- package/dist/features/lists/unorderedList/i18n.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/client.d.ts +0 -5
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/client.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/client.js +0 -6
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/client.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/index.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/index.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/index.js +0 -8
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/index.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/client.d.ts +0 -5
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/client.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/client.js +0 -6
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/client.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/index.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/index.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/index.js +0 -8
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/index.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/client.d.ts +0 -5
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/client.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/client.js +0 -6
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/client.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/index.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/index.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/index.js +0 -8
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/index.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/client.d.ts +0 -5
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/client.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/client.js +0 -6
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/client.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/index.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/index.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/index.js +0 -8
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/index.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/client.d.ts +0 -5
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/client.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/client.js +0 -6
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/client.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/index.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/index.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/index.js +0 -8
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/index.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/client.d.ts +0 -5
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/client.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/client.js +0 -6
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/client.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/index.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/index.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/index.js +0 -8
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/index.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/client.d.ts +0 -5
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/client.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/client.js +0 -6
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/client.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/index.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/index.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/index.js +0 -8
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts +0 -5
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/client.js +0 -6
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/index.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/index.js +0 -8
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/client.d.ts +0 -5
- package/dist/features/migrations/slateToLexical/converter/converters/heading/client.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/client.js +0 -6
- package/dist/features/migrations/slateToLexical/converter/converters/heading/client.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/index.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/heading/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/index.js +0 -8
- package/dist/features/migrations/slateToLexical/converter/converters/heading/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/client.d.ts +0 -5
- package/dist/features/migrations/slateToLexical/converter/converters/indent/client.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/client.js +0 -6
- package/dist/features/migrations/slateToLexical/converter/converters/indent/client.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/index.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/indent/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/index.js +0 -8
- package/dist/features/migrations/slateToLexical/converter/converters/indent/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/client.d.ts +0 -5
- package/dist/features/migrations/slateToLexical/converter/converters/link/client.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/client.js +0 -6
- package/dist/features/migrations/slateToLexical/converter/converters/link/client.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/index.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/link/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/index.js +0 -8
- package/dist/features/migrations/slateToLexical/converter/converters/link/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/client.d.ts +0 -5
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/client.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/client.js +0 -6
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/client.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/index.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/index.js +0 -8
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/client.d.ts +0 -5
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/client.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/client.js +0 -6
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/client.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/index.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/index.js +0 -8
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/client.d.ts +0 -5
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/client.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/client.js +0 -6
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/client.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/index.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/index.js +0 -8
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/client.d.ts +0 -5
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/client.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/client.js +0 -6
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/client.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/index.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/index.js +0 -8
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/client.d.ts +0 -5
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/client.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/client.js +0 -6
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/client.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/index.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/index.js +0 -8
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/client.d.ts +0 -5
- package/dist/features/migrations/slateToLexical/converter/converters/upload/client.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/client.js +0 -6
- package/dist/features/migrations/slateToLexical/converter/converters/upload/client.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/index.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/upload/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/index.js +0 -8
- package/dist/features/migrations/slateToLexical/converter/converters/upload/index.js.map +0 -1
- package/dist/features/paragraph/feature.client.d.ts +0 -5
- package/dist/features/paragraph/feature.client.d.ts.map +0 -1
- package/dist/features/paragraph/feature.client.js +0 -71
- package/dist/features/paragraph/feature.client.js.map +0 -1
- package/dist/features/paragraph/feature.server.d.ts +0 -2
- package/dist/features/paragraph/feature.server.d.ts.map +0 -1
- package/dist/features/paragraph/feature.server.js +0 -14
- package/dist/features/paragraph/feature.server.js.map +0 -1
- package/dist/features/paragraph/i18n.d.ts.map +0 -1
- package/dist/features/paragraph/i18n.js.map +0 -1
- package/dist/features/relationship/drawer/commands.d.ts.map +0 -1
- package/dist/features/relationship/drawer/commands.js.map +0 -1
- package/dist/features/relationship/drawer/index.d.ts.map +0 -1
- package/dist/features/relationship/drawer/index.js.map +0 -1
- package/dist/features/relationship/feature.client.d.ts +0 -18
- package/dist/features/relationship/feature.client.d.ts.map +0 -1
- package/dist/features/relationship/feature.client.js +0 -72
- package/dist/features/relationship/feature.client.js.map +0 -1
- package/dist/features/relationship/feature.server.d.ts +0 -27
- package/dist/features/relationship/feature.server.d.ts.map +0 -1
- package/dist/features/relationship/feature.server.js +0 -55
- package/dist/features/relationship/feature.server.js.map +0 -1
- package/dist/features/relationship/graphQLPopulationPromise.d.ts +0 -5
- package/dist/features/relationship/graphQLPopulationPromise.d.ts.map +0 -1
- package/dist/features/relationship/graphQLPopulationPromise.js +0 -29
- package/dist/features/relationship/graphQLPopulationPromise.js.map +0 -1
- package/dist/features/relationship/i18n.d.ts.map +0 -1
- package/dist/features/relationship/i18n.js.map +0 -1
- package/dist/features/relationship/nodes/RelationshipNode.d.ts +0 -35
- package/dist/features/relationship/nodes/RelationshipNode.d.ts.map +0 -1
- package/dist/features/relationship/nodes/RelationshipNode.js +0 -111
- package/dist/features/relationship/nodes/RelationshipNode.js.map +0 -1
- package/dist/features/relationship/nodes/components/RelationshipComponent.d.ts +0 -13
- package/dist/features/relationship/nodes/components/RelationshipComponent.d.ts.map +0 -1
- package/dist/features/relationship/nodes/components/RelationshipComponent.js +0 -171
- package/dist/features/relationship/nodes/components/RelationshipComponent.js.map +0 -1
- package/dist/features/relationship/plugins/index.d.ts +0 -7
- package/dist/features/relationship/plugins/index.d.ts.map +0 -1
- package/dist/features/relationship/plugins/index.js +0 -50
- package/dist/features/relationship/plugins/index.js.map +0 -1
- package/dist/features/relationship/utils/EnabledRelationshipsCondition.d.ts.map +0 -1
- package/dist/features/relationship/utils/EnabledRelationshipsCondition.js +0 -33
- package/dist/features/relationship/utils/EnabledRelationshipsCondition.js.map +0 -1
- package/dist/features/toolbars/fixed/Toolbar/index.d.ts +0 -5
- package/dist/features/toolbars/fixed/Toolbar/index.d.ts.map +0 -1
- package/dist/features/toolbars/fixed/Toolbar/index.js +0 -207
- package/dist/features/toolbars/fixed/Toolbar/index.js.map +0 -1
- package/dist/features/toolbars/fixed/feature.client.d.ts +0 -6
- package/dist/features/toolbars/fixed/feature.client.d.ts.map +0 -1
- package/dist/features/toolbars/fixed/feature.client.js +0 -13
- package/dist/features/toolbars/fixed/feature.client.js.map +0 -1
- package/dist/features/toolbars/fixed/feature.server.d.ts +0 -18
- package/dist/features/toolbars/fixed/feature.server.d.ts.map +0 -1
- package/dist/features/toolbars/fixed/feature.server.js +0 -19
- package/dist/features/toolbars/fixed/feature.server.js.map +0 -1
- package/dist/features/toolbars/inline/Toolbar/index.d.ts +0 -4
- package/dist/features/toolbars/inline/Toolbar/index.d.ts.map +0 -1
- package/dist/features/toolbars/inline/Toolbar/index.js +0 -319
- package/dist/features/toolbars/inline/Toolbar/index.js.map +0 -1
- package/dist/features/toolbars/inline/feature.client.d.ts +0 -5
- package/dist/features/toolbars/inline/feature.client.d.ts.map +0 -1
- package/dist/features/toolbars/inline/feature.client.js +0 -13
- package/dist/features/toolbars/inline/feature.client.js.map +0 -1
- package/dist/features/toolbars/inline/feature.server.d.ts +0 -2
- package/dist/features/toolbars/inline/feature.server.d.ts.map +0 -1
- package/dist/features/toolbars/inline/feature.server.js +0 -11
- package/dist/features/toolbars/inline/feature.server.js.map +0 -1
- package/dist/features/upload/component/index.d.ts +0 -9
- package/dist/features/upload/component/index.d.ts.map +0 -1
- package/dist/features/upload/component/index.js +0 -242
- package/dist/features/upload/component/index.js.map +0 -1
- package/dist/features/upload/drawer/commands.d.ts.map +0 -1
- package/dist/features/upload/drawer/commands.js.map +0 -1
- package/dist/features/upload/drawer/index.d.ts.map +0 -1
- package/dist/features/upload/drawer/index.js +0 -77
- package/dist/features/upload/drawer/index.js.map +0 -1
- package/dist/features/upload/feature.client.d.ts.map +0 -1
- package/dist/features/upload/feature.client.js +0 -74
- package/dist/features/upload/feature.client.js.map +0 -1
- package/dist/features/upload/feature.server.d.ts +0 -18
- package/dist/features/upload/feature.server.d.ts.map +0 -1
- package/dist/features/upload/feature.server.js +0 -184
- package/dist/features/upload/feature.server.js.map +0 -1
- package/dist/features/upload/graphQLPopulationPromise.d.ts +0 -5
- package/dist/features/upload/graphQLPopulationPromise.d.ts.map +0 -1
- package/dist/features/upload/graphQLPopulationPromise.js +0 -52
- package/dist/features/upload/graphQLPopulationPromise.js.map +0 -1
- package/dist/features/upload/i18n.d.ts.map +0 -1
- package/dist/features/upload/i18n.js.map +0 -1
- package/dist/features/upload/nodes/UploadNode.d.ts +0 -39
- package/dist/features/upload/nodes/UploadNode.d.ts.map +0 -1
- package/dist/features/upload/nodes/UploadNode.js +0 -131
- package/dist/features/upload/nodes/UploadNode.js.map +0 -1
- package/dist/features/upload/plugin/index.d.ts +0 -8
- package/dist/features/upload/plugin/index.d.ts.map +0 -1
- package/dist/features/upload/plugin/index.js +0 -53
- package/dist/features/upload/plugin/index.js.map +0 -1
- package/dist/features/upload/validate.d.ts +0 -5
- package/dist/features/upload/validate.d.ts.map +0 -1
- package/dist/features/upload/validate.js.map +0 -1
- package/dist/lexical/utils/invariant.d.ts +0 -2
- package/dist/lexical/utils/invariant.d.ts.map +0 -1
- package/dist/lexical/utils/invariant.js +0 -12
- package/dist/lexical/utils/invariant.js.map +0 -1
- /package/dist/features/align/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/align/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/blockquote/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/blockquote/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/blocks/{component → client/component}/FormSavePlugin.d.ts +0 -0
- /package/dist/features/blocks/{component → client/component}/FormSavePlugin.js +0 -0
- /package/dist/features/blocks/{component → client/component}/removeEmptyArrayValues.d.ts +0 -0
- /package/dist/features/blocks/{component → client/component}/removeEmptyArrayValues.js +0 -0
- /package/dist/features/blocks/{componentInline → client/componentInline}/index.d.ts +0 -0
- /package/dist/features/blocks/{plugin → client/plugin}/commands.d.ts +0 -0
- /package/dist/features/blocks/{plugin → client/plugin}/commands.js +0 -0
- /package/dist/features/blocks/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/blocks/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/blocks/{validate.js → server/validate.js} +0 -0
- /package/dist/features/debug/treeView/{plugin → client/plugin}/index.js +0 -0
- /package/dist/features/experimental_table/{utils → client/utils}/debounce.d.ts +0 -0
- /package/dist/features/experimental_table/{utils → client/utils}/debounce.js +0 -0
- /package/dist/features/experimental_table/{utils → client/utils}/useDebounce.d.ts +0 -0
- /package/dist/features/experimental_table/{utils → client/utils}/useDebounce.js +0 -0
- /package/dist/features/heading/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/heading/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/horizontalRule/{component → client/component}/index.d.ts +0 -0
- /package/dist/features/horizontalRule/{component → client/component}/index.js +0 -0
- /package/dist/features/horizontalRule/{markdownTransformer.d.ts → client/markdownTransformer.d.ts} +0 -0
- /package/dist/features/horizontalRule/{markdownTransformer.js → client/markdownTransformer.js} +0 -0
- /package/dist/features/horizontalRule/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/horizontalRule/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/indent/{toolbarIndentGroup.js → client/toolbarIndentGroup.js} +0 -0
- /package/dist/features/indent/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/indent/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/link/{plugins → client/plugins}/clickableLink/index.js +0 -0
- /package/dist/features/link/{plugins → client/plugins}/floatingLinkEditor/LinkEditor/commands.d.ts +0 -0
- /package/dist/features/link/{plugins → client/plugins}/floatingLinkEditor/LinkEditor/commands.js +0 -0
- /package/dist/features/link/{plugins → client/plugins}/floatingLinkEditor/LinkEditor/index.d.ts +0 -0
- /package/dist/features/link/{plugins → client/plugins}/floatingLinkEditor/index.js +0 -0
- /package/dist/features/link/{plugins → client/plugins}/floatingLinkEditor/types.js +0 -0
- /package/dist/features/link/{drawer → server}/baseFields.d.ts +0 -0
- /package/dist/features/link/{drawer → server}/baseFields.js +0 -0
- /package/dist/features/link/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/link/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/link/{validate.js → server/validate.js} +0 -0
- /package/dist/features/lists/checklist/{plugin → client/plugin}/index.js +0 -0
- /package/dist/features/lists/checklist/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/lists/checklist/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/lists/orderedList/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/lists/orderedList/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/lists/unorderedList/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/lists/unorderedList/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/paragraph/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/paragraph/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/relationship/{drawer → client/drawer}/commands.d.ts +0 -0
- /package/dist/features/relationship/{drawer → client/drawer}/commands.js +0 -0
- /package/dist/features/relationship/{drawer → client/drawer}/index.d.ts +0 -0
- /package/dist/features/relationship/{drawer → client/drawer}/index.js +0 -0
- /package/dist/features/relationship/{utils → client/utils}/EnabledRelationshipsCondition.d.ts +0 -0
- /package/dist/features/relationship/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/relationship/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/upload/{drawer → client/drawer}/commands.d.ts +0 -0
- /package/dist/features/upload/{drawer → client/drawer}/commands.js +0 -0
- /package/dist/features/upload/{drawer → client/drawer}/index.d.ts +0 -0
- /package/dist/features/upload/{feature.client.d.ts → client/feature.client.d.ts} +0 -0
- /package/dist/features/upload/{i18n.d.ts → server/i18n.d.ts} +0 -0
- /package/dist/features/upload/{i18n.js → server/i18n.js} +0 -0
- /package/dist/features/upload/{validate.js → server/validate.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createCommand as p}from"lexical";var x=p("INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND");import*as l from"react";import{DecoratorBlockNode as u}from"@lexical/react/LexicalDecoratorBlockNode.js";function c(i){let t=i.getAttribute("data-lexical-relationship-id"),e=i.getAttribute("data-lexical-relationship-relationTo");return t!=null&&e!=null?{node:r({relationTo:e,value:t})}:null}var a=class extends u{__data;constructor({data:t,format:e,key:o}){super(e,o),this.__data=t}static clone(t){return new this({data:t.__data,format:t.__format,key:t.__key})}static getType(){return"relationship"}static importDOM(){return{div:t=>!t.hasAttribute("data-lexical-relationship-relationTo")||!t.hasAttribute("data-lexical-relationship-id")?null:{conversion:c,priority:2}}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id);let e={relationTo:t.relationTo,value:t.value},o=r(e);return o.setFormat(t.format),o}static isInline(){return!1}decorate(t,e){return null}exportDOM(){let t=document.createElement("div");t.setAttribute("data-lexical-relationship-id",String(this.__data?.value)),t.setAttribute("data-lexical-relationship-relationTo",this.__data?.relationTo);let e=document.createTextNode(this.getTextContent());return t.append(e),{element:t}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship",version:2}}getData(){return this.getLatest().__data}getTextContent(){return`${this.__data?.relationTo} relation to ${this.__data?.value}`}setData(t){let e=this.getWritable();e.__data=t}};function r(i){return new a({data:i})}import{jsx as m}from"react/jsx-runtime";var d=l.lazy(()=>import("./RelationshipComponent-GYUTPDNG.js").then(i=>({default:i.RelationshipComponent})));function h(i){let t=i.getAttribute("data-lexical-relationship-id"),e=i.getAttribute("data-lexical-relationship-relationTo");return t!=null&&e!=null?{node:s({relationTo:e,value:t})}:null}var n=class extends a{static clone(t){return super.clone(t)}static getType(){return super.getType()}static importDOM(){return{div:t=>!t.hasAttribute("data-lexical-relationship-relationTo")||!t.hasAttribute("data-lexical-relationship-id")?null:{conversion:h,priority:2}}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id);let e={relationTo:t.relationTo,value:t.value},o=s(e);return o.setFormat(t.format),o}decorate(t,e){return m(d,{className:e.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function s(i){return new n({data:i})}function T(i){return i instanceof n}export{x as a,n as b,s as c,T as d};
|
|
2
|
+
//# sourceMappingURL=chunk-4EX7W4UX.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/relationship/client/drawer/commands.ts", "../../../src/features/relationship/client/nodes/RelationshipNode.tsx", "../../../src/features/relationship/server/nodes/RelationshipNode.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { LexicalCommand } from 'lexical'\n\nimport { createCommand } from 'lexical'\n\nexport const INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND: LexicalCommand<{\n replace: { nodeKey: string } | false\n}> = createCommand('INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND')\n", "import type {\n DOMConversionMap,\n DOMConversionOutput,\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n} from 'lexical'\nimport type { JSX } from 'react'\n\nimport * as React from 'react'\n\nimport type {\n RelationshipData,\n SerializedRelationshipNode,\n} from '../../server/nodes/RelationshipNode.js'\n\nimport { RelationshipServerNode } from '../../server/nodes/RelationshipNode.js'\n\nconst RelationshipComponent = React.lazy(() =>\n import('../components/RelationshipComponent.js').then((module) => ({\n default: module.RelationshipComponent,\n })),\n)\n\nfunction $relationshipElementToNode(domNode: HTMLDivElement): DOMConversionOutput | null {\n const id = domNode.getAttribute('data-lexical-relationship-id')\n const relationTo = domNode.getAttribute('data-lexical-relationship-relationTo')\n\n if (id != null && relationTo != null) {\n const node = $createRelationshipNode({\n relationTo,\n value: id,\n })\n return { node }\n }\n return null\n}\n\nexport class RelationshipNode extends RelationshipServerNode {\n static clone(node: RelationshipServerNode): RelationshipServerNode {\n return super.clone(node)\n }\n\n static getType(): string {\n return super.getType()\n }\n\n static importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {\n div: (domNode: HTMLDivElement) => {\n if (\n !domNode.hasAttribute('data-lexical-relationship-relationTo') ||\n !domNode.hasAttribute('data-lexical-relationship-id')\n ) {\n return null\n }\n return {\n conversion: $relationshipElementToNode,\n priority: 2,\n }\n },\n }\n }\n\n static importJSON(serializedNode: SerializedRelationshipNode): RelationshipNode {\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\n const importedData: RelationshipData = {\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n const node = $createRelationshipNode(importedData)\n node.setFormat(serializedNode.format)\n return node\n }\n\n decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element {\n return (\n <RelationshipComponent\n className={config.theme.relationship ?? 'LexicalEditorTheme__relationship'}\n data={this.__data}\n format={this.__format}\n nodeKey={this.getKey()}\n />\n )\n }\n\n exportJSON(): SerializedRelationshipNode {\n return super.exportJSON()\n }\n}\n\nexport function $createRelationshipNode(data: RelationshipData): RelationshipNode {\n return new RelationshipNode({\n data,\n })\n}\n\nexport function $isRelationshipNode(\n node: LexicalNode | RelationshipNode | null | undefined,\n): node is RelationshipNode {\n return node instanceof RelationshipNode\n}\n", "import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n EditorConfig,\n ElementFormatType,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n Spread,\n} from 'lexical'\nimport type { CollectionSlug } from 'payload'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\n\nexport type RelationshipData = {\n relationTo: CollectionSlug\n value: number | string\n}\n\nexport type SerializedRelationshipNode = {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'relationship'\n} & Spread<RelationshipData, SerializedDecoratorBlockNode>\n\nfunction $relationshipElementToServerNode(domNode: HTMLDivElement): DOMConversionOutput | null {\n const id = domNode.getAttribute('data-lexical-relationship-id')\n const relationTo = domNode.getAttribute('data-lexical-relationship-relationTo')\n\n if (id != null && relationTo != null) {\n const node = $createServerRelationshipNode({\n relationTo,\n value: id,\n })\n return { node }\n }\n return null\n}\n\nexport class RelationshipServerNode extends DecoratorBlockNode {\n __data: RelationshipData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: RelationshipData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static clone(node: RelationshipServerNode): RelationshipServerNode {\n return new this({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static getType(): string {\n return 'relationship'\n }\n\n static importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {\n div: (domNode: HTMLDivElement) => {\n if (\n !domNode.hasAttribute('data-lexical-relationship-relationTo') ||\n !domNode.hasAttribute('data-lexical-relationship-id')\n ) {\n return null\n }\n return {\n conversion: $relationshipElementToServerNode,\n priority: 2,\n }\n },\n }\n }\n\n static importJSON(serializedNode: SerializedRelationshipNode): RelationshipServerNode {\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\n const importedData: RelationshipData = {\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n const node = $createServerRelationshipNode(importedData)\n node.setFormat(serializedNode.format)\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element {\n return null\n }\n\n exportDOM(): DOMExportOutput {\n const element = document.createElement('div')\n element.setAttribute('data-lexical-relationship-id', String(this.__data?.value))\n element.setAttribute('data-lexical-relationship-relationTo', this.__data?.relationTo)\n\n const text = document.createTextNode(this.getTextContent())\n element.append(text)\n return { element }\n }\n\n exportJSON(): SerializedRelationshipNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'relationship',\n version: 2,\n }\n }\n\n getData(): RelationshipData {\n return this.getLatest().__data\n }\n\n getTextContent(): string {\n return `${this.__data?.relationTo} relation to ${this.__data?.value}`\n }\n\n setData(data: RelationshipData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n}\n\nexport function $createServerRelationshipNode(data: RelationshipData): RelationshipServerNode {\n return new RelationshipServerNode({\n data,\n })\n}\n\nexport function $isServerRelationshipNode(\n node: LexicalNode | RelationshipServerNode | null | undefined,\n): node is RelationshipServerNode {\n return node instanceof RelationshipServerNode\n}\n"],
|
|
5
|
+
"mappings": "AAEA,OAAS,iBAAAA,MAAqB,UAEvB,IAAMC,EAERD,EAAc,yCAAyC,ECG5D,UAAYE,MAAW,QCMvB,OAAS,sBAAAC,MAA0B,8CAYnC,SAASC,EAAiCC,EAAqD,CAC7F,IAAMC,EAAKD,EAAQ,aAAa,8BAA8B,EACxDE,EAAaF,EAAQ,aAAa,sCAAsC,EAE9E,OAAIC,GAAM,MAAQC,GAAc,KAKvB,CAAE,KAJIC,EAA8B,CACzC,WAAAD,EACA,MAAOD,CACT,CAAC,CACa,EAET,IACT,CAEO,IAAMG,EAAN,cAAqCN,CAAmB,CAC7D,OAEA,YAAY,CACV,KAAAO,EACA,OAAAC,EACA,IAAAC,CACF,EAIG,CACD,MAAMD,EAAQC,CAAG,EACjB,KAAK,OAASF,CAChB,CAEA,OAAO,MAAMG,EAAsD,CACjE,OAAO,IAAI,KA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iB,CAC1B,KAAAO,CACF,CAAC,CACH,CAEO,SAASC,EACdN,EAC0B,CAC1B,OAAOA,aAAgBF,CACzB",
|
|
6
|
+
"names": ["createCommand", "INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND", "React", "DecoratorBlockNode", "$relationshipElementToServerNode", "domNode", "id", "relationTo", "$createServerRelationshipNode", "RelationshipServerNode", "data", "format", "key", "node", "serializedNode", "importedData", "editor", "config", "element", "text", "writable", "jsx", "RelationshipComponent", "module", "$relationshipElementToNode", "domNode", "id", "relationTo", "$createRelationshipNode", "RelationshipNode", "RelationshipServerNode", "node", "serializedNode", "importedData", "editor", "config", "data", "$isRelationshipNode"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as v}from"./chunk-SQHN3N6E.js";import{Drawer as j}from"@payloadcms/ui";import{Form as L,FormSubmit as A,RenderFields as k,useConfig as P,useDocumentInfo as I,useFieldProps as N,useTranslation as $}from"@payloadcms/ui";import{getFormState as C}from"@payloadcms/ui/shared";import{useCallback as J,useEffect as H,useState as B}from"react";import{v4 as K}from"uuid";import{jsx as x,jsxs as W}from"react/jsx-runtime";var h=({data:e,featureKey:t,fieldMapOverride:o,handleDrawerSubmit:a,schemaFieldsPathOverride:r,schemaPathSuffix:n})=>{let{t:s}=$(),{id:i}=I(),{schemaPath:d}=N(),{config:l}=P(),[g,R]=B(!1),{field:{richTextComponentMap:M}}=v(),E=`lexical_internal_feature.${t}.fields${n?`.${n}`:""}`,p=r??`${d}.lexical_internal_feature.${t}${n?`.${n}`:""}`,u=o??M.get(E);H(()=>{(async()=>{let T=await C({apiRoute:l.routes.api,body:{id:i,data:e??{},operation:"update",schemaPath:p},serverURL:l.serverURL});R(T)})()},[l.routes.api,l.serverURL,p,i,e]);let S=J(async({formState:D})=>await C({apiRoute:l.routes.api,body:{id:i,formState:D,operation:"update",schemaPath:p},serverURL:l.serverURL}),[l.routes.api,l.serverURL,p,i]);return g===!1?null:W(L,{beforeSubmit:[S],disableValidationOnSubmit:!0,fields:Array.isArray(u)?u:[],initialState:g,onChange:[S],onSubmit:a,uuid:K(),children:[x(k,{fields:Array.isArray(u)?u:[],forceRender:!0,path:"",readOnly:!1,schemaPath:p}),x(A,{children:s("fields:saveChanges")})]})};import{jsx as U}from"react/jsx-runtime";var yt=({className:e,data:t,drawerSlug:o,drawerTitle:a,featureKey:r,fieldMapOverride:n,handleDrawerSubmit:s,schemaFieldsPathOverride:i,schemaPathSuffix:d})=>U(j,{className:e,slug:o,title:a??"",children:U(h,{data:t,featureKey:r,fieldMapOverride:n,handleDrawerSubmit:s,schemaFieldsPathOverride:i,schemaPathSuffix:d})});import{useAuth as V,useConfig as X,useEntityVisibility as G}from"@payloadcms/ui";import*as m from"react";var q=(e,t)=>e.filter(({slug:o,admin:{enableRichTextRelationship:a},upload:r})=>t.visibleEntities.collections.includes(o)?t?.uploads?a&&!!r:r?!1:a:!1),vt=e=>{let{children:t,uploads:o=!1,...a}=e,{config:{collections:r}}=X(),{user:n}=V(),{visibleEntities:s}=G(),[i]=m.useState(()=>q(r,{uploads:o,user:n,visibleEntities:s}).map(({slug:d})=>d));return i.length?m.cloneElement(t,{...a,enabledCollectionSlugs:i}):null};import{createCommand as Q}from"lexical";var ht=Q("INSERT_UPLOAD_WITH_DRAWER_COMMAND");import _ from"bson-objectid";import{$applyNodeReplacement as et}from"lexical";import*as w from"react";import{DecoratorBlockNode as Y}from"@lexical/react/LexicalDecoratorBlockNode.js";import O from"bson-objectid";import{$applyNodeReplacement as Z}from"lexical";import{jsx as tt}from"react/jsx-runtime";function y(e){return e.parentElement!=null&&e.parentElement.tagName==="LI"&&e.previousSibling===null&&e.getAttribute("aria-roledescription")==="checkbox"}function z(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let o=e.getAttribute("data-lexical-upload-id"),a=e.getAttribute("data-lexical-upload-relation-to");if(o!=null&&a!=null)return{node:b({data:{fields:{},relationTo:a,value:o}})}}let t=e;return t.src.startsWith("file:///")||y(t),null}var c=class extends Y{__data;constructor({data:t,format:o,key:a}){super(o,a),this.__data=t}static clone(t){return new this({data:t.__data,format:t.__format,key:t.__key})}static getType(){return"upload"}static importDOM(){return{img:t=>({conversion:z,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new O.default().toHexString(),t.version=3);let o={id:t.id,fields:t.fields,relationTo:t.relationTo,value:t.value},a=b({data:o});return a.setFormat(t.format),a}static isInline(){return!1}decorate(){return tt(RawUploadComponent,{data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportDOM(){let t=document.createElement("img");return t.setAttribute("data-lexical-upload-id",String(this.__data?.value)),t.setAttribute("data-lexical-upload-relation-to",this.__data?.relationTo),{element:t}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(t){let o=this.getWritable();o.__data=t}updateDOM(){return!1}};function b({data:e}){return e?.id||(e.id=new O.default().toHexString()),Z(new c({data:e}))}import{jsx as rt}from"react/jsx-runtime";var at=w.lazy(()=>import("./component-GUWIGB77.js").then(e=>({default:e.UploadComponent})));function ot(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let o=e.getAttribute("data-lexical-upload-id"),a=e.getAttribute("data-lexical-upload-relation-to");if(o!=null&&a!=null)return{node:F({data:{fields:{},relationTo:a,value:o}})}}let t=e;return t.src.startsWith("file:///")||y(t),null}var f=class extends c{static clone(t){return super.clone(t)}static getType(){return super.getType()}static importDOM(){return{img:t=>({conversion:ot,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new _.default().toHexString(),t.version=3);let o={id:t.id,fields:t.fields,relationTo:t.relationTo,value:t.value},a=F({data:o});return a.setFormat(t.format),a}decorate(){return rt(at,{data:this.__data,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function F({data:e}){return e?.id||(e.id=new _.default().toHexString()),et(new f({data:e}))}function Tt(e){return e instanceof f}export{yt as a,vt as b,ht as c,f as d,F as e,Tt as f};
|
|
2
|
+
//# sourceMappingURL=chunk-E4HH5PS6.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/utilities/fieldsDrawer/Drawer.tsx", "../../../src/utilities/fieldsDrawer/DrawerContent.tsx", "../../../src/features/relationship/client/utils/EnabledRelationshipsCondition.tsx", "../../../src/features/upload/client/drawer/commands.ts", "../../../src/features/upload/client/nodes/UploadNode.tsx", "../../../src/features/upload/server/nodes/UploadNode.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport type { ClientField, Data, FormState, JsonObject } from 'payload'\n\nimport { Drawer } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { DrawerContent } from './DrawerContent.js'\n\nexport type FieldsDrawerProps = {\n readonly className?: string\n readonly data?: Data\n readonly drawerSlug: string\n readonly drawerTitle?: string\n readonly featureKey: string\n readonly fieldMapOverride?: ClientField[]\n readonly handleDrawerSubmit: (fields: FormState, data: JsonObject) => void\n readonly schemaFieldsPathOverride?: string\n readonly schemaPathSuffix?: string\n}\n\n/**\n * This FieldsDrawer component can be used to easily create a Drawer that contains a form with fields within your feature.\n * The fields are taken directly from the schema map based on your `featureKey` and `schemaPathSuffix`. Thus, this can only\n * be used if you provide your field schema inside the `generateSchemaMap` prop of your feature.server.ts.\n */\nexport const FieldsDrawer: React.FC<FieldsDrawerProps> = ({\n className,\n data,\n drawerSlug,\n drawerTitle,\n featureKey,\n fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPathSuffix,\n}) => {\n // The Drawer only renders its children (and itself) if it's open. Thus, by extracting the main content\n // to DrawerContent, this should be faster\n return (\n <Drawer className={className} slug={drawerSlug} title={drawerTitle ?? ''}>\n <DrawerContent\n data={data}\n featureKey={featureKey}\n fieldMapOverride={fieldMapOverride}\n handleDrawerSubmit={handleDrawerSubmit}\n schemaFieldsPathOverride={schemaFieldsPathOverride}\n schemaPathSuffix={schemaPathSuffix}\n />\n </Drawer>\n )\n}\n", "'use client'\nimport type { FormProps } from '@payloadcms/ui'\nimport type { ClientField, FormState } from 'payload'\n\nimport {\n Form,\n FormSubmit,\n RenderFields,\n useConfig,\n useDocumentInfo,\n useFieldProps,\n useTranslation,\n} from '@payloadcms/ui'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { FieldsDrawerProps } from './Drawer.js'\n\nimport { useEditorConfigContext } from '../../lexical/config/client/EditorConfigProvider.js'\n\nexport const DrawerContent: React.FC<Omit<FieldsDrawerProps, 'drawerSlug' | 'drawerTitle'>> = ({\n data,\n featureKey,\n fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPathSuffix,\n}) => {\n const { t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const { config } = useConfig()\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `lexical_internal_feature.${featureKey}.fields${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n const schemaFieldsPath =\n schemaFieldsPathOverride ??\n `${schemaPath}.lexical_internal_feature.${featureKey}${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n\n const fields: any =\n fieldMapOverride ?? (richTextComponentMap.get(componentMapRenderedFieldsPath) as ClientField[]) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: data ?? {},\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n void awaitInitialState()\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id, data])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n return await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id],\n )\n\n if (initialState === false) {\n return null\n }\n\n return (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n fields={Array.isArray(fields) ? fields : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleDrawerSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fields={Array.isArray(fields) ? fields : []}\n forceRender\n path=\"\" // See Blocks feature path for details as for why this is empty\n readOnly={false}\n schemaPath={schemaFieldsPath}\n />\n\n <FormSubmit>{t('fields:saveChanges')}</FormSubmit>\n </Form>\n )\n}\n", "import type { ClientCollectionConfig, ClientUser, VisibleEntities } from 'payload'\n\nimport { useAuth, useConfig, useEntityVisibility } from '@payloadcms/ui'\nimport * as React from 'react'\n\ntype Options = {\n uploads: boolean\n user: ClientUser\n visibleEntities: VisibleEntities\n}\n\ntype FilteredCollectionsT = (\n collections: ClientCollectionConfig[],\n options?: Options,\n) => ClientCollectionConfig[]\n\nconst filterRichTextCollections: FilteredCollectionsT = (collections, options) => {\n return collections.filter(({ slug, admin: { enableRichTextRelationship }, upload }) => {\n if (!options.visibleEntities.collections.includes(slug)) {\n return false\n }\n\n if (options?.uploads) {\n return enableRichTextRelationship && Boolean(upload) === true\n }\n\n return upload ? false : enableRichTextRelationship\n })\n}\n\nexport const EnabledRelationshipsCondition: React.FC<any> = (props) => {\n const { children, uploads = false, ...rest } = props\n const {\n config: { collections },\n } = useConfig()\n const { user } = useAuth()\n const { visibleEntities } = useEntityVisibility()\n\n const [enabledCollectionSlugs] = React.useState(() =>\n filterRichTextCollections(collections, { uploads, user, visibleEntities }).map(\n ({ slug }) => slug,\n ),\n )\n\n if (!enabledCollectionSlugs.length) {\n return null\n }\n\n return React.cloneElement(children, { ...rest, enabledCollectionSlugs })\n}\n", "'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { createCommand } from 'lexical'\n\nexport const INSERT_UPLOAD_WITH_DRAWER_COMMAND: LexicalCommand<{\n replace: { nodeKey: string } | false\n}> = createCommand('INSERT_UPLOAD_WITH_DRAWER_COMMAND')\n", "import 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 { UploadServerNode, isGoogleDocCheckboxImg } 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", "import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n ElementFormatType,\n LexicalNode,\n NodeKey,\n Spread,\n} from 'lexical'\nimport type { CollectionSlug, JsonObject } from 'payload'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nexport type UploadData = {\n fields: JsonObject\n id: string\n relationTo: CollectionSlug\n value: number | string\n}\n\nexport function isGoogleDocCheckboxImg(img: HTMLImageElement): boolean {\n return (\n img.parentElement != null &&\n img.parentElement.tagName === 'LI' &&\n img.previousSibling === null &&\n img.getAttribute('aria-roledescription') === 'checkbox'\n )\n}\n\nfunction $convertUploadServerElement(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 = $createUploadServerNode({\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 UploadServerNode extends DecoratorBlockNode {\n __data: UploadData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: UploadData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static clone(node: UploadServerNode): UploadServerNode {\n return new this({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static getType(): string {\n return 'upload'\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n img: (node: HTMLImageElement) => ({\n conversion: $convertUploadServerElement,\n priority: 0,\n }),\n }\n }\n\n static importJSON(serializedNode: SerializedUploadNode): UploadServerNode {\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 = $createUploadServerNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n decorate(): JSX.Element {\n // @ts-expect-error\n return <RawUploadComponent data={this.__data} format={this.__format} nodeKey={this.getKey()} />\n }\n\n exportDOM(): DOMExportOutput {\n const element = document.createElement('img')\n element.setAttribute('data-lexical-upload-id', String(this.__data?.value))\n element.setAttribute('data-lexical-upload-relation-to', this.__data?.relationTo)\n\n return { element }\n }\n\n exportJSON(): SerializedUploadNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'upload',\n version: 3,\n }\n }\n\n getData(): UploadData {\n return this.getLatest().__data\n }\n\n setData(data: UploadData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n\n updateDOM(): false {\n return false\n }\n}\n\nexport function $createUploadServerNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadServerNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n return $applyNodeReplacement(new UploadServerNode({ data: data as UploadData }))\n}\n\nexport function $isUploadServerNode(\n node: LexicalNode | null | undefined,\n): node is UploadServerNode {\n return node instanceof UploadServerNode\n}\n"],
|
|
5
|
+
"mappings": "wCAGA,OAAS,UAAAA,MAAc,iBCCvB,OACE,QAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,iBAAAC,EACA,kBAAAC,MACK,iBACP,OAAS,gBAAAC,MAAoB,wBAC7B,OAAgB,eAAAC,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QACxD,OAAS,MAAMC,MAAY,OAwEvB,OASE,OAAAC,EATF,QAAAC,MAAA,oBAlEG,IAAMC,EAAiF,CAAC,CAC7F,KAAAC,EACA,WAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,yBAAAC,EACA,iBAAAC,CACF,IAAM,CACJ,GAAM,CAAE,EAAAC,CAAE,EAAIC,EAAe,EACvB,CAAE,GAAAC,CAAG,EAAIC,EAAgB,EACzB,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAC/B,CAAE,OAAAC,CAAO,EAAIC,EAAU,EACvB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K,OAAO,EAAG,CACxE,CAEA,YAAmC,CACjC,OAAO,MAAM,WAAW,CAC1B,CACF,EAEO,SAASM,EAAkB,CAChC,KAAAS,CACF,EAEe,CACb,OAAKA,GAAM,KACTA,EAAK,GAAK,IAAIF,EAAS,QAAQ,EAAE,YAAY,GAExCG,GAAsB,IAAIP,EAAW,CAAE,KAAMM,CAAmB,CAAC,CAAC,CAC3E,CAEO,SAASE,GAAcN,EAA0D,CACtF,OAAOA,aAAgBF,CACzB",
|
|
6
|
+
"names": ["Drawer", "Form", "FormSubmit", "RenderFields", "useConfig", "useDocumentInfo", "useFieldProps", "useTranslation", "getFormState", "useCallback", "useEffect", "useState", "uuid", "jsx", "jsxs", "DrawerContent", "data", "featureKey", "fieldMapOverride", "handleDrawerSubmit", "schemaFieldsPathOverride", "schemaPathSuffix", "t", "useTranslation", "id", "useDocumentInfo", "schemaPath", "useFieldProps", "config", "useConfig", "initialState", "setInitialState", "useState", "richTextComponentMap", "useEditorConfigContext", "componentMapRenderedFieldsPath", "schemaFieldsPath", "fields", "useEffect", "state", "getFormState", "onChange", "useCallback", "prevFormState", "Form", "uuid", "RenderFields", "FormSubmit", "jsx", "FieldsDrawer", "className", "data", "drawerSlug", "drawerTitle", "featureKey", "fieldMapOverride", "handleDrawerSubmit", "schemaFieldsPathOverride", "schemaPathSuffix", "Drawer", "DrawerContent", "useAuth", "useConfig", "useEntityVisibility", "React", "filterRichTextCollections", "collections", "options", "slug", "enableRichTextRelationship", "upload", "EnabledRelationshipsCondition", "props", "children", "uploads", "rest", "user", "visibleEntities", "enabledCollectionSlugs", "createCommand", "INSERT_UPLOAD_WITH_DRAWER_COMMAND", "ObjectID", "$applyNodeReplacement", "React", "DecoratorBlockNode", "ObjectID", "$applyNodeReplacement", "jsx", "isGoogleDocCheckboxImg", "img", "$convertUploadServerElement", "domNode", "id", "relationTo", "$createUploadServerNode", "UploadServerNode", "data", "format", "key", "node", "serializedNode", "importedData", "element", "writable", "jsx", "RawUploadComponent", "module", "$convertUploadElement", "domNode", "id", "relationTo", "$createUploadNode", "img", "isGoogleDocCheckboxImg", "UploadNode", "UploadServerNode", "node", "serializedNode", "ObjectID", "importedData", "data", "$applyNodeReplacement", "$isUploadNode"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createCommand as r}from"lexical";var B=r("INSERT_BLOCK_COMMAND"),f=r("INSERT_INLINE_BLOCK_COMMAND"),x=r("OPEN_INLINE_BLOCK_DRAWER_COMMAND");import p from"bson-objectid";import N from"react";import d from"bson-objectid";import{DecoratorNode as c}from"lexical";import{deepCopyObjectSimple as s}from"payload/shared";var i=class extends c{__fields;constructor({fields:e,key:t}){super(t),this.__fields=e}static clone(e){return new this({fields:e.__fields,key:e.__key})}static getType(){return"inlineBlock"}static importDOM(){return{}}static importJSON(e){return a(e.fields)}static isInline(){return!1}canIndent(){return!0}createDOM(){let e=document.createElement("span");return e.classList.add("inline-block-container"),e}decorate(e,t){return null}exportDOM(){let e=document.createElement("span");e.classList.add("inline-block-container");let t=document.createTextNode(this.getTextContent());return e.append(t),{element:e}}exportJSON(){return{type:"inlineBlock",fields:this.getFields(),version:1}}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}isInline(){return!0}setFields(e){let t=s(e),l=this.getWritable();l.__fields=t}updateDOM(){return!1}};function a(n){return new i({fields:{...n,id:n?.id||new d.default().toHexString()}})}import{jsx as k}from"react/jsx-runtime";var m=N.lazy(()=>import("./componentInline-C2XIK5VZ.js").then(n=>({default:n.InlineBlockComponent}))),o=class extends i{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return I(e.fields)}decorate(e,t){return k(m,{formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function I(n){return new o({fields:{...n,id:n?.id||new p.default().toHexString()}})}function v(n){return n instanceof o}export{B as a,f as b,x as c,o as d,I as e,v as f};
|
|
2
|
+
//# sourceMappingURL=chunk-LTR7V74A.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/blocks/client/plugin/commands.ts", "../../../src/features/blocks/client/nodes/InlineBlocksNode.tsx", "../../../src/features/blocks/server/nodes/InlineBlocksNode.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { LexicalCommand } from 'lexical'\n\nimport { createCommand } from 'lexical'\n\nimport type { InsertBlockPayload } from './index.js'\n\nexport const INSERT_BLOCK_COMMAND: LexicalCommand<InsertBlockPayload> =\n createCommand('INSERT_BLOCK_COMMAND')\n\nexport const INSERT_INLINE_BLOCK_COMMAND: LexicalCommand<Partial<InsertBlockPayload>> =\n createCommand('INSERT_INLINE_BLOCK_COMMAND')\n\nexport const OPEN_INLINE_BLOCK_DRAWER_COMMAND: LexicalCommand<{\n fields: Partial<InsertBlockPayload>\n nodeKey?: string\n}> = createCommand('OPEN_INLINE_BLOCK_DRAWER_COMMAND')\n", "import type {\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n SerializedLexicalNode,\n Spread,\n} from 'lexical'\n\nimport ObjectID from 'bson-objectid'\nimport React, { type JSX } from 'react'\n\nimport type { SerializedServerInlineBlockNode } from '../../server/nodes/InlineBlocksNode.js'\n\nimport { ServerInlineBlockNode } from '../../server/nodes/InlineBlocksNode.js'\n\nexport type InlineBlockFields = {\n /** Block form data */\n [key: string]: any\n //blockName: string\n blockType: string\n id: string\n}\n\nconst InlineBlockComponent = React.lazy(() =>\n import('../componentInline/index.js').then((module) => ({\n default: module.InlineBlockComponent,\n })),\n)\n\nexport type SerializedInlineBlockNode = Spread<\n {\n children?: never // required so that our typed editor state doesn't automatically add children\n fields: InlineBlockFields\n type: 'inlineBlock'\n },\n SerializedLexicalNode\n>\n\nexport class InlineBlockNode extends ServerInlineBlockNode {\n static clone(node: ServerInlineBlockNode): ServerInlineBlockNode {\n return super.clone(node)\n }\n\n static getType(): string {\n return super.getType()\n }\n\n static importJSON(serializedNode: SerializedInlineBlockNode): InlineBlockNode {\n const node = $createInlineBlockNode(serializedNode.fields)\n return node\n }\n\n decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element {\n return <InlineBlockComponent formData={this.getFields()} nodeKey={this.getKey()} />\n }\n\n exportJSON(): SerializedServerInlineBlockNode {\n return super.exportJSON()\n }\n}\n\nexport function $createInlineBlockNode(fields: Exclude<InlineBlockFields, 'id'>): InlineBlockNode {\n return new InlineBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\n },\n })\n}\n\nexport function $isInlineBlockNode(\n node: InlineBlockNode | LexicalNode | null | undefined,\n): node is InlineBlockNode {\n return node instanceof InlineBlockNode\n}\n", "import type {\n DOMConversionMap,\n DOMExportOutput,\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n SerializedLexicalNode,\n Spread,\n} from 'lexical'\nimport type React from 'react'\nimport type { JSX } from 'react'\n\nimport ObjectID from 'bson-objectid'\nimport { DecoratorNode } from 'lexical'\nimport { deepCopyObjectSimple } from 'payload/shared'\n\nexport type InlineBlockFields = {\n /** Block form data */\n [key: string]: any\n //blockName: string\n blockType: string\n id: string\n}\n\nexport type SerializedServerInlineBlockNode = Spread<\n {\n children?: never // required so that our typed editor state doesn't automatically add children\n fields: InlineBlockFields\n type: 'inlineBlock'\n },\n SerializedLexicalNode\n>\n\nexport class ServerInlineBlockNode extends DecoratorNode<React.ReactElement> {\n __fields: InlineBlockFields\n\n constructor({ fields, key }: { fields: InlineBlockFields; key?: NodeKey }) {\n super(key)\n this.__fields = fields\n }\n\n static clone(node: ServerInlineBlockNode): ServerInlineBlockNode {\n return new this({\n fields: node.__fields,\n key: node.__key,\n })\n }\n\n static getType(): string {\n return 'inlineBlock'\n }\n\n static importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {}\n }\n\n static importJSON(serializedNode: SerializedServerInlineBlockNode): ServerInlineBlockNode {\n const node = $createServerInlineBlockNode(serializedNode.fields)\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n canIndent() {\n return true\n }\n createDOM() {\n const element = document.createElement('span')\n element.classList.add('inline-block-container')\n\n return element\n }\n\n decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element {\n return null\n }\n\n exportDOM(): DOMExportOutput {\n const element = document.createElement('span')\n element.classList.add('inline-block-container')\n\n const text = document.createTextNode(this.getTextContent())\n element.append(text)\n return { element }\n }\n\n exportJSON(): SerializedServerInlineBlockNode {\n return {\n type: 'inlineBlock',\n fields: this.getFields(),\n version: 1,\n }\n }\n\n getFields(): InlineBlockFields {\n return this.getLatest().__fields\n }\n\n getTextContent(): string {\n return `Block Field`\n }\n\n isInline() {\n return true\n }\n\n setFields(fields: InlineBlockFields): void {\n const fieldsCopy = deepCopyObjectSimple(fields)\n\n const writable = this.getWritable()\n writable.__fields = fieldsCopy\n }\n\n updateDOM(): boolean {\n return false\n }\n}\n\nexport function $createServerInlineBlockNode(\n fields: Exclude<InlineBlockFields, 'id'>,\n): ServerInlineBlockNode {\n return new ServerInlineBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\n },\n })\n}\n\nexport function $isServerInlineBlockNode(\n node: LexicalNode | ServerInlineBlockNode | null | undefined,\n): node is ServerInlineBlockNode {\n return node instanceof ServerInlineBlockNode\n}\n"],
|
|
5
|
+
"mappings": "AAEA,OAAS,iBAAAA,MAAqB,UAIvB,IAAMC,EACXD,EAAc,sBAAsB,EAEzBE,EACXF,EAAc,6BAA6B,EAEhCG,EAGRH,EAAc,kCAAkC,ECPrD,OAAOI,MAAc,gBACrB,OAAOC,MAAyB,QCIhC,OAAOC,MAAc,gBACrB,OAAS,iBAAAC,MAAqB,UAC9B,OAAS,wBAAAC,MAA4B,iBAmB9B,IAAMC,EAAN,cAAoCF,CAAkC,CAC3E,SAEA,YAAY,CAAE,OAAAG,EAAQ,IAAAC,CAAI,EAAiD,CACzE,MAAMA,CAAG,EACT,KAAK,SAAWD,CAClB,CAEA,OAAO,MAAME,EAAoD,CAC/D,OA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AAO,oBAClB,EAAE,CACJ,EAWaC,EAAN,cAA8BC,CAAsB,CACzD,OAAO,MAAMC,EAAoD,CAC/D,OAAO,MAAM,MAAMA,CAAI,CACzB,CAEA,OAAO,SAAkB,CACvB,OAAO,MAAM,QAAQ,CACvB,CAEA,OAAO,WAAWC,EAA4D,CAE5E,OADaC,EAAuBD,EAAe,MAAM,CAE3D,CAEA,SAASE,EAAuBC,EAAmC,CACjE,OAAOV,EAACC,EAAA,CAAqB,SAAU,KAAK,UAAU,EAAG,QAAS,KAAK,OAAO,EAAG,CACnF,CAEA,YAA8C,CAC5C,OAAO,MAAM,WAAW,CAC1B,CACF,EAEO,SAASO,EAAuBG,EAA2D,CAChG,OAAO,IAAIP,EAAgB,CACzB,OAAQ,CACN,GAAGO,EACH,GAAIA,GAAQ,IAAM,IAAIC,EAAS,QAAQ,EAAE,YAAY,CACvD,CACF,CAAC,CACH,CAEO,SAASC,EACdP,EACyB,CACzB,OAAOA,aAAgBF,CACzB",
|
|
6
|
+
"names": ["createCommand", "INSERT_BLOCK_COMMAND", "INSERT_INLINE_BLOCK_COMMAND", "OPEN_INLINE_BLOCK_DRAWER_COMMAND", "ObjectID", "React", "ObjectID", "DecoratorNode", "deepCopyObjectSimple", "ServerInlineBlockNode", "fields", "key", "node", "serializedNode", "$createServerInlineBlockNode", "element", "editor", "config", "text", "fieldsCopy", "writable", "jsx", "InlineBlockComponent", "React", "module", "InlineBlockNode", "ServerInlineBlockNode", "node", "serializedNode", "$createInlineBlockNode", "editor", "config", "fields", "ObjectID", "$isInlineBlockNode"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useLexicalComposerContext as y}from"@lexical/react/LexicalComposerContext.js";import{createContext as T,useContext as m,useMemo as h,useRef as a,useState as p}from"react";import{jsx as M}from"react/jsx-runtime";function R(){return Math.random().toString(36).substring(2,12)+Math.random().toString(36).substring(2,12)}var E=T({editorConfig:null,field:null,uuid:null}),L=({children:i,editorConfig:c,editorContainerRef:s,field:u,parentContext:r})=>{let[C]=y(),[f]=p(R()),e=a(new Map),[l,g]=p(null),n=a(new Set),x=h(()=>({blurEditor:t=>{n.current.clear()},childrenEditors:e,editor:C,editorConfig:c,editorContainerRef:s,field:u,focusEditor:t=>{let o=t.uuid;n.current.has(o)||(n.current.add(o),g(t),r?.uuid&&r.focusEditor(t),e.current.forEach((d,v)=>{d.focusEditor(t)}),n.current.clear())},focusedEditor:l,parentEditor:r,registerChild:(t,o)=>{if(!e.current.has(t)){let d=new Map(e.current);d.set(t,o),e.current=d}},unregisterChild:t=>{if(e.current.has(t)){let o=new Map(e.current);o.delete(t),e.current=o}},uuid:f}),[C,e,c,s,u,l,r,f]);return M(E.Provider,{value:x,children:i})},S=()=>{let i=m(E);if(i===void 0)throw new Error("useEditorConfigContext must be used within an EditorConfigProvider");return i};export{L as a,S as b};
|
|
2
|
+
//# sourceMappingURL=chunk-SQHN3N6E.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lexical/config/client/EditorConfigProvider.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport type { LexicalEditor } from 'lexical'\nimport type { RichTextFieldClient } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport * as React from 'react'\nimport { createContext, useContext, useMemo, useRef, useState } from 'react'\n\nimport type { LexicalRichTextFieldProps } from '../../../types.js'\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\n// Should always produce a 20 character pseudo-random string\nfunction generateQuickGuid(): string {\n return Math.random().toString(36).substring(2, 12) + Math.random().toString(36).substring(2, 12)\n}\n\nexport interface EditorConfigContextType {\n // Editor focus handling\n blurEditor: (editorContext: EditorConfigContextType) => void\n childrenEditors: React.RefObject<Map<string, EditorConfigContextType>>\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n field: LexicalRichTextFieldProps['field']\n // Editor focus handling\n focusEditor: (editorContext: EditorConfigContextType) => void\n focusedEditor: EditorConfigContextType | null\n parentEditor: EditorConfigContextType\n registerChild: (uuid: string, editorContext: EditorConfigContextType) => void\n unregisterChild?: (uuid: string) => void\n uuid: string\n}\n\nconst Context: React.Context<EditorConfigContextType> = createContext({\n editorConfig: null,\n field: null,\n uuid: null,\n})\n\nexport const EditorConfigProvider = ({\n children,\n editorConfig,\n editorContainerRef,\n field,\n parentContext,\n}: {\n children: React.ReactNode\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n field: LexicalRichTextFieldProps['field']\n parentContext?: EditorConfigContextType\n}): React.ReactNode => {\n const [editor] = useLexicalComposerContext()\n // State to store the UUID\n const [uuid] = useState(generateQuickGuid())\n\n const childrenEditors = useRef<Map<string, EditorConfigContextType>>(new Map())\n const [focusedEditor, setFocusedEditor] = useState<EditorConfigContextType | null>(null)\n const focusHistory = useRef<Set<string>>(new Set())\n\n const editorContext = useMemo(\n () =>\n ({\n blurEditor: (editorContext: EditorConfigContextType) => {\n //setFocusedEditor(null) // Clear focused editor\n focusHistory.current.clear() // Reset focus history when focus is lost\n },\n childrenEditors,\n editor,\n editorConfig,\n editorContainerRef,\n field,\n focusEditor: (editorContext: EditorConfigContextType) => {\n const editorUUID = editorContext.uuid\n\n // Avoid recursion by checking if this editor is already focused in this cycle\n if (focusHistory.current.has(editorUUID)) {\n return\n }\n\n // Add this editor to the history to prevent future recursions in this cycle\n focusHistory.current.add(editorUUID)\n setFocusedEditor(editorContext)\n\n // Propagate focus event to parent and children, ensuring they do not refocus this editor\n if (parentContext?.uuid) {\n parentContext.focusEditor(editorContext)\n }\n childrenEditors.current.forEach((childEditor, childUUID) => {\n childEditor.focusEditor(editorContext)\n })\n\n focusHistory.current.clear()\n },\n focusedEditor,\n parentEditor: parentContext,\n registerChild: (childUUID, childEditorContext) => {\n if (!childrenEditors.current.has(childUUID)) {\n const newMap = new Map(childrenEditors.current)\n newMap.set(childUUID, childEditorContext)\n childrenEditors.current = newMap\n }\n },\n unregisterChild: (childUUID) => {\n if (childrenEditors.current.has(childUUID)) {\n const newMap = new Map(childrenEditors.current)\n newMap.delete(childUUID)\n childrenEditors.current = newMap\n }\n },\n\n uuid,\n }) as EditorConfigContextType,\n [\n editor,\n childrenEditors,\n editorConfig,\n editorContainerRef,\n field,\n focusedEditor,\n parentContext,\n uuid,\n ],\n )\n\n return <Context.Provider value={editorContext}>{children}</Context.Provider>\n}\n\nexport const useEditorConfigContext = (): EditorConfigContextType => {\n const context = useContext(Context)\n if (context === undefined) {\n throw new Error('useEditorConfigContext must be used within an EditorConfigProvider')\n }\n return context\n}\n"],
|
|
5
|
+
"mappings": "AAKA,OAAS,6BAAAA,MAAiC,2CAE1C,OAAS,iBAAAC,EAAe,cAAAC,EAAY,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QAuH5D,cAAAC,MAAA,oBAjHT,SAASC,GAA4B,CACnC,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAG,EAAE,EAAI,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAG,EAAE,CACjG,CAmBA,IAAMC,EAAkDP,EAAc,CACpE,aAAc,KACd,MAAO,KACP,KAAM,IACR,CAAC,EAEYQ,EAAuB,CAAC,CACnC,SAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,MAAAC,EACA,cAAAC,CACF,IAMuB,CACrB,GAAM,CAACC,CAAM,EAAIf,EAA0B,EAErC,CAACgB,CAAI,EAAIX,EAASE,EAAkB,CAAC,EAErCU,EAAkBb,EAA6C,IAAI,GAAK,EACxE,CAACc,EAAeC,CAAgB,EAAId,EAAyC,IAAI,EACjFe,EAAehB,EAAoB,IAAI,GAAK,EAE5CiB,EAAgBlB,EACpB,KACG,CACC,WAAakB,GAA2C,CAEtDD,EAAa,QAAQ,MAAM,CAC7B,EACA,gBAAAH,EACA,OAAAF,EACA,aAAAJ,EACA,mBAAAC,EACA,MAAAC,EACA,YAAcQ,GAA2C,CACvD,IAAMC,EAAaD,EAAc,KAG7BD,EAAa,QAAQ,IAAIE,CAAU,IAKvCF,EAAa,QAAQ,IAAIE,CAAU,EACnCH,EAAiBE,CAAa,EAG1BP,GAAe,MACjBA,EAAc,YAAYO,CAAa,EAEzCJ,EAAgB,QAAQ,QAAQ,CAACM,EAAaC,IAAc,CAC1DD,EAAY,YAAYF,CAAa,CACvC,CAAC,EAEDD,EAAa,QAAQ,MAAM,EAC7B,EACA,cAAAF,EACA,aAAcJ,EACd,cAAe,CAACU,EAAWC,IAAuB,CAChD,GAAI,CAACR,EAAgB,QAAQ,IAAIO,CAAS,EAAG,CAC3C,IAAME,EAAS,IAAI,IAAIT,EAAgB,OAAO,EAC9CS,EAAO,IAAIF,EAAWC,CAAkB,EACxCR,EAAgB,QAAUS,CAC5B,CACF,EACA,gBAAkBF,GAAc,CAC9B,GAAIP,EAAgB,QAAQ,IAAIO,CAAS,EAAG,CAC1C,IAAME,EAAS,IAAI,IAAIT,EAAgB,OAAO,EAC9CS,EAAO,OAAOF,CAAS,EACvBP,EAAgB,QAAUS,CAC5B,CACF,EAEA,KAAAV,CACF,GACF,CACED,EACAE,EACAN,EACAC,EACAC,EACAK,EACAJ,EACAE,CACF,CACF,EAEA,OAAOV,EAACE,EAAQ,SAAR,CAAiB,MAAOa,EAAgB,SAAAX,EAAS,CAC3D,EAEaiB,EAAyB,IAA+B,CACnE,IAAMC,EAAU1B,EAAWM,CAAO,EAClC,GAAIoB,IAAY,OACd,MAAM,IAAI,MAAM,oEAAoE,EAEtF,OAAOA,CACT",
|
|
6
|
+
"names": ["useLexicalComposerContext", "createContext", "useContext", "useMemo", "useRef", "useState", "jsx", "generateQuickGuid", "Context", "EditorConfigProvider", "children", "editorConfig", "editorContainerRef", "field", "parentContext", "editor", "uuid", "childrenEditors", "focusedEditor", "setFocusedEditor", "focusHistory", "editorContext", "editorUUID", "childEditor", "childUUID", "childEditorContext", "newMap", "useEditorConfigContext", "context"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{$applyNodeReplacement as s}from"lexical";import*as l from"react";import{addClassNamesToElement as a}from"@lexical/utils";import{$applyNodeReplacement as u,DecoratorNode as d,createCommand as c}from"lexical";var O=c("INSERT_HORIZONTAL_RULE_COMMAND"),r=class extends d{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:p,priority:0})}}static importJSON(e){return i()}createDOM(e){let n=document.createElement("hr");return a(n,e.theme.hr),n}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{type:"horizontalrule",version:1}}getTextContent(){return`
|
|
2
|
+
`}isInline(){return!1}updateDOM(){return!1}};function p(){return{node:i()}}function i(){return u(new r)}import{jsx as z}from"react/jsx-runtime";var m=l.lazy(()=>import("./component-UQ2BKD5X.js").then(o=>({default:o.HorizontalRuleComponent}))),t=class extends r{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return N()}decorate(){return z(m,{nodeKey:this.__key})}exportJSON(){return super.exportJSON()}};function N(){return s(new t)}function v(o){return o instanceof t}export{O as a,t as b,N as c,v as d};
|
|
3
|
+
//# sourceMappingURL=chunk-VMCQSR3T.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/horizontalRule/client/nodes/HorizontalRuleNode.tsx", "../../../src/features/horizontalRule/server/nodes/HorizontalRuleNode.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { DOMConversionOutput, LexicalNode, SerializedLexicalNode } from 'lexical'\n\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nimport type { SerializedHorizontalRuleNode } from '../../server/nodes/HorizontalRuleNode.js'\n\nimport { HorizontalRuleServerNode } from '../../server/nodes/HorizontalRuleNode.js'\n\nconst HorizontalRuleComponent = React.lazy(() =>\n import('../../client/component/index.js').then((module) => ({\n default: module.HorizontalRuleComponent,\n })),\n)\n\nexport class HorizontalRuleNode extends HorizontalRuleServerNode {\n static clone(node: HorizontalRuleServerNode): HorizontalRuleServerNode {\n return super.clone(node)\n }\n\n static getType(): string {\n return super.getType()\n }\n\n /**\n * The data for this node is stored serialized as JSON. This is the \"load function\" of that node: it takes the saved data and converts it into a node.\n */\n static importJSON(serializedNode: SerializedHorizontalRuleNode): HorizontalRuleNode {\n return $createHorizontalRuleNode()\n }\n\n /**\n * Allows you to render a React component within whatever createDOM returns.\n */\n decorate(): React.ReactElement {\n return <HorizontalRuleComponent nodeKey={this.__key} />\n }\n\n exportJSON(): SerializedLexicalNode {\n return super.exportJSON()\n }\n}\n\nfunction $convertHorizontalRuleElement(): DOMConversionOutput {\n return { node: $createHorizontalRuleNode() }\n}\n\nexport function $createHorizontalRuleNode(): HorizontalRuleNode {\n return $applyNodeReplacement(new HorizontalRuleNode())\n}\n\nexport function $isHorizontalRuleNode(\n node: LexicalNode | null | undefined,\n): node is HorizontalRuleNode {\n return node instanceof HorizontalRuleNode\n}\n", "import type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n EditorConfig,\n LexicalCommand,\n LexicalNode,\n SerializedLexicalNode,\n Spread,\n} from 'lexical'\nimport type * as React from 'react'\n\nimport { addClassNamesToElement } from '@lexical/utils'\nimport { $applyNodeReplacement, DecoratorNode, createCommand } from 'lexical'\n\n/**\n * Serialized representation of a horizontal rule node. Serialized = converted to JSON. This is what is stored in the database / in the lexical editor state.\n */\nexport type SerializedHorizontalRuleNode = Spread<\n {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'horizontalrule'\n },\n SerializedLexicalNode\n>\n\nexport const INSERT_HORIZONTAL_RULE_COMMAND: LexicalCommand<void> = createCommand(\n 'INSERT_HORIZONTAL_RULE_COMMAND',\n)\n\n/**\n * This node is a DecoratorNode. DecoratorNodes allow you to render React components in the editor.\n *\n * They need both createDom and decorate functions. createDom => outside of the html. decorate => React Component inside of the html.\n *\n * If we used DecoratorBlockNode instead, we would only need a decorate method\n */\nexport class HorizontalRuleServerNode extends DecoratorNode<React.ReactElement> {\n static clone(node: HorizontalRuleServerNode): HorizontalRuleServerNode {\n return new this(node.__key)\n }\n\n static getType(): string {\n return 'horizontalrule'\n }\n\n /**\n * Defines what happens if you copy an hr element from another page and paste it into the lexical editor\n *\n * This also determines the behavior of lexical's internal HTML -> Lexical converter\n */\n static importDOM(): DOMConversionMap | null {\n return {\n hr: () => ({\n conversion: $convertHorizontalRuleElement,\n priority: 0,\n }),\n }\n }\n\n /**\n * The data for this node is stored serialized as JSON. This is the \"load function\" of that node: it takes the saved data and converts it into a node.\n */\n static importJSON(serializedNode: SerializedHorizontalRuleNode): HorizontalRuleServerNode {\n return $createHorizontalRuleServerNode()\n }\n\n /**\n * Determines how the hr element is rendered in the lexical editor. This is only the \"initial\" / \"outer\" HTML element.\n */\n createDOM(config: EditorConfig): HTMLElement {\n const element = document.createElement('hr')\n addClassNamesToElement(element, config.theme.hr)\n return element\n }\n\n decorate() {\n return null\n }\n\n /**\n * Opposite of importDOM, this function defines what happens when you copy an hr element from the lexical editor and paste it into another page.\n *\n * This also determines the behavior of lexical's internal Lexical -> HTML converter\n */\n exportDOM(): DOMExportOutput {\n return { element: document.createElement('hr') }\n }\n /**\n * Opposite of importJSON. This determines what data is saved in the database / in the lexical editor state.\n */\n exportJSON(): SerializedLexicalNode {\n return {\n type: 'horizontalrule',\n version: 1,\n }\n }\n\n getTextContent(): string {\n return '\\n'\n }\n\n isInline(): false {\n return false\n }\n\n updateDOM(): boolean {\n return false\n }\n}\n\nfunction $convertHorizontalRuleElement(): DOMConversionOutput {\n return { node: $createHorizontalRuleServerNode() }\n}\n\nexport function $createHorizontalRuleServerNode(): HorizontalRuleServerNode {\n return $applyNodeReplacement(new HorizontalRuleServerNode())\n}\n\nexport function $isHorizontalRuleServerNode(\n node: LexicalNode | null | undefined,\n): node is HorizontalRuleServerNode {\n return node instanceof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,CACvB,OAAO,MAAM,QAAQ,CACvB,CAKA,OAAO,WAAWC,EAAkE,CAClF,OAAOC,EAA0B,CACnC,CAKA,UAA+B,CAC7B,OAAOP,EAACC,EAAA,CAAwB,QAAS,KAAK,MAAO,CACvD,CAEA,YAAoC,CAClC,OAAO,MAAM,WAAW,CAC1B,CACF,EAMO,SAASO,GAAgD,CAC9D,OAAOC,EAAsB,IAAIC,CAAoB,CACvD,CAEO,SAASC,EACdC,EAC4B,CAC5B,OAAOA,aAAgBF,CACzB",
|
|
6
|
+
"names": ["$applyNodeReplacement", "React", "addClassNamesToElement", "$applyNodeReplacement", "DecoratorNode", "createCommand", "INSERT_HORIZONTAL_RULE_COMMAND", "HorizontalRuleServerNode", "node", "$convertHorizontalRuleElement", "serializedNode", "$createHorizontalRuleServerNode", "config", "element", "jsx", "HorizontalRuleComponent", "module", "HorizontalRuleNode", "HorizontalRuleServerNode", "node", "serializedNode", "$createHorizontalRuleNode", "$createHorizontalRuleNode", "$applyNodeReplacement", "HorizontalRuleNode", "$isHorizontalRuleNode", "node"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{b as T}from"./chunk-SQHN3N6E.js";import{Collapsible as te,Form as le,Pill as ae,RenderComponent as se,SectionTitle as re,ShimmerEffect as ie,useConfig as ne,useDocumentInfo as ce,useFieldProps as de,useFormSubmitted as me,useTranslation as pe}from"@payloadcms/ui";import{useCallback as fe,useEffect as ue,useMemo as he,useState as ye}from"react";import{getTranslation as be}from"@payloadcms/translations";import{getFormState as K}from"@payloadcms/ui/shared";import{v4 as ke}from"uuid";import{useLexicalComposerContext as j}from"@lexical/react/LexicalComposerContext.js";import{getTranslation as W}from"@payloadcms/translations";import{Button as H,Collapsible as q,ErrorPill as z,Pill as G,RenderComponent as J,RenderFields as Q,SectionTitle as X,useDocumentInfo as Y,useFormSubmitted as Z,useTranslation as ee}from"@payloadcms/ui";import{dequal as oe}from"dequal/lite";import{$getNodeByKey as O}from"lexical";import $,{useCallback as w}from"react";import{useAllFormFields as U}from"@payloadcms/ui";import{reduceFieldsToValues as I}from"payload/shared";import{useEffect as M}from"react";function D({fields:a}){for(let e in a){let o=a[e];Array.isArray(o.rows)&&"value"in o&&(o.disableFormData=!0)}return a}var E=a=>{let{onChange:e}=a,[o]=U(),t=D({fields:o}),y=I(t,!0);return M(()=>{e&&e({fullFieldsWithValues:t,newFormData:y})},[y,e,t]),null};import{jsx as u,jsxs as L}from"react/jsx-runtime";function A(a){for(let e in a){let o=a[e];Array.isArray(o)&&!o?.length?delete a[e]:o&&typeof o=="object"?A(o):o==null&&delete a[e]}}var V=a=>{let{baseClass:e,clientBlock:o,field:t,formSchema:y,nodeKey:n,schemaPath:S}=a,{formData:l}=a,{i18n:k}=ee(),[c]=j(),{getDocPreferences:g,setDocFieldPreferences:_}=Y(),[m,N]=$.useState(()=>{let r=!1;return g().then(i=>{let f=i?.fields[t.name]?.collapsed;f&&f.includes(l.id)&&(r=!0,N(!0))}),r}),B=Z(),[s,P]=$.useState(0),F=B&&s>0,R=[`${e}__row`,F?`${e}__row--has-errors`:`${e}__row--no-errors`].filter(Boolean).join(" "),x=w(({fullFieldsWithValues:r,newFormData:i})=>{if(i.id=l.id,i.blockType=l.blockType,A(i),A(l),oe(l,i)||setTimeout(()=>{c.update(()=>{let b=O(n);b&&(l=i,b.setFields(i))})},0),B){let b=0;for(let f of Object.values(r))f?.valid===!1&&b++;P(b)}},[c,n,B,l]),C=w(r=>{g().then(i=>{let f=i?.fields[t.name]?.collapsed,v=f&&f?.length?f:[];r?v.includes(l.id)||v.push(l.id):v.includes(l.id)&&v.splice(v.indexOf(l.id),1),_(t.name,{collapsed:v,hello:"hi"})})},[g,t.name,_,l.id]),p=w(()=>{c.update(()=>{O(n).remove()})},[c,n]);return L($.Fragment,{children:[u(q,{className:R,collapsibleStyle:F?"error":"default",header:o?.admin?.components?.Label?u(J,{clientProps:{blockKind:"lexicalBlock",formData:l},mappedComponent:o.admin.components.Label}):L("div",{className:`${e}__block-header`,children:[L("div",{children:[u(G,{className:`${e}__block-pill ${e}__block-pill-${l?.blockType}`,pillStyle:"white",children:typeof o?.labels.singular=="string"?W(o?.labels.singular,k):o.slug}),u(X,{path:"blockName",readOnly:t?.admin?.readOnly}),F&&u(z,{count:s,i18n:k,withMessage:!0})]}),c.isEditable()&&u(H,{buttonStyle:"icon-label",className:`${e}__removeButton`,disabled:t?.admin?.readOnly,icon:"x",onClick:r=>{r.preventDefault(),p()},round:!0,tooltip:"Remove Block"})]}),isCollapsed:m,onToggle:r=>{C(r),N(r)},children:u(Q,{className:`${e}__fields`,fields:y,forceRender:!0,margins:"small",path:"",readOnly:!1,schemaPath:S})},0),u(E,{onChange:x})]})};import{jsx as d,jsxs as Fe}from"react/jsx-runtime";var h="lexical-block",je=a=>{let{formData:e,nodeKey:o}=a,{config:t}=ne(),y=me(),{id:n}=ce(),{path:S,schemaPath:l}=de(),{field:k}=T(),[c,g]=ye(!1),{field:{richTextComponentMap:_}}=T(),m=`${l}.lexical_internal_feature.blocks.lexical_blocks.lexical_blocks.${e.blockType}`,s=_.get("lexical_internal_feature.blocks.fields.lexical_blocks")[0].blocks.find(C=>C.slug===e.blockType);ue(()=>{e&&(async()=>{let p=await K({apiRoute:t.routes.api,body:{id:n,data:e,operation:"update",schemaPath:m},serverURL:t.serverURL});p&&(p.blockName={initialValue:"",passesCondition:!0,valid:!0,value:e.blockName},g(p))})()},[t.routes.api,t.serverURL,m,n]);let P=fe(async({formState:C})=>{let p=await K({apiRoute:t.routes.api,body:{id:n,formState:C,operation:"update",schemaPath:m},serverURL:t.serverURL});return p.blockName={initialValue:"",passesCondition:!0,valid:!0,value:e.blockName},p},[t.routes.api,t.serverURL,n,m,e.blockName]),{i18n:F}=pe(),R=[`${h}__row`,`${h}__row--no-errors`].filter(Boolean).join(" "),x=he(()=>s&&c!==!1?d(le,{beforeSubmit:[P],fields:s.fields,initialState:c,onChange:[P],submitted:y,uuid:ke(),children:d(V,{baseClass:h,clientBlock:s,field:k,formData:e,formSchema:s.fields,nodeKey:o,path:`${S}.lexical_internal_feature.blocks.${e.blockType}`,schemaPath:m})}):d(te,{className:R,collapsibleStyle:"default",header:s?.admin?.components?.Label?d(se,{clientProps:{blockKind:"lexicalBlock",formData:e},mappedComponent:s.admin.components.Label}):d("div",{className:`${h}__block-header`,children:Fe("div",{children:[d(ae,{className:`${h}__block-pill ${h}__block-pill-${e?.blockType}`,pillStyle:"white",children:s&&typeof s.labels.singular=="string"?be(s.labels.singular,F):s.slug}),d(re,{path:"blockName",readOnly:k?.admin?.readOnly})]})}),children:d(ie,{height:"35vh"})},0),[s,c,P,y,k,o,S,m,R,F]);return d("div",{className:h+" "+h+"-"+e.blockType,children:x})};export{je as BlockComponent};
|
|
2
|
+
//# sourceMappingURL=component-6C5JERGA.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/blocks/client/component/index.tsx", "../../../src/features/blocks/client/component/BlockContent.tsx", "../../../src/features/blocks/client/component/FormSavePlugin.tsx", "../../../src/features/blocks/client/component/removeEmptyArrayValues.ts"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport type { FormProps } from '@payloadcms/ui'\n\nimport {\n Collapsible,\n Form,\n Pill,\n RenderComponent,\n SectionTitle,\n ShimmerEffect,\n useConfig,\n useDocumentInfo,\n useFieldProps,\n useFormSubmitted,\n useTranslation,\n} from '@payloadcms/ui'\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\n\nconst baseClass = 'lexical-block'\nimport type { BlockFieldClient, FormState } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport { v4 as uuid } from 'uuid'\n\nimport type { BlockFields } from '../../server/nodes/BlocksNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { BlockContent } from './BlockContent.js'\ntype Props = {\n readonly children?: React.ReactNode\n readonly formData: BlockFields\n readonly nodeKey?: string\n}\n\nexport const BlockComponent: React.FC<Props> = (props) => {\n const { formData, nodeKey } = props\n const { config } = useConfig()\n const submitted = useFormSubmitted()\n const { id } = useDocumentInfo()\n const { path, schemaPath } = useFieldProps()\n const { field: parentLexicalRichTextField } = useEditorConfigContext()\n\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.lexical_blocks.${formData.blockType}`\n\n const componentMapRenderedBlockPath = `lexical_internal_feature.blocks.fields.lexical_blocks`\n const blocksField: BlockFieldClient = richTextComponentMap.get(componentMapRenderedBlockPath)[0]\n\n const clientBlock = blocksField.blocks.find((block) => block.slug === formData.blockType)\n\n // Field Schema\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: formData,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n\n if (state) {\n state.blockName = {\n initialValue: '',\n passesCondition: true,\n valid: true,\n value: formData.blockName,\n }\n\n setInitialState(state)\n }\n }\n\n if (formData) {\n void awaitInitialState()\n }\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id]) // DO NOT ADD FORMDATA HERE! Adding formData will kick you out of sub block editors while writing.\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n const formState = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n\n formState.blockName = {\n initialValue: '',\n passesCondition: true,\n valid: true,\n value: formData.blockName,\n }\n\n return formState\n },\n\n [config.routes.api, config.serverURL, id, schemaFieldsPath, formData.blockName],\n )\n const { i18n } = useTranslation()\n\n const classNames = [`${baseClass}__row`, `${baseClass}__row--no-errors`].filter(Boolean).join(' ')\n\n // Memoized Form JSX\n const formContent = useMemo(() => {\n return clientBlock && initialState !== false ? (\n <Form\n beforeSubmit={[onChange]}\n fields={clientBlock.fields}\n initialState={initialState}\n onChange={[onChange]}\n submitted={submitted}\n uuid={uuid()}\n >\n <BlockContent\n baseClass={baseClass}\n clientBlock={clientBlock}\n field={parentLexicalRichTextField}\n formData={formData}\n formSchema={clientBlock.fields}\n nodeKey={nodeKey}\n path={`${path}.lexical_internal_feature.blocks.${formData.blockType}`}\n schemaPath={schemaFieldsPath}\n />\n </Form>\n ) : (\n <Collapsible\n className={classNames}\n collapsibleStyle=\"default\"\n header={\n clientBlock?.admin?.components?.Label ? (\n <RenderComponent\n clientProps={{ blockKind: 'lexicalBlock', formData }}\n mappedComponent={clientBlock.admin.components.Label}\n />\n ) : (\n <div className={`${baseClass}__block-header`}>\n <div>\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`}\n pillStyle=\"white\"\n >\n {clientBlock && typeof clientBlock.labels.singular === 'string'\n ? getTranslation(clientBlock.labels.singular, i18n)\n : clientBlock.slug}\n </Pill>\n <SectionTitle\n path=\"blockName\"\n readOnly={parentLexicalRichTextField?.admin?.readOnly}\n />\n </div>\n </div>\n )\n }\n key={0}\n >\n <ShimmerEffect height=\"35vh\" />\n </Collapsible>\n )\n }, [\n clientBlock,\n initialState,\n onChange,\n submitted,\n parentLexicalRichTextField,\n nodeKey,\n path,\n schemaFieldsPath,\n classNames,\n i18n,\n ])\n\n return <div className={baseClass + ' ' + baseClass + '-' + formData.blockType}>{formContent}</div>\n}\n", "import type { ClientBlock, ClientField, CollapsedPreferences, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Collapsible,\n ErrorPill,\n Pill,\n RenderComponent,\n RenderFields,\n SectionTitle,\n useDocumentInfo,\n useFormSubmitted,\n useTranslation,\n} from '@payloadcms/ui'\nimport { dequal } from 'dequal/lite'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback } from 'react'\n\nimport type { LexicalRichTextFieldProps } from '../../../../types.js'\nimport type { BlockFields } from '../../server/nodes/BlocksNode.js'\nimport type { BlockNode } from '../nodes/BlocksNode.js'\n\nimport { FormSavePlugin } from './FormSavePlugin.js'\n\ntype Props = {\n baseClass: string\n clientBlock: ClientBlock\n field: LexicalRichTextFieldProps['field']\n formData: BlockFields\n formSchema: ClientField[]\n nodeKey: string\n path: string\n schemaPath: string\n}\n\n// Recursively remove all undefined values from even being present in formData, as they will\n// cause isDeepEqual to return false if, for example, formData has a key that fields.data\n// does not have, even if it's undefined.\n// Currently, this happens if a block has another sub-blocks field. Inside formData, that sub-blocks field has an undefined blockName property.\n// Inside of fields.data however, that sub-blocks blockName property does not exist at all.\nfunction removeUndefinedAndNullAndEmptyArraysRecursively(obj: object) {\n for (const key in obj) {\n const value = obj[key]\n if (Array.isArray(value) && !value?.length) {\n delete obj[key]\n } else if (value && typeof value === 'object') {\n removeUndefinedAndNullAndEmptyArraysRecursively(value)\n } else if (value === undefined || value === null) {\n delete obj[key]\n }\n }\n}\n\n/**\n * The actual content of the Block. This should be INSIDE a Form component,\n * scoped to the block. All format operations in here are thus scoped to the block's form, and\n * not the whole document.\n */\nexport const BlockContent: React.FC<Props> = (props) => {\n const { baseClass, clientBlock, field, formSchema, nodeKey, schemaPath } = props\n let { formData } = props\n\n const { i18n } = useTranslation()\n const [editor] = useLexicalComposerContext()\n // Used for saving collapsed to preferences (and gettin' it from there again)\n // Remember, these preferences are scoped to the whole document, not just this form. This\n // is important to consider for the data path used in setDocFieldPreferences\n const { getDocPreferences, setDocFieldPreferences } = useDocumentInfo()\n\n const [isCollapsed, setIsCollapsed] = React.useState<boolean>(() => {\n let initialState = false\n\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences = currentDocPreferences?.fields[field.name]\n\n const collapsedArray = currentFieldPreferences?.collapsed\n\n if (collapsedArray && collapsedArray.includes(formData.id)) {\n initialState = true\n setIsCollapsed(true)\n }\n })\n return initialState\n })\n\n const hasSubmitted = useFormSubmitted()\n\n const [errorCount, setErrorCount] = React.useState(0)\n\n const fieldHasErrors = hasSubmitted && errorCount > 0\n\n const classNames = [\n `${baseClass}__row`,\n fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,\n ]\n .filter(Boolean)\n .join(' ')\n\n const onFormChange = useCallback(\n ({\n fullFieldsWithValues,\n newFormData,\n }: {\n fullFieldsWithValues: FormState\n newFormData: BlockFields\n }) => {\n newFormData.id = formData.id\n newFormData.blockType = formData.blockType\n\n removeUndefinedAndNullAndEmptyArraysRecursively(newFormData)\n removeUndefinedAndNullAndEmptyArraysRecursively(formData)\n\n // Only update if the data has actually changed. Otherwise, we may be triggering an unnecessary value change,\n // which would trigger the \"Leave without saving\" dialog unnecessarily\n if (!dequal(formData, newFormData)) {\n // Running this in the next tick in the meantime fixes this issue: https://github.com/payloadcms/payload/issues/4108\n // I don't know why. When this is called immediately, it might focus out of a nested lexical editor field if an update is made there.\n // My hypothesis is that the nested editor might not have fully finished its update cycle yet. By updating in the next tick, we\n // ensure that the nested editor has finished its update cycle before we update the block node.\n setTimeout(() => {\n editor.update(() => {\n const node: BlockNode = $getNodeByKey(nodeKey)\n if (node) {\n formData = newFormData\n node.setFields(newFormData)\n }\n })\n }, 0)\n }\n\n // update error count\n if (hasSubmitted) {\n let rowErrorCount = 0\n for (const formField of Object.values(fullFieldsWithValues)) {\n if (formField?.valid === false) {\n rowErrorCount++\n }\n }\n setErrorCount(rowErrorCount)\n }\n },\n [editor, nodeKey, hasSubmitted, formData],\n )\n\n const onCollapsedChange = useCallback(\n (changedCollapsed: boolean) => {\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences = currentDocPreferences?.fields[field.name]\n\n const collapsedArray = currentFieldPreferences?.collapsed\n\n const newCollapsed: CollapsedPreferences =\n collapsedArray && collapsedArray?.length ? collapsedArray : []\n\n if (changedCollapsed) {\n if (!newCollapsed.includes(formData.id)) {\n newCollapsed.push(formData.id)\n }\n } else {\n if (newCollapsed.includes(formData.id)) {\n newCollapsed.splice(newCollapsed.indexOf(formData.id), 1)\n }\n }\n\n setDocFieldPreferences(field.name, {\n collapsed: newCollapsed,\n hello: 'hi',\n })\n })\n },\n [getDocPreferences, field.name, setDocFieldPreferences, formData.id],\n )\n\n const removeBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n return (\n <React.Fragment>\n <Collapsible\n className={classNames}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n header={\n clientBlock?.admin?.components?.Label ? (\n <RenderComponent\n clientProps={{ blockKind: 'lexicalBlock', formData }}\n mappedComponent={clientBlock.admin.components.Label}\n />\n ) : (\n <div className={`${baseClass}__block-header`}>\n <div>\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`}\n pillStyle=\"white\"\n >\n {typeof clientBlock?.labels.singular === 'string'\n ? getTranslation(clientBlock?.labels.singular, i18n)\n : clientBlock.slug}\n </Pill>\n <SectionTitle path=\"blockName\" readOnly={field?.admin?.readOnly} />\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n {editor.isEditable() && (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.admin?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeBlock()\n }}\n round\n tooltip=\"Remove Block\"\n />\n )}\n </div>\n )\n }\n isCollapsed={isCollapsed}\n key={0}\n onToggle={(incomingCollapsedState) => {\n onCollapsedChange(incomingCollapsedState)\n setIsCollapsed(incomingCollapsedState)\n }}\n >\n <RenderFields\n className={`${baseClass}__fields`}\n fields={formSchema}\n forceRender\n margins=\"small\"\n path=\"\" // Leaving path empty makes it so field values are not prefixed / scoped by the entire schemaPath. e.g. we can access \"myField\" instead of \"someLexicalField.feature.blocks.someArrayB\" // TODO: Could there be any implications leaving path different than schemaPath?\n readOnly={false}\n schemaPath={schemaPath} // Having the correct schemaPath here allows sub-fields (like array > addRow) to run correct form-state calls and retrieve their needed form state from the server\n />\n </Collapsible>\n\n <FormSavePlugin onChange={onFormChange} />\n </React.Fragment>\n )\n}\n", "import type { Data, FormState } from 'payload'\nimport type React from 'react'\n\nimport { useAllFormFields } from '@payloadcms/ui'\nimport { reduceFieldsToValues } from 'payload/shared'\nimport { useEffect } from 'react'\n\nimport { removeEmptyArrayValues } from './removeEmptyArrayValues.js'\n\ntype Props = {\n onChange?: ({\n fullFieldsWithValues,\n newFormData,\n }: {\n fullFieldsWithValues: FormState\n newFormData: Data\n }) => void\n}\n\nexport const FormSavePlugin: React.FC<Props> = (props) => {\n const { onChange } = props\n\n const [_fields] = useAllFormFields()\n\n const fields = removeEmptyArrayValues({ fields: _fields })\n\n // Pass in fields, and indicate if you'd like to \"unflatten\" field data.\n // The result below will reflect the data stored in the form at the given time\n const newFormData = reduceFieldsToValues(fields, true)\n\n useEffect(() => {\n if (onChange) {\n onChange({ fullFieldsWithValues: fields, newFormData })\n }\n }, [newFormData, onChange, fields])\n\n return null\n}\n", "import type { FormState } from 'payload'\n\n/**\n * By default, if an array field is empty, it will be included in the form state with a value of 0.\n * We do not need this behavior here, By setting `disableFormData` to true, we can prevent the field from being included in the form state\n * like that.\n * @param fields form state\n */\nexport function removeEmptyArrayValues({ fields }: { fields: FormState }): FormState {\n for (const key in fields) {\n const field = fields[key]\n if (Array.isArray(field.rows) && 'value' in field) {\n field.disableFormData = true\n }\n }\n return fields\n}\n"],
|
|
5
|
+
"mappings": "qDAIA,OACE,eAAAA,GACA,QAAAC,GACA,QAAAC,GACA,mBAAAC,GACA,gBAAAC,GACA,iBAAAC,GACA,aAAAC,GACA,mBAAAC,GACA,iBAAAC,GACA,oBAAAC,GACA,kBAAAC,OACK,iBACP,OAAgB,eAAAC,GAAa,aAAAC,GAAW,WAAAC,GAAS,YAAAC,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,MAAOP,EACP,SAAUX,EACV,WAAYkB,EAAY,OACxB,QAASjB,EACT,KAAM,GAAGO,CAAI,oCAAoCR,EAAS,SAAS,GACnE,WAAYiB,EACd,EACF,EAEAtB,EAACwC,GAAA,CACC,UAAWN,EACX,iBAAiB,UACjB,OACEX,GAAa,OAAO,YAAY,MAC9BvB,EAACyC,GAAA,CACC,YAAa,CAAE,UAAW,eAAgB,SAAApC,CAAS,EACnD,gBAAiBkB,EAAY,MAAM,WAAW,MAChD,EAEAvB,EAAC,OAAI,UAAW,GAAGE,CAAS,iBAC1B,SAAAD,GAAC,OACC,UAAAD,EAAC0C,GAAA,CACC,UAAW,GAAGxC,CAAS,gBAAgBA,CAAS,gBAAgBG,GAAU,SAAS,GACnF,UAAU,QAET,SAAAkB,GAAe,OAAOA,EAAY,OAAO,UAAa,SACnDoB,GAAepB,EAAY,OAAO,SAAUS,CAAI,EAChDT,EAAY,KAClB,EACAvB,EAAC4C,GAAA,CACC,KAAK,YACL,SAAU5B,GAA4B,OAAO,SAC/C,GACF,EACF,EAKJ,SAAAhB,EAAC6C,GAAA,CAAc,OAAO,OAAO,GAFxB,CAGP,EAED,CACDtB,EACAL,EACAU,EACAnB,EACAO,EACAV,EACAO,EACAS,EACAY,EACAF,CACF,CAAC,EAED,OAAOhC,EAAC,OAAI,UAAWE,EAAY,IAAMA,EAAY,IAAMG,EAAS,UAAY,SAAA8B,EAAY,CAC9F",
|
|
6
|
+
"names": ["Collapsible", "Form", "Pill", "RenderComponent", "SectionTitle", "ShimmerEffect", "useConfig", "useDocumentInfo", "useFieldProps", "useFormSubmitted", "useTranslation", "useCallback", "useEffect", "useMemo", "useState", "getTranslation", "getFormState", "uuid", "useLexicalComposerContext", "getTranslation", "Button", "Collapsible", "ErrorPill", "Pill", "RenderComponent", "RenderFields", "SectionTitle", "useDocumentInfo", "useFormSubmitted", "useTranslation", "dequal", "$getNodeByKey", "React", "useCallback", "useAllFormFields", "reduceFieldsToValues", "useEffect", "removeEmptyArrayValues", "fields", "key", "field", "FormSavePlugin", "props", "onChange", "_fields", "useAllFormFields", "fields", "removeEmptyArrayValues", "newFormData", "reduceFieldsToValues", "useEffect", "jsx", "jsxs", "removeUndefinedAndNullAndEmptyArraysRecursively", "obj", "key", "value", "BlockContent", "props", "baseClass", "clientBlock", "field", "formSchema", "nodeKey", "schemaPath", "formData", "i18n", "useTranslation", "editor", "useLexicalComposerContext", "getDocPreferences", "setDocFieldPreferences", "useDocumentInfo", "isCollapsed", "setIsCollapsed", "React", "initialState", "currentDocPreferences", "collapsedArray", "hasSubmitted", "useFormSubmitted", "errorCount", "setErrorCount", "fieldHasErrors", "classNames", "onFormChange", "useCallback", "fullFieldsWithValues", "newFormData", "dequal", "node", "$getNodeByKey", "rowErrorCount", "formField", "onCollapsedChange", "changedCollapsed", "newCollapsed", "removeBlock", "Collapsible", "RenderComponent", "Pill", "getTranslation", "SectionTitle", "ErrorPill", "Button", "e", "incomingCollapsedState", "RenderFields", "FormSavePlugin", "jsx", "jsxs", "baseClass", "BlockComponent", "props", "formData", "nodeKey", "config", "useConfig", "submitted", "useFormSubmitted", "id", "useDocumentInfo", "path", "schemaPath", "useFieldProps", "parentLexicalRichTextField", "useEditorConfigContext", "initialState", "setInitialState", "useState", "richTextComponentMap", "schemaFieldsPath", "clientBlock", "block", "useEffect", "state", "getFormState", "onChange", "useCallback", "prevFormState", "formState", "i18n", "useTranslation", "classNames", "formContent", "useMemo", "Form", "uuid", "BlockContent", "Collapsible", "RenderComponent", "Pill", "getTranslation", "SectionTitle", "ShimmerEffect"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{a as L,b as O,c as A,f as F}from"./chunk-E4HH5PS6.js";import{b}from"./chunk-SQHN3N6E.js";import{useLexicalComposerContext as oe}from"@lexical/react/LexicalComposerContext.js";import{useLexicalNodeSelection as te}from"@lexical/react/useLexicalNodeSelection.js";import{mergeRegister as ae}from"@lexical/utils";import{getTranslation as K}from"@payloadcms/translations";import{Button as E,DrawerToggler as le,File as ne,formatDrawerSlug as ie,useConfig as re,useDocumentDrawer as se,useEditDepth as de,useModal as ce,usePayloadAPI as ue,useTranslation as pe}from"@payloadcms/ui";import{$getNodeByKey as w,$getSelection as me,$isNodeSelection as fe,CLICK_COMMAND as ge,COMMAND_PRIORITY_LOW as R,KEY_BACKSPACE_COMMAND as Ce,KEY_DELETE_COMMAND as De}from"lexical";import{useCallback as r,useEffect as ve,useId as _e,useReducer as Ne,useRef as be,useState as Ee}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";var t="lexical-upload",I={depth:0},we=d=>{let{data:{fields:B,relationTo:y,value:c},nodeKey:l}=d,{config:{collections:k,routes:{api:j},serverURL:W}}=re(),C=be(null),{closeModal:h}=ce(),{uuid:Y}=b(),H=de(),[a]=oe(),[n,u,D]=te(l),{editorConfig:z,field:v}=b(),{i18n:S,t:p}=pe(),[$,q]=Ne(e=>e+1,0),[i]=Ee(()=>k.find(e=>e.slug===y)),G=_e(),m=ie({slug:"lexical-upload-drawer-"+Y+G,depth:H}),[J,Q,{closeDrawer:U}]=se({id:c,collectionSlug:i.slug}),[{data:f},{setParams:P}]=ue(`${W}${j}/${i.slug}/${c}`,{initialParams:I}),M=f?.thumbnailURL||f?.url,V=r(()=>{a.update(()=>{w(l).remove()})},[a,l]),X=r(e=>{P({...I,cacheBust:$}),q(),U()},[P,$,U]),_=r(e=>{if(n&&fe(me())){e.preventDefault();let g=w(l);if(F(g))return g.remove(),!0}return!1},[n,l]),x=r(e=>e.target===C.current||C.current?.contains(e.target)?(e.shiftKey?u(!n):n||(D(),u(!0)),!0):!1,[n,u,D]);ve(()=>ae(a.registerCommand(ge,x,R),a.registerCommand(De,_,R),a.registerCommand(Ce,_,R)),[D,a,n,l,_,u,x]);let T=(z?.resolvedFeatureMap?.get("upload")?.sanitizedClientFeatureProps).collections?.[i.slug]?.hasExtraFields,Z=r((e,g)=>{a.update(()=>{let N=w(l);if(N){let ee={...N.getData(),fields:g};N.setData(ee)}}),h(m)},[h,a,m,l]);return s("div",{className:[t,n&&`${t}--selected`].filter(Boolean).join(" "),contentEditable:!1,ref:C,children:[s("div",{className:`${t}__card`,children:[s("div",{className:`${t}__topRow`,children:[o("div",{className:`${t}__thumbnail`,children:M?o("img",{alt:f?.filename,"data-lexical-upload-id":c,"data-lexical-upload-relation-to":y,src:M}):o(ne,{})}),s("div",{className:`${t}__topRowRightPanel`,children:[o("div",{className:`${t}__collectionLabel`,children:K(i.labels.singular,S)}),a.isEditable()&&s("div",{className:`${t}__actions`,children:[T?o(le,{className:`${t}__upload-drawer-toggler`,disabled:v?.admin?.readOnly,slug:m,children:o(E,{buttonStyle:"icon-label",el:"div",icon:"edit",onClick:e=>{e.preventDefault()},round:!0,tooltip:p("fields:editRelationship")})}):null,o(E,{buttonStyle:"icon-label",disabled:v?.admin?.readOnly,el:"div",icon:"swap",onClick:()=>{a.dispatchCommand(A,{replace:{nodeKey:l}})},round:!0,tooltip:p("fields:swapUpload")}),o(E,{buttonStyle:"icon-label",className:`${t}__removeButton`,disabled:v?.admin?.readOnly,icon:"x",onClick:e=>{e.preventDefault(),V()},round:!0,tooltip:p("fields:removeUpload")})]})]})]}),o("div",{className:`${t}__bottomRow`,children:o(Q,{className:`${t}__doc-drawer-toggler`,children:o("strong",{children:f?.filename})})})]}),c&&o(J,{onSave:X}),T?o(L,{data:B,drawerSlug:m,drawerTitle:p("general:editLabel",{label:K(i.labels.singular,S)}),featureKey:"upload",handleDrawerSubmit:Z,schemaPathSuffix:i.slug}):null]})},Fe=d=>o(O,{...d,uploads:!0,children:o(we,{...d})});export{Fe as UploadComponent};
|
|
2
|
+
//# sourceMappingURL=component-GUWIGB77.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/upload/client/component/index.tsx"],
|
|
4
|
+
"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'\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 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"],
|
|
5
|
+
"mappings": "6GAGA,OAAS,6BAAAA,OAAiC,2CAC1C,OAAS,2BAAAC,OAA+B,4CACxC,OAAS,iBAAAC,OAAqB,iBAC9B,OAAS,kBAAAC,MAAsB,2BAC/B,OACE,UAAAC,EACA,iBAAAC,GACA,QAAAC,GACA,oBAAAC,GACA,aAAAC,GACA,qBAAAC,GACA,gBAAAC,GACA,YAAAC,GACA,iBAAAC,GACA,kBAAAC,OACK,iBACP,OACE,iBAAAC,EACA,iBAAAC,GACA,oBAAAC,GACA,iBAAAC,GACA,wBAAAC,EACA,yBAAAC,GACA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gBwD,EAAmC,CACxD,QAAS,CAAE,QAAArE,CAAQ,CACrB,CAAC,CACH,EACA,MAAK,GACL,QAASsB,EAAE,mBAAmB,EAChC,EACA/B,EAAC6E,EAAA,CACC,YAAY,aACZ,UAAW,GAAG3E,CAAS,iBACvB,SAAU2B,GAAO,OAAO,SACxB,KAAK,IACL,QAAU,GAAM,CACd,EAAE,eAAe,EACjBuB,EAAa,CACf,EACA,MAAK,GACL,QAASrB,EAAE,qBAAqB,EAClC,GACF,GAEJ,GACF,EACA/B,EAAC,OAAI,UAAW,GAAGE,CAAS,cAC1B,SAAAF,EAAC6C,EAAA,CAAsB,UAAW,GAAG3C,CAAS,uBAC5C,SAAAF,EAAC,UAAQ,SAAAgD,GAAM,SAAS,EAC1B,EACF,GACF,EACCxC,GAASR,EAAC4C,EAAA,CAAe,OAAQW,EAAc,EAC/Cc,EACCrE,EAAC+E,EAAA,CACC,KAAMzE,EACN,WAAYoC,EACZ,YAAaX,EAAE,oBAAqB,CAClC,MAAO4C,EAAetC,EAAkB,OAAO,SAAUP,CAAI,CAC/D,CAAC,EACD,WAAW,SACX,mBAAoBwC,EACpB,iBAAkBjC,EAAkB,KACtC,EACE,MACN,CAEJ,EAEa2C,GAAmB3E,GAE5BL,EAACiF,EAAA,CAA+B,GAAG5E,EAAO,QAAO,GAC/C,SAAAL,EAACI,GAAA,CAAW,GAAGC,EAAO,EACxB",
|
|
6
|
+
"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", "useCallback", "useEffect", "useId", "useReducer", "useRef", "useState", "jsx", "jsxs", "baseClass", "initialParams", "Component", "props", "fields", "relationTo", "value", "nodeKey", "collections", "api", "serverURL", "useConfig", "uploadRef", "useRef", "closeModal", "useModal", "uuid", "useEditorConfigContext", "editDepth", "useEditDepth", "editor", "useLexicalComposerContext", "isSelected", "setSelected", "clearSelection", "useLexicalNodeSelection", "editorConfig", "field", "i18n", "t", "useTranslation", "cacheBust", "dispatchCacheBust", "useReducer", "state", "relatedCollection", "useState", "coll", "componentID", "useId", "drawerSlug", "formatDrawerSlug", "DocumentDrawer", "DocumentDrawerToggler", "closeDrawer", "useDocumentDrawer", "data", "setParams", "usePayloadAPI", "thumbnailSRC", "removeUpload", "useCallback", "$getNodeByKey", "updateUpload", "$onDelete", "event", "$isNodeSelection", "$getSelection", "node", "$isUploadNode", "onClick", "useEffect", "mergeRegister", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_DELETE_COMMAND", "KEY_BACKSPACE_COMMAND", "hasExtraFields", "onExtraFieldsDrawerSubmit", "_", "uploadNode", "newData", "File", "getTranslation", "DrawerToggler", "Button", "INSERT_UPLOAD_WITH_DRAWER_COMMAND", "FieldsDrawer", "UploadComponent", "EnabledRelationshipsCondition"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{d as a}from"./chunk-VMCQSR3T.js";import{useLexicalComposerContext as u}from"@lexical/react/LexicalComposerContext.js";import{useLexicalNodeSelection as C}from"@lexical/react/useLexicalNodeSelection.js";import{addClassNamesToElement as E,mergeRegister as d,removeClassNamesFromElement as N}from"@lexical/utils";import{$getNodeByKey as p,$getSelection as g,$isNodeSelection as M,CLICK_COMMAND as S,COMMAND_PRIORITY_LOW as m,KEY_BACKSPACE_COMMAND as D,KEY_DELETE_COMMAND as _}from"lexical";import{useCallback as y,useEffect as c}from"react";var f="selected";function $({nodeKey:t}){let[r]=u(),[o,i,n]=C(t),s=y(e=>{if(o&&M(g())){e.preventDefault();let l=p(t);if(a(l))return l.remove(),!0}return!1},[o,t]);return c(()=>d(r.registerCommand(S,e=>{let l=r.getElementByKey(t);return e.target===l?(e.shiftKey||n(),i(!o),!0):!1},m),r.registerCommand(_,s,m),r.registerCommand(D,s,m)),[n,r,o,t,s,i]),c(()=>{let e=r.getElementByKey(t);e!==null&&(o?E(e,f):N(e,f))},[r,o,t]),null}export{$ as HorizontalRuleComponent};
|
|
2
|
+
//# sourceMappingURL=component-UQ2BKD5X.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/horizontalRule/client/component/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport type { NodeKey } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { addClassNamesToElement, mergeRegister, removeClassNamesFromElement } from '@lexical/utils'\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 { useCallback, useEffect } from 'react'\n\nimport { $isHorizontalRuleNode } from '../nodes/HorizontalRuleNode.js'\n\nconst isSelectedClassName = 'selected'\n\n/**\n * React component rendered in the lexical editor, WITHIN the hr element created by createDOM of the HorizontalRuleNode.\n *\n * @param nodeKey every node has a unique key (this key is not saved to the database and thus may differ between sessions). It's useful for working with the CURRENT lexical editor state\n */\nexport function HorizontalRuleComponent({ nodeKey }: { nodeKey: NodeKey }) {\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const $onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isHorizontalRuleNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n CLICK_COMMAND,\n (event: MouseEvent) => {\n const hrElem = editor.getElementByKey(nodeKey)\n\n if (event.target === hrElem) {\n if (!event.shiftKey) {\n clearSelection()\n }\n setSelected(!isSelected)\n return true\n }\n\n return false\n },\n 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])\n\n useEffect(() => {\n const hrElem = editor.getElementByKey(nodeKey)\n if (hrElem !== null) {\n if (isSelected) {\n addClassNamesToElement(hrElem, isSelectedClassName)\n } else {\n removeClassNamesFromElement(hrElem, isSelectedClassName)\n }\n }\n }, [editor, isSelected, nodeKey])\n\n return null\n}\n"],
|
|
5
|
+
"mappings": "qDAIA,OAAS,6BAAAA,MAAiC,2CAC1C,OAAS,2BAAAC,MAA+B,4CACxC,OAAS,0BAAAC,EAAwB,iBAAAC,EAAe,+BAAAC,MAAmC,iBACnF,OACE,iBAAAC,EACA,iBAAAC,EACA,oBAAAC,EACA,iBAAAC,EACA,wBAAAC,EACA,yBAAAC,EACA,sBAAAC,MACK,UACP,OAAS,eAAAC,EAAa,aAAAC,MAAiB,QAIvC,IAAMC,EAAsB,WAOrB,SAASC,EAAwB,CAAE,QAAAC,CAAQ,EAAyB,CACzE,GAAM,CAACC,CAAM,EAAIC,EAA0B,EACrC,CAACC,EAAYC,EAAaC,CAAc,EAAIC,EAAwBN,CAAO,EAE3EO,EAAYC,EACfC,GAAyB,CACxB,GAAIN,GAAcO,EAAiBC,EAAc,CAAC,EAAG,CACnDF,EAAM,eAAe,EACrB,IAAMG,EAAOC,EAAcb,CAAO,EAClC,GAAIc,EAAsBF,CAAI,EAC5B,OAAAA,EAAK,OAAO,EACL,EAEX,CACA,MAAO,EACT,EACA,CAACT,EAAYH,CAAO,CACtB,EAEA,OAAAe,EAAU,IACDC,EACLf,EAAO,gBACLgB,EACCR,GAAsB,CACrB,IAAMS,EAASjB,EAAO,gBAAgBD,CAAO,EAE7C,OAAIS,EAAM,SAAWS,GACdT,EAAM,UACTJ,EAAe,EAEjBD,EAAY,CAACD,CAAU,EAChB,IAGF,EACT,EACAgB,CACF,EACAlB,EAAO,gBAAgBmB,EAAoBb,EAAWY,CAAoB,EAC1ElB,EAAO,gBAAgBoB,EAAuBd,EAAWY,CAAoB,CAC/E,EACC,CAACd,EAAgBJ,EAAQE,EAAYH,EAASO,EAAWH,CAAW,CAAC,EAExEW,EAAU,IAAM,CACd,IAAMG,EAASjB,EAAO,gBAAgBD,CAAO,EACzCkB,IAAW,OACTf,EACFmB,EAAuBJ,EAAQpB,CAAmB,EAElDyB,EAA4BL,EAAQpB,CAAmB,EAG7D,EAAG,CAACG,EAAQE,EAAYH,CAAO,CAAC,EAEzB,IACT",
|
|
6
|
+
"names": ["useLexicalComposerContext", "useLexicalNodeSelection", "addClassNamesToElement", "mergeRegister", "removeClassNamesFromElement", "$getNodeByKey", "$getSelection", "$isNodeSelection", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "useCallback", "useEffect", "isSelectedClassName", "HorizontalRuleComponent", "nodeKey", "editor", "useLexicalComposerContext", "isSelected", "setSelected", "clearSelection", "useLexicalNodeSelection", "$onDelete", "useCallback", "event", "$isNodeSelection", "$getSelection", "node", "$getNodeByKey", "$isHorizontalRuleNode", "useEffect", "mergeRegister", "CLICK_COMMAND", "hrElem", "COMMAND_PRIORITY_LOW", "KEY_DELETE_COMMAND", "KEY_BACKSPACE_COMMAND", "addClassNamesToElement", "removeClassNamesFromElement"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{c as v,f as y}from"./chunk-LTR7V74A.js";import{b as u}from"./chunk-SQHN3N6E.js";import{useCallback as f,useEffect as K,useRef as O}from"react";import{useLexicalComposerContext as L}from"@lexical/react/LexicalComposerContext";import{useLexicalNodeSelection as S}from"@lexical/react/useLexicalNodeSelection";import{mergeRegister as $}from"@lexical/utils";import{getTranslation as N}from"@payloadcms/translations";import{Button as E,RenderComponent as A,useTranslation as P}from"@payloadcms/ui";import{$getNodeByKey as M,$getSelection as T,$isNodeSelection as F,CLICK_COMMAND as h,COMMAND_PRIORITY_LOW as k,KEY_BACKSPACE_COMMAND as Y,KEY_DELETE_COMMAND as j}from"lexical";import{jsx as a,jsxs as D}from"react/jsx-runtime";var s="inline-block",oe=I=>{let{formData:r,nodeKey:o}=I,[e]=L(),{i18n:b,t:C}=P(),{field:B}=u(),d=O(null),[l,c,m]=S(o),{field:{richTextComponentMap:R}}=u(),t=R.get("lexical_internal_feature.blocks.fields.lexical_inline_blocks")[0].blocks.find(n=>n.slug===r.blockType),x=f(()=>{e.update(()=>{M(o).remove()})},[e,o]),p=f(n=>{if(l&&F(T())){n.preventDefault();let i=M(o);if(y(i))return i.remove(),!0}return!1},[l,o]),_=f(n=>{let i=n;return i.target===d.current||d.current?.contains(i.target)?(i.shiftKey?c(!l):l||(m(),c(!0)),!0):!1},[l,c,m]);K(()=>$(e.registerCommand(h,_,k),e.registerCommand(j,p,k),e.registerCommand(Y,p,k)),[m,e,l,o,p,c,_]);let g=t?.labels?.singular?N(t.labels.singular,b):t.slug;return D("div",{className:[s,s+"-"+r.blockType,l&&`${s}--selected`].filter(Boolean).join(" "),ref:d,children:[t?.admin?.components?.Label?a(A,{clientProps:{blockKind:"lexicalInlineBlock",formData:r},mappedComponent:t.admin.components.Label}):a("div",{children:N(t.labels?.singular,b)}),e.isEditable()&&D("div",{className:`${s}__actions`,children:[a(E,{buttonStyle:"icon-label",className:`${s}__editButton`,disabled:B?.admin?.readOnly,el:"div",icon:"edit",onClick:()=>{e.dispatchCommand(v,{fields:r,nodeKey:o})},round:!0,size:"small",tooltip:C("lexical:blocks:inlineBlocks:edit",{label:g})}),a(E,{buttonStyle:"icon-label",className:`${s}__removeButton`,disabled:B?.admin?.readOnly,icon:"x",onClick:n=>{n.preventDefault(),x()},round:!0,size:"small",tooltip:C("lexical:blocks:inlineBlocks:remove",{label:g})})]})]})};export{oe as InlineBlockComponent};
|
|
2
|
+
//# sourceMappingURL=componentInline-C2XIK5VZ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/blocks/client/componentInline/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport React, { useCallback, useEffect, useRef } from 'react'\nconst baseClass = 'inline-block'\n\nimport type { BlockFieldClient } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button, RenderComponent, useTranslation } 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'\n\nimport type { InlineBlockFields } from '../nodes/InlineBlocksNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js'\nimport { OPEN_INLINE_BLOCK_DRAWER_COMMAND } from '../plugin/commands.js'\ntype Props = {\n readonly formData: InlineBlockFields\n readonly nodeKey?: string\n}\n\nexport const InlineBlockComponent: React.FC<Props> = (props) => {\n const { formData, nodeKey } = props\n const [editor] = useLexicalComposerContext()\n const { i18n, t } = useTranslation<object, string>()\n const { field } = useEditorConfigContext()\n const inlineBlockElemElemRef = useRef<HTMLDivElement | null>(null)\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedBlockPath = `lexical_internal_feature.blocks.fields.lexical_inline_blocks`\n const blocksField: BlockFieldClient = richTextComponentMap.get(componentMapRenderedBlockPath)[0]\n const clientBlock = blocksField.blocks.find((block) => block.slug === formData.blockType)\n\n const removeInlineBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const $onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isInlineBlockNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n const onClick = useCallback(\n (payload: MouseEvent) => {\n const event = payload\n // Check if inlineBlockElemElemRef.target or anything WITHIN inlineBlockElemElemRef.target was clicked\n if (\n event.target === inlineBlockElemElemRef.current ||\n inlineBlockElemElemRef.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 [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 blockDisplayName = clientBlock?.labels?.singular\n ? getTranslation(clientBlock.labels.singular, i18n)\n : clientBlock.slug\n\n return (\n <div\n className={[\n baseClass,\n baseClass + '-' + formData.blockType,\n isSelected && `${baseClass}--selected`,\n ]\n .filter(Boolean)\n .join(' ')}\n ref={inlineBlockElemElemRef}\n >\n {clientBlock?.admin?.components?.Label ? (\n <RenderComponent\n clientProps={{ blockKind: 'lexicalInlineBlock', formData }}\n mappedComponent={clientBlock.admin.components.Label}\n />\n ) : (\n <div>{getTranslation(clientBlock.labels?.singular, i18n)}</div>\n )}\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__editButton`}\n disabled={field?.admin?.readOnly}\n el=\"div\"\n icon=\"edit\"\n onClick={() => {\n editor.dispatchCommand(OPEN_INLINE_BLOCK_DRAWER_COMMAND, {\n fields: formData,\n nodeKey,\n })\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\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 removeInlineBlock()\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:remove', { label: blockDisplayName })}\n />\n </div>\n )}\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "oGAEA,OAAgB,eAAAA,EAAa,aAAAC,EAAW,UAAAC,MAAc,QAKtD,OAAS,6BAAAC,MAAiC,wCAC1C,OAAS,2BAAAC,MAA+B,yCACxC,OAAS,iBAAAC,MAAqB,iBAC9B,OAAS,kBAAAC,MAAsB,2BAC/B,OAAS,UAAAC,EAAQ,mBAAAC,EAAiB,kBAAAC,MAAsB,iBACxD,OACE,iBAAAC,EACA,iBAAAC,EACA,oBAAAC,EACA,iBAAAC,EACA,wBAAAC,EACA,yBAAAC,EACA,sBAAAC,MACK,UAiGC,cAAAC,EAQA,QAAAC,MARA,oBAlHR,IAAMC,EAAY,eA6BLC,GAAyCC,GAAU,CAC9D,GAAM,CAAE,SAAAC,EAAU,QAAAC,CAAQ,EAAIF,EACxB,CAACG,CAAM,EAAIC,EAA0B,EACrC,CAAE,KAAAC,EAAM,EAAAC,CAAE,EAAIC,EAA+B,EAC7C,CAAE,MAAAC,CAAM,EAAIC,EAAuB,EACnCC,EAAyBC,EAA8B,IAAI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Y,IAAMG,EAAS,UAC3BW,GAAc,GAAGd,CAAS,YAC5B,EACG,OAAO,OAAO,EACd,KAAK,GAAG,EACX,IAAKY,EAEJ,UAAAO,GAAa,OAAO,YAAY,MAC/BrB,EAAC0C,EAAA,CACC,YAAa,CAAE,UAAW,qBAAsB,SAAArC,CAAS,EACzD,gBAAiBgB,EAAY,MAAM,WAAW,MAChD,EAEArB,EAAC,OAAK,SAAAyC,EAAepB,EAAY,QAAQ,SAAUZ,CAAI,EAAE,EAE1DF,EAAO,WAAW,GACjBN,EAAC,OAAI,UAAW,GAAGC,CAAS,YAC1B,UAAAF,EAAC2C,EAAA,CACC,YAAY,aACZ,UAAW,GAAGzC,CAAS,eACvB,SAAUU,GAAO,OAAO,SACxB,GAAG,MACH,KAAK,OACL,QAAS,IAAM,CACbL,EAAO,gBAAgBqC,EAAkC,CACvD,OAAQvC,EACR,QAAAC,CACF,CAAC,CACH,EACA,MAAK,GACL,KAAK,QACL,QAASI,EAAE,mCAAoC,CAAE,MAAO8B,CAAiB,CAAC,EAC5E,EACAxC,EAAC2C,EAAA,CACC,YAAY,aACZ,UAAW,GAAGzC,CAAS,iBACvB,SAAUU,GAAO,OAAO,SACxB,KAAK,IACL,QAAUiC,GAAM,CACdA,EAAE,eAAe,EACjBtB,EAAkB,CACpB,EACA,MAAK,GACL,KAAK,QACL,QAASb,EAAE,qCAAsC,CAAE,MAAO8B,CAAiB,CAAC,EAC9E,GACF,GAEJ,CAEJ",
|
|
6
|
+
"names": ["useCallback", "useEffect", "useRef", "useLexicalComposerContext", "useLexicalNodeSelection", "mergeRegister", "getTranslation", "Button", "RenderComponent", "useTranslation", "$getNodeByKey", "$getSelection", "$isNodeSelection", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "jsx", "jsxs", "baseClass", "InlineBlockComponent", "props", "formData", "nodeKey", "editor", "useLexicalComposerContext", "i18n", "t", "useTranslation", "field", "useEditorConfigContext", "inlineBlockElemElemRef", "useRef", "isSelected", "setSelected", "clearSelection", "useLexicalNodeSelection", "richTextComponentMap", "clientBlock", "block", "removeInlineBlock", "useCallback", "$getNodeByKey", "$onDelete", "event", "$isNodeSelection", "$getSelection", "node", "$isInlineBlockNode", "onClick", "payload", "useEffect", "mergeRegister", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_DELETE_COMMAND", "KEY_BACKSPACE_COMMAND", "blockDisplayName", "getTranslation", "RenderComponent", "Button", "OPEN_INLINE_BLOCK_DRAWER_COMMAND", "e"]
|
|
7
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { slashMenuBasicGroupWithItems } from '../../features/shared/slashMenu/basicGroup.js';
|
|
2
2
|
export { RichTextCell } from '../../cell/index.js';
|
|
3
|
-
export { AlignFeatureClient } from '../../features/align/
|
|
4
|
-
export { BlockquoteFeatureClient } from '../../features/blockquote/
|
|
5
|
-
export { BlocksFeatureClient } from '../../features/blocks/
|
|
3
|
+
export { AlignFeatureClient } from '../../features/align/client/index.js';
|
|
4
|
+
export { BlockquoteFeatureClient } from '../../features/blockquote/client/index.js';
|
|
5
|
+
export { BlocksFeatureClient } from '../../features/blocks/client/index.js';
|
|
6
6
|
export { createClientComponent } from '../../features/createClientComponent.js';
|
|
7
|
-
export { TestRecorderFeatureClient } from '../../features/debug/testRecorder/
|
|
8
|
-
export { TreeViewFeatureClient } from '../../features/debug/treeView/
|
|
7
|
+
export { TestRecorderFeatureClient } from '../../features/debug/testRecorder/client/index.js';
|
|
8
|
+
export { TreeViewFeatureClient } from '../../features/debug/treeView/client/index.js';
|
|
9
9
|
export { BoldFeatureClient } from '../../features/format/bold/feature.client.js';
|
|
10
10
|
export { InlineCodeFeatureClient } from '../../features/format/inlineCode/feature.client.js';
|
|
11
11
|
export { ItalicFeatureClient } from '../../features/format/italic/feature.client.js';
|
|
@@ -13,27 +13,27 @@ export { StrikethroughFeatureClient } from '../../features/format/strikethrough/
|
|
|
13
13
|
export { SubscriptFeatureClient } from '../../features/format/subscript/feature.client.js';
|
|
14
14
|
export { SuperscriptFeatureClient } from '../../features/format/superscript/feature.client.js';
|
|
15
15
|
export { UnderlineFeatureClient } from '../../features/format/underline/feature.client.js';
|
|
16
|
-
export { HeadingFeatureClient } from '../../features/heading/
|
|
17
|
-
export { HorizontalRuleFeatureClient } from '../../features/horizontalRule/
|
|
18
|
-
export { IndentFeatureClient } from '../../features/indent/
|
|
19
|
-
export { LinkFeatureClient } from '../../features/link/
|
|
20
|
-
export { ChecklistFeatureClient } from '../../features/lists/checklist/
|
|
21
|
-
export { OrderedListFeatureClient } from '../../features/lists/orderedList/
|
|
22
|
-
export { UnorderedListFeatureClient } from '../../features/lists/unorderedList/
|
|
16
|
+
export { HeadingFeatureClient } from '../../features/heading/client/index.js';
|
|
17
|
+
export { HorizontalRuleFeatureClient } from '../../features/horizontalRule/client/index.js';
|
|
18
|
+
export { IndentFeatureClient } from '../../features/indent/client/index.js';
|
|
19
|
+
export { LinkFeatureClient } from '../../features/link/client/index.js';
|
|
20
|
+
export { ChecklistFeatureClient } from '../../features/lists/checklist/client/index.js';
|
|
21
|
+
export { OrderedListFeatureClient } from '../../features/lists/orderedList/client/index.js';
|
|
22
|
+
export { UnorderedListFeatureClient } from '../../features/lists/unorderedList/client/index.js';
|
|
23
23
|
export { LexicalPluginToLexicalFeatureClient } from '../../features/migrations/lexicalPluginToLexical/feature.client.js';
|
|
24
24
|
export { SlateToLexicalFeatureClient } from '../../features/migrations/slateToLexical/feature.client.js';
|
|
25
|
-
export { ParagraphFeatureClient } from '../../features/paragraph/
|
|
26
|
-
export { RelationshipFeatureClient } from '../../features/relationship/
|
|
25
|
+
export { ParagraphFeatureClient } from '../../features/paragraph/client/index.js';
|
|
26
|
+
export { RelationshipFeatureClient } from '../../features/relationship/client/index.js';
|
|
27
27
|
export { toolbarFormatGroupWithItems } from '../../features/format/shared/toolbarFormatGroup.js';
|
|
28
28
|
export { toolbarAddDropdownGroupWithItems } from '../../features/shared/toolbar/addDropdownGroup.js';
|
|
29
29
|
export { toolbarFeatureButtonsGroupWithItems } from '../../features/shared/toolbar/featureButtonsGroup.js';
|
|
30
30
|
export { toolbarTextDropdownGroupWithItems } from '../../features/shared/toolbar/textDropdownGroup.js';
|
|
31
|
-
export { FixedToolbarFeatureClient } from '../../features/toolbars/fixed/
|
|
32
|
-
export { InlineToolbarFeatureClient } from '../../features/toolbars/inline/
|
|
31
|
+
export { FixedToolbarFeatureClient } from '../../features/toolbars/fixed/client/index.js';
|
|
32
|
+
export { InlineToolbarFeatureClient } from '../../features/toolbars/inline/client/index.js';
|
|
33
33
|
export { ToolbarButton } from '../../features/toolbars/shared/ToolbarButton/index.js';
|
|
34
|
-
export { TableFeatureClient } from '../../features/experimental_table/
|
|
34
|
+
export { TableFeatureClient } from '../../features/experimental_table/client/index.js';
|
|
35
35
|
export { ToolbarDropdown } from '../../features/toolbars/shared/ToolbarDropdown/index.js';
|
|
36
|
-
export { UploadFeatureClient } from '../../features/upload/feature.client.js';
|
|
36
|
+
export { UploadFeatureClient } from '../../features/upload/client/feature.client.js';
|
|
37
37
|
export { RichTextField } from '../../field/index.js';
|
|
38
38
|
export { EditorConfigProvider, useEditorConfigContext, } from '../../lexical/config/client/EditorConfigProvider.js';
|
|
39
39
|
export { defaultEditorLexicalConfig } from '../../lexical/config/client/default.js';
|
|
@@ -42,7 +42,6 @@ export { CAN_USE_DOM } from '../../lexical/utils/canUseDOM.js';
|
|
|
42
42
|
export { getDOMRangeRect } from '../../lexical/utils/getDOMRangeRect.js';
|
|
43
43
|
export { getSelectedNode } from '../../lexical/utils/getSelectedNode.js';
|
|
44
44
|
export { isHTMLElement } from '../../lexical/utils/guard.js';
|
|
45
|
-
export { invariant } from '../../lexical/utils/invariant.js';
|
|
46
45
|
export { joinClasses } from '../../lexical/utils/joinClasses.js';
|
|
47
46
|
export { createBlockNode } from '../../lexical/utils/markdown/createBlockNode.js';
|
|
48
47
|
export { Point, isPoint } from '../../lexical/utils/point.js';
|
|
@@ -54,10 +53,10 @@ export { createClientFeature } from '../../utilities/createClientFeature.js';
|
|
|
54
53
|
export { DETAIL_TYPE_TO_DETAIL, DOUBLE_LINE_BREAK, ELEMENT_FORMAT_TO_TYPE, ELEMENT_TYPE_TO_FORMAT, IS_ALL_FORMATTING, LTR_REGEX, NON_BREAKING_SPACE, NodeFormat, RTL_REGEX, TEXT_MODE_TO_TYPE, TEXT_TYPE_TO_FORMAT, TEXT_TYPE_TO_MODE, } from '../../lexical/utils/nodeFormat.js';
|
|
55
54
|
export { ENABLE_SLASH_MENU_COMMAND } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js';
|
|
56
55
|
export { getEnabledNodes } from '../../lexical/nodes/index.js';
|
|
57
|
-
export { $createUploadNode, $isUploadNode, UploadNode, } from '../../features/upload/nodes/UploadNode.js';
|
|
58
|
-
export { $createRelationshipNode, $isRelationshipNode, RelationshipNode, } from '../../features/relationship/nodes/RelationshipNode.js';
|
|
56
|
+
export { $createUploadNode, $isUploadNode, UploadNode, } from '../../features/upload/client/nodes/UploadNode.js';
|
|
57
|
+
export { $createRelationshipNode, $isRelationshipNode, RelationshipNode, } from '../../features/relationship/client/nodes/RelationshipNode.js';
|
|
59
58
|
export { $createLinkNode, $isLinkNode, LinkNode, TOGGLE_LINK_COMMAND, } from '../../features/link/nodes/LinkNode.js';
|
|
60
59
|
export { $createAutoLinkNode, $isAutoLinkNode, AutoLinkNode, } from '../../features/link/nodes/AutoLinkNode.js';
|
|
61
|
-
export { $createBlockNode, $isBlockNode, BlockNode, } from '../../features/blocks/nodes/BlocksNode.js';
|
|
60
|
+
export { $createBlockNode, $isBlockNode, BlockNode, } from '../../features/blocks/client/nodes/BlocksNode.js';
|
|
62
61
|
export { FieldsDrawer } from '../../utilities/fieldsDrawer/Drawer.js';
|
|
63
62
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAA;AAE5F,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAA;AAE5F,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAA;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAA;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAA;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAA;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAA;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAA;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uDAAuD,CAAA;AAClG,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAA;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAA;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAA;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAA;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAA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