@payloadcms/richtext-lexical 3.0.0-beta.85 → 3.0.0-beta.87
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 +117 -127
- package/dist/cell/index.js.map +1 -1
- package/dist/exports/client/Component-DOSSWC76.js +2 -0
- package/dist/exports/client/Component-DOSSWC76.js.map +7 -0
- package/dist/exports/client/Component-MBLHTKDK.js +2 -0
- package/dist/exports/client/Component-MBLHTKDK.js.map +7 -0
- package/dist/exports/client/Field-63NGLPJB.js +2 -0
- package/dist/exports/client/Field-63NGLPJB.js.map +7 -0
- package/dist/exports/client/RelationshipComponent-3QWBV4GT.js +2 -0
- package/dist/exports/client/RelationshipComponent-3QWBV4GT.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-G5DTIOPI.js +2 -0
- package/dist/exports/client/chunk-G5DTIOPI.js.map +7 -0
- package/dist/exports/client/chunk-LGUXX2QH.js +2 -0
- package/dist/exports/client/chunk-LGUXX2QH.js.map +7 -0
- package/dist/exports/client/chunk-NI6Z4GBD.js +2 -0
- package/dist/exports/client/{chunk-SQHN3N6E.js.map → chunk-NI6Z4GBD.js.map} +2 -2
- package/dist/exports/client/chunk-OKMIHD2R.js +2 -0
- package/dist/exports/client/chunk-OKMIHD2R.js.map +7 -0
- package/dist/exports/client/chunk-TO2W7Q2G.js +2 -0
- package/dist/exports/client/chunk-TO2W7Q2G.js.map +7 -0
- package/dist/exports/client/chunk-V2LKLT2F.js +3 -0
- package/dist/exports/client/chunk-V2LKLT2F.js.map +7 -0
- package/dist/exports/client/component-3OFD6Q4Z.js +2 -0
- package/dist/exports/client/component-3OFD6Q4Z.js.map +7 -0
- package/dist/exports/client/component-LCAAX56T.js +2 -0
- package/dist/exports/client/component-LCAAX56T.js.map +7 -0
- package/dist/exports/client/component-LLWMZU6K.js +2 -0
- package/dist/exports/client/component-LLWMZU6K.js.map +7 -0
- package/dist/exports/client/componentInline-72VZAAHP.js +2 -0
- package/dist/exports/client/componentInline-72VZAAHP.js.map +7 -0
- package/dist/exports/client/index.js +9 -9
- package/dist/exports/client/index.js.map +3 -3
- package/dist/exports/server/migrate.js +0 -1
- package/dist/exports/server/migrate.js.map +1 -1
- package/dist/features/align/client/index.js +151 -134
- package/dist/features/align/client/index.js.map +1 -1
- package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
- package/dist/features/align/client/toolbarAlignGroup.js +10 -9
- package/dist/features/align/client/toolbarAlignGroup.js.map +1 -1
- package/dist/features/align/server/i18n.js +192 -193
- package/dist/features/align/server/i18n.js.map +1 -1
- package/dist/features/align/server/index.js +5 -6
- package/dist/features/align/server/index.js.map +1 -1
- package/dist/features/blockquote/client/index.js +60 -65
- package/dist/features/blockquote/client/index.js.map +1 -1
- package/dist/features/blockquote/markdownTransformer.js +28 -34
- package/dist/features/blockquote/markdownTransformer.js.map +1 -1
- package/dist/features/blockquote/server/i18n.js +96 -97
- package/dist/features/blockquote/server/i18n.js.map +1 -1
- package/dist/features/blockquote/server/index.js +38 -37
- package/dist/features/blockquote/server/index.js.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.js +166 -172
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/blocks/client/component/FormSavePlugin.d.ts.map +1 -1
- package/dist/features/blocks/client/component/FormSavePlugin.js +46 -22
- package/dist/features/blocks/client/component/FormSavePlugin.js.map +1 -1
- package/dist/features/blocks/client/component/index.js +130 -142
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +1 -1
- package/dist/features/blocks/client/component/removeEmptyArrayValues.js +12 -8
- package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +106 -122
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/index.js +149 -142
- package/dist/features/blocks/client/index.js.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.js +41 -40
- package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/InlineBlocksNode.js +31 -30
- package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/blocks/client/plugin/commands.d.ts.map +1 -1
- package/dist/features/blocks/client/plugin/commands.js +2 -1
- package/dist/features/blocks/client/plugin/commands.js.map +1 -1
- package/dist/features/blocks/client/plugin/index.js +179 -106
- package/dist/features/blocks/client/plugin/index.js.map +1 -1
- package/dist/features/blocks/server/graphQLPopulationPromise.js +41 -28
- package/dist/features/blocks/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/blocks/server/i18n.js +288 -289
- package/dist/features/blocks/server/i18n.js.map +1 -1
- package/dist/features/blocks/server/index.js +149 -151
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.js +76 -73
- package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js +78 -76
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/blocks/server/validate.js +45 -34
- package/dist/features/blocks/server/validate.js.map +1 -1
- package/dist/features/converters/html/converter/converters/linebreak.js +4 -7
- package/dist/features/converters/html/converter/converters/linebreak.js.map +1 -1
- package/dist/features/converters/html/converter/converters/paragraph.js +24 -19
- package/dist/features/converters/html/converter/converters/paragraph.js.map +1 -1
- package/dist/features/converters/html/converter/converters/text.js +28 -29
- package/dist/features/converters/html/converter/converters/text.js.map +1 -1
- package/dist/features/converters/html/converter/defaultConverters.js +1 -6
- package/dist/features/converters/html/converter/defaultConverters.js.map +1 -1
- package/dist/features/converters/html/converter/index.js +66 -51
- package/dist/features/converters/html/converter/index.js.map +1 -1
- package/dist/features/converters/html/converter/types.js +1 -2
- package/dist/features/converters/html/converter/types.js.map +1 -1
- package/dist/features/converters/html/field/index.js +134 -139
- package/dist/features/converters/html/field/index.js.map +1 -1
- package/dist/features/converters/html/index.js +2 -3
- package/dist/features/converters/html/index.js.map +1 -1
- package/dist/features/createClientComponent.js +7 -6
- package/dist/features/createClientComponent.js.map +1 -1
- package/dist/features/createFeaturePropComponent.js +14 -13
- package/dist/features/createFeaturePropComponent.js.map +1 -1
- package/dist/features/debug/testRecorder/client/index.js +5 -7
- package/dist/features/debug/testRecorder/client/index.js.map +1 -1
- package/dist/features/debug/testRecorder/client/plugin/index.js +518 -402
- package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
- package/dist/features/debug/testRecorder/server/index.js +4 -5
- package/dist/features/debug/testRecorder/server/index.js.map +1 -1
- package/dist/features/debug/treeView/client/index.js +5 -7
- package/dist/features/debug/treeView/client/index.js.map +1 -1
- package/dist/features/debug/treeView/client/plugin/index.js +21 -11
- package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
- package/dist/features/debug/treeView/server/index.js +4 -5
- package/dist/features/debug/treeView/server/index.js.map +1 -1
- package/dist/features/experimental_table/client/index.js +41 -58
- package/dist/features/experimental_table/client/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +714 -560
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +295 -301
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -7
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +228 -159
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +129 -82
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/utils/debounce.d.ts.map +1 -1
- package/dist/features/experimental_table/client/utils/debounce.js +108 -89
- package/dist/features/experimental_table/client/utils/debounce.js.map +1 -1
- package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +1 -1
- package/dist/features/experimental_table/client/utils/useDebounce.js +11 -13
- package/dist/features/experimental_table/client/utils/useDebounce.js.map +1 -1
- package/dist/features/experimental_table/server/index.js +127 -114
- package/dist/features/experimental_table/server/index.js.map +1 -1
- package/dist/features/format/bold/feature.client.js +34 -35
- package/dist/features/format/bold/feature.client.js.map +1 -1
- package/dist/features/format/bold/feature.server.js +14 -18
- package/dist/features/format/bold/feature.server.js.map +1 -1
- package/dist/features/format/bold/markdownTransformers.js +14 -25
- package/dist/features/format/bold/markdownTransformers.js.map +1 -1
- package/dist/features/format/inlineCode/feature.client.js +26 -28
- package/dist/features/format/inlineCode/feature.client.js.map +1 -1
- package/dist/features/format/inlineCode/feature.server.js +5 -8
- package/dist/features/format/inlineCode/feature.server.js.map +1 -1
- package/dist/features/format/inlineCode/markdownTransformers.js +3 -6
- package/dist/features/format/inlineCode/markdownTransformers.js.map +1 -1
- package/dist/features/format/italic/feature.client.js +26 -29
- package/dist/features/format/italic/feature.client.js.map +1 -1
- package/dist/features/format/italic/feature.server.js +5 -9
- package/dist/features/format/italic/feature.server.js.map +1 -1
- package/dist/features/format/italic/markdownTransformers.js +7 -12
- package/dist/features/format/italic/markdownTransformers.js.map +1 -1
- package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
- package/dist/features/format/shared/toolbarFormatGroup.js +9 -8
- package/dist/features/format/shared/toolbarFormatGroup.js.map +1 -1
- package/dist/features/format/strikethrough/feature.client.js +26 -28
- package/dist/features/format/strikethrough/feature.client.js.map +1 -1
- package/dist/features/format/strikethrough/feature.server.js +5 -8
- package/dist/features/format/strikethrough/feature.server.js.map +1 -1
- package/dist/features/format/strikethrough/markdownTransformers.js +3 -6
- package/dist/features/format/strikethrough/markdownTransformers.js.map +1 -1
- package/dist/features/format/subscript/feature.client.js +25 -25
- package/dist/features/format/subscript/feature.client.js.map +1 -1
- package/dist/features/format/subscript/feature.server.js +4 -5
- package/dist/features/format/subscript/feature.server.js.map +1 -1
- package/dist/features/format/superscript/feature.client.js +25 -25
- package/dist/features/format/superscript/feature.client.js.map +1 -1
- package/dist/features/format/superscript/feature.server.js +4 -5
- package/dist/features/format/superscript/feature.server.js.map +1 -1
- package/dist/features/format/underline/feature.client.js +25 -25
- package/dist/features/format/underline/feature.client.js.map +1 -1
- package/dist/features/format/underline/feature.server.js +4 -5
- package/dist/features/format/underline/feature.server.js.map +1 -1
- package/dist/features/heading/client/index.js +86 -90
- package/dist/features/heading/client/index.js.map +1 -1
- package/dist/features/heading/markdownTransformer.js +22 -25
- package/dist/features/heading/markdownTransformer.js.map +1 -1
- package/dist/features/heading/server/i18n.js +96 -97
- package/dist/features/heading/server/i18n.js.map +1 -1
- package/dist/features/heading/server/index.js +49 -51
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/horizontalRule/client/component/index.js +81 -51
- package/dist/features/horizontalRule/client/component/index.js.map +1 -1
- package/dist/features/horizontalRule/client/index.js +48 -57
- package/dist/features/horizontalRule/client/index.js.map +1 -1
- package/dist/features/horizontalRule/client/markdownTransformer.js +15 -18
- package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +33 -30
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/horizontalRule/client/plugin/index.js +31 -20
- package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
- package/dist/features/horizontalRule/server/i18n.js +96 -97
- package/dist/features/horizontalRule/server/i18n.js.map +1 -1
- package/dist/features/horizontalRule/server/index.js +17 -24
- package/dist/features/horizontalRule/server/index.js.map +1 -1
- package/dist/features/horizontalRule/server/markdownTransformer.js +15 -18
- package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +71 -66
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/indent/client/index.js +52 -47
- package/dist/features/indent/client/index.js.map +1 -1
- package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
- package/dist/features/indent/client/toolbarIndentGroup.js +9 -8
- package/dist/features/indent/client/toolbarIndentGroup.js.map +1 -1
- package/dist/features/indent/server/i18n.js +128 -129
- package/dist/features/indent/server/i18n.js.map +1 -1
- package/dist/features/indent/server/index.js +5 -6
- package/dist/features/indent/server/index.js.map +1 -1
- package/dist/features/link/client/index.js +78 -83
- package/dist/features/link/client/index.js.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.js +267 -271
- package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
- package/dist/features/link/client/plugins/clickableLink/index.js +3 -3
- package/dist/features/link/client/plugins/clickableLink/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.js +2 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +254 -276
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js +8 -6
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/types.js +1 -2
- package/dist/features/link/client/plugins/floatingLinkEditor/types.js.map +1 -1
- package/dist/features/link/client/plugins/link/index.js +50 -41
- package/dist/features/link/client/plugins/link/index.js.map +1 -1
- package/dist/features/link/markdownTransformer.js +38 -39
- package/dist/features/link/markdownTransformer.js.map +1 -1
- package/dist/features/link/nodes/AutoLinkNode.js +57 -56
- package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
- package/dist/features/link/nodes/LinkNode.js +277 -276
- package/dist/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/features/link/nodes/types.js +1 -2
- package/dist/features/link/nodes/types.js.map +1 -1
- package/dist/features/link/server/baseFields.js +118 -88
- package/dist/features/link/server/baseFields.js.map +1 -1
- package/dist/features/link/server/graphQLPopulationPromise.js +42 -28
- package/dist/features/link/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/link/server/i18n.js +96 -97
- package/dist/features/link/server/i18n.js.map +1 -1
- package/dist/features/link/server/index.js +120 -114
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/link/server/transformExtraFields.js +15 -15
- package/dist/features/link/server/transformExtraFields.js.map +1 -1
- package/dist/features/link/server/validate.js +37 -26
- package/dist/features/link/server/validate.js.map +1 -1
- package/dist/features/lists/checklist/client/index.js +77 -85
- package/dist/features/lists/checklist/client/index.js.map +1 -1
- package/dist/features/lists/checklist/client/plugin/index.js +3 -3
- package/dist/features/lists/checklist/client/plugin/index.js.map +1 -1
- package/dist/features/lists/checklist/markdownTransformers.js +7 -11
- package/dist/features/lists/checklist/markdownTransformers.js.map +1 -1
- package/dist/features/lists/checklist/server/i18n.js +96 -97
- package/dist/features/lists/checklist/server/i18n.js.map +1 -1
- package/dist/features/lists/checklist/server/index.js +21 -25
- package/dist/features/lists/checklist/server/index.js.map +1 -1
- package/dist/features/lists/htmlConverter.js +54 -43
- package/dist/features/lists/htmlConverter.js.map +1 -1
- package/dist/features/lists/orderedList/client/index.js +71 -77
- package/dist/features/lists/orderedList/client/index.js.map +1 -1
- package/dist/features/lists/orderedList/markdownTransformer.js +7 -11
- package/dist/features/lists/orderedList/markdownTransformer.js.map +1 -1
- package/dist/features/lists/orderedList/server/i18n.js +96 -97
- package/dist/features/lists/orderedList/server/i18n.js.map +1 -1
- package/dist/features/lists/orderedList/server/index.js +21 -25
- package/dist/features/lists/orderedList/server/index.js.map +1 -1
- package/dist/features/lists/plugin/index.js +3 -3
- package/dist/features/lists/plugin/index.js.map +1 -1
- package/dist/features/lists/shared/markdown.js +48 -49
- package/dist/features/lists/shared/markdown.js.map +1 -1
- package/dist/features/lists/shared/slashMenuListGroup.js +9 -8
- package/dist/features/lists/shared/slashMenuListGroup.js.map +1 -1
- package/dist/features/lists/unorderedList/client/index.js +68 -76
- package/dist/features/lists/unorderedList/client/index.js.map +1 -1
- package/dist/features/lists/unorderedList/markdownTransformer.js +7 -11
- package/dist/features/lists/unorderedList/markdownTransformer.js.map +1 -1
- package/dist/features/lists/unorderedList/server/i18n.js +96 -97
- package/dist/features/lists/unorderedList/server/i18n.js.map +1 -1
- package/dist/features/lists/unorderedList/server/index.js +17 -23
- package/dist/features/lists/unorderedList/server/index.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js +18 -17
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js +30 -29
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js +21 -20
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js +21 -19
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js +18 -17
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js +24 -23
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +20 -21
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js +1 -10
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +69 -61
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.js +1 -2
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.js +5 -7
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.js +42 -43
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +11 -11
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +64 -59
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js +19 -19
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js +20 -25
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js +28 -30
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js +26 -26
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js +22 -21
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js +22 -22
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js +12 -13
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js +23 -23
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js +22 -22
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js +15 -16
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.js +1 -13
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/index.js +105 -98
- package/dist/features/migrations/slateToLexical/converter/index.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/types.js +1 -2
- package/dist/features/migrations/slateToLexical/converter/types.js.map +1 -1
- package/dist/features/migrations/slateToLexical/feature.client.js +7 -7
- package/dist/features/migrations/slateToLexical/feature.client.js.map +1 -1
- package/dist/features/migrations/slateToLexical/feature.server.js +43 -44
- package/dist/features/migrations/slateToLexical/feature.server.js.map +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +11 -11
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +64 -59
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/features/paragraph/client/index.js +58 -61
- package/dist/features/paragraph/client/index.js.map +1 -1
- package/dist/features/paragraph/server/i18n.js +128 -129
- package/dist/features/paragraph/server/i18n.js.map +1 -1
- package/dist/features/paragraph/server/index.js +6 -7
- package/dist/features/paragraph/server/index.js.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.js +141 -149
- package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
- package/dist/features/relationship/client/drawer/commands.js +0 -1
- package/dist/features/relationship/client/drawer/commands.js.map +1 -1
- package/dist/features/relationship/client/drawer/index.js +138 -67
- package/dist/features/relationship/client/drawer/index.js.map +1 -1
- package/dist/features/relationship/client/index.js +53 -59
- package/dist/features/relationship/client/index.js.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.js +60 -59
- package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +90 -35
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.d.ts.map +1 -1
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +97 -26
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.js +34 -26
- package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/relationship/server/i18n.js +96 -97
- package/dist/features/relationship/server/i18n.js.map +1 -1
- package/dist/features/relationship/server/index.js +48 -44
- package/dist/features/relationship/server/index.js.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.js +90 -87
- package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/shared/slashMenu/basicGroup.js +9 -8
- package/dist/features/shared/slashMenu/basicGroup.js.map +1 -1
- package/dist/features/shared/toolbar/addDropdownGroup.js +8 -9
- package/dist/features/shared/toolbar/addDropdownGroup.js.map +1 -1
- package/dist/features/shared/toolbar/featureButtonsGroup.js +7 -8
- package/dist/features/shared/toolbar/featureButtonsGroup.js.map +1 -1
- package/dist/features/shared/toolbar/textDropdownGroup.js +8 -9
- package/dist/features/shared/toolbar/textDropdownGroup.js.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +264 -187
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/fixed/client/index.js +5 -7
- package/dist/features/toolbars/fixed/client/index.js.map +1 -1
- package/dist/features/toolbars/fixed/server/index.js +14 -13
- package/dist/features/toolbars/fixed/server/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.js +374 -286
- package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/index.js +5 -7
- package/dist/features/toolbars/inline/client/index.js.map +1 -1
- package/dist/features/toolbars/inline/server/index.js +4 -5
- package/dist/features/toolbars/inline/server/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +75 -97
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +190 -211
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +289 -124
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/features/toolbars/types.js +1 -2
- package/dist/features/toolbars/types.js.map +1 -1
- package/dist/features/typeUtilities.js +2 -3
- package/dist/features/typeUtilities.js.map +1 -1
- package/dist/features/typesClient.js +1 -2
- package/dist/features/typesClient.js.map +1 -1
- package/dist/features/typesServer.js +1 -2
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/component/index.js +208 -224
- package/dist/features/upload/client/component/index.js.map +1 -1
- package/dist/features/upload/client/drawer/commands.js +1 -1
- package/dist/features/upload/client/drawer/commands.js.map +1 -1
- package/dist/features/upload/client/drawer/index.js +107 -58
- package/dist/features/upload/client/drawer/index.js.map +1 -1
- package/dist/features/upload/client/feature.client.js +51 -61
- package/dist/features/upload/client/feature.client.js.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.js +76 -73
- package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/client/plugin/index.js +67 -39
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/feature.server.js +190 -171
- package/dist/features/upload/server/feature.server.js.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js +60 -47
- package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/upload/server/i18n.js +96 -97
- package/dist/features/upload/server/i18n.js.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.js +113 -108
- package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/server/validate.js +53 -40
- package/dist/features/upload/server/validate.js.map +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +127 -105
- package/dist/field/Field.js.map +1 -1
- package/dist/field/bundled.css +1 -0
- package/dist/field/index.js +92 -36
- package/dist/field/index.js.map +1 -1
- package/dist/i18n.js +160 -161
- package/dist/i18n.js.map +1 -1
- package/dist/index.js +670 -623
- package/dist/index.js.map +1 -1
- package/dist/lexical/EditorPlugin.d.ts.map +1 -1
- package/dist/lexical/EditorPlugin.js +15 -10
- package/dist/lexical/EditorPlugin.js.map +1 -1
- package/dist/lexical/LexicalEditor.js +206 -161
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/LexicalProvider.js +83 -82
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.js +76 -79
- package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
- package/dist/lexical/config/client/default.js +3 -3
- package/dist/lexical/config/client/default.js.map +1 -1
- package/dist/lexical/config/client/loader.js +42 -39
- package/dist/lexical/config/client/loader.js.map +1 -1
- package/dist/lexical/config/client/sanitize.js +165 -165
- package/dist/lexical/config/client/sanitize.js.map +1 -1
- package/dist/lexical/config/server/default.js +5 -27
- package/dist/lexical/config/server/default.js.map +1 -1
- package/dist/lexical/config/server/loader.js +103 -103
- package/dist/lexical/config/server/loader.js.map +1 -1
- package/dist/lexical/config/server/sanitize.js +98 -99
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/config/types.js +1 -2
- package/dist/lexical/config/types.js.map +1 -1
- package/dist/lexical/nodes/index.js +9 -8
- package/dist/lexical/nodes/index.js.map +1 -1
- package/dist/lexical/plugins/MarkdownShortcut/index.js +17 -5
- package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +384 -361
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +223 -160
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -2
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.js +191 -179
- package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js +41 -26
- package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +164 -129
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js +11 -10
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js +11 -10
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js +27 -23
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +331 -300
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +110 -97
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +23 -16
- package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +18 -27
- package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/getCollapsedMargins.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/getCollapsedMargins.js +15 -11
- package/dist/lexical/plugins/handles/utils/getCollapsedMargins.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js +133 -118
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +3 -2
- package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/isOnHandleElement.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/isOnHandleElement.js +3 -2
- package/dist/lexical/plugins/handles/utils/isOnHandleElement.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/setHandlePosition.js +26 -25
- package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
- package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
- package/dist/lexical/theme/EditorTheme.js +97 -102
- package/dist/lexical/theme/EditorTheme.js.map +1 -1
- package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +27 -10
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/lexical/ui/icons/AI/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AI/index.js +31 -33
- package/dist/lexical/ui/icons/AI/index.js.map +1 -1
- package/dist/lexical/ui/icons/Add/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Add/index.js +16 -18
- package/dist/lexical/ui/icons/Add/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignCenter/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignCenter/index.js +25 -28
- package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignJustify/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignJustify/index.js +25 -28
- package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignLeft/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignLeft/index.js +25 -28
- package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignRight/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignRight/index.js +25 -28
- package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
- package/dist/lexical/ui/icons/Block/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Block/index.js +34 -37
- package/dist/lexical/ui/icons/Block/index.js.map +1 -1
- package/dist/lexical/ui/icons/Blockquote/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Blockquote/index.js +16 -15
- package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
- package/dist/lexical/ui/icons/Bold/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Bold/index.js +16 -15
- package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
- package/dist/lexical/ui/icons/Checklist/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Checklist/index.js +24 -26
- package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
- package/dist/lexical/ui/icons/Code/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Code/index.js +19 -21
- package/dist/lexical/ui/icons/Code/index.js.map +1 -1
- package/dist/lexical/ui/icons/CodeBlock/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/CodeBlock/index.js +19 -21
- package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
- package/dist/lexical/ui/icons/H1/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H1/index.js +16 -15
- package/dist/lexical/ui/icons/H1/index.js.map +1 -1
- package/dist/lexical/ui/icons/H2/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H2/index.js +16 -15
- package/dist/lexical/ui/icons/H2/index.js.map +1 -1
- package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H3/index.js +16 -15
- package/dist/lexical/ui/icons/H3/index.js.map +1 -1
- package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H4/index.js +16 -15
- package/dist/lexical/ui/icons/H4/index.js.map +1 -1
- package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H5/index.js +16 -15
- package/dist/lexical/ui/icons/H5/index.js.map +1 -1
- package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H6/index.js +16 -15
- package/dist/lexical/ui/icons/H6/index.js.map +1 -1
- package/dist/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/HorizontalRule/index.js +19 -18
- package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
- package/dist/lexical/ui/icons/IndentDecrease/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/IndentDecrease/index.js +28 -32
- package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
- package/dist/lexical/ui/icons/IndentIncrease/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/IndentIncrease/index.js +28 -32
- package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
- package/dist/lexical/ui/icons/InlineBlocks/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/InlineBlocks/index.js +18 -17
- package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
- package/dist/lexical/ui/icons/Italic/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Italic/index.js +16 -15
- package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
- package/dist/lexical/ui/icons/Link/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Link/index.js +17 -16
- package/dist/lexical/ui/icons/Link/index.js.map +1 -1
- package/dist/lexical/ui/icons/Meatballs/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Meatballs/index.js +19 -22
- package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
- package/dist/lexical/ui/icons/OrderedList/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/OrderedList/index.js +31 -36
- package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
- package/dist/lexical/ui/icons/Relationship/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Relationship/index.js +31 -33
- package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
- package/dist/lexical/ui/icons/Strikethrough/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Strikethrough/index.js +19 -21
- package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
- package/dist/lexical/ui/icons/Subscript/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Subscript/index.js +16 -15
- package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
- package/dist/lexical/ui/icons/Superscript/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Superscript/index.js +16 -15
- package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
- package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Table/index.js +17 -16
- package/dist/lexical/ui/icons/Table/index.js.map +1 -1
- package/dist/lexical/ui/icons/Text/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Text/index.js +16 -15
- package/dist/lexical/ui/icons/Text/index.js.map +1 -1
- package/dist/lexical/ui/icons/Underline/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Underline/index.js +19 -21
- package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
- package/dist/lexical/ui/icons/UnorderedList/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/UnorderedList/index.js +46 -52
- package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
- package/dist/lexical/ui/icons/Upload/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Upload/index.js +28 -31
- package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
- package/dist/lexical/utils/canUseDOM.d.ts.map +1 -1
- package/dist/lexical/utils/canUseDOM.js +2 -1
- package/dist/lexical/utils/canUseDOM.js.map +1 -1
- package/dist/lexical/utils/environment.d.ts.map +1 -1
- package/dist/lexical/utils/environment.js +2 -1
- package/dist/lexical/utils/environment.js.map +1 -1
- package/dist/lexical/utils/getDOMRangeRect.d.ts.map +1 -1
- package/dist/lexical/utils/getDOMRangeRect.js +13 -12
- package/dist/lexical/utils/getDOMRangeRect.js.map +1 -1
- package/dist/lexical/utils/getSelectedNode.d.ts.map +1 -1
- package/dist/lexical/utils/getSelectedNode.js +18 -13
- package/dist/lexical/utils/getSelectedNode.js.map +1 -1
- package/dist/lexical/utils/guard.d.ts.map +1 -1
- package/dist/lexical/utils/guard.js +3 -2
- package/dist/lexical/utils/guard.js.map +1 -1
- package/dist/lexical/utils/joinClasses.d.ts.map +1 -1
- package/dist/lexical/utils/joinClasses.js +3 -2
- package/dist/lexical/utils/joinClasses.js.map +1 -1
- package/dist/lexical/utils/markdown/createBlockNode.js +9 -10
- package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
- package/dist/lexical/utils/nodeFormat.js +58 -59
- package/dist/lexical/utils/nodeFormat.js.map +1 -1
- package/dist/lexical/utils/point.d.ts.map +1 -1
- package/dist/lexical/utils/point.js +40 -32
- package/dist/lexical/utils/point.js.map +1 -1
- package/dist/lexical/utils/rect.d.ts.map +1 -1
- package/dist/lexical/utils/rect.js +167 -134
- package/dist/lexical/utils/rect.js.map +1 -1
- package/dist/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
- package/dist/lexical/utils/setFloatingElemPosition.js +56 -45
- package/dist/lexical/utils/setFloatingElemPosition.js.map +1 -1
- package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.d.ts.map +1 -1
- package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.js +23 -22
- package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.js.map +1 -1
- package/dist/lexical/utils/swipe.d.ts.map +1 -1
- package/dist/lexical/utils/swipe.js +82 -83
- package/dist/lexical/utils/swipe.js.map +1 -1
- package/dist/lexical/utils/url.js +23 -22
- package/dist/lexical/utils/url.js.map +1 -1
- package/dist/nodeTypes.js +1 -2
- package/dist/nodeTypes.js.map +1 -1
- package/dist/populateGraphQL/defaultValue.js +24 -29
- package/dist/populateGraphQL/defaultValue.js.map +1 -1
- package/dist/populateGraphQL/populate.js +35 -25
- package/dist/populateGraphQL/populate.js.map +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.js +47 -32
- package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js +39 -25
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -1
- package/dist/types.js +1 -2
- package/dist/types.js.map +1 -1
- package/dist/utilities/createClientFeature.js +40 -36
- package/dist/utilities/createClientFeature.js.map +1 -1
- package/dist/utilities/createServerFeature.js +46 -35
- package/dist/utilities/createServerFeature.js.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.js +28 -17
- package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.js +149 -78
- package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
- package/dist/utilities/forEachNodeRecursively.js +24 -19
- package/dist/utilities/forEachNodeRecursively.js.map +1 -1
- package/dist/utilities/generateComponentMap.d.ts.map +1 -1
- package/dist/utilities/generateComponentMap.js +92 -82
- package/dist/utilities/generateComponentMap.js.map +1 -1
- package/dist/utilities/generateImportMap.js +53 -47
- package/dist/utilities/generateImportMap.js.map +1 -1
- package/dist/utilities/generateSchemaMap.js +35 -30
- package/dist/utilities/generateSchemaMap.js.map +1 -1
- package/dist/utilities/migrateSlateToLexical/index.js +99 -86
- package/dist/utilities/migrateSlateToLexical/index.js.map +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +73 -66
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/recurseNodeTree.js +25 -22
- package/dist/utilities/recurseNodeTree.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/index.js +99 -86
- package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +71 -66
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/useLexicalFeature.js +9 -8
- package/dist/utilities/useLexicalFeature.js.map +1 -1
- package/dist/validate/index.js +32 -26
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/validateNodes.js +31 -28
- package/dist/validate/validateNodes.js.map +1 -1
- package/package.json +22 -11
- package/dist/exports/client/Component-7HS6FEJS.js +0 -2
- package/dist/exports/client/Component-7HS6FEJS.js.map +0 -7
- package/dist/exports/client/Component-LAKSCIDX.js +0 -2
- package/dist/exports/client/Component-LAKSCIDX.js.map +0 -7
- package/dist/exports/client/Field-BYB3WX7J.js +0 -2
- package/dist/exports/client/Field-BYB3WX7J.js.map +0 -7
- package/dist/exports/client/RelationshipComponent-GYUTPDNG.js +0 -2
- package/dist/exports/client/RelationshipComponent-GYUTPDNG.js.map +0 -7
- package/dist/exports/client/chunk-4EX7W4UX.js +0 -2
- package/dist/exports/client/chunk-4EX7W4UX.js.map +0 -7
- package/dist/exports/client/chunk-E4HH5PS6.js +0 -2
- package/dist/exports/client/chunk-E4HH5PS6.js.map +0 -7
- package/dist/exports/client/chunk-EBB2CEB6.js +0 -2
- package/dist/exports/client/chunk-EBB2CEB6.js.map +0 -7
- package/dist/exports/client/chunk-LTR7V74A.js +0 -2
- package/dist/exports/client/chunk-LTR7V74A.js.map +0 -7
- package/dist/exports/client/chunk-SQHN3N6E.js +0 -2
- package/dist/exports/client/chunk-VMCQSR3T.js +0 -3
- package/dist/exports/client/chunk-VMCQSR3T.js.map +0 -7
- package/dist/exports/client/component-6C5JERGA.js +0 -2
- package/dist/exports/client/component-6C5JERGA.js.map +0 -7
- package/dist/exports/client/component-GUWIGB77.js +0 -2
- package/dist/exports/client/component-GUWIGB77.js.map +0 -7
- package/dist/exports/client/component-UQ2BKD5X.js +0 -2
- package/dist/exports/client/component-UQ2BKD5X.js.map +0 -7
- package/dist/exports/client/componentInline-C2XIK5VZ.js +0 -2
- package/dist/exports/client/componentInline-C2XIK5VZ.js.map +0 -7
- package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts +0 -12
- package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js +0 -181
- package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
2
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { Collapsible, Form, Pill, RenderComponent, SectionTitle, ShimmerEffect, useConfig, useDocumentInfo, useFieldProps, useFormSubmitted, useTranslation } from '@payloadcms/ui';
|
|
4
5
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
@@ -8,150 +9,137 @@ import { getFormState } from '@payloadcms/ui/shared';
|
|
|
8
9
|
import { v4 as uuid } from 'uuid';
|
|
9
10
|
import { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js';
|
|
10
11
|
import { BlockContent } from './BlockContent.js';
|
|
11
|
-
export const BlockComponent =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
config.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
apiRoute: config.routes.api,
|
|
60
|
-
body: {
|
|
61
|
-
id,
|
|
62
|
-
formState: prevFormState,
|
|
63
|
-
operation: 'update',
|
|
64
|
-
schemaPath: schemaFieldsPath
|
|
65
|
-
},
|
|
66
|
-
serverURL: config.serverURL
|
|
67
|
-
});
|
|
68
|
-
formState.blockName = {
|
|
69
|
-
initialValue: '',
|
|
70
|
-
passesCondition: true,
|
|
71
|
-
valid: true,
|
|
72
|
-
value: formData.blockName
|
|
12
|
+
export const BlockComponent = props => {
|
|
13
|
+
const {
|
|
14
|
+
formData,
|
|
15
|
+
nodeKey
|
|
16
|
+
} = props;
|
|
17
|
+
const {
|
|
18
|
+
config
|
|
19
|
+
} = useConfig();
|
|
20
|
+
const submitted = useFormSubmitted();
|
|
21
|
+
const {
|
|
22
|
+
id
|
|
23
|
+
} = useDocumentInfo();
|
|
24
|
+
const {
|
|
25
|
+
path,
|
|
26
|
+
schemaPath
|
|
27
|
+
} = useFieldProps();
|
|
28
|
+
const {
|
|
29
|
+
field: parentLexicalRichTextField
|
|
30
|
+
} = useEditorConfigContext();
|
|
31
|
+
const [initialState, setInitialState] = useState(false);
|
|
32
|
+
const {
|
|
33
|
+
field: {
|
|
34
|
+
richTextComponentMap
|
|
35
|
+
}
|
|
36
|
+
} = useEditorConfigContext();
|
|
37
|
+
const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.lexical_blocks.${formData.blockType}`;
|
|
38
|
+
const componentMapRenderedBlockPath = `lexical_internal_feature.blocks.fields.lexical_blocks`;
|
|
39
|
+
const blocksField = richTextComponentMap.get(componentMapRenderedBlockPath)[0];
|
|
40
|
+
const clientBlock = blocksField.blocks.find(block => block.slug === formData.blockType);
|
|
41
|
+
// Field Schema
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const awaitInitialState = async () => {
|
|
44
|
+
const state = await getFormState({
|
|
45
|
+
apiRoute: config.routes.api,
|
|
46
|
+
body: {
|
|
47
|
+
id,
|
|
48
|
+
data: formData,
|
|
49
|
+
operation: 'update',
|
|
50
|
+
schemaPath: schemaFieldsPath
|
|
51
|
+
},
|
|
52
|
+
serverURL: config.serverURL
|
|
53
|
+
});
|
|
54
|
+
if (state) {
|
|
55
|
+
state.blockName = {
|
|
56
|
+
initialValue: '',
|
|
57
|
+
passesCondition: true,
|
|
58
|
+
valid: true,
|
|
59
|
+
value: formData.blockName
|
|
73
60
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
setInitialState(state);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
if (formData) {
|
|
65
|
+
void awaitInitialState();
|
|
66
|
+
}
|
|
67
|
+
}, [config.routes.api, config.serverURL, schemaFieldsPath, id]) // DO NOT ADD FORMDATA HERE! Adding formData will kick you out of sub block editors while writing.
|
|
68
|
+
;
|
|
69
|
+
const onChange = useCallback(async ({
|
|
70
|
+
formState: prevFormState
|
|
71
|
+
}) => {
|
|
72
|
+
const formState = await getFormState({
|
|
73
|
+
apiRoute: config.routes.api,
|
|
74
|
+
body: {
|
|
78
75
|
id,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
`${baseClass}__row`,
|
|
85
|
-
`${baseClass}__row--no-errors`
|
|
86
|
-
].filter(Boolean).join(' ');
|
|
87
|
-
// Memoized Form JSX
|
|
88
|
-
const formContent = useMemo(()=>{
|
|
89
|
-
return clientBlock && initialState !== false ? /*#__PURE__*/ _jsx(Form, {
|
|
90
|
-
beforeSubmit: [
|
|
91
|
-
onChange
|
|
92
|
-
],
|
|
93
|
-
fields: clientBlock.fields,
|
|
94
|
-
initialState: initialState,
|
|
95
|
-
onChange: [
|
|
96
|
-
onChange
|
|
97
|
-
],
|
|
98
|
-
submitted: submitted,
|
|
99
|
-
uuid: uuid(),
|
|
100
|
-
children: /*#__PURE__*/ _jsx(BlockContent, {
|
|
101
|
-
baseClass: baseClass,
|
|
102
|
-
clientBlock: clientBlock,
|
|
103
|
-
field: parentLexicalRichTextField,
|
|
104
|
-
formData: formData,
|
|
105
|
-
formSchema: clientBlock.fields,
|
|
106
|
-
nodeKey: nodeKey,
|
|
107
|
-
path: `${path}.lexical_internal_feature.blocks.${formData.blockType}`,
|
|
108
|
-
schemaPath: schemaFieldsPath
|
|
109
|
-
})
|
|
110
|
-
}) : /*#__PURE__*/ _jsx(Collapsible, {
|
|
111
|
-
className: classNames,
|
|
112
|
-
collapsibleStyle: "default",
|
|
113
|
-
header: clientBlock?.admin?.components?.Label ? /*#__PURE__*/ _jsx(RenderComponent, {
|
|
114
|
-
clientProps: {
|
|
115
|
-
blockKind: 'lexicalBlock',
|
|
116
|
-
formData
|
|
117
|
-
},
|
|
118
|
-
mappedComponent: clientBlock.admin.components.Label
|
|
119
|
-
}) : /*#__PURE__*/ _jsx("div", {
|
|
120
|
-
className: `${baseClass}__block-header`,
|
|
121
|
-
children: /*#__PURE__*/ _jsxs("div", {
|
|
122
|
-
children: [
|
|
123
|
-
/*#__PURE__*/ _jsx(Pill, {
|
|
124
|
-
className: `${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`,
|
|
125
|
-
pillStyle: "white",
|
|
126
|
-
children: clientBlock && typeof clientBlock.labels.singular === 'string' ? getTranslation(clientBlock.labels.singular, i18n) : clientBlock.slug
|
|
127
|
-
}),
|
|
128
|
-
/*#__PURE__*/ _jsx(SectionTitle, {
|
|
129
|
-
path: "blockName",
|
|
130
|
-
readOnly: parentLexicalRichTextField?.admin?.readOnly
|
|
131
|
-
})
|
|
132
|
-
]
|
|
133
|
-
})
|
|
134
|
-
}),
|
|
135
|
-
children: /*#__PURE__*/ _jsx(ShimmerEffect, {
|
|
136
|
-
height: "35vh"
|
|
137
|
-
})
|
|
138
|
-
}, 0);
|
|
139
|
-
}, [
|
|
140
|
-
clientBlock,
|
|
141
|
-
initialState,
|
|
142
|
-
onChange,
|
|
143
|
-
submitted,
|
|
144
|
-
parentLexicalRichTextField,
|
|
145
|
-
nodeKey,
|
|
146
|
-
path,
|
|
147
|
-
schemaFieldsPath,
|
|
148
|
-
classNames,
|
|
149
|
-
i18n
|
|
150
|
-
]);
|
|
151
|
-
return /*#__PURE__*/ _jsx("div", {
|
|
152
|
-
className: baseClass + ' ' + baseClass + '-' + formData.blockType,
|
|
153
|
-
children: formContent
|
|
76
|
+
formState: prevFormState,
|
|
77
|
+
operation: 'update',
|
|
78
|
+
schemaPath: schemaFieldsPath
|
|
79
|
+
},
|
|
80
|
+
serverURL: config.serverURL
|
|
154
81
|
});
|
|
82
|
+
formState.blockName = {
|
|
83
|
+
initialValue: '',
|
|
84
|
+
passesCondition: true,
|
|
85
|
+
valid: true,
|
|
86
|
+
value: formData.blockName
|
|
87
|
+
};
|
|
88
|
+
return formState;
|
|
89
|
+
}, [config.routes.api, config.serverURL, id, schemaFieldsPath, formData.blockName]);
|
|
90
|
+
const {
|
|
91
|
+
i18n
|
|
92
|
+
} = useTranslation();
|
|
93
|
+
const classNames = [`${baseClass}__row`, `${baseClass}__row--no-errors`].filter(Boolean).join(' ');
|
|
94
|
+
// Memoized Form JSX
|
|
95
|
+
const formContent = useMemo(() => {
|
|
96
|
+
return clientBlock && initialState !== false ? /*#__PURE__*/_jsx(Form, {
|
|
97
|
+
beforeSubmit: [onChange],
|
|
98
|
+
fields: clientBlock.fields,
|
|
99
|
+
initialState: initialState,
|
|
100
|
+
onChange: [onChange],
|
|
101
|
+
submitted: submitted,
|
|
102
|
+
uuid: uuid(),
|
|
103
|
+
children: /*#__PURE__*/_jsx(BlockContent, {
|
|
104
|
+
baseClass: baseClass,
|
|
105
|
+
clientBlock: clientBlock,
|
|
106
|
+
field: parentLexicalRichTextField,
|
|
107
|
+
formData: formData,
|
|
108
|
+
formSchema: clientBlock.fields,
|
|
109
|
+
nodeKey: nodeKey,
|
|
110
|
+
path: `${path}.lexical_internal_feature.blocks.${formData.blockType}`,
|
|
111
|
+
schemaPath: schemaFieldsPath
|
|
112
|
+
})
|
|
113
|
+
}) : /*#__PURE__*/_jsx(Collapsible, {
|
|
114
|
+
className: classNames,
|
|
115
|
+
collapsibleStyle: "default",
|
|
116
|
+
header: clientBlock?.admin?.components?.Label ? /*#__PURE__*/_jsx(RenderComponent, {
|
|
117
|
+
clientProps: {
|
|
118
|
+
blockKind: 'lexicalBlock',
|
|
119
|
+
formData
|
|
120
|
+
},
|
|
121
|
+
mappedComponent: clientBlock.admin.components.Label
|
|
122
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
123
|
+
className: `${baseClass}__block-header`,
|
|
124
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
125
|
+
children: [/*#__PURE__*/_jsx(Pill, {
|
|
126
|
+
className: `${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`,
|
|
127
|
+
pillStyle: "white",
|
|
128
|
+
children: clientBlock && typeof clientBlock.labels.singular === 'string' ? getTranslation(clientBlock.labels.singular, i18n) : clientBlock.slug
|
|
129
|
+
}), /*#__PURE__*/_jsx(SectionTitle, {
|
|
130
|
+
path: "blockName",
|
|
131
|
+
readOnly: parentLexicalRichTextField?.admin?.readOnly
|
|
132
|
+
})]
|
|
133
|
+
})
|
|
134
|
+
}),
|
|
135
|
+
children: /*#__PURE__*/_jsx(ShimmerEffect, {
|
|
136
|
+
height: "35vh"
|
|
137
|
+
})
|
|
138
|
+
}, 0);
|
|
139
|
+
}, [clientBlock, initialState, onChange, submitted, parentLexicalRichTextField, nodeKey, path, schemaFieldsPath, classNames, i18n]);
|
|
140
|
+
return /*#__PURE__*/_jsx("div", {
|
|
141
|
+
className: baseClass + ' ' + baseClass + '-' + formData.blockType,
|
|
142
|
+
children: formContent
|
|
143
|
+
});
|
|
155
144
|
};
|
|
156
|
-
|
|
157
145
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/features/blocks/client/component/index.tsx"],"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'\nimport './index.scss'\n\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"],"names":["Collapsible","Form","Pill","RenderComponent","SectionTitle","ShimmerEffect","useConfig","useDocumentInfo","useFieldProps","useFormSubmitted","useTranslation","React","useCallback","useEffect","useMemo","useState","baseClass","getTranslation","getFormState","v4","uuid","useEditorConfigContext","BlockContent","BlockComponent","props","formData","nodeKey","config","submitted","id","path","schemaPath","field","parentLexicalRichTextField","initialState","setInitialState","richTextComponentMap","schemaFieldsPath","blockType","componentMapRenderedBlockPath","blocksField","get","clientBlock","blocks","find","block","slug","awaitInitialState","state","apiRoute","routes","api","body","data","operation","serverURL","blockName","initialValue","passesCondition","valid","value","onChange","formState","prevFormState","i18n","classNames","filter","Boolean","join","formContent","beforeSubmit","fields","formSchema","className","collapsibleStyle","header","admin","components","Label","clientProps","blockKind","mappedComponent","div","pillStyle","labels","singular","readOnly","height"],"mappings":"AAAA;;AAIA,SACEA,WAAW,EACXC,IA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YAC1BrC,cAAcA;YACd2B,UAAU;gBAACA;aAAS;YACpBjC,WAAWA;YACXR,MAAMA;sBAEN,cAAA,KAACE;gBACCN,WAAWA;gBACX0B,aAAaA;gBACbV,OAAOC;gBACPR,UAAUA;gBACV+C,YAAY9B,YAAY6B,MAAM;gBAC9B7C,SAASA;gBACTI,MAAM,CAAC,EAAEA,KAAK,iCAAiC,EAAEL,SAASa,SAAS,CAAC,CAAC;gBACrEP,YAAYM;;2BAIhB,KAACrC;YACCyE,WAAWR;YACXS,kBAAiB;YACjBC,QACEjC,aAAakC,OAAOC,YAAYC,sBAC9B,KAAC3E;gBACC4E,aAAa;oBAAEC,WAAW;oBAAgBvD;gBAAS;gBACnDwD,iBAAiBvC,YAAYkC,KAAK,CAACC,UAAU,CAACC,KAAK;+BAGrD,KAACI;gBAAIT,WAAW,CAAC,EAAEzD,UAAU,cAAc,CAAC;0BAC1C,cAAA,MAACkE;;sCACC,KAAChF;4BACCuE,WAAW,CAAC,EAAEzD,UAAU,aAAa,EAAEA,UAAU,aAAa,EAAES,UAAUa,UAAU,CAAC;4BACrF6C,WAAU;sCAETzC,eAAe,OAAOA,YAAY0C,MAAM,CAACC,QAAQ,KAAK,WACnDpE,eAAeyB,YAAY0C,MAAM,CAACC,QAAQ,EAAErB,QAC5CtB,YAAYI,IAAI;;sCAEtB,KAAC1C;4BACC0B,MAAK;4BACLwD,UAAUrD,4BAA4B2C,OAAOU;;;;;sBAQvD,cAAA,KAACjF;gBAAckF,QAAO;;WAFjB;IAKX,GAAG;QACD7C;QACAR;QACA2B;QACAjC;QACAK;QACAP;QACAI;QACAO;QACA4B;QACAD;KACD;IAED,qBAAO,KAACkB;QAAIT,WAAWzD,YAAY,MAAMA,YAAY,MAAMS,SAASa,SAAS;kBAAG+B;;AAClF,EAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["Collapsible","Form","Pill","RenderComponent","SectionTitle","ShimmerEffect","useConfig","useDocumentInfo","useFieldProps","useFormSubmitted","useTranslation","React","useCallback","useEffect","useMemo","useState","baseClass","getTranslation","getFormState","v4","uuid","useEditorConfigContext","BlockContent","BlockComponent","props","formData","nodeKey","config","submitted","id","path","schemaPath","field","parentLexicalRichTextField","initialState","setInitialState","richTextComponentMap","schemaFieldsPath","blockType","componentMapRenderedBlockPath","blocksField","get","clientBlock","blocks","find","block","slug","awaitInitialState","state","apiRoute","routes","api","body","data","operation","serverURL","blockName","initialValue","passesCondition","valid","value","onChange","formState","prevFormState","i18n","classNames","filter","Boolean","join","formContent","_jsx","beforeSubmit","fields","formSchema","className","collapsibleStyle","header","admin","components","Label","clientProps","blockKind","mappedComponent","_jsxs","pillStyle","labels","singular","readOnly","height"],"sources":["../../../../../src/features/blocks/client/component/index.tsx"],"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'\nimport './index.scss'\n\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"],"mappings":"AAAA;;;AAIA,SACEA,WAAW,EACXC,IAAI,EACJC,IAAI,EACJC,eAAe,EACfC,YAAY,EACZC,aAAa,EACbC,SAAS,EACTC,eAAe,EACfC,aAAa,EACbC,gBAAgB,EAChBC,cAAc,QACT;AACP,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AAEjE,MAAMC,SAAA,GAAY;AAGlB,SAASC,cAAc,QAAQ;AAC/B,SAASC,YAAY,QAAQ;AAC7B,SAASC,EAAA,IAAMC,IAAI,QAAQ;AAI3B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,YAAY,QAAQ;AAS7B,OAAO,MAAMC,cAAA,GAAmCC,KAAA;EAC9C,MAAM;IAAEC,QAAQ;IAAEC;EAAO,CAAE,GAAGF,KAAA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YAAA,EACA2B,QAAA,EACAjC,SAAA,EACAK,0BAAA,EACAP,OAAA,EACAI,IAAA,EACAO,gBAAA,EACA4B,UAAA,EACAD,IAAA,CACD;EAED,oBAAOM,IAAA,CAAC;IAAII,SAAA,EAAW1D,SAAA,GAAY,MAAMA,SAAA,GAAY,MAAMS,QAAA,CAASa,SAAS;cAAG+B;;AAClF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeEmptyArrayValues.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/removeEmptyArrayValues.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"removeEmptyArrayValues.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/removeEmptyArrayValues.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAQnF"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* By default, if an array field is empty, it will be included in the form state with a value of 0.
|
|
3
5
|
* We do not need this behavior here, By setting `disableFormData` to true, we can prevent the field from being included in the form state
|
|
4
6
|
* like that.
|
|
5
7
|
* @param fields form state
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
*/
|
|
9
|
+
export function removeEmptyArrayValues({
|
|
10
|
+
fields
|
|
11
|
+
}) {
|
|
12
|
+
for (const key in fields) {
|
|
13
|
+
const field = fields[key];
|
|
14
|
+
if (Array.isArray(field.rows) && 'value' in field) {
|
|
15
|
+
field.disableFormData = true;
|
|
12
16
|
}
|
|
13
|
-
|
|
17
|
+
}
|
|
18
|
+
return fields;
|
|
14
19
|
}
|
|
15
|
-
|
|
16
20
|
//# sourceMappingURL=removeEmptyArrayValues.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/features/blocks/client/component/removeEmptyArrayValues.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"removeEmptyArrayValues.js","names":["removeEmptyArrayValues","fields","key","field","Array","isArray","rows","disableFormData"],"sources":["../../../../../src/features/blocks/client/component/removeEmptyArrayValues.ts"],"sourcesContent":["'use client'\nimport 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"],"mappings":"AAAA;;AAGA;;;;;;AAMA,OAAO,SAASA,uBAAuB;EAAEC;AAAM,CAAyB;EACtE,KAAK,MAAMC,GAAA,IAAOD,MAAA,EAAQ;IACxB,MAAME,KAAA,GAAQF,MAAM,CAACC,GAAA,CAAI;IACzB,IAAIE,KAAA,CAAMC,OAAO,CAACF,KAAA,CAAMG,IAAI,KAAK,WAAWH,KAAA,EAAO;MACjDA,KAAA,CAAMI,eAAe,GAAG;IAC1B;EACF;EACA,OAAON,MAAA;AACT","ignoreList":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
2
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
4
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
4
5
|
const baseClass = 'inline-block';
|
|
@@ -11,128 +12,111 @@ import { $getNodeByKey, $getSelection, $isNodeSelection, CLICK_COMMAND, COMMAND_
|
|
|
11
12
|
import { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js';
|
|
12
13
|
import { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js';
|
|
13
14
|
import { OPEN_INLINE_BLOCK_DRAWER_COMMAND } from '../plugin/commands.js';
|
|
14
|
-
export const InlineBlockComponent =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
43
|
-
}, [
|
|
44
|
-
isSelected,
|
|
45
|
-
nodeKey
|
|
46
|
-
]);
|
|
47
|
-
const onClick = useCallback((payload)=>{
|
|
48
|
-
const event = payload;
|
|
49
|
-
// Check if inlineBlockElemElemRef.target or anything WITHIN inlineBlockElemElemRef.target was clicked
|
|
50
|
-
if (event.target === inlineBlockElemElemRef.current || inlineBlockElemElemRef.current?.contains(event.target)) {
|
|
51
|
-
if (event.shiftKey) {
|
|
52
|
-
setSelected(!isSelected);
|
|
53
|
-
} else {
|
|
54
|
-
if (!isSelected) {
|
|
55
|
-
clearSelection();
|
|
56
|
-
setSelected(true);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
return false;
|
|
62
|
-
}, [
|
|
63
|
-
isSelected,
|
|
64
|
-
setSelected,
|
|
65
|
-
clearSelection
|
|
66
|
-
]);
|
|
67
|
-
useEffect(()=>{
|
|
68
|
-
return mergeRegister(editor.registerCommand(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW));
|
|
69
|
-
}, [
|
|
70
|
-
clearSelection,
|
|
71
|
-
editor,
|
|
72
|
-
isSelected,
|
|
73
|
-
nodeKey,
|
|
74
|
-
$onDelete,
|
|
75
|
-
setSelected,
|
|
76
|
-
onClick
|
|
77
|
-
]);
|
|
78
|
-
const blockDisplayName = clientBlock?.labels?.singular ? getTranslation(clientBlock.labels.singular, i18n) : clientBlock.slug;
|
|
79
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
80
|
-
className: [
|
|
81
|
-
baseClass,
|
|
82
|
-
baseClass + '-' + formData.blockType,
|
|
83
|
-
isSelected && `${baseClass}--selected`
|
|
84
|
-
].filter(Boolean).join(' '),
|
|
85
|
-
ref: inlineBlockElemElemRef,
|
|
86
|
-
children: [
|
|
87
|
-
clientBlock?.admin?.components?.Label ? /*#__PURE__*/ _jsx(RenderComponent, {
|
|
88
|
-
clientProps: {
|
|
89
|
-
blockKind: 'lexicalInlineBlock',
|
|
90
|
-
formData
|
|
91
|
-
},
|
|
92
|
-
mappedComponent: clientBlock.admin.components.Label
|
|
93
|
-
}) : /*#__PURE__*/ _jsx("div", {
|
|
94
|
-
children: getTranslation(clientBlock.labels?.singular, i18n)
|
|
95
|
-
}),
|
|
96
|
-
editor.isEditable() && /*#__PURE__*/ _jsxs("div", {
|
|
97
|
-
className: `${baseClass}__actions`,
|
|
98
|
-
children: [
|
|
99
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
100
|
-
buttonStyle: "icon-label",
|
|
101
|
-
className: `${baseClass}__editButton`,
|
|
102
|
-
disabled: field?.admin?.readOnly,
|
|
103
|
-
el: "div",
|
|
104
|
-
icon: "edit",
|
|
105
|
-
onClick: ()=>{
|
|
106
|
-
editor.dispatchCommand(OPEN_INLINE_BLOCK_DRAWER_COMMAND, {
|
|
107
|
-
fields: formData,
|
|
108
|
-
nodeKey
|
|
109
|
-
});
|
|
110
|
-
},
|
|
111
|
-
round: true,
|
|
112
|
-
size: "small",
|
|
113
|
-
tooltip: t('lexical:blocks:inlineBlocks:edit', {
|
|
114
|
-
label: blockDisplayName
|
|
115
|
-
})
|
|
116
|
-
}),
|
|
117
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
118
|
-
buttonStyle: "icon-label",
|
|
119
|
-
className: `${baseClass}__removeButton`,
|
|
120
|
-
disabled: field?.admin?.readOnly,
|
|
121
|
-
icon: "x",
|
|
122
|
-
onClick: (e)=>{
|
|
123
|
-
e.preventDefault();
|
|
124
|
-
removeInlineBlock();
|
|
125
|
-
},
|
|
126
|
-
round: true,
|
|
127
|
-
size: "small",
|
|
128
|
-
tooltip: t('lexical:blocks:inlineBlocks:remove', {
|
|
129
|
-
label: blockDisplayName
|
|
130
|
-
})
|
|
131
|
-
})
|
|
132
|
-
]
|
|
133
|
-
})
|
|
134
|
-
]
|
|
15
|
+
export const InlineBlockComponent = props => {
|
|
16
|
+
const {
|
|
17
|
+
formData,
|
|
18
|
+
nodeKey
|
|
19
|
+
} = props;
|
|
20
|
+
const [editor] = useLexicalComposerContext();
|
|
21
|
+
const {
|
|
22
|
+
i18n,
|
|
23
|
+
t
|
|
24
|
+
} = useTranslation();
|
|
25
|
+
const {
|
|
26
|
+
field
|
|
27
|
+
} = useEditorConfigContext();
|
|
28
|
+
const inlineBlockElemElemRef = useRef(null);
|
|
29
|
+
const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey);
|
|
30
|
+
const {
|
|
31
|
+
field: {
|
|
32
|
+
richTextComponentMap
|
|
33
|
+
}
|
|
34
|
+
} = useEditorConfigContext();
|
|
35
|
+
const componentMapRenderedBlockPath = `lexical_internal_feature.blocks.fields.lexical_inline_blocks`;
|
|
36
|
+
const blocksField = richTextComponentMap.get(componentMapRenderedBlockPath)[0];
|
|
37
|
+
const clientBlock = blocksField.blocks.find(block => block.slug === formData.blockType);
|
|
38
|
+
const removeInlineBlock = useCallback(() => {
|
|
39
|
+
editor.update(() => {
|
|
40
|
+
$getNodeByKey(nodeKey).remove();
|
|
135
41
|
});
|
|
42
|
+
}, [editor, nodeKey]);
|
|
43
|
+
const $onDelete = useCallback(event => {
|
|
44
|
+
if (isSelected && $isNodeSelection($getSelection())) {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
const node = $getNodeByKey(nodeKey);
|
|
47
|
+
if ($isInlineBlockNode(node)) {
|
|
48
|
+
node.remove();
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return false;
|
|
53
|
+
}, [isSelected, nodeKey]);
|
|
54
|
+
const onClick = useCallback(payload => {
|
|
55
|
+
const event_0 = payload;
|
|
56
|
+
// Check if inlineBlockElemElemRef.target or anything WITHIN inlineBlockElemElemRef.target was clicked
|
|
57
|
+
if (event_0.target === inlineBlockElemElemRef.current || inlineBlockElemElemRef.current?.contains(event_0.target)) {
|
|
58
|
+
if (event_0.shiftKey) {
|
|
59
|
+
setSelected(!isSelected);
|
|
60
|
+
} else {
|
|
61
|
+
if (!isSelected) {
|
|
62
|
+
clearSelection();
|
|
63
|
+
setSelected(true);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
}, [isSelected, setSelected, clearSelection]);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
return mergeRegister(editor.registerCommand(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW));
|
|
72
|
+
}, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected, onClick]);
|
|
73
|
+
const blockDisplayName = clientBlock?.labels?.singular ? getTranslation(clientBlock.labels.singular, i18n) : clientBlock.slug;
|
|
74
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
75
|
+
className: [baseClass, baseClass + '-' + formData.blockType, isSelected && `${baseClass}--selected`].filter(Boolean).join(' '),
|
|
76
|
+
ref: inlineBlockElemElemRef,
|
|
77
|
+
children: [clientBlock?.admin?.components?.Label ? /*#__PURE__*/_jsx(RenderComponent, {
|
|
78
|
+
clientProps: {
|
|
79
|
+
blockKind: 'lexicalInlineBlock',
|
|
80
|
+
formData
|
|
81
|
+
},
|
|
82
|
+
mappedComponent: clientBlock.admin.components.Label
|
|
83
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
84
|
+
children: getTranslation(clientBlock.labels?.singular, i18n)
|
|
85
|
+
}), editor.isEditable() && /*#__PURE__*/_jsxs("div", {
|
|
86
|
+
className: `${baseClass}__actions`,
|
|
87
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
88
|
+
buttonStyle: "icon-label",
|
|
89
|
+
className: `${baseClass}__editButton`,
|
|
90
|
+
disabled: field?.admin?.readOnly,
|
|
91
|
+
el: "div",
|
|
92
|
+
icon: "edit",
|
|
93
|
+
onClick: () => {
|
|
94
|
+
editor.dispatchCommand(OPEN_INLINE_BLOCK_DRAWER_COMMAND, {
|
|
95
|
+
fields: formData,
|
|
96
|
+
nodeKey
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
round: true,
|
|
100
|
+
size: "small",
|
|
101
|
+
tooltip: t('lexical:blocks:inlineBlocks:edit', {
|
|
102
|
+
label: blockDisplayName
|
|
103
|
+
})
|
|
104
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
105
|
+
buttonStyle: "icon-label",
|
|
106
|
+
className: `${baseClass}__removeButton`,
|
|
107
|
+
disabled: field?.admin?.readOnly,
|
|
108
|
+
icon: "x",
|
|
109
|
+
onClick: e => {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
removeInlineBlock();
|
|
112
|
+
},
|
|
113
|
+
round: true,
|
|
114
|
+
size: "small",
|
|
115
|
+
tooltip: t('lexical:blocks:inlineBlocks:remove', {
|
|
116
|
+
label: blockDisplayName
|
|
117
|
+
})
|
|
118
|
+
})]
|
|
119
|
+
})]
|
|
120
|
+
});
|
|
136
121
|
};
|
|
137
|
-
|
|
138
122
|
//# sourceMappingURL=index.js.map
|