@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
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
5
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
4
6
|
import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
|
|
@@ -10,596 +12,748 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
10
12
|
import { createPortal } from 'react-dom';
|
|
11
13
|
import { MeatballsIcon } from '../../../../../lexical/ui/icons/Meatballs/index.js';
|
|
12
14
|
function computeSelectionCount(selection) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const selectionShape = selection.getShape();
|
|
16
|
+
return {
|
|
17
|
+
columns: selectionShape.toX - selectionShape.fromX + 1,
|
|
18
|
+
rows: selectionShape.toY - selectionShape.fromY + 1
|
|
19
|
+
};
|
|
18
20
|
}
|
|
19
21
|
// This is important when merging cells as there is no good way to re-merge weird shapes (a result
|
|
20
22
|
// of selecting merged cells and non-merged)
|
|
21
23
|
function isTableSelectionRectangular(selection) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
currentRows[currentColumns + j] += node.__rowSpan;
|
|
50
|
-
}
|
|
51
|
-
currentColumns += colSpan;
|
|
24
|
+
const nodes = selection.getNodes();
|
|
25
|
+
const currentRows = [];
|
|
26
|
+
let currentRow = null;
|
|
27
|
+
let expectedColumns = null;
|
|
28
|
+
let currentColumns = 0;
|
|
29
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
30
|
+
const node = nodes[i];
|
|
31
|
+
if ($isTableCellNode(node)) {
|
|
32
|
+
const row = node.getParentOrThrow();
|
|
33
|
+
if ($isTableRowNode(row)) {
|
|
34
|
+
throw new Error('Expected CellNode to have a RowNode parent');
|
|
35
|
+
}
|
|
36
|
+
if (currentRow !== row) {
|
|
37
|
+
if (expectedColumns !== null && currentColumns !== expectedColumns) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (currentRow !== null) {
|
|
41
|
+
expectedColumns = currentColumns;
|
|
42
|
+
}
|
|
43
|
+
currentRow = row;
|
|
44
|
+
currentColumns = 0;
|
|
45
|
+
}
|
|
46
|
+
const colSpan = node.__colSpan;
|
|
47
|
+
for (let j = 0; j < colSpan; j++) {
|
|
48
|
+
if (currentRows[currentColumns + j] === undefined) {
|
|
49
|
+
currentRows[currentColumns + j] = 0;
|
|
52
50
|
}
|
|
51
|
+
currentRows[currentColumns + j] += node.__rowSpan;
|
|
52
|
+
}
|
|
53
|
+
currentColumns += colSpan;
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
+
}
|
|
56
|
+
return (expectedColumns === null || currentColumns === expectedColumns) && currentRows.every(v => v === currentRows[0]);
|
|
55
57
|
}
|
|
56
58
|
function $canUnmerge() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
const selection = $getSelection();
|
|
60
|
+
if ($isRangeSelection(selection) && !selection.isCollapsed() || $isTableSelection(selection) && !selection.anchor.is(selection.focus) || !$isRangeSelection(selection) && !$isTableSelection(selection)) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
const [cell] = $getNodeTriplet(selection.anchor);
|
|
64
|
+
return cell.__colSpan > 1 || cell.__rowSpan > 1;
|
|
63
65
|
}
|
|
64
66
|
function $cellContainsEmptyParagraph(cell) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
if (cell.getChildrenSize() !== 1) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
const firstChild = cell.getFirstChildOrThrow();
|
|
71
|
+
if (!$isParagraphNode(firstChild) || !firstChild.isEmpty()) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
73
75
|
}
|
|
74
76
|
function $selectLastDescendant(node) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
const lastDescendant = node.getLastDescendant();
|
|
78
|
+
if ($isTextNode(lastDescendant)) {
|
|
79
|
+
lastDescendant.select();
|
|
80
|
+
} else if ($isElementNode(lastDescendant)) {
|
|
81
|
+
lastDescendant.selectEnd();
|
|
82
|
+
} else if (lastDescendant !== null) {
|
|
83
|
+
lastDescendant.selectNext();
|
|
84
|
+
}
|
|
83
85
|
}
|
|
84
|
-
function TableActionMenu(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
setCanUnmergeCell($canUnmerge());
|
|
86
|
+
function TableActionMenu(t0) {
|
|
87
|
+
const $ = _c(69);
|
|
88
|
+
const {
|
|
89
|
+
cellMerge,
|
|
90
|
+
contextRef,
|
|
91
|
+
onClose,
|
|
92
|
+
setIsMenuOpen,
|
|
93
|
+
tableCellNode: _tableCellNode
|
|
94
|
+
} = t0;
|
|
95
|
+
const [editor] = useLexicalComposerContext();
|
|
96
|
+
const dropDownRef = useRef(null);
|
|
97
|
+
const [tableCellNode, updateTableCellNode] = useState(_tableCellNode);
|
|
98
|
+
let t1;
|
|
99
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
100
|
+
t1 = {
|
|
101
|
+
columns: 1,
|
|
102
|
+
rows: 1
|
|
103
|
+
};
|
|
104
|
+
$[0] = t1;
|
|
105
|
+
} else {
|
|
106
|
+
t1 = $[0];
|
|
107
|
+
}
|
|
108
|
+
const [selectionCounts, updateSelectionCounts] = useState(t1);
|
|
109
|
+
const [canMergeCells, setCanMergeCells] = useState(false);
|
|
110
|
+
const [canUnmergeCell, setCanUnmergeCell] = useState(false);
|
|
111
|
+
const {
|
|
112
|
+
y
|
|
113
|
+
} = useScrollInfo();
|
|
114
|
+
let t2;
|
|
115
|
+
let t3;
|
|
116
|
+
if ($[1] !== editor || $[2] !== tableCellNode) {
|
|
117
|
+
t2 = () => editor.registerMutationListener(TableCellNode, nodeMutations => {
|
|
118
|
+
const nodeUpdated = nodeMutations.get(tableCellNode.getKey()) === "updated";
|
|
119
|
+
if (nodeUpdated) {
|
|
120
|
+
editor.getEditorState().read(() => {
|
|
121
|
+
updateTableCellNode(tableCellNode.getLatest());
|
|
121
122
|
});
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
dropDownElement.style.top = `${topPosition}px`;
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
skipInitialization: true
|
|
126
|
+
});
|
|
127
|
+
t3 = [editor, tableCellNode];
|
|
128
|
+
$[1] = editor;
|
|
129
|
+
$[2] = tableCellNode;
|
|
130
|
+
$[3] = t2;
|
|
131
|
+
$[4] = t3;
|
|
132
|
+
} else {
|
|
133
|
+
t2 = $[3];
|
|
134
|
+
t3 = $[4];
|
|
135
|
+
}
|
|
136
|
+
useEffect(t2, t3);
|
|
137
|
+
let t4;
|
|
138
|
+
let t5;
|
|
139
|
+
if ($[5] !== editor) {
|
|
140
|
+
t4 = () => {
|
|
141
|
+
editor.getEditorState().read(() => {
|
|
142
|
+
const selection = $getSelection();
|
|
143
|
+
if ($isTableSelection(selection)) {
|
|
144
|
+
const currentSelectionCounts = computeSelectionCount(selection);
|
|
145
|
+
updateSelectionCounts(computeSelectionCount(selection));
|
|
146
|
+
setCanMergeCells(isTableSelectionRectangular(selection) && (currentSelectionCounts.columns > 1 || currentSelectionCounts.rows > 1));
|
|
147
147
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
]
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
148
|
+
setCanUnmergeCell($canUnmerge());
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
t5 = [editor];
|
|
152
|
+
$[5] = editor;
|
|
153
|
+
$[6] = t4;
|
|
154
|
+
$[7] = t5;
|
|
155
|
+
} else {
|
|
156
|
+
t4 = $[6];
|
|
157
|
+
t5 = $[7];
|
|
158
|
+
}
|
|
159
|
+
useEffect(t4, t5);
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
const menuButtonElement = contextRef.current;
|
|
162
|
+
const dropDownElement = dropDownRef.current;
|
|
163
|
+
const rootElement = editor.getRootElement();
|
|
164
|
+
if (menuButtonElement != null && dropDownElement != null && rootElement != null) {
|
|
165
|
+
const rootEleRect = rootElement.getBoundingClientRect();
|
|
166
|
+
const menuButtonRect = menuButtonElement.getBoundingClientRect();
|
|
167
|
+
dropDownElement.style.opacity = "1";
|
|
168
|
+
const dropDownElementRect = dropDownElement.getBoundingClientRect();
|
|
169
|
+
let leftPosition = menuButtonRect.right + 5;
|
|
170
|
+
if (leftPosition + dropDownElementRect.width > window.innerWidth || leftPosition + dropDownElementRect.width > rootEleRect.right) {
|
|
171
|
+
const position = menuButtonRect.left - dropDownElementRect.width - 5;
|
|
172
|
+
leftPosition = (position < 0 ? 5 : position) + window.pageXOffset;
|
|
173
|
+
}
|
|
174
|
+
dropDownElement.style.left = `${leftPosition + window.pageXOffset}px`;
|
|
175
|
+
let topPosition = menuButtonRect.top;
|
|
176
|
+
if (topPosition + dropDownElementRect.height > window.innerHeight) {
|
|
177
|
+
const position_0 = menuButtonRect.bottom - dropDownElementRect.height;
|
|
178
|
+
topPosition = (position_0 < 0 ? 5 : position_0) + window.pageYOffset;
|
|
179
|
+
}
|
|
180
|
+
dropDownElement.style.top = `${topPosition}px`;
|
|
181
|
+
}
|
|
182
|
+
}, [contextRef, dropDownRef, editor, y]);
|
|
183
|
+
let t6;
|
|
184
|
+
if ($[8] !== setIsMenuOpen || $[9] !== contextRef) {
|
|
185
|
+
t6 = [setIsMenuOpen, contextRef];
|
|
186
|
+
$[8] = setIsMenuOpen;
|
|
187
|
+
$[9] = contextRef;
|
|
188
|
+
$[10] = t6;
|
|
189
|
+
} else {
|
|
190
|
+
t6 = $[10];
|
|
191
|
+
}
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
const handleClickOutside = function handleClickOutside(event) {
|
|
194
|
+
if (dropDownRef.current != null && contextRef.current != null && !dropDownRef.current.contains(event.target) && !contextRef.current.contains(event.target)) {
|
|
195
|
+
setIsMenuOpen(false);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
window.addEventListener("click", handleClickOutside);
|
|
199
|
+
return () => window.removeEventListener("click", handleClickOutside);
|
|
200
|
+
}, t6);
|
|
201
|
+
let t7;
|
|
202
|
+
if ($[11] !== editor || $[12] !== tableCellNode) {
|
|
203
|
+
t7 = () => {
|
|
204
|
+
editor.update(() => {
|
|
205
|
+
if (tableCellNode.isAttached()) {
|
|
206
|
+
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
207
|
+
const tableElement = editor.getElementByKey(tableNode.getKey());
|
|
208
|
+
if (!tableElement) {
|
|
209
|
+
throw new Error("Expected to find tableElement in DOM");
|
|
210
|
+
}
|
|
211
|
+
const tableSelection = getTableObserverFromTableElement(tableElement);
|
|
212
|
+
if (tableSelection !== null) {
|
|
213
|
+
tableSelection.clearHighlight();
|
|
214
|
+
}
|
|
215
|
+
tableNode.markDirty();
|
|
216
|
+
updateTableCellNode(tableCellNode.getLatest());
|
|
159
217
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
]
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
218
|
+
const rootNode = $getRoot();
|
|
219
|
+
rootNode.selectStart();
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
$[11] = editor;
|
|
223
|
+
$[12] = tableCellNode;
|
|
224
|
+
$[13] = t7;
|
|
225
|
+
} else {
|
|
226
|
+
t7 = $[13];
|
|
227
|
+
}
|
|
228
|
+
const clearTableSelection = t7;
|
|
229
|
+
let t8;
|
|
230
|
+
if ($[14] !== editor || $[15] !== onClose) {
|
|
231
|
+
t8 = () => {
|
|
232
|
+
editor.update(() => {
|
|
233
|
+
const selection_0 = $getSelection();
|
|
234
|
+
if ($isTableSelection(selection_0)) {
|
|
235
|
+
const {
|
|
236
|
+
columns,
|
|
237
|
+
rows
|
|
238
|
+
} = computeSelectionCount(selection_0);
|
|
239
|
+
const nodes = selection_0.getNodes();
|
|
240
|
+
let firstCell = null;
|
|
241
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
242
|
+
const node = nodes[i];
|
|
243
|
+
if ($isTableCellNode(node)) {
|
|
244
|
+
if (firstCell === null) {
|
|
245
|
+
node.setColSpan(columns).setRowSpan(rows);
|
|
246
|
+
firstCell = node;
|
|
247
|
+
const isEmpty = $cellContainsEmptyParagraph(node);
|
|
248
|
+
let firstChild;
|
|
249
|
+
if (isEmpty && $isParagraphNode(firstChild = node.getFirstChild())) {
|
|
250
|
+
firstChild.remove();
|
|
173
251
|
}
|
|
174
|
-
|
|
175
|
-
if (
|
|
176
|
-
|
|
252
|
+
} else {
|
|
253
|
+
if ($isTableCellNode(firstCell)) {
|
|
254
|
+
const isEmpty_0 = $cellContainsEmptyParagraph(node);
|
|
255
|
+
if (!isEmpty_0) {
|
|
256
|
+
firstCell.append(...node.getChildren());
|
|
257
|
+
}
|
|
258
|
+
node.remove();
|
|
177
259
|
}
|
|
178
|
-
|
|
179
|
-
updateTableCellNode(tableCellNode.getLatest());
|
|
260
|
+
}
|
|
180
261
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
editor,
|
|
186
|
-
tableCellNode
|
|
187
|
-
]);
|
|
188
|
-
const mergeTableCellsAtSelection = ()=>{
|
|
189
|
-
editor.update(()=>{
|
|
190
|
-
const selection = $getSelection();
|
|
191
|
-
if ($isTableSelection(selection)) {
|
|
192
|
-
const { columns, rows } = computeSelectionCount(selection);
|
|
193
|
-
const nodes = selection.getNodes();
|
|
194
|
-
let firstCell = null;
|
|
195
|
-
for(let i = 0; i < nodes.length; i++){
|
|
196
|
-
const node = nodes[i];
|
|
197
|
-
if ($isTableCellNode(node)) {
|
|
198
|
-
if (firstCell === null) {
|
|
199
|
-
node.setColSpan(columns).setRowSpan(rows);
|
|
200
|
-
firstCell = node;
|
|
201
|
-
const isEmpty = $cellContainsEmptyParagraph(node);
|
|
202
|
-
let firstChild;
|
|
203
|
-
if (isEmpty && $isParagraphNode(firstChild = node.getFirstChild())) {
|
|
204
|
-
firstChild.remove();
|
|
205
|
-
}
|
|
206
|
-
} else if ($isTableCellNode(firstCell)) {
|
|
207
|
-
const isEmpty = $cellContainsEmptyParagraph(node);
|
|
208
|
-
if (!isEmpty) {
|
|
209
|
-
firstCell.append(...node.getChildren());
|
|
210
|
-
}
|
|
211
|
-
node.remove();
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
if (firstCell !== null) {
|
|
216
|
-
if (firstCell.getChildrenSize() === 0) {
|
|
217
|
-
firstCell.append($createParagraphNode());
|
|
218
|
-
}
|
|
219
|
-
$selectLastDescendant(firstCell);
|
|
220
|
-
}
|
|
221
|
-
onClose();
|
|
262
|
+
}
|
|
263
|
+
if (firstCell !== null) {
|
|
264
|
+
if (firstCell.getChildrenSize() === 0) {
|
|
265
|
+
firstCell.append($createParagraphNode());
|
|
222
266
|
}
|
|
223
|
-
|
|
267
|
+
$selectLastDescendant(firstCell);
|
|
268
|
+
}
|
|
269
|
+
onClose();
|
|
270
|
+
}
|
|
271
|
+
});
|
|
224
272
|
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
273
|
+
$[14] = editor;
|
|
274
|
+
$[15] = onClose;
|
|
275
|
+
$[16] = t8;
|
|
276
|
+
} else {
|
|
277
|
+
t8 = $[16];
|
|
278
|
+
}
|
|
279
|
+
const mergeTableCellsAtSelection = t8;
|
|
280
|
+
let t9;
|
|
281
|
+
if ($[17] !== editor) {
|
|
282
|
+
t9 = () => {
|
|
283
|
+
editor.update(() => {
|
|
284
|
+
$unmergeCell();
|
|
285
|
+
});
|
|
229
286
|
};
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
editor,
|
|
258
|
-
onClose
|
|
259
|
-
]);
|
|
260
|
-
const deleteTableAtSelection = useCallback(()=>{
|
|
261
|
-
editor.update(()=>{
|
|
262
|
-
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
263
|
-
tableNode.remove();
|
|
264
|
-
clearTableSelection();
|
|
265
|
-
onClose();
|
|
266
|
-
});
|
|
267
|
-
}, [
|
|
268
|
-
editor,
|
|
269
|
-
tableCellNode,
|
|
270
|
-
clearTableSelection,
|
|
271
|
-
onClose
|
|
272
|
-
]);
|
|
273
|
-
const deleteTableColumnAtSelection = useCallback(()=>{
|
|
274
|
-
editor.update(()=>{
|
|
275
|
-
$deleteTableColumn__EXPERIMENTAL();
|
|
276
|
-
onClose();
|
|
277
|
-
});
|
|
278
|
-
}, [
|
|
279
|
-
editor,
|
|
280
|
-
onClose
|
|
281
|
-
]);
|
|
282
|
-
const toggleTableRowIsHeader = useCallback(()=>{
|
|
283
|
-
editor.update(()=>{
|
|
284
|
-
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
285
|
-
const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode);
|
|
286
|
-
const tableRows = tableNode.getChildren();
|
|
287
|
-
if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {
|
|
288
|
-
throw new Error('Expected table cell to be inside of table row.');
|
|
289
|
-
}
|
|
290
|
-
const tableRow = tableRows[tableRowIndex];
|
|
291
|
-
if (!$isTableRowNode(tableRow)) {
|
|
292
|
-
throw new Error('Expected table row');
|
|
293
|
-
}
|
|
294
|
-
tableRow.getChildren().forEach((tableCell)=>{
|
|
295
|
-
if (!$isTableCellNode(tableCell)) {
|
|
296
|
-
throw new Error('Expected table cell');
|
|
297
|
-
}
|
|
298
|
-
tableCell.toggleHeaderStyle(TableCellHeaderStates.ROW);
|
|
299
|
-
});
|
|
300
|
-
clearTableSelection();
|
|
301
|
-
onClose();
|
|
302
|
-
});
|
|
303
|
-
}, [
|
|
304
|
-
editor,
|
|
305
|
-
tableCellNode,
|
|
306
|
-
clearTableSelection,
|
|
307
|
-
onClose
|
|
308
|
-
]);
|
|
309
|
-
const toggleTableColumnIsHeader = useCallback(()=>{
|
|
310
|
-
editor.update(()=>{
|
|
311
|
-
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
312
|
-
const tableColumnIndex = $getTableColumnIndexFromTableCellNode(tableCellNode);
|
|
313
|
-
const tableRows = tableNode.getChildren();
|
|
314
|
-
const maxRowsLength = Math.max(...tableRows.map((row)=>row.getChildren().length));
|
|
315
|
-
if (tableColumnIndex >= maxRowsLength || tableColumnIndex < 0) {
|
|
316
|
-
throw new Error('Expected table cell to be inside of table row.');
|
|
317
|
-
}
|
|
318
|
-
for(let r = 0; r < tableRows.length; r++){
|
|
319
|
-
const tableRow = tableRows[r];
|
|
320
|
-
if (!$isTableRowNode(tableRow)) {
|
|
321
|
-
throw new Error('Expected table row');
|
|
322
|
-
}
|
|
323
|
-
const tableCells = tableRow.getChildren();
|
|
324
|
-
if (tableColumnIndex >= tableCells.length) {
|
|
325
|
-
continue;
|
|
326
|
-
}
|
|
327
|
-
const tableCell = tableCells[tableColumnIndex];
|
|
328
|
-
if (!$isTableCellNode(tableCell)) {
|
|
329
|
-
throw new Error('Expected table cell');
|
|
330
|
-
}
|
|
331
|
-
tableCell.toggleHeaderStyle(TableCellHeaderStates.COLUMN);
|
|
332
|
-
}
|
|
333
|
-
clearTableSelection();
|
|
334
|
-
onClose();
|
|
335
|
-
});
|
|
336
|
-
}, [
|
|
337
|
-
editor,
|
|
338
|
-
tableCellNode,
|
|
339
|
-
clearTableSelection,
|
|
340
|
-
onClose
|
|
341
|
-
]);
|
|
342
|
-
let mergeCellButton = null;
|
|
343
|
-
if (cellMerge) {
|
|
344
|
-
if (canMergeCells) {
|
|
345
|
-
mergeCellButton = /*#__PURE__*/ _jsx("button", {
|
|
346
|
-
className: "item",
|
|
347
|
-
"data-test-id": "table-merge-cells",
|
|
348
|
-
onClick: ()=>mergeTableCellsAtSelection(),
|
|
349
|
-
type: "button",
|
|
350
|
-
children: "Merge cells"
|
|
351
|
-
});
|
|
352
|
-
} else if (canUnmergeCell) {
|
|
353
|
-
mergeCellButton = /*#__PURE__*/ _jsx("button", {
|
|
354
|
-
className: "item",
|
|
355
|
-
"data-test-id": "table-unmerge-cells",
|
|
356
|
-
onClick: ()=>unmergeTableCellsAtSelection(),
|
|
357
|
-
type: "button",
|
|
358
|
-
children: "Unmerge cells"
|
|
359
|
-
});
|
|
287
|
+
$[17] = editor;
|
|
288
|
+
$[18] = t9;
|
|
289
|
+
} else {
|
|
290
|
+
t9 = $[18];
|
|
291
|
+
}
|
|
292
|
+
const unmergeTableCellsAtSelection = t9;
|
|
293
|
+
let t10;
|
|
294
|
+
if ($[19] !== editor || $[20] !== onClose) {
|
|
295
|
+
t10 = shouldInsertAfter => {
|
|
296
|
+
editor.update(() => {
|
|
297
|
+
$insertTableRow__EXPERIMENTAL(shouldInsertAfter);
|
|
298
|
+
onClose();
|
|
299
|
+
});
|
|
300
|
+
};
|
|
301
|
+
$[19] = editor;
|
|
302
|
+
$[20] = onClose;
|
|
303
|
+
$[21] = t10;
|
|
304
|
+
} else {
|
|
305
|
+
t10 = $[21];
|
|
306
|
+
}
|
|
307
|
+
const insertTableRowAtSelection = t10;
|
|
308
|
+
let t11;
|
|
309
|
+
if ($[22] !== editor || $[23] !== selectionCounts.columns || $[24] !== onClose) {
|
|
310
|
+
t11 = shouldInsertAfter_0 => {
|
|
311
|
+
editor.update(() => {
|
|
312
|
+
for (let i_0 = 0; i_0 < selectionCounts.columns; i_0++) {
|
|
313
|
+
$insertTableColumn__EXPERIMENTAL(shouldInsertAfter_0);
|
|
360
314
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
' ',
|
|
431
|
-
"right"
|
|
432
|
-
]
|
|
433
|
-
})
|
|
434
|
-
}),
|
|
435
|
-
/*#__PURE__*/ _jsx("hr", {}),
|
|
436
|
-
/*#__PURE__*/ _jsx("button", {
|
|
437
|
-
className: "item",
|
|
438
|
-
"data-test-id": "table-delete-columns",
|
|
439
|
-
onClick: ()=>deleteTableColumnAtSelection(),
|
|
440
|
-
type: "button",
|
|
441
|
-
children: /*#__PURE__*/ _jsx("span", {
|
|
442
|
-
className: "text",
|
|
443
|
-
children: "Delete column"
|
|
444
|
-
})
|
|
445
|
-
}),
|
|
446
|
-
/*#__PURE__*/ _jsx("button", {
|
|
447
|
-
className: "item",
|
|
448
|
-
"data-test-id": "table-delete-rows",
|
|
449
|
-
onClick: ()=>deleteTableRowAtSelection(),
|
|
450
|
-
type: "button",
|
|
451
|
-
children: /*#__PURE__*/ _jsx("span", {
|
|
452
|
-
className: "text",
|
|
453
|
-
children: "Delete row"
|
|
454
|
-
})
|
|
455
|
-
}),
|
|
456
|
-
/*#__PURE__*/ _jsx("button", {
|
|
457
|
-
className: "item",
|
|
458
|
-
"data-test-id": "table-delete",
|
|
459
|
-
onClick: ()=>deleteTableAtSelection(),
|
|
460
|
-
type: "button",
|
|
461
|
-
children: /*#__PURE__*/ _jsx("span", {
|
|
462
|
-
className: "text",
|
|
463
|
-
children: "Delete table"
|
|
464
|
-
})
|
|
465
|
-
}),
|
|
466
|
-
/*#__PURE__*/ _jsx("hr", {}),
|
|
467
|
-
/*#__PURE__*/ _jsx("button", {
|
|
468
|
-
className: "item",
|
|
469
|
-
onClick: ()=>toggleTableRowIsHeader(),
|
|
470
|
-
type: "button",
|
|
471
|
-
children: /*#__PURE__*/ _jsxs("span", {
|
|
472
|
-
className: "text",
|
|
473
|
-
children: [
|
|
474
|
-
(tableCellNode.__headerState & TableCellHeaderStates.ROW) === TableCellHeaderStates.ROW ? 'Remove' : 'Add',
|
|
475
|
-
' ',
|
|
476
|
-
"row header"
|
|
477
|
-
]
|
|
478
|
-
})
|
|
479
|
-
}),
|
|
480
|
-
/*#__PURE__*/ _jsx("button", {
|
|
481
|
-
className: "item",
|
|
482
|
-
"data-test-id": "table-column-header",
|
|
483
|
-
onClick: ()=>toggleTableColumnIsHeader(),
|
|
484
|
-
type: "button",
|
|
485
|
-
children: /*#__PURE__*/ _jsxs("span", {
|
|
486
|
-
className: "text",
|
|
487
|
-
children: [
|
|
488
|
-
(tableCellNode.__headerState & TableCellHeaderStates.COLUMN) === TableCellHeaderStates.COLUMN ? 'Remove' : 'Add',
|
|
489
|
-
' ',
|
|
490
|
-
"column header"
|
|
491
|
-
]
|
|
492
|
-
})
|
|
493
|
-
})
|
|
494
|
-
]
|
|
495
|
-
}), document.body);
|
|
496
|
-
}
|
|
497
|
-
function TableCellActionMenuContainer({ anchorElem, cellMerge }) {
|
|
498
|
-
const [editor] = useLexicalComposerContext();
|
|
499
|
-
const menuButtonRef = useRef(null);
|
|
500
|
-
const menuRootRef = useRef(null);
|
|
501
|
-
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
502
|
-
const [tableCellNode, setTableMenuCellNode] = useState(null);
|
|
503
|
-
const $moveMenu = useCallback(()=>{
|
|
504
|
-
const menu = menuButtonRef.current;
|
|
505
|
-
const selection = $getSelection();
|
|
506
|
-
const nativeSelection = window.getSelection();
|
|
507
|
-
const activeElement = document.activeElement;
|
|
508
|
-
if (selection == null || menu == null) {
|
|
509
|
-
setTableMenuCellNode(null);
|
|
510
|
-
return;
|
|
315
|
+
onClose();
|
|
316
|
+
});
|
|
317
|
+
};
|
|
318
|
+
$[22] = editor;
|
|
319
|
+
$[23] = selectionCounts.columns;
|
|
320
|
+
$[24] = onClose;
|
|
321
|
+
$[25] = t11;
|
|
322
|
+
} else {
|
|
323
|
+
t11 = $[25];
|
|
324
|
+
}
|
|
325
|
+
const insertTableColumnAtSelection = t11;
|
|
326
|
+
let t12;
|
|
327
|
+
if ($[26] !== editor || $[27] !== onClose) {
|
|
328
|
+
t12 = () => {
|
|
329
|
+
editor.update(() => {
|
|
330
|
+
$deleteTableRow__EXPERIMENTAL();
|
|
331
|
+
onClose();
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
$[26] = editor;
|
|
335
|
+
$[27] = onClose;
|
|
336
|
+
$[28] = t12;
|
|
337
|
+
} else {
|
|
338
|
+
t12 = $[28];
|
|
339
|
+
}
|
|
340
|
+
const deleteTableRowAtSelection = t12;
|
|
341
|
+
let t13;
|
|
342
|
+
if ($[29] !== editor || $[30] !== tableCellNode || $[31] !== clearTableSelection || $[32] !== onClose) {
|
|
343
|
+
t13 = () => {
|
|
344
|
+
editor.update(() => {
|
|
345
|
+
const tableNode_0 = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
346
|
+
tableNode_0.remove();
|
|
347
|
+
clearTableSelection();
|
|
348
|
+
onClose();
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
$[29] = editor;
|
|
352
|
+
$[30] = tableCellNode;
|
|
353
|
+
$[31] = clearTableSelection;
|
|
354
|
+
$[32] = onClose;
|
|
355
|
+
$[33] = t13;
|
|
356
|
+
} else {
|
|
357
|
+
t13 = $[33];
|
|
358
|
+
}
|
|
359
|
+
const deleteTableAtSelection = t13;
|
|
360
|
+
let t14;
|
|
361
|
+
if ($[34] !== editor || $[35] !== onClose) {
|
|
362
|
+
t14 = () => {
|
|
363
|
+
editor.update(() => {
|
|
364
|
+
$deleteTableColumn__EXPERIMENTAL();
|
|
365
|
+
onClose();
|
|
366
|
+
});
|
|
367
|
+
};
|
|
368
|
+
$[34] = editor;
|
|
369
|
+
$[35] = onClose;
|
|
370
|
+
$[36] = t14;
|
|
371
|
+
} else {
|
|
372
|
+
t14 = $[36];
|
|
373
|
+
}
|
|
374
|
+
const deleteTableColumnAtSelection = t14;
|
|
375
|
+
let t15;
|
|
376
|
+
if ($[37] !== editor || $[38] !== tableCellNode || $[39] !== clearTableSelection || $[40] !== onClose) {
|
|
377
|
+
t15 = () => {
|
|
378
|
+
editor.update(() => {
|
|
379
|
+
const tableNode_1 = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
380
|
+
const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode);
|
|
381
|
+
const tableRows = tableNode_1.getChildren();
|
|
382
|
+
if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {
|
|
383
|
+
throw new Error("Expected table cell to be inside of table row.");
|
|
511
384
|
}
|
|
512
|
-
const
|
|
513
|
-
if (
|
|
514
|
-
|
|
515
|
-
if (tableCellNodeFromSelection == null) {
|
|
516
|
-
setTableMenuCellNode(null);
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
const tableCellParentNodeDOM = editor.getElementByKey(tableCellNodeFromSelection.getKey());
|
|
520
|
-
if (tableCellParentNodeDOM == null) {
|
|
521
|
-
setTableMenuCellNode(null);
|
|
522
|
-
return;
|
|
523
|
-
}
|
|
524
|
-
setTableMenuCellNode(tableCellNodeFromSelection);
|
|
525
|
-
} else if (!activeElement) {
|
|
526
|
-
setTableMenuCellNode(null);
|
|
385
|
+
const tableRow = tableRows[tableRowIndex];
|
|
386
|
+
if (!$isTableRowNode(tableRow)) {
|
|
387
|
+
throw new Error("Expected table row");
|
|
527
388
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
editor.getEditorState().read(()=>{
|
|
534
|
-
$moveMenu();
|
|
535
|
-
});
|
|
389
|
+
tableRow.getChildren().forEach(tableCell => {
|
|
390
|
+
if (!$isTableCellNode(tableCell)) {
|
|
391
|
+
throw new Error("Expected table cell");
|
|
392
|
+
}
|
|
393
|
+
tableCell.toggleHeaderStyle(TableCellHeaderStates.ROW);
|
|
536
394
|
});
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
395
|
+
clearTableSelection();
|
|
396
|
+
onClose();
|
|
397
|
+
});
|
|
398
|
+
};
|
|
399
|
+
$[37] = editor;
|
|
400
|
+
$[38] = tableCellNode;
|
|
401
|
+
$[39] = clearTableSelection;
|
|
402
|
+
$[40] = onClose;
|
|
403
|
+
$[41] = t15;
|
|
404
|
+
} else {
|
|
405
|
+
t15 = $[41];
|
|
406
|
+
}
|
|
407
|
+
const toggleTableRowIsHeader = t15;
|
|
408
|
+
let t16;
|
|
409
|
+
if ($[42] !== editor || $[43] !== tableCellNode || $[44] !== clearTableSelection || $[45] !== onClose) {
|
|
410
|
+
t16 = () => {
|
|
411
|
+
editor.update(() => {
|
|
412
|
+
const tableNode_2 = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
413
|
+
const tableColumnIndex = $getTableColumnIndexFromTableCellNode(tableCellNode);
|
|
414
|
+
const tableRows_0 = tableNode_2.getChildren();
|
|
415
|
+
const maxRowsLength = Math.max(...tableRows_0.map(row => row.getChildren().length));
|
|
416
|
+
if (tableColumnIndex >= maxRowsLength || tableColumnIndex < 0) {
|
|
417
|
+
throw new Error("Expected table cell to be inside of table row.");
|
|
418
|
+
}
|
|
419
|
+
for (let r = 0; r < tableRows_0.length; r++) {
|
|
420
|
+
const tableRow_0 = tableRows_0[r];
|
|
421
|
+
if (!$isTableRowNode(tableRow_0)) {
|
|
422
|
+
throw new Error("Expected table row");
|
|
423
|
+
}
|
|
424
|
+
const tableCells = tableRow_0.getChildren();
|
|
425
|
+
if (tableColumnIndex >= tableCells.length) {
|
|
426
|
+
continue;
|
|
427
|
+
}
|
|
428
|
+
const tableCell_0 = tableCells[tableColumnIndex];
|
|
429
|
+
if (!$isTableCellNode(tableCell_0)) {
|
|
430
|
+
throw new Error("Expected table cell");
|
|
431
|
+
}
|
|
432
|
+
tableCell_0.toggleHeaderStyle(TableCellHeaderStates.COLUMN);
|
|
554
433
|
}
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
]
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
434
|
+
clearTableSelection();
|
|
435
|
+
onClose();
|
|
436
|
+
});
|
|
437
|
+
};
|
|
438
|
+
$[42] = editor;
|
|
439
|
+
$[43] = tableCellNode;
|
|
440
|
+
$[44] = clearTableSelection;
|
|
441
|
+
$[45] = onClose;
|
|
442
|
+
$[46] = t16;
|
|
443
|
+
} else {
|
|
444
|
+
t16 = $[46];
|
|
445
|
+
}
|
|
446
|
+
const toggleTableColumnIsHeader = t16;
|
|
447
|
+
let mergeCellButton = null;
|
|
448
|
+
if (cellMerge) {
|
|
449
|
+
if (canMergeCells) {
|
|
450
|
+
let t17;
|
|
451
|
+
if ($[47] !== mergeTableCellsAtSelection) {
|
|
452
|
+
t17 = () => mergeTableCellsAtSelection();
|
|
453
|
+
$[47] = mergeTableCellsAtSelection;
|
|
454
|
+
$[48] = t17;
|
|
455
|
+
} else {
|
|
456
|
+
t17 = $[48];
|
|
457
|
+
}
|
|
458
|
+
mergeCellButton = _jsx("button", {
|
|
459
|
+
className: "item",
|
|
460
|
+
"data-test-id": "table-merge-cells",
|
|
461
|
+
onClick: t17,
|
|
462
|
+
type: "button",
|
|
463
|
+
children: "Merge cells"
|
|
464
|
+
});
|
|
465
|
+
} else {
|
|
466
|
+
if (canUnmergeCell) {
|
|
467
|
+
let t17;
|
|
468
|
+
if ($[49] !== unmergeTableCellsAtSelection) {
|
|
469
|
+
t17 = () => unmergeTableCellsAtSelection();
|
|
470
|
+
$[49] = unmergeTableCellsAtSelection;
|
|
471
|
+
$[50] = t17;
|
|
472
|
+
} else {
|
|
473
|
+
t17 = $[50];
|
|
565
474
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
475
|
+
mergeCellButton = _jsx("button", {
|
|
476
|
+
className: "item",
|
|
477
|
+
"data-test-id": "table-unmerge-cells",
|
|
478
|
+
onClick: t17,
|
|
479
|
+
type: "button",
|
|
480
|
+
children: "Unmerge cells"
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
let t17;
|
|
486
|
+
if ($[51] !== insertTableRowAtSelection) {
|
|
487
|
+
t17 = () => insertTableRowAtSelection(false);
|
|
488
|
+
$[51] = insertTableRowAtSelection;
|
|
489
|
+
$[52] = t17;
|
|
490
|
+
} else {
|
|
491
|
+
t17 = $[52];
|
|
492
|
+
}
|
|
493
|
+
let t18;
|
|
494
|
+
if ($[53] !== insertTableRowAtSelection) {
|
|
495
|
+
t18 = () => insertTableRowAtSelection(true);
|
|
496
|
+
$[53] = insertTableRowAtSelection;
|
|
497
|
+
$[54] = t18;
|
|
498
|
+
} else {
|
|
499
|
+
t18 = $[54];
|
|
500
|
+
}
|
|
501
|
+
let t19;
|
|
502
|
+
if ($[55] !== insertTableColumnAtSelection) {
|
|
503
|
+
t19 = () => insertTableColumnAtSelection(false);
|
|
504
|
+
$[55] = insertTableColumnAtSelection;
|
|
505
|
+
$[56] = t19;
|
|
506
|
+
} else {
|
|
507
|
+
t19 = $[56];
|
|
508
|
+
}
|
|
509
|
+
let t20;
|
|
510
|
+
if ($[57] !== insertTableColumnAtSelection) {
|
|
511
|
+
t20 = () => insertTableColumnAtSelection(true);
|
|
512
|
+
$[57] = insertTableColumnAtSelection;
|
|
513
|
+
$[58] = t20;
|
|
514
|
+
} else {
|
|
515
|
+
t20 = $[58];
|
|
516
|
+
}
|
|
517
|
+
let t21;
|
|
518
|
+
if ($[59] !== deleteTableColumnAtSelection) {
|
|
519
|
+
t21 = () => deleteTableColumnAtSelection();
|
|
520
|
+
$[59] = deleteTableColumnAtSelection;
|
|
521
|
+
$[60] = t21;
|
|
522
|
+
} else {
|
|
523
|
+
t21 = $[60];
|
|
524
|
+
}
|
|
525
|
+
let t22;
|
|
526
|
+
if ($[61] !== deleteTableRowAtSelection) {
|
|
527
|
+
t22 = () => deleteTableRowAtSelection();
|
|
528
|
+
$[61] = deleteTableRowAtSelection;
|
|
529
|
+
$[62] = t22;
|
|
530
|
+
} else {
|
|
531
|
+
t22 = $[62];
|
|
532
|
+
}
|
|
533
|
+
let t23;
|
|
534
|
+
if ($[63] !== deleteTableAtSelection) {
|
|
535
|
+
t23 = () => deleteTableAtSelection();
|
|
536
|
+
$[63] = deleteTableAtSelection;
|
|
537
|
+
$[64] = t23;
|
|
538
|
+
} else {
|
|
539
|
+
t23 = $[64];
|
|
540
|
+
}
|
|
541
|
+
let t24;
|
|
542
|
+
if ($[65] !== toggleTableRowIsHeader) {
|
|
543
|
+
t24 = () => toggleTableRowIsHeader();
|
|
544
|
+
$[65] = toggleTableRowIsHeader;
|
|
545
|
+
$[66] = t24;
|
|
546
|
+
} else {
|
|
547
|
+
t24 = $[66];
|
|
548
|
+
}
|
|
549
|
+
let t25;
|
|
550
|
+
if ($[67] !== toggleTableColumnIsHeader) {
|
|
551
|
+
t25 = () => toggleTableColumnIsHeader();
|
|
552
|
+
$[67] = toggleTableColumnIsHeader;
|
|
553
|
+
$[68] = t25;
|
|
554
|
+
} else {
|
|
555
|
+
t25 = $[68];
|
|
556
|
+
}
|
|
557
|
+
return createPortal(_jsxs("div", {
|
|
558
|
+
className: "table-action-menu-dropdown",
|
|
559
|
+
onClick: _temp,
|
|
560
|
+
ref: dropDownRef,
|
|
561
|
+
children: [mergeCellButton ? _jsxs(React.Fragment, {
|
|
562
|
+
children: [mergeCellButton, _jsx("hr", {})]
|
|
563
|
+
}) : null, _jsx("button", {
|
|
564
|
+
className: "item",
|
|
565
|
+
"data-test-id": "table-insert-row-above",
|
|
566
|
+
onClick: t17,
|
|
567
|
+
type: "button",
|
|
568
|
+
children: _jsxs("span", {
|
|
569
|
+
className: "text",
|
|
570
|
+
children: ["Insert ", selectionCounts.rows === 1 ? "row" : `${selectionCounts.rows} rows`, " above"]
|
|
571
|
+
})
|
|
572
|
+
}), _jsx("button", {
|
|
573
|
+
className: "item",
|
|
574
|
+
"data-test-id": "table-insert-row-below",
|
|
575
|
+
onClick: t18,
|
|
576
|
+
type: "button",
|
|
577
|
+
children: _jsxs("span", {
|
|
578
|
+
className: "text",
|
|
579
|
+
children: ["Insert ", selectionCounts.rows === 1 ? "row" : `${selectionCounts.rows} rows`, " below"]
|
|
580
|
+
})
|
|
581
|
+
}), _jsx("hr", {}), _jsx("button", {
|
|
582
|
+
className: "item",
|
|
583
|
+
"data-test-id": "table-insert-column-before",
|
|
584
|
+
onClick: t19,
|
|
585
|
+
type: "button",
|
|
586
|
+
children: _jsxs("span", {
|
|
587
|
+
className: "text",
|
|
588
|
+
children: ["Insert ", selectionCounts.columns === 1 ? "column" : `${selectionCounts.columns} columns`, " ", "left"]
|
|
589
|
+
})
|
|
590
|
+
}), _jsx("button", {
|
|
591
|
+
className: "item",
|
|
592
|
+
"data-test-id": "table-insert-column-after",
|
|
593
|
+
onClick: t20,
|
|
594
|
+
type: "button",
|
|
595
|
+
children: _jsxs("span", {
|
|
596
|
+
className: "text",
|
|
597
|
+
children: ["Insert ", selectionCounts.columns === 1 ? "column" : `${selectionCounts.columns} columns`, " ", "right"]
|
|
598
|
+
})
|
|
599
|
+
}), _jsx("hr", {}), _jsx("button", {
|
|
600
|
+
className: "item",
|
|
601
|
+
"data-test-id": "table-delete-columns",
|
|
602
|
+
onClick: t21,
|
|
603
|
+
type: "button",
|
|
604
|
+
children: _jsx("span", {
|
|
605
|
+
className: "text",
|
|
606
|
+
children: "Delete column"
|
|
607
|
+
})
|
|
608
|
+
}), _jsx("button", {
|
|
609
|
+
className: "item",
|
|
610
|
+
"data-test-id": "table-delete-rows",
|
|
611
|
+
onClick: t22,
|
|
612
|
+
type: "button",
|
|
613
|
+
children: _jsx("span", {
|
|
614
|
+
className: "text",
|
|
615
|
+
children: "Delete row"
|
|
616
|
+
})
|
|
617
|
+
}), _jsx("button", {
|
|
618
|
+
className: "item",
|
|
619
|
+
"data-test-id": "table-delete",
|
|
620
|
+
onClick: t23,
|
|
621
|
+
type: "button",
|
|
622
|
+
children: _jsx("span", {
|
|
623
|
+
className: "text",
|
|
624
|
+
children: "Delete table"
|
|
625
|
+
})
|
|
626
|
+
}), _jsx("hr", {}), _jsx("button", {
|
|
627
|
+
className: "item",
|
|
628
|
+
onClick: t24,
|
|
629
|
+
type: "button",
|
|
630
|
+
children: _jsxs("span", {
|
|
631
|
+
className: "text",
|
|
632
|
+
children: [(tableCellNode.__headerState & TableCellHeaderStates.ROW) === TableCellHeaderStates.ROW ? "Remove" : "Add", " ", "row header"]
|
|
633
|
+
})
|
|
634
|
+
}), _jsx("button", {
|
|
635
|
+
className: "item",
|
|
636
|
+
"data-test-id": "table-column-header",
|
|
637
|
+
onClick: t25,
|
|
638
|
+
type: "button",
|
|
639
|
+
children: _jsxs("span", {
|
|
640
|
+
className: "text",
|
|
641
|
+
children: [(tableCellNode.__headerState & TableCellHeaderStates.COLUMN) === TableCellHeaderStates.COLUMN ? "Remove" : "Add", " ", "column header"]
|
|
642
|
+
})
|
|
643
|
+
})]
|
|
644
|
+
}), document.body);
|
|
645
|
+
}
|
|
646
|
+
function _temp(e) {
|
|
647
|
+
e.stopPropagation();
|
|
648
|
+
}
|
|
649
|
+
function TableCellActionMenuContainer({
|
|
650
|
+
anchorElem,
|
|
651
|
+
cellMerge
|
|
652
|
+
}) {
|
|
653
|
+
const [editor] = useLexicalComposerContext();
|
|
654
|
+
const menuButtonRef = useRef(null);
|
|
655
|
+
const menuRootRef = useRef(null);
|
|
656
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
657
|
+
const [tableCellNode, setTableMenuCellNode] = useState(null);
|
|
658
|
+
const $moveMenu = useCallback(() => {
|
|
659
|
+
const menu = menuButtonRef.current;
|
|
660
|
+
const selection = $getSelection();
|
|
661
|
+
const nativeSelection = window.getSelection();
|
|
662
|
+
const activeElement = document.activeElement;
|
|
663
|
+
if (selection == null || menu == null) {
|
|
664
|
+
setTableMenuCellNode(null);
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
const rootElement = editor.getRootElement();
|
|
668
|
+
if ($isRangeSelection(selection) && rootElement !== null && nativeSelection !== null && rootElement.contains(nativeSelection.anchorNode)) {
|
|
669
|
+
const tableCellNodeFromSelection = $getTableCellNodeFromLexicalNode(selection.anchor.getNode());
|
|
670
|
+
if (tableCellNodeFromSelection == null) {
|
|
671
|
+
setTableMenuCellNode(null);
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
const tableCellParentNodeDOM = editor.getElementByKey(tableCellNodeFromSelection.getKey());
|
|
675
|
+
if (tableCellParentNodeDOM == null) {
|
|
676
|
+
setTableMenuCellNode(null);
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
setTableMenuCellNode(tableCellNodeFromSelection);
|
|
680
|
+
} else if (!activeElement) {
|
|
681
|
+
setTableMenuCellNode(null);
|
|
682
|
+
}
|
|
683
|
+
}, [editor]);
|
|
684
|
+
useEffect(() => {
|
|
685
|
+
return editor.registerUpdateListener(() => {
|
|
686
|
+
editor.getEditorState().read(() => {
|
|
687
|
+
$moveMenu();
|
|
688
|
+
});
|
|
595
689
|
});
|
|
690
|
+
});
|
|
691
|
+
useEffect(() => {
|
|
692
|
+
const menuButtonDOM = menuButtonRef.current;
|
|
693
|
+
if (menuButtonDOM != null && tableCellNode != null) {
|
|
694
|
+
const tableCellNodeDOM = editor.getElementByKey(tableCellNode.getKey());
|
|
695
|
+
if (tableCellNodeDOM != null) {
|
|
696
|
+
const tableCellRect = tableCellNodeDOM.getBoundingClientRect();
|
|
697
|
+
const menuRect = menuButtonDOM.getBoundingClientRect();
|
|
698
|
+
const anchorRect = anchorElem.getBoundingClientRect();
|
|
699
|
+
const top = tableCellRect.top - anchorRect.top + 4;
|
|
700
|
+
const left = tableCellRect.right - menuRect.width - 10 - anchorRect.left;
|
|
701
|
+
menuButtonDOM.style.opacity = '1';
|
|
702
|
+
menuButtonDOM.style.transform = `translate(${left}px, ${top}px)`;
|
|
703
|
+
} else {
|
|
704
|
+
menuButtonDOM.style.opacity = '0';
|
|
705
|
+
menuButtonDOM.style.transform = 'translate(-10000px, -10000px)';
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}, [menuButtonRef, tableCellNode, editor, anchorElem]);
|
|
709
|
+
const prevTableCellDOM = useRef(tableCellNode);
|
|
710
|
+
useEffect(() => {
|
|
711
|
+
if (prevTableCellDOM.current !== tableCellNode) {
|
|
712
|
+
setIsMenuOpen(false);
|
|
713
|
+
}
|
|
714
|
+
prevTableCellDOM.current = tableCellNode;
|
|
715
|
+
}, [prevTableCellDOM, tableCellNode]);
|
|
716
|
+
return /*#__PURE__*/_jsx("div", {
|
|
717
|
+
className: "table-cell-action-button-container",
|
|
718
|
+
ref: menuButtonRef,
|
|
719
|
+
children: tableCellNode != null && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
720
|
+
children: [/*#__PURE__*/_jsx("button", {
|
|
721
|
+
className: "table-cell-action-button",
|
|
722
|
+
onClick: e => {
|
|
723
|
+
e.stopPropagation();
|
|
724
|
+
setIsMenuOpen(!isMenuOpen);
|
|
725
|
+
},
|
|
726
|
+
ref: menuRootRef,
|
|
727
|
+
type: "button",
|
|
728
|
+
children: /*#__PURE__*/_jsx(MeatballsIcon, {})
|
|
729
|
+
}), isMenuOpen && /*#__PURE__*/_jsx(TableActionMenu, {
|
|
730
|
+
cellMerge: cellMerge,
|
|
731
|
+
contextRef: menuRootRef,
|
|
732
|
+
onClose: () => setIsMenuOpen(false),
|
|
733
|
+
setIsMenuOpen: setIsMenuOpen,
|
|
734
|
+
tableCellNode: tableCellNode
|
|
735
|
+
})]
|
|
736
|
+
})
|
|
737
|
+
});
|
|
596
738
|
}
|
|
597
|
-
export const TableActionMenuPlugin =
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
739
|
+
export const TableActionMenuPlugin = t0 => {
|
|
740
|
+
const $ = _c(3);
|
|
741
|
+
const {
|
|
742
|
+
anchorElem
|
|
743
|
+
} = t0;
|
|
744
|
+
const isEditable = useLexicalEditable();
|
|
745
|
+
let t1;
|
|
746
|
+
if ($[0] !== isEditable || $[1] !== anchorElem) {
|
|
747
|
+
t1 = createPortal(isEditable ? _jsx(TableCellActionMenuContainer, {
|
|
748
|
+
anchorElem: anchorElem ?? document.body,
|
|
749
|
+
cellMerge: true
|
|
602
750
|
}) : null, anchorElem ?? document.body);
|
|
751
|
+
$[0] = isEditable;
|
|
752
|
+
$[1] = anchorElem;
|
|
753
|
+
$[2] = t1;
|
|
754
|
+
} else {
|
|
755
|
+
t1 = $[2];
|
|
756
|
+
}
|
|
757
|
+
return t1;
|
|
603
758
|
};
|
|
604
|
-
|
|
605
759
|
//# sourceMappingURL=index.js.map
|