@payloadcms/richtext-lexical 3.0.0-beta.85 → 3.0.0-beta.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cell/index.d.ts +2 -2
- package/dist/cell/index.d.ts.map +1 -1
- package/dist/cell/index.js +117 -127
- package/dist/cell/index.js.map +1 -1
- package/dist/exports/client/Component-DOSSWC76.js +2 -0
- package/dist/exports/client/Component-DOSSWC76.js.map +7 -0
- package/dist/exports/client/Component-MBLHTKDK.js +2 -0
- package/dist/exports/client/Component-MBLHTKDK.js.map +7 -0
- package/dist/exports/client/Field-63NGLPJB.js +2 -0
- package/dist/exports/client/Field-63NGLPJB.js.map +7 -0
- package/dist/exports/client/RelationshipComponent-3QWBV4GT.js +2 -0
- package/dist/exports/client/RelationshipComponent-3QWBV4GT.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-G5DTIOPI.js +2 -0
- package/dist/exports/client/chunk-G5DTIOPI.js.map +7 -0
- package/dist/exports/client/chunk-LGUXX2QH.js +2 -0
- package/dist/exports/client/chunk-LGUXX2QH.js.map +7 -0
- package/dist/exports/client/chunk-NI6Z4GBD.js +2 -0
- package/dist/exports/client/{chunk-SQHN3N6E.js.map → chunk-NI6Z4GBD.js.map} +2 -2
- package/dist/exports/client/chunk-OKMIHD2R.js +2 -0
- package/dist/exports/client/chunk-OKMIHD2R.js.map +7 -0
- package/dist/exports/client/chunk-TO2W7Q2G.js +2 -0
- package/dist/exports/client/chunk-TO2W7Q2G.js.map +7 -0
- package/dist/exports/client/chunk-V2LKLT2F.js +3 -0
- package/dist/exports/client/chunk-V2LKLT2F.js.map +7 -0
- package/dist/exports/client/component-3OFD6Q4Z.js +2 -0
- package/dist/exports/client/component-3OFD6Q4Z.js.map +7 -0
- package/dist/exports/client/component-LCAAX56T.js +2 -0
- package/dist/exports/client/component-LCAAX56T.js.map +7 -0
- package/dist/exports/client/component-LLWMZU6K.js +2 -0
- package/dist/exports/client/component-LLWMZU6K.js.map +7 -0
- package/dist/exports/client/componentInline-72VZAAHP.js +2 -0
- package/dist/exports/client/componentInline-72VZAAHP.js.map +7 -0
- package/dist/exports/client/index.js +9 -9
- package/dist/exports/client/index.js.map +3 -3
- package/dist/exports/server/migrate.js +0 -1
- package/dist/exports/server/migrate.js.map +1 -1
- package/dist/features/align/client/index.js +151 -134
- package/dist/features/align/client/index.js.map +1 -1
- package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
- package/dist/features/align/client/toolbarAlignGroup.js +10 -9
- package/dist/features/align/client/toolbarAlignGroup.js.map +1 -1
- package/dist/features/align/server/i18n.js +192 -193
- package/dist/features/align/server/i18n.js.map +1 -1
- package/dist/features/align/server/index.js +5 -6
- package/dist/features/align/server/index.js.map +1 -1
- package/dist/features/blockquote/client/index.js +60 -65
- package/dist/features/blockquote/client/index.js.map +1 -1
- package/dist/features/blockquote/markdownTransformer.js +28 -34
- package/dist/features/blockquote/markdownTransformer.js.map +1 -1
- package/dist/features/blockquote/server/i18n.js +96 -97
- package/dist/features/blockquote/server/i18n.js.map +1 -1
- package/dist/features/blockquote/server/index.js +38 -37
- package/dist/features/blockquote/server/index.js.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.js +166 -172
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/blocks/client/component/FormSavePlugin.d.ts.map +1 -1
- package/dist/features/blocks/client/component/FormSavePlugin.js +46 -22
- package/dist/features/blocks/client/component/FormSavePlugin.js.map +1 -1
- package/dist/features/blocks/client/component/index.js +130 -142
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +1 -1
- package/dist/features/blocks/client/component/removeEmptyArrayValues.js +12 -8
- package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +106 -122
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/index.js +149 -142
- package/dist/features/blocks/client/index.js.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.js +41 -40
- package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/InlineBlocksNode.js +31 -30
- package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/blocks/client/plugin/commands.d.ts.map +1 -1
- package/dist/features/blocks/client/plugin/commands.js +2 -1
- package/dist/features/blocks/client/plugin/commands.js.map +1 -1
- package/dist/features/blocks/client/plugin/index.js +179 -106
- package/dist/features/blocks/client/plugin/index.js.map +1 -1
- package/dist/features/blocks/server/graphQLPopulationPromise.js +41 -28
- package/dist/features/blocks/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/blocks/server/i18n.js +288 -289
- package/dist/features/blocks/server/i18n.js.map +1 -1
- package/dist/features/blocks/server/index.js +149 -151
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.js +76 -73
- package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js +78 -76
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/blocks/server/validate.js +45 -34
- package/dist/features/blocks/server/validate.js.map +1 -1
- package/dist/features/converters/html/converter/converters/linebreak.js +4 -7
- package/dist/features/converters/html/converter/converters/linebreak.js.map +1 -1
- package/dist/features/converters/html/converter/converters/paragraph.js +24 -19
- package/dist/features/converters/html/converter/converters/paragraph.js.map +1 -1
- package/dist/features/converters/html/converter/converters/text.js +28 -29
- package/dist/features/converters/html/converter/converters/text.js.map +1 -1
- package/dist/features/converters/html/converter/defaultConverters.js +1 -6
- package/dist/features/converters/html/converter/defaultConverters.js.map +1 -1
- package/dist/features/converters/html/converter/index.js +66 -51
- package/dist/features/converters/html/converter/index.js.map +1 -1
- package/dist/features/converters/html/converter/types.js +1 -2
- package/dist/features/converters/html/converter/types.js.map +1 -1
- package/dist/features/converters/html/field/index.js +134 -139
- package/dist/features/converters/html/field/index.js.map +1 -1
- package/dist/features/converters/html/index.js +2 -3
- package/dist/features/converters/html/index.js.map +1 -1
- package/dist/features/createClientComponent.js +7 -6
- package/dist/features/createClientComponent.js.map +1 -1
- package/dist/features/createFeaturePropComponent.js +14 -13
- package/dist/features/createFeaturePropComponent.js.map +1 -1
- package/dist/features/debug/testRecorder/client/index.js +5 -7
- package/dist/features/debug/testRecorder/client/index.js.map +1 -1
- package/dist/features/debug/testRecorder/client/plugin/index.js +518 -402
- package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
- package/dist/features/debug/testRecorder/server/index.js +4 -5
- package/dist/features/debug/testRecorder/server/index.js.map +1 -1
- package/dist/features/debug/treeView/client/index.js +5 -7
- package/dist/features/debug/treeView/client/index.js.map +1 -1
- package/dist/features/debug/treeView/client/plugin/index.js +21 -11
- package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
- package/dist/features/debug/treeView/server/index.js +4 -5
- package/dist/features/debug/treeView/server/index.js.map +1 -1
- package/dist/features/experimental_table/client/index.js +41 -58
- package/dist/features/experimental_table/client/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +714 -560
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +295 -301
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -7
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +228 -159
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +129 -82
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/utils/debounce.d.ts.map +1 -1
- package/dist/features/experimental_table/client/utils/debounce.js +108 -89
- package/dist/features/experimental_table/client/utils/debounce.js.map +1 -1
- package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +1 -1
- package/dist/features/experimental_table/client/utils/useDebounce.js +11 -13
- package/dist/features/experimental_table/client/utils/useDebounce.js.map +1 -1
- package/dist/features/experimental_table/server/index.js +127 -114
- package/dist/features/experimental_table/server/index.js.map +1 -1
- package/dist/features/format/bold/feature.client.js +34 -35
- package/dist/features/format/bold/feature.client.js.map +1 -1
- package/dist/features/format/bold/feature.server.js +14 -18
- package/dist/features/format/bold/feature.server.js.map +1 -1
- package/dist/features/format/bold/markdownTransformers.js +14 -25
- package/dist/features/format/bold/markdownTransformers.js.map +1 -1
- package/dist/features/format/inlineCode/feature.client.js +26 -28
- package/dist/features/format/inlineCode/feature.client.js.map +1 -1
- package/dist/features/format/inlineCode/feature.server.js +5 -8
- package/dist/features/format/inlineCode/feature.server.js.map +1 -1
- package/dist/features/format/inlineCode/markdownTransformers.js +3 -6
- package/dist/features/format/inlineCode/markdownTransformers.js.map +1 -1
- package/dist/features/format/italic/feature.client.js +26 -29
- package/dist/features/format/italic/feature.client.js.map +1 -1
- package/dist/features/format/italic/feature.server.js +5 -9
- package/dist/features/format/italic/feature.server.js.map +1 -1
- package/dist/features/format/italic/markdownTransformers.js +7 -12
- package/dist/features/format/italic/markdownTransformers.js.map +1 -1
- package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
- package/dist/features/format/shared/toolbarFormatGroup.js +9 -8
- package/dist/features/format/shared/toolbarFormatGroup.js.map +1 -1
- package/dist/features/format/strikethrough/feature.client.js +26 -28
- package/dist/features/format/strikethrough/feature.client.js.map +1 -1
- package/dist/features/format/strikethrough/feature.server.js +5 -8
- package/dist/features/format/strikethrough/feature.server.js.map +1 -1
- package/dist/features/format/strikethrough/markdownTransformers.js +3 -6
- package/dist/features/format/strikethrough/markdownTransformers.js.map +1 -1
- package/dist/features/format/subscript/feature.client.js +25 -25
- package/dist/features/format/subscript/feature.client.js.map +1 -1
- package/dist/features/format/subscript/feature.server.js +4 -5
- package/dist/features/format/subscript/feature.server.js.map +1 -1
- package/dist/features/format/superscript/feature.client.js +25 -25
- package/dist/features/format/superscript/feature.client.js.map +1 -1
- package/dist/features/format/superscript/feature.server.js +4 -5
- package/dist/features/format/superscript/feature.server.js.map +1 -1
- package/dist/features/format/underline/feature.client.js +25 -25
- package/dist/features/format/underline/feature.client.js.map +1 -1
- package/dist/features/format/underline/feature.server.js +4 -5
- package/dist/features/format/underline/feature.server.js.map +1 -1
- package/dist/features/heading/client/index.js +86 -90
- package/dist/features/heading/client/index.js.map +1 -1
- package/dist/features/heading/markdownTransformer.js +22 -25
- package/dist/features/heading/markdownTransformer.js.map +1 -1
- package/dist/features/heading/server/i18n.js +96 -97
- package/dist/features/heading/server/i18n.js.map +1 -1
- package/dist/features/heading/server/index.js +49 -51
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/horizontalRule/client/component/index.js +81 -51
- package/dist/features/horizontalRule/client/component/index.js.map +1 -1
- package/dist/features/horizontalRule/client/index.js +48 -57
- package/dist/features/horizontalRule/client/index.js.map +1 -1
- package/dist/features/horizontalRule/client/markdownTransformer.js +15 -18
- package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +33 -30
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/horizontalRule/client/plugin/index.js +31 -20
- package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
- package/dist/features/horizontalRule/server/i18n.js +96 -97
- package/dist/features/horizontalRule/server/i18n.js.map +1 -1
- package/dist/features/horizontalRule/server/index.js +17 -24
- package/dist/features/horizontalRule/server/index.js.map +1 -1
- package/dist/features/horizontalRule/server/markdownTransformer.js +15 -18
- package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +71 -66
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/indent/client/index.js +52 -47
- package/dist/features/indent/client/index.js.map +1 -1
- package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
- package/dist/features/indent/client/toolbarIndentGroup.js +9 -8
- package/dist/features/indent/client/toolbarIndentGroup.js.map +1 -1
- package/dist/features/indent/server/i18n.js +128 -129
- package/dist/features/indent/server/i18n.js.map +1 -1
- package/dist/features/indent/server/index.js +5 -6
- package/dist/features/indent/server/index.js.map +1 -1
- package/dist/features/link/client/index.js +78 -83
- package/dist/features/link/client/index.js.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.js +267 -271
- package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
- package/dist/features/link/client/plugins/clickableLink/index.js +3 -3
- package/dist/features/link/client/plugins/clickableLink/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.js +2 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +254 -276
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js +8 -6
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/types.js +1 -2
- package/dist/features/link/client/plugins/floatingLinkEditor/types.js.map +1 -1
- package/dist/features/link/client/plugins/link/index.js +50 -41
- package/dist/features/link/client/plugins/link/index.js.map +1 -1
- package/dist/features/link/markdownTransformer.js +38 -39
- package/dist/features/link/markdownTransformer.js.map +1 -1
- package/dist/features/link/nodes/AutoLinkNode.js +57 -56
- package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
- package/dist/features/link/nodes/LinkNode.js +277 -276
- package/dist/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/features/link/nodes/types.js +1 -2
- package/dist/features/link/nodes/types.js.map +1 -1
- package/dist/features/link/server/baseFields.js +118 -88
- package/dist/features/link/server/baseFields.js.map +1 -1
- package/dist/features/link/server/graphQLPopulationPromise.js +42 -28
- package/dist/features/link/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/link/server/i18n.js +96 -97
- package/dist/features/link/server/i18n.js.map +1 -1
- package/dist/features/link/server/index.js +120 -114
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/link/server/transformExtraFields.js +15 -15
- package/dist/features/link/server/transformExtraFields.js.map +1 -1
- package/dist/features/link/server/validate.js +37 -26
- package/dist/features/link/server/validate.js.map +1 -1
- package/dist/features/lists/checklist/client/index.js +77 -85
- package/dist/features/lists/checklist/client/index.js.map +1 -1
- package/dist/features/lists/checklist/client/plugin/index.js +3 -3
- package/dist/features/lists/checklist/client/plugin/index.js.map +1 -1
- package/dist/features/lists/checklist/markdownTransformers.js +7 -11
- package/dist/features/lists/checklist/markdownTransformers.js.map +1 -1
- package/dist/features/lists/checklist/server/i18n.js +96 -97
- package/dist/features/lists/checklist/server/i18n.js.map +1 -1
- package/dist/features/lists/checklist/server/index.js +21 -25
- package/dist/features/lists/checklist/server/index.js.map +1 -1
- package/dist/features/lists/htmlConverter.js +54 -43
- package/dist/features/lists/htmlConverter.js.map +1 -1
- package/dist/features/lists/orderedList/client/index.js +71 -77
- package/dist/features/lists/orderedList/client/index.js.map +1 -1
- package/dist/features/lists/orderedList/markdownTransformer.js +7 -11
- package/dist/features/lists/orderedList/markdownTransformer.js.map +1 -1
- package/dist/features/lists/orderedList/server/i18n.js +96 -97
- package/dist/features/lists/orderedList/server/i18n.js.map +1 -1
- package/dist/features/lists/orderedList/server/index.js +21 -25
- package/dist/features/lists/orderedList/server/index.js.map +1 -1
- package/dist/features/lists/plugin/index.js +3 -3
- package/dist/features/lists/plugin/index.js.map +1 -1
- package/dist/features/lists/shared/markdown.js +48 -49
- package/dist/features/lists/shared/markdown.js.map +1 -1
- package/dist/features/lists/shared/slashMenuListGroup.js +9 -8
- package/dist/features/lists/shared/slashMenuListGroup.js.map +1 -1
- package/dist/features/lists/unorderedList/client/index.js +68 -76
- package/dist/features/lists/unorderedList/client/index.js.map +1 -1
- package/dist/features/lists/unorderedList/markdownTransformer.js +7 -11
- package/dist/features/lists/unorderedList/markdownTransformer.js.map +1 -1
- package/dist/features/lists/unorderedList/server/i18n.js +96 -97
- package/dist/features/lists/unorderedList/server/i18n.js.map +1 -1
- package/dist/features/lists/unorderedList/server/index.js +17 -23
- package/dist/features/lists/unorderedList/server/index.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js +18 -17
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js +30 -29
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js +21 -20
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js +21 -19
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js +18 -17
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js +24 -23
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +20 -21
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js +1 -10
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +69 -61
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.js +1 -2
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.js +5 -7
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.js +42 -43
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +11 -11
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +64 -59
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js +19 -19
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js +20 -25
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js +28 -30
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js +26 -26
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js +22 -21
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js +22 -22
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js +12 -13
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js +23 -23
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js +22 -22
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js +15 -16
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.js +1 -13
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/index.js +105 -98
- package/dist/features/migrations/slateToLexical/converter/index.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/types.js +1 -2
- package/dist/features/migrations/slateToLexical/converter/types.js.map +1 -1
- package/dist/features/migrations/slateToLexical/feature.client.js +7 -7
- package/dist/features/migrations/slateToLexical/feature.client.js.map +1 -1
- package/dist/features/migrations/slateToLexical/feature.server.js +43 -44
- package/dist/features/migrations/slateToLexical/feature.server.js.map +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +11 -11
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +64 -59
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/features/paragraph/client/index.js +58 -61
- package/dist/features/paragraph/client/index.js.map +1 -1
- package/dist/features/paragraph/server/i18n.js +128 -129
- package/dist/features/paragraph/server/i18n.js.map +1 -1
- package/dist/features/paragraph/server/index.js +6 -7
- package/dist/features/paragraph/server/index.js.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.js +141 -149
- package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
- package/dist/features/relationship/client/drawer/commands.js +0 -1
- package/dist/features/relationship/client/drawer/commands.js.map +1 -1
- package/dist/features/relationship/client/drawer/index.js +138 -67
- package/dist/features/relationship/client/drawer/index.js.map +1 -1
- package/dist/features/relationship/client/index.js +53 -59
- package/dist/features/relationship/client/index.js.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.js +60 -59
- package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +90 -35
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.d.ts.map +1 -1
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +97 -26
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.js +34 -26
- package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/relationship/server/i18n.js +96 -97
- package/dist/features/relationship/server/i18n.js.map +1 -1
- package/dist/features/relationship/server/index.js +48 -44
- package/dist/features/relationship/server/index.js.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.js +90 -87
- package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/shared/slashMenu/basicGroup.js +9 -8
- package/dist/features/shared/slashMenu/basicGroup.js.map +1 -1
- package/dist/features/shared/toolbar/addDropdownGroup.js +8 -9
- package/dist/features/shared/toolbar/addDropdownGroup.js.map +1 -1
- package/dist/features/shared/toolbar/featureButtonsGroup.js +7 -8
- package/dist/features/shared/toolbar/featureButtonsGroup.js.map +1 -1
- package/dist/features/shared/toolbar/textDropdownGroup.js +8 -9
- package/dist/features/shared/toolbar/textDropdownGroup.js.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +264 -187
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/fixed/client/index.js +5 -7
- package/dist/features/toolbars/fixed/client/index.js.map +1 -1
- package/dist/features/toolbars/fixed/server/index.js +14 -13
- package/dist/features/toolbars/fixed/server/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.js +374 -286
- package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/index.js +5 -7
- package/dist/features/toolbars/inline/client/index.js.map +1 -1
- package/dist/features/toolbars/inline/server/index.js +4 -5
- package/dist/features/toolbars/inline/server/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +75 -97
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +190 -211
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +289 -124
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/features/toolbars/types.js +1 -2
- package/dist/features/toolbars/types.js.map +1 -1
- package/dist/features/typeUtilities.js +2 -3
- package/dist/features/typeUtilities.js.map +1 -1
- package/dist/features/typesClient.js +1 -2
- package/dist/features/typesClient.js.map +1 -1
- package/dist/features/typesServer.js +1 -2
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/component/index.js +208 -224
- package/dist/features/upload/client/component/index.js.map +1 -1
- package/dist/features/upload/client/drawer/commands.js +1 -1
- package/dist/features/upload/client/drawer/commands.js.map +1 -1
- package/dist/features/upload/client/drawer/index.js +107 -58
- package/dist/features/upload/client/drawer/index.js.map +1 -1
- package/dist/features/upload/client/feature.client.js +51 -61
- package/dist/features/upload/client/feature.client.js.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.js +76 -73
- package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/client/plugin/index.js +67 -39
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/feature.server.js +190 -171
- package/dist/features/upload/server/feature.server.js.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js +60 -47
- package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/upload/server/i18n.js +96 -97
- package/dist/features/upload/server/i18n.js.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.js +113 -108
- package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/server/validate.js +53 -40
- package/dist/features/upload/server/validate.js.map +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +127 -105
- package/dist/field/Field.js.map +1 -1
- package/dist/field/bundled.css +1 -0
- package/dist/field/index.js +92 -36
- package/dist/field/index.js.map +1 -1
- package/dist/i18n.js +160 -161
- package/dist/i18n.js.map +1 -1
- package/dist/index.js +670 -623
- package/dist/index.js.map +1 -1
- package/dist/lexical/EditorPlugin.d.ts.map +1 -1
- package/dist/lexical/EditorPlugin.js +15 -10
- package/dist/lexical/EditorPlugin.js.map +1 -1
- package/dist/lexical/LexicalEditor.js +206 -161
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/LexicalProvider.js +83 -82
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.js +76 -79
- package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
- package/dist/lexical/config/client/default.js +3 -3
- package/dist/lexical/config/client/default.js.map +1 -1
- package/dist/lexical/config/client/loader.js +42 -39
- package/dist/lexical/config/client/loader.js.map +1 -1
- package/dist/lexical/config/client/sanitize.js +165 -165
- package/dist/lexical/config/client/sanitize.js.map +1 -1
- package/dist/lexical/config/server/default.js +5 -27
- package/dist/lexical/config/server/default.js.map +1 -1
- package/dist/lexical/config/server/loader.js +103 -103
- package/dist/lexical/config/server/loader.js.map +1 -1
- package/dist/lexical/config/server/sanitize.js +98 -99
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/config/types.js +1 -2
- package/dist/lexical/config/types.js.map +1 -1
- package/dist/lexical/nodes/index.js +9 -8
- package/dist/lexical/nodes/index.js.map +1 -1
- package/dist/lexical/plugins/MarkdownShortcut/index.js +17 -5
- package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +384 -361
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +223 -160
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -2
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.js +191 -179
- package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js +41 -26
- package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +164 -129
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js +11 -10
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js +11 -10
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js +27 -23
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +331 -300
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +110 -97
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +23 -16
- package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +18 -27
- package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/getCollapsedMargins.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/getCollapsedMargins.js +15 -11
- package/dist/lexical/plugins/handles/utils/getCollapsedMargins.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js +133 -118
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +3 -2
- package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/isOnHandleElement.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/isOnHandleElement.js +3 -2
- package/dist/lexical/plugins/handles/utils/isOnHandleElement.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/setHandlePosition.js +26 -25
- package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
- package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
- package/dist/lexical/theme/EditorTheme.js +97 -102
- package/dist/lexical/theme/EditorTheme.js.map +1 -1
- package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +27 -10
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/lexical/ui/icons/AI/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AI/index.js +31 -33
- package/dist/lexical/ui/icons/AI/index.js.map +1 -1
- package/dist/lexical/ui/icons/Add/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Add/index.js +16 -18
- package/dist/lexical/ui/icons/Add/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignCenter/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignCenter/index.js +25 -28
- package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignJustify/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignJustify/index.js +25 -28
- package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignLeft/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignLeft/index.js +25 -28
- package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignRight/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignRight/index.js +25 -28
- package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
- package/dist/lexical/ui/icons/Block/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Block/index.js +34 -37
- package/dist/lexical/ui/icons/Block/index.js.map +1 -1
- package/dist/lexical/ui/icons/Blockquote/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Blockquote/index.js +16 -15
- package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
- package/dist/lexical/ui/icons/Bold/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Bold/index.js +16 -15
- package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
- package/dist/lexical/ui/icons/Checklist/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Checklist/index.js +24 -26
- package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
- package/dist/lexical/ui/icons/Code/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Code/index.js +19 -21
- package/dist/lexical/ui/icons/Code/index.js.map +1 -1
- package/dist/lexical/ui/icons/CodeBlock/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/CodeBlock/index.js +19 -21
- package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
- package/dist/lexical/ui/icons/H1/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H1/index.js +16 -15
- package/dist/lexical/ui/icons/H1/index.js.map +1 -1
- package/dist/lexical/ui/icons/H2/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H2/index.js +16 -15
- package/dist/lexical/ui/icons/H2/index.js.map +1 -1
- package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H3/index.js +16 -15
- package/dist/lexical/ui/icons/H3/index.js.map +1 -1
- package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H4/index.js +16 -15
- package/dist/lexical/ui/icons/H4/index.js.map +1 -1
- package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H5/index.js +16 -15
- package/dist/lexical/ui/icons/H5/index.js.map +1 -1
- package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H6/index.js +16 -15
- package/dist/lexical/ui/icons/H6/index.js.map +1 -1
- package/dist/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/HorizontalRule/index.js +19 -18
- package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
- package/dist/lexical/ui/icons/IndentDecrease/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/IndentDecrease/index.js +28 -32
- package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
- package/dist/lexical/ui/icons/IndentIncrease/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/IndentIncrease/index.js +28 -32
- package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
- package/dist/lexical/ui/icons/InlineBlocks/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/InlineBlocks/index.js +18 -17
- package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
- package/dist/lexical/ui/icons/Italic/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Italic/index.js +16 -15
- package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
- package/dist/lexical/ui/icons/Link/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Link/index.js +17 -16
- package/dist/lexical/ui/icons/Link/index.js.map +1 -1
- package/dist/lexical/ui/icons/Meatballs/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Meatballs/index.js +19 -22
- package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
- package/dist/lexical/ui/icons/OrderedList/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/OrderedList/index.js +31 -36
- package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
- package/dist/lexical/ui/icons/Relationship/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Relationship/index.js +31 -33
- package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
- package/dist/lexical/ui/icons/Strikethrough/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Strikethrough/index.js +19 -21
- package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
- package/dist/lexical/ui/icons/Subscript/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Subscript/index.js +16 -15
- package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
- package/dist/lexical/ui/icons/Superscript/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Superscript/index.js +16 -15
- package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
- package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Table/index.js +17 -16
- package/dist/lexical/ui/icons/Table/index.js.map +1 -1
- package/dist/lexical/ui/icons/Text/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Text/index.js +16 -15
- package/dist/lexical/ui/icons/Text/index.js.map +1 -1
- package/dist/lexical/ui/icons/Underline/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Underline/index.js +19 -21
- package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
- package/dist/lexical/ui/icons/UnorderedList/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/UnorderedList/index.js +46 -52
- package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
- package/dist/lexical/ui/icons/Upload/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Upload/index.js +28 -31
- package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
- package/dist/lexical/utils/canUseDOM.d.ts.map +1 -1
- package/dist/lexical/utils/canUseDOM.js +2 -1
- package/dist/lexical/utils/canUseDOM.js.map +1 -1
- package/dist/lexical/utils/environment.d.ts.map +1 -1
- package/dist/lexical/utils/environment.js +2 -1
- package/dist/lexical/utils/environment.js.map +1 -1
- package/dist/lexical/utils/getDOMRangeRect.d.ts.map +1 -1
- package/dist/lexical/utils/getDOMRangeRect.js +13 -12
- package/dist/lexical/utils/getDOMRangeRect.js.map +1 -1
- package/dist/lexical/utils/getSelectedNode.d.ts.map +1 -1
- package/dist/lexical/utils/getSelectedNode.js +18 -13
- package/dist/lexical/utils/getSelectedNode.js.map +1 -1
- package/dist/lexical/utils/guard.d.ts.map +1 -1
- package/dist/lexical/utils/guard.js +3 -2
- package/dist/lexical/utils/guard.js.map +1 -1
- package/dist/lexical/utils/joinClasses.d.ts.map +1 -1
- package/dist/lexical/utils/joinClasses.js +3 -2
- package/dist/lexical/utils/joinClasses.js.map +1 -1
- package/dist/lexical/utils/markdown/createBlockNode.js +9 -10
- package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
- package/dist/lexical/utils/nodeFormat.js +58 -59
- package/dist/lexical/utils/nodeFormat.js.map +1 -1
- package/dist/lexical/utils/point.d.ts.map +1 -1
- package/dist/lexical/utils/point.js +40 -32
- package/dist/lexical/utils/point.js.map +1 -1
- package/dist/lexical/utils/rect.d.ts.map +1 -1
- package/dist/lexical/utils/rect.js +167 -134
- package/dist/lexical/utils/rect.js.map +1 -1
- package/dist/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
- package/dist/lexical/utils/setFloatingElemPosition.js +56 -45
- package/dist/lexical/utils/setFloatingElemPosition.js.map +1 -1
- package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.d.ts.map +1 -1
- package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.js +23 -22
- package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.js.map +1 -1
- package/dist/lexical/utils/swipe.d.ts.map +1 -1
- package/dist/lexical/utils/swipe.js +82 -83
- package/dist/lexical/utils/swipe.js.map +1 -1
- package/dist/lexical/utils/url.js +23 -22
- package/dist/lexical/utils/url.js.map +1 -1
- package/dist/nodeTypes.js +1 -2
- package/dist/nodeTypes.js.map +1 -1
- package/dist/populateGraphQL/defaultValue.js +24 -29
- package/dist/populateGraphQL/defaultValue.js.map +1 -1
- package/dist/populateGraphQL/populate.js +35 -25
- package/dist/populateGraphQL/populate.js.map +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.js +47 -32
- package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js +39 -25
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -1
- package/dist/types.js +1 -2
- package/dist/types.js.map +1 -1
- package/dist/utilities/createClientFeature.js +40 -36
- package/dist/utilities/createClientFeature.js.map +1 -1
- package/dist/utilities/createServerFeature.js +46 -35
- package/dist/utilities/createServerFeature.js.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.js +28 -17
- package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.js +149 -78
- package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
- package/dist/utilities/forEachNodeRecursively.js +24 -19
- package/dist/utilities/forEachNodeRecursively.js.map +1 -1
- package/dist/utilities/generateComponentMap.d.ts.map +1 -1
- package/dist/utilities/generateComponentMap.js +92 -82
- package/dist/utilities/generateComponentMap.js.map +1 -1
- package/dist/utilities/generateImportMap.js +53 -47
- package/dist/utilities/generateImportMap.js.map +1 -1
- package/dist/utilities/generateSchemaMap.js +35 -30
- package/dist/utilities/generateSchemaMap.js.map +1 -1
- package/dist/utilities/migrateSlateToLexical/index.js +99 -86
- package/dist/utilities/migrateSlateToLexical/index.js.map +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +73 -66
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/recurseNodeTree.js +25 -22
- package/dist/utilities/recurseNodeTree.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/index.js +99 -86
- package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +71 -66
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/useLexicalFeature.js +9 -8
- package/dist/utilities/useLexicalFeature.js.map +1 -1
- package/dist/validate/index.js +32 -26
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/validateNodes.js +31 -28
- package/dist/validate/validateNodes.js.map +1 -1
- package/package.json +22 -11
- package/dist/exports/client/Component-7HS6FEJS.js +0 -2
- package/dist/exports/client/Component-7HS6FEJS.js.map +0 -7
- package/dist/exports/client/Component-LAKSCIDX.js +0 -2
- package/dist/exports/client/Component-LAKSCIDX.js.map +0 -7
- package/dist/exports/client/Field-BYB3WX7J.js +0 -2
- package/dist/exports/client/Field-BYB3WX7J.js.map +0 -7
- package/dist/exports/client/RelationshipComponent-GYUTPDNG.js +0 -2
- package/dist/exports/client/RelationshipComponent-GYUTPDNG.js.map +0 -7
- package/dist/exports/client/chunk-4EX7W4UX.js +0 -2
- package/dist/exports/client/chunk-4EX7W4UX.js.map +0 -7
- package/dist/exports/client/chunk-E4HH5PS6.js +0 -2
- package/dist/exports/client/chunk-E4HH5PS6.js.map +0 -7
- package/dist/exports/client/chunk-EBB2CEB6.js +0 -2
- package/dist/exports/client/chunk-EBB2CEB6.js.map +0 -7
- package/dist/exports/client/chunk-LTR7V74A.js +0 -2
- package/dist/exports/client/chunk-LTR7V74A.js.map +0 -7
- package/dist/exports/client/chunk-SQHN3N6E.js +0 -2
- package/dist/exports/client/chunk-VMCQSR3T.js +0 -3
- package/dist/exports/client/chunk-VMCQSR3T.js.map +0 -7
- package/dist/exports/client/component-6C5JERGA.js +0 -2
- package/dist/exports/client/component-6C5JERGA.js.map +0 -7
- package/dist/exports/client/component-GUWIGB77.js +0 -2
- package/dist/exports/client/component-GUWIGB77.js.map +0 -7
- package/dist/exports/client/component-UQ2BKD5X.js +0 -2
- package/dist/exports/client/component-UQ2BKD5X.js.map +0 -7
- package/dist/exports/client/componentInline-C2XIK5VZ.js +0 -2
- package/dist/exports/client/componentInline-C2XIK5VZ.js.map +0 -7
- package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts +0 -12
- package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js +0 -181
- package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js.map +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/blocks/client/component/index.tsx", "../../../src/features/blocks/client/component/BlockContent.tsx", "../../../src/features/blocks/client/component/FormSavePlugin.tsx", "../../../src/features/blocks/client/component/removeEmptyArrayValues.ts"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport type { FormProps } from '@payloadcms/ui'\n\nimport {\n Collapsible,\n Form,\n Pill,\n RenderComponent,\n SectionTitle,\n ShimmerEffect,\n useConfig,\n useDocumentInfo,\n useFieldProps,\n useFormSubmitted,\n useTranslation,\n} from '@payloadcms/ui'\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\n\nconst baseClass = 'lexical-block'\nimport type { BlockFieldClient, FormState } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport { v4 as uuid } from 'uuid'\n\nimport type { BlockFields } from '../../server/nodes/BlocksNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { BlockContent } from './BlockContent.js'\nimport './index.scss'\n\ntype Props = {\n readonly children?: React.ReactNode\n readonly formData: BlockFields\n readonly nodeKey?: string\n}\n\nexport const BlockComponent: React.FC<Props> = (props) => {\n const { formData, nodeKey } = props\n const { config } = useConfig()\n const submitted = useFormSubmitted()\n const { id } = useDocumentInfo()\n const { path, schemaPath } = useFieldProps()\n const { field: parentLexicalRichTextField } = useEditorConfigContext()\n\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.lexical_blocks.${formData.blockType}`\n\n const componentMapRenderedBlockPath = `lexical_internal_feature.blocks.fields.lexical_blocks`\n const blocksField: BlockFieldClient = richTextComponentMap.get(componentMapRenderedBlockPath)[0]\n\n const clientBlock = blocksField.blocks.find((block) => block.slug === formData.blockType)\n\n // Field Schema\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: formData,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n\n if (state) {\n state.blockName = {\n initialValue: '',\n passesCondition: true,\n valid: true,\n value: formData.blockName,\n }\n\n setInitialState(state)\n }\n }\n\n if (formData) {\n void awaitInitialState()\n }\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id]) // DO NOT ADD FORMDATA HERE! Adding formData will kick you out of sub block editors while writing.\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n const formState = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n\n formState.blockName = {\n initialValue: '',\n passesCondition: true,\n valid: true,\n value: formData.blockName,\n }\n\n return formState\n },\n\n [config.routes.api, config.serverURL, id, schemaFieldsPath, formData.blockName],\n )\n const { i18n } = useTranslation()\n\n const classNames = [`${baseClass}__row`, `${baseClass}__row--no-errors`].filter(Boolean).join(' ')\n\n // Memoized Form JSX\n const formContent = useMemo(() => {\n return clientBlock && initialState !== false ? (\n <Form\n beforeSubmit={[onChange]}\n fields={clientBlock.fields}\n initialState={initialState}\n onChange={[onChange]}\n submitted={submitted}\n uuid={uuid()}\n >\n <BlockContent\n baseClass={baseClass}\n clientBlock={clientBlock}\n field={parentLexicalRichTextField}\n formData={formData}\n formSchema={clientBlock.fields}\n nodeKey={nodeKey}\n path={`${path}.lexical_internal_feature.blocks.${formData.blockType}`}\n schemaPath={schemaFieldsPath}\n />\n </Form>\n ) : (\n <Collapsible\n className={classNames}\n collapsibleStyle=\"default\"\n header={\n clientBlock?.admin?.components?.Label ? (\n <RenderComponent\n clientProps={{ blockKind: 'lexicalBlock', formData }}\n mappedComponent={clientBlock.admin.components.Label}\n />\n ) : (\n <div className={`${baseClass}__block-header`}>\n <div>\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`}\n pillStyle=\"white\"\n >\n {clientBlock && typeof clientBlock.labels.singular === 'string'\n ? getTranslation(clientBlock.labels.singular, i18n)\n : clientBlock.slug}\n </Pill>\n <SectionTitle\n path=\"blockName\"\n readOnly={parentLexicalRichTextField?.admin?.readOnly}\n />\n </div>\n </div>\n )\n }\n key={0}\n >\n <ShimmerEffect height=\"35vh\" />\n </Collapsible>\n )\n }, [\n clientBlock,\n initialState,\n onChange,\n submitted,\n parentLexicalRichTextField,\n nodeKey,\n path,\n schemaFieldsPath,\n classNames,\n i18n,\n ])\n\n return <div className={baseClass + ' ' + baseClass + '-' + formData.blockType}>{formContent}</div>\n}\n", "'use client'\nimport type { ClientBlock, ClientField, CollapsedPreferences, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Collapsible,\n ErrorPill,\n Pill,\n RenderComponent,\n RenderFields,\n SectionTitle,\n useDocumentInfo,\n useFormSubmitted,\n useTranslation,\n} from '@payloadcms/ui'\nimport { dequal } from 'dequal/lite'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback } from 'react'\n\nimport type { LexicalRichTextFieldProps } from '../../../../types.js'\nimport type { BlockFields } from '../../server/nodes/BlocksNode.js'\nimport type { BlockNode } from '../nodes/BlocksNode.js'\n\nimport { FormSavePlugin } from './FormSavePlugin.js'\n\ntype Props = {\n baseClass: string\n clientBlock: ClientBlock\n field: LexicalRichTextFieldProps['field']\n formData: BlockFields\n formSchema: ClientField[]\n nodeKey: string\n path: string\n schemaPath: string\n}\n\n// Recursively remove all undefined values from even being present in formData, as they will\n// cause isDeepEqual to return false if, for example, formData has a key that fields.data\n// does not have, even if it's undefined.\n// Currently, this happens if a block has another sub-blocks field. Inside formData, that sub-blocks field has an undefined blockName property.\n// Inside of fields.data however, that sub-blocks blockName property does not exist at all.\nfunction removeUndefinedAndNullAndEmptyArraysRecursively(obj: object) {\n for (const key in obj) {\n const value = obj[key]\n if (Array.isArray(value) && !value?.length) {\n delete obj[key]\n } else if (value && typeof value === 'object') {\n removeUndefinedAndNullAndEmptyArraysRecursively(value)\n } else if (value === undefined || value === null) {\n delete obj[key]\n }\n }\n}\n\n/**\n * The actual content of the Block. This should be INSIDE a Form component,\n * scoped to the block. All format operations in here are thus scoped to the block's form, and\n * not the whole document.\n */\nexport const BlockContent: React.FC<Props> = (props) => {\n const { baseClass, clientBlock, field, formSchema, nodeKey, schemaPath } = props\n let { formData } = props\n\n const { i18n } = useTranslation()\n const [editor] = useLexicalComposerContext()\n // Used for saving collapsed to preferences (and gettin' it from there again)\n // Remember, these preferences are scoped to the whole document, not just this form. This\n // is important to consider for the data path used in setDocFieldPreferences\n const { getDocPreferences, setDocFieldPreferences } = useDocumentInfo()\n\n const [isCollapsed, setIsCollapsed] = React.useState<boolean>(() => {\n let initialState = false\n\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences = currentDocPreferences?.fields[field.name]\n\n const collapsedArray = currentFieldPreferences?.collapsed\n\n if (collapsedArray && collapsedArray.includes(formData.id)) {\n initialState = true\n setIsCollapsed(true)\n }\n })\n return initialState\n })\n\n const hasSubmitted = useFormSubmitted()\n\n const [errorCount, setErrorCount] = React.useState(0)\n\n const fieldHasErrors = hasSubmitted && errorCount > 0\n\n const classNames = [\n `${baseClass}__row`,\n fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,\n ]\n .filter(Boolean)\n .join(' ')\n\n const onFormChange = useCallback(\n ({\n fullFieldsWithValues,\n newFormData,\n }: {\n fullFieldsWithValues: FormState\n newFormData: BlockFields\n }) => {\n newFormData.id = formData.id\n newFormData.blockType = formData.blockType\n\n removeUndefinedAndNullAndEmptyArraysRecursively(newFormData)\n removeUndefinedAndNullAndEmptyArraysRecursively(formData)\n\n // Only update if the data has actually changed. Otherwise, we may be triggering an unnecessary value change,\n // which would trigger the \"Leave without saving\" dialog unnecessarily\n if (!dequal(formData, newFormData)) {\n // Running this in the next tick in the meantime fixes this issue: https://github.com/payloadcms/payload/issues/4108\n // I don't know why. When this is called immediately, it might focus out of a nested lexical editor field if an update is made there.\n // My hypothesis is that the nested editor might not have fully finished its update cycle yet. By updating in the next tick, we\n // ensure that the nested editor has finished its update cycle before we update the block node.\n setTimeout(() => {\n editor.update(() => {\n const node: BlockNode = $getNodeByKey(nodeKey)\n if (node) {\n formData = newFormData\n node.setFields(newFormData)\n }\n })\n }, 0)\n }\n\n // update error count\n if (hasSubmitted) {\n let rowErrorCount = 0\n for (const formField of Object.values(fullFieldsWithValues)) {\n if (formField?.valid === false) {\n rowErrorCount++\n }\n }\n setErrorCount(rowErrorCount)\n }\n },\n [editor, nodeKey, hasSubmitted, formData],\n )\n\n const onCollapsedChange = useCallback(\n (changedCollapsed: boolean) => {\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences = currentDocPreferences?.fields[field.name]\n\n const collapsedArray = currentFieldPreferences?.collapsed\n\n const newCollapsed: CollapsedPreferences =\n collapsedArray && collapsedArray?.length ? collapsedArray : []\n\n if (changedCollapsed) {\n if (!newCollapsed.includes(formData.id)) {\n newCollapsed.push(formData.id)\n }\n } else {\n if (newCollapsed.includes(formData.id)) {\n newCollapsed.splice(newCollapsed.indexOf(formData.id), 1)\n }\n }\n\n setDocFieldPreferences(field.name, {\n collapsed: newCollapsed,\n hello: 'hi',\n })\n })\n },\n [getDocPreferences, field.name, setDocFieldPreferences, formData.id],\n )\n\n const removeBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n return (\n <React.Fragment>\n <Collapsible\n className={classNames}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n header={\n clientBlock?.admin?.components?.Label ? (\n <RenderComponent\n clientProps={{ blockKind: 'lexicalBlock', formData }}\n mappedComponent={clientBlock.admin.components.Label}\n />\n ) : (\n <div className={`${baseClass}__block-header`}>\n <div>\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`}\n pillStyle=\"white\"\n >\n {typeof clientBlock?.labels.singular === 'string'\n ? getTranslation(clientBlock?.labels.singular, i18n)\n : clientBlock.slug}\n </Pill>\n <SectionTitle path=\"blockName\" readOnly={field?.admin?.readOnly} />\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n {editor.isEditable() && (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.admin?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeBlock()\n }}\n round\n tooltip=\"Remove Block\"\n />\n )}\n </div>\n )\n }\n isCollapsed={isCollapsed}\n key={0}\n onToggle={(incomingCollapsedState) => {\n onCollapsedChange(incomingCollapsedState)\n setIsCollapsed(incomingCollapsedState)\n }}\n >\n <RenderFields\n className={`${baseClass}__fields`}\n fields={formSchema}\n forceRender\n margins=\"small\"\n path=\"\" // Leaving path empty makes it so field values are not prefixed / scoped by the entire schemaPath. e.g. we can access \"myField\" instead of \"someLexicalField.feature.blocks.someArrayB\" // TODO: Could there be any implications leaving path different than schemaPath?\n readOnly={false}\n schemaPath={schemaPath} // Having the correct schemaPath here allows sub-fields (like array > addRow) to run correct form-state calls and retrieve their needed form state from the server\n />\n </Collapsible>\n\n <FormSavePlugin onChange={onFormChange} />\n </React.Fragment>\n )\n}\n", "'use client'\nimport type { Data, FormState } from 'payload'\nimport type React from 'react'\n\nimport { useAllFormFields } from '@payloadcms/ui'\nimport { reduceFieldsToValues } from 'payload/shared'\nimport { useEffect } from 'react'\n\nimport { removeEmptyArrayValues } from './removeEmptyArrayValues.js'\n\ntype Props = {\n onChange?: ({\n fullFieldsWithValues,\n newFormData,\n }: {\n fullFieldsWithValues: FormState\n newFormData: Data\n }) => void\n}\n\nexport const FormSavePlugin: React.FC<Props> = (props) => {\n const { onChange } = props\n\n const [_fields] = useAllFormFields()\n\n const fields = removeEmptyArrayValues({ fields: _fields })\n\n // Pass in fields, and indicate if you'd like to \"unflatten\" field data.\n // The result below will reflect the data stored in the form at the given time\n const newFormData = reduceFieldsToValues(fields, true)\n\n useEffect(() => {\n if (onChange) {\n onChange({ fullFieldsWithValues: fields, newFormData })\n }\n }, [newFormData, onChange, fields])\n\n return null\n}\n", "'use client'\nimport type { FormState } from 'payload'\n\n/**\n * By default, if an array field is empty, it will be included in the form state with a value of 0.\n * We do not need this behavior here, By setting `disableFormData` to true, we can prevent the field from being included in the form state\n * like that.\n * @param fields form state\n */\nexport function removeEmptyArrayValues({ fields }: { fields: FormState }): FormState {\n for (const key in fields) {\n const field = fields[key]\n if (Array.isArray(field.rows) && 'value' in field) {\n field.disableFormData = true\n }\n }\n return fields\n}\n"],
|
|
5
|
+
"mappings": "wGAIA,OACEA,eAAAA,GACAC,QAAA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MAAMC,WAAWC,QAGhDb,EAAC,MAAA,CAAIQ,UAAW,GAAGhE,CAAA,0BACjB0E,GAAC,MAAA,WACClB,EAACmB,GAAA,CACCX,UAAW,GAAGhE,CAAA,gBAAyBA,CAAA,gBAAyBG,GAAUmB,SAAA,GAC1EsD,UAAU,iBAETrD,GAAe,OAAOA,EAAYsD,OAAOC,UAAa,SACnDC,GAAexD,EAAYsD,OAAOC,SAAU9B,CAAA,EAC5CzB,EAAYK,OAElB4B,EAACwB,GAAA,CACCrE,KAAK,YACLsE,SAAUlE,GAA4BoD,OAAOc,yBAQvDzB,EAAC0B,GAAA,CAAcC,OAAO,UAFjB,CAAA,EAKR,CACD5D,EACAN,EACA2B,EACArC,EACAQ,EACAX,EACAO,EACAU,EACA6B,EACAF,CAAA,CACD,EAED,OAAOQ,EAAC,MAAA,CAAIQ,UAAWhE,EAAY,IAAMA,EAAY,IAAMG,EAASmB,mBAAYgC,GAClF",
|
|
6
|
+
"names": ["Collapsible", "Form", "Pill", "RenderComponent", "SectionTitle", "ShimmerEffect", "useConfig", "useDocumentInfo", "useFieldProps", "useFormSubmitted", "useTranslation", "useCallback", "useEffect", "useMemo", "useState", "getTranslation", "getFormState", "v4", "uuid", "useLexicalComposerContext", "getTranslation", "Button", "Collapsible", "ErrorPill", "Pill", "RenderComponent", "RenderFields", "SectionTitle", "useDocumentInfo", "useFormSubmitted", "useTranslation", "dequal", "$getNodeByKey", "React", "useCallback", "c", "_c", "useAllFormFields", "reduceFieldsToValues", "useEffect", "removeEmptyArrayValues", "fields", "key", "field", "Array", "isArray", "rows", "disableFormData", "FormSavePlugin", "props", "$", "_c", "onChange", "_fields", "useAllFormFields", "t0", "fields", "removeEmptyArrayValues", "reduceFieldsToValues", "newFormData", "t1", "t2", "fullFieldsWithValues", "useEffect", "removeUndefinedAndNullAndEmptyArraysRecursively", "obj", "key", "value", "Array", "isArray", "length", "BlockContent", "props", "baseClass", "clientBlock", "field", "formSchema", "nodeKey", "schemaPath", "formData", "i18n", "useTranslation", "editor", "useLexicalComposerContext", "getDocPreferences", "setDocFieldPreferences", "useDocumentInfo", "isCollapsed", "setIsCollapsed", "React", "useState", "initialState", "then", "currentDocPreferences", "collapsedArray", "fields", "name", "collapsed", "includes", "id", "hasSubmitted", "useFormSubmitted", "errorCount", "setErrorCount", "fieldHasErrors", "classNames", "filter", "Boolean", "join", "onFormChange", "useCallback", "fullFieldsWithValues", "newFormData", "blockType", "dequal", "setTimeout", "update", "node", "$getNodeByKey", "setFields", "rowErrorCount", "formField", "Object", "values", "valid", "onCollapsedChange", "changedCollapsed", "newCollapsed", "push", "splice", "indexOf", "hello", "removeBlock", "remove", "_jsxs", "Fragment", "_jsx", "Collapsible", "className", "collapsibleStyle", "header", "admin", "components", "Label", "RenderComponent", "clientProps", "blockKind", "mappedComponent", "Pill", "pillStyle", "labels", "singular", "getTranslation", "slug", "SectionTitle", "path", "readOnly", "ErrorPill", "count", "withMessage", "isEditable", "Button", "buttonStyle", "disabled", "icon", "onClick", "e", "preventDefault", "round", "tooltip", "onToggle", "incomingCollapsedState", "RenderFields", "forceRender", "margins", "FormSavePlugin", "onChange", "baseClass", "BlockComponent", "props", "formData", "nodeKey", "config", "useConfig", "submitted", "useFormSubmitted", "id", "useDocumentInfo", "path", "schemaPath", "useFieldProps", "field", "parentLexicalRichTextField", "useEditorConfigContext", "initialState", "setInitialState", "useState", "richTextComponentMap", "schemaFieldsPath", "blockType", "clientBlock", "get", "blocks", "find", "block", "slug", "useEffect", "state", "getFormState", "apiRoute", "routes", "api", "body", "data", "operation", "serverURL", "blockName", "initialValue", "passesCondition", "valid", "value", "onChange", "useCallback", "formState", "prevFormState", "i18n", "useTranslation", "classNames", "filter", "Boolean", "join", "formContent", "useMemo", "_jsx", "Form", "beforeSubmit", "fields", "uuid", "BlockContent", "formSchema", "Collapsible", "className", "collapsibleStyle", "header", "admin", "components", "Label", "RenderComponent", "clientProps", "blockKind", "mappedComponent", "_jsxs", "Pill", "pillStyle", "labels", "singular", "getTranslation", "SectionTitle", "readOnly", "ShimmerEffect", "height"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{d as E}from"./chunk-V2LKLT2F.js";import{c as K}from"react/compiler-runtime";import{useLexicalComposerContext as y}from"@lexical/react/LexicalComposerContext.js";import{useLexicalNodeSelection as M}from"@lexical/react/useLexicalNodeSelection.js";import{addClassNamesToElement as S,mergeRegister as _,removeClassNamesFromElement as D}from"@lexical/utils";import{$getNodeByKey as A,$getSelection as O,$isNodeSelection as $,CLICK_COMMAND as L,COMMAND_PRIORITY_LOW as d,KEY_BACKSPACE_COMMAND as R,KEY_DELETE_COMMAND as x}from"lexical";import{useEffect as p}from"react";var N="selected";function P(g){let e=K(16),{nodeKey:t}=g,[o]=y(),[r,n,i]=M(t),m;e[0]!==r||e[1]!==t?(m=l=>{if(r&&$(O())){l.preventDefault();let C=A(t);if(E(C))return C.remove(),!0}return!1},e[0]=r,e[1]=t,e[2]=m):m=e[2];let s=m,c,f;e[3]!==o||e[4]!==t||e[5]!==i||e[6]!==n||e[7]!==r||e[8]!==s?(c=()=>_(o.registerCommand(L,l=>{let C=o.getElementByKey(t);return l.target===C?(l.shiftKey||i(),n(!r),!0):!1},d),o.registerCommand(x,s,d),o.registerCommand(R,s,d)),f=[i,o,r,t,s,n],e[3]=o,e[4]=t,e[5]=i,e[6]=n,e[7]=r,e[8]=s,e[9]=c,e[10]=f):(c=e[9],f=e[10]),p(c,f);let a,u;return e[11]!==o||e[12]!==t||e[13]!==r?(a=()=>{let l=o.getElementByKey(t);l!==null&&(r?S(l,N):D(l,N))},u=[o,r,t],e[11]=o,e[12]=t,e[13]=r,e[14]=a,e[15]=u):(a=e[14],u=e[15]),p(a,u),null}export{P as HorizontalRuleComponent};
|
|
2
|
+
//# sourceMappingURL=component-LLWMZU6K.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/horizontalRule/client/component/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport type { NodeKey } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { addClassNamesToElement, mergeRegister, removeClassNamesFromElement } from '@lexical/utils'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport { useCallback, useEffect } from 'react'\n\nimport { $isHorizontalRuleNode } from '../nodes/HorizontalRuleNode.js'\n\nconst isSelectedClassName = 'selected'\n\n/**\n * React component rendered in the lexical editor, WITHIN the hr element created by createDOM of the HorizontalRuleNode.\n *\n * @param nodeKey every node has a unique key (this key is not saved to the database and thus may differ between sessions). It's useful for working with the CURRENT lexical editor state\n */\nexport function HorizontalRuleComponent({ nodeKey }: { nodeKey: NodeKey }) {\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const $onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isHorizontalRuleNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n CLICK_COMMAND,\n (event: MouseEvent) => {\n const hrElem = editor.getElementByKey(nodeKey)\n\n if (event.target === hrElem) {\n if (!event.shiftKey) {\n clearSelection()\n }\n setSelected(!isSelected)\n return true\n }\n\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected])\n\n useEffect(() => {\n const hrElem = editor.getElementByKey(nodeKey)\n if (hrElem !== null) {\n if (isSelected) {\n addClassNamesToElement(hrElem, isSelectedClassName)\n } else {\n removeClassNamesFromElement(hrElem, isSelectedClassName)\n }\n }\n }, [editor, isSelected, nodeKey])\n\n return null\n}\n"],
|
|
5
|
+
"mappings": "qDAAA,OAAAA,KAAAC,MAAA,yBAIA,OAASC,6BAAAA,MAAiC,2CAC1C,OAASC,2BAAAA,MAA+B,4CACxC,OAASC,0BAAAA,EAAwBC,iBAAAA,EAAeC,+BAAAA,MAAmC,iBACnF,OACEC,iBAAAA,EACAC,iBAAAA,EACAC,oBAAAA,EACAC,iBAAAA,EACAC,wBAAAA,EACAC,yBAAAA,EACAC,sBAAAA,MACK,UACP,OAAsBC,aAAAA,MAAiB,QAIvC,IAAMC,EAAsB,WAOrB,SAAAC,EAAAC,EAAA,CAAA,IAAAC,EAAAC,EAAA,EAAA,EAAiC,CAAAC,QAAAA,CAAA,EAAAH,EACtC,CAAAI,CAAA,EAAiBC,EAAA,EACjB,CAAAC,EAAAC,EAAAC,CAAA,EAAkDC,EAAwBN,CAAA,EAAAO,EAAAT,EAAA,CAAA,IAAAK,GAAAL,EAAA,CAAA,IAAAE,GAGxEO,EAAAC,GAAA,CAAA,GACML,GAAcM,EAAiBC,EAAA,CAAA,EAAA,CACjCF,EAAAG,eAAoB,EACpB,IAAAC,EAAaC,EAAcb,CAAA,EAAA,GACvBc,EAAsBF,CAAA,EACxBA,OAAAA,EAAAG,OAAW,EAAA,EAAA,CAAA,MAAA,EAAA,EAKjBjB,EAAA,CAAA,EAAAK,EAAAL,EAAA,CAAA,EAAAE,EAAAF,EAAA,CAAA,EAAAS,GAAAA,EAAAT,EAAA,CAAA,EAXF,IAAAkB,EAAkBT,EAYKU,EAAAC,EAAApB,EAAA,CAAA,IAAAG,GAAAH,EAAA,CAAA,IAAAE,GAAAF,EAAA,CAAA,I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C,IAAAD,EAAAjC,EAAA,EAAA,EAAAkC,EAAAlC,EAAA,EAAA,GAThCgC,EAAUC,EASPC,CAA6B,EAAA,IAAA",
|
|
6
|
+
"names": ["c", "_c", "useLexicalComposerContext", "useLexicalNodeSelection", "addClassNamesToElement", "mergeRegister", "removeClassNamesFromElement", "$getNodeByKey", "$getSelection", "$isNodeSelection", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "useEffect", "isSelectedClassName", "HorizontalRuleComponent", "t0", "$", "_c", "nodeKey", "editor", "useLexicalComposerContext", "isSelected", "setSelected", "clearSelection", "useLexicalNodeSelection", "t1", "event", "$isNodeSelection", "$getSelection", "preventDefault", "node", "$getNodeByKey", "$isHorizontalRuleNode", "remove", "$onDelete", "t2", "t3", "mergeRegister", "registerCommand", "CLICK_COMMAND", "event_0", "hrElem", "getElementByKey", "target", "shiftKey", "COMMAND_PRIORITY_LOW", "KEY_DELETE_COMMAND", "KEY_BACKSPACE_COMMAND", "useEffect", "t4", "t5", "hrElem_0", "addClassNamesToElement", "removeClassNamesFromElement"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{c as N,f as x}from"./chunk-OKMIHD2R.js";import{b as p}from"./chunk-NI6Z4GBD.js";import{jsx as a,jsxs as E}from"react/jsx-runtime";import{useCallback as f,useEffect as I,useRef as K}from"react";import{useLexicalComposerContext as L}from"@lexical/react/LexicalComposerContext";import{useLexicalNodeSelection as S}from"@lexical/react/useLexicalNodeSelection";import{mergeRegister as $}from"@lexical/utils";import{getTranslation as M}from"@payloadcms/translations";import{Button as v,RenderComponent as h,useTranslation as A}from"@payloadcms/ui";import{$getNodeByKey as D,$getSelection as T,$isNodeSelection as P,CLICK_COMMAND as j,COMMAND_PRIORITY_LOW as b,KEY_BACKSPACE_COMMAND as Y,KEY_DELETE_COMMAND as z}from"lexical";var s="inline-block",le=y=>{let{formData:r,nodeKey:o}=y,[e]=L(),{i18n:C,t:k}=A(),{field:_}=p(),m=K(null),[l,c,d]=S(o),{field:{richTextComponentMap:O}}=p(),t=O.get("lexical_internal_feature.blocks.fields.lexical_inline_blocks")[0].blocks.find(n=>n.slug===r.blockType),R=f(()=>{e.update(()=>{D(o).remove()})},[e,o]),u=f(n=>{if(l&&P(T())){n.preventDefault();let i=D(o);if(x(i))return i.remove(),!0}return!1},[l,o]),g=f(n=>{let i=n;return i.target===m.current||m.current?.contains(i.target)?(i.shiftKey?c(!l):l||(d(),c(!0)),!0):!1},[l,c,d]);I(()=>$(e.registerCommand(j,g,b),e.registerCommand(z,u,b),e.registerCommand(Y,u,b)),[d,e,l,o,u,c,g]);let B=t?.labels?.singular?M(t.labels.singular,C):t.slug;return E("div",{className:[s,s+"-"+r.blockType,l&&`${s}--selected`].filter(Boolean).join(" "),ref:m,children:[t?.admin?.components?.Label?a(h,{clientProps:{blockKind:"lexicalInlineBlock",formData:r},mappedComponent:t.admin.components.Label}):a("div",{children:M(t.labels?.singular,C)}),e.isEditable()&&E("div",{className:`${s}__actions`,children:[a(v,{buttonStyle:"icon-label",className:`${s}__editButton`,disabled:_?.admin?.readOnly,el:"div",icon:"edit",onClick:()=>{e.dispatchCommand(N,{fields:r,nodeKey:o})},round:!0,size:"small",tooltip:k("lexical:blocks:inlineBlocks:edit",{label:B})}),a(v,{buttonStyle:"icon-label",className:`${s}__removeButton`,disabled:_?.admin?.readOnly,icon:"x",onClick:n=>{n.preventDefault(),R()},round:!0,size:"small",tooltip:k("lexical:blocks:inlineBlocks:remove",{label:B})})]})]})};export{le as InlineBlockComponent};
|
|
2
|
+
//# sourceMappingURL=componentInline-72VZAAHP.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/blocks/client/componentInline/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport React, { useCallback, useEffect, useRef } from 'react'\nconst baseClass = 'inline-block'\n\nimport type { BlockFieldClient } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button, RenderComponent, useTranslation } from '@payloadcms/ui'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\n\nimport type { InlineBlockFields } from '../nodes/InlineBlocksNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js'\nimport { OPEN_INLINE_BLOCK_DRAWER_COMMAND } from '../plugin/commands.js'\nimport './index.scss'\n\ntype Props = {\n readonly formData: InlineBlockFields\n readonly nodeKey?: string\n}\n\nexport const InlineBlockComponent: React.FC<Props> = (props) => {\n const { formData, nodeKey } = props\n const [editor] = useLexicalComposerContext()\n const { i18n, t } = useTranslation<object, string>()\n const { field } = useEditorConfigContext()\n const inlineBlockElemElemRef = useRef<HTMLDivElement | null>(null)\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedBlockPath = `lexical_internal_feature.blocks.fields.lexical_inline_blocks`\n const blocksField: BlockFieldClient = richTextComponentMap.get(componentMapRenderedBlockPath)[0]\n const clientBlock = blocksField.blocks.find((block) => block.slug === formData.blockType)\n\n const removeInlineBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const $onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isInlineBlockNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n const onClick = useCallback(\n (payload: MouseEvent) => {\n const event = payload\n // Check if inlineBlockElemElemRef.target or anything WITHIN inlineBlockElemElemRef.target was clicked\n if (\n event.target === inlineBlockElemElemRef.current ||\n inlineBlockElemElemRef.current?.contains(event.target as Node)\n ) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n if (!isSelected) {\n clearSelection()\n setSelected(true)\n }\n }\n return true\n }\n\n return false\n },\n [isSelected, setSelected, clearSelection],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW),\n\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected, onClick])\n\n const blockDisplayName = clientBlock?.labels?.singular\n ? getTranslation(clientBlock.labels.singular, i18n)\n : clientBlock.slug\n\n return (\n <div\n className={[\n baseClass,\n baseClass + '-' + formData.blockType,\n isSelected && `${baseClass}--selected`,\n ]\n .filter(Boolean)\n .join(' ')}\n ref={inlineBlockElemElemRef}\n >\n {clientBlock?.admin?.components?.Label ? (\n <RenderComponent\n clientProps={{ blockKind: 'lexicalInlineBlock', formData }}\n mappedComponent={clientBlock.admin.components.Label}\n />\n ) : (\n <div>{getTranslation(clientBlock.labels?.singular, i18n)}</div>\n )}\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__editButton`}\n disabled={field?.admin?.readOnly}\n el=\"div\"\n icon=\"edit\"\n onClick={() => {\n editor.dispatchCommand(OPEN_INLINE_BLOCK_DRAWER_COMMAND, {\n fields: formData,\n nodeKey,\n })\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.admin?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeInlineBlock()\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:remove', { label: blockDisplayName })}\n />\n </div>\n )}\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "sJAEA,OAAgBA,eAAAA,EAAaC,aAAAA,EAAWC,UAAAA,MAAc,QAKtD,OAASC,6BAAAA,MAAiC,wCAC1C,OAASC,2BAAAA,MAA+B,yCACxC,OAASC,iBAAAA,MAAqB,iBAC9B,OAASC,kBAAAA,MAAsB,2BAC/B,OAASC,UAAAA,EAAQC,mBAAAA,EAAiBC,kBAAAA,MAAsB,iBACxD,OACEC,iBAAAA,EACAC,iBAAAA,EACAC,oBAAAA,EACAC,iBAAAA,EACAC,wBAAAA,EACAC,yBAAAA,EACAC,sBAAAA,MACK,UAjBP,IAAMC,EAAY,eA+BLC,GAAyCC,GAAA,CACpD,GAAM,CAAEC,SAAAA,EAAUC,QAAAA,CAAO,EAAKF,EACxB,CAACG,CAAA,EAAUC,EAAA,EACX,CAAEC,KAAAA,EAAMC,EAAAA,CAAC,EAAKC,EAAA,EACd,CAAEC,MAAAA,CAAK,EAAKC,EAAA,EACZC,EAAyBC,EAA8B,IAAA,EACvD,CAACC,EAAYC,EAAaC,CAAA,EAAkBC,EAAwBb,CAAA,EAEpE,CACJM,MAAO,CAAEQ,qBAAAA,CAAoB,CAAE,EAC7BP,EAAA,EAIEQ,EADgCD,EAAqBE,IADrB,8DACyB,EAA+B,CAAA,EAC9DC,OAAOC,KAAMC,GAAUA,EAAMC,OAASrB,EAASsB,SAAS,EAElFC,EAAoBC,EAAY,IAAA,CACpCtB,EAAOuB,OAAO,IAAA,CACZC,EAAczB,CAAA,EAAS0B,OAAM,CAC/B,CAAA,CACF,EAAG,CAACzB,EAAQD,CAAA,CAAQ,EAEd2B,E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AOgE,WAAU,GAChBd,EAAC,MAAA,CAAIC,UAAW,GAAGxD,CAAA,sBACjBgE,EAACM,EAAA,CACCC,YAAY,aACZf,UAAW,GAAGxD,CAAA,eACdwE,SAAU9D,GAAOmD,OAAOY,SACxBC,GAAG,MACHC,KAAK,OACLrC,QAASA,IAAA,CACPjC,EAAOuE,gBAAgBC,EAAkC,CACvDC,OAAQ3E,EACRC,QAAAA,CACF,CAAA,CACF,EACA2E,MAAK,GACLC,KAAK,QACLC,QAASzE,EAAE,mCAAoC,CAAE0E,MAAO/B,CAAiB,CAAA,IAE3Ea,EAACM,EAAA,CACCC,YAAY,aACZf,UAAW,GAAGxD,CAAA,iBACdwE,SAAU9D,GAAOmD,OAAOY,SACxBE,KAAK,IACLrC,QAAU6C,GAAA,CACRA,EAAEhD,eAAc,EAChBT,EAAA,CACF,EACAqD,MAAK,GACLC,KAAK,QACLC,QAASzE,EAAE,qCAAsC,CAAE0E,MAAO/B,CAAiB,CAAA,SAMvF",
|
|
6
|
+
"names": ["useCallback", "useEffect", "useRef", "useLexicalComposerContext", "useLexicalNodeSelection", "mergeRegister", "getTranslation", "Button", "RenderComponent", "useTranslation", "$getNodeByKey", "$getSelection", "$isNodeSelection", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "baseClass", "InlineBlockComponent", "props", "formData", "nodeKey", "editor", "useLexicalComposerContext", "i18n", "t", "useTranslation", "field", "useEditorConfigContext", "inlineBlockElemElemRef", "useRef", "isSelected", "setSelected", "clearSelection", "useLexicalNodeSelection", "richTextComponentMap", "clientBlock", "get", "blocks", "find", "block", "slug", "blockType", "removeInlineBlock", "useCallback", "update", "$getNodeByKey", "remove", "$onDelete", "event", "$isNodeSelection", "$getSelection", "preventDefault", "node", "$isInlineBlockNode", "onClick", "payload", "target", "current", "contains", "shiftKey", "useEffect", "mergeRegister", "registerCommand", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_DELETE_COMMAND", "KEY_BACKSPACE_COMMAND", "blockDisplayName", "labels", "singular", "getTranslation", "_jsxs", "className", "filter", "Boolean", "join", "ref", "admin", "components", "Label", "_jsx", "RenderComponent", "clientProps", "blockKind", "mappedComponent", "isEditable", "Button", "buttonStyle", "disabled", "readOnly", "el", "icon", "dispatchCommand", "OPEN_INLINE_BLOCK_DRAWER_COMMAND", "fields", "round", "size", "tooltip", "label", "e"]
|
|
7
|
+
}
|