@payloadcms/richtext-lexical 3.0.0-beta.84 → 3.0.0-beta.86
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.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-KUSPHC7Q.js +2 -0
- package/dist/exports/client/Field-KUSPHC7Q.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.js +124 -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.d.ts.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.d.ts.map +1 -1
- package/dist/utilities/createClientFeature.js +40 -26
- package/dist/utilities/createClientFeature.js.map +1 -1
- package/dist/utilities/createServerFeature.d.ts.map +1 -1
- package/dist/utilities/createServerFeature.js +46 -31
- 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.js +90 -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
package/dist/validate/index.js
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
import { validateNodes } from './validateNodes.js';
|
|
2
|
-
export const richTextValidateHOC = ({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
export const richTextValidateHOC = ({
|
|
3
|
+
editorConfig
|
|
4
|
+
}) => {
|
|
5
|
+
const richTextValidate = async (value, options) => {
|
|
6
|
+
const {
|
|
7
|
+
req: {
|
|
8
|
+
t
|
|
9
|
+
},
|
|
10
|
+
required
|
|
11
|
+
} = options;
|
|
12
|
+
if (required) {
|
|
13
|
+
const hasChildren = value?.root?.children?.length;
|
|
14
|
+
const hasOnlyEmptyParagraph = value?.root?.children?.length === 1 && value?.root?.children[0]?.type === 'paragraph' && value?.root?.children[0]?.children?.length === 0 || value?.root?.children[0]?.children?.length === 1 && value?.root?.children[0]?.children[0]?.type === 'text' && value?.root?.children[0]?.children[0]?.['text'] === '';
|
|
15
|
+
if (!hasChildren || hasOnlyEmptyParagraph) {
|
|
16
|
+
return t('validation:required');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
// Traverse through nodes and validate them. Just like a node can hook into the population process (e.g. link or relationship nodes),
|
|
20
|
+
// they can also hook into the validation process. E.g. a block node probably has fields with validation rules.
|
|
21
|
+
const rootNodes = value?.root?.children;
|
|
22
|
+
if (rootNodes && Array.isArray(rootNodes) && rootNodes?.length) {
|
|
23
|
+
return await validateNodes({
|
|
24
|
+
nodeValidations: editorConfig.features.validations,
|
|
25
|
+
nodes: rootNodes,
|
|
26
|
+
validation: {
|
|
27
|
+
options,
|
|
28
|
+
value
|
|
11
29
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
nodeValidations: editorConfig.features.validations,
|
|
18
|
-
nodes: rootNodes,
|
|
19
|
-
validation: {
|
|
20
|
-
options,
|
|
21
|
-
value
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return true;
|
|
26
|
-
};
|
|
27
|
-
return richTextValidate;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
};
|
|
34
|
+
return richTextValidate;
|
|
28
35
|
};
|
|
29
|
-
|
|
30
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/validate/index.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedParagraphNode } from 'lexical'\nimport type { RichTextField, Validate } from 'payload'\n\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\n\nimport { validateNodes } from './validateNodes.js'\n\nexport const richTextValidateHOC = ({\n editorConfig,\n}: {\n editorConfig: SanitizedServerEditorConfig\n}) => {\n const richTextValidate: Validate<SerializedEditorState, unknown, unknown, RichTextField> = async (\n value,\n options,\n ) => {\n const {\n req: { t },\n required,\n } = options\n\n if (required) {\n const hasChildren = value?.root?.children?.length\n\n const hasOnlyEmptyParagraph =\n (value?.root?.children?.length === 1 &&\n value?.root?.children[0]?.type === 'paragraph' &&\n (value?.root?.children[0] as SerializedParagraphNode)?.children?.length === 0) ||\n ((value?.root?.children[0] as SerializedParagraphNode)?.children?.length === 1 &&\n (value?.root?.children[0] as SerializedParagraphNode)?.children[0]?.type === 'text' &&\n (value?.root?.children[0] as SerializedParagraphNode)?.children[0]?.['text'] === '')\n\n if (!hasChildren || hasOnlyEmptyParagraph) {\n return t('validation:required')\n }\n }\n\n // Traverse through nodes and validate them. Just like a node can hook into the population process (e.g. link or relationship nodes),\n // they can also hook into the validation process. E.g. a block node probably has fields with validation rules.\n\n const rootNodes = value?.root?.children\n if (rootNodes && Array.isArray(rootNodes) && rootNodes?.length) {\n return await validateNodes({\n nodeValidations: editorConfig.features.validations,\n nodes: rootNodes,\n validation: {\n options,\n value,\n },\n })\n }\n\n return true\n }\n\n return richTextValidate\n}\n"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["validateNodes","richTextValidateHOC","editorConfig","richTextValidate","value","options","req","t","required","hasChildren","root","children","length","hasOnlyEmptyParagraph","type","rootNodes","Array","isArray","nodeValidations","features","validations","nodes","validation"],"sources":["../../src/validate/index.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedParagraphNode } from 'lexical'\nimport type { RichTextField, Validate } from 'payload'\n\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\n\nimport { validateNodes } from './validateNodes.js'\n\nexport const richTextValidateHOC = ({\n editorConfig,\n}: {\n editorConfig: SanitizedServerEditorConfig\n}) => {\n const richTextValidate: Validate<SerializedEditorState, unknown, unknown, RichTextField> = async (\n value,\n options,\n ) => {\n const {\n req: { t },\n required,\n } = options\n\n if (required) {\n const hasChildren = value?.root?.children?.length\n\n const hasOnlyEmptyParagraph =\n (value?.root?.children?.length === 1 &&\n value?.root?.children[0]?.type === 'paragraph' &&\n (value?.root?.children[0] as SerializedParagraphNode)?.children?.length === 0) ||\n ((value?.root?.children[0] as SerializedParagraphNode)?.children?.length === 1 &&\n (value?.root?.children[0] as SerializedParagraphNode)?.children[0]?.type === 'text' &&\n (value?.root?.children[0] as SerializedParagraphNode)?.children[0]?.['text'] === '')\n\n if (!hasChildren || hasOnlyEmptyParagraph) {\n return t('validation:required')\n }\n }\n\n // Traverse through nodes and validate them. Just like a node can hook into the population process (e.g. link or relationship nodes),\n // they can also hook into the validation process. E.g. a block node probably has fields with validation rules.\n\n const rootNodes = value?.root?.children\n if (rootNodes && Array.isArray(rootNodes) && rootNodes?.length) {\n return await validateNodes({\n nodeValidations: editorConfig.features.validations,\n nodes: rootNodes,\n validation: {\n options,\n value,\n },\n })\n }\n\n return true\n }\n\n return richTextValidate\n}\n"],"mappings":"AAKA,SAASA,aAAa,QAAQ;AAE9B,OAAO,MAAMC,mBAAA,GAAsBA,CAAC;EAClCC;AAAY,CAGb;EACC,MAAMC,gBAAA,GAAqF,MAAAA,CACzFC,KAAA,EACAC,OAAA;IAEA,MAAM;MACJC,GAAA,EAAK;QAAEC;MAAC,CAAE;MACVC;IAAQ,CACT,GAAGH,OAAA;IAEJ,IAAIG,QAAA,EAAU;MACZ,MAAMC,WAAA,GAAcL,KAAA,EAAOM,IAAA,EAAMC,QAAA,EAAUC,MAAA;MAE3C,MAAMC,qBAAA,GACJT,KAAC,EAAOM,IAAA,EAAMC,QAAA,EAAUC,MAAA,KAAW,KACjCR,KAAA,EAAOM,IAAA,EAAMC,QAAQ,CAAC,EAAE,EAAEG,IAAA,KAAS,eACnCV,KAAC,EAAOM,IAAA,EAAMC,QAAQ,CAAC,EAAE,EAA8BA,QAAA,EAAUC,MAAA,KAAW,KAC7ER,KAAC,EAAOM,IAAA,EAAMC,QAAQ,CAAC,EAAE,EAA8BA,QAAA,EAAUC,MAAA,KAAW,KAC3ER,KAAC,EAAOM,IAAA,EAAMC,QAAQ,CAAC,EAAE,EAA8BA,QAAQ,CAAC,EAAE,EAAEG,IAAA,KAAS,UAC7EV,KAAC,EAAOM,IAAA,EAAMC,QAAQ,CAAC,EAAE,EAA8BA,QAAQ,CAAC,EAAE,GAAG,OAAO,KAAK;MAErF,IAAI,CAACF,WAAA,IAAeI,qBAAA,EAAuB;QACzC,OAAON,CAAA,CAAE;MACX;IACF;IAEA;IACA;IAEA,MAAMQ,SAAA,GAAYX,KAAA,EAAOM,IAAA,EAAMC,QAAA;IAC/B,IAAII,SAAA,IAAaC,KAAA,CAAMC,OAAO,CAACF,SAAA,KAAcA,SAAA,EAAWH,MAAA,EAAQ;MAC9D,OAAO,MAAMZ,aAAA,CAAc;QACzBkB,eAAA,EAAiBhB,YAAA,CAAaiB,QAAQ,CAACC,WAAW;QAClDC,KAAA,EAAON,SAAA;QACPO,UAAA,EAAY;UACVjB,OAAA;UACAD;QACF;MACF;IACF;IAEA,OAAO;EACT;EAEA,OAAOD,gBAAA;AACT","ignoreList":[]}
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
export async function validateNodes({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if ('children' in node && node?.children) {
|
|
19
|
-
const childrenValidationResult = await validateNodes({
|
|
20
|
-
nodeValidations,
|
|
21
|
-
nodes: node.children,
|
|
22
|
-
validation: validationFromProps
|
|
23
|
-
});
|
|
24
|
-
if (childrenValidationResult !== true) {
|
|
25
|
-
return childrenValidationResult;
|
|
26
|
-
}
|
|
1
|
+
export async function validateNodes({
|
|
2
|
+
nodeValidations,
|
|
3
|
+
nodes,
|
|
4
|
+
validation: validationFromProps
|
|
5
|
+
}) {
|
|
6
|
+
for (const node of nodes) {
|
|
7
|
+
// Validate node
|
|
8
|
+
if (nodeValidations && typeof nodeValidations?.has === 'function' && nodeValidations?.has(node.type)) {
|
|
9
|
+
const validations = nodeValidations.get(node.type);
|
|
10
|
+
for (const validation of validations) {
|
|
11
|
+
const validationResult = await validation({
|
|
12
|
+
node,
|
|
13
|
+
nodeValidations,
|
|
14
|
+
validation: validationFromProps
|
|
15
|
+
});
|
|
16
|
+
if (validationResult !== true) {
|
|
17
|
+
return `${node.type} node failed to validate: ${validationResult}`;
|
|
27
18
|
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
// Validate node's children
|
|
22
|
+
if ('children' in node && node?.children) {
|
|
23
|
+
const childrenValidationResult = await validateNodes({
|
|
24
|
+
nodeValidations,
|
|
25
|
+
nodes: node.children,
|
|
26
|
+
validation: validationFromProps
|
|
27
|
+
});
|
|
28
|
+
if (childrenValidationResult !== true) {
|
|
29
|
+
return childrenValidationResult;
|
|
30
|
+
}
|
|
28
31
|
}
|
|
29
|
-
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
30
34
|
}
|
|
31
|
-
|
|
32
35
|
//# sourceMappingURL=validateNodes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/validate/validateNodes.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\nimport type { RichTextField, ValidateOptions } from 'payload'\n\nimport type { NodeValidation } from '../features/typesServer.js'\n\nexport async function validateNodes({\n nodeValidations,\n nodes,\n validation: validationFromProps,\n}: {\n nodeValidations: Map<string, Array<NodeValidation>>\n nodes: SerializedLexicalNode[]\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}): Promise<string | true> {\n for (const node of nodes) {\n // Validate node\n if (\n nodeValidations &&\n typeof nodeValidations?.has === 'function' &&\n nodeValidations?.has(node.type)\n ) {\n const validations = nodeValidations.get(node.type)\n for (const validation of validations) {\n const validationResult = await validation({\n node,\n nodeValidations,\n validation: validationFromProps,\n })\n if (validationResult !== true) {\n return `${node.type} node failed to validate: ${validationResult}`\n }\n }\n }\n\n // Validate node's children\n if ('children' in node && node?.children) {\n const childrenValidationResult = await validateNodes({\n nodeValidations,\n nodes: node.children as SerializedLexicalNode[],\n validation: validationFromProps,\n })\n if (childrenValidationResult !== true) {\n return childrenValidationResult\n }\n }\n }\n\n return true\n}\n"],"
|
|
1
|
+
{"version":3,"file":"validateNodes.js","names":["validateNodes","nodeValidations","nodes","validation","validationFromProps","node","has","type","validations","get","validationResult","children","childrenValidationResult"],"sources":["../../src/validate/validateNodes.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\nimport type { RichTextField, ValidateOptions } from 'payload'\n\nimport type { NodeValidation } from '../features/typesServer.js'\n\nexport async function validateNodes({\n nodeValidations,\n nodes,\n validation: validationFromProps,\n}: {\n nodeValidations: Map<string, Array<NodeValidation>>\n nodes: SerializedLexicalNode[]\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}): Promise<string | true> {\n for (const node of nodes) {\n // Validate node\n if (\n nodeValidations &&\n typeof nodeValidations?.has === 'function' &&\n nodeValidations?.has(node.type)\n ) {\n const validations = nodeValidations.get(node.type)\n for (const validation of validations) {\n const validationResult = await validation({\n node,\n nodeValidations,\n validation: validationFromProps,\n })\n if (validationResult !== true) {\n return `${node.type} node failed to validate: ${validationResult}`\n }\n }\n }\n\n // Validate node's children\n if ('children' in node && node?.children) {\n const childrenValidationResult = await validateNodes({\n nodeValidations,\n nodes: node.children as SerializedLexicalNode[],\n validation: validationFromProps,\n })\n if (childrenValidationResult !== true) {\n return childrenValidationResult\n }\n }\n }\n\n return true\n}\n"],"mappings":"AAKA,OAAO,eAAeA,cAAc;EAClCC,eAAe;EACfC,KAAK;EACLC,UAAA,EAAYC;AAAmB,CAQhC;EACC,KAAK,MAAMC,IAAA,IAAQH,KAAA,EAAO;IACxB;IACA,IACED,eAAA,IACA,OAAOA,eAAA,EAAiBK,GAAA,KAAQ,cAChCL,eAAA,EAAiBK,GAAA,CAAID,IAAA,CAAKE,IAAI,GAC9B;MACA,MAAMC,WAAA,GAAcP,eAAA,CAAgBQ,GAAG,CAACJ,IAAA,CAAKE,IAAI;MACjD,KAAK,MAAMJ,UAAA,IAAcK,WAAA,EAAa;QACpC,MAAME,gBAAA,GAAmB,MAAMP,UAAA,CAAW;UACxCE,IAAA;UACAJ,eAAA;UACAE,UAAA,EAAYC;QACd;QACA,IAAIM,gBAAA,KAAqB,MAAM;UAC7B,OAAO,GAAGL,IAAA,CAAKE,IAAI,6BAA6BG,gBAAA,EAAkB;QACpE;MACF;IACF;IAEA;IACA,IAAI,cAAcL,IAAA,IAAQA,IAAA,EAAMM,QAAA,EAAU;MACxC,MAAMC,wBAAA,GAA2B,MAAMZ,aAAA,CAAc;QACnDC,eAAA;QACAC,KAAA,EAAOG,IAAA,CAAKM,QAAQ;QACpBR,UAAA,EAAYC;MACd;MACA,IAAIQ,wBAAA,KAA6B,MAAM;QACrC,OAAOA,wBAAA;MACT;IACF;EACF;EAEA,OAAO;AACT","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/richtext-lexical",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.86",
|
|
4
4
|
"description": "The officially supported Lexical richtext adapter for Payload",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -57,19 +57,27 @@
|
|
|
57
57
|
"uuid": "10.0.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
+
"@babel/cli": "^7.24.5",
|
|
61
|
+
"@babel/core": "^7.24.5",
|
|
62
|
+
"@babel/preset-env": "^7.24.5",
|
|
63
|
+
"@babel/preset-react": "^7.24.1",
|
|
64
|
+
"@babel/preset-typescript": "^7.24.1",
|
|
60
65
|
"@lexical/eslint-plugin": "0.17.0",
|
|
61
66
|
"@types/json-schema": "7.0.15",
|
|
62
67
|
"@types/node": "20.12.5",
|
|
63
68
|
"@types/react": "npm:types-react@19.0.0-rc.0",
|
|
64
69
|
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.0",
|
|
70
|
+
"babel-plugin-react-compiler": "0.0.0-experimental-1cd8995-20240814",
|
|
71
|
+
"babel-plugin-transform-remove-imports": "^1.8.0",
|
|
65
72
|
"esbuild": "0.23.0",
|
|
66
73
|
"esbuild-sass-plugin": "3.3.1",
|
|
74
|
+
"eslint-plugin-react-compiler": "0.0.0-experimental-d0e920e-20240815",
|
|
67
75
|
"swc-plugin-transform-remove-imports": "1.15.0",
|
|
68
76
|
"@payloadcms/eslint-config": "3.0.0-beta.59",
|
|
69
|
-
"@payloadcms/
|
|
70
|
-
"@payloadcms/
|
|
71
|
-
"
|
|
72
|
-
"
|
|
77
|
+
"@payloadcms/ui": "3.0.0-beta.86",
|
|
78
|
+
"@payloadcms/next": "3.0.0-beta.86",
|
|
79
|
+
"payload": "3.0.0-beta.86",
|
|
80
|
+
"@payloadcms/translations": "3.0.0-beta.86"
|
|
73
81
|
},
|
|
74
82
|
"peerDependencies": {
|
|
75
83
|
"@faceless-ui/modal": "3.0.0-beta.2",
|
|
@@ -87,10 +95,10 @@
|
|
|
87
95
|
"lexical": "0.17.0",
|
|
88
96
|
"react": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801",
|
|
89
97
|
"react-dom": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801",
|
|
90
|
-
"@payloadcms/
|
|
91
|
-
"@payloadcms/
|
|
92
|
-
"
|
|
93
|
-
"
|
|
98
|
+
"@payloadcms/translations": "3.0.0-beta.86",
|
|
99
|
+
"@payloadcms/ui": "3.0.0-beta.86",
|
|
100
|
+
"@payloadcms/next": "3.0.0-beta.86",
|
|
101
|
+
"payload": "3.0.0-beta.86"
|
|
94
102
|
},
|
|
95
103
|
"engines": {
|
|
96
104
|
"node": "^18.20.2 || >=20.9.0"
|
|
@@ -103,11 +111,14 @@
|
|
|
103
111
|
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.0"
|
|
104
112
|
},
|
|
105
113
|
"scripts": {
|
|
106
|
-
"build": "
|
|
114
|
+
"build": "pnpm build:reactcompiler",
|
|
115
|
+
"build:babel": "rm -rf dist_optimized && babel dist --out-dir dist_optimized --source-maps --extensions .ts,.js,.tsx,.jsx,.cjs,.mjs && rm -rf dist && mv dist_optimized dist",
|
|
107
116
|
"build:clean": "find . \\( -type d \\( -name build -o -name dist -o -name .cache \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} + && pnpm build",
|
|
108
|
-
"build:esbuild": "node bundle.js",
|
|
117
|
+
"build:esbuild": "node bundle.js && rm -rf dist/exports/client && mv dist/exports/client_optimized dist/exports/client",
|
|
118
|
+
"build:reactcompiler": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm build:swc && pnpm build:babel && pnpm copyfiles && pnpm build:esbuild && pnpm build:types",
|
|
109
119
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|
|
110
120
|
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
121
|
+
"build_without_reactcompiler": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm copyfiles && pnpm build:types && pnpm build:swc && pnpm build:esbuild && rm -rf dist/exports/client && mv dist/exports/client_unoptimized dist/exports/client",
|
|
111
122
|
"clean": "rimraf {dist,*.tsbuildinfo}",
|
|
112
123
|
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
|
|
113
124
|
"translateNewKeys": "node --no-deprecation --import @swc-node/register/esm-register scripts/translateNewKeys.ts"
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";var d=o=>{let{data:n}=o;return t("div",{children:["Unknown converted payload-plugin-lexical node: ",e("strong",{children:n?.nodeType})]})};export{d as UnknownConvertedNodeComponent};
|
|
2
|
-
//# sourceMappingURL=Component-7HS6FEJS.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\n\nimport type { UnknownConvertedNodeData } from './index.js'\n\ntype Props = {\n data: UnknownConvertedNodeData\n}\n\nexport const UnknownConvertedNodeComponent: React.FC<Props> = (props) => {\n const { data } = props\n\n return (\n <div>\n Unknown converted payload-plugin-lexical node: <strong>{data?.nodeType}</strong>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAYI,OACiD,OAAAA,EADjD,QAAAC,MAAA,oBAJG,IAAMC,EAAkDC,GAAU,CACvE,GAAM,CAAE,KAAAC,CAAK,EAAID,EAEjB,OACEF,EAAC,OAAI,4DAC4CD,EAAC,UAAQ,SAAAI,GAAM,SAAS,GACzE,CAEJ",
|
|
6
|
-
"names": ["jsx", "jsxs", "UnknownConvertedNodeComponent", "props", "data"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\n\nimport type { UnknownConvertedNodeData } from './index.js'\n\ntype Props = {\n data: UnknownConvertedNodeData\n}\n\nexport const UnknownConvertedNodeComponent: React.FC<Props> = (props) => {\n const { data } = props\n\n return (\n <div>\n Unknown converted Slate node: <strong>{data?.nodeType}</strong>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAYI,OACgC,OAAAA,EADhC,QAAAC,MAAA,oBAJG,IAAMC,EAAkDC,GAAU,CACvE,GAAM,CAAE,KAAAC,CAAK,EAAID,EAEjB,OACEF,EAAC,OAAI,2CAC2BD,EAAC,UAAQ,SAAAI,GAAM,SAAS,GACxD,CAEJ",
|
|
6
|
-
"names": ["jsx", "jsxs", "UnknownConvertedNodeComponent", "props", "data"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";import{a as fe,b as ge,c as ye,d as he,e as K,f as D,h as Ee}from"./chunk-EBB2CEB6.js";import{a as pe,b as P}from"./chunk-SQHN3N6E.js";import{FieldDescription as zt,FieldError as $t,FieldLabel as Gt,useField as Kt,useFieldProps as Wt,withCondition as Yt}from"@payloadcms/ui";import{useCallback as Vt}from"react";import{ErrorBoundary as Ut}from"react-error-boundary";import{LexicalComposer as _t}from"@lexical/react/LexicalComposer.js";import*as Je from"react";import{useMemo as qe}from"react";import{useLexicalComposerContext as wt}from"@lexical/react/LexicalComposerContext.js";import{LexicalErrorBoundary as It}from"@lexical/react/LexicalErrorBoundary.js";import{HistoryPlugin as Dt}from"@lexical/react/LexicalHistoryPlugin.js";import{OnChangePlugin as Ft}from"@lexical/react/LexicalOnChangePlugin.js";import{RichTextPlugin as Bt}from"@lexical/react/LexicalRichTextPlugin.js";import{TabIndentationPlugin as Ot}from"@lexical/react/LexicalTabIndentationPlugin.js";import{BLUR_COMMAND as Ht,COMMAND_PRIORITY_LOW as Ye,FOCUS_COMMAND as At}from"lexical";import*as j from"react";import{useEffect as Ve,useState as Ue}from"react";import{jsx as xe}from"react/jsx-runtime";var _=({anchorElem:t,clientProps:e,plugin:i})=>i.position==="floatingAnchorElem"?i.Component&&xe(i.Component,{anchorElem:t,clientProps:e}):i.Component&&xe(i.Component,{clientProps:e});import{MarkdownShortcutPlugin as Ze}from"@lexical/react/LexicalMarkdownShortcutPlugin.js";import{jsx as et}from"react/jsx-runtime";var be=()=>{let{editorConfig:t}=P();return et(Ze,{transformers:t.features.markdownTransformers})};import{useLexicalComposerContext as ot}from"@lexical/react/LexicalComposerContext.js";import{useFieldProps as Me,useTranslation as Le}from"@payloadcms/ui";import{useCallback as Te,useMemo as nt,useState as rt}from"react";import*as Pe from"react-dom";import{useCallback as tt}from"react";function Ce(t,{maxLength:e=75,minLength:i=1}){return tt(({query:a})=>{let n="[^"+t+ge+"\\s]",u=new RegExp("(^|\\s|\\()(["+t+"]((?:"+n+"){0,"+e+"}))$").exec(a);if(u!==null){let f=u[1],s=u[3];if(s.length>=i)return{leadOffset:u.index+f.length,matchingString:s,replaceableString:u[2]}}return null},[e,i,t])}import{jsx as W,jsxs as Re}from"react/jsx-runtime";var k="slash-menu-popup";function it({isSelected:t,item:e,onClick:i,onMouseEnter:a}){let{field:{richTextComponentMap:n}}=P(),{schemaPath:p}=Me(),{i18n:u}=Le(),f=`${k}__item ${k}__item-${e.key}`;t&&(f+=` ${k}__item--selected`);let s=e.key;return e.label&&(s=typeof e.label=="function"?e.label({i18n:u,richTextComponentMap:n,schemaPath:p}):e.label),s.length>25&&(s=s.substring(0,25)+"..."),Re("button",{"aria-selected":t,className:f,id:k+"__item-"+e.key,onClick:i,onMouseEnter:a,ref:d=>{e.ref={current:d}},role:"option",tabIndex:-1,type:"button",children:[e?.Icon&&W(e.Icon,{}),W("span",{className:`${k}__item-text`,children:s})]},e.key)}function ve({anchorElem:t=document.body}){let[e]=ot(),[i,a]=rt(null),{editorConfig:n}=P(),{i18n:p}=Le(),{field:{richTextComponentMap:u}}=P(),{schemaPath:f}=Me(),s=Ce("/",{minLength:0}),d=Te(()=>{let l=[];for(let r of n.features.slashMenu.dynamicGroups){let y=r({editor:e,queryString:i});l=l.concat(y)}return l},[e,i,n?.features]),h=nt(()=>{let l=[];for(let r of n?.features.slashMenu.groups??[])l.push(r);if(i){l=l.map(y=>{let E=y.items.filter(m=>{let g=m.key;return m.label&&(g=typeof m.label=="function"?m.label({i18n:p,richTextComponentMap:u,schemaPath:f}):m.label),new RegExp(i,"gi").exec(g)?!0:m.keywords!=null?m.keywords.some(c=>new RegExp(i,"gi").exec(c)):!1});return E.length?{...y,items:E}:null}),l=l.filter(y=>y!=null);let r=d();for(let y of r){let E=l.find(m=>m.key===y.key);E?l=l.filter(m=>m.key!==y.key):E={...y,items:[]},E?.items?.length&&(E.items=E.items.concat(E.items)),l.push(E)}}return l},[d,i,n?.features,p]),o=Te((l,r,y,E)=>{r&&e.update(()=>{r.remove()}),l.onSelect({editor:e,queryString:E}),y()},[e]);return W(he,{anchorElem:t,groups:h,menuRenderFn:(l,{selectItemAndCleanUp:r,selectedItemKey:y,setSelectedItemKey:E})=>l.current&&h.length?Pe.createPortal(W("div",{className:k,children:h.map(m=>{let g=m.key;return m.label&&(g=typeof m.label=="function"?m.label({i18n:p,richTextComponentMap:u,schemaPath:f}):m.label),Re("div",{className:`${k}__group ${k}__group-${m.key}`,children:[W("div",{className:`${k}__group-title`,children:g}),m.items.map((c,x)=>W(it,{index:x,isSelected:y===c.key,item:c,onClick:()=>{E(c.key),r(c)},onMouseEnter:()=>{E(c.key)}},c.key))]},m.key)})}),l.current):null,onQueryChange:a,onSelectItem:o,triggerFn:s})}import{useLexicalComposerContext as dt}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as ut}from"lexical";import*as we from"react";import{useCallback as ft,useEffect as ke,useRef as pt,useState as gt}from"react";import{createPortal as yt}from"react-dom";var Y=(t,e,i,a,n=50,p=25)=>{let u=0;if(t&&!t.contains(a)){let{bottom:f,left:s,right:d,top:h}=t.getBoundingClientRect(),o=h+window.scrollY,l=f+window.scrollY;if(i<o-p||i>l+p||e<s-n||e>d+n)return-1;(e<s||e>d)&&(u=e<s?e-s:e-d)}return u};import{$getNodeByKey as ee}from"lexical";function F(t){let e=t.getBoundingClientRect(),i=getComputedStyle(t).getPropertyValue("transform");if(!i||i==="none")return e;let a=i.split(",").pop();return e.y=e.y-Number(a.replace(")","")),e}function Z(t){let e=(s,d)=>s?parseFloat(window.getComputedStyle(s)[d]):0,{marginBottom:i,marginTop:a}=window.getComputedStyle(t),n=e(t.previousElementSibling,"marginBottom"),p=e(t.nextElementSibling,"marginTop"),u=Math.max(parseFloat(a),n);return{marginBottom:Math.max(parseFloat(i),p),marginTop:u}}import{$getRoot as lt}from"lexical";function z(t){return t.getEditorState().read(()=>lt().getChildrenKeys())}var at=1,st=-1,Ne=0,w={props:null,result:null};function ct(t,e,i=20){let a=t.x-e.x,n=t.y-e.y;return a*a+n*n<=i*i}function V(t){let{anchorElem:e,cache_threshold:i=20,editor:a,fuzzy:n=!1,horizontalOffset:p=0,point:{x:u,y:f},startIndex:s=0,useEdgeAsDefault:d=!1,verbose:h=!1}=t;if(i>0&&w.props&&w.result&&w.props.fuzzy===t.fuzzy&&w.props.horizontalOffset===t.horizontalOffset&&w.props.useEdgeAsDefault===t.useEdgeAsDefault&&ct(w.props.point,t.point,i))return w.result;let o=e.getBoundingClientRect(),l=z(a),r={blockElem:null,blockNode:null,distance:1/0,foundAtIndex:-1,isFoundNodeEmptyParagraph:!1};return a.getEditorState().read(()=>{if(d){let[m,g]=[a.getElementByKey(l[0]),a.getElementByKey(l[l.length-1])],[c,x]=[F(m),F(g)];if(c&&x&&(f<c.top?(r.blockElem=m,r.distance=c.top-f,r.blockNode=ee(l[0]),r.foundAtIndex=0):f>x.bottom&&(r.distance=f-x.bottom,r.blockNode=ee(l[l.length-1]),r.blockElem=g,r.foundAtIndex=l.length-1),r?.blockElem))return{blockElem:null,isFoundNodeEmptyParagraph:!1}}let y=s,E=Ne;for(;y>=0&&y<l.length;){let m=l[y],g=a.getElementByKey(m);if(g===null)break;let c=new D(u+p,f),x=Ee.fromDOMRect(F(g)),{marginBottom:v,marginTop:M}=Z(g),R=x.generateNewRect({bottom:x.bottom+v,left:o.left,right:o.right,top:x.top-M}),{distance:L,isOnBottomSide:b,isOnTopSide:O}=R.distanceFromPoint(c);if(L===0){r.blockElem=g,r.blockNode=ee(m),r.foundAtIndex=y,r.distance=L,r.blockNode&&r.blockNode.getType()==="paragraph"&&r.blockNode.getTextContent()===""&&(!n&&!t.returnEmptyParagraphs&&(r.blockElem=null,r.blockNode=null),r.isFoundNodeEmptyParagraph=!0);break}else n&&L<r.distance&&(r.blockElem=g,r.blockNode=ee(m),r.distance=L,r.foundAtIndex=y);E===Ne&&(O?E=st:b?E=at:E=1/0),y+=E}}),w.props=t,w.result={blockElem:r.blockElem,blockNode:r.blockNode,foundAtIndex:r.foundAtIndex,isFoundNodeEmptyParagraph:r.isFoundNodeEmptyParagraph},{blockElem:r.blockElem,blockNode:r.blockNode,foundAtIndex:r.foundAtIndex,isFoundNodeEmptyParagraph:r.isFoundNodeEmptyParagraph}}function te(t,e){return!!t.closest(`.${e}`)}var mt=["IMG","INPUT","TEXTAREA","SELECT","BUTTON","VIDEO","OBJECT","EMBED","IFRAME","HR"];function Se(t){if(!t||mt.includes(t.tagName)||t.offsetHeight===0||t.offsetWidth===0)return!1;let e=window.getComputedStyle(t);return!(e.display==="table-cell"||e.position==="absolute"||e.visibility==="hidden"||e.opacity==="0")}function oe(t,e,i,a=0){if(!t){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let n=t.getBoundingClientRect(),p=window.getComputedStyle(t),u=e.getBoundingClientRect(),f=i.getBoundingClientRect(),s;if(n.height<60)s=n.top-u.height/2-f.top+n.height/2-1;else{let o=Se(t)?parseInt(p.lineHeight,10):0;s=n.top+(o-u.height)/2-f.top-1}let h=a;e.style.opacity="1",e.style.transform=`translate(${h}px, ${s}px)`}import{jsx as me}from"react/jsx-runtime";var ht="add-block-menu",ne=1/0;function Et(t){return t===0?1/0:ne>=0&&ne<t?ne:Math.floor(t/2)}function xt(t,e,i){let a=e.parentElement,{editorConfig:n}=P(),p=n?.admin?.hideGutter?-24:12,u=pt(null),[f,s]=gt(null);ke(()=>{function h(o){let l=o.target;if(!K(l))return;let r=Y(a,o.pageX,o.pageY,l);if(r===-1){s(null);return}if(te(l,ht))return;let y=z(t),{blockElem:E,blockNode:m,foundAtIndex:g}=V({anchorElem:e,cache_threshold:0,editor:t,horizontalOffset:-r,point:new D(o.x,o.y),returnEmptyParagraphs:!0,startIndex:Et(y.length),useEdgeAsDefault:!1});ne=g,E&&(f?.node!==m||f?.elem!==E)&&s({elem:E,node:m})}return document?.addEventListener("mousemove",h),()=>{document?.removeEventListener("mousemove",h)}},[a,e,t,f]),ke(()=>{u.current&&f?.node&&oe(f?.elem,u.current,e,p)},[e,f,p]);let d=ft(h=>{let o=f;o?.node&&(t.update(()=>{let l=!0;if((o.node.getType()!=="paragraph"||o.node.getTextContent()!=="")&&(l=!1),!l){let r=ut();o.node.insertAfter(r),setTimeout(()=>{o={elem:t.getElementByKey(r.getKey()),node:r},s(o)},0)}}),setTimeout(()=>{t.update(()=>{t.focus(),o.node&&"select"in o.node&&typeof o.node.select=="function"&&o.node.select()})},1),setTimeout(()=>{t.dispatchCommand(ye,{node:o.node})},2),h.stopPropagation(),h.preventDefault())},[t,f]);return yt(me(we.Fragment,{children:me("button",{className:"icon add-block-menu",onClick:h=>{d(h)},ref:u,type:"button",children:me("div",{className:i?"icon":""})})}),e)}function Ie({anchorElem:t=document.body}){let[e]=dt();return xt(e,t,e._editable)}import{useLexicalComposerContext as Tt}from"@lexical/react/LexicalComposerContext.js";import{eventFiles as Be}from"@lexical/rich-text";import{$getNearestNodeFromDOMNode as Oe,$getNodeByKey as Mt}from"lexical";import*as $e from"react";import{useEffect as de,useRef as re,useState as He}from"react";import{createPortal as Lt}from"react-dom";function De(t,e,i){if(!t.current)return;let{left:a,top:n}=i.getBoundingClientRect(),p=F(e),u=p.width,f=p.height,s=p.top-n,d=p.left-a;t.current.style.border="2px solid green",t.current.style.boxSizing="border-box",t.current.style.height=f+"px",t.current.style.pointerEvents="none",t.current.style.position="absolute",t.current.style.top=s+"px",t.current.style.left=d+"px",t.current.style.width=u+"px",t.current.style.zIndex="1000",t.current.style.opacity="0.5"}var U=25,bt=-24,Ct=!1,$=0;function Fe(t,e,i,a,n,p,u,f,s,d=!1){let{height:h,top:o}=a.getBoundingClientRect(),{top:l,width:r}=u.getBoundingClientRect(),{marginBottom:y,marginTop:E}=Z(a),m=o,g=p>=o+h/2+window.scrollY,c=!1;if(n?.elem)if(a!==n?.elem)(g&&n?.elem&&n?.elem===a.nextElementSibling||!g&&n?.elem&&n?.elem===a.previousElementSibling)&&($++,$<200&&(c=!0));else{$++;let L=n?.boundingBox?.y,b=a.getBoundingClientRect().y;(g===n?.isBelow&&L===b||$<200)&&(c=!1)}if(c)return{isBelow:g,willStayInSamePosition:c};d?m+=h/2:g?m+=h+y/2:m-=E/2;let x=0;d||(g?x=-U:x=U);let v=m-l+x,M=bt-e;i.style.width=`calc(${r}px - ${t})`,i.style.opacity=".4";let R=12;return d?i.style.transform=`translate(${M}px, ${v-U}px)`:g?(a.style.marginBottom=U*2+R+"px",i.style.transform=`translate(${M}px, calc(${v}px - 0px))`):(a.style.marginTop=U*2+R+"px",i.style.transform=`translate(${M}px, calc(${v-U*2}px - 0px))`),Ct&&De(s,a,u),n.elem.style.opacity="",n?.elem===a?g?n.elem.style.marginTop="":n.elem.style.marginBottom="":(n.elem.style.marginBottom="",n.elem.style.marginTop=""),$=0,{isBelow:g,willStayInSamePosition:c}}import{jsx as ie,jsxs as Nt}from"react/jsx-runtime";var Pt="draggable-block-menu",Ae="application/x-lexical-drag-block",J=1/0;function _e(t){return t===0?1/0:J>=0&&J<t?J:Math.floor(t/2)}function vt(t,e){let{transform:i}=e.style;t.setDragImage(e,0,0),setTimeout(()=>{e.style.transform=i})}function ze(t,e){t&&(t.style.opacity="0"),e&&(e.style.opacity="",e.style.marginBottom="",e.style.marginTop="")}function Rt(t,e,i){let a=e.parentElement,n=re(null),p=re(null),u=re(null),f=re(!1),[s,d]=He(null),[h,o]=He(null),{editorConfig:l}=P(),r=l?.admin?.hideGutter?-44:-8;de(()=>{function m(g){let c=g.target;if(!K(c))return;let x=Y(a,g.pageX,g.pageY,c);if(x===-1){d(null);return}if(te(c,Pt))return;let v=z(t),{blockElem:M,foundAtIndex:R,isFoundNodeEmptyParagraph:L}=V({anchorElem:e,cache_threshold:0,editor:t,horizontalOffset:-x,point:new D(g.x,g.y),startIndex:_e(v.length),useEdgeAsDefault:!1,verbose:!1});J=R,!(!M&&!L)&&s!==M&&d(M)}return document?.addEventListener("mousemove",m),()=>{document?.removeEventListener("mousemove",m)}},[a,e,t,s]),de(()=>{n.current&&oe(s,n.current,e,r)},[e,s,r]),de(()=>{function m(c){if(!f.current)return!1;let[x]=Be(c);if(x)return!1;let{pageY:v,target:M}=c;if(!K(M))return!1;let R=Y(a,c.pageX,c.pageY,M,100,50),L=z(t),{blockElem:b,foundAtIndex:O,isFoundNodeEmptyParagraph:H}=V({anchorElem:e,editor:t,fuzzy:!0,horizontalOffset:-R,point:new D(c.x,c.y),startIndex:_e(L.length),useEdgeAsDefault:!0,verbose:!0});J=O;let N=p.current;if(b===null||N===null)return!1;if(s!==b){let{isBelow:S,willStayInSamePosition:q}=Fe(l?.admin?.hideGutter?"0px":"3rem",r+(l?.admin?.hideGutter?n?.current?.getBoundingClientRect()?.width??0:-(n?.current?.getBoundingClientRect()?.width??0)),N,b,h,v,e,c,u,H);c.preventDefault(),q||o({boundingBox:b.getBoundingClientRect(),elem:b,isBelow:S})}else ze(N,h?.elem),o({boundingBox:b.getBoundingClientRect(),elem:b,isBelow:!1});return!0}function g(c){if(!f.current)return!1;let[x]=Be(c);if(x)return!1;let{dataTransfer:v,pageY:M,target:R}=c,L=v?.getData(Ae)||"";return t.update(()=>{let b=Mt(L);if(!b||!K(R))return!1;let O=Y(a,c.pageX,c.pageY,R,100,50),{blockElem:H,isFoundNodeEmptyParagraph:N}=V({anchorElem:e,editor:t,fuzzy:!0,horizontalOffset:-O,point:new D(c.x,c.y),useEdgeAsDefault:!0});if(!H)return!1;let S=Oe(H);if(!S)return!1;if(S===b)return!0;let{height:q,top:ae}=F(H),ce=M>=ae+q/2+window.scrollY;N?(S.insertBefore(b),S.remove()):ce?S.insertAfter(b):S.insertBefore(b),s!==null&&d(null),document.querySelectorAll(".lexical-block-highlighter").forEach(I=>{I.remove()});let A=t.getElementByKey(b.getKey());setTimeout(()=>{let I=A.getBoundingClientRect(),T=document.createElement("div");T.className="lexical-block-highlighter",document.documentElement.getAttribute("data-theme")==="dark"?T.style.backgroundColor="white":T.style.backgroundColor="black",T.style.transition="opacity 0.1s ease-in-out",T.style.zIndex="1",T.style.pointerEvents="none",T.style.boxSizing="border-box",T.style.borderRadius="4px",T.style.position="absolute",document.body.appendChild(T),T.style.opacity="0.1",T.style.height=`${I.height+8}px`,T.style.width=`${I.width+8}px`,T.style.top=`${I.top+window.scrollY-4}px`,T.style.left=`${I.left-4}px`,setTimeout(()=>{T.style.opacity="0",setTimeout(()=>{T.remove()},1e3)},3e3)},120)}),!0}return document.addEventListener("dragover",m),document.addEventListener("drop",g),()=>{document.removeEventListener("dragover",m),document.removeEventListener("drop",g)}},[a,r,e,t,h,s,l?.admin?.hideGutter]);function y(m){let g=m.dataTransfer;if(!g||!s)return;vt(g,s);let c="";t.update(()=>{let x=Oe(s);x&&(c=x.getKey())}),f.current=!0,g.setData(Ae,c)}function E(){f.current=!1,ze(p.current,h?.elem)}return Lt(Nt($e.Fragment,{children:[ie("div",{className:"icon draggable-block-menu",draggable:!0,onDragEnd:E,onDragStart:y,ref:n,children:ie("div",{className:i?"icon":""})}),ie("div",{className:"draggable-block-target-line",ref:p}),ie("div",{className:"debug-highlight",ref:u})]}),e)}function Ge({anchorElem:t=document.body}){let[e]=Tt();return Rt(e,t,e._editable)}import{ContentEditable as St}from"@lexical/react/LexicalContentEditable.js";import{useTranslation as kt}from"@payloadcms/ui";import{jsx as Ke}from"react/jsx-runtime";function We({className:t}){let{t:e}=kt();return Ke(St,{"aria-placeholder":e("lexical:general:placeholder"),className:t??"ContentEditable__root",placeholder:Ke("p",{className:"editor-placeholder",children:e("lexical:general:placeholder")})})}import{jsx as C,jsxs as X}from"react/jsx-runtime";var je=t=>{let{editorConfig:e,editorContainerRef:i,onChange:a}=t,n=P(),[p]=wt(),[u,f]=Ue(null),s=o=>{o!==null&&f(o)};Ve(()=>{if(!n?.uuid){console.error("Lexical Editor must be used within an EditorConfigProvider");return}n?.parentEditor?.uuid&&n.parentEditor?.registerChild(n.uuid,n);let o=()=>{n.focusEditor(n)},l=()=>{n.blurEditor(n)},r=p.registerCommand(At,()=>(o(),!0),Ye),y=p.registerCommand(Ht,()=>(l(),!0),Ye);return()=>{r(),y(),n.parentEditor?.unregisterChild?.(n.uuid)}},[p,n]);let[d,h]=Ue(!1);return Ve(()=>{let o=()=>{let l=window.matchMedia("(max-width: 768px)").matches;l!==d&&h(l)};return o(),window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[d]),X(j.Fragment,{children:[e.features.plugins.map(o=>{if(o.position==="aboveContainer")return C(_,{clientProps:o.clientProps,plugin:o},o.key)}),X("div",{className:"editor-container",ref:i,children:[e.features.plugins.map(o=>{if(o.position==="top")return C(_,{clientProps:o.clientProps,plugin:o},o.key)}),C(Bt,{ErrorBoundary:It,contentEditable:C("div",{className:"editor-scroller",children:C("div",{className:"editor",ref:s,children:C(We,{})})})}),C(Ft,{ignoreSelectionChange:!0,onChange:(o,l,r)=>{(!r.has("focus")||r.size>1)&&a?.(o,l,r)}}),u&&X(j.Fragment,{children:[!d&&p.isEditable()&&X(j.Fragment,{children:[C(Ge,{anchorElem:u}),C(Ie,{anchorElem:u})]}),e.features.plugins.map(o=>{if(o.position==="floatingAnchorElem"&&!(o.desktopOnly===!0&&d))return C(_,{anchorElem:u,clientProps:o.clientProps,plugin:o},o.key)}),p.isEditable()&&C(j.Fragment,{children:C(ve,{anchorElem:u})})]}),p.isEditable()&&X(j.Fragment,{children:[C(Dt,{}),e?.features?.markdownTransformers?.length>0&&C(be,{})]}),C(Ot,{}),e.features.plugins.map(o=>{if(o.position==="normal")return C(_,{clientProps:o.clientProps,plugin:o},o.key)}),e.features.plugins.map(o=>{if(o.position==="bottom")return C(_,{clientProps:o.clientProps,plugin:o},o.key)})]}),e.features.plugins.map(o=>{if(o.position==="belowContainer")return C(_,{clientProps:o.clientProps,plugin:o},o.key)})]})};import{jsx as B}from"react/jsx-runtime";var Xe=({children:t,providers:e})=>{if(!e?.length)return t;let i=e[0];return e.length>1?B(i,{children:B(Xe,{providers:e.slice(1),children:t})}):B(i,{children:t})},Qe=t=>{let{editorConfig:e,field:i,onChange:a,path:n,readOnly:p,value:u}=t,f=P(),s=Je.useRef(null),d=qe(()=>{let o=u;return e?.features?.hooks?.load?.length&&e.features.hooks.load.forEach(l=>{o=l({incomingEditorState:o})}),o},[e,u]),h=qe(()=>{if(d&&typeof d!="object")throw new Error("The value passed to the Lexical editor is not an object. This is not supported. Please remove the data from the field and start again. This is the value that was passed in: "+JSON.stringify(d));if(d&&Array.isArray(d)&&!("root"in d))throw new Error("You have tried to pass in data from the old Slate editor to the new Lexical editor. The data structure is different, thus you will have to migrate your data. We offer a one-line migration script which migrates all your rich text fields: https://payloadcms.com/docs/beta/lexical/migration#migration-via-migration-script-recommended");if(d&&"jsonContent"in d)throw new Error("You have tried to pass in data from payload-plugin-lexical. The data structure is different, thus you will have to migrate your data. Migration guide: https://payloadcms.com/docs/beta/lexical/migration#migrating-from-payload-plugin-lexical");return{editable:p!==!0,editorState:d!=null?JSON.stringify(d):void 0,namespace:e.lexical.namespace,nodes:[...fe({editorConfig:e})],onError:o=>{throw o},theme:e.lexical.theme}},[e,d,p]);return h?B(_t,{initialConfig:h,children:B(pe,{editorConfig:e,editorContainerRef:s,field:i,parentContext:f,children:B(Xe,{providers:e.features.providers,children:B(je,{editorConfig:e,editorContainerRef:s,onChange:a})})})},n):B("p",{children:"Loading..."})};import"./bundled.css";import{jsx as G,jsxs as ue}from"react/jsx-runtime";var le="rich-text-lexical",jt=t=>{let{descriptionProps:e,editorConfig:i,errorProps:a,field:{name:n,_path:p,admin:{className:u,components:{Description:f,Error:s,Label:d},readOnly:h,style:o,width:l}={},label:r,required:y},field:E,labelProps:m,readOnly:g,validate:c}=t,x=g||h,v=Vt((Q,A)=>{if(typeof c=="function")return c(Q,{...A,props:t,required:y})},[c,y]),{path:M,readOnly:R}=Wt(),L=Kt({path:M??p??n,validate:v}),{formInitializing:b,formProcessing:O,initialValue:H,path:N,setValue:S,showError:q,value:ae}=L,se=x||R||O||b,ce=[le,"field-type",u,q&&"error",se&&`${le}--read-only`,i?.admin?.hideGutter!==!0?`${le}--show-gutter`:null].filter(Boolean).join(" ");return ue("div",{className:ce,style:{...o,width:l},children:[G($t,{CustomError:s,path:N,...a||{},alignCaret:"left"}),G(Gt,{Label:d,label:r,required:y,...m||{}}),ue("div",{className:`${le}__wrap`,children:[G(Ut,{fallbackRender:qt,onReset:()=>{},children:G(Qe,{editorConfig:i,field:E,onChange:Q=>{let A=Q.toJSON();i?.features?.hooks?.save?.length&&i.features.hooks.save.forEach(I=>{A=I({incomingEditorState:A})}),S(A)},path:N,readOnly:se,value:ae},JSON.stringify({initialValue:H,path:N}))}),G(zt,{Description:f,...e||{}})]})]},N)};function qt({error:t}){return ue("div",{className:"errorBoundary",role:"alert",children:[G("p",{children:"Something went wrong:"}),G("pre",{style:{color:"red"},children:t.message})]})}var jn=Yt(jt);export{jn as RichText};
|
|
2
|
-
//# sourceMappingURL=Field-BYB3WX7J.js.map
|