@payloadcms/richtext-lexical 4.0.0-canary.2 → 4.0.0-canary.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/dist/cell/rscEntry.d.ts.map +1 -1
- package/dist/cell/rscEntry.js +5 -5
- package/dist/cell/rscEntry.js.map +1 -1
- package/dist/exports/client/Field-F22V5L4V.js +2 -0
- package/dist/exports/client/Field-F22V5L4V.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-43E5QYAA.js +2 -0
- package/dist/exports/client/chunk-43E5QYAA.js.map +7 -0
- package/dist/exports/client/{chunk-CUFJGFNW.js → chunk-ESITTE3C.js} +2 -2
- package/dist/exports/client/{chunk-CUFJGFNW.js.map → chunk-ESITTE3C.js.map} +2 -2
- package/dist/exports/client/chunk-LN6VX25I.js +2 -0
- package/dist/exports/client/chunk-LN6VX25I.js.map +7 -0
- package/dist/exports/client/component-D5QLYS7W.js +2 -0
- package/dist/exports/client/component-D5QLYS7W.js.map +7 -0
- package/dist/exports/client/componentInline-H24N7GUG.js +2 -0
- package/dist/exports/client/index.d.ts +1 -2
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +27 -28
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
- package/dist/features/blockquote/client/index.js +2 -2
- package/dist/features/blockquote/client/index.js.map +1 -1
- package/dist/features/blockquote/server/index.js +2 -2
- package/dist/features/blockquote/server/index.js.map +1 -1
- package/dist/features/blocks/client/component/index.css +2 -2
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.css +8 -8
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/getBlockImageComponent.d.ts +1 -1
- package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts +1 -1
- package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts.map +1 -1
- package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js +1 -1
- package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js.map +1 -1
- package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts +1 -1
- package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts.map +1 -1
- package/dist/features/blocks/client/markdown/getMarkdownToLexical.js +5 -2
- package/dist/features/blocks/client/markdown/getMarkdownToLexical.js.map +1 -1
- package/dist/features/blocks/client/markdown/markdownTransformer.d.ts +1 -2
- package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
- package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.css +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +2 -4
- package/dist/features/blocks/premade/CodeBlock/Component/index.css +5 -5
- package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.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/blocks/server/markdown/markdownTransformer.d.ts +1 -1
- package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
- package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/server/schema.d.ts.map +1 -1
- package/dist/features/blocks/server/schema.js +3 -2
- package/dist/features/blocks/server/schema.js.map +1 -1
- package/dist/features/blocks/server/validate.d.ts.map +1 -1
- package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
- package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
- package/dist/features/converters/lexicalToMarkdown/index.js +1 -1
- package/dist/features/converters/lexicalToMarkdown/index.js.map +1 -1
- package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
- package/dist/features/converters/markdownToLexical/index.js +5 -2
- package/dist/features/converters/markdownToLexical/index.js.map +1 -1
- package/dist/features/debug/jsxConverter/client/plugin/style.css +2 -2
- package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
- package/dist/features/format/bold/feature.client.js +1 -1
- package/dist/features/format/bold/feature.client.js.map +1 -1
- package/dist/features/format/bold/feature.server.d.ts.map +1 -1
- package/dist/features/format/bold/feature.server.js +1 -1
- package/dist/features/format/bold/feature.server.js.map +1 -1
- package/dist/features/format/inlineCode/feature.client.js +1 -1
- package/dist/features/format/inlineCode/feature.client.js.map +1 -1
- package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
- package/dist/features/format/inlineCode/feature.server.js +1 -1
- package/dist/features/format/inlineCode/feature.server.js.map +1 -1
- package/dist/features/format/italic/feature.client.js +1 -1
- package/dist/features/format/italic/feature.client.js.map +1 -1
- package/dist/features/format/italic/feature.server.d.ts.map +1 -1
- package/dist/features/format/italic/feature.server.js +1 -1
- package/dist/features/format/italic/feature.server.js.map +1 -1
- package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
- package/dist/features/format/strikethrough/feature.client.js +1 -1
- package/dist/features/format/strikethrough/feature.client.js.map +1 -1
- package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
- package/dist/features/format/strikethrough/feature.server.js +1 -1
- package/dist/features/format/strikethrough/feature.server.js.map +1 -1
- package/dist/features/heading/client/index.js +2 -2
- package/dist/features/heading/client/index.js.map +1 -1
- package/dist/features/heading/markdownTransformer.d.ts +2 -2
- package/dist/features/heading/markdownTransformer.d.ts.map +1 -1
- package/dist/features/heading/markdownTransformer.js +6 -19
- package/dist/features/heading/markdownTransformer.js.map +1 -1
- package/dist/features/heading/server/index.js +2 -2
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/heading/server/schema.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/index.js +2 -2
- package/dist/features/horizontalRule/client/index.js.map +1 -1
- package/dist/features/horizontalRule/client/markdownTransformer.d.ts +2 -2
- package/dist/features/horizontalRule/client/markdownTransformer.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/markdownTransformer.js +1 -1
- package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
- 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/client/plugin/index.css +2 -2
- package/dist/features/horizontalRule/server/index.js +2 -2
- package/dist/features/horizontalRule/server/index.js.map +1 -1
- package/dist/features/horizontalRule/server/markdownTransformer.d.ts +2 -2
- package/dist/features/horizontalRule/server/markdownTransformer.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/markdownTransformer.js +1 -1
- package/dist/features/horizontalRule/server/markdownTransformer.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/toolbarIndentGroup.d.ts.map +1 -1
- package/dist/features/link/client/index.js +2 -2
- package/dist/features/link/client/index.js.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +3 -3
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.css +7 -12
- package/dist/features/link/markdownTransformer.d.ts +4 -4
- package/dist/features/link/markdownTransformer.d.ts.map +1 -1
- package/dist/features/link/markdownTransformer.js +2 -2
- package/dist/features/link/markdownTransformer.js.map +1 -1
- package/dist/features/link/markdownTransformer.spec.js +10 -10
- package/dist/features/link/markdownTransformer.spec.js.map +1 -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/baseFields.d.ts.map +1 -1
- package/dist/features/link/server/baseFields.js.map +1 -1
- package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/link/server/index.js +4 -4
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/link/server/schema.d.ts.map +1 -1
- package/dist/features/link/server/schema.js +4 -2
- package/dist/features/link/server/schema.js.map +1 -1
- package/dist/features/link/server/validate.d.ts.map +1 -1
- package/dist/features/lists/checklist/client/index.js +1 -1
- package/dist/features/lists/checklist/client/index.js.map +1 -1
- package/dist/features/lists/checklist/server/index.js +1 -1
- package/dist/features/lists/checklist/server/index.js.map +1 -1
- package/dist/features/lists/orderedList/client/index.js +1 -1
- package/dist/features/lists/orderedList/client/index.js.map +1 -1
- package/dist/features/lists/orderedList/server/index.js +1 -1
- package/dist/features/lists/orderedList/server/index.js.map +1 -1
- package/dist/features/lists/unorderedList/client/index.js +1 -1
- package/dist/features/lists/unorderedList/client/index.js.map +1 -1
- package/dist/features/lists/unorderedList/server/index.js +1 -1
- package/dist/features/lists/unorderedList/server/index.js.map +1 -1
- package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/server/schema.d.ts +3 -3
- package/dist/features/relationship/server/schema.d.ts.map +1 -1
- package/dist/features/relationship/server/schema.js +22 -5
- package/dist/features/relationship/server/schema.js.map +1 -1
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
- package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
- package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
- package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
- package/dist/features/table/client/index.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/client/index.js +2 -2
- package/dist/features/table/client/index.js.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
- 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/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 +5 -0
- package/dist/features/table/markdownTransformer.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/markdownTransformer.js +6 -3
- 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 +6 -6
- 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/textState/feature.client.js +1 -1
- package/dist/features/textState/feature.client.js.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.css +4 -6
- package/dist/features/toolbars/inline/client/Toolbar/index.css +2 -14
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.css +8 -14
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/useToolbarStates.d.ts.map +1 -1
- package/dist/features/toolbars/shared/useToolbarStates.js +3 -1
- package/dist/features/toolbars/shared/useToolbarStates.js.map +1 -1
- package/dist/features/typesClient.d.ts +1 -1
- package/dist/features/typesClient.d.ts.map +1 -1
- package/dist/features/typesClient.js.map +1 -1
- package/dist/features/typesServer.d.ts +3 -3
- package/dist/features/typesServer.d.ts.map +1 -1
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/component/index.css +9 -9
- 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/drawer/index.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/client/plugin/index.js +5 -5
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/upload/server/index.js +4 -4
- package/dist/features/upload/server/index.js.map +1 -1
- package/dist/features/upload/server/markdownTransformer.d.ts +2 -2
- package/dist/features/upload/server/markdownTransformer.d.ts.map +1 -1
- package/dist/features/upload/server/markdownTransformer.js +1 -1
- package/dist/features/upload/server/markdownTransformer.js.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/server/schema.d.ts +4 -4
- package/dist/features/upload/server/schema.d.ts.map +1 -1
- package/dist/features/upload/server/schema.js +26 -6
- package/dist/features/upload/server/schema.js.map +1 -1
- package/dist/features/upload/server/validate.d.ts.map +1 -1
- package/dist/field/Diff/converters/unknown/index.css +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +18 -15
- package/dist/field/Field.js.map +1 -1
- package/dist/field/ViewSelector.css +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.css +5 -9
- package/dist/field/index.js +1 -1
- package/dist/field/index.js.map +1 -1
- package/dist/field/rscEntry.d.ts.map +1 -1
- package/dist/field/rscEntry.js +2 -0
- package/dist/field/rscEntry.js.map +1 -1
- 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 +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.css +18 -18
- package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
- package/dist/lexical/config/client/loader.d.ts.map +1 -1
- package/dist/lexical/config/client/loader.js +5 -1
- package/dist/lexical/config/client/loader.js.map +1 -1
- package/dist/lexical/config/client/sanitize.d.ts.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/DecoratorPlugin/index.css +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +16 -24
- 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/MarkdownShortcut/index.d.ts.map +1 -1
- package/dist/lexical/plugins/MarkdownShortcut/index.js +1 -1
- package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
- package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +21 -0
- package/dist/lexical/plugins/NodeViewOverridePlugin/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 +1 -20
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.css +1 -6
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +4 -3
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
- package/dist/lexical/theme/EditorTheme.css +18 -19
- package/dist/lexical/ui/ContentEditable.css +22 -17
- package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts +17 -0
- package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts.map +1 -0
- package/dist/lexical/utils/markdown/convertFromMarkdownString.js +27 -0
- package/dist/lexical/utils/markdown/convertFromMarkdownString.js.map +1 -0
- package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +88 -0
- package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +1 -0
- package/dist/lexical/utils/markdown/createBlockNode.d.ts +2 -2
- package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
- package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
- package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts +25 -0
- package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts.map +1 -0
- package/dist/lexical/utils/markdown/normalizeMarkdown.js +91 -0
- package/dist/lexical/utils/markdown/normalizeMarkdown.js.map +1 -0
- package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
- package/dist/lexical/utils/point.d.ts.map +1 -1
- package/dist/lexical/utils/rect.d.ts.map +1 -1
- package/dist/lexical-proxy/@lexical-markdown.d.ts +1 -1
- package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -1
- package/dist/lexical-proxy/@lexical-markdown.js +1 -1
- package/dist/lexical-proxy/@lexical-markdown.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/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/jsonSchemaHelpers.d.ts.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/types/schema.d.ts.map +1 -1
- package/dist/types/schema.js +12 -5
- package/dist/types/schema.js.map +1 -1
- package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
- package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
- package/dist/utilities/buildInitialState.d.ts +2 -1
- package/dist/utilities/buildInitialState.d.ts.map +1 -1
- package/dist/utilities/buildInitialState.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/fieldsDrawer/index.css +0 -4
- package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +1 -1
- package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.d.ts +1 -1
- package/dist/utilities/generateImportMap.d.ts.map +1 -1
- package/dist/utilities/generateSchemaMap.d.ts +1 -1
- package/dist/utilities/generateSchemaMap.d.ts.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/recurseNodeTree.d.ts.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
- package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/package.json +96 -27
- package/dist/exports/client/Field-G5Z2HM5Y.js +0 -2
- package/dist/exports/client/Field-G5Z2HM5Y.js.map +0 -7
- package/dist/exports/client/chunk-LH634DPU.js +0 -12
- package/dist/exports/client/chunk-LH634DPU.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/component-PHZQBOJE.js +0 -2
- package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
- package/dist/exports/client/componentInline-DV4EGOWU.js +0 -2
- package/dist/features/blockquote/markdownTransformer.d.ts +0 -3
- package/dist/features/blockquote/markdownTransformer.d.ts.map +0 -1
- package/dist/features/blockquote/markdownTransformer.js +0 -33
- package/dist/features/blockquote/markdownTransformer.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 +0 -5
- 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/format/bold/markdownTransformers.d.ts +0 -6
- package/dist/features/format/bold/markdownTransformers.d.ts.map +0 -1
- package/dist/features/format/bold/markdownTransformers.js +0 -23
- package/dist/features/format/bold/markdownTransformers.js.map +0 -1
- package/dist/features/format/inlineCode/markdownTransformers.d.ts +0 -3
- package/dist/features/format/inlineCode/markdownTransformers.d.ts.map +0 -1
- package/dist/features/format/inlineCode/markdownTransformers.js +0 -6
- package/dist/features/format/inlineCode/markdownTransformers.js.map +0 -1
- package/dist/features/format/italic/markdownTransformers.d.ts +0 -4
- package/dist/features/format/italic/markdownTransformers.d.ts.map +0 -1
- package/dist/features/format/italic/markdownTransformers.js +0 -12
- package/dist/features/format/italic/markdownTransformers.js.map +0 -1
- package/dist/features/format/strikethrough/markdownTransformers.d.ts +0 -3
- package/dist/features/format/strikethrough/markdownTransformers.d.ts.map +0 -1
- package/dist/features/format/strikethrough/markdownTransformers.js +0 -6
- package/dist/features/format/strikethrough/markdownTransformers.js.map +0 -1
- package/dist/features/lists/checklist/markdownTransformers.d.ts +0 -3
- package/dist/features/lists/checklist/markdownTransformers.d.ts.map +0 -1
- package/dist/features/lists/checklist/markdownTransformers.js +0 -12
- package/dist/features/lists/checklist/markdownTransformers.js.map +0 -1
- package/dist/features/lists/orderedList/markdownTransformer.d.ts +0 -3
- package/dist/features/lists/orderedList/markdownTransformer.d.ts.map +0 -1
- package/dist/features/lists/orderedList/markdownTransformer.js +0 -12
- package/dist/features/lists/orderedList/markdownTransformer.js.map +0 -1
- package/dist/features/lists/shared/markdown.d.ts +0 -6
- package/dist/features/lists/shared/markdown.d.ts.map +0 -1
- package/dist/features/lists/shared/markdown.js +0 -57
- package/dist/features/lists/shared/markdown.js.map +0 -1
- package/dist/features/lists/unorderedList/markdownTransformer.d.ts +0 -3
- package/dist/features/lists/unorderedList/markdownTransformer.d.ts.map +0 -1
- package/dist/features/lists/unorderedList/markdownTransformer.js +0 -12
- package/dist/features/lists/unorderedList/markdownTransformer.js.map +0 -1
- package/dist/lexical/utils/guard.d.ts +0 -5
- package/dist/lexical/utils/guard.d.ts.map +0 -1
- package/dist/lexical/utils/guard.js +0 -9
- package/dist/lexical/utils/guard.js.map +0 -1
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +0 -2
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +0 -1
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +0 -2
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +0 -1
- package/dist/packages/@lexical/markdown/MarkdownExport.d.ts +0 -14
- package/dist/packages/@lexical/markdown/MarkdownExport.d.ts.map +0 -1
- package/dist/packages/@lexical/markdown/MarkdownExport.js +0 -213
- package/dist/packages/@lexical/markdown/MarkdownExport.js.map +0 -1
- package/dist/packages/@lexical/markdown/MarkdownImport.d.ts +0 -19
- package/dist/packages/@lexical/markdown/MarkdownImport.d.ts.map +0 -1
- package/dist/packages/@lexical/markdown/MarkdownImport.js +0 -198
- package/dist/packages/@lexical/markdown/MarkdownImport.js.map +0 -1
- package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts +0 -11
- package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts.map +0 -1
- package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +0 -304
- package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +0 -1
- package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts +0 -147
- package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts.map +0 -1
- package/dist/packages/@lexical/markdown/MarkdownTransformers.js +0 -268
- package/dist/packages/@lexical/markdown/MarkdownTransformers.js.map +0 -1
- package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts +0 -22
- package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts.map +0 -1
- package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +0 -91
- package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +0 -1
- package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts +0 -21
- package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts.map +0 -1
- package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +0 -54
- package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +0 -1
- package/dist/packages/@lexical/markdown/importTextTransformers.d.ts +0 -18
- package/dist/packages/@lexical/markdown/importTextTransformers.d.ts.map +0 -1
- package/dist/packages/@lexical/markdown/importTextTransformers.js +0 -54
- package/dist/packages/@lexical/markdown/importTextTransformers.js.map +0 -1
- package/dist/packages/@lexical/markdown/index.d.ts +0 -29
- package/dist/packages/@lexical/markdown/index.d.ts.map +0 -1
- package/dist/packages/@lexical/markdown/index.js +0 -39
- package/dist/packages/@lexical/markdown/index.js.map +0 -1
- package/dist/packages/@lexical/markdown/utils.d.ts +0 -34
- package/dist/packages/@lexical/markdown/utils.d.ts.map +0 -1
- package/dist/packages/@lexical/markdown/utils.js +0 -267
- package/dist/packages/@lexical/markdown/utils.js.map +0 -1
- /package/dist/exports/client/{componentInline-DV4EGOWU.js.map → componentInline-H24N7GUG.js.map} +0 -0
- /package/dist/features/{experimental_table → table}/client/index.d.ts +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/TableActionMenuPlugin/index.js +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/TableCellResizerPlugin/index.js +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}/server/schema.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
|
@@ -1,46 +1,59 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
6
|
+
import { useTranslation } from '@payloadcms/ui';
|
|
6
7
|
import { $createParagraphNode, $getRoot } from 'lexical';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
import './index.css';
|
|
9
10
|
import { useEditorConfigContext } from '../../config/client/EditorConfigProvider.js';
|
|
11
|
+
import { AddIcon } from '../../ui/icons/Add/index.js';
|
|
10
12
|
const baseClass = 'insert-paragraph-at-end';
|
|
11
13
|
export const InsertParagraphAtEndPlugin = () => {
|
|
12
|
-
const $ = _c(
|
|
14
|
+
const $ = _c(5);
|
|
13
15
|
const [editor] = useLexicalComposerContext();
|
|
14
16
|
const {
|
|
15
17
|
editorConfig
|
|
16
18
|
} = useEditorConfigContext();
|
|
19
|
+
const {
|
|
20
|
+
t
|
|
21
|
+
} = useTranslation();
|
|
17
22
|
if (editorConfig?.admin?.hideInsertParagraphAtEnd) {
|
|
18
23
|
return null;
|
|
19
24
|
}
|
|
20
25
|
let t0;
|
|
21
26
|
if ($[0] !== editor) {
|
|
22
|
-
|
|
27
|
+
t0 = () => {
|
|
23
28
|
editor.update(_temp);
|
|
24
29
|
};
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
$[0] = editor;
|
|
31
|
+
$[1] = t0;
|
|
32
|
+
} else {
|
|
33
|
+
t0 = $[1];
|
|
34
|
+
}
|
|
35
|
+
const onClick = t0;
|
|
36
|
+
let t1;
|
|
37
|
+
if ($[2] !== onClick || $[3] !== t) {
|
|
38
|
+
t1 = _jsx("button", {
|
|
39
|
+
"aria-label": t("lexical:general:insertParagraph"),
|
|
27
40
|
className: baseClass,
|
|
28
41
|
onClick,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
children: _jsx("div", {
|
|
42
|
+
type: "button",
|
|
43
|
+
children: _jsx("span", {
|
|
32
44
|
className: `${baseClass}-inside`,
|
|
33
|
-
children: _jsx(
|
|
34
|
-
|
|
45
|
+
children: _jsx(AddIcon, {
|
|
46
|
+
size: 16
|
|
35
47
|
})
|
|
36
48
|
})
|
|
37
49
|
});
|
|
38
|
-
$[
|
|
39
|
-
$[
|
|
50
|
+
$[2] = onClick;
|
|
51
|
+
$[3] = t;
|
|
52
|
+
$[4] = t1;
|
|
40
53
|
} else {
|
|
41
|
-
|
|
54
|
+
t1 = $[4];
|
|
42
55
|
}
|
|
43
|
-
return
|
|
56
|
+
return t1;
|
|
44
57
|
};
|
|
45
58
|
function _temp() {
|
|
46
59
|
const paragraphNode = $createParagraphNode();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$createParagraphNode","$getRoot","React","useEditorConfigContext","baseClass","InsertParagraphAtEndPlugin","$","editor","editorConfig","admin","hideInsertParagraphAtEnd","t0","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useTranslation","$createParagraphNode","$getRoot","React","useEditorConfigContext","AddIcon","baseClass","InsertParagraphAtEndPlugin","$","editor","editorConfig","t","admin","hideInsertParagraphAtEnd","t0","update","_temp","onClick","t1","_jsx","className","type","children","size","paragraphNode","append","select"],"sources":["../../../../src/lexical/plugins/InsertParagraphAtEnd/index.tsx"],"sourcesContent":["'use client'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useTranslation } from '@payloadcms/ui'\nimport { $createParagraphNode, $getRoot } from 'lexical'\nimport React from 'react'\n\nimport './index.css'\nimport { useEditorConfigContext } from '../../config/client/EditorConfigProvider.js'\nimport { AddIcon } from '../../ui/icons/Add/index.js'\nconst baseClass = 'insert-paragraph-at-end'\n\nexport const InsertParagraphAtEndPlugin: React.FC = () => {\n const [editor] = useLexicalComposerContext()\n const { editorConfig } = useEditorConfigContext()\n const { t } = useTranslation<{}, string>()\n\n if (editorConfig?.admin?.hideInsertParagraphAtEnd) {\n return null\n }\n\n const onClick = () => {\n editor.update(() => {\n const paragraphNode = $createParagraphNode()\n $getRoot().append(paragraphNode)\n paragraphNode.select()\n })\n }\n\n return (\n <button\n aria-label={t('lexical:general:insertParagraph')}\n className={baseClass}\n onClick={onClick}\n type=\"button\"\n >\n <span className={`${baseClass}-inside`}>\n <AddIcon size={16} />\n </span>\n </button>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAEA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,cAAc,QAAQ;AAC/B,SAASC,oBAAoB,EAAEC,QAAQ,QAAQ;AAC/C,OAAOC,KAAA,MAAW;AAElB,OAAO;AACP,SAASC,sBAAsB,QAAQ;AACvC,SAASC,OAAO,QAAQ;AACxB,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,0BAAA,GAAuCA,CAAA;EAAA,MAAAC,CAAA,GAAAV,EAAA;EAClD,OAAAW,MAAA,IAAiBV,yBAAA;EACjB;IAAAW;EAAA,IAAyBN,sBAAA;EACzB;IAAAO;EAAA,IAAcX,cAAA;EAAA,IAEVU,YAAA,EAAAE,KAAA,EAAAC,wBAAA;IAAA;EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAN,CAAA,QAAAC,MAAA;IAIYK,EAAA,GAAAA,CAAA;MACdL,MAAA,CAAAM,MAAA,CAAAC,KAIA;IAAA;IACFR,CAAA,MAAAC,MAAA;IAAAD,CAAA,MAAAM,EAAA;EAAA;IAAAA,EAAA,GAAAN,CAAA;EAAA;EANA,MAAAS,OAAA,GAAgBH,EAMhB;EAAA,IAAAI,EAAA;EAAA,IAAAV,CAAA,QAAAS,OAAA,IAAAT,CAAA,QAAAG,CAAA;IAGEO,EAAA,GAAAC,IAAA,CAAC;MAAA,cACaR,CAAA,CAAE;MAAAS,SAAA,EAAAd,SAAA;MAAAW,OAAA;MAAAI,IAAA,EAGT;MAAAC,QAAA,EAELH,IAAA,CAAC;QAAAC,SAAA,EAAgB,GAAAd,SAAA,SAAqB;QAAAgB,QAAA,EACpCH,IAAA,CAAAd,OAAA;UAAAkB,IAAA;QAAA,C;;;;;;;;;SAPJL,E;CAWJ;AA7BoD,SAAAF,MAAA;EAW9C,MAAAQ,aAAA,GAAsBvB,oBAAA;EACtBC,QAAA,GAAAuB,MAAA,CAAkBD,aAAA;EAClBA,aAAA,CAAAE,MAAA,CAAoB;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lexical/plugins/MarkdownShortcut/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lexical/plugins/MarkdownShortcut/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAS1C,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { registerMarkdownShortcuts } from '@lexical/markdown';
|
|
4
5
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
5
6
|
import * as React from 'react';
|
|
6
|
-
import { registerMarkdownShortcuts } from '../../../packages/@lexical/markdown/MarkdownShortcuts.js';
|
|
7
7
|
import { useEditorConfigContext } from '../../config/client/EditorConfigProvider.js';
|
|
8
8
|
export const MarkdownShortcutPlugin = () => {
|
|
9
9
|
const $ = _c(4);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","registerMarkdownShortcuts","useLexicalComposerContext","React","useEditorConfigContext","MarkdownShortcutPlugin","$","editorConfig","editor","t0","t1","features","markdownTransformers","useEffect"],"sources":["../../../../src/lexical/plugins/MarkdownShortcut/index.tsx"],"sourcesContent":["'use client'\n\nimport { registerMarkdownShortcuts } from '@lexical/markdown'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport * as React from 'react'\n\nimport { useEditorConfigContext } from '../../config/client/EditorConfigProvider.js'\n\nexport const MarkdownShortcutPlugin: React.FC = () => {\n const { editorConfig } = useEditorConfigContext()\n const [editor] = useLexicalComposerContext()\n\n React.useEffect(() => {\n return registerMarkdownShortcuts(editor, editorConfig.features.markdownTransformers ?? [])\n }, [editor, editorConfig.features.markdownTransformers])\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAEA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,yBAAyB,QAAQ;AAC1C,YAAYC,KAAA,MAAW;AAEvB,SAASC,sBAAsB,QAAQ;AAEvC,OAAO,MAAMC,sBAAA,GAAmCA,CAAA;EAAA,MAAAC,CAAA,GAAAN,EAAA;EAC9C;IAAAO;EAAA,IAAyBH,sBAAA;EACzB,OAAAI,MAAA,IAAiBN,yBAAA;EAAA,IAAAO,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAJ,CAAA,QAAAE,MAAA,IAAAF,CAAA,QAAAC,YAAA,CAAAI,QAAA,CAAAC,oBAAA;IAEDH,EAAA,GAAAA,CAAA,KACPR,yBAAA,CAA0BO,MAAA,EAAQD,YAAA,CAAAI,QAAA,CAAAC,oBAAA,MAAgD;IACxFF,EAAA,IAACF,MAAA,EAAQD,YAAA,CAAAI,QAAA,CAAAC,oBAAA;IAA2CN,CAAA,MAAAE,MAAA;IAAAF,CAAA,MAAAC,YAAA,CAAAI,QAAA,CAAAC,oBAAA;IAAAN,CAAA,MAAAG,EAAA;IAAAH,CAAA,MAAAI,EAAA;EAAA;IAAAD,EAAA,GAAAH,CAAA;IAAAI,EAAA,GAAAJ,CAAA;EAAA;EAFvDH,KAAA,CAAAU,SAAA,CAAgBJ,EAEhB,EAAGC,EAAoD;EAAA;AAAA,CAGzD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lexical/plugins/NodeViewOverridePlugin/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lexical/plugins/NodeViewOverridePlugin/index.tsx"],"names":[],"mappings":"AA4BA,wBAAgB,sBAAsB,IAAI,IAAI,CAwB7C"}
|
|
@@ -2,9 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
4
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
|
|
5
|
+
import { $getRoot } from 'lexical';
|
|
5
6
|
import { useEffect } from 'react';
|
|
6
7
|
import { useRichTextView } from '../../../field/RichTextViewProvider.js';
|
|
7
8
|
import { clearEditorNodeViews, registerEditorNodeViews } from '../../nodes/index.js';
|
|
9
|
+
// `LexicalComposer` re-mounts with a new `editor` whenever `currentView` changes,
|
|
10
|
+
// so decorator nodes run their initial `decorate()` before this effect registers the view's overrides.
|
|
11
|
+
// Mark existing block decorators dirty after registering so they re-decorate with the resolved custom `Block` component.
|
|
12
|
+
function refreshBlockDecorators(editor) {
|
|
13
|
+
editor.update(() => {
|
|
14
|
+
const walk = node => {
|
|
15
|
+
const type = node.getType();
|
|
16
|
+
if (type === 'block' || type === 'inlineBlock') {
|
|
17
|
+
node.markDirty();
|
|
18
|
+
}
|
|
19
|
+
if ('getChildren' in node && typeof node.getChildren === 'function') {
|
|
20
|
+
for (const child of node.getChildren()) {
|
|
21
|
+
walk(child);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
walk($getRoot());
|
|
26
|
+
});
|
|
27
|
+
}
|
|
8
28
|
export function NodeViewOverridePlugin() {
|
|
9
29
|
const $ = _c(5);
|
|
10
30
|
const [editor] = useLexicalComposerContext();
|
|
@@ -31,6 +51,7 @@ export function NodeViewOverridePlugin() {
|
|
|
31
51
|
registerEditorNodeViews(editor, views[currentView]?.nodes);
|
|
32
52
|
}
|
|
33
53
|
}
|
|
54
|
+
refreshBlockDecorators(editor);
|
|
34
55
|
};
|
|
35
56
|
t1 = [editor, views, currentView];
|
|
36
57
|
$[0] = currentView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useEffect","useRichTextView","clearEditorNodeViews","registerEditorNodeViews","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$getRoot","useEffect","useRichTextView","clearEditorNodeViews","registerEditorNodeViews","refreshBlockDecorators","editor","update","walk","node","type","getType","markDirty","getChildren","child","NodeViewOverridePlugin","$","currentView","views","t0","t1","default","nodes"],"sources":["../../../../src/lexical/plugins/NodeViewOverridePlugin/index.tsx"],"sourcesContent":["'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $getRoot, type LexicalNode } from 'lexical'\nimport { useEffect } from 'react'\n\nimport { useRichTextView } from '../../../field/RichTextViewProvider.js'\nimport { clearEditorNodeViews, registerEditorNodeViews } from '../../nodes/index.js'\n\n// `LexicalComposer` re-mounts with a new `editor` whenever `currentView` changes,\n// so decorator nodes run their initial `decorate()` before this effect registers the view's overrides.\n// Mark existing block decorators dirty after registering so they re-decorate with the resolved custom `Block` component.\nfunction refreshBlockDecorators(editor: ReturnType<typeof useLexicalComposerContext>[0]): void {\n editor.update(() => {\n const walk = (node: LexicalNode): void => {\n const type = node.getType()\n if (type === 'block' || type === 'inlineBlock') {\n node.markDirty()\n }\n if ('getChildren' in node && typeof node.getChildren === 'function') {\n for (const child of node.getChildren() as LexicalNode[]) {\n walk(child)\n }\n }\n }\n walk($getRoot())\n })\n}\n\nexport function NodeViewOverridePlugin(): null {\n const [editor] = useLexicalComposerContext()\n const { currentView, views } = useRichTextView()\n\n useEffect(() => {\n if (!views) {\n return\n }\n\n if (currentView === 'default') {\n if (views.default) {\n registerEditorNodeViews(editor, views.default?.nodes)\n } else {\n clearEditorNodeViews(editor)\n }\n } else if (views[currentView]) {\n clearEditorNodeViews(editor)\n registerEditorNodeViews(editor, views[currentView]?.nodes)\n }\n\n refreshBlockDecorators(editor)\n }, [editor, views, currentView])\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AACA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,QAAQ,QAA0B;AAC3C,SAASC,SAAS,QAAQ;AAE1B,SAASC,eAAe,QAAQ;AAChC,SAASC,oBAAoB,EAAEC,uBAAuB,QAAQ;AAE9D;AACA;AACA;AACA,SAASC,uBAAuBC,MAAuD;EACrFA,MAAA,CAAOC,MAAM,CAAC;IACZ,MAAMC,IAAA,GAAQC,IAAA;MACZ,MAAMC,IAAA,GAAOD,IAAA,CAAKE,OAAO;MACzB,IAAID,IAAA,KAAS,WAAWA,IAAA,KAAS,eAAe;QAC9CD,IAAA,CAAKG,SAAS;MAChB;MACA,IAAI,iBAAiBH,IAAA,IAAQ,OAAOA,IAAA,CAAKI,WAAW,KAAK,YAAY;QACnE,KAAK,MAAMC,KAAA,IAASL,IAAA,CAAKI,WAAW,IAAqB;UACvDL,IAAA,CAAKM,KAAA;QACP;MACF;IACF;IACAN,IAAA,CAAKR,QAAA;EACP;AACF;AAEA,OAAO,SAAAe,uBAAA;EAAA,MAAAC,CAAA,GAAAlB,EAAA;EACL,OAAAQ,MAAA,IAAiBP,yBAAA;EACjB;IAAAkB,WAAA;IAAAC;EAAA,IAA+BhB,eAAA;EAAA,IAAAiB,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAJ,CAAA,QAAAC,WAAA,IAAAD,CAAA,QAAAV,MAAA,IAAAU,CAAA,QAAAE,KAAA;IAErBC,EAAA,GAAAA,CAAA;MAAA,KACHD,KAAA;QAAA;MAAA;MAAA,IAIDD,WAAA,KAAgB;QAAA,IACdC,KAAA,CAAAG,OAAA;UACFjB,uBAAA,CAAwBE,MAAA,EAAQY,KAAA,CAAAG,OAAA,EAAAC,KAAe;QAAA;UAE/CnB,oBAAA,CAAqBG,MAAA;QAAA;MAAA;QAAA,IAEdY,KAAK,CAACD,WAAA;UACfd,oBAAA,CAAqBG,MAAA;UACrBF,uBAAA,CAAwBE,MAAA,EAAQY,KAAK,CAACD,WAAA,GAAAK,KAAc;QAAA;MAAA;MAGtDjB,sBAAA,CAAuBC,MAAA;IAAA;IACtBc,EAAA,IAACd,MAAA,EAAQY,KAAA,EAAOD,WAAA;IAAYD,CAAA,MAAAC,WAAA;IAAAD,CAAA,MAAAV,MAAA;IAAAU,CAAA,MAAAE,KAAA;IAAAF,CAAA,MAAAG,EAAA;IAAAH,CAAA,MAAAI,EAAA;EAAA;IAAAD,EAAA,GAAAH,CAAA;IAAAI,EAAA,GAAAJ,CAAA;EAAA;EAjB/Bf,SAAA,CAAUkB,EAiBV,EAAGC,EAA4B;EAAA;AAAA","ignoreList":[]}
|
|
@@ -12,7 +12,6 @@ export type MenuRenderFn = (anchorElementRef: RefObject<HTMLElement | null>, ite
|
|
|
12
12
|
selectItemAndCleanUp: (selectedItem: SlashMenuItem) => void;
|
|
13
13
|
setSelectedItemKey: (itemKey: string) => void;
|
|
14
14
|
}, matchingString: null | string) => JSX.Element | null | ReactPortal;
|
|
15
|
-
export declare function getScrollParent(element: HTMLElement, includeHidden: boolean): HTMLBodyElement | HTMLElement;
|
|
16
15
|
export declare function useDynamicPositioning(resolution: MenuResolution | null, targetElementRef: RefObject<HTMLElement | null>, onReposition: () => void, onVisibilityChange?: (isInView: boolean) => void): void;
|
|
17
16
|
export declare const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{
|
|
18
17
|
index: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LexicalMenu.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,cAAc,EAAE,aAAa,EAAY,MAAM,SAAS,CAAA;AACrF,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAmBxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAI9F,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,OAAO,CAAA;IACtB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,CAAA;AAID,MAAM,MAAM,YAAY,GAAG,CACzB,gBAAgB,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAC/C,SAAS,EAAE;IACT,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAA;IACrC,eAAe,EAAE,IAAI,GAAG,MAAM,CAAA;IAC9B,oBAAoB,EAAE,CAAC,YAAY,EAAE,aAAa,KAAK,IAAI,CAAA;IAC3D,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9C,EACD,cAAc,EAAE,IAAI,GAAG,MAAM,KAC1B,GAAG,CAAC,OAAO,GAAG,IAAI,GAAG,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"LexicalMenu.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,cAAc,EAAE,aAAa,EAAY,MAAM,SAAS,CAA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E;IACD,gBAAgB,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC/C,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,MAAM,EAAE,aAAa,CAAA;IACrB,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAA;IACrC,YAAY,EAAE,YAAY,CAAA;IAC1B,UAAU,EAAE,cAAc,CAAA;IAC1B,wBAAwB,CAAC,EAAE,OAAO,CAAA;CACnC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAuOrB;AAYD,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,cAAc,GAAG,IAAI,EACjC,aAAa,EAAE,CAAC,CAAC,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,EACjD,SAAS,CAAC,EAAE,MAAM,GACjB,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAoG/B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
4
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
|
|
5
|
-
import { mergeRegister } from '@lexical/utils';
|
|
5
|
+
import { getScrollParent, mergeRegister } from '@lexical/utils';
|
|
6
6
|
import { $getSelection, $isRangeSelection, $setSelection, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, createCommand, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND } from 'lexical';
|
|
7
7
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
8
8
|
import { CAN_USE_DOM } from '../../../utils/canUseDOM.js';
|
|
@@ -73,25 +73,6 @@ function $splitNodeContainingQuery(match) {
|
|
|
73
73
|
}
|
|
74
74
|
return newNode;
|
|
75
75
|
}
|
|
76
|
-
// Got from https://stackoverflow.com/a/42543908/2013580
|
|
77
|
-
export function getScrollParent(element, includeHidden) {
|
|
78
|
-
let style = getComputedStyle(element);
|
|
79
|
-
const excludeStaticParent = style.position === 'absolute';
|
|
80
|
-
const overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/;
|
|
81
|
-
if (style.position === 'fixed') {
|
|
82
|
-
return document.body;
|
|
83
|
-
}
|
|
84
|
-
for (let parent1 = element; parent1 = parent1.parentElement;) {
|
|
85
|
-
style = getComputedStyle(parent1);
|
|
86
|
-
if (excludeStaticParent && style.position === 'static') {
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) {
|
|
90
|
-
return parent1;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return document.body;
|
|
94
|
-
}
|
|
95
76
|
function isTriggerVisibleInNearestScrollContainer(targetElement, containerElement) {
|
|
96
77
|
const tRect = targetElement.getBoundingClientRect();
|
|
97
78
|
const cRect = containerElement.getBoundingClientRect();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LexicalMenu.js","names":["c","_c","useLexicalComposerContext","mergeRegister","$getSelection","$isRangeSelection","$setSelection","COMMAND_PRIORITY_LOW","COMMAND_PRIORITY_NORMAL","createCommand","KEY_ARROW_DOWN_COMMAND","KEY_ARROW_UP_COMMAND","KEY_ENTER_COMMAND","KEY_ESCAPE_COMMAND","KEY_TAB_COMMAND","useCallback","useEffect","useLayoutEffect","useMemo","useRef","useState","CAN_USE_DOM","baseClass","scrollIntoViewIfNeeded","target","typeaheadContainerNode","document","getElementById","typeaheadRect","getBoundingClientRect","top","height","window","innerHeight","scrollIntoView","block","getFullMatchOffset","documentText","entryText","offset","triggerOffset","i","length","substring","$splitNodeContainingQuery","match","selection","isCollapsed","anchor","type","anchorNode","getNode","isSimpleText","selectionOffset","textContent","getTextContent","slice","characterOffset","replaceableString","queryOffset","matchingString","startOffset","newNode","splitText","getScrollParent","element","includeHidden","style","getComputedStyle","excludeStaticParent","position","overflowRegex","body","parent1","parentElement","test","overflow","overflowY","overflowX","isTriggerVisibleInNearestScrollContainer","targetElement","containerElement","tRect","cRect","bottom","useDynamicPositioning","resolution","targetElementRef","onReposition","onVisibilityChange","$","editor","t0","t1","current","rootElement","getRootElement","rootScrollParent","ticking","previousIsInView","handleScroll","requestAnimationFrame","isInView","resizeObserver","ResizeObserver","addEventListener","capture","passive","observe","disconnect","removeEventListener","SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND","LexicalMenu","anchorElementRef","close","groups","menuRenderFn","shouldSplitNodeWithQuery","selectedItemKey","setSelectedItemKey","updateSelectedItem","item","rootElem","setAttribute","key","setSelectedItemKeyToFirstMatchingItem","allItems","flatMap","group","items","firstMatchingItem","selectItemAndCleanUp","selectedItem","update","textNodeContainingQuery","remove","setTimeout","read","clone","onSelect","queryString","removeAttribute","registerCommand","ref","payload","event","selectedIndex","findIndex","newSelectedIndex","newSelectedItem","dispatchCommand","index","preventDefault","stopImmediatePropagation","find","listItemProps","setContainerDivAttributes","containerDiv","className","display","useMenuAnchorRef","anchorElem","setResolution","Symbol","for","createElement","parent","undefined","menuEle","firstChild","width","getRect","left","rawTop","scrollY","scrollX","menuRect","menuHeight","menuWidth","rootElementRect","isRTL","dir","documentElement","anchorRect","leftBoundary","Math","max","right","newLeft","wouldGoOffBottomOfScreen","wouldGoOffTopOfScreen","isConnected","append","positionMenu","t2","t3","rootElement_0","containerDiv_0","t4"],"sources":["../../../../../src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx"],"sourcesContent":["'use client'\nimport type { BaseSelection, LexicalCommand, LexicalEditor, TextNode } from 'lexical'\nimport type { JSX, ReactPortal, RefObject } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { mergeRegister } from '@lexical/utils'\nimport {\n $getSelection,\n $isRangeSelection,\n $setSelection,\n COMMAND_PRIORITY_LOW,\n COMMAND_PRIORITY_NORMAL,\n createCommand,\n KEY_ARROW_DOWN_COMMAND,\n KEY_ARROW_UP_COMMAND,\n KEY_ENTER_COMMAND,\n KEY_ESCAPE_COMMAND,\n KEY_TAB_COMMAND,\n} from 'lexical'\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'\n\nimport type { MenuTextMatch } from '../useMenuTriggerMatch.js'\nimport type { SlashMenuGroupInternal, SlashMenuItem, SlashMenuItemInternal } from './types.js'\n\nimport { CAN_USE_DOM } from '../../../utils/canUseDOM.js'\n\nexport type MenuResolution = {\n getRect: () => DOMRect\n match?: MenuTextMatch\n}\n\nconst baseClass = 'slash-menu-popup'\n\nexport type MenuRenderFn = (\n anchorElementRef: RefObject<HTMLElement | null>,\n itemProps: {\n groups: Array<SlashMenuGroupInternal>\n selectedItemKey: null | string\n selectItemAndCleanUp: (selectedItem: SlashMenuItem) => void\n setSelectedItemKey: (itemKey: string) => void\n },\n matchingString: null | string,\n) => JSX.Element | null | ReactPortal\n\nconst scrollIntoViewIfNeeded = (target: HTMLElement) => {\n const typeaheadContainerNode = document.getElementById('slash-menu')\n if (!typeaheadContainerNode) {\n return\n }\n\n const typeaheadRect = typeaheadContainerNode.getBoundingClientRect()\n\n if (typeaheadRect.top + typeaheadRect.height > window.innerHeight) {\n typeaheadContainerNode.scrollIntoView({\n block: 'center',\n })\n }\n\n if (typeaheadRect.top < 0) {\n typeaheadContainerNode.scrollIntoView({\n block: 'center',\n })\n }\n\n target.scrollIntoView({ block: 'nearest' })\n}\n\n/**\n * Walk backwards along user input and forward through entity title to try\n * and replace more of the user's text with entity.\n */\nfunction getFullMatchOffset(documentText: string, entryText: string, offset: number) {\n let triggerOffset = offset\n for (let i = triggerOffset; i <= entryText.length; i++) {\n if (documentText.substring(documentText.length - i) === entryText.substring(0, i)) {\n triggerOffset = i\n }\n }\n return triggerOffset\n}\n\n/**\n * Split Lexical TextNode and return a new TextNode only containing matched text.\n * Common use cases include: removing the node, replacing with a new node.\n */\nfunction $splitNodeContainingQuery(match: MenuTextMatch): TextNode | undefined {\n const selection = $getSelection()\n if (!$isRangeSelection(selection) || !selection.isCollapsed()) {\n return\n }\n const anchor = selection.anchor\n if (anchor.type !== 'text') {\n return\n }\n const anchorNode = anchor.getNode()\n if (!anchorNode.isSimpleText()) {\n return\n }\n const selectionOffset = anchor.offset\n const textContent = anchorNode.getTextContent().slice(0, selectionOffset)\n const characterOffset = match.replaceableString.length\n const queryOffset = getFullMatchOffset(textContent, match.matchingString, characterOffset)\n const startOffset = selectionOffset - queryOffset\n if (startOffset < 0) {\n return\n }\n let newNode\n if (startOffset === 0) {\n ;[newNode] = anchorNode.splitText(selectionOffset)\n } else {\n ;[, newNode] = anchorNode.splitText(startOffset, selectionOffset)\n }\n\n return newNode\n}\n\n// Got from https://stackoverflow.com/a/42543908/2013580\nexport function getScrollParent(\n element: HTMLElement,\n includeHidden: boolean,\n): HTMLBodyElement | HTMLElement {\n let style = getComputedStyle(element)\n const excludeStaticParent = style.position === 'absolute'\n const overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/\n if (style.position === 'fixed') {\n return document.body\n }\n for (let parent: HTMLElement | null = element; (parent = parent.parentElement); ) {\n style = getComputedStyle(parent)\n if (excludeStaticParent && style.position === 'static') {\n continue\n }\n if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) {\n return parent\n }\n }\n return document.body\n}\n\nfunction isTriggerVisibleInNearestScrollContainer(\n targetElement: HTMLElement,\n containerElement: HTMLElement,\n): boolean {\n const tRect = targetElement.getBoundingClientRect()\n const cRect = containerElement.getBoundingClientRect()\n return tRect.top > cRect.top && tRect.top < cRect.bottom\n}\n\n// Reposition the menu on scroll, window resize, and element resize.\nexport function useDynamicPositioning(\n resolution: MenuResolution | null,\n targetElementRef: RefObject<HTMLElement | null>,\n onReposition: () => void,\n onVisibilityChange?: (isInView: boolean) => void,\n) {\n const [editor] = useLexicalComposerContext()\n useEffect(() => {\n const targetElement = targetElementRef.current\n if (targetElement != null && resolution != null) {\n const rootElement = editor.getRootElement()\n const rootScrollParent =\n rootElement != null ? getScrollParent(rootElement, false) : document.body\n let ticking = false\n let previousIsInView = isTriggerVisibleInNearestScrollContainer(\n targetElement,\n rootScrollParent,\n )\n const handleScroll = function () {\n if (!ticking) {\n window.requestAnimationFrame(function () {\n onReposition()\n ticking = false\n })\n ticking = true\n }\n const isInView = isTriggerVisibleInNearestScrollContainer(targetElement, rootScrollParent)\n if (isInView !== previousIsInView) {\n previousIsInView = isInView\n if (onVisibilityChange != null) {\n onVisibilityChange(isInView)\n }\n }\n }\n const resizeObserver = new ResizeObserver(onReposition)\n window.addEventListener('resize', onReposition)\n document.addEventListener('scroll', handleScroll, {\n capture: true,\n passive: true,\n })\n resizeObserver.observe(targetElement)\n return () => {\n resizeObserver.disconnect()\n window.removeEventListener('resize', onReposition)\n document.removeEventListener('scroll', handleScroll, true)\n }\n }\n }, [editor, onVisibilityChange, onReposition, resolution, targetElementRef])\n}\n\nexport const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{\n index: number\n item: SlashMenuItemInternal\n}> = createCommand('SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND')\n\nexport function LexicalMenu({\n anchorElementRef,\n close,\n editor,\n // groups filtering is already handled in SlashMenu/index.tsx. Thus, groups always contains the matching items.\n groups,\n menuRenderFn,\n resolution,\n shouldSplitNodeWithQuery = false,\n}: {\n anchorElementRef: RefObject<HTMLElement | null>\n close: () => void\n editor: LexicalEditor\n groups: Array<SlashMenuGroupInternal>\n menuRenderFn: MenuRenderFn\n resolution: MenuResolution\n shouldSplitNodeWithQuery?: boolean\n}): JSX.Element | null {\n const [selectedItemKey, setSelectedItemKey] = useState<null | string>(null)\n\n const matchingString = (resolution.match && resolution.match.matchingString) || ''\n\n const updateSelectedItem = useCallback(\n (item: SlashMenuItem) => {\n const rootElem = editor.getRootElement()\n if (rootElem !== null) {\n rootElem.setAttribute('aria-activedescendant', `${baseClass}__item-${item.key}`)\n setSelectedItemKey(item.key)\n }\n },\n [editor],\n )\n\n const setSelectedItemKeyToFirstMatchingItem = useCallback(() => {\n // set selected item to the first of the matching ones\n if (groups !== null && matchingString != null) {\n // groups filtering is already handled in SlashMenu/index.tsx. Thus, groups always contains the matching items.\n const allItems = groups.flatMap((group) => group.items)\n\n if (allItems.length) {\n const firstMatchingItem = allItems[0]!\n updateSelectedItem(firstMatchingItem)\n }\n }\n }, [groups, updateSelectedItem, matchingString])\n\n useEffect(() => {\n setSelectedItemKeyToFirstMatchingItem()\n }, [matchingString, setSelectedItemKeyToFirstMatchingItem])\n\n const selectItemAndCleanUp = useCallback(\n (selectedItem: SlashMenuItem) => {\n close()\n\n editor.update(() => {\n const textNodeContainingQuery =\n resolution.match != null && shouldSplitNodeWithQuery\n ? $splitNodeContainingQuery(resolution.match)\n : null\n\n if (textNodeContainingQuery) {\n textNodeContainingQuery.remove()\n }\n })\n\n setTimeout(() => {\n // Needed in Firefox. See https://github.com/payloadcms/payload/issues/10724\n let selection: BaseSelection | undefined\n editor.read(() => {\n selection = $getSelection()?.clone()\n })\n editor.update(() => {\n if (selection) {\n $setSelection(selection)\n }\n })\n\n selectedItem.onSelect({\n editor,\n queryString: resolution.match ? resolution.match.matchingString : '',\n })\n }, 0)\n },\n [editor, shouldSplitNodeWithQuery, resolution.match, close],\n )\n\n useEffect(() => {\n return () => {\n const rootElem = editor.getRootElement()\n if (rootElem !== null) {\n rootElem.removeAttribute('aria-activedescendant')\n }\n }\n }, [editor])\n\n useLayoutEffect(() => {\n if (groups === null) {\n setSelectedItemKey(null)\n } else if (selectedItemKey === null) {\n setSelectedItemKeyToFirstMatchingItem()\n }\n }, [groups, selectedItemKey, updateSelectedItem, setSelectedItemKeyToFirstMatchingItem])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND,\n ({ item }) => {\n if (item.ref && item.ref.current != null) {\n scrollIntoViewIfNeeded(item.ref.current)\n return true\n }\n\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n )\n }, [editor, updateSelectedItem])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<KeyboardEvent>(\n KEY_ARROW_DOWN_COMMAND,\n (payload) => {\n const event = payload\n if (groups !== null && groups.length && selectedItemKey !== null) {\n const allItems = groups.flatMap((group) => group.items)\n const selectedIndex = allItems.findIndex((item) => item.key === selectedItemKey)\n\n const newSelectedIndex = selectedIndex !== allItems.length - 1 ? selectedIndex + 1 : 0\n\n const newSelectedItem = allItems[newSelectedIndex]\n if (!newSelectedItem) {\n return false\n }\n\n updateSelectedItem(newSelectedItem)\n if (newSelectedItem.ref != null && newSelectedItem.ref.current) {\n editor.dispatchCommand(SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND, {\n index: newSelectedIndex,\n item: newSelectedItem,\n })\n }\n event.preventDefault()\n event.stopImmediatePropagation()\n }\n return true\n },\n COMMAND_PRIORITY_NORMAL,\n ),\n editor.registerCommand<KeyboardEvent>(\n KEY_ARROW_UP_COMMAND,\n (payload) => {\n const event = payload\n if (groups !== null && groups.length && selectedItemKey !== null) {\n const allItems = groups.flatMap((group) => group.items)\n const selectedIndex = allItems.findIndex((item) => item.key === selectedItemKey)\n\n const newSelectedIndex = selectedIndex !== 0 ? selectedIndex - 1 : allItems.length - 1\n\n const newSelectedItem = allItems[newSelectedIndex]\n if (!newSelectedItem) {\n return false\n }\n\n updateSelectedItem(newSelectedItem)\n if (newSelectedItem.ref != null && newSelectedItem.ref.current) {\n scrollIntoViewIfNeeded(newSelectedItem.ref.current)\n }\n event.preventDefault()\n event.stopImmediatePropagation()\n }\n return true\n },\n COMMAND_PRIORITY_NORMAL,\n ),\n editor.registerCommand<KeyboardEvent>(\n KEY_ESCAPE_COMMAND,\n (payload) => {\n const event = payload\n event.preventDefault()\n event.stopImmediatePropagation()\n close()\n return true\n },\n COMMAND_PRIORITY_LOW,\n ),\n editor.registerCommand<KeyboardEvent>(\n KEY_TAB_COMMAND,\n (payload) => {\n const event = payload\n\n if (groups === null || selectedItemKey === null) {\n return false\n }\n const allItems = groups.flatMap((group) => group.items)\n const selectedItem = allItems.find((item) => item.key === selectedItemKey)\n if (!selectedItem) {\n return false\n }\n\n event.preventDefault()\n event.stopImmediatePropagation()\n selectItemAndCleanUp(selectedItem)\n return true\n },\n COMMAND_PRIORITY_NORMAL,\n ),\n editor.registerCommand(\n KEY_ENTER_COMMAND,\n (event: KeyboardEvent | null) => {\n if (groups === null || selectedItemKey === null) {\n return false\n }\n const allItems = groups.flatMap((group) => group.items)\n const selectedItem = allItems.find((item) => item.key === selectedItemKey)\n if (!selectedItem) {\n return false\n }\n\n if (event !== null) {\n event.preventDefault()\n event.stopImmediatePropagation()\n }\n selectItemAndCleanUp(selectedItem)\n return true\n },\n COMMAND_PRIORITY_NORMAL,\n ),\n )\n }, [selectItemAndCleanUp, close, editor, groups, selectedItemKey, updateSelectedItem])\n\n const listItemProps = useMemo(\n () => ({\n groups,\n selectedItemKey,\n selectItemAndCleanUp,\n setSelectedItemKey,\n }),\n [selectItemAndCleanUp, selectedItemKey, groups],\n )\n\n return menuRenderFn(\n anchorElementRef,\n listItemProps,\n resolution.match ? resolution.match.matchingString : '',\n )\n}\n\nfunction setContainerDivAttributes(containerDiv: HTMLElement, className?: string) {\n if (className != null) {\n containerDiv.className = className\n }\n containerDiv.setAttribute('aria-label', 'Slash menu')\n containerDiv.setAttribute('role', 'listbox')\n containerDiv.style.display = 'block'\n containerDiv.style.position = 'absolute'\n}\n\nexport function useMenuAnchorRef(\n anchorElem: HTMLElement,\n resolution: MenuResolution | null,\n setResolution: (r: MenuResolution | null) => void,\n className?: string,\n): RefObject<HTMLElement | null> {\n const [editor] = useLexicalComposerContext()\n const anchorElementRef = useRef<HTMLElement | null>(\n CAN_USE_DOM ? document.createElement('div') : null,\n )\n const positionMenu = useCallback(() => {\n if (anchorElementRef.current === null || parent === undefined) {\n return\n }\n const rootElement = editor.getRootElement()\n const containerDiv = anchorElementRef.current\n\n const VERTICAL_OFFSET = 32\n\n const menuEle = containerDiv.firstChild as Element\n if (rootElement !== null && resolution !== null) {\n const { height, width } = resolution.getRect()\n let { left, top } = resolution.getRect()\n\n const rawTop = top\n top -= anchorElem.getBoundingClientRect().top + window.scrollY\n left -= anchorElem.getBoundingClientRect().left + window.scrollX\n containerDiv.style.left = `${left + window.scrollX}px`\n containerDiv.style.height = `${height}px`\n containerDiv.style.width = `${width}px`\n if (menuEle !== null) {\n const menuRect = menuEle.getBoundingClientRect()\n const menuHeight = menuRect.height\n const menuWidth = menuRect.width\n\n const rootElementRect = rootElement.getBoundingClientRect()\n\n const isRTL = document.dir === 'rtl' || document.documentElement.dir === 'rtl'\n const anchorRect = anchorElem.getBoundingClientRect()\n const leftBoundary = Math.max(0, rootElementRect.left)\n\n if (!isRTL && left + menuWidth > rootElementRect.right) {\n containerDiv.style.left = `${rootElementRect.right - menuWidth + window.scrollX}px`\n } else if (isRTL && menuRect.left < leftBoundary) {\n const newLeft = leftBoundary + menuWidth - anchorRect.left\n containerDiv.style.left = `${newLeft + window.scrollX}px`\n }\n\n const wouldGoOffBottomOfScreen = rawTop + menuHeight + VERTICAL_OFFSET > window.innerHeight\n //const wouldGoOffBottomOfContainer = top + menuHeight > rootElementRect.bottom\n const wouldGoOffTopOfScreen = rawTop < 0\n\n // Position slash menu above the cursor instead of below (default) if it would otherwise go off the bottom of the screen.\n if (wouldGoOffBottomOfScreen && !wouldGoOffTopOfScreen) {\n const margin = 24\n containerDiv.style.top = `${\n top + VERTICAL_OFFSET - menuHeight + window.scrollY - (height + margin)\n }px`\n } else {\n containerDiv.style.top = `${top + window.scrollY + VERTICAL_OFFSET}px`\n }\n }\n\n if (!containerDiv.isConnected) {\n setContainerDivAttributes(containerDiv, className)\n anchorElem.append(containerDiv)\n }\n containerDiv.setAttribute('id', 'slash-menu')\n anchorElementRef.current = containerDiv\n rootElement.setAttribute('aria-controls', 'slash-menu')\n }\n }, [editor, resolution, className, anchorElem])\n\n useEffect(() => {\n const rootElement = editor.getRootElement()\n if (resolution !== null) {\n positionMenu()\n return () => {\n if (rootElement !== null) {\n rootElement.removeAttribute('aria-controls')\n }\n\n const containerDiv = anchorElementRef.current\n if (containerDiv !== null && containerDiv.isConnected) {\n containerDiv.remove()\n containerDiv.removeAttribute('id')\n }\n }\n }\n }, [editor, positionMenu, resolution])\n\n const onVisibilityChange = useCallback(\n (isInView: boolean) => {\n if (resolution !== null) {\n if (!isInView) {\n setResolution(null)\n }\n }\n },\n [resolution, setResolution],\n )\n\n useDynamicPositioning(resolution, anchorElementRef, positionMenu, onVisibilityChange)\n\n return anchorElementRef\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAIA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,aAAa,QAAQ;AAC9B,SACEC,aAAa,EACbC,iBAAiB,EACjBC,aAAa,EACbC,oBAAoB,EACpBC,uBAAuB,EACvBC,aAAa,EACbC,sBAAsB,EACtBC,oBAAoB,EACpBC,iBAAiB,EACjBC,kBAAkB,EAClBC,eAAe,QACV;AACP,SAASC,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAKnF,SAASC,WAAW,QAAQ;AAO5B,MAAMC,SAAA,GAAY;AAalB,MAAMC,sBAAA,GAA0BC,MAAA;EAC9B,MAAMC,sBAAA,GAAyBC,QAAA,CAASC,cAAc,CAAC;EACvD,IAAI,CAACF,sBAAA,EAAwB;IAC3B;EACF;EAEA,MAAMG,aAAA,GAAgBH,sBAAA,CAAuBI,qBAAqB;EAElE,IAAID,aAAA,CAAcE,GAAG,GAAGF,aAAA,CAAcG,MAAM,GAAGC,MAAA,CAAOC,WAAW,EAAE;IACjER,sBAAA,CAAuBS,cAAc,CAAC;MACpCC,KAAA,EAAO;IACT;EACF;EAEA,IAAIP,aAAA,CAAcE,GAAG,GAAG,GAAG;IACzBL,sB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IAAAyG,EAAA,GAAAzG,CAAA;EAAA;EAhBrC1E,SAAA,CAAUkL,EAgBV,EAAGC,EAAkC;EAAA,IAAAG,EAAA;EAAA,IAAA5G,CAAA,SAAAJ,UAAA,IAAAI,CAAA,SAAAwE,aAAA;IAGnCoC,EAAA,GAAAhG,QAAA;MAAA,IACMhB,UAAA,SAAe;QAAA,KACZgB,QAAA;UACH4D,aAAA,KAAc;QAAA;MAAA;IAAA;IAGpBxE,CAAA,OAAAJ,UAAA;IAAAI,CAAA,OAAAwE,aAAA;IAAAxE,CAAA,OAAA4G,EAAA;EAAA;IAAAA,EAAA,GAAA5G,CAAA;EAAA;EAPF,MAAAD,kBAAA,GAA2B6G,EAQE;EAG7BjH,qBAAA,CAAsBC,UAAA,EAAY2B,gBAAA,EAAkBgF,YAAA,EAAcxG,kBAAA;EAAA,OAE3DwB,gBAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"LexicalMenu.js","names":["c","_c","useLexicalComposerContext","getScrollParent","mergeRegister","$getSelection","$isRangeSelection","$setSelection","COMMAND_PRIORITY_LOW","COMMAND_PRIORITY_NORMAL","createCommand","KEY_ARROW_DOWN_COMMAND","KEY_ARROW_UP_COMMAND","KEY_ENTER_COMMAND","KEY_ESCAPE_COMMAND","KEY_TAB_COMMAND","useCallback","useEffect","useLayoutEffect","useMemo","useRef","useState","CAN_USE_DOM","baseClass","scrollIntoViewIfNeeded","target","typeaheadContainerNode","document","getElementById","typeaheadRect","getBoundingClientRect","top","height","window","innerHeight","scrollIntoView","block","getFullMatchOffset","documentText","entryText","offset","triggerOffset","i","length","substring","$splitNodeContainingQuery","match","selection","isCollapsed","anchor","type","anchorNode","getNode","isSimpleText","selectionOffset","textContent","getTextContent","slice","characterOffset","replaceableString","queryOffset","matchingString","startOffset","newNode","splitText","isTriggerVisibleInNearestScrollContainer","targetElement","containerElement","tRect","cRect","bottom","useDynamicPositioning","resolution","targetElementRef","onReposition","onVisibilityChange","$","editor","t0","t1","current","rootElement","getRootElement","rootScrollParent","body","ticking","previousIsInView","handleScroll","requestAnimationFrame","isInView","resizeObserver","ResizeObserver","addEventListener","capture","passive","observe","disconnect","removeEventListener","SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND","LexicalMenu","anchorElementRef","close","groups","menuRenderFn","shouldSplitNodeWithQuery","selectedItemKey","setSelectedItemKey","updateSelectedItem","item","rootElem","setAttribute","key","setSelectedItemKeyToFirstMatchingItem","allItems","flatMap","group","items","firstMatchingItem","selectItemAndCleanUp","selectedItem","update","textNodeContainingQuery","remove","setTimeout","read","clone","onSelect","queryString","removeAttribute","registerCommand","ref","payload","event","selectedIndex","findIndex","newSelectedIndex","newSelectedItem","dispatchCommand","index","preventDefault","stopImmediatePropagation","find","listItemProps","setContainerDivAttributes","containerDiv","className","style","display","position","useMenuAnchorRef","anchorElem","setResolution","Symbol","for","createElement","parent","undefined","menuEle","firstChild","width","getRect","left","rawTop","scrollY","scrollX","menuRect","menuHeight","menuWidth","rootElementRect","isRTL","dir","documentElement","anchorRect","leftBoundary","Math","max","right","newLeft","wouldGoOffBottomOfScreen","wouldGoOffTopOfScreen","isConnected","append","positionMenu","t2","t3","rootElement_0","containerDiv_0","t4"],"sources":["../../../../../src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx"],"sourcesContent":["'use client'\nimport type { BaseSelection, LexicalCommand, LexicalEditor, TextNode } from 'lexical'\nimport type { JSX, ReactPortal, RefObject } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { getScrollParent, mergeRegister } from '@lexical/utils'\nimport {\n $getSelection,\n $isRangeSelection,\n $setSelection,\n COMMAND_PRIORITY_LOW,\n COMMAND_PRIORITY_NORMAL,\n createCommand,\n KEY_ARROW_DOWN_COMMAND,\n KEY_ARROW_UP_COMMAND,\n KEY_ENTER_COMMAND,\n KEY_ESCAPE_COMMAND,\n KEY_TAB_COMMAND,\n} from 'lexical'\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'\n\nimport type { MenuTextMatch } from '../useMenuTriggerMatch.js'\nimport type { SlashMenuGroupInternal, SlashMenuItem, SlashMenuItemInternal } from './types.js'\n\nimport { CAN_USE_DOM } from '../../../utils/canUseDOM.js'\n\nexport type MenuResolution = {\n getRect: () => DOMRect\n match?: MenuTextMatch\n}\n\nconst baseClass = 'slash-menu-popup'\n\nexport type MenuRenderFn = (\n anchorElementRef: RefObject<HTMLElement | null>,\n itemProps: {\n groups: Array<SlashMenuGroupInternal>\n selectedItemKey: null | string\n selectItemAndCleanUp: (selectedItem: SlashMenuItem) => void\n setSelectedItemKey: (itemKey: string) => void\n },\n matchingString: null | string,\n) => JSX.Element | null | ReactPortal\n\nconst scrollIntoViewIfNeeded = (target: HTMLElement) => {\n const typeaheadContainerNode = document.getElementById('slash-menu')\n if (!typeaheadContainerNode) {\n return\n }\n\n const typeaheadRect = typeaheadContainerNode.getBoundingClientRect()\n\n if (typeaheadRect.top + typeaheadRect.height > window.innerHeight) {\n typeaheadContainerNode.scrollIntoView({\n block: 'center',\n })\n }\n\n if (typeaheadRect.top < 0) {\n typeaheadContainerNode.scrollIntoView({\n block: 'center',\n })\n }\n\n target.scrollIntoView({ block: 'nearest' })\n}\n\n/**\n * Walk backwards along user input and forward through entity title to try\n * and replace more of the user's text with entity.\n */\nfunction getFullMatchOffset(documentText: string, entryText: string, offset: number) {\n let triggerOffset = offset\n for (let i = triggerOffset; i <= entryText.length; i++) {\n if (documentText.substring(documentText.length - i) === entryText.substring(0, i)) {\n triggerOffset = i\n }\n }\n return triggerOffset\n}\n\n/**\n * Split Lexical TextNode and return a new TextNode only containing matched text.\n * Common use cases include: removing the node, replacing with a new node.\n */\nfunction $splitNodeContainingQuery(match: MenuTextMatch): TextNode | undefined {\n const selection = $getSelection()\n if (!$isRangeSelection(selection) || !selection.isCollapsed()) {\n return\n }\n const anchor = selection.anchor\n if (anchor.type !== 'text') {\n return\n }\n const anchorNode = anchor.getNode()\n if (!anchorNode.isSimpleText()) {\n return\n }\n const selectionOffset = anchor.offset\n const textContent = anchorNode.getTextContent().slice(0, selectionOffset)\n const characterOffset = match.replaceableString.length\n const queryOffset = getFullMatchOffset(textContent, match.matchingString, characterOffset)\n const startOffset = selectionOffset - queryOffset\n if (startOffset < 0) {\n return\n }\n let newNode\n if (startOffset === 0) {\n ;[newNode] = anchorNode.splitText(selectionOffset)\n } else {\n ;[, newNode] = anchorNode.splitText(startOffset, selectionOffset)\n }\n\n return newNode\n}\n\nfunction isTriggerVisibleInNearestScrollContainer(\n targetElement: HTMLElement,\n containerElement: HTMLElement,\n): boolean {\n const tRect = targetElement.getBoundingClientRect()\n const cRect = containerElement.getBoundingClientRect()\n return tRect.top > cRect.top && tRect.top < cRect.bottom\n}\n\n// Reposition the menu on scroll, window resize, and element resize.\nexport function useDynamicPositioning(\n resolution: MenuResolution | null,\n targetElementRef: RefObject<HTMLElement | null>,\n onReposition: () => void,\n onVisibilityChange?: (isInView: boolean) => void,\n) {\n const [editor] = useLexicalComposerContext()\n useEffect(() => {\n const targetElement = targetElementRef.current\n if (targetElement != null && resolution != null) {\n const rootElement = editor.getRootElement()\n const rootScrollParent =\n rootElement != null ? getScrollParent(rootElement, false) : document.body\n let ticking = false\n let previousIsInView = isTriggerVisibleInNearestScrollContainer(\n targetElement,\n rootScrollParent,\n )\n const handleScroll = function () {\n if (!ticking) {\n window.requestAnimationFrame(function () {\n onReposition()\n ticking = false\n })\n ticking = true\n }\n const isInView = isTriggerVisibleInNearestScrollContainer(targetElement, rootScrollParent)\n if (isInView !== previousIsInView) {\n previousIsInView = isInView\n if (onVisibilityChange != null) {\n onVisibilityChange(isInView)\n }\n }\n }\n const resizeObserver = new ResizeObserver(onReposition)\n window.addEventListener('resize', onReposition)\n document.addEventListener('scroll', handleScroll, {\n capture: true,\n passive: true,\n })\n resizeObserver.observe(targetElement)\n return () => {\n resizeObserver.disconnect()\n window.removeEventListener('resize', onReposition)\n document.removeEventListener('scroll', handleScroll, true)\n }\n }\n }, [editor, onVisibilityChange, onReposition, resolution, targetElementRef])\n}\n\nexport const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{\n index: number\n item: SlashMenuItemInternal\n}> = createCommand('SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND')\n\nexport function LexicalMenu({\n anchorElementRef,\n close,\n editor,\n // groups filtering is already handled in SlashMenu/index.tsx. Thus, groups always contains the matching items.\n groups,\n menuRenderFn,\n resolution,\n shouldSplitNodeWithQuery = false,\n}: {\n anchorElementRef: RefObject<HTMLElement | null>\n close: () => void\n editor: LexicalEditor\n groups: Array<SlashMenuGroupInternal>\n menuRenderFn: MenuRenderFn\n resolution: MenuResolution\n shouldSplitNodeWithQuery?: boolean\n}): JSX.Element | null {\n const [selectedItemKey, setSelectedItemKey] = useState<null | string>(null)\n\n const matchingString = (resolution.match && resolution.match.matchingString) || ''\n\n const updateSelectedItem = useCallback(\n (item: SlashMenuItem) => {\n const rootElem = editor.getRootElement()\n if (rootElem !== null) {\n rootElem.setAttribute('aria-activedescendant', `${baseClass}__item-${item.key}`)\n setSelectedItemKey(item.key)\n }\n },\n [editor],\n )\n\n const setSelectedItemKeyToFirstMatchingItem = useCallback(() => {\n // set selected item to the first of the matching ones\n if (groups !== null && matchingString != null) {\n // groups filtering is already handled in SlashMenu/index.tsx. Thus, groups always contains the matching items.\n const allItems = groups.flatMap((group) => group.items)\n\n if (allItems.length) {\n const firstMatchingItem = allItems[0]!\n updateSelectedItem(firstMatchingItem)\n }\n }\n }, [groups, updateSelectedItem, matchingString])\n\n useEffect(() => {\n setSelectedItemKeyToFirstMatchingItem()\n }, [matchingString, setSelectedItemKeyToFirstMatchingItem])\n\n const selectItemAndCleanUp = useCallback(\n (selectedItem: SlashMenuItem) => {\n close()\n\n editor.update(() => {\n const textNodeContainingQuery =\n resolution.match != null && shouldSplitNodeWithQuery\n ? $splitNodeContainingQuery(resolution.match)\n : null\n\n if (textNodeContainingQuery) {\n textNodeContainingQuery.remove()\n }\n })\n\n setTimeout(() => {\n // Needed in Firefox. See https://github.com/payloadcms/payload/issues/10724\n let selection: BaseSelection | undefined\n editor.read(() => {\n selection = $getSelection()?.clone()\n })\n editor.update(() => {\n if (selection) {\n $setSelection(selection)\n }\n })\n\n selectedItem.onSelect({\n editor,\n queryString: resolution.match ? resolution.match.matchingString : '',\n })\n }, 0)\n },\n [editor, shouldSplitNodeWithQuery, resolution.match, close],\n )\n\n useEffect(() => {\n return () => {\n const rootElem = editor.getRootElement()\n if (rootElem !== null) {\n rootElem.removeAttribute('aria-activedescendant')\n }\n }\n }, [editor])\n\n useLayoutEffect(() => {\n if (groups === null) {\n setSelectedItemKey(null)\n } else if (selectedItemKey === null) {\n setSelectedItemKeyToFirstMatchingItem()\n }\n }, [groups, selectedItemKey, updateSelectedItem, setSelectedItemKeyToFirstMatchingItem])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND,\n ({ item }) => {\n if (item.ref && item.ref.current != null) {\n scrollIntoViewIfNeeded(item.ref.current)\n return true\n }\n\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n )\n }, [editor, updateSelectedItem])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<KeyboardEvent>(\n KEY_ARROW_DOWN_COMMAND,\n (payload) => {\n const event = payload\n if (groups !== null && groups.length && selectedItemKey !== null) {\n const allItems = groups.flatMap((group) => group.items)\n const selectedIndex = allItems.findIndex((item) => item.key === selectedItemKey)\n\n const newSelectedIndex = selectedIndex !== allItems.length - 1 ? selectedIndex + 1 : 0\n\n const newSelectedItem = allItems[newSelectedIndex]\n if (!newSelectedItem) {\n return false\n }\n\n updateSelectedItem(newSelectedItem)\n if (newSelectedItem.ref != null && newSelectedItem.ref.current) {\n editor.dispatchCommand(SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND, {\n index: newSelectedIndex,\n item: newSelectedItem,\n })\n }\n event.preventDefault()\n event.stopImmediatePropagation()\n }\n return true\n },\n COMMAND_PRIORITY_NORMAL,\n ),\n editor.registerCommand<KeyboardEvent>(\n KEY_ARROW_UP_COMMAND,\n (payload) => {\n const event = payload\n if (groups !== null && groups.length && selectedItemKey !== null) {\n const allItems = groups.flatMap((group) => group.items)\n const selectedIndex = allItems.findIndex((item) => item.key === selectedItemKey)\n\n const newSelectedIndex = selectedIndex !== 0 ? selectedIndex - 1 : allItems.length - 1\n\n const newSelectedItem = allItems[newSelectedIndex]\n if (!newSelectedItem) {\n return false\n }\n\n updateSelectedItem(newSelectedItem)\n if (newSelectedItem.ref != null && newSelectedItem.ref.current) {\n scrollIntoViewIfNeeded(newSelectedItem.ref.current)\n }\n event.preventDefault()\n event.stopImmediatePropagation()\n }\n return true\n },\n COMMAND_PRIORITY_NORMAL,\n ),\n editor.registerCommand<KeyboardEvent>(\n KEY_ESCAPE_COMMAND,\n (payload) => {\n const event = payload\n event.preventDefault()\n event.stopImmediatePropagation()\n close()\n return true\n },\n COMMAND_PRIORITY_LOW,\n ),\n editor.registerCommand<KeyboardEvent>(\n KEY_TAB_COMMAND,\n (payload) => {\n const event = payload\n\n if (groups === null || selectedItemKey === null) {\n return false\n }\n const allItems = groups.flatMap((group) => group.items)\n const selectedItem = allItems.find((item) => item.key === selectedItemKey)\n if (!selectedItem) {\n return false\n }\n\n event.preventDefault()\n event.stopImmediatePropagation()\n selectItemAndCleanUp(selectedItem)\n return true\n },\n COMMAND_PRIORITY_NORMAL,\n ),\n editor.registerCommand(\n KEY_ENTER_COMMAND,\n (event: KeyboardEvent | null) => {\n if (groups === null || selectedItemKey === null) {\n return false\n }\n const allItems = groups.flatMap((group) => group.items)\n const selectedItem = allItems.find((item) => item.key === selectedItemKey)\n if (!selectedItem) {\n return false\n }\n\n if (event !== null) {\n event.preventDefault()\n event.stopImmediatePropagation()\n }\n selectItemAndCleanUp(selectedItem)\n return true\n },\n COMMAND_PRIORITY_NORMAL,\n ),\n )\n }, [selectItemAndCleanUp, close, editor, groups, selectedItemKey, updateSelectedItem])\n\n const listItemProps = useMemo(\n () => ({\n groups,\n selectedItemKey,\n selectItemAndCleanUp,\n setSelectedItemKey,\n }),\n [selectItemAndCleanUp, selectedItemKey, groups],\n )\n\n return menuRenderFn(\n anchorElementRef,\n listItemProps,\n resolution.match ? resolution.match.matchingString : '',\n )\n}\n\nfunction setContainerDivAttributes(containerDiv: HTMLElement, className?: string) {\n if (className != null) {\n containerDiv.className = className\n }\n containerDiv.setAttribute('aria-label', 'Slash menu')\n containerDiv.setAttribute('role', 'listbox')\n containerDiv.style.display = 'block'\n containerDiv.style.position = 'absolute'\n}\n\nexport function useMenuAnchorRef(\n anchorElem: HTMLElement,\n resolution: MenuResolution | null,\n setResolution: (r: MenuResolution | null) => void,\n className?: string,\n): RefObject<HTMLElement | null> {\n const [editor] = useLexicalComposerContext()\n const anchorElementRef = useRef<HTMLElement | null>(\n CAN_USE_DOM ? document.createElement('div') : null,\n )\n const positionMenu = useCallback(() => {\n if (anchorElementRef.current === null || parent === undefined) {\n return\n }\n const rootElement = editor.getRootElement()\n const containerDiv = anchorElementRef.current\n\n const VERTICAL_OFFSET = 32\n\n const menuEle = containerDiv.firstChild as Element\n if (rootElement !== null && resolution !== null) {\n const { height, width } = resolution.getRect()\n let { left, top } = resolution.getRect()\n\n const rawTop = top\n top -= anchorElem.getBoundingClientRect().top + window.scrollY\n left -= anchorElem.getBoundingClientRect().left + window.scrollX\n containerDiv.style.left = `${left + window.scrollX}px`\n containerDiv.style.height = `${height}px`\n containerDiv.style.width = `${width}px`\n if (menuEle !== null) {\n const menuRect = menuEle.getBoundingClientRect()\n const menuHeight = menuRect.height\n const menuWidth = menuRect.width\n\n const rootElementRect = rootElement.getBoundingClientRect()\n\n const isRTL = document.dir === 'rtl' || document.documentElement.dir === 'rtl'\n const anchorRect = anchorElem.getBoundingClientRect()\n const leftBoundary = Math.max(0, rootElementRect.left)\n\n if (!isRTL && left + menuWidth > rootElementRect.right) {\n containerDiv.style.left = `${rootElementRect.right - menuWidth + window.scrollX}px`\n } else if (isRTL && menuRect.left < leftBoundary) {\n const newLeft = leftBoundary + menuWidth - anchorRect.left\n containerDiv.style.left = `${newLeft + window.scrollX}px`\n }\n\n const wouldGoOffBottomOfScreen = rawTop + menuHeight + VERTICAL_OFFSET > window.innerHeight\n //const wouldGoOffBottomOfContainer = top + menuHeight > rootElementRect.bottom\n const wouldGoOffTopOfScreen = rawTop < 0\n\n // Position slash menu above the cursor instead of below (default) if it would otherwise go off the bottom of the screen.\n if (wouldGoOffBottomOfScreen && !wouldGoOffTopOfScreen) {\n const margin = 24\n containerDiv.style.top = `${\n top + VERTICAL_OFFSET - menuHeight + window.scrollY - (height + margin)\n }px`\n } else {\n containerDiv.style.top = `${top + window.scrollY + VERTICAL_OFFSET}px`\n }\n }\n\n if (!containerDiv.isConnected) {\n setContainerDivAttributes(containerDiv, className)\n anchorElem.append(containerDiv)\n }\n containerDiv.setAttribute('id', 'slash-menu')\n anchorElementRef.current = containerDiv\n rootElement.setAttribute('aria-controls', 'slash-menu')\n }\n }, [editor, resolution, className, anchorElem])\n\n useEffect(() => {\n const rootElement = editor.getRootElement()\n if (resolution !== null) {\n positionMenu()\n return () => {\n if (rootElement !== null) {\n rootElement.removeAttribute('aria-controls')\n }\n\n const containerDiv = anchorElementRef.current\n if (containerDiv !== null && containerDiv.isConnected) {\n containerDiv.remove()\n containerDiv.removeAttribute('id')\n }\n }\n }\n }, [editor, positionMenu, resolution])\n\n const onVisibilityChange = useCallback(\n (isInView: boolean) => {\n if (resolution !== null) {\n if (!isInView) {\n setResolution(null)\n }\n }\n },\n [resolution, setResolution],\n )\n\n useDynamicPositioning(resolution, anchorElementRef, positionMenu, onVisibilityChange)\n\n return anchorElementRef\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAIA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,eAAe,EAAEC,aAAa,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AAA4G,EAAA,GAAA5G,CAAA;EAAA;EAhBrC3D,SAAA,CAAUsK,EAgBV,EAAGC,EAAkC;EAAA,IAAAG,EAAA;EAAA,IAAA/G,CAAA,SAAAJ,UAAA,IAAAI,CAAA,SAAA2E,aAAA;IAGnCoC,EAAA,GAAAlG,QAAA;MAAA,IACMjB,UAAA,SAAe;QAAA,KACZiB,QAAA;UACH8D,aAAA,KAAc;QAAA;MAAA;IAAA;IAGpB3E,CAAA,OAAAJ,UAAA;IAAAI,CAAA,OAAA2E,aAAA;IAAA3E,CAAA,OAAA+G,EAAA;EAAA;IAAAA,EAAA,GAAA/G,CAAA;EAAA;EAPF,MAAAD,kBAAA,GAA2BgH,EAQE;EAG7BpH,qBAAA,CAAsBC,UAAA,EAAY4B,gBAAA,EAAkBkF,YAAA,EAAc3G,kBAAA;EAAA,OAE3DyB,gBAAA;AAAA","ignoreList":[]}
|
|
@@ -16,11 +16,7 @@
|
|
|
16
16
|
overflow-y: auto;
|
|
17
17
|
z-index: 10;
|
|
18
18
|
position: absolute;
|
|
19
|
-
box-shadow:
|
|
20
|
-
0 2px 6px 0 rgba(0, 0, 0, 0.12),
|
|
21
|
-
0 10px 16px 0 rgba(0, 0, 0, 0.08),
|
|
22
|
-
0 0 0.5px 0 rgba(0, 0, 0, 0.12),
|
|
23
|
-
0 0 0 1px rgba(0, 0, 0, 0.04);
|
|
19
|
+
box-shadow: var(--elevation-400-menu-panel);
|
|
24
20
|
}
|
|
25
21
|
|
|
26
22
|
.slash-menu-popup__group {
|
|
@@ -46,7 +42,6 @@
|
|
|
46
42
|
border-radius: var(--radius-medium);
|
|
47
43
|
cursor: pointer;
|
|
48
44
|
gap: var(--spacer-1);
|
|
49
|
-
transition: background-color 0.15s cubic-bezier(0, 0.2, 0.2, 1);
|
|
50
45
|
|
|
51
46
|
.icon {
|
|
52
47
|
color: var(--color-icon-secondary);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/debounce.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/debounce.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,MAAM,aAE/C,SAAS,EAAE,UAUtC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
cursor: grab;
|
|
7
7
|
opacity: 0;
|
|
8
8
|
position: absolute;
|
|
9
|
-
|
|
9
|
+
inset-inline-start: 0;
|
|
10
10
|
top: 0;
|
|
11
11
|
will-change: transform;
|
|
12
12
|
background-color: var(--color-bg);
|
|
@@ -46,11 +46,12 @@
|
|
|
46
46
|
|
|
47
47
|
.rich-text-lexical--show-gutter
|
|
48
48
|
> .rich-text-lexical__wrap
|
|
49
|
+
> .rich-text-lexical__editor-content
|
|
49
50
|
> .editor-container
|
|
50
51
|
> .editor-scroller
|
|
51
52
|
> .editor {
|
|
52
53
|
> .draggable-block-target-line {
|
|
53
|
-
|
|
54
|
+
inset-inline-start: var(--spacer-5);
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
border-radius: var(--radius-small);
|
|
61
62
|
height: var(--spacer-1);
|
|
62
63
|
position: absolute;
|
|
63
|
-
|
|
64
|
+
inset-inline-start: 0;
|
|
64
65
|
top: 0;
|
|
65
66
|
opacity: 0;
|
|
66
67
|
will-change: transform;
|
|
@@ -271,7 +271,7 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
|
|
|
271
271
|
}
|
|
272
272
|
const highlightElem = document.createElement('div');
|
|
273
273
|
highlightElem.className = 'lexical-block-highlighter';
|
|
274
|
-
highlightElem.style.backgroundColor = 'var(--
|
|
274
|
+
highlightElem.style.backgroundColor = 'var(--color-bg-inverse)';
|
|
275
275
|
highlightElem.style.transition = 'opacity 0.5s ease-in-out';
|
|
276
276
|
highlightElem.style.zIndex = '1';
|
|
277
277
|
highlightElem.style.pointerEvents = 'none';
|