@payloadcms/richtext-lexical 3.0.0-canary.ff8c8fd → 3.0.0
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/LICENSE.md +1 -1
- package/dist/cell/rscEntry.d.ts +12 -0
- package/dist/cell/rscEntry.d.ts.map +1 -0
- package/dist/cell/rscEntry.js +82 -0
- package/dist/cell/rscEntry.js.map +1 -0
- package/dist/exports/client/Field-KKSJXHR7.js +2 -0
- package/dist/exports/client/Field-KKSJXHR7.js.map +7 -0
- package/dist/exports/client/RelationshipComponent-2RT3YXUT.js +2 -0
- package/dist/exports/client/RelationshipComponent-2RT3YXUT.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-2CYU43GM.js +2 -0
- package/dist/exports/client/chunk-2CYU43GM.js.map +7 -0
- package/dist/exports/client/chunk-5PBXL4HT.js +2 -0
- package/dist/exports/client/chunk-5PBXL4HT.js.map +7 -0
- package/dist/exports/client/chunk-C7S3V4EB.js +2 -0
- package/dist/exports/client/chunk-C7S3V4EB.js.map +7 -0
- package/dist/exports/client/chunk-CUIBIFW2.js +2 -0
- package/dist/exports/client/chunk-CUIBIFW2.js.map +7 -0
- package/dist/exports/client/{chunk-UJDWBQ2K.js → chunk-MI5HS4QX.js} +2 -2
- package/dist/exports/client/{chunk-UJDWBQ2K.js.map → chunk-MI5HS4QX.js.map} +2 -2
- package/dist/exports/client/chunk-QPPOQTHD.js +2 -0
- package/dist/exports/client/chunk-QPPOQTHD.js.map +7 -0
- package/dist/exports/client/chunk-U7O7EYCP.js +2 -0
- package/dist/exports/client/chunk-U7O7EYCP.js.map +7 -0
- package/dist/exports/client/{chunk-V2LKLT2F.js → chunk-XCEM47RI.js} +3 -3
- package/dist/exports/client/{chunk-V2LKLT2F.js.map → chunk-XCEM47RI.js.map} +3 -3
- package/dist/exports/client/component-ANB7VZLA.js +2 -0
- package/dist/exports/client/component-ANB7VZLA.js.map +7 -0
- package/dist/exports/client/component-H3EYQ5KG.js +2 -0
- package/dist/exports/client/component-H3EYQ5KG.js.map +7 -0
- package/dist/exports/client/componentInline-ZGO3K4TA.js +2 -0
- package/dist/exports/client/componentInline-ZGO3K4TA.js.map +7 -0
- package/dist/exports/client/index.d.ts +10 -4
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +10 -8
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/server/ast/mdx.d.ts +7 -0
- package/dist/exports/server/ast/mdx.d.ts.map +1 -0
- package/dist/exports/server/ast/mdx.js +37 -0
- package/dist/exports/server/ast/mdx.js.map +1 -0
- package/dist/exports/server/rsc.d.ts +3 -0
- package/dist/exports/server/rsc.d.ts.map +1 -0
- package/dist/exports/server/rsc.js +3 -0
- package/dist/exports/server/rsc.js.map +1 -0
- package/dist/exports/shared.d.ts +4 -0
- package/dist/exports/shared.d.ts.map +1 -0
- package/dist/exports/shared.js +4 -0
- package/dist/exports/shared.js.map +1 -0
- package/dist/features/align/client/index.d.ts +1 -4
- package/dist/features/align/client/index.d.ts.map +1 -1
- package/dist/features/blockquote/client/index.d.ts +1 -4
- package/dist/features/blockquote/client/index.d.ts.map +1 -1
- package/dist/features/blockquote/markdownTransformer.js.map +1 -1
- package/dist/features/blockquote/server/index.d.ts +1 -1
- package/dist/features/blockquote/server/index.d.ts.map +1 -1
- package/dist/features/blockquote/server/index.js +5 -1
- package/dist/features/blockquote/server/index.js.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.d.ts +34 -8
- package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.js +66 -170
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/blocks/client/component/components/BlockCollapsible.d.ts +11 -0
- package/dist/features/blocks/client/component/components/BlockCollapsible.d.ts.map +1 -0
- package/dist/features/blocks/client/component/components/BlockCollapsible.js +37 -0
- package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -0
- package/dist/features/blocks/client/component/components/BlockEditButton.d.ts +3 -0
- package/dist/features/blocks/client/component/components/BlockEditButton.d.ts.map +1 -0
- package/dist/features/blocks/client/component/components/BlockEditButton.js +22 -0
- package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -0
- package/dist/features/blocks/client/component/components/BlockRemoveButton.d.ts +3 -0
- package/dist/features/blocks/client/component/components/BlockRemoveButton.d.ts.map +1 -0
- package/dist/features/blocks/client/component/components/BlockRemoveButton.js +22 -0
- package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -0
- package/dist/features/blocks/client/component/index.d.ts +1 -1
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +294 -93
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts +5 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js +28 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.d.ts +3 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js +22 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.d.ts +3 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js +22 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.d.ts +3 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js +22 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -0
- package/dist/features/blocks/client/componentInline/index.d.ts +14 -2
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +237 -63
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/index.d.ts +1 -8
- package/dist/features/blocks/client/index.d.ts.map +1 -1
- package/dist/features/blocks/client/index.js +140 -147
- package/dist/features/blocks/client/index.js.map +1 -1
- package/dist/features/blocks/client/markdownTransformer.d.ts +16 -0
- package/dist/features/blocks/client/markdownTransformer.d.ts.map +1 -0
- package/dist/features/blocks/client/markdownTransformer.js +144 -0
- package/dist/features/blocks/client/markdownTransformer.js.map +1 -0
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts +2 -2
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.js +1 -3
- package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/client/plugin/commands.d.ts +0 -4
- package/dist/features/blocks/client/plugin/commands.d.ts.map +1 -1
- package/dist/features/blocks/client/plugin/commands.js +0 -1
- package/dist/features/blocks/client/plugin/commands.js.map +1 -1
- package/dist/features/blocks/client/plugin/index.d.ts +3 -4
- package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
- package/dist/features/blocks/client/plugin/index.js +25 -129
- package/dist/features/blocks/client/plugin/index.js.map +1 -1
- package/dist/features/blocks/server/index.d.ts +1 -2
- package/dist/features/blocks/server/index.d.ts.map +1 -1
- package/dist/features/blocks/server/index.js +72 -35
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.d.ts +22 -0
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.d.ts.map +1 -0
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js +136 -0
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js.map +1 -0
- package/dist/features/blocks/server/markdownTransformer.d.ts +22 -0
- package/dist/features/blocks/server/markdownTransformer.d.ts.map +1 -0
- package/dist/features/blocks/server/markdownTransformer.js +400 -0
- package/dist/features/blocks/server/markdownTransformer.js.map +1 -0
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts +11 -5
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +3 -3
- package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/blocks/server/validate.d.ts.map +1 -1
- package/dist/features/blocks/server/validate.js +8 -5
- package/dist/features/blocks/server/validate.js.map +1 -1
- package/dist/features/converters/html/converter/converters/paragraph.d.ts.map +1 -1
- package/dist/features/converters/html/converter/converters/paragraph.js +4 -0
- package/dist/features/converters/html/converter/converters/paragraph.js.map +1 -1
- package/dist/features/converters/html/converter/converters/text.d.ts.map +1 -1
- package/dist/features/converters/html/converter/converters/text.js +2 -1
- package/dist/features/converters/html/converter/converters/text.js.map +1 -1
- package/dist/features/converters/html/converter/index.d.ts +11 -7
- package/dist/features/converters/html/converter/index.d.ts.map +1 -1
- package/dist/features/converters/html/converter/index.js +17 -1
- package/dist/features/converters/html/converter/index.js.map +1 -1
- package/dist/features/converters/html/converter/types.d.ts +3 -1
- package/dist/features/converters/html/converter/types.d.ts.map +1 -1
- package/dist/features/converters/html/converter/types.js.map +1 -1
- package/dist/features/converters/html/field/index.d.ts.map +1 -1
- package/dist/features/converters/html/field/index.js +7 -1
- package/dist/features/converters/html/field/index.js.map +1 -1
- package/dist/features/debug/testRecorder/client/index.d.ts +1 -4
- package/dist/features/debug/testRecorder/client/index.d.ts.map +1 -1
- package/dist/features/debug/testRecorder/client/plugin/index.js +25 -14
- package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
- package/dist/features/debug/treeView/client/index.d.ts +1 -4
- package/dist/features/debug/treeView/client/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/index.d.ts +1 -1
- package/dist/features/experimental_table/client/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/index.js +2 -0
- package/dist/features/experimental_table/client/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +49 -51
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +55 -42
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +58 -19
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +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 +52 -50
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/utils/debounce.js +4 -4
- package/dist/features/experimental_table/client/utils/debounce.js.map +1 -1
- package/dist/features/experimental_table/client/utils/useDebounce.js.map +1 -1
- package/dist/features/experimental_table/markdownTransformer.d.ts +5 -0
- package/dist/features/experimental_table/markdownTransformer.d.ts.map +1 -0
- package/dist/features/experimental_table/markdownTransformer.js +127 -0
- package/dist/features/experimental_table/markdownTransformer.js.map +1 -0
- package/dist/features/experimental_table/server/index.d.ts.map +1 -1
- package/dist/features/experimental_table/server/index.js +22 -4
- package/dist/features/experimental_table/server/index.js.map +1 -1
- package/dist/features/format/bold/feature.client.d.ts +1 -4
- package/dist/features/format/bold/feature.client.d.ts.map +1 -1
- package/dist/features/format/bold/feature.client.js +2 -1
- package/dist/features/format/bold/feature.client.js.map +1 -1
- package/dist/features/format/inlineCode/feature.client.d.ts +1 -4
- package/dist/features/format/inlineCode/feature.client.d.ts.map +1 -1
- package/dist/features/format/inlineCode/feature.client.js +2 -1
- package/dist/features/format/inlineCode/feature.client.js.map +1 -1
- package/dist/features/format/italic/feature.client.d.ts +1 -4
- package/dist/features/format/italic/feature.client.d.ts.map +1 -1
- package/dist/features/format/italic/feature.client.js +2 -1
- package/dist/features/format/italic/feature.client.js.map +1 -1
- package/dist/features/format/strikethrough/feature.client.d.ts +1 -4
- package/dist/features/format/strikethrough/feature.client.d.ts.map +1 -1
- package/dist/features/format/strikethrough/feature.client.js +2 -1
- package/dist/features/format/strikethrough/feature.client.js.map +1 -1
- package/dist/features/format/subscript/feature.client.d.ts +1 -4
- package/dist/features/format/subscript/feature.client.d.ts.map +1 -1
- package/dist/features/format/subscript/feature.client.js +2 -1
- package/dist/features/format/subscript/feature.client.js.map +1 -1
- package/dist/features/format/superscript/feature.client.d.ts +1 -4
- package/dist/features/format/superscript/feature.client.d.ts.map +1 -1
- package/dist/features/format/superscript/feature.client.js +2 -1
- package/dist/features/format/superscript/feature.client.js.map +1 -1
- package/dist/features/format/underline/feature.client.d.ts +1 -4
- package/dist/features/format/underline/feature.client.d.ts.map +1 -1
- package/dist/features/format/underline/feature.client.js +2 -1
- package/dist/features/format/underline/feature.client.js.map +1 -1
- package/dist/features/heading/client/index.d.ts +1 -4
- package/dist/features/heading/client/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.js +4 -0
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/horizontalRule/client/component/index.d.ts +1 -1
- package/dist/features/horizontalRule/client/component/index.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/component/index.js +12 -9
- package/dist/features/horizontalRule/client/component/index.js.map +1 -1
- package/dist/features/horizontalRule/client/index.d.ts +1 -4
- package/dist/features/horizontalRule/client/index.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +2 -2
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/indent/client/index.d.ts +1 -4
- package/dist/features/indent/client/index.d.ts.map +1 -1
- package/dist/features/indent/client/index.js +2 -1
- package/dist/features/indent/client/index.js.map +1 -1
- package/dist/features/link/client/index.d.ts +1 -13
- package/dist/features/link/client/index.d.ts.map +1 -1
- package/dist/features/link/client/index.js +2 -2
- package/dist/features/link/client/index.js.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.d.ts +1 -1
- package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.js +3 -1
- package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +78 -40
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
- package/dist/features/link/nodes/AutoLinkNode.js +2 -2
- package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
- package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/LinkNode.js +12 -7
- package/dist/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/features/link/nodes/types.d.ts +3 -3
- package/dist/features/link/nodes/types.d.ts.map +1 -1
- package/dist/features/link/nodes/types.js.map +1 -1
- package/dist/features/link/server/baseFields.d.ts +1 -1
- package/dist/features/link/server/baseFields.d.ts.map +1 -1
- package/dist/features/link/server/baseFields.js +15 -3
- package/dist/features/link/server/baseFields.js.map +1 -1
- package/dist/features/link/server/i18n.d.ts.map +1 -1
- package/dist/features/link/server/i18n.js +64 -32
- package/dist/features/link/server/i18n.js.map +1 -1
- package/dist/features/link/server/index.d.ts.map +1 -1
- package/dist/features/link/server/index.js +17 -4
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/link/server/transformExtraFields.d.ts +1 -1
- package/dist/features/link/server/transformExtraFields.d.ts.map +1 -1
- package/dist/features/link/server/transformExtraFields.js.map +1 -1
- package/dist/features/link/server/validate.d.ts.map +1 -1
- package/dist/features/link/server/validate.js +8 -5
- package/dist/features/link/server/validate.js.map +1 -1
- package/dist/features/lists/checklist/client/index.d.ts +1 -4
- package/dist/features/lists/checklist/client/index.d.ts.map +1 -1
- package/dist/features/lists/htmlConverter.d.ts.map +1 -1
- package/dist/features/lists/htmlConverter.js +8 -0
- package/dist/features/lists/htmlConverter.js.map +1 -1
- package/dist/features/lists/orderedList/client/index.d.ts +1 -4
- package/dist/features/lists/orderedList/client/index.d.ts.map +1 -1
- package/dist/features/lists/shared/markdown.js.map +1 -1
- package/dist/features/lists/unorderedList/client/index.d.ts +1 -4
- package/dist/features/lists/unorderedList/client/index.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +1 -0
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts +1 -4
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/converter/index.js +1 -0
- package/dist/features/migrations/slateToLexical/converter/index.js.map +1 -1
- package/dist/features/migrations/slateToLexical/feature.client.d.ts +1 -4
- package/dist/features/migrations/slateToLexical/feature.client.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/feature.client.js +1 -3
- package/dist/features/migrations/slateToLexical/feature.client.js.map +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/features/paragraph/client/index.d.ts +1 -4
- package/dist/features/paragraph/client/index.d.ts.map +1 -1
- package/dist/features/paragraph/server/index.d.ts +1 -1
- package/dist/features/paragraph/server/index.d.ts.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.js +34 -24
- package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
- package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
- package/dist/features/relationship/client/drawer/index.js +27 -26
- package/dist/features/relationship/client/drawer/index.js.map +1 -1
- package/dist/features/relationship/client/index.d.ts +2 -17
- package/dist/features/relationship/client/index.d.ts.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.d.ts +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +1 -1
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +1 -1
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +1 -1
- package/dist/features/relationship/server/index.d.ts +1 -1
- package/dist/features/relationship/server/index.d.ts.map +1 -1
- package/dist/features/relationship/server/index.js +50 -40
- package/dist/features/relationship/server/index.js.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +2 -2
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +93 -66
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/fixed/client/index.d.ts +1 -4
- package/dist/features/toolbars/fixed/client/index.d.ts.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.js +135 -97
- package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/index.d.ts +1 -4
- package/dist/features/toolbars/inline/client/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +5 -2
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +5 -4
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +24 -10
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +4 -5
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +127 -127
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/features/toolbars/types.d.ts +23 -11
- package/dist/features/toolbars/types.d.ts.map +1 -1
- package/dist/features/toolbars/types.js.map +1 -1
- package/dist/features/typesClient.d.ts +22 -30
- package/dist/features/typesClient.d.ts.map +1 -1
- package/dist/features/typesClient.js.map +1 -1
- package/dist/features/typesServer.d.ts +23 -28
- package/dist/features/typesServer.d.ts.map +1 -1
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/component/index.d.ts.map +1 -1
- package/dist/features/upload/client/component/index.js +66 -58
- package/dist/features/upload/client/component/index.js.map +1 -1
- package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
- package/dist/features/upload/client/drawer/index.js +34 -32
- package/dist/features/upload/client/drawer/index.js.map +1 -1
- package/dist/features/upload/client/feature.client.d.ts +1 -4
- package/dist/features/upload/client/feature.client.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.js +1 -1
- package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/client/plugin/index.js +1 -1
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/feature.server.d.ts.map +1 -1
- package/dist/features/upload/server/feature.server.js +17 -8
- package/dist/features/upload/server/feature.server.js.map +1 -1
- package/dist/features/upload/server/validate.d.ts.map +1 -1
- package/dist/features/upload/server/validate.js +7 -4
- package/dist/features/upload/server/validate.js.map +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +39 -65
- package/dist/field/Field.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js +74 -74
- package/dist/field/index.js.map +1 -1
- package/dist/field/rscEntry.d.ts +9 -0
- package/dist/field/rscEntry.d.ts.map +1 -0
- package/dist/field/rscEntry.js +56 -0
- package/dist/field/rscEntry.js.map +1 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +101 -105
- package/dist/index.js.map +1 -1
- package/dist/lexical/EditorPlugin.d.ts.map +1 -1
- package/dist/lexical/EditorPlugin.js +2 -1
- package/dist/lexical/EditorPlugin.js.map +1 -1
- package/dist/lexical/LexicalEditor.d.ts +1 -1
- package/dist/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/lexical/LexicalEditor.js +10 -10
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/LexicalProvider.d.ts +2 -2
- package/dist/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/lexical/LexicalProvider.js +18 -25
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.d.ts +6 -5
- package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.js +14 -13
- package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
- package/dist/lexical/config/client/loader.d.ts +5 -2
- package/dist/lexical/config/client/loader.d.ts.map +1 -1
- package/dist/lexical/config/client/loader.js +12 -18
- package/dist/lexical/config/client/loader.js.map +1 -1
- package/dist/lexical/config/client/sanitize.d.ts +1 -1
- package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/client/sanitize.js +19 -18
- package/dist/lexical/config/client/sanitize.js.map +1 -1
- package/dist/lexical/config/server/loader.d.ts +2 -1
- package/dist/lexical/config/server/loader.d.ts.map +1 -1
- package/dist/lexical/config/server/loader.js +2 -0
- package/dist/lexical/config/server/loader.js.map +1 -1
- package/dist/lexical/config/server/sanitize.d.ts +1 -1
- package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/server/sanitize.js +27 -13
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/config/types.d.ts +2 -2
- package/dist/lexical/config/types.d.ts.map +1 -1
- package/dist/lexical/config/types.js.map +1 -1
- package/dist/lexical/nodes/index.d.ts +4 -0
- package/dist/lexical/nodes/index.d.ts.map +1 -1
- package/dist/lexical/nodes/index.js +8 -1
- package/dist/lexical/nodes/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +6 -6
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +19 -8
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +2 -2
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +7 -7
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +3 -2
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.js +24 -30
- package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +11 -9
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +15 -8
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +9 -7
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +3 -1
- package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js +3 -4
- package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -1
- package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
- package/dist/lexical/theme/EditorTheme.js +1 -2
- package/dist/lexical/theme/EditorTheme.js.map +1 -1
- package/dist/lexical/utils/nodeFormat.d.ts +2 -2
- package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
- package/dist/lexical/utils/nodeFormat.js.map +1 -1
- package/dist/lexical/utils/rect.d.ts +4 -4
- package/dist/lexical/utils/rect.d.ts.map +1 -1
- package/dist/lexical/utils/rect.js.map +1 -1
- package/dist/lexical/utils/setFloatingElemPosition.d.ts +1 -1
- package/dist/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
- package/dist/lexical/utils/setFloatingElemPosition.js.map +1 -1
- package/dist/lexical/utils/url.d.ts +5 -0
- package/dist/lexical/utils/url.d.ts.map +1 -1
- package/dist/lexical/utils/url.js +25 -5
- package/dist/lexical/utils/url.js.map +1 -1
- package/dist/lexical-proxy/@lexical-headless.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-headless.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-headless.js +2 -0
- package/dist/lexical-proxy/@lexical-headless.js.map +1 -0
- package/dist/lexical-proxy/@lexical-link.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-link.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-link.js +2 -0
- package/dist/lexical-proxy/@lexical-link.js.map +1 -0
- package/dist/lexical-proxy/@lexical-list.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-list.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-list.js +2 -0
- package/dist/lexical-proxy/@lexical-list.js.map +1 -0
- package/dist/lexical-proxy/@lexical-mark.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-mark.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-mark.js +2 -0
- package/dist/lexical-proxy/@lexical-mark.js.map +1 -0
- package/dist/lexical-proxy/@lexical-markdown.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-markdown.js +2 -0
- package/dist/lexical-proxy/@lexical-markdown.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposer.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposer.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposer.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposer.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTreeView.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTreeView.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTreeView.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTreeView.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalEditable.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalEditable.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalEditable.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalEditable.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.js.map +1 -0
- package/dist/lexical-proxy/@lexical-rich-text.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-rich-text.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-rich-text.js +2 -0
- package/dist/lexical-proxy/@lexical-rich-text.js.map +1 -0
- package/dist/lexical-proxy/@lexical-selection.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-selection.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-selection.js +2 -0
- package/dist/lexical-proxy/@lexical-selection.js.map +1 -0
- package/dist/lexical-proxy/@lexical-utils.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-utils.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-utils.js +2 -0
- package/dist/lexical-proxy/@lexical-utils.js.map +1 -0
- package/dist/lexical-proxy/lexical.d.ts +2 -0
- package/dist/lexical-proxy/lexical.d.ts.map +1 -0
- package/dist/lexical-proxy/lexical.js +2 -0
- package/dist/lexical-proxy/lexical.js.map +1 -0
- package/dist/populateGraphQL/populate.d.ts +3 -2
- package/dist/populateGraphQL/populate.d.ts.map +1 -1
- package/dist/populateGraphQL/populate.js +3 -1
- package/dist/populateGraphQL/populate.js.map +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.js +5 -4
- package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -1
- package/dist/types.d.ts +23 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utilities/buildInitialState.d.ts +27 -0
- package/dist/utilities/buildInitialState.d.ts.map +1 -0
- package/dist/utilities/buildInitialState.js +53 -0
- package/dist/utilities/buildInitialState.js.map +1 -0
- package/dist/utilities/createClientFeature.d.ts +8 -5
- package/dist/utilities/createClientFeature.d.ts.map +1 -1
- package/dist/utilities/createClientFeature.js +7 -4
- package/dist/utilities/createClientFeature.js.map +1 -1
- package/dist/utilities/createServerFeature.d.ts +1 -0
- package/dist/utilities/createServerFeature.d.ts.map +1 -1
- package/dist/utilities/createServerFeature.js +2 -0
- package/dist/utilities/createServerFeature.js.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.d.ts +1 -0
- package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.js +68 -27
- package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.js +102 -138
- package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts +13 -0
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -0
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +129 -0
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -0
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts +10 -0
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -0
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.js +136 -0
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -0
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts +16 -0
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -0
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js +144 -0
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -0
- package/dist/utilities/generateImportMap.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.js +2 -3
- package/dist/utilities/generateImportMap.js.map +1 -1
- package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
- package/dist/utilities/generateSchemaMap.js +13 -10
- package/dist/utilities/generateSchemaMap.js.map +1 -1
- package/dist/utilities/initLexicalFeatures.d.ts +18 -0
- package/dist/utilities/initLexicalFeatures.d.ts.map +1 -0
- package/dist/utilities/initLexicalFeatures.js +96 -0
- package/dist/utilities/initLexicalFeatures.js.map +1 -0
- package/dist/utilities/jsx/collectTopLevelJSXInLines.d.ts +52 -0
- package/dist/utilities/jsx/collectTopLevelJSXInLines.d.ts.map +1 -0
- package/dist/utilities/jsx/collectTopLevelJSXInLines.js +79 -0
- package/dist/utilities/jsx/collectTopLevelJSXInLines.js.map +1 -0
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.d.ts +12 -0
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.d.ts.map +1 -0
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.js +125 -0
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.js.map +1 -0
- package/dist/utilities/jsx/jsx.d.ts +26 -0
- package/dist/utilities/jsx/jsx.d.ts.map +1 -0
- package/dist/utilities/jsx/jsx.js +105 -0
- package/dist/utilities/jsx/jsx.js.map +1 -0
- package/dist/utilities/jsx/jsx.spec.d.ts +2 -0
- package/dist/utilities/jsx/jsx.spec.d.ts.map +1 -0
- package/dist/utilities/jsx/jsx.spec.js +142 -0
- package/dist/utilities/jsx/jsx.spec.js.map +1 -0
- package/dist/utilities/jsx/lexicalMarkdownCopy.d.ts +11 -0
- package/dist/utilities/jsx/lexicalMarkdownCopy.d.ts.map +1 -0
- package/dist/utilities/jsx/lexicalMarkdownCopy.js +61 -0
- package/dist/utilities/jsx/lexicalMarkdownCopy.js.map +1 -0
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +5 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
- package/dist/utilities/useLexicalFeature.js +12 -4
- package/dist/utilities/useLexicalFeature.js.map +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +2 -2
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/validateNodes.d.ts +2 -2
- package/dist/validate/validateNodes.d.ts.map +1 -1
- package/dist/validate/validateNodes.js +4 -4
- package/dist/validate/validateNodes.js.map +1 -1
- package/package.json +332 -46
- package/dist/cell/index.d.ts +0 -9
- package/dist/cell/index.d.ts.map +0 -1
- package/dist/cell/index.js +0 -135
- package/dist/cell/index.js.map +0 -1
- package/dist/exports/client/Field-SUWHJ4HF.js +0 -2
- package/dist/exports/client/Field-SUWHJ4HF.js.map +0 -7
- package/dist/exports/client/RelationshipComponent-EZORSGUZ.js +0 -2
- package/dist/exports/client/RelationshipComponent-EZORSGUZ.js.map +0 -7
- package/dist/exports/client/chunk-OLSILJA6.js +0 -2
- package/dist/exports/client/chunk-OLSILJA6.js.map +0 -7
- package/dist/exports/client/chunk-TD7O23AB.js +0 -2
- package/dist/exports/client/chunk-TD7O23AB.js.map +0 -7
- package/dist/exports/client/chunk-YL453UOS.js +0 -2
- package/dist/exports/client/chunk-YL453UOS.js.map +0 -7
- package/dist/exports/client/chunk-YSI2QILQ.js +0 -2
- package/dist/exports/client/chunk-YSI2QILQ.js.map +0 -7
- package/dist/exports/client/component-2YLEVOFH.js +0 -2
- package/dist/exports/client/component-2YLEVOFH.js.map +0 -7
- package/dist/exports/client/component-7RAP75FW.js +0 -2
- package/dist/exports/client/component-7RAP75FW.js.map +0 -7
- package/dist/exports/client/component-LLWMZU6K.js +0 -2
- package/dist/exports/client/component-LLWMZU6K.js.map +0 -7
- package/dist/exports/client/componentInline-YSHGRL2J.js +0 -2
- package/dist/exports/client/componentInline-YSHGRL2J.js.map +0 -7
- package/dist/features/blocks/client/component/FormSavePlugin.d.ts +0 -11
- package/dist/features/blocks/client/component/FormSavePlugin.d.ts.map +0 -1
- package/dist/features/blocks/client/component/FormSavePlugin.js +0 -53
- package/dist/features/blocks/client/component/FormSavePlugin.js.map +0 -1
- package/dist/features/createClientComponent.d.ts +0 -7
- package/dist/features/createClientComponent.d.ts.map +0 -1
- package/dist/features/createClientComponent.js +0 -13
- package/dist/features/createClientComponent.js.map +0 -1
- package/dist/features/createFeaturePropComponent.d.ts +0 -6
- package/dist/features/createFeaturePropComponent.d.ts.map +0 -1
- package/dist/features/createFeaturePropComponent.js +0 -19
- package/dist/features/createFeaturePropComponent.js.map +0 -1
- package/dist/utilities/generateComponentMap.d.ts +0 -6
- package/dist/utilities/generateComponentMap.d.ts.map +0 -1
- package/dist/utilities/generateComponentMap.js +0 -99
- package/dist/utilities/generateComponentMap.js.map +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
5
6
|
import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
|
|
6
|
-
import { $computeTableMapSkipCellCheck, $getTableNodeFromLexicalNodeOrThrow, $getTableRowIndexFromTableCellNode, $isTableCellNode, $isTableRowNode, getDOMCellFromTarget } from '@lexical/table';
|
|
7
|
+
import { $computeTableMapSkipCellCheck, $getTableNodeFromLexicalNodeOrThrow, $getTableRowIndexFromTableCellNode, $isTableCellNode, $isTableRowNode, getDOMCellFromTarget, TableNode } from '@lexical/table';
|
|
7
8
|
import { calculateZoomLevel } from '@lexical/utils';
|
|
8
9
|
import { $getNearestNodeFromDOMNode } from 'lexical';
|
|
9
10
|
import * as React from 'react';
|
|
@@ -11,7 +12,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
11
12
|
import { createPortal } from 'react-dom';
|
|
12
13
|
import { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js';
|
|
13
14
|
const MIN_ROW_HEIGHT = 33;
|
|
14
|
-
const MIN_COLUMN_WIDTH =
|
|
15
|
+
const MIN_COLUMN_WIDTH = 92;
|
|
15
16
|
function TableCellResizer({
|
|
16
17
|
editor
|
|
17
18
|
}) {
|
|
@@ -34,6 +35,17 @@ function TableCellResizer({
|
|
|
34
35
|
const isMouseDownOnEvent = event => {
|
|
35
36
|
return (event.buttons & 1) === 1;
|
|
36
37
|
};
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
return editor.registerNodeTransform(TableNode, tableNode => {
|
|
40
|
+
if (tableNode.getColWidths()) {
|
|
41
|
+
return tableNode;
|
|
42
|
+
}
|
|
43
|
+
const numColumns = tableNode.getColumnCount();
|
|
44
|
+
const columnWidth = MIN_COLUMN_WIDTH;
|
|
45
|
+
tableNode.setColWidths(Array(numColumns).fill(columnWidth));
|
|
46
|
+
return tableNode;
|
|
47
|
+
});
|
|
48
|
+
}, [editor]);
|
|
37
49
|
useEffect(() => {
|
|
38
50
|
const onMouseMove = event_0 => {
|
|
39
51
|
setTimeout(() => {
|
|
@@ -58,8 +70,8 @@ function TableCellResizer({
|
|
|
58
70
|
if (!tableCellNode) {
|
|
59
71
|
throw new Error('TableCellResizer: Table cell node not found.');
|
|
60
72
|
}
|
|
61
|
-
const
|
|
62
|
-
const tableElement = editor.getElementByKey(
|
|
73
|
+
const tableNode_0 = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
74
|
+
const tableElement = editor.getElementByKey(tableNode_0.getKey());
|
|
63
75
|
if (!tableElement) {
|
|
64
76
|
throw new Error('TableCellResizer: Table element not found.');
|
|
65
77
|
}
|
|
@@ -84,12 +96,12 @@ function TableCellResizer({
|
|
|
84
96
|
}, 0);
|
|
85
97
|
};
|
|
86
98
|
const removeRootListener = editor.registerRootListener((rootElement, prevRootElement) => {
|
|
87
|
-
rootElement?.addEventListener('mousemove', onMouseMove);
|
|
88
|
-
rootElement?.addEventListener('mousedown', onMouseDown);
|
|
89
|
-
rootElement?.addEventListener('mouseup', onMouseUp);
|
|
90
99
|
prevRootElement?.removeEventListener('mousemove', onMouseMove);
|
|
91
100
|
prevRootElement?.removeEventListener('mousedown', onMouseDown);
|
|
92
101
|
prevRootElement?.removeEventListener('mouseup', onMouseUp);
|
|
102
|
+
rootElement?.addEventListener('mousemove', onMouseMove);
|
|
103
|
+
rootElement?.addEventListener('mousedown', onMouseDown);
|
|
104
|
+
rootElement?.addEventListener('mouseup', onMouseUp);
|
|
93
105
|
});
|
|
94
106
|
return () => {
|
|
95
107
|
removeRootListener();
|
|
@@ -110,9 +122,9 @@ function TableCellResizer({
|
|
|
110
122
|
if (!$isTableCellNode(tableCellNode_0)) {
|
|
111
123
|
throw new Error('TableCellResizer: Table cell node not found.');
|
|
112
124
|
}
|
|
113
|
-
const
|
|
114
|
-
const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode_0);
|
|
115
|
-
const tableRows =
|
|
125
|
+
const tableNode_1 = $getTableNodeFromLexicalNodeOrThrow(tableCellNode_0);
|
|
126
|
+
const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode_0) + tableCellNode_0.getRowSpan() - 1;
|
|
127
|
+
const tableRows = tableNode_1.getChildren();
|
|
116
128
|
if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {
|
|
117
129
|
throw new Error('Expected table cell to be inside of table row.');
|
|
118
130
|
}
|
|
@@ -131,21 +143,9 @@ function TableCellResizer({
|
|
|
131
143
|
tag: 'skip-scroll-into-view'
|
|
132
144
|
});
|
|
133
145
|
}, [activeCell, editor]);
|
|
134
|
-
const
|
|
135
|
-
const width = cell_1.getWidth();
|
|
136
|
-
if (width !== undefined) {
|
|
137
|
-
return width;
|
|
138
|
-
}
|
|
146
|
+
const getCellNodeHeight = (cell_1, activeEditor) => {
|
|
139
147
|
const domCellNode = activeEditor.getElementByKey(cell_1.getKey());
|
|
140
|
-
|
|
141
|
-
return undefined;
|
|
142
|
-
}
|
|
143
|
-
const computedStyle = getComputedStyle(domCellNode);
|
|
144
|
-
return domCellNode.clientWidth - parseFloat(computedStyle.paddingLeft) - parseFloat(computedStyle.paddingRight);
|
|
145
|
-
};
|
|
146
|
-
const getCellNodeHeight = (cell_2, activeEditor_0) => {
|
|
147
|
-
const domCellNode_0 = activeEditor_0.getElementByKey(cell_2.getKey());
|
|
148
|
-
return domCellNode_0?.clientHeight;
|
|
148
|
+
return domCellNode?.clientHeight;
|
|
149
149
|
};
|
|
150
150
|
const getCellColumnIndex = (tableCellNode_1, tableMap) => {
|
|
151
151
|
for (let row = 0; row < tableMap.length; row++) {
|
|
@@ -165,23 +165,24 @@ function TableCellResizer({
|
|
|
165
165
|
if (!$isTableCellNode(tableCellNode_2)) {
|
|
166
166
|
throw new Error('TableCellResizer: Table cell node not found.');
|
|
167
167
|
}
|
|
168
|
-
const
|
|
169
|
-
const [tableMap_0] = $computeTableMapSkipCellCheck(
|
|
168
|
+
const tableNode_2 = $getTableNodeFromLexicalNodeOrThrow(tableCellNode_2);
|
|
169
|
+
const [tableMap_0] = $computeTableMapSkipCellCheck(tableNode_2, null, null);
|
|
170
170
|
const columnIndex = getCellColumnIndex(tableCellNode_2, tableMap_0);
|
|
171
171
|
if (columnIndex === undefined) {
|
|
172
172
|
throw new Error('TableCellResizer: Table column not found.');
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const newWidth = Math.max(width_0 + widthChange, MIN_COLUMN_WIDTH);
|
|
182
|
-
cell_3.cell.setWidth(newWidth);
|
|
183
|
-
}
|
|
174
|
+
const colWidths = tableNode_2.getColWidths();
|
|
175
|
+
if (!colWidths) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const width = colWidths[columnIndex];
|
|
179
|
+
if (width === undefined) {
|
|
180
|
+
return;
|
|
184
181
|
}
|
|
182
|
+
const newColWidths = [...colWidths];
|
|
183
|
+
const newWidth = Math.max(width + widthChange, MIN_COLUMN_WIDTH);
|
|
184
|
+
newColWidths[columnIndex] = newWidth;
|
|
185
|
+
tableNode_2.setColWidths(newColWidths);
|
|
185
186
|
}, {
|
|
186
187
|
tag: 'skip-scroll-into-view'
|
|
187
188
|
});
|
|
@@ -235,7 +236,7 @@ function TableCellResizer({
|
|
|
235
236
|
height: height_0,
|
|
236
237
|
left,
|
|
237
238
|
top,
|
|
238
|
-
width:
|
|
239
|
+
width: width_0
|
|
239
240
|
} = activeCell.elem.getBoundingClientRect();
|
|
240
241
|
const zoom_0 = calculateZoomLevel(activeCell.elem);
|
|
241
242
|
const zoneWidth = 10 // Pixel width of the zone where you can drag the edge
|
|
@@ -247,13 +248,13 @@ function TableCellResizer({
|
|
|
247
248
|
height: `${zoneWidth}px`,
|
|
248
249
|
left: `${window.pageXOffset + left}px`,
|
|
249
250
|
top: `${window.pageYOffset + top + height_0 - zoneWidth / 2}px`,
|
|
250
|
-
width: `${
|
|
251
|
+
width: `${width_0}px`
|
|
251
252
|
},
|
|
252
253
|
right: {
|
|
253
254
|
backgroundColor: 'none',
|
|
254
255
|
cursor: 'col-resize',
|
|
255
256
|
height: `${height_0}px`,
|
|
256
|
-
left: `${window.pageXOffset + left +
|
|
257
|
+
left: `${window.pageXOffset + left + width_0 - zoneWidth / 2}px`,
|
|
257
258
|
top: `${window.pageYOffset + top}px`,
|
|
258
259
|
width: `${zoneWidth}px`
|
|
259
260
|
}
|
|
@@ -299,10 +300,22 @@ function TableCellResizer({
|
|
|
299
300
|
});
|
|
300
301
|
}
|
|
301
302
|
export const TableCellResizerPlugin = () => {
|
|
303
|
+
const $ = _c(3);
|
|
302
304
|
const [editor] = useLexicalComposerContext();
|
|
303
305
|
const isEditable = useLexicalEditable();
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
306
|
+
let t0;
|
|
307
|
+
let t1;
|
|
308
|
+
if ($[0] !== isEditable || $[1] !== editor) {
|
|
309
|
+
t1 = isEditable ? createPortal(_jsx(TableCellResizer, {
|
|
310
|
+
editor
|
|
311
|
+
}), document.body) : null;
|
|
312
|
+
$[0] = isEditable;
|
|
313
|
+
$[1] = editor;
|
|
314
|
+
$[2] = t1;
|
|
315
|
+
} else {
|
|
316
|
+
t1 = $[2];
|
|
317
|
+
}
|
|
318
|
+
t0 = t1;
|
|
319
|
+
return t0;
|
|
307
320
|
};
|
|
308
321
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalEditable","$computeTableMapSkipCellCheck","$getTableNodeFromLexicalNodeOrThrow","$getTableRowIndexFromTableCellNode","$isTableCellNode","$isTableRowNode","getDOMCellFromTarget","calculateZoomLevel","$getNearestNodeFromDOMNode","React","useCallback","useEffect","useMemo","useRef","useState","createPortal","useEditorConfigContext","MIN_ROW_HEIGHT","MIN_COLUMN_WIDTH","TableCellResizer","editor","targetRef","resizerRef","tableRectRef","editorConfig","mouseStartPosRef","mouseCurrentPos","updateMouseCurrentPos","activeCell","updateActiveCell","isMouseDown","updateIsMouseDown","draggingDirection","updateDraggingDirection","resetState","current","isMouseDownOnEvent","event","buttons","onMouseMove","setTimeout","target","x","clientX","y","clientY","contains","cell","update","tableCellNode","elem","Error","tableNode","tableElement","getElementByKey","getKey","getBoundingClientRect","onMouseDown","onMouseUp","removeRootListener","registerRootListener","rootElement","prevRootElement","addEventListener","removeEventListener","isHeightChanging","direction","updateRowHeight","heightChange","tableRowIndex","tableRows","getChildren","length","tableRow","height","getHeight","undefined","rowCells","Math","min","map","getCellNodeHeight","Infinity","newHeight","max","setHeight","tag","getCellNodeWidth","activeEditor","width","getWidth","domCellNode","computedStyle","getComputedStyle","clientWidth","parseFloat","paddingLeft","paddingRight","clientHeight","getCellColumnIndex","tableMap","row","column","updateColumnWidth","widthChange","columnIndex","startRow","newWidth","setWidth","mouseUpHandler","handler","preventDefault","stopPropagation","zoom","document","toggleResize","getResizers","left","top","zoneWidth","styles","bottom","backgroundColor","cursor","window","pageXOffset","pageYOffset","right","tableRect","resizerStyles","_jsx","ref","_jsxs","Fragment","className","lexical","theme","tableCellResizer","style","TableCellResizerPlugin","isEditable","body"],"sources":["../../../../../../src/features/experimental_table/client/plugins/TableCellResizerPlugin/index.tsx"],"sourcesContent":["'use client'\n\nimport type { TableCellNode, TableDOMCell, TableMapType, TableMapValueType } from '@lexical/table'\nimport type { LexicalEditor } from 'lexical'\nimport type { JSX, MouseEventHandler } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport {\n $computeTableMapSkipCellCheck,\n $getTableNodeFromLexicalNodeOrThrow,\n $getTableRowIndexFromTableCellNode,\n $isTableCellNode,\n $isTableRowNode,\n getDOMCellFromTarget,\n} from '@lexical/table'\nimport { calculateZoomLevel } from '@lexical/utils'\nimport { $getNearestNodeFromDOMNode } from 'lexical'\nimport * as React from 'react'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { PluginComponent } from '../../../../typesClient.js'\n\nimport { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js'\n\ntype MousePosition = {\n x: number\n y: number\n}\n\ntype MouseDraggingDirection = 'bottom' | 'right'\n\nconst MIN_ROW_HEIGHT = 33\nconst MIN_COLUMN_WIDTH = 50\n\nfunction TableCellResizer({ editor }: { editor: LexicalEditor }): JSX.Element {\n const targetRef = useRef<HTMLElement | null>(null)\n const resizerRef = useRef<HTMLDivElement | null>(null)\n const tableRectRef = useRef<ClientRect | null>(null)\n const editorConfig = useEditorConfigContext()\n\n const mouseStartPosRef = useRef<MousePosition | null>(null)\n const [mouseCurrentPos, updateMouseCurrentPos] = useState<MousePosition | null>(null)\n\n const [activeCell, updateActiveCell] = useState<TableDOMCell | null>(null)\n const [isMouseDown, updateIsMouseDown] = useState<boolean>(false)\n const [draggingDirection, updateDraggingDirection] = useState<MouseDraggingDirection | null>(null)\n\n const resetState = useCallback(() => {\n updateActiveCell(null)\n targetRef.current = null\n updateDraggingDirection(null)\n mouseStartPosRef.current = null\n tableRectRef.current = null\n }, [])\n\n const isMouseDownOnEvent = (event: MouseEvent) => {\n return (event.buttons & 1) === 1\n }\n\n useEffect(() => {\n const onMouseMove = (event: MouseEvent) => {\n setTimeout(() => {\n const target = event.target\n\n if (draggingDirection) {\n updateMouseCurrentPos({\n x: event.clientX,\n y: event.clientY,\n })\n return\n }\n updateIsMouseDown(isMouseDownOnEvent(event))\n if (resizerRef.current && resizerRef.current.contains(target as Node)) {\n return\n }\n\n if (targetRef.current !== target) {\n targetRef.current = target as HTMLElement\n const cell = getDOMCellFromTarget(target as HTMLElement)\n\n if (cell && activeCell !== cell) {\n editor.update(() => {\n const tableCellNode = $getNearestNodeFromDOMNode(cell.elem)\n\n if (!tableCellNode) {\n throw new Error('TableCellResizer: Table cell node not found.')\n }\n\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n const tableElement = editor.getElementByKey(tableNode.getKey())\n\n if (!tableElement) {\n throw new Error('TableCellResizer: Table element not found.')\n }\n\n targetRef.current = target as HTMLElement\n tableRectRef.current = tableElement.getBoundingClientRect()\n updateActiveCell(cell)\n })\n } else if (cell == null) {\n resetState()\n }\n }\n }, 0)\n }\n\n const onMouseDown = (event: MouseEvent) => {\n setTimeout(() => {\n updateIsMouseDown(true)\n }, 0)\n }\n\n const onMouseUp = (event: MouseEvent) => {\n setTimeout(() => {\n updateIsMouseDown(false)\n }, 0)\n }\n\n const removeRootListener = editor.registerRootListener((rootElement, prevRootElement) => {\n rootElement?.addEventListener('mousemove', onMouseMove)\n rootElement?.addEventListener('mousedown', onMouseDown)\n rootElement?.addEventListener('mouseup', onMouseUp)\n\n prevRootElement?.removeEventListener('mousemove', onMouseMove)\n prevRootElement?.removeEventListener('mousedown', onMouseDown)\n prevRootElement?.removeEventListener('mouseup', onMouseUp)\n })\n\n return () => {\n removeRootListener()\n }\n }, [activeCell, draggingDirection, editor, resetState])\n\n const isHeightChanging = (direction: MouseDraggingDirection) => {\n if (direction === 'bottom') {\n return true\n }\n return false\n }\n\n const updateRowHeight = useCallback(\n (heightChange: number) => {\n if (!activeCell) {\n throw new Error('TableCellResizer: Expected active cell.')\n }\n\n editor.update(\n () => {\n const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem)\n if (!$isTableCellNode(tableCellNode)) {\n throw new Error('TableCellResizer: Table cell node not found.')\n }\n\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n\n const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode)\n\n const tableRows = tableNode.getChildren()\n\n if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {\n throw new Error('Expected table cell to be inside of table row.')\n }\n\n const tableRow = tableRows[tableRowIndex]\n\n if (!$isTableRowNode(tableRow)) {\n throw new Error('Expected table row')\n }\n\n let height = tableRow.getHeight()\n if (height === undefined) {\n const rowCells = tableRow.getChildren<TableCellNode>()\n height = Math.min(\n ...rowCells.map((cell) => getCellNodeHeight(cell, editor) ?? Infinity),\n )\n }\n\n const newHeight = Math.max(height + heightChange, MIN_ROW_HEIGHT)\n tableRow.setHeight(newHeight)\n },\n { tag: 'skip-scroll-into-view' },\n )\n },\n [activeCell, editor],\n )\n\n const getCellNodeWidth = (\n cell: TableCellNode,\n activeEditor: LexicalEditor,\n ): number | undefined => {\n const width = cell.getWidth()\n if (width !== undefined) {\n return width\n }\n\n const domCellNode = activeEditor.getElementByKey(cell.getKey())\n if (domCellNode == null) {\n return undefined\n }\n const computedStyle = getComputedStyle(domCellNode)\n return (\n domCellNode.clientWidth -\n parseFloat(computedStyle.paddingLeft) -\n parseFloat(computedStyle.paddingRight)\n )\n }\n\n const getCellNodeHeight = (\n cell: TableCellNode,\n activeEditor: LexicalEditor,\n ): number | undefined => {\n const domCellNode = activeEditor.getElementByKey(cell.getKey())\n return domCellNode?.clientHeight\n }\n\n const getCellColumnIndex = (tableCellNode: TableCellNode, tableMap: TableMapType) => {\n for (let row = 0; row < tableMap.length; row++) {\n for (let column = 0; column < tableMap[row].length; column++) {\n if (tableMap[row][column].cell === tableCellNode) {\n return column\n }\n }\n }\n }\n\n const updateColumnWidth = useCallback(\n (widthChange: number) => {\n if (!activeCell) {\n throw new Error('TableCellResizer: Expected active cell.')\n }\n editor.update(\n () => {\n const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem)\n if (!$isTableCellNode(tableCellNode)) {\n throw new Error('TableCellResizer: Table cell node not found.')\n }\n\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n const [tableMap] = $computeTableMapSkipCellCheck(tableNode, null, null)\n const columnIndex = getCellColumnIndex(tableCellNode, tableMap)\n if (columnIndex === undefined) {\n throw new Error('TableCellResizer: Table column not found.')\n }\n\n for (let row = 0; row < tableMap.length; row++) {\n const cell: TableMapValueType = tableMap[row][columnIndex]\n if (\n cell.startRow === row &&\n (columnIndex === tableMap[row].length - 1 ||\n tableMap[row][columnIndex].cell !== tableMap[row][columnIndex + 1].cell)\n ) {\n const width = getCellNodeWidth(cell.cell, editor)\n if (width === undefined) {\n continue\n }\n const newWidth = Math.max(width + widthChange, MIN_COLUMN_WIDTH)\n cell.cell.setWidth(newWidth)\n }\n }\n },\n { tag: 'skip-scroll-into-view' },\n )\n },\n [activeCell, editor],\n )\n\n const mouseUpHandler = useCallback(\n (direction: MouseDraggingDirection) => {\n const handler = (event: MouseEvent) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (!activeCell) {\n throw new Error('TableCellResizer: Expected active cell.')\n }\n\n if (mouseStartPosRef.current) {\n const { x, y } = mouseStartPosRef.current\n\n if (activeCell === null) {\n return\n }\n const zoom = calculateZoomLevel(event.target as Element)\n\n if (isHeightChanging(direction)) {\n const heightChange = (event.clientY - y) / zoom\n updateRowHeight(heightChange)\n } else {\n const widthChange = (event.clientX - x) / zoom\n updateColumnWidth(widthChange)\n }\n\n resetState()\n document.removeEventListener('mouseup', handler)\n }\n }\n return handler\n },\n [activeCell, resetState, updateColumnWidth, updateRowHeight],\n )\n\n const toggleResize = useCallback(\n (direction: MouseDraggingDirection): MouseEventHandler<HTMLDivElement> =>\n (event) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (!activeCell) {\n throw new Error('TableCellResizer: Expected active cell.')\n }\n\n mouseStartPosRef.current = {\n x: event.clientX,\n y: event.clientY,\n }\n updateMouseCurrentPos(mouseStartPosRef.current)\n updateDraggingDirection(direction)\n\n document.addEventListener('mouseup', mouseUpHandler(direction))\n },\n [activeCell, mouseUpHandler],\n )\n\n const getResizers = useCallback(() => {\n if (activeCell) {\n const { height, left, top, width } = activeCell.elem.getBoundingClientRect()\n const zoom = calculateZoomLevel(activeCell.elem)\n const zoneWidth = 10 // Pixel width of the zone where you can drag the edge\n const styles = {\n bottom: {\n backgroundColor: 'none',\n cursor: 'row-resize',\n height: `${zoneWidth}px`,\n left: `${window.pageXOffset + left}px`,\n top: `${window.pageYOffset + top + height - zoneWidth / 2}px`,\n width: `${width}px`,\n },\n right: {\n backgroundColor: 'none',\n cursor: 'col-resize',\n height: `${height}px`,\n left: `${window.pageXOffset + left + width - zoneWidth / 2}px`,\n top: `${window.pageYOffset + top}px`,\n width: `${zoneWidth}px`,\n },\n }\n\n const tableRect = tableRectRef.current\n\n if (draggingDirection && mouseCurrentPos && tableRect) {\n if (isHeightChanging(draggingDirection)) {\n styles[draggingDirection].left = `${window.pageXOffset + tableRect.left}px`\n styles[draggingDirection].top = `${window.pageYOffset + mouseCurrentPos.y / zoom}px`\n styles[draggingDirection].height = '3px'\n styles[draggingDirection].width = `${tableRect.width}px`\n } else {\n styles[draggingDirection].top = `${window.pageYOffset + tableRect.top}px`\n styles[draggingDirection].left = `${window.pageXOffset + mouseCurrentPos.x / zoom}px`\n styles[draggingDirection].width = '3px'\n styles[draggingDirection].height = `${tableRect.height}px`\n }\n\n styles[draggingDirection].backgroundColor = '#adf'\n }\n\n return styles\n }\n\n return {\n bottom: null,\n left: null,\n right: null,\n top: null,\n }\n }, [activeCell, draggingDirection, mouseCurrentPos])\n\n const resizerStyles = getResizers()\n\n return (\n <div ref={resizerRef}>\n {activeCell != null && !isMouseDown && (\n <React.Fragment>\n <div\n className={`${editorConfig.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`}\n onMouseDown={toggleResize('right')}\n style={resizerStyles.right || undefined}\n />\n <div\n className={`${editorConfig.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`}\n onMouseDown={toggleResize('bottom')}\n style={resizerStyles.bottom || undefined}\n />\n </React.Fragment>\n )}\n </div>\n )\n}\n\nexport const TableCellResizerPlugin: PluginComponent = () => {\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n\n return useMemo(\n () => (isEditable ? createPortal(<TableCellResizer editor={editor} />, document.body) : null),\n [editor, isEditable],\n )\n}\n"],"mappings":"AAAA;;;AAMA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SACEC,6BAA6B,EAC7BC,mCAAmC,EACnCC,kCAAkC,EAClCC,gBAAgB,EAChBC,eAAe,EACfC,oBAAoB,QACf;AACP,SAASC,kBAAkB,QAAQ;AACnC,SAASC,0BAA0B,QAAQ;AAC3C,YAAYC,KAAA,MAAW;AACvB,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAClE,SAASC,YAAY,QAAQ;AAI7B,SAASC,sBAAsB,QAAQ;AASvC,MAAMC,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GAAA,EAAK;IACP;EACF,GAAG,CAAC1F,UAAA,EAAYI,iBAAA,EAAmBN,eAAA,CAAgB;EAEnD,MAAMuG,aAAA,GAAgBb,WAAA;EAEtB,oBACEc,IAAA,CAAC;IAAIC,GAAA,EAAK7G,UAAA;cACPM,UAAA,IAAc,QAAQ,CAACE,WAAA,iBACtBsG,KAAA,CAAC3H,KAAA,CAAM4H,QAAQ;8BACbH,IAAA,CAAC;QACCI,SAAA,EAAW,GAAG9G,YAAA,CAAaA,YAAY,CAAC+G,OAAO,CAACC,KAAK,CAACC,gBAAgB,uBAAuB;QAC7FhF,WAAA,EAAa0D,YAAA,CAAa;QAC1BuB,KAAA,EAAOT,aAAA,CAAcF,KAAK,IAAInD;uBAEhCsD,IAAA,CAAC;QACCI,SAAA,EAAW,GAAG9G,YAAA,CAAaA,YAAY,CAAC+G,OAAO,CAACC,KAAK,CAACC,gBAAgB,uBAAuB;QAC7FhF,WAAA,EAAa0D,YAAA,CAAa;QAC1BuB,KAAA,EAAOT,aAAA,CAAcR,MAAM,IAAI7C;;;;AAM3C;AAEA,OAAO,MAAM+D,sBAAA,GAA0CA,CAAA;EACrD,MAAM,CAACvH,MAAA,CAAO,GAAGrB,yBAAA;EACjB,MAAM6I,UAAA,GAAa5I,kBAAA;EAEnB,OAAOY,OAAA,CACL,MAAOgI,UAAA,gBAAa7H,YAAA,eAAamH,IAAA,CAAC/G,gBAAA;IAAiBC,MAAA,EAAQA;MAAY8F,QAAA,CAAS2B,IAAI,IAAI,MACxF,CAACzH,MAAA,EAAQwH,UAAA,CAAW;AAExB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useLexicalEditable","$computeTableMapSkipCellCheck","$getTableNodeFromLexicalNodeOrThrow","$getTableRowIndexFromTableCellNode","$isTableCellNode","$isTableRowNode","getDOMCellFromTarget","TableNode","calculateZoomLevel","$getNearestNodeFromDOMNode","React","useCallback","useEffect","useMemo","useRef","useState","createPortal","useEditorConfigContext","MIN_ROW_HEIGHT","MIN_COLUMN_WIDTH","TableCellResizer","editor","targetRef","resizerRef","tableRectRef","editorConfig","mouseStartPosRef","mouseCurrentPos","updateMouseCurrentPos","activeCell","updateActiveCell","isMouseDown","updateIsMouseDown","draggingDirection","updateDraggingDirection","resetState","current","isMouseDownOnEvent","event","buttons","registerNodeTransform","tableNode","getColWidths","numColumns","getColumnCount","columnWidth","setColWidths","Array","fill","onMouseMove","setTimeout","target","x","clientX","y","clientY","contains","cell","update","tableCellNode","elem","Error","tableElement","getElementByKey","getKey","getBoundingClientRect","onMouseDown","onMouseUp","removeRootListener","registerRootListener","rootElement","prevRootElement","removeEventListener","addEventListener","isHeightChanging","direction","updateRowHeight","heightChange","tableRowIndex","getRowSpan","tableRows","getChildren","length","tableRow","height","getHeight","undefined","rowCells","Math","min","map","getCellNodeHeight","Infinity","newHeight","max","setHeight","tag","activeEditor","domCellNode","clientHeight","getCellColumnIndex","tableMap","row","column","updateColumnWidth","widthChange","columnIndex","colWidths","width","newColWidths","newWidth","mouseUpHandler","handler","preventDefault","stopPropagation","zoom","document","toggleResize","getResizers","left","top","zoneWidth","styles","bottom","backgroundColor","cursor","window","pageXOffset","pageYOffset","right","tableRect","resizerStyles","_jsx","ref","_jsxs","Fragment","className","lexical","theme","tableCellResizer","style","TableCellResizerPlugin","$","isEditable","t0","t1"],"sources":["../../../../../../src/features/experimental_table/client/plugins/TableCellResizerPlugin/index.tsx"],"sourcesContent":["'use client'\n\nimport type { TableCellNode, TableDOMCell, TableMapType } from '@lexical/table'\nimport type { LexicalEditor } from 'lexical'\nimport type { JSX, MouseEventHandler } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport {\n $computeTableMapSkipCellCheck,\n $getTableNodeFromLexicalNodeOrThrow,\n $getTableRowIndexFromTableCellNode,\n $isTableCellNode,\n $isTableRowNode,\n getDOMCellFromTarget,\n TableNode,\n} from '@lexical/table'\nimport { calculateZoomLevel } from '@lexical/utils'\nimport { $getNearestNodeFromDOMNode } from 'lexical'\nimport * as React from 'react'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { PluginComponent } from '../../../../typesClient.js'\n\nimport { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js'\n\ntype MousePosition = {\n x: number\n y: number\n}\n\ntype MouseDraggingDirection = 'bottom' | 'right'\n\nconst MIN_ROW_HEIGHT = 33\nconst MIN_COLUMN_WIDTH = 92\n\nfunction TableCellResizer({ editor }: { editor: LexicalEditor }): JSX.Element {\n const targetRef = useRef<HTMLElement | null>(null)\n const resizerRef = useRef<HTMLDivElement | null>(null)\n const tableRectRef = useRef<ClientRect | null>(null)\n const editorConfig = useEditorConfigContext()\n\n const mouseStartPosRef = useRef<MousePosition | null>(null)\n const [mouseCurrentPos, updateMouseCurrentPos] = useState<MousePosition | null>(null)\n\n const [activeCell, updateActiveCell] = useState<null | TableDOMCell>(null)\n const [isMouseDown, updateIsMouseDown] = useState<boolean>(false)\n const [draggingDirection, updateDraggingDirection] = useState<MouseDraggingDirection | null>(null)\n\n const resetState = useCallback(() => {\n updateActiveCell(null)\n targetRef.current = null\n updateDraggingDirection(null)\n mouseStartPosRef.current = null\n tableRectRef.current = null\n }, [])\n\n const isMouseDownOnEvent = (event: MouseEvent) => {\n return (event.buttons & 1) === 1\n }\n\n useEffect(() => {\n return editor.registerNodeTransform(TableNode, (tableNode) => {\n if (tableNode.getColWidths()) {\n return tableNode\n }\n\n const numColumns = tableNode.getColumnCount()\n const columnWidth = MIN_COLUMN_WIDTH\n\n tableNode.setColWidths(Array(numColumns).fill(columnWidth))\n return tableNode\n })\n }, [editor])\n\n useEffect(() => {\n const onMouseMove = (event: MouseEvent) => {\n setTimeout(() => {\n const target = event.target\n\n if (draggingDirection) {\n updateMouseCurrentPos({\n x: event.clientX,\n y: event.clientY,\n })\n return\n }\n updateIsMouseDown(isMouseDownOnEvent(event))\n if (resizerRef.current && resizerRef.current.contains(target as Node)) {\n return\n }\n\n if (targetRef.current !== target) {\n targetRef.current = target as HTMLElement\n const cell = getDOMCellFromTarget(target as HTMLElement)\n\n if (cell && activeCell !== cell) {\n editor.update(() => {\n const tableCellNode = $getNearestNodeFromDOMNode(cell.elem)\n\n if (!tableCellNode) {\n throw new Error('TableCellResizer: Table cell node not found.')\n }\n\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n const tableElement = editor.getElementByKey(tableNode.getKey())\n\n if (!tableElement) {\n throw new Error('TableCellResizer: Table element not found.')\n }\n\n targetRef.current = target as HTMLElement\n tableRectRef.current = tableElement.getBoundingClientRect()\n updateActiveCell(cell)\n })\n } else if (cell == null) {\n resetState()\n }\n }\n }, 0)\n }\n\n const onMouseDown = (event: MouseEvent) => {\n setTimeout(() => {\n updateIsMouseDown(true)\n }, 0)\n }\n\n const onMouseUp = (event: MouseEvent) => {\n setTimeout(() => {\n updateIsMouseDown(false)\n }, 0)\n }\n\n const removeRootListener = editor.registerRootListener((rootElement, prevRootElement) => {\n prevRootElement?.removeEventListener('mousemove', onMouseMove)\n prevRootElement?.removeEventListener('mousedown', onMouseDown)\n prevRootElement?.removeEventListener('mouseup', onMouseUp)\n rootElement?.addEventListener('mousemove', onMouseMove)\n rootElement?.addEventListener('mousedown', onMouseDown)\n rootElement?.addEventListener('mouseup', onMouseUp)\n })\n\n return () => {\n removeRootListener()\n }\n }, [activeCell, draggingDirection, editor, resetState])\n\n const isHeightChanging = (direction: MouseDraggingDirection) => {\n if (direction === 'bottom') {\n return true\n }\n return false\n }\n\n const updateRowHeight = useCallback(\n (heightChange: number) => {\n if (!activeCell) {\n throw new Error('TableCellResizer: Expected active cell.')\n }\n\n editor.update(\n () => {\n const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem)\n if (!$isTableCellNode(tableCellNode)) {\n throw new Error('TableCellResizer: Table cell node not found.')\n }\n\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n\n const tableRowIndex =\n $getTableRowIndexFromTableCellNode(tableCellNode) + tableCellNode.getRowSpan() - 1\n\n const tableRows = tableNode.getChildren()\n\n if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {\n throw new Error('Expected table cell to be inside of table row.')\n }\n\n const tableRow = tableRows[tableRowIndex]\n\n if (!$isTableRowNode(tableRow)) {\n throw new Error('Expected table row')\n }\n\n let height = tableRow.getHeight()\n if (height === undefined) {\n const rowCells = tableRow.getChildren<TableCellNode>()\n height = Math.min(\n ...rowCells.map((cell) => getCellNodeHeight(cell, editor) ?? Infinity),\n )\n }\n\n const newHeight = Math.max(height + heightChange, MIN_ROW_HEIGHT)\n tableRow.setHeight(newHeight)\n },\n { tag: 'skip-scroll-into-view' },\n )\n },\n [activeCell, editor],\n )\n\n const getCellNodeHeight = (\n cell: TableCellNode,\n activeEditor: LexicalEditor,\n ): number | undefined => {\n const domCellNode = activeEditor.getElementByKey(cell.getKey())\n return domCellNode?.clientHeight\n }\n\n const getCellColumnIndex = (tableCellNode: TableCellNode, tableMap: TableMapType) => {\n for (let row = 0; row < tableMap.length; row++) {\n for (let column = 0; column < tableMap[row].length; column++) {\n if (tableMap[row][column].cell === tableCellNode) {\n return column\n }\n }\n }\n }\n\n const updateColumnWidth = useCallback(\n (widthChange: number) => {\n if (!activeCell) {\n throw new Error('TableCellResizer: Expected active cell.')\n }\n editor.update(\n () => {\n const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem)\n if (!$isTableCellNode(tableCellNode)) {\n throw new Error('TableCellResizer: Table cell node not found.')\n }\n\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n const [tableMap] = $computeTableMapSkipCellCheck(tableNode, null, null)\n const columnIndex = getCellColumnIndex(tableCellNode, tableMap)\n if (columnIndex === undefined) {\n throw new Error('TableCellResizer: Table column not found.')\n }\n\n const colWidths = tableNode.getColWidths()\n if (!colWidths) {\n return\n }\n const width = colWidths[columnIndex]\n if (width === undefined) {\n return\n }\n const newColWidths = [...colWidths]\n const newWidth = Math.max(width + widthChange, MIN_COLUMN_WIDTH)\n newColWidths[columnIndex] = newWidth\n tableNode.setColWidths(newColWidths)\n },\n { tag: 'skip-scroll-into-view' },\n )\n },\n [activeCell, editor],\n )\n\n const mouseUpHandler = useCallback(\n (direction: MouseDraggingDirection) => {\n const handler = (event: MouseEvent) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (!activeCell) {\n throw new Error('TableCellResizer: Expected active cell.')\n }\n\n if (mouseStartPosRef.current) {\n const { x, y } = mouseStartPosRef.current\n\n if (activeCell === null) {\n return\n }\n const zoom = calculateZoomLevel(event.target as Element)\n\n if (isHeightChanging(direction)) {\n const heightChange = (event.clientY - y) / zoom\n updateRowHeight(heightChange)\n } else {\n const widthChange = (event.clientX - x) / zoom\n updateColumnWidth(widthChange)\n }\n\n resetState()\n document.removeEventListener('mouseup', handler)\n }\n }\n return handler\n },\n [activeCell, resetState, updateColumnWidth, updateRowHeight],\n )\n\n const toggleResize = useCallback(\n (direction: MouseDraggingDirection): MouseEventHandler<HTMLDivElement> =>\n (event) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (!activeCell) {\n throw new Error('TableCellResizer: Expected active cell.')\n }\n\n mouseStartPosRef.current = {\n x: event.clientX,\n y: event.clientY,\n }\n updateMouseCurrentPos(mouseStartPosRef.current)\n updateDraggingDirection(direction)\n\n document.addEventListener('mouseup', mouseUpHandler(direction))\n },\n [activeCell, mouseUpHandler],\n )\n\n const getResizers = useCallback(() => {\n if (activeCell) {\n const { height, left, top, width } = activeCell.elem.getBoundingClientRect()\n const zoom = calculateZoomLevel(activeCell.elem)\n const zoneWidth = 10 // Pixel width of the zone where you can drag the edge\n const styles = {\n bottom: {\n backgroundColor: 'none',\n cursor: 'row-resize',\n height: `${zoneWidth}px`,\n left: `${window.pageXOffset + left}px`,\n top: `${window.pageYOffset + top + height - zoneWidth / 2}px`,\n width: `${width}px`,\n },\n right: {\n backgroundColor: 'none',\n cursor: 'col-resize',\n height: `${height}px`,\n left: `${window.pageXOffset + left + width - zoneWidth / 2}px`,\n top: `${window.pageYOffset + top}px`,\n width: `${zoneWidth}px`,\n },\n }\n\n const tableRect = tableRectRef.current\n\n if (draggingDirection && mouseCurrentPos && tableRect) {\n if (isHeightChanging(draggingDirection)) {\n styles[draggingDirection].left = `${window.pageXOffset + tableRect.left}px`\n styles[draggingDirection].top = `${window.pageYOffset + mouseCurrentPos.y / zoom}px`\n styles[draggingDirection].height = '3px'\n styles[draggingDirection].width = `${tableRect.width}px`\n } else {\n styles[draggingDirection].top = `${window.pageYOffset + tableRect.top}px`\n styles[draggingDirection].left = `${window.pageXOffset + mouseCurrentPos.x / zoom}px`\n styles[draggingDirection].width = '3px'\n styles[draggingDirection].height = `${tableRect.height}px`\n }\n\n styles[draggingDirection].backgroundColor = '#adf'\n }\n\n return styles\n }\n\n return {\n bottom: null,\n left: null,\n right: null,\n top: null,\n }\n }, [activeCell, draggingDirection, mouseCurrentPos])\n\n const resizerStyles = getResizers()\n\n return (\n <div ref={resizerRef}>\n {activeCell != null && !isMouseDown && (\n <React.Fragment>\n <div\n className={`${editorConfig.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`}\n onMouseDown={toggleResize('right')}\n style={resizerStyles.right || undefined}\n />\n <div\n className={`${editorConfig.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`}\n onMouseDown={toggleResize('bottom')}\n style={resizerStyles.bottom || undefined}\n />\n </React.Fragment>\n )}\n </div>\n )\n}\n\nexport const TableCellResizerPlugin: PluginComponent = () => {\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n\n return useMemo(\n () => (isEditable ? createPortal(<TableCellResizer editor={editor} />, document.body) : null),\n [editor, isEditable],\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAMA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;A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ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAiP9B,wBAAgB,uBAAuB,CAAC,EACtC,UAA0B,GAC3B,EAAE;IACD,UAAU,CAAC,EAAE,WAAW,CAAA;CACzB,GAAG,IAAI,GAAG,KAAK,CAAC,WAAW,CAO3B"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
5
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
5
6
|
import { $getTableColumnIndexFromTableCellNode, $getTableRowIndexFromTableCellNode, $insertTableColumn__EXPERIMENTAL, $insertTableRow__EXPERIMENTAL, $isTableCellNode, $isTableNode, TableNode } from '@lexical/table';
|
|
6
7
|
import { $findMatchingParent, mergeRegister } from '@lexical/utils';
|
|
7
8
|
import { $getNearestNodeFromDOMNode } from 'lexical';
|
|
8
|
-
import { useEffect, useRef, useState } from 'react';
|
|
9
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
9
10
|
import * as React from 'react';
|
|
10
11
|
import { createPortal } from 'react-dom';
|
|
11
12
|
import { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js';
|
|
@@ -20,8 +21,8 @@ function TableHoverActionsContainer({
|
|
|
20
21
|
const [isShownColumn, setShownColumn] = useState(false);
|
|
21
22
|
const [shouldListenMouseMove, setShouldListenMouseMove] = useState(false);
|
|
22
23
|
const [position, setPosition] = useState({});
|
|
23
|
-
const
|
|
24
|
-
const
|
|
24
|
+
const tableSetRef = useRef(new Set());
|
|
25
|
+
const tableCellDOMNodeRef = useRef(null);
|
|
25
26
|
const debouncedOnMouseMove = useDebounce(event => {
|
|
26
27
|
const {
|
|
27
28
|
isOutside,
|
|
@@ -35,7 +36,7 @@ function TableHoverActionsContainer({
|
|
|
35
36
|
if (!tableDOMNode) {
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
tableCellDOMNodeRef.current = tableDOMNode;
|
|
39
40
|
let hoveredRowNode = null;
|
|
40
41
|
let hoveredColumnNode = null;
|
|
41
42
|
let tableDOMElement = null;
|
|
@@ -66,9 +67,9 @@ function TableHoverActionsContainer({
|
|
|
66
67
|
const {
|
|
67
68
|
bottom: tableElemBottom,
|
|
68
69
|
height: tableElemHeight,
|
|
70
|
+
left: tableElemLeft,
|
|
69
71
|
right: tableElemRight,
|
|
70
72
|
width: tableElemWidth,
|
|
71
|
-
x: tableElemX,
|
|
72
73
|
y: tableElemY
|
|
73
74
|
} = tableDOMElement.getBoundingClientRect();
|
|
74
75
|
const {
|
|
@@ -80,7 +81,7 @@ function TableHoverActionsContainer({
|
|
|
80
81
|
setShownRow(true);
|
|
81
82
|
setPosition({
|
|
82
83
|
height: BUTTON_WIDTH_PX,
|
|
83
|
-
left:
|
|
84
|
+
left: tableElemLeft - editorElemLeft,
|
|
84
85
|
top: tableElemBottom - editorElemY + 5,
|
|
85
86
|
width: tableElemWidth
|
|
86
87
|
});
|
|
@@ -96,6 +97,14 @@ function TableHoverActionsContainer({
|
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
}, 50, 250);
|
|
100
|
+
// Hide the buttons on any table dimensions change to prevent last row cells
|
|
101
|
+
// overlap behind the 'Add Row' button when text entry changes cell height
|
|
102
|
+
const tableResizeObserver = useMemo(() => {
|
|
103
|
+
return new ResizeObserver(() => {
|
|
104
|
+
setShownRow(false);
|
|
105
|
+
setShownColumn(false);
|
|
106
|
+
});
|
|
107
|
+
}, []);
|
|
99
108
|
useEffect(() => {
|
|
100
109
|
if (!shouldListenMouseMove) {
|
|
101
110
|
return;
|
|
@@ -111,14 +120,26 @@ function TableHoverActionsContainer({
|
|
|
111
120
|
return mergeRegister(editor.registerMutationListener(TableNode, mutations => {
|
|
112
121
|
editor.getEditorState().read(() => {
|
|
113
122
|
for (const [key, type] of mutations) {
|
|
123
|
+
const tableDOMElement_0 = editor.getElementByKey(key);
|
|
114
124
|
switch (type) {
|
|
115
125
|
case 'created':
|
|
116
|
-
|
|
117
|
-
setShouldListenMouseMove(
|
|
126
|
+
tableSetRef.current.add(key);
|
|
127
|
+
setShouldListenMouseMove(tableSetRef.current.size > 0);
|
|
128
|
+
if (tableDOMElement_0) {
|
|
129
|
+
tableResizeObserver.observe(tableDOMElement_0);
|
|
130
|
+
}
|
|
118
131
|
break;
|
|
119
132
|
case 'destroyed':
|
|
120
|
-
|
|
121
|
-
setShouldListenMouseMove(
|
|
133
|
+
tableSetRef.current.delete(key);
|
|
134
|
+
setShouldListenMouseMove(tableSetRef.current.size > 0);
|
|
135
|
+
// Reset resize observers
|
|
136
|
+
tableResizeObserver.disconnect();
|
|
137
|
+
tableSetRef.current.forEach(tableKey => {
|
|
138
|
+
const tableElement = editor.getElementByKey(tableKey);
|
|
139
|
+
if (tableElement) {
|
|
140
|
+
tableResizeObserver.observe(tableElement);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
122
143
|
break;
|
|
123
144
|
default:
|
|
124
145
|
break;
|
|
@@ -128,11 +149,11 @@ function TableHoverActionsContainer({
|
|
|
128
149
|
}, {
|
|
129
150
|
skipInitialization: false
|
|
130
151
|
}));
|
|
131
|
-
}, [editor]);
|
|
152
|
+
}, [editor, tableResizeObserver]);
|
|
132
153
|
const insertAction = insertRow => {
|
|
133
154
|
editor.update(() => {
|
|
134
|
-
if (
|
|
135
|
-
const maybeTableNode = $getNearestNodeFromDOMNode(
|
|
155
|
+
if (tableCellDOMNodeRef.current) {
|
|
156
|
+
const maybeTableNode = $getNearestNodeFromDOMNode(tableCellDOMNodeRef.current);
|
|
136
157
|
maybeTableNode?.selectEnd();
|
|
137
158
|
if (insertRow) {
|
|
138
159
|
$insertTableRow__EXPERIMENTAL();
|
|
@@ -144,6 +165,9 @@ function TableHoverActionsContainer({
|
|
|
144
165
|
}
|
|
145
166
|
});
|
|
146
167
|
};
|
|
168
|
+
if (!editor?.isEditable()) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
147
171
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
148
172
|
children: [isShownRow && /*#__PURE__*/_jsx("button", {
|
|
149
173
|
className: editorConfig.editorConfig.lexical.theme.tableAddRows,
|
|
@@ -176,11 +200,26 @@ function getMouseInfo(event, editorConfig) {
|
|
|
176
200
|
};
|
|
177
201
|
}
|
|
178
202
|
}
|
|
179
|
-
export function TableHoverActionsPlugin({
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
203
|
+
export function TableHoverActionsPlugin(t0) {
|
|
204
|
+
const $ = _c(2);
|
|
205
|
+
const {
|
|
206
|
+
anchorElem: t1
|
|
207
|
+
} = t0;
|
|
208
|
+
const anchorElem = t1 === undefined ? document.body : t1;
|
|
209
|
+
const [editor] = useLexicalComposerContext();
|
|
210
|
+
if (!editor?.isEditable()) {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
let t2;
|
|
214
|
+
if ($[0] !== anchorElem) {
|
|
215
|
+
t2 = createPortal(_jsx(TableHoverActionsContainer, {
|
|
216
|
+
anchorElem
|
|
217
|
+
}), anchorElem);
|
|
218
|
+
$[0] = anchorElem;
|
|
219
|
+
$[1] = t2;
|
|
220
|
+
} else {
|
|
221
|
+
t2 = $[1];
|
|
222
|
+
}
|
|
223
|
+
return t2;
|
|
185
224
|
}
|
|
186
225
|
//# sourceMappingURL=index.js.map
|
package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useLexicalComposerContext","$getTableColumnIndexFromTableCellNode","$getTableRowIndexFromTableCellNode","$insertTableColumn__EXPERIMENTAL","$insertTableRow__EXPERIMENTAL","$isTableCellNode","$isTableNode","TableNode","$findMatchingParent","mergeRegister","$getNearestNodeFromDOMNode","useEffect","useRef","useState","React","createPortal","useEditorConfigContext","useDebounce","BUTTON_WIDTH_PX","TableHoverActionsContainer","anchorElem","editor","editorConfig","isShownRow","setShownRow","isShownColumn","setShownColumn","shouldListenMouseMove","setShouldListenMouseMove","position","setPosition","codeSetRef","Set","tableDOMNodeRef","debouncedOnMouseMove","event","isOutside","tableDOMNode","getMouseInfo","lexical","current","hoveredRowNode","hoveredColumnNode","tableDOMElement","update","maybeTableCell","table","node","getElementByKey","getKey","rowCount","getChildrenSize","colCount","getChildAtIndex","rowIndex","colIndex","bottom","tableElemBottom","height","tableElemHeight","right","tableElemRight","width","tableElemWidth","x","tableElemX","y","tableElemY","getBoundingClientRect","left","editorElemLeft","editorElemY","top","document","addEventListener","removeEventListener","registerMutationListener","mutations","getEditorState","read","key","type","add","size","delete","skipInitialization","insertAction","insertRow","maybeTableNode","selectEnd","_jsxs","_Fragment","_jsx","className","theme","tableAddRows","onClick","style","tableAddColumns","target","HTMLElement","closest","tableCell","tableCellResizer","TableHoverActionsPlugin","body"],"sources":["../../../../../../src/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.tsx"],"sourcesContent":["'use client'\n\nimport type { TableCellNode, TableRowNode } from '@lexical/table'\nimport type { EditorConfig, NodeKey } from 'lexical'\nimport type { JSX } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport {\n $getTableColumnIndexFromTableCellNode,\n $getTableRowIndexFromTableCellNode,\n $insertTableColumn__EXPERIMENTAL,\n $insertTableRow__EXPERIMENTAL,\n $isTableCellNode,\n $isTableNode,\n TableNode,\n} from '@lexical/table'\nimport { $findMatchingParent, mergeRegister } from '@lexical/utils'\nimport { $getNearestNodeFromDOMNode } from 'lexical'\nimport { useEffect, useRef, useState } from 'react'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport { useDebounce } from '../../utils/useDebounce.js'\n\nconst BUTTON_WIDTH_PX = 20\n\nfunction TableHoverActionsContainer({ anchorElem }: { anchorElem: HTMLElement }): JSX.Element {\n const [editor] = useLexicalComposerContext()\n const editorConfig = useEditorConfigContext()\n const [isShownRow, setShownRow] = useState<boolean>(false)\n const [isShownColumn, setShownColumn] = useState<boolean>(false)\n const [shouldListenMouseMove, setShouldListenMouseMove] = useState<boolean>(false)\n const [position, setPosition] = useState({})\n const codeSetRef = useRef<Set<NodeKey>>(new Set())\n const tableDOMNodeRef = useRef<HTMLElement | null>(null)\n\n const debouncedOnMouseMove = useDebounce(\n (event: MouseEvent) => {\n const { isOutside, tableDOMNode } = getMouseInfo(event, editorConfig.editorConfig?.lexical)\n\n if (isOutside) {\n setShownRow(false)\n setShownColumn(false)\n return\n }\n\n if (!tableDOMNode) {\n return\n }\n\n tableDOMNodeRef.current = tableDOMNode\n\n let hoveredRowNode: TableCellNode | null = null\n let hoveredColumnNode: TableCellNode | null = null\n let tableDOMElement: HTMLElement | null = null\n\n editor.update(() => {\n const maybeTableCell = $getNearestNodeFromDOMNode(tableDOMNode)\n\n if ($isTableCellNode(maybeTableCell)) {\n const table = $findMatchingParent(maybeTableCell, (node) => $isTableNode(node))\n if (!$isTableNode(table)) {\n return\n }\n\n tableDOMElement = editor.getElementByKey(table?.getKey())\n\n if (tableDOMElement) {\n const rowCount = table.getChildrenSize()\n const colCount =\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n ((table as TableNode).getChildAtIndex(0) as TableRowNode)?.getChildrenSize()\n\n const rowIndex = $getTableRowIndexFromTableCellNode(maybeTableCell)\n const colIndex = $getTableColumnIndexFromTableCellNode(maybeTableCell)\n\n if (rowIndex === rowCount - 1) {\n hoveredRowNode = maybeTableCell\n } else if (colIndex === colCount - 1) {\n hoveredColumnNode = maybeTableCell\n }\n }\n }\n })\n\n if (tableDOMElement) {\n const {\n bottom: tableElemBottom,\n height: tableElemHeight,\n right: tableElemRight,\n width: tableElemWidth,\n x: tableElemX,\n y: tableElemY,\n } = (tableDOMElement as HTMLTableElement).getBoundingClientRect()\n\n const { left: editorElemLeft, y: editorElemY } = anchorElem.getBoundingClientRect()\n\n if (hoveredRowNode) {\n setShownColumn(false)\n setShownRow(true)\n setPosition({\n height: BUTTON_WIDTH_PX,\n left: tableElemX - editorElemLeft,\n top: tableElemBottom - editorElemY + 5,\n width: tableElemWidth,\n })\n } else if (hoveredColumnNode) {\n setShownColumn(true)\n setShownRow(false)\n setPosition({\n height: tableElemHeight,\n left: tableElemRight - editorElemLeft + 5,\n top: tableElemY - editorElemY,\n width: BUTTON_WIDTH_PX,\n })\n }\n }\n },\n 50,\n 250,\n )\n\n useEffect(() => {\n if (!shouldListenMouseMove) {\n return\n }\n\n document.addEventListener('mousemove', debouncedOnMouseMove)\n\n return () => {\n setShownRow(false)\n setShownColumn(false)\n\n document.removeEventListener('mousemove', debouncedOnMouseMove)\n }\n }, [shouldListenMouseMove, debouncedOnMouseMove])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerMutationListener(\n TableNode,\n (mutations) => {\n editor.getEditorState().read(() => {\n for (const [key, type] of mutations) {\n switch (type) {\n case 'created':\n codeSetRef.current.add(key)\n setShouldListenMouseMove(codeSetRef.current.size > 0)\n break\n\n case 'destroyed':\n codeSetRef.current.delete(key)\n setShouldListenMouseMove(codeSetRef.current.size > 0)\n break\n\n default:\n break\n }\n }\n })\n },\n { skipInitialization: false },\n ),\n )\n }, [editor])\n\n const insertAction = (insertRow: boolean) => {\n editor.update(() => {\n if (tableDOMNodeRef.current) {\n const maybeTableNode = $getNearestNodeFromDOMNode(tableDOMNodeRef.current)\n maybeTableNode?.selectEnd()\n if (insertRow) {\n $insertTableRow__EXPERIMENTAL()\n setShownRow(false)\n } else {\n $insertTableColumn__EXPERIMENTAL()\n setShownColumn(false)\n }\n }\n })\n }\n\n return (\n <>\n {isShownRow && (\n <button\n className={editorConfig.editorConfig.lexical.theme.tableAddRows}\n onClick={() => insertAction(true)}\n style={{ ...position }}\n />\n )}\n {isShownColumn && (\n <button\n className={editorConfig.editorConfig.lexical.theme.tableAddColumns}\n onClick={() => insertAction(false)}\n style={{ ...position }}\n />\n )}\n </>\n )\n}\n\nfunction getMouseInfo(\n event: MouseEvent,\n editorConfig: EditorConfig,\n): {\n isOutside: boolean\n tableDOMNode: HTMLElement | null\n} {\n const target = event.target\n\n if (target && target instanceof HTMLElement) {\n const tableDOMNode = target.closest<HTMLElement>(\n `td.${editorConfig.theme.tableCell}, th.${editorConfig.theme.tableCell}`,\n )\n\n const isOutside = !(\n tableDOMNode ||\n target.closest<HTMLElement>(`button.${editorConfig.theme.tableAddRows}`) ||\n target.closest<HTMLElement>(`button.${editorConfig.theme.tableAddColumns}`) ||\n target.closest<HTMLElement>(`div.${editorConfig.theme.tableCellResizer}`)\n )\n\n return { isOutside, tableDOMNode }\n } else {\n return { isOutside: true, tableDOMNode: null }\n }\n}\n\nexport function TableHoverActionsPlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactPortal | null {\n return createPortal(<TableHoverActionsContainer anchorElem={anchorElem} />, anchorElem)\n}\n"],"mappings":"AAAA;;;AAMA,SAASA,yBAAyB,QAAQ;AAC1C,SACEC,qCAAqC,EACrCC,kCAAkC,EAClCC,gCAAgC,EAChCC,6BAA6B,EAC7BC,gBAAgB,EAChBC,YAAY,EACZC,SAAS,QACJ;AACP,SAASC,mBAAmB,EAAEC,aAAa,QAAQ;AACnD,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,SAAS,EAAEC,MAAM,EAAEC,QA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YAAA,EAAc;IAAK;EAC/C;AACF;AAEA,OAAO,SAASmE,wBAAwB;EACtCpF,UAAA,GAAaqD,QAAA,CAASgC;AAAI,CAG3B;EACC,oBAAO1F,YAAA,eAAa6E,IAAA,CAACzE,0BAAA;IAA2BC,UAAA,EAAYA;MAAgBA,UAAA;AAC9E","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$getTableColumnIndexFromTableCellNode","$getTableRowIndexFromTableCellNode","$insertTableColumn__EXPERIMENTAL","$insertTableRow__EXPERIMENTAL","$isTableCellNode","$isTableNode","TableNode","$findMatchingParent","mergeRegister","$getNearestNodeFromDOMNode","useEffect","useMemo","useRef","useState","React","createPortal","useEditorConfigContext","useDebounce","BUTTON_WIDTH_PX","TableHoverActionsContainer","anchorElem","editor","editorConfig","isShownRow","setShownRow","isShownColumn","setShownColumn","shouldListenMouseMove","setShouldListenMouseMove","position","setPosition","tableSetRef","Set","tableCellDOMNodeRef","debouncedOnMouseMove","event","isOutside","tableDOMNode","getMouseInfo","lexical","current","hoveredRowNode","hoveredColumnNode","tableDOMElement","update","maybeTableCell","table","node","getElementByKey","getKey","rowCount","getChildrenSize","colCount","getChildAtIndex","rowIndex","colIndex","bottom","tableElemBottom","height","tableElemHeight","left","tableElemLeft","right","tableElemRight","width","tableElemWidth","y","tableElemY","getBoundingClientRect","editorElemLeft","editorElemY","top","tableResizeObserver","ResizeObserver","document","addEventListener","removeEventListener","registerMutationListener","mutations","getEditorState","read","key","type","add","size","observe","delete","disconnect","forEach","tableKey","tableElement","skipInitialization","insertAction","insertRow","maybeTableNode","selectEnd","isEditable","_jsxs","_Fragment","_jsx","className","theme","tableAddRows","onClick","style","tableAddColumns","target","HTMLElement","closest","tableCell","tableCellResizer","TableHoverActionsPlugin","t0","$","t1","undefined","body","t2"],"sources":["../../../../../../src/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.tsx"],"sourcesContent":["'use client'\n\nimport type { TableCellNode, TableRowNode } from '@lexical/table'\nimport type { EditorConfig, NodeKey } from 'lexical'\nimport type { JSX } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport {\n $getTableColumnIndexFromTableCellNode,\n $getTableRowIndexFromTableCellNode,\n $insertTableColumn__EXPERIMENTAL,\n $insertTableRow__EXPERIMENTAL,\n $isTableCellNode,\n $isTableNode,\n TableNode,\n} from '@lexical/table'\nimport { $findMatchingParent, mergeRegister } from '@lexical/utils'\nimport { $getNearestNodeFromDOMNode } from 'lexical'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport { useDebounce } from '../../utils/useDebounce.js'\n\nconst BUTTON_WIDTH_PX = 20\n\nfunction TableHoverActionsContainer({\n anchorElem,\n}: {\n anchorElem: HTMLElement\n}): JSX.Element | null {\n const [editor] = useLexicalComposerContext()\n const editorConfig = useEditorConfigContext()\n const [isShownRow, setShownRow] = useState<boolean>(false)\n const [isShownColumn, setShownColumn] = useState<boolean>(false)\n const [shouldListenMouseMove, setShouldListenMouseMove] = useState<boolean>(false)\n const [position, setPosition] = useState({})\n const tableSetRef = useRef<Set<NodeKey>>(new Set())\n const tableCellDOMNodeRef = useRef<HTMLElement | null>(null)\n\n const debouncedOnMouseMove = useDebounce(\n (event: MouseEvent) => {\n const { isOutside, tableDOMNode } = getMouseInfo(event, editorConfig.editorConfig?.lexical)\n\n if (isOutside) {\n setShownRow(false)\n setShownColumn(false)\n return\n }\n\n if (!tableDOMNode) {\n return\n }\n\n tableCellDOMNodeRef.current = tableDOMNode\n\n let hoveredRowNode: null | TableCellNode = null\n let hoveredColumnNode: null | TableCellNode = null\n let tableDOMElement: HTMLElement | null = null\n\n editor.update(() => {\n const maybeTableCell = $getNearestNodeFromDOMNode(tableDOMNode)\n\n if ($isTableCellNode(maybeTableCell)) {\n const table = $findMatchingParent(maybeTableCell, (node) => $isTableNode(node))\n if (!$isTableNode(table)) {\n return\n }\n\n tableDOMElement = editor.getElementByKey(table?.getKey())\n\n if (tableDOMElement) {\n const rowCount = table.getChildrenSize()\n const colCount =\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n ((table as TableNode).getChildAtIndex(0) as TableRowNode)?.getChildrenSize()\n\n const rowIndex = $getTableRowIndexFromTableCellNode(maybeTableCell)\n const colIndex = $getTableColumnIndexFromTableCellNode(maybeTableCell)\n\n if (rowIndex === rowCount - 1) {\n hoveredRowNode = maybeTableCell\n } else if (colIndex === colCount - 1) {\n hoveredColumnNode = maybeTableCell\n }\n }\n }\n })\n\n if (tableDOMElement) {\n const {\n bottom: tableElemBottom,\n height: tableElemHeight,\n left: tableElemLeft,\n right: tableElemRight,\n width: tableElemWidth,\n y: tableElemY,\n } = (tableDOMElement as HTMLTableElement).getBoundingClientRect()\n\n const { left: editorElemLeft, y: editorElemY } = anchorElem.getBoundingClientRect()\n\n if (hoveredRowNode) {\n setShownColumn(false)\n setShownRow(true)\n setPosition({\n height: BUTTON_WIDTH_PX,\n left: tableElemLeft - editorElemLeft,\n top: tableElemBottom - editorElemY + 5,\n width: tableElemWidth,\n })\n } else if (hoveredColumnNode) {\n setShownColumn(true)\n setShownRow(false)\n setPosition({\n height: tableElemHeight,\n left: tableElemRight - editorElemLeft + 5,\n top: tableElemY - editorElemY,\n width: BUTTON_WIDTH_PX,\n })\n }\n }\n },\n 50,\n 250,\n )\n\n // Hide the buttons on any table dimensions change to prevent last row cells\n // overlap behind the 'Add Row' button when text entry changes cell height\n const tableResizeObserver = useMemo(() => {\n return new ResizeObserver(() => {\n setShownRow(false)\n setShownColumn(false)\n })\n }, [])\n\n useEffect(() => {\n if (!shouldListenMouseMove) {\n return\n }\n\n document.addEventListener('mousemove', debouncedOnMouseMove)\n\n return () => {\n setShownRow(false)\n setShownColumn(false)\n\n document.removeEventListener('mousemove', debouncedOnMouseMove)\n }\n }, [shouldListenMouseMove, debouncedOnMouseMove])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerMutationListener(\n TableNode,\n (mutations) => {\n editor.getEditorState().read(() => {\n for (const [key, type] of mutations) {\n const tableDOMElement = editor.getElementByKey(key)\n\n switch (type) {\n case 'created':\n tableSetRef.current.add(key)\n setShouldListenMouseMove(tableSetRef.current.size > 0)\n if (tableDOMElement) {\n tableResizeObserver.observe(tableDOMElement)\n }\n break\n\n case 'destroyed':\n tableSetRef.current.delete(key)\n setShouldListenMouseMove(tableSetRef.current.size > 0)\n // Reset resize observers\n tableResizeObserver.disconnect()\n tableSetRef.current.forEach((tableKey: NodeKey) => {\n const tableElement = editor.getElementByKey(tableKey)\n if (tableElement) {\n tableResizeObserver.observe(tableElement)\n }\n })\n break\n\n default:\n break\n }\n }\n })\n },\n { skipInitialization: false },\n ),\n )\n }, [editor, tableResizeObserver])\n\n const insertAction = (insertRow: boolean) => {\n editor.update(() => {\n if (tableCellDOMNodeRef.current) {\n const maybeTableNode = $getNearestNodeFromDOMNode(tableCellDOMNodeRef.current)\n maybeTableNode?.selectEnd()\n if (insertRow) {\n $insertTableRow__EXPERIMENTAL()\n setShownRow(false)\n } else {\n $insertTableColumn__EXPERIMENTAL()\n setShownColumn(false)\n }\n }\n })\n }\n\n if (!editor?.isEditable()) {\n return null\n }\n\n return (\n <>\n {isShownRow && (\n <button\n className={editorConfig.editorConfig.lexical.theme.tableAddRows}\n onClick={() => insertAction(true)}\n style={{ ...position }}\n />\n )}\n {isShownColumn && (\n <button\n className={editorConfig.editorConfig.lexical.theme.tableAddColumns}\n onClick={() => insertAction(false)}\n style={{ ...position }}\n />\n )}\n </>\n )\n}\n\nfunction getMouseInfo(\n event: MouseEvent,\n editorConfig: EditorConfig,\n): {\n isOutside: boolean\n tableDOMNode: HTMLElement | null\n} {\n const target = event.target\n\n if (target && target instanceof HTMLElement) {\n const tableDOMNode = target.closest<HTMLElement>(\n `td.${editorConfig.theme.tableCell}, th.${editorConfig.theme.tableCell}`,\n )\n\n const isOutside = !(\n tableDOMNode ||\n target.closest<HTMLElement>(`button.${editorConfig.theme.tableAddRows}`) ||\n target.closest<HTMLElement>(`button.${editorConfig.theme.tableAddColumns}`) ||\n target.closest<HTMLElement>(`div.${editorConfig.theme.tableCellResizer}`)\n )\n\n return { isOutside, tableDOMNode }\n } else {\n return { isOutside: true, tableDOMNode: null }\n }\n}\n\nexport function TableHoverActionsPlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): null | React.ReactPortal {\n const [editor] = useLexicalComposerContext()\n if (!editor?.isEditable()) {\n return null\n }\n\n return createPortal(<TableHoverActionsContainer anchorElem={anchorElem} />, anchorElem)\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAMA,SAASC,yBAAyB,QAAQ;AAC1C,SACEC,qCAAqC,EACrCC,kCAAkC,EAClCC,gCAAgC,EAChCC,6BAA6B,EAC7BC,gBAAgB,EAChBC,YAAY,EACZC,SAAS,QACJ;AACP,SAASC,mBAAmB,EAAEC,aAAa,QAAQ;AACnD,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AACrD,YAAYC,KAAA,MAAW;AACvB,SAASC,YAAY,QAAQ;AAE7B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,WAAW,QAAQ;AAE5B,MAAMC,eAAA,GAAkB;AAExB,SAASC,2BAA2B;EAClCC;AAAU,CAGX;EACC,MAAM,CAACC,MAAA,CAAO,GAAGtB,yBAAA;EACjB,MAAMuB,YAAA,GAAeN,sBAAA;EACrB,MAAM,CAACO,UAAA,EAAYC,WAAA,CAAY,GAAGX,QAAA,CAAkB;EACpD,MAAM,CAACY,aAAA,EAAeC,cAAA,CAAe,GAAGb,QAAA,CAAkB;EAC1D,MAAM,CAACc,qBAAA,EAAuBC,wBAAA,CAAyB,GAAGf,QAAA,CAAkB;EAC5E,MAAM,CAACgB,QAAA,EAAUC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,YAAA,CAAa+E,KAAK,CAACS,gBAAgB,EAAE;IAG1E,OAAO;MAAE1E,SAAA;MAAWC;IAAa;EACnC,OAAO;IACL,OAAO;MAAED,SAAA,EAAW;MAAMC,YAAA,EAAc;IAAK;EAC/C;AACF;AAEA,OAAO,SAAA0E,wBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAnH,EAAA;EAAiC;IAAAsB,UAAA,EAAA8F;EAAA,IAAAF,EAIvC;EAHC,MAAA5F,UAAA,GAAA8F,EAA0B,KAAAC,SAAA,GAAAzC,QAAA,CAAA0C,IAAA,GAA1BF,EAA0B;EAI1B,OAAA7F,MAAA,IAAiBtB,yBAAA;EAAA,KACZsB,MAAA,EAAA2E,UAAA;IAAA;EAAA;EAAA,IAAAqB,EAAA;EAAA,IAAAJ,CAAA,QAAA7F,UAAA;IAIEiG,EAAA,GAAAtG,YAAA,CAAaoF,IAAA,CAAAhF,0BAAA;MAAAC;IAAA,C,GAAwDA,UAAA;IAAA6F,CAAA,MAAA7F,UAAA;IAAA6F,CAAA,MAAAI,EAAA;EAAA;IAAAA,EAAA,GAAAJ,CAAA;EAAA;EAAA,OAArEI,EAAqE;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/experimental_table/client/plugins/TablePlugin/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,KAAK,EACL,cAAc,EACd,aAAa,EACb,WAAW,EAEZ,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAShC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/experimental_table/client/plugins/TablePlugin/index.tsx"],"names":[],"mappings":"AAEA,O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