@payloadcms/richtext-lexical 4.0.0-internal.c7d5de4 → 4.0.0-internal.cb69780
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/exports/client/Field-TS5CRYHE.js +2 -0
- package/dist/exports/client/Field-TS5CRYHE.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
- package/dist/exports/client/{chunk-X3D4LZS7.js.map → chunk-3LRZDIIG.js.map} +4 -4
- package/dist/exports/client/chunk-43E5QYAA.js +2 -0
- package/dist/exports/client/chunk-43E5QYAA.js.map +7 -0
- package/dist/exports/client/{chunk-ESITTE3C.js → chunk-ZFGDYZDE.js} +2 -2
- package/dist/exports/client/{chunk-ESITTE3C.js.map → chunk-ZFGDYZDE.js.map} +2 -2
- package/dist/exports/client/component-D5QLYS7W.js +2 -0
- package/dist/exports/client/component-D5QLYS7W.js.map +7 -0
- package/dist/exports/client/componentInline-55HZXGUS.js +2 -0
- package/dist/exports/client/index.d.ts +1 -1
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +26 -26
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
- package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
- package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
- package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
- package/dist/features/blocks/client/component/index.d.ts +0 -6
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +133 -76
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
- package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
- package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
- package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +2 -2
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/server/index.js +2 -2
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
- package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
- package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
- package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
- package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
- package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
- package/dist/features/heading/constants.d.ts +2 -0
- package/dist/features/heading/constants.d.ts.map +1 -0
- package/dist/features/heading/constants.js +2 -0
- package/dist/features/heading/constants.js.map +1 -0
- package/dist/features/heading/server/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.js +5 -1
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/heading/server/validate.d.ts +6 -0
- package/dist/features/heading/server/validate.d.ts.map +1 -0
- package/dist/features/heading/server/validate.js +15 -0
- package/dist/features/heading/server/validate.js.map +1 -0
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
- 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/IndentPlugin.d.ts.map +1 -1
- package/dist/features/indent/client/IndentPlugin.js +122 -1
- package/dist/features/indent/client/IndentPlugin.js.map +1 -1
- package/dist/features/indent/server/i18n.d.ts.map +1 -1
- package/dist/features/indent/server/i18n.js +74 -37
- package/dist/features/indent/server/i18n.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 +6 -3
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -1
- package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
- package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
- package/dist/features/link/nodes/LinkNode.d.ts +1 -1
- package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/features/link/server/index.js +2 -2
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
- package/dist/features/lists/checklist/server/index.js +5 -2
- package/dist/features/lists/checklist/server/index.js.map +1 -1
- package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/orderedList/server/index.js +5 -2
- package/dist/features/lists/orderedList/server/index.js.map +1 -1
- package/dist/features/lists/shared/constants.d.ts +2 -0
- package/dist/features/lists/shared/constants.d.ts.map +1 -0
- package/dist/features/lists/shared/constants.js +2 -0
- package/dist/features/lists/shared/constants.js.map +1 -0
- package/dist/features/lists/shared/validate.d.ts +5 -0
- package/dist/features/lists/shared/validate.d.ts.map +1 -0
- package/dist/features/lists/shared/validate.js +15 -0
- package/dist/features/lists/shared/validate.js.map +1 -0
- package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/unorderedList/server/index.js +5 -2
- package/dist/features/lists/unorderedList/server/index.js.map +1 -1
- package/dist/features/relationship/client/index.d.ts +2 -2
- package/dist/features/relationship/client/index.d.ts.map +1 -1
- package/dist/features/relationship/client/index.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.d.ts +2 -2
- package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +27 -31
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
- package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
- package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/relationship/server/index.d.ts +8 -1
- package/dist/features/relationship/server/index.d.ts.map +1 -1
- package/dist/features/relationship/server/index.js +28 -11
- package/dist/features/relationship/server/index.js.map +1 -1
- package/dist/features/relationship/server/schema.d.ts +2 -2
- package/dist/features/relationship/server/schema.d.ts.map +1 -1
- package/dist/features/relationship/server/schema.js +5 -10
- package/dist/features/relationship/server/schema.js.map +1 -1
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
- package/dist/features/table/client/index.d.ts.map +1 -0
- package/dist/features/table/client/index.js.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
- package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +41 -18
- package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
- package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
- package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
- package/dist/features/table/client/utils/debounce.js.map +1 -0
- package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
- package/dist/features/table/client/utils/useDebounce.js.map +1 -0
- package/dist/features/table/markdownTransformer.d.ts.map +1 -0
- package/dist/features/table/markdownTransformer.js.map +1 -0
- package/dist/features/table/server/index.d.ts +3 -0
- package/dist/features/table/server/index.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/server/index.js +4 -4
- package/dist/features/table/server/index.js.map +1 -0
- package/dist/features/table/server/schema.d.ts.map +1 -0
- package/dist/features/table/server/schema.js.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.css +78 -6
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +4 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.css +0 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -13
- package/dist/features/typesServer.d.ts +1 -1
- package/dist/features/typesServer.d.ts.map +1 -1
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/component/index.js +2 -1
- package/dist/features/upload/client/component/index.js.map +1 -1
- package/dist/features/upload/client/index.d.ts +3 -2
- package/dist/features/upload/client/index.d.ts.map +1 -1
- package/dist/features/upload/client/index.js.map +1 -1
- package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
- package/dist/features/upload/client/plugin/index.js +47 -52
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/upload/server/index.d.ts +6 -2
- package/dist/features/upload/server/index.d.ts.map +1 -1
- package/dist/features/upload/server/index.js +20 -16
- package/dist/features/upload/server/index.js.map +1 -1
- package/dist/features/upload/server/schema.d.ts +2 -2
- package/dist/features/upload/server/schema.d.ts.map +1 -1
- package/dist/features/upload/server/schema.js +4 -8
- package/dist/features/upload/server/schema.js.map +1 -1
- package/dist/features/upload/server/validate.d.ts +2 -2
- package/dist/features/upload/server/validate.d.ts.map +1 -1
- package/dist/features/upload/server/validate.js +3 -0
- package/dist/features/upload/server/validate.js.map +1 -1
- package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/listitem/index.js +2 -1
- package/dist/field/Diff/converters/listitem/index.js.map +1 -1
- package/dist/field/Diff/index.d.ts +3 -2
- package/dist/field/Diff/index.d.ts.map +1 -1
- package/dist/field/Diff/index.js +1 -0
- package/dist/field/Diff/index.js.map +1 -1
- package/dist/field/RenderLexical/index.d.ts +3 -1
- package/dist/field/RenderLexical/index.d.ts.map +1 -1
- package/dist/field/RenderLexical/index.js +23 -23
- package/dist/field/RenderLexical/index.js.map +1 -1
- package/dist/field/ViewSelector.d.ts.map +1 -1
- package/dist/field/ViewSelector.js +1 -0
- package/dist/field/ViewSelector.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.css +10 -10
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +68 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.css +29 -20
- package/dist/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/lexical/LexicalEditor.js +61 -64
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/config/server/loader.d.ts +1 -1
- package/dist/lexical/config/server/loader.d.ts.map +1 -1
- package/dist/lexical/config/server/loader.js +2 -2
- 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 +2 -2
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -21
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.css +0 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +1 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
- package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
- package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
- package/dist/lexical/ui/ContentEditable.css +16 -15
- package/dist/lexical/ui/ContentEditable.d.ts +2 -1
- package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +9 -6
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H3/index.js +13 -6
- package/dist/lexical/ui/icons/H3/index.js.map +1 -1
- package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H4/index.js +13 -6
- package/dist/lexical/ui/icons/H4/index.js.map +1 -1
- package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H5/index.js +13 -6
- package/dist/lexical/ui/icons/H5/index.js.map +1 -1
- package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H6/index.js +13 -6
- package/dist/lexical/ui/icons/H6/index.js.map +1 -1
- package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
- package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
- package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
- package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
- package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
- package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/nodeTypes.d.ts +1 -1
- package/dist/types/nodeTypes.d.ts.map +1 -1
- package/dist/types/nodeTypes.js.map +1 -1
- package/dist/utilities/createServerFeature.d.ts +1 -1
- package/dist/utilities/createServerFeature.d.ts.map +1 -1
- package/dist/utilities/createServerFeature.js +2 -2
- package/dist/utilities/createServerFeature.js.map +1 -1
- package/dist/utilities/editorConfigFactory.d.ts +6 -6
- package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
- package/dist/utilities/editorConfigFactory.js +9 -9
- package/dist/utilities/editorConfigFactory.js.map +1 -1
- package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
- package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
- package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
- package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/index.js +6 -3
- package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
- package/package.json +97 -23
- package/dist/dependencyChecker.spec.js +0 -16
- package/dist/dependencyChecker.spec.js.map +0 -1
- package/dist/exports/client/Field-QGSHF22S.js +0 -2
- package/dist/exports/client/Field-QGSHF22S.js.map +0 -7
- package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
- package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
- package/dist/exports/client/chunk-X3D4LZS7.js +0 -2
- package/dist/exports/client/component-PHZQBOJE.js +0 -2
- package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
- package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
- package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
- package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
- package/dist/features/experimental_table/client/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
- package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
- package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
- package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
- package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
- package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
- package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
- package/dist/features/experimental_table/server/index.d.ts +0 -3
- package/dist/features/experimental_table/server/index.d.ts.map +0 -1
- package/dist/features/experimental_table/server/index.js.map +0 -1
- package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
- package/dist/features/experimental_table/server/schema.js.map +0 -1
- package/dist/features/link/markdownTransformer.spec.js +0 -195
- package/dist/features/link/markdownTransformer.spec.js.map +0 -1
- package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
- package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
- package/dist/lexical/utils/url.spec.js +0 -114
- package/dist/lexical/utils/url.spec.js.map +0 -1
- package/dist/utilities/jsx/jsx.spec.js +0 -178
- package/dist/utilities/jsx/jsx.spec.js.map +0 -1
- /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-55HZXGUS.js.map} +0 -0
- /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
- /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
- /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useLexicalComposerContext","eventFiles","$getNearestNodeFromDOMNode","$getNodeByKey","isHTMLElement","React","useEffect","useRef","useState","createPortal","useEditorConfigContext","Point","calculateDistanceFromScrollerElem","getNodeCloseToPoint","getTopLevelNodeKeys","isOnHandleElement","setHandlePosition","getBoundingClientRectWithoutTransform","setTargetLine","DRAGGABLE_BLOCK_MENU_CLASSNAME","DRAG_DATA_FORMAT","prevIndex","Infinity","getCurrentIndex","keysLength","Math","floor","setDragImage","dataTransfer","draggableBlockElem","transform","style","setTimeout","hideTargetLine","targetLineElem","lastTargetBlockElem","opacity","marginBottom","marginTop","useDraggableBlockMenu","editor","anchorElem","isEditable","scrollerElem","parentElement","menuRef","targetLineRef","debugHighlightRef","isDraggingBlockRef","highlightTimersRef","setDraggableBlockElem","lastTargetBlock","setLastTargetBlock","editorConfig","blockHandleHorizontalOffset","admin","hideGutter","onDocumentMouseMove","event","target","distanceFromScrollerElem","pageX","pageY","topLevelNodeKeys","blockElem","_draggableBlockElem","foundAtIndex","isFoundNodeEmptyParagraph","cache_threshold","horizontalOffset","point","x","y","startIndex","length","useEdgeAsDefault","verbose","document","addEventListener","removeEventListener","current","onDragover","isFileTransfer","targetBlockElem","fuzzy","preventDefault","dropEffect","isBelow","willStayInSamePosition","getBoundingClientRect","width","boundingBox","elem","onDrop","dragData","getData","update","draggedNode","targetNode","height","targetBlockElemHeight","top","targetBlockElemTop","mouseY","window","scrollY","insertAfter","insertBefore","remove","allPrevHighlighters","querySelectorAll","forEach","highlighter","newInsertedElem","getElementByKey","getKey","highlightTimer","newInsertedElemRect","highlightElem","createElement","className","backgroundColor","transition","zIndex","pointerEvents","boxSizing","borderRadius","position","body","appendChild","left","fadeTimer","removeTimer","push","clearTimeout","onDragStart","effectAllowed","nodeKey","node","setData","onDragEnd","_jsxs","Fragment","_jsx","draggable","ref","type","DraggableBlockPlugin","t0","t1","undefined","_editable"],"sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\nimport type { DragEvent as ReactDragEvent } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { eventFiles } from '@lexical/rich-text'\nimport { $getNearestNodeFromDOMNode, $getNodeByKey, isHTMLElement } from 'lexical'\nimport * as React from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../config/client/EditorConfigProvider.js'\nimport { Point } from '../../../utils/point.js'\nimport { calculateDistanceFromScrollerElem } from '../utils/calculateDistanceFromScrollerElem.js'\nimport { getNodeCloseToPoint } from '../utils/getNodeCloseToPoint.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\nimport { isOnHandleElement } from '../utils/isOnHandleElement.js'\nimport { setHandlePosition } from '../utils/setHandlePosition.js'\nimport { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js'\nimport './index.css'\nimport { setTargetLine } from './setTargetLine.js'\n\nconst DRAGGABLE_BLOCK_MENU_CLASSNAME = 'draggable-block-menu'\nconst DRAG_DATA_FORMAT = 'application/x-lexical-drag-block'\n\nlet prevIndex = Infinity\n\nfunction getCurrentIndex(keysLength: number): number {\n if (keysLength === 0) {\n return Infinity\n }\n if (prevIndex >= 0 && prevIndex < keysLength) {\n return prevIndex\n }\n\n return Math.floor(keysLength / 2)\n}\n\nfunction setDragImage(dataTransfer: DataTransfer, draggableBlockElem: HTMLElement) {\n const { transform } = draggableBlockElem.style\n\n // Remove dragImage borders\n dataTransfer.setDragImage(draggableBlockElem, 0, 0)\n\n setTimeout(() => {\n draggableBlockElem.style.transform = transform\n })\n}\n\nfunction hideTargetLine(\n targetLineElem: HTMLElement | null,\n lastTargetBlockElem: HTMLElement | null,\n) {\n if (targetLineElem) {\n targetLineElem.style.opacity = '0'\n }\n if (lastTargetBlockElem) {\n lastTargetBlockElem.style.opacity = ''\n // Delete marginBottom and marginTop values we set\n lastTargetBlockElem.style.marginBottom = ''\n lastTargetBlockElem.style.marginTop = ''\n //lastTargetBlock.style.border = 'none'\n }\n}\n\nfunction useDraggableBlockMenu(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n isEditable: boolean,\n): React.ReactElement {\n const scrollerElem = anchorElem.parentElement\n\n const menuRef = useRef<HTMLButtonElement>(null)\n const targetLineRef = useRef<HTMLDivElement>(null)\n const debugHighlightRef = useRef<HTMLDivElement>(null)\n const isDraggingBlockRef = useRef<boolean>(false)\n const highlightTimersRef = useRef<ReturnType<typeof setTimeout>[]>([])\n const [draggableBlockElem, setDraggableBlockElem] = useState<HTMLElement | null>(null)\n const [lastTargetBlock, setLastTargetBlock] = useState<{\n boundingBox?: DOMRect\n elem: HTMLElement | null\n isBelow: boolean\n } | null>(null)\n\n const { editorConfig } = useEditorConfigContext()\n\n const blockHandleHorizontalOffset = editorConfig?.admin?.hideGutter ? -44 : -8\n\n useEffect(() => {\n /**\n * Handles positioning of the drag handle\n */\n function onDocumentMouseMove(event: MouseEvent) {\n const target = event.target\n if (!isHTMLElement(target)) {\n return\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n )\n if (distanceFromScrollerElem === -1) {\n setDraggableBlockElem(null)\n return\n }\n\n if (isOnHandleElement(target, DRAGGABLE_BLOCK_MENU_CLASSNAME)) {\n return\n }\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: _draggableBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n cache_threshold: 0,\n editor,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: false,\n verbose: false,\n })\n\n prevIndex = foundAtIndex\n\n //if (DEBUG && _draggableBlockElem) {\n //targetBlockElem.style.border = '3px solid red'\n // highlightElemOriginalPosition(debugHighlightRef, _draggableBlockElem, anchorElem)\n //}\n\n if (!_draggableBlockElem && !isFoundNodeEmptyParagraph) {\n return\n }\n\n if (draggableBlockElem !== _draggableBlockElem) {\n setDraggableBlockElem(_draggableBlockElem)\n }\n }\n\n // Since the draggableBlockElem is outside the actual editor, we need to listen to the document\n // to be able to detect when the mouse is outside the editor and respect a buffer around\n // the scrollerElem to avoid the draggableBlockElem disappearing too early.\n document?.addEventListener('mousemove', onDocumentMouseMove)\n\n return () => {\n document?.removeEventListener('mousemove', onDocumentMouseMove)\n }\n }, [scrollerElem, anchorElem, editor, draggableBlockElem])\n\n useEffect(() => {\n if (menuRef.current) {\n setHandlePosition(\n draggableBlockElem,\n menuRef.current,\n anchorElem,\n blockHandleHorizontalOffset,\n )\n }\n }, [anchorElem, draggableBlockElem, blockHandleHorizontalOffset])\n\n useEffect(() => {\n function onDragover(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n\n const { pageY, target } = event\n if (!isHTMLElement(target)) {\n return false\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: targetBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: true,\n verbose: true,\n })\n\n prevIndex = foundAtIndex\n\n const targetLineElem = targetLineRef.current\n // targetBlockElem === null shouldn't happen\n if (targetBlockElem === null || targetLineElem === null) {\n return false\n }\n\n // Always prevent default and set dropEffect during drag to maintain the move cursor\n event.preventDefault()\n event.dataTransfer!.dropEffect = 'move'\n\n if (draggableBlockElem !== targetBlockElem) {\n const { isBelow, willStayInSamePosition } = setTargetLine(\n editorConfig?.admin?.hideGutter ? '0px' : 'var(--spacer-5)',\n blockHandleHorizontalOffset +\n (editorConfig?.admin?.hideGutter\n ? (menuRef?.current?.getBoundingClientRect()?.width ?? 0)\n : -(menuRef?.current?.getBoundingClientRect()?.width ?? 0)),\n targetLineElem,\n targetBlockElem,\n lastTargetBlock!,\n pageY,\n anchorElem,\n event,\n debugHighlightRef,\n isFoundNodeEmptyParagraph,\n )\n\n if (!willStayInSamePosition) {\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow,\n })\n }\n } else if (lastTargetBlock?.elem) {\n hideTargetLine(targetLineElem, lastTargetBlock.elem)\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow: false,\n })\n }\n\n return true\n }\n\n function onDrop(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n const { dataTransfer, pageY, target } = event\n const dragData = dataTransfer?.getData(DRAG_DATA_FORMAT) || ''\n\n editor.update(() => {\n const draggedNode = $getNodeByKey(dragData)\n if (!draggedNode) {\n return false\n }\n if (!isHTMLElement(target)) {\n return false\n }\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const { blockElem: targetBlockElem, isFoundNodeEmptyParagraph } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n useEdgeAsDefault: true,\n })\n\n if (!targetBlockElem) {\n return false\n }\n const targetNode = $getNearestNodeFromDOMNode(targetBlockElem)\n if (!targetNode) {\n return false\n }\n if (targetNode === draggedNode) {\n return true\n }\n\n const { height: targetBlockElemHeight, top: targetBlockElemTop } =\n getBoundingClientRectWithoutTransform(targetBlockElem)\n\n const mouseY = pageY\n const isBelow = mouseY >= targetBlockElemTop + targetBlockElemHeight / 2 + window.scrollY\n\n if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n // below targetBlockElem\n targetNode.insertAfter(draggedNode)\n } else {\n // above targetBlockElem\n targetNode.insertBefore(draggedNode)\n }\n } else {\n //\n targetNode.insertBefore(draggedNode)\n targetNode.remove()\n }\n\n /*\n if (pageY >= targetBlockElemTop + targetBlockElemHeight / 2) {\n targetNode.insertAfter(draggedNode)\n } else {\n targetNode.insertBefore(draggedNode)\n }*/\n if (draggableBlockElem !== null) {\n setDraggableBlockElem(null)\n }\n\n // find all previous elements with lexical-block-highlighter class and remove them\n const allPrevHighlighters = document.querySelectorAll('.lexical-block-highlighter')\n allPrevHighlighters.forEach((highlighter) => {\n highlighter.remove()\n })\n\n const newInsertedElem = editor.getElementByKey(draggedNode.getKey())\n const highlightTimer = setTimeout(() => {\n // add new temp html element to newInsertedElem with the same height and width and the class block-selected\n // to highlight the new inserted element\n const newInsertedElemRect = newInsertedElem?.getBoundingClientRect()\n if (!newInsertedElemRect) {\n return\n }\n const highlightElem = document.createElement('div')\n highlightElem.className = 'lexical-block-highlighter'\n\n highlightElem.style.backgroundColor = 'var(--color-bg-inverse)'\n highlightElem.style.transition = 'opacity 0.5s ease-in-out'\n highlightElem.style.zIndex = '1'\n highlightElem.style.pointerEvents = 'none'\n highlightElem.style.boxSizing = 'border-box'\n highlightElem.style.borderRadius = '4px'\n highlightElem.style.position = 'absolute'\n document.body.appendChild(highlightElem)\n\n highlightElem.style.opacity = '0.1'\n\n highlightElem.style.height = `${newInsertedElemRect.height + 8}px`\n highlightElem.style.width = `${newInsertedElemRect.width + 8}px`\n highlightElem.style.top = `${newInsertedElemRect.top + window.scrollY - 4}px`\n highlightElem.style.left = `${newInsertedElemRect.left - 4}px`\n\n const fadeTimer = setTimeout(() => {\n highlightElem.style.opacity = '0'\n const removeTimer = setTimeout(() => {\n highlightElem.remove()\n }, 500)\n highlightTimersRef.current.push(removeTimer)\n }, 1000)\n highlightTimersRef.current.push(fadeTimer)\n }, 120)\n highlightTimersRef.current.push(highlightTimer)\n })\n\n return true\n }\n\n // register onDragover event listeners:\n document.addEventListener('dragover', onDragover)\n // register onDrop event listeners:\n document.addEventListener('drop', onDrop)\n\n return () => {\n document.removeEventListener('dragover', onDragover)\n document.removeEventListener('drop', onDrop)\n highlightTimersRef.current.forEach(clearTimeout)\n highlightTimersRef.current = []\n }\n }, [\n scrollerElem,\n blockHandleHorizontalOffset,\n anchorElem,\n editor,\n lastTargetBlock,\n draggableBlockElem,\n editorConfig?.admin?.hideGutter,\n ])\n\n function onDragStart(event: ReactDragEvent<HTMLButtonElement>): void {\n const dataTransfer = event.dataTransfer\n if (!dataTransfer || !draggableBlockElem) {\n return\n }\n setDragImage(dataTransfer, draggableBlockElem)\n dataTransfer.effectAllowed = 'move'\n let nodeKey = ''\n editor.update(() => {\n const node = $getNearestNodeFromDOMNode(draggableBlockElem)\n if (node) {\n nodeKey = node.getKey()\n }\n })\n isDraggingBlockRef.current = true\n dataTransfer.setData(DRAG_DATA_FORMAT, nodeKey)\n }\n\n function onDragEnd(): void {\n isDraggingBlockRef.current = false\n if (lastTargetBlock?.elem) {\n hideTargetLine(targetLineRef.current, lastTargetBlock?.elem)\n }\n }\n\n return createPortal(\n <React.Fragment>\n <button\n aria-label=\"Drag to move\"\n className=\"icon draggable-block-menu\"\n draggable\n onDragEnd={onDragEnd}\n onDragStart={onDragStart}\n ref={menuRef}\n type=\"button\"\n >\n <div className={isEditable ? 'icon' : ''} />\n </button>\n <div className=\"draggable-block-target-line\" ref={targetLineRef} />\n <div className=\"debug-highlight\" ref={debugHighlightRef} />\n </React.Fragment>,\n anchorElem,\n )\n}\n\nexport function DraggableBlockPlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactElement {\n const [editor] = useLexicalComposerContext()\n return useDraggableBlockMenu(editor, anchorElem, editor._editable)\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SAASC,0BAA0B,EAAEC,aAAa,EAAEC,aAAa,QAAQ;AACzE,YAAYC,KAAA,MAAW;AACvB,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAC5C,SAASC,YAAY,QAAQ;AAE7B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,KAAK,QAAQ;AACtB,SAASC,iCAAiC,QAAQ;AAClD,SAASC,mBAAmB,QAAQ;AACpC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,qCAAqC,QAAQ;AACtD,OAAO;AACP,SAASC,aAAa,QAAQ;AAE9B,MAAMC,8BAAA,GAAiC;AACvC,MAAMC,gBAAA,GAAmB;AAEzB,IAAIC,SAAA,GAAYC,QAA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,GAAA,EAAKlG;;MAExCN,UAAA;AAEJ;AAEA,OAAO,SAAA0G,qBAAAC,EAAA;EAA8B;IAAA3G,UAAA,EAAA4G;EAAA,IAAAD,EAIpC;EAHC,MAAA3G,UAAA,GAAA4G,EAA0B,KAAAC,SAAA,GAAAzE,QAAA,CAAAmD,IAAA,GAA1BqB,EAA0B;EAI1B,OAAA7G,MAAA,IAAiBxC,yBAAA;EAAA,OACVuC,qBAAA,CAAsBC,MAAA,EAAQC,UAAA,EAAYD,MAAA,CAAA+G,SAAgB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["useLexicalComposerContext","eventFiles","useTranslation","$getNearestNodeFromDOMNode","$getNodeByKey","isHTMLElement","React","useEffect","useId","useRef","useState","createPortal","useEditorConfigContext","Point","calculateDistanceFromScrollerElem","getNodeCloseToPoint","getTopLevelNodeKeys","isOnHandleElement","setHandlePosition","getBoundingClientRectWithoutTransform","setTargetLine","useKeyboardReordering","DRAGGABLE_BLOCK_MENU_CLASSNAME","DRAG_DATA_FORMAT","prevIndex","Infinity","getCurrentIndex","keysLength","Math","floor","setDragImage","dataTransfer","draggableBlockElem","transform","style","setTimeout","hideTargetLine","targetLineElem","lastTargetBlockElem","opacity","marginBottom","marginTop","useDraggableBlockMenu","editor","anchorElem","isEditable","scrollerElem","parentElement","instructionsID","t","menuRef","targetLineRef","debugHighlightRef","isDraggingBlockRef","highlightTimersRef","setDraggableBlockElem","lastTargetBlock","setLastTargetBlock","editorConfig","blockHandleHorizontalOffset","admin","hideGutter","onDocumentMouseMove","event","target","distanceFromScrollerElem","pageX","pageY","topLevelNodeKeys","blockElem","_draggableBlockElem","foundAtIndex","isFoundNodeEmptyParagraph","cache_threshold","horizontalOffset","point","x","y","startIndex","length","useEdgeAsDefault","verbose","document","addEventListener","removeEventListener","current","onDragover","isFileTransfer","targetBlockElem","fuzzy","preventDefault","dropEffect","isBelow","willStayInSamePosition","getBoundingClientRect","width","boundingBox","elem","onDrop","dragData","getData","update","draggedNode","targetNode","height","targetBlockElemHeight","top","targetBlockElemTop","mouseY","window","scrollY","insertAfter","insertBefore","remove","allPrevHighlighters","querySelectorAll","forEach","highlighter","newInsertedElem","getElementByKey","getKey","highlightTimer","newInsertedElemRect","highlightElem","createElement","className","backgroundColor","transition","zIndex","pointerEvents","boxSizing","borderRadius","position","body","appendChild","left","fadeTimer","removeTimer","push","clearTimeout","onDragStart","effectAllowed","nodeKey","node","setData","onDragEnd","_jsxs","Fragment","id","_jsx","draggable","ref","type","DraggableBlockPlugin","t0","t1","undefined","_editable"],"sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\nimport type { DragEvent as ReactDragEvent } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { eventFiles } from '@lexical/rich-text'\nimport { useTranslation } from '@payloadcms/ui'\nimport { $getNearestNodeFromDOMNode, $getNodeByKey, isHTMLElement } from 'lexical'\nimport * as React from 'react'\nimport { useEffect, useId, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../config/client/EditorConfigProvider.js'\nimport { Point } from '../../../utils/point.js'\nimport { calculateDistanceFromScrollerElem } from '../utils/calculateDistanceFromScrollerElem.js'\nimport { getNodeCloseToPoint } from '../utils/getNodeCloseToPoint.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\nimport { isOnHandleElement } from '../utils/isOnHandleElement.js'\nimport { setHandlePosition } from '../utils/setHandlePosition.js'\nimport { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js'\nimport './index.css'\nimport { setTargetLine } from './setTargetLine.js'\nimport { useKeyboardReordering } from './useKeyboardReordering.js'\n\nconst DRAGGABLE_BLOCK_MENU_CLASSNAME = 'draggable-block-menu'\nconst DRAG_DATA_FORMAT = 'application/x-lexical-drag-block'\n\nlet prevIndex = Infinity\n\nfunction getCurrentIndex(keysLength: number): number {\n if (keysLength === 0) {\n return Infinity\n }\n if (prevIndex >= 0 && prevIndex < keysLength) {\n return prevIndex\n }\n\n return Math.floor(keysLength / 2)\n}\n\nfunction setDragImage(dataTransfer: DataTransfer, draggableBlockElem: HTMLElement) {\n const { transform } = draggableBlockElem.style\n\n // Remove dragImage borders\n dataTransfer.setDragImage(draggableBlockElem, 0, 0)\n\n setTimeout(() => {\n draggableBlockElem.style.transform = transform\n })\n}\n\nfunction hideTargetLine(\n targetLineElem: HTMLElement | null,\n lastTargetBlockElem: HTMLElement | null,\n) {\n if (targetLineElem) {\n targetLineElem.style.opacity = '0'\n }\n if (lastTargetBlockElem) {\n lastTargetBlockElem.style.opacity = ''\n // Delete marginBottom and marginTop values we set\n lastTargetBlockElem.style.marginBottom = ''\n lastTargetBlockElem.style.marginTop = ''\n //lastTargetBlock.style.border = 'none'\n }\n}\n\nfunction useDraggableBlockMenu(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n isEditable: boolean,\n): React.ReactElement {\n const scrollerElem = anchorElem.parentElement\n const instructionsID = useId()\n const { t } = useTranslation()\n\n useKeyboardReordering({ editor, instructionsID })\n\n const menuRef = useRef<HTMLButtonElement>(null)\n const targetLineRef = useRef<HTMLDivElement>(null)\n const debugHighlightRef = useRef<HTMLDivElement>(null)\n const isDraggingBlockRef = useRef<boolean>(false)\n const highlightTimersRef = useRef<ReturnType<typeof setTimeout>[]>([])\n const [draggableBlockElem, setDraggableBlockElem] = useState<HTMLElement | null>(null)\n const [lastTargetBlock, setLastTargetBlock] = useState<{\n boundingBox?: DOMRect\n elem: HTMLElement | null\n isBelow: boolean\n } | null>(null)\n\n const { editorConfig } = useEditorConfigContext()\n\n const blockHandleHorizontalOffset = editorConfig?.admin?.hideGutter ? -44 : -8\n\n useEffect(() => {\n /**\n * Handles positioning of the drag handle\n */\n function onDocumentMouseMove(event: MouseEvent) {\n const target = event.target\n if (!isHTMLElement(target)) {\n return\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n )\n if (distanceFromScrollerElem === -1) {\n setDraggableBlockElem(null)\n return\n }\n\n if (isOnHandleElement(target, DRAGGABLE_BLOCK_MENU_CLASSNAME)) {\n return\n }\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: _draggableBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n cache_threshold: 0,\n editor,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: false,\n verbose: false,\n })\n\n prevIndex = foundAtIndex\n\n //if (DEBUG && _draggableBlockElem) {\n //targetBlockElem.style.border = '3px solid red'\n // highlightElemOriginalPosition(debugHighlightRef, _draggableBlockElem, anchorElem)\n //}\n\n if (!_draggableBlockElem && !isFoundNodeEmptyParagraph) {\n return\n }\n\n if (draggableBlockElem !== _draggableBlockElem) {\n setDraggableBlockElem(_draggableBlockElem)\n }\n }\n\n // Since the draggableBlockElem is outside the actual editor, we need to listen to the document\n // to be able to detect when the mouse is outside the editor and respect a buffer around\n // the scrollerElem to avoid the draggableBlockElem disappearing too early.\n document?.addEventListener('mousemove', onDocumentMouseMove)\n\n return () => {\n document?.removeEventListener('mousemove', onDocumentMouseMove)\n }\n }, [scrollerElem, anchorElem, editor, draggableBlockElem])\n\n useEffect(() => {\n if (menuRef.current) {\n setHandlePosition(\n draggableBlockElem,\n menuRef.current,\n anchorElem,\n blockHandleHorizontalOffset,\n )\n }\n }, [anchorElem, draggableBlockElem, blockHandleHorizontalOffset])\n\n useEffect(() => {\n function onDragover(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n\n const { pageY, target } = event\n if (!isHTMLElement(target)) {\n return false\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: targetBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: true,\n verbose: true,\n })\n\n prevIndex = foundAtIndex\n\n const targetLineElem = targetLineRef.current\n // targetBlockElem === null shouldn't happen\n if (targetBlockElem === null || targetLineElem === null) {\n return false\n }\n\n // Always prevent default and set dropEffect during drag to maintain the move cursor\n event.preventDefault()\n event.dataTransfer!.dropEffect = 'move'\n\n if (draggableBlockElem !== targetBlockElem) {\n const { isBelow, willStayInSamePosition } = setTargetLine(\n editorConfig?.admin?.hideGutter ? '0px' : 'var(--spacer-5)',\n blockHandleHorizontalOffset +\n (editorConfig?.admin?.hideGutter\n ? (menuRef?.current?.getBoundingClientRect()?.width ?? 0)\n : -(menuRef?.current?.getBoundingClientRect()?.width ?? 0)),\n targetLineElem,\n targetBlockElem,\n lastTargetBlock!,\n pageY,\n anchorElem,\n event,\n debugHighlightRef,\n isFoundNodeEmptyParagraph,\n )\n\n if (!willStayInSamePosition) {\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow,\n })\n }\n } else if (lastTargetBlock?.elem) {\n hideTargetLine(targetLineElem, lastTargetBlock.elem)\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow: false,\n })\n }\n\n return true\n }\n\n function onDrop(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n const { dataTransfer, pageY, target } = event\n const dragData = dataTransfer?.getData(DRAG_DATA_FORMAT) || ''\n\n editor.update(() => {\n const draggedNode = $getNodeByKey(dragData)\n if (!draggedNode) {\n return false\n }\n if (!isHTMLElement(target)) {\n return false\n }\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const { blockElem: targetBlockElem, isFoundNodeEmptyParagraph } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n useEdgeAsDefault: true,\n })\n\n if (!targetBlockElem) {\n return false\n }\n const targetNode = $getNearestNodeFromDOMNode(targetBlockElem)\n if (!targetNode) {\n return false\n }\n if (targetNode === draggedNode) {\n return true\n }\n\n const { height: targetBlockElemHeight, top: targetBlockElemTop } =\n getBoundingClientRectWithoutTransform(targetBlockElem)\n\n const mouseY = pageY\n const isBelow = mouseY >= targetBlockElemTop + targetBlockElemHeight / 2 + window.scrollY\n\n if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n // below targetBlockElem\n targetNode.insertAfter(draggedNode)\n } else {\n // above targetBlockElem\n targetNode.insertBefore(draggedNode)\n }\n } else {\n //\n targetNode.insertBefore(draggedNode)\n targetNode.remove()\n }\n\n /*\n if (pageY >= targetBlockElemTop + targetBlockElemHeight / 2) {\n targetNode.insertAfter(draggedNode)\n } else {\n targetNode.insertBefore(draggedNode)\n }*/\n if (draggableBlockElem !== null) {\n setDraggableBlockElem(null)\n }\n\n // find all previous elements with lexical-block-highlighter class and remove them\n const allPrevHighlighters = document.querySelectorAll('.lexical-block-highlighter')\n allPrevHighlighters.forEach((highlighter) => {\n highlighter.remove()\n })\n\n const newInsertedElem = editor.getElementByKey(draggedNode.getKey())\n const highlightTimer = setTimeout(() => {\n // add new temp html element to newInsertedElem with the same height and width and the class block-selected\n // to highlight the new inserted element\n const newInsertedElemRect = newInsertedElem?.getBoundingClientRect()\n if (!newInsertedElemRect) {\n return\n }\n const highlightElem = document.createElement('div')\n highlightElem.className = 'lexical-block-highlighter'\n\n highlightElem.style.backgroundColor = 'var(--color-bg-inverse)'\n highlightElem.style.transition = 'opacity 0.5s ease-in-out'\n highlightElem.style.zIndex = '1'\n highlightElem.style.pointerEvents = 'none'\n highlightElem.style.boxSizing = 'border-box'\n highlightElem.style.borderRadius = '4px'\n highlightElem.style.position = 'absolute'\n document.body.appendChild(highlightElem)\n\n highlightElem.style.opacity = '0.1'\n\n highlightElem.style.height = `${newInsertedElemRect.height + 8}px`\n highlightElem.style.width = `${newInsertedElemRect.width + 8}px`\n highlightElem.style.top = `${newInsertedElemRect.top + window.scrollY - 4}px`\n highlightElem.style.left = `${newInsertedElemRect.left - 4}px`\n\n const fadeTimer = setTimeout(() => {\n highlightElem.style.opacity = '0'\n const removeTimer = setTimeout(() => {\n highlightElem.remove()\n }, 500)\n highlightTimersRef.current.push(removeTimer)\n }, 1000)\n highlightTimersRef.current.push(fadeTimer)\n }, 120)\n highlightTimersRef.current.push(highlightTimer)\n })\n\n return true\n }\n\n // register onDragover event listeners:\n document.addEventListener('dragover', onDragover)\n // register onDrop event listeners:\n document.addEventListener('drop', onDrop)\n\n return () => {\n document.removeEventListener('dragover', onDragover)\n document.removeEventListener('drop', onDrop)\n highlightTimersRef.current.forEach(clearTimeout)\n highlightTimersRef.current = []\n }\n }, [\n scrollerElem,\n blockHandleHorizontalOffset,\n anchorElem,\n editor,\n lastTargetBlock,\n draggableBlockElem,\n editorConfig?.admin?.hideGutter,\n ])\n\n function onDragStart(event: ReactDragEvent<HTMLButtonElement>): void {\n const dataTransfer = event.dataTransfer\n if (!dataTransfer || !draggableBlockElem) {\n return\n }\n setDragImage(dataTransfer, draggableBlockElem)\n dataTransfer.effectAllowed = 'move'\n let nodeKey = ''\n editor.update(() => {\n const node = $getNearestNodeFromDOMNode(draggableBlockElem)\n if (node) {\n nodeKey = node.getKey()\n }\n })\n isDraggingBlockRef.current = true\n dataTransfer.setData(DRAG_DATA_FORMAT, nodeKey)\n }\n\n function onDragEnd(): void {\n isDraggingBlockRef.current = false\n if (lastTargetBlock?.elem) {\n hideTargetLine(targetLineRef.current, lastTargetBlock?.elem)\n }\n }\n\n return createPortal(\n <React.Fragment>\n <span className=\"sr-only\" id={instructionsID}>\n {t('general:moveUp')}: Alt + Shift + ↑. {t('general:moveDown')}: Alt + Shift + ↓.\n </span>\n <button\n aria-label=\"Drag to move\"\n className=\"icon draggable-block-menu\"\n draggable\n onDragEnd={onDragEnd}\n onDragStart={onDragStart}\n ref={menuRef}\n type=\"button\"\n >\n <div className={isEditable ? 'icon' : ''} />\n </button>\n <div className=\"draggable-block-target-line\" ref={targetLineRef} />\n <div className=\"debug-highlight\" ref={debugHighlightRef} />\n </React.Fragment>,\n anchorElem,\n )\n}\n\nexport function DraggableBlockPlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactElement {\n const [editor] = useLexicalComposerContext()\n return useDraggableBlockMenu(editor, anchorElem, editor._editable)\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SAASC,cAAc,QAAQ;AAC/B,SAASC,0BAA0B,EAAEC,aAAa,EAAEC,aAAa,QAAQ;AACzE,YAAYC,KAAA,MAAW;AACvB,SAASC,SAAS,EAAEC,KAAK,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AACnD,SAASC,YAAY,QAAQ;AAE7B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,KAAK,QAAQ;AACtB,SAASC,iCAAiC,QAAQ;AAClD,SAASC,mBAAmB,QAAQ;AACpC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,qCAAqC,QAAQ;AACtD,OAAO;AACP,SAASC,aAAa,QAAQ;AAC9B,SAASC,qBAAqB,QAAQ;AAEtC,MAAMC,8BAAA,GAAiC;AACvC,MAAMC,gB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AU;MACVyB,SAAS;MACTL,SAAA,EAAWA,SAAA;MACXL,WAAA,EAAaA,WAAA;MACbW,GAAA,EAAKrG,OAAA;MACLsG,IAAA,EAAK;gBAEL,aAAAH,IAAA,CAAC;QAAIxB,SAAA,EAAWhF,UAAA,GAAa,SAAS;;qBAExCwG,IAAA,CAAC;MAAIxB,SAAA,EAAU;MAA8B0B,GAAA,EAAKpG;qBAClDkG,IAAA,CAAC;MAAIxB,SAAA,EAAU;MAAkB0B,GAAA,EAAKnG;;MAExCR,UAAA;AAEJ;AAEA,OAAO,SAAA6G,qBAAAC,EAAA;EAA8B;IAAA9G,UAAA,EAAA+G;EAAA,IAAAD,EAIpC;EAHC,MAAA9G,UAAA,GAAA+G,EAA0B,KAAAC,SAAA,GAAA1E,QAAA,CAAAmD,IAAA,GAA1BsB,EAA0B;EAI1B,OAAAhH,MAAA,IAAiB3C,yBAAA;EAAA,OACV0C,qBAAA,CAAsBC,MAAA,EAAQC,UAAA,EAAYD,MAAA,CAAAkH,SAAgB;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LexicalEditor } from 'lexical';
|
|
2
|
+
/** Move the current top-level line, including decorator nodes, without a pointer. */
|
|
3
|
+
export declare function useKeyboardReordering({ editor, instructionsID, }: {
|
|
4
|
+
editor: LexicalEditor;
|
|
5
|
+
instructionsID: string;
|
|
6
|
+
}): void;
|
|
7
|
+
//# sourceMappingURL=useKeyboardReordering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboardReordering.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAa5C,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,cAAc,GACf,EAAE;IACD,MAAM,EAAE,aAAa,CAAA;IACrB,cAAc,EAAE,MAAM,CAAA;CACvB,QA0EA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { mergeRegister } from '@lexical/utils';
|
|
2
|
+
import { $getSelection, $isNodeSelection, $isRangeSelection, COMMAND_PRIORITY_HIGH, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND } from 'lexical';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
/** Move the current top-level line, including decorator nodes, without a pointer. */
|
|
5
|
+
export function useKeyboardReordering({
|
|
6
|
+
editor,
|
|
7
|
+
instructionsID
|
|
8
|
+
}) {
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const moveLine = ({
|
|
11
|
+
direction,
|
|
12
|
+
event
|
|
13
|
+
}) => {
|
|
14
|
+
if (!editor.isEditable() || !event.altKey || !event.shiftKey || event.ctrlKey || event.metaKey) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
const selection = $getSelection();
|
|
18
|
+
const selectedNode = $isRangeSelection(selection) && selection.isCollapsed() ? selection.anchor.getNode() : $isNodeSelection(selection) && selection.getNodes().length === 1 ? selection.getNodes()[0] : null;
|
|
19
|
+
const node = selectedNode?.getTopLevelElement();
|
|
20
|
+
if (!node) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
const sibling = direction === -1 ? node.getPreviousSibling() : node.getNextSibling();
|
|
25
|
+
if (sibling) {
|
|
26
|
+
if (direction === -1) {
|
|
27
|
+
sibling.insertBefore(node);
|
|
28
|
+
} else {
|
|
29
|
+
sibling.insertAfter(node);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
};
|
|
34
|
+
return mergeRegister(editor.registerCommand(KEY_ARROW_UP_COMMAND, event => moveLine({
|
|
35
|
+
direction: -1,
|
|
36
|
+
event
|
|
37
|
+
}), COMMAND_PRIORITY_HIGH), editor.registerCommand(KEY_ARROW_DOWN_COMMAND, event => moveLine({
|
|
38
|
+
direction: 1,
|
|
39
|
+
event
|
|
40
|
+
}), COMMAND_PRIORITY_HIGH));
|
|
41
|
+
}, [editor]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
let restore;
|
|
44
|
+
const unregister = editor.registerRootListener(root => {
|
|
45
|
+
restore?.();
|
|
46
|
+
if (!root) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const description = root.getAttribute('aria-describedby');
|
|
50
|
+
root.setAttribute('aria-describedby', [description, instructionsID].filter(Boolean).join(' '));
|
|
51
|
+
restore = () => {
|
|
52
|
+
if (description === null) {
|
|
53
|
+
root.removeAttribute('aria-describedby');
|
|
54
|
+
} else {
|
|
55
|
+
root.setAttribute('aria-describedby', description);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
return () => {
|
|
60
|
+
unregister();
|
|
61
|
+
restore?.();
|
|
62
|
+
};
|
|
63
|
+
}, [editor, instructionsID]);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=useKeyboardReordering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboardReordering.js","names":["mergeRegister","$getSelection","$isNodeSelection","$isRangeSelection","COMMAND_PRIORITY_HIGH","KEY_ARROW_DOWN_COMMAND","KEY_ARROW_UP_COMMAND","useEffect","useKeyboardReordering","editor","instructionsID","moveLine","direction","event","isEditable","altKey","shiftKey","ctrlKey","metaKey","selection","selectedNode","isCollapsed","anchor","getNode","getNodes","length","node","getTopLevelElement","preventDefault","sibling","getPreviousSibling","getNextSibling","insertBefore","insertAfter","registerCommand","restore","unregister","registerRootListener","root","description","getAttribute","setAttribute","filter","Boolean","join","removeAttribute"],"sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.ts"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\n\nimport { mergeRegister } from '@lexical/utils'\nimport {\n $getSelection,\n $isNodeSelection,\n $isRangeSelection,\n COMMAND_PRIORITY_HIGH,\n KEY_ARROW_DOWN_COMMAND,\n KEY_ARROW_UP_COMMAND,\n} from 'lexical'\nimport { useEffect } from 'react'\n\n/** Move the current top-level line, including decorator nodes, without a pointer. */\nexport function useKeyboardReordering({\n editor,\n instructionsID,\n}: {\n editor: LexicalEditor\n instructionsID: string\n}) {\n useEffect(() => {\n const moveLine = ({ direction, event }: { direction: -1 | 1; event: KeyboardEvent }) => {\n if (\n !editor.isEditable() ||\n !event.altKey ||\n !event.shiftKey ||\n event.ctrlKey ||\n event.metaKey\n ) {\n return false\n }\n const selection = $getSelection()\n const selectedNode =\n $isRangeSelection(selection) && selection.isCollapsed()\n ? selection.anchor.getNode()\n : $isNodeSelection(selection) && selection.getNodes().length === 1\n ? selection.getNodes()[0]\n : null\n const node = selectedNode?.getTopLevelElement()\n\n if (!node) {\n return false\n }\n event.preventDefault()\n const sibling = direction === -1 ? node.getPreviousSibling() : node.getNextSibling()\n\n if (sibling) {\n if (direction === -1) {\n sibling.insertBefore(node)\n } else {\n sibling.insertAfter(node)\n }\n }\n return true\n }\n\n return mergeRegister(\n editor.registerCommand(\n KEY_ARROW_UP_COMMAND,\n (event) => moveLine({ direction: -1, event }),\n COMMAND_PRIORITY_HIGH,\n ),\n editor.registerCommand(\n KEY_ARROW_DOWN_COMMAND,\n (event) => moveLine({ direction: 1, event }),\n COMMAND_PRIORITY_HIGH,\n ),\n )\n }, [editor])\n\n useEffect(() => {\n let restore: (() => void) | undefined\n const unregister = editor.registerRootListener((root) => {\n restore?.()\n if (!root) {\n return\n }\n const description = root.getAttribute('aria-describedby')\n root.setAttribute('aria-describedby', [description, instructionsID].filter(Boolean).join(' '))\n restore = () => {\n if (description === null) {\n root.removeAttribute('aria-describedby')\n } else {\n root.setAttribute('aria-describedby', description)\n }\n }\n })\n\n return () => {\n unregister()\n restore?.()\n }\n }, [editor, instructionsID])\n}\n"],"mappings":"AAEA,SAASA,aAAa,QAAQ;AAC9B,SACEC,aAAa,EACbC,gBAAgB,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GAEFK,MAAA,CAAOyB,eAAe,CACpB7B,sBAAA,EACCQ,KAAA,IAAUF,QAAA,CAAS;MAAEC,SAAA,EAAW;MAAGC;IAAM,IAC1CT,qBAAA;EAGN,GAAG,CAACK,MAAA,CAAO;EAEXF,SAAA,CAAU;IACR,IAAI4B,OAAA;IACJ,MAAMC,UAAA,GAAa3B,MAAA,CAAO4B,oBAAoB,CAAEC,IAAA;MAC9CH,OAAA;MACA,IAAI,CAACG,IAAA,EAAM;QACT;MACF;MACA,MAAMC,WAAA,GAAcD,IAAA,CAAKE,YAAY,CAAC;MACtCF,IAAA,CAAKG,YAAY,CAAC,oBAAoB,CAACF,WAAA,EAAa7B,cAAA,CAAe,CAACgC,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;MACzFT,OAAA,GAAUA,CAAA;QACR,IAAII,WAAA,KAAgB,MAAM;UACxBD,IAAA,CAAKO,eAAe,CAAC;QACvB,OAAO;UACLP,IAAA,CAAKG,YAAY,CAAC,oBAAoBF,WAAA;QACxC;MACF;IACF;IAEA,OAAO;MACLH,UAAA;MACAD,OAAA;IACF;EACF,GAAG,CAAC1B,MAAA,EAAQC,cAAA,CAAe;AAC7B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setHandlePosition.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/utils/setHandlePosition.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,WAAW,GAAG,IAAI,EAC9B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,WAAW,EACvB,UAAU,GAAE,MAAU,
|
|
1
|
+
{"version":3,"file":"setHandlePosition.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/utils/setHandlePosition.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,WAAW,GAAG,IAAI,EAC9B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,WAAW,EACvB,UAAU,GAAE,MAAU,QA2CvB"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { doesLineHeightAffectElement } from './doesLineHeightAffectElement.js';
|
|
4
4
|
export function setHandlePosition(targetElem, handleElem, anchorElem, leftOffset = 0) {
|
|
5
5
|
if (!targetElem) {
|
|
6
|
+
handleElem.style.visibility = 'hidden';
|
|
6
7
|
handleElem.style.opacity = '0';
|
|
7
8
|
handleElem.style.transform = 'translate(-10000px, -10000px)';
|
|
8
9
|
return;
|
|
@@ -23,6 +24,7 @@ export function setHandlePosition(targetElem, handleElem, anchorElem, leftOffset
|
|
|
23
24
|
}
|
|
24
25
|
const left = leftOffset;
|
|
25
26
|
handleElem.style.opacity = '1';
|
|
27
|
+
handleElem.style.visibility = 'visible';
|
|
26
28
|
handleElem.style.transform = `translate(${left}px, ${top}px)`;
|
|
27
29
|
}
|
|
28
30
|
//# sourceMappingURL=setHandlePosition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setHandlePosition.js","names":["doesLineHeightAffectElement","setHandlePosition","targetElem","handleElem","anchorElem","leftOffset","style","opacity","transform","targetRect","getBoundingClientRect","targetStyle","window","getComputedStyle","floatingElemRect","anchorElementRect","top","isBlockStyle","some","classes","classList","contains","firstElementChild","actualLineHeight","parseInt","lineHeight","height","left"],"sources":["../../../../../src/lexical/plugins/handles/utils/setHandlePosition.ts"],"sourcesContent":["'use client'\nimport { doesLineHeightAffectElement } from './doesLineHeightAffectElement.js'\n\nexport function setHandlePosition(\n targetElem: HTMLElement | null,\n handleElem: HTMLElement,\n anchorElem: HTMLElement,\n leftOffset: number = 0, // SPACE\n) {\n if (!targetElem) {\n handleElem.style.opacity = '0'\n handleElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const targetRect = targetElem.getBoundingClientRect()\n const targetStyle = window.getComputedStyle(targetElem)\n const floatingElemRect = handleElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n\n let top: number\n\n const isBlockStyle = [\n 'LexicalEditorTheme__block',\n 'LexicalEditorTheme__upload',\n 'LexicalEditorTheme__relationship',\n ].some(\n (classes) =>\n targetElem.classList.contains(classes) ||\n targetElem.firstElementChild?.classList.contains(classes),\n )\n\n if (!isBlockStyle) {\n // No need to let line height affect the re-positioning of the floating element if line height has no\n // visual effect on the element. Otherwise, the floating element will be positioned incorrectly.\n const actualLineHeight = doesLineHeightAffectElement(targetElem)\n ? parseInt(targetStyle.lineHeight, 10)\n : 0\n\n top = targetRect.top + (actualLineHeight - floatingElemRect.height) / 2 - anchorElementRect.top\n } else {\n top = targetRect.top + 8 - anchorElementRect.top\n }\n\n const left = leftOffset\n\n handleElem.style.opacity = '1'\n handleElem.style.transform = `translate(${left}px, ${top}px)`\n}\n"],"mappings":"AAAA;;AACA,SAASA,2BAA2B,QAAQ;AAE5C,OAAO,SAASC,kBACdC,UAA8B,EAC9BC,UAAuB,EACvBC,UAAuB,EACvBC,UAAA,GAAqB,CAAC;EAEtB,IAAI,CAACH,UAAA,EAAY;IACfC,UAAA,CAAWG,KAAK,CAACC,
|
|
1
|
+
{"version":3,"file":"setHandlePosition.js","names":["doesLineHeightAffectElement","setHandlePosition","targetElem","handleElem","anchorElem","leftOffset","style","visibility","opacity","transform","targetRect","getBoundingClientRect","targetStyle","window","getComputedStyle","floatingElemRect","anchorElementRect","top","isBlockStyle","some","classes","classList","contains","firstElementChild","actualLineHeight","parseInt","lineHeight","height","left"],"sources":["../../../../../src/lexical/plugins/handles/utils/setHandlePosition.ts"],"sourcesContent":["'use client'\nimport { doesLineHeightAffectElement } from './doesLineHeightAffectElement.js'\n\nexport function setHandlePosition(\n targetElem: HTMLElement | null,\n handleElem: HTMLElement,\n anchorElem: HTMLElement,\n leftOffset: number = 0, // SPACE\n) {\n if (!targetElem) {\n handleElem.style.visibility = 'hidden'\n handleElem.style.opacity = '0'\n handleElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const targetRect = targetElem.getBoundingClientRect()\n const targetStyle = window.getComputedStyle(targetElem)\n const floatingElemRect = handleElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n\n let top: number\n\n const isBlockStyle = [\n 'LexicalEditorTheme__block',\n 'LexicalEditorTheme__upload',\n 'LexicalEditorTheme__relationship',\n ].some(\n (classes) =>\n targetElem.classList.contains(classes) ||\n targetElem.firstElementChild?.classList.contains(classes),\n )\n\n if (!isBlockStyle) {\n // No need to let line height affect the re-positioning of the floating element if line height has no\n // visual effect on the element. Otherwise, the floating element will be positioned incorrectly.\n const actualLineHeight = doesLineHeightAffectElement(targetElem)\n ? parseInt(targetStyle.lineHeight, 10)\n : 0\n\n top = targetRect.top + (actualLineHeight - floatingElemRect.height) / 2 - anchorElementRect.top\n } else {\n top = targetRect.top + 8 - anchorElementRect.top\n }\n\n const left = leftOffset\n\n handleElem.style.opacity = '1'\n handleElem.style.visibility = 'visible'\n handleElem.style.transform = `translate(${left}px, ${top}px)`\n}\n"],"mappings":"AAAA;;AACA,SAASA,2BAA2B,QAAQ;AAE5C,OAAO,SAASC,kBACdC,UAA8B,EAC9BC,UAAuB,EACvBC,UAAuB,EACvBC,UAAA,GAAqB,CAAC;EAEtB,IAAI,CAACH,UAAA,EAAY;IACfC,UAAA,CAAWG,KAAK,CAACC,UAAU,GAAG;IAC9BJ,UAAA,CAAWG,KAAK,CAACE,OAAO,GAAG;IAC3BL,UAAA,CAAWG,KAAK,CAACG,SAAS,GAAG;IAC7B;EACF;EAEA,MAAMC,UAAA,GAAaR,UAAA,CAAWS,qBAAqB;EACnD,MAAMC,WAAA,GAAcC,MAAA,CAAOC,gBAAgB,CAACZ,UAAA;EAC5C,MAAMa,gBAAA,GAAmBZ,UAAA,CAAWQ,qBAAqB;EACzD,MAAMK,iBAAA,GAAoBZ,UAAA,CAAWO,qBAAqB;EAE1D,IAAIM,GAAA;EAEJ,MAAMC,YAAA,GAAe,CACnB,6BACA,8BACA,mCACD,CAACC,IAAI,CACHC,OAAA,IACClB,UAAA,CAAWmB,SAAS,CAACC,QAAQ,CAACF,OAAA,KAC9BlB,UAAA,CAAWqB,iBAAiB,EAAEF,SAAA,CAAUC,QAAA,CAASF,OAAA;EAGrD,IAAI,CAACF,YAAA,EAAc;IACjB;IACA;IACA,MAAMM,gBAAA,GAAmBxB,2BAAA,CAA4BE,UAAA,IACjDuB,QAAA,CAASb,WAAA,CAAYc,UAAU,EAAE,MACjC;IAEJT,GAAA,GAAMP,UAAA,CAAWO,GAAG,GAAG,CAACO,gBAAA,GAAmBT,gBAAA,CAAiBY,MAAM,IAAI,IAAIX,iBAAA,CAAkBC,GAAG;EACjG,OAAO;IACLA,GAAA,GAAMP,UAAA,CAAWO,GAAG,GAAG,IAAID,iBAAA,CAAkBC,GAAG;EAClD;EAEA,MAAMW,IAAA,GAAOvB,UAAA;EAEbF,UAAA,CAAWG,KAAK,CAACE,OAAO,GAAG;EAC3BL,UAAA,CAAWG,KAAK,CAACC,UAAU,GAAG;EAC9BJ,UAAA,CAAWG,KAAK,CAACG,SAAS,GAAG,aAAamB,IAAA,OAAWX,GAAA,KAAQ;AAC/D","ignoreList":[]}
|
|
@@ -5,29 +5,30 @@
|
|
|
5
5
|
position: relative;
|
|
6
6
|
tab-size: 1;
|
|
7
7
|
outline: 0;
|
|
8
|
-
padding
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
padding-
|
|
8
|
+
padding: var(--spacer-3) var(--spacer-3);
|
|
9
|
+
/* Reserve space for the InsertParagraphAtEnd hover "+" affordance, which
|
|
10
|
+
overlaps this bottom padding; shrinking it would cover the last line. */
|
|
11
|
+
padding-bottom: var(--spacer-4);
|
|
12
12
|
|
|
13
13
|
&:focus-visible {
|
|
14
14
|
outline: none !important;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
& > * {
|
|
18
|
-
transition: transform 0.2s ease-in-out;
|
|
19
|
-
}
|
|
20
16
|
}
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
> .rich-text-lexical__editor-content
|
|
25
|
-
> .editor-container
|
|
26
|
-
> .editor-scroller
|
|
27
|
-
> .editor {
|
|
28
|
-
> .ContentEditable__root {
|
|
18
|
+
@media (min-width: 768px) {
|
|
19
|
+
.ContentEditable__root {
|
|
29
20
|
padding: var(--spacer-4) var(--spacer-5);
|
|
30
21
|
}
|
|
22
|
+
|
|
23
|
+
.rich-text-lexical:not(.rich-text-lexical--show-gutter)
|
|
24
|
+
> .rich-text-lexical__wrap
|
|
25
|
+
> .rich-text-lexical__editor-content
|
|
26
|
+
> .editor-container
|
|
27
|
+
> .editor-scroller
|
|
28
|
+
> .editor
|
|
29
|
+
> .ContentEditable__root {
|
|
30
|
+
padding: var(--spacer-2) 0;
|
|
31
|
+
}
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
html[data-theme='light'] {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { JSX } from 'react';
|
|
2
2
|
import './ContentEditable.css';
|
|
3
3
|
import type { SanitizedClientEditorConfig } from '../config/types.js';
|
|
4
|
-
export declare function LexicalContentEditable({ className, editorConfig, }: {
|
|
4
|
+
export declare function LexicalContentEditable({ className, editorConfig, instructionsID, }: {
|
|
5
5
|
className?: string;
|
|
6
6
|
editorConfig: SanitizedClientEditorConfig;
|
|
7
|
+
instructionsID?: string;
|
|
7
8
|
}): JSX.Element;
|
|
8
9
|
//# sourceMappingURL=ContentEditable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEditable.d.ts","sourceRoot":"","sources":["../../../src/lexical/ui/ContentEditable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAMhC,OAAO,uBAAuB,CAAA;AAI9B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAErE,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,YAAY,
|
|
1
|
+
{"version":3,"file":"ContentEditable.d.ts","sourceRoot":"","sources":["../../../src/lexical/ui/ContentEditable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAMhC,OAAO,uBAAuB,CAAA;AAI9B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAErE,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,YAAY,EACZ,cAAc,GACf,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,2BAA2B,CAAA;IACzC,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,GAAG,GAAG,CAAC,OAAO,CAgBd"}
|
|
@@ -8,10 +8,11 @@ import { useTranslation } from '@payloadcms/ui';
|
|
|
8
8
|
import './ContentEditable.css';
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
export function LexicalContentEditable(t0) {
|
|
11
|
-
const $ = _c(
|
|
11
|
+
const $ = _c(6);
|
|
12
12
|
const {
|
|
13
13
|
className,
|
|
14
|
-
editorConfig
|
|
14
|
+
editorConfig,
|
|
15
|
+
instructionsID
|
|
15
16
|
} = t0;
|
|
16
17
|
const {
|
|
17
18
|
t
|
|
@@ -21,9 +22,10 @@ export function LexicalContentEditable(t0) {
|
|
|
21
22
|
getTheme
|
|
22
23
|
} = t1;
|
|
23
24
|
let t2;
|
|
24
|
-
if ($[0] !== className || $[1] !== editorConfig?.admin?.placeholder || $[2] !== getTheme || $[3] !== t) {
|
|
25
|
+
if ($[0] !== className || $[1] !== editorConfig?.admin?.placeholder || $[2] !== getTheme || $[3] !== instructionsID || $[4] !== t) {
|
|
25
26
|
const theme = getTheme();
|
|
26
27
|
t2 = _jsx(ContentEditable, {
|
|
28
|
+
"aria-describedby": instructionsID,
|
|
27
29
|
"aria-placeholder": t("lexical:general:placeholder"),
|
|
28
30
|
className: className ?? "ContentEditable__root",
|
|
29
31
|
placeholder: _jsx("p", {
|
|
@@ -34,10 +36,11 @@ export function LexicalContentEditable(t0) {
|
|
|
34
36
|
$[0] = className;
|
|
35
37
|
$[1] = editorConfig?.admin?.placeholder;
|
|
36
38
|
$[2] = getTheme;
|
|
37
|
-
$[3] =
|
|
38
|
-
$[4] =
|
|
39
|
+
$[3] = instructionsID;
|
|
40
|
+
$[4] = t;
|
|
41
|
+
$[5] = t2;
|
|
39
42
|
} else {
|
|
40
|
-
t2 = $[
|
|
43
|
+
t2 = $[5];
|
|
41
44
|
}
|
|
42
45
|
return t2;
|
|
43
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEditable.js","names":["c","_c","useLexicalComposerContext","ContentEditable","useTranslation","React","LexicalContentEditable","t0","$","className","editorConfig","t","t1","getTheme","t2","admin","placeholder","theme","_jsx","children"],"sources":["../../../src/lexical/ui/ContentEditable.tsx"],"sourcesContent":["'use client'\nimport type { JSX } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { ContentEditable } from '@lexical/react/LexicalContentEditable.js'\nimport { useTranslation } from '@payloadcms/ui'\n\nimport './ContentEditable.css'\n\nimport * as React from 'react'\n\nimport type { SanitizedClientEditorConfig } from '../config/types.js'\n\nexport function LexicalContentEditable({\n className,\n editorConfig,\n}: {\n className?: string\n editorConfig: SanitizedClientEditorConfig\n}): JSX.Element {\n const { t } = useTranslation<{}, string>()\n const [_, { getTheme }] = useLexicalComposerContext()\n const theme = getTheme()\n
|
|
1
|
+
{"version":3,"file":"ContentEditable.js","names":["c","_c","useLexicalComposerContext","ContentEditable","useTranslation","React","LexicalContentEditable","t0","$","className","editorConfig","instructionsID","t","t1","getTheme","t2","admin","placeholder","theme","_jsx","children"],"sources":["../../../src/lexical/ui/ContentEditable.tsx"],"sourcesContent":["'use client'\nimport type { JSX } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { ContentEditable } from '@lexical/react/LexicalContentEditable.js'\nimport { useTranslation } from '@payloadcms/ui'\n\nimport './ContentEditable.css'\n\nimport * as React from 'react'\n\nimport type { SanitizedClientEditorConfig } from '../config/types.js'\n\nexport function LexicalContentEditable({\n className,\n editorConfig,\n instructionsID,\n}: {\n className?: string\n editorConfig: SanitizedClientEditorConfig\n instructionsID?: string\n}): JSX.Element {\n const { t } = useTranslation<{}, string>()\n const [_, { getTheme }] = useLexicalComposerContext()\n const theme = getTheme()\n return (\n <ContentEditable\n aria-describedby={instructionsID}\n aria-placeholder={t('lexical:general:placeholder')}\n className={className ?? 'ContentEditable__root'}\n placeholder={\n <p className={theme?.placeholder}>\n {editorConfig?.admin?.placeholder ?? t('lexical:general:placeholder')}\n </p>\n }\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,eAAe,QAAQ;AAChC,SAASC,cAAc,QAAQ;AAE/B,OAAO;AAEP,YAAYC,KAAA,MAAW;AAIvB,OAAO,SAAAC,uBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAAgC;IAAAQ,SAAA;IAAAC,YAAA;IAAAC;EAAA,IAAAJ,EAQtC;EACC;IAAAK;EAAA,IAAcR,cAAA;EACd,SAAAS,EAAA,IAA0BX,yBAAA;EAAhB;IAAAY;EAAA,IAAAD,EAAY;EAAA,IAAAE,EAAA;EAAA,IAAAP,CAAA,QAAAC,SAAA,IAAAD,CAAA,QAAAE,YAAA,EAAAM,KAAA,EAAAC,WAAA,IAAAT,CAAA,QAAAM,QAAA,IAAAN,CAAA,QAAAG,cAAA,IAAAH,CAAA,QAAAI,CAAA;IACtB,MAAAM,KAAA,GAAcJ,QAAA;IAEZC,EAAA,GAAAI,IAAA,CAAAhB,eAAA;MAAA,oBACoBQ,cAAA;MAAA,oBACAC,CAAA,CAAE;MAAAH,SAAA,EACTA,SAAA,IAAa;MAAAQ,WAAA,EAEtBE,IAAA,CAAC;QAAAV,SAAA,EAAaS,KAAA,EAAAD,WAAA;QAAAG,QAAA,EACXV,YAAA,EAAAM,KAAA,EAAAC,WAAA,IAAoCL,CAAA,CAAE;MAAA,C;;;;;;;;;;;SAN7CG,E","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H3/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H3/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAoBA,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
const
|
|
5
|
+
const headingPath = 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z';
|
|
6
|
+
const numeralPath = 'M16.59 13.32 A1.5 1.25 0 1 1 18 15 A1.5 1.25 0 1 1 16.59 16.68';
|
|
6
7
|
export const H3Icon = ({
|
|
7
8
|
className
|
|
8
|
-
}) => /*#__PURE__*/
|
|
9
|
+
}) => /*#__PURE__*/_jsxs("svg", {
|
|
9
10
|
"aria-hidden": "true",
|
|
10
11
|
className: ['icon', className].filter(Boolean).join(' '),
|
|
11
12
|
fill: "none",
|
|
@@ -14,9 +15,15 @@ export const H3Icon = ({
|
|
|
14
15
|
viewBox: "0 0 24 24",
|
|
15
16
|
width: 24,
|
|
16
17
|
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
-
children: /*#__PURE__*/_jsx("path", {
|
|
18
|
-
d:
|
|
18
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
19
|
+
d: headingPath,
|
|
19
20
|
fill: "currentColor"
|
|
20
|
-
})
|
|
21
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
22
|
+
d: numeralPath,
|
|
23
|
+
stroke: "currentColor",
|
|
24
|
+
strokeLinecap: "round",
|
|
25
|
+
strokeLinejoin: "round",
|
|
26
|
+
strokeWidth: 1
|
|
27
|
+
})]
|
|
21
28
|
});
|
|
22
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","headingPath","numeralPath","H3Icon","className","_jsxs","filter","Boolean","join","fill","focusable","height","viewBox","width","xmlns","_jsx","d","stroke","strokeLinecap","strokeLinejoin","strokeWidth"],"sources":["../../../../../src/lexical/ui/icons/H3/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nconst headingPath =\n 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z'\nconst numeralPath = 'M16.59 13.32 A1.5 1.25 0 1 1 18 15 A1.5 1.25 0 1 1 16.59 16.68'\n\nexport const H3Icon: React.FC<{\n readonly className?: string\n}> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={['icon', className].filter(Boolean).join(' ')}\n fill=\"none\"\n focusable=\"false\"\n height={24}\n viewBox=\"0 0 24 24\"\n width={24}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d={headingPath} fill=\"currentColor\" />\n <path\n d={numeralPath}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={1}\n />\n </svg>\n)\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,MAAMC,WAAA,GACJ;AACF,MAAMC,WAAA,GAAc;AAEpB,OAAO,MAAMC,MAAA,GAERA,CAAC;EAAEC;AAAS,CAAE,kBACjBC,KAAA,CAAC;EACC,eAAY;EACZD,SAAA,EAAW,CAAC,QAAQA,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EACpDC,IAAA,EAAK;EACLC,SAAA,EAAU;EACVC,MAAA,EAAQ;EACRC,OAAA,EAAQ;EACRC,KAAA,EAAO;EACPC,KAAA,EAAM;0BAENC,IAAA,CAAC;IAAKC,CAAA,EAAGf,WAAA;IAAaQ,IAAA,EAAK;mBAC3BM,IAAA,CAAC;IACCC,CAAA,EAAGd,WAAA;IACHe,MAAA,EAAO;IACPC,aAAA,EAAc;IACdC,cAAA,EAAe;IACfC,WAAA,EAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H4/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H4/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAoBA,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
const
|
|
5
|
+
const headingPath = 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z';
|
|
6
|
+
const numeralPath = 'M18.85 17.5 V12.5 L16.5 15.85 H19.5';
|
|
6
7
|
export const H4Icon = ({
|
|
7
8
|
className
|
|
8
|
-
}) => /*#__PURE__*/
|
|
9
|
+
}) => /*#__PURE__*/_jsxs("svg", {
|
|
9
10
|
"aria-hidden": "true",
|
|
10
11
|
className: ['icon', className].filter(Boolean).join(' '),
|
|
11
12
|
fill: "none",
|
|
@@ -14,9 +15,15 @@ export const H4Icon = ({
|
|
|
14
15
|
viewBox: "0 0 24 24",
|
|
15
16
|
width: 24,
|
|
16
17
|
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
-
children: /*#__PURE__*/_jsx("path", {
|
|
18
|
-
d:
|
|
18
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
19
|
+
d: headingPath,
|
|
19
20
|
fill: "currentColor"
|
|
20
|
-
})
|
|
21
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
22
|
+
d: numeralPath,
|
|
23
|
+
stroke: "currentColor",
|
|
24
|
+
strokeLinecap: "round",
|
|
25
|
+
strokeLinejoin: "round",
|
|
26
|
+
strokeWidth: 1
|
|
27
|
+
})]
|
|
21
28
|
});
|
|
22
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","headingPath","numeralPath","H4Icon","className","_jsxs","filter","Boolean","join","fill","focusable","height","viewBox","width","xmlns","_jsx","d","stroke","strokeLinecap","strokeLinejoin","strokeWidth"],"sources":["../../../../../src/lexical/ui/icons/H4/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nconst headingPath =\n 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z'\nconst numeralPath = 'M18.85 17.5 V12.5 L16.5 15.85 H19.5'\n\nexport const H4Icon: React.FC<{\n readonly className?: string\n}> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={['icon', className].filter(Boolean).join(' ')}\n fill=\"none\"\n focusable=\"false\"\n height={24}\n viewBox=\"0 0 24 24\"\n width={24}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d={headingPath} fill=\"currentColor\" />\n <path\n d={numeralPath}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={1}\n />\n </svg>\n)\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,MAAMC,WAAA,GACJ;AACF,MAAMC,WAAA,GAAc;AAEpB,OAAO,MAAMC,MAAA,GAERA,CAAC;EAAEC;AAAS,CAAE,kBACjBC,KAAA,CAAC;EACC,eAAY;EACZD,SAAA,EAAW,CAAC,QAAQA,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EACpDC,IAAA,EAAK;EACLC,SAAA,EAAU;EACVC,MAAA,EAAQ;EACRC,OAAA,EAAQ;EACRC,KAAA,EAAO;EACPC,KAAA,EAAM;0BAENC,IAAA,CAAC;IAAKC,CAAA,EAAGf,WAAA;IAAaQ,IAAA,EAAK;mBAC3BM,IAAA,CAAC;IACCC,CAAA,EAAGd,WAAA;IACHe,MAAA,EAAO;IACPC,aAAA,EAAc;IACdC,cAAA,EAAe;IACfC,WAAA,EAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H5/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H5/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAoBA,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
const
|
|
5
|
+
const headingPath = 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z';
|
|
6
|
+
const numeralPath = 'M19.2 12.5 H16.8 V14.9 A1.5 1.5 0 1 1 16.7 16.9';
|
|
6
7
|
export const H5Icon = ({
|
|
7
8
|
className
|
|
8
|
-
}) => /*#__PURE__*/
|
|
9
|
+
}) => /*#__PURE__*/_jsxs("svg", {
|
|
9
10
|
"aria-hidden": "true",
|
|
10
11
|
className: ['icon', className].filter(Boolean).join(' '),
|
|
11
12
|
fill: "none",
|
|
@@ -14,9 +15,15 @@ export const H5Icon = ({
|
|
|
14
15
|
viewBox: "0 0 24 24",
|
|
15
16
|
width: 24,
|
|
16
17
|
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
-
children: /*#__PURE__*/_jsx("path", {
|
|
18
|
-
d:
|
|
18
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
19
|
+
d: headingPath,
|
|
19
20
|
fill: "currentColor"
|
|
20
|
-
})
|
|
21
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
22
|
+
d: numeralPath,
|
|
23
|
+
stroke: "currentColor",
|
|
24
|
+
strokeLinecap: "round",
|
|
25
|
+
strokeLinejoin: "round",
|
|
26
|
+
strokeWidth: 1
|
|
27
|
+
})]
|
|
21
28
|
});
|
|
22
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","headingPath","numeralPath","H5Icon","className","_jsxs","filter","Boolean","join","fill","focusable","height","viewBox","width","xmlns","_jsx","d","stroke","strokeLinecap","strokeLinejoin","strokeWidth"],"sources":["../../../../../src/lexical/ui/icons/H5/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nconst headingPath =\n 'M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z'\nconst numeralPath = 'M19.2 12.5 H16.8 V14.9 A1.5 1.5 0 1 1 16.7 16.9'\n\nexport const H5Icon: React.FC<{\n readonly className?: string\n}> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={['icon', className].filter(Boolean).join(' ')}\n fill=\"none\"\n focusable=\"false\"\n height={24}\n viewBox=\"0 0 24 24\"\n width={24}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d={headingPath} fill=\"currentColor\" />\n <path\n d={numeralPath}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={1}\n />\n </svg>\n)\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAElB,MAAMC,WAAA,GACJ;AACF,MAAMC,WAAA,GAAc;AAEpB,OAAO,MAAMC,MAAA,GAERA,CAAC;EAAEC;AAAS,CAAE,kBACjBC,KAAA,CAAC;EACC,eAAY;EACZD,SAAA,EAAW,CAAC,QAAQA,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EACpDC,IAAA,EAAK;EACLC,SAAA,EAAU;EACVC,MAAA,EAAQ;EACRC,OAAA,EAAQ;EACRC,KAAA,EAAO;EACPC,KAAA,EAAM;0BAENC,IAAA,CAAC;IAAKC,CAAA,EAAGf,WAAA;IAAaQ,IAAA,EAAK;mBAC3BM,IAAA,CAAC;IACCC,CAAA,EAAGd,WAAA;IACHe,MAAA,EAAO;IACPC,aAAA,EAAc;IACdC,cAAA,EAAe;IACfC,WAAA,EAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H6/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/ui/icons/H6/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAoBA,CAAA"}
|