@payloadcms/richtext-lexical 4.0.0-internal.688c4d0 → 4.0.0-internal.7b031c8
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/exports/client/Field-QGSHF22S.js +2 -0
- package/dist/exports/client/Field-QGSHF22S.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-X3D4LZS7.js +2 -0
- package/dist/exports/client/chunk-X3D4LZS7.js.map +7 -0
- package/dist/exports/client/index.d.ts +0 -2
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +24 -25
- 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/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.css +8 -8
- 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/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/experimental_table/client/index.js +2 -2
- package/dist/features/experimental_table/client/index.js.map +1 -1
- package/dist/features/experimental_table/client/utils/debounce.d.ts.map +1 -1
- package/dist/features/experimental_table/markdownTransformer.d.ts +2 -2
- package/dist/features/experimental_table/markdownTransformer.d.ts.map +1 -1
- package/dist/features/experimental_table/markdownTransformer.js +6 -3
- package/dist/features/experimental_table/markdownTransformer.js.map +1 -1
- package/dist/features/experimental_table/server/index.js +2 -2
- package/dist/features/experimental_table/server/index.js.map +1 -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.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.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 -11
- 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.map +1 -1
- package/dist/features/link/nodes/LinkNode.d.ts.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 +2 -2
- 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/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 -13
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.css +8 -12
- 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 +2 -2
- 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/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 +2 -2
- 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 +14 -15
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -50
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.css +18 -18
- package/dist/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/lexical/LexicalEditor.js +2 -36
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/lexical/LexicalProvider.js +7 -22
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
- package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.css +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/index.css +1 -5
- 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 -13
- 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/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
- package/dist/types/jsonSchemaHelpers.d.ts.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/editorConfigFactory.d.ts.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/generateImportMap.js +3 -7
- package/dist/utilities/generateImportMap.js.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.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 +20 -26
- package/dist/@types/assets.d.js +0 -2
- package/dist/@types/assets.d.js.map +0 -1
- package/dist/exports/client/Field-VYBSMSRY.js +0 -2
- package/dist/exports/client/Field-VYBSMSRY.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/server/rsc.browser.d.ts +0 -11
- package/dist/exports/server/rsc.browser.d.ts.map +0 -1
- package/dist/exports/server/rsc.browser.js +0 -10
- package/dist/exports/server/rsc.browser.js.map +0 -1
- 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/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/field/clientEntry.d.ts +0 -29
- package/dist/field/clientEntry.d.ts.map +0 -1
- package/dist/field/clientEntry.js +0 -86
- package/dist/field/clientEntry.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LexicalProvider.js","names":["LexicalComposer","useEditDepth","React","useMemo","useRichTextView","EditorConfigProvider","useEditorConfigContext","LexicalEditor","LexicalEditorComponent","getEnabledNodes","NestProviders","children","providers","length","Component","_jsx","slice","LexicalProvider","props","composerKey","editorConfig","fieldProps","isSmallWidthViewport","onChange","readOnly","rtl","value","currentView","views","parentContext","editDepth","editorContainerRef","useRef","initialConfig","Error","JSON","stringify","Array","isArray","nodeViews","nodes","editable","editorState","undefined","namespace","lexical","onError","error","theme","
|
|
1
|
+
{"version":3,"file":"LexicalProvider.js","names":["LexicalComposer","useEditDepth","React","useMemo","useRichTextView","EditorConfigProvider","useEditorConfigContext","LexicalEditor","LexicalEditorComponent","getEnabledNodes","NestProviders","children","providers","length","Component","_jsx","slice","LexicalProvider","props","composerKey","editorConfig","fieldProps","isSmallWidthViewport","onChange","readOnly","rtl","value","currentView","views","parentContext","editDepth","editorContainerRef","useRef","initialConfig","Error","JSON","stringify","Array","isArray","nodeViews","nodes","editable","editorState","undefined","namespace","lexical","onError","error","theme","features"],"sources":["../../src/lexical/LexicalProvider.tsx"],"sourcesContent":["'use client'\nimport type { InitialConfigType } from '@lexical/react/LexicalComposer.js'\nimport type { EditorState, LexicalEditor, SerializedEditorState } from 'lexical'\n\nimport { LexicalComposer } from '@lexical/react/LexicalComposer.js'\nimport { useEditDepth } from '@payloadcms/ui'\nimport * as React from 'react'\nimport { useMemo } from 'react'\n\nimport type { LexicalRichTextFieldProps } from '../types/index.js'\nimport type { SanitizedClientEditorConfig } from './config/types.js'\n\nimport { useRichTextView } from '../field/RichTextViewProvider.js'\nimport {\n EditorConfigProvider,\n useEditorConfigContext,\n} from './config/client/EditorConfigProvider.js'\nimport { LexicalEditor as LexicalEditorComponent } from './LexicalEditor.js'\nimport { getEnabledNodes } from './nodes/index.js'\n\nexport type LexicalProviderProps = {\n composerKey: string\n editorConfig: SanitizedClientEditorConfig\n fieldProps: LexicalRichTextFieldProps\n isSmallWidthViewport: boolean\n onChange: (editorState: EditorState, editor: LexicalEditor, tags: Set<string>) => void\n readOnly: boolean\n rtl?: boolean\n value: SerializedEditorState\n}\n\nconst NestProviders = ({\n children,\n providers,\n}: {\n children: React.ReactNode\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n providers: any[]\n}) => {\n if (!providers?.length) {\n return children\n }\n const Component = providers[0]\n if (providers.length > 1) {\n return (\n <Component>\n <NestProviders providers={providers.slice(1)}>{children}</NestProviders>\n </Component>\n )\n }\n return <Component>{children}</Component>\n}\n\nexport const LexicalProvider: React.FC<LexicalProviderProps> = (props) => {\n const {\n composerKey,\n editorConfig,\n fieldProps,\n isSmallWidthViewport,\n onChange,\n readOnly,\n rtl,\n value,\n } = props\n\n const { currentView, views } = useRichTextView()\n\n const parentContext = useEditorConfigContext()\n\n const editDepth = useEditDepth()\n\n const editorContainerRef = React.useRef<HTMLDivElement>(null)\n\n // useMemo for the initialConfig that depends on readOnly and value\n const initialConfig = useMemo<InitialConfigType>(() => {\n if (value && typeof value !== 'object') {\n throw new Error(\n 'The value passed to the Lexical editor is not an object. This is not supported. Please remove the data from the field and start again. This is the value that was passed in: ' +\n JSON.stringify(value),\n )\n }\n\n if (value && Array.isArray(value) && !('root' in value)) {\n throw new Error(\n 'You have tried to pass in data from the old Slate editor to the new Lexical editor. The data structure is different, thus you will have to migrate your data. We offer a one-line migration script which migrates all your rich text fields: https://payloadcms.com/docs/lexical/migration#migration-via-migration-script-recommended',\n )\n }\n\n if (value && 'jsonContent' in value) {\n throw new Error(\n 'You have tried to pass in data from payload-plugin-lexical. The data structure is different, thus you will have to migrate your data. Migration guide: https://payloadcms.com/docs/lexical/migration#migrating-from-payload-plugin-lexical',\n )\n }\n\n // Use the 'default' view if available, otherwise undefined\n const nodeViews = views?.[currentView]?.nodes\n\n return {\n editable: readOnly !== true,\n editorState: value != null ? JSON.stringify(value) : undefined,\n namespace: editorConfig.lexical.namespace,\n nodes: getEnabledNodes({\n editorConfig,\n nodeViews,\n }),\n onError: (error: Error) => {\n throw error\n },\n theme: editorConfig.lexical.theme,\n }\n // Important: do not add readOnly and value to the dependencies array. This will cause the entire lexical editor to re-render if the document is saved, which will\n // cause the editor to lose focus.\n }, [editorConfig, views, currentView])\n\n if (!initialConfig) {\n return <p>Loading...</p>\n }\n\n // We need to add initialConfig.editable to the key to force a re-render when the readOnly prop changes.\n // Without it, there were cases where lexical editors inside drawers turn readOnly initially - a few miliseconds later they turn editable, but the editor does not re-render and stays readOnly.\n // We also add currentView to force re-render when the view changes.\n return (\n <LexicalComposer\n initialConfig={initialConfig}\n key={composerKey + initialConfig.editable + currentView}\n >\n <EditorConfigProvider\n editorConfig={editorConfig}\n editorContainerRef={editorContainerRef}\n fieldProps={fieldProps}\n /**\n * Parent editor is not truly the parent editor, if the current editor is part of a drawer and the parent editor is the main editor.\n */\n parentContext={parentContext?.editDepth === editDepth ? parentContext : undefined}\n >\n <NestProviders providers={editorConfig.features.providers}>\n <LexicalEditorComponent\n editorConfig={editorConfig}\n editorContainerRef={editorContainerRef}\n isSmallWidthViewport={isSmallWidthViewport}\n onChange={onChange}\n rtl={rtl}\n />\n </NestProviders>\n </EditorConfig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,oBAAA;UACtBC,QAAA,EAAUA,QAAA;UACVE,GAAA,EAAKA;;;;KAjBNN,WAAA,GAAcc,aAAA,CAAcQ,QAAQ,GAAGd,WAAA;AAuBlD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorConfigProvider.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/client/EditorConfigProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAIjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2DAA2D,CAAA;AAChG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAO9D,MAAM,WAAW,uBAAuB;IAEtC,UAAU,EAAE,CAAC,aAAa,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC5D,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAA;IACtE,kBAAkB,CAAC,EAAE,eAAe,CAAA;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,aAAa,CAAA;IACrB,YAAY,EAAE,2BAA2B,CAAA;IACzC,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;IACnD,UAAU,EAAE,YAAY,CAAC,yBAAyB,EAAE,MAAM,GAAG,YAAY,CAAC,CAAA;IAC1E,aAAa,EAAE,uBAAuB,GAAG,IAAI,CAAA;IAE7C,WAAW,EAAE,CAAC,aAAa,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC7D,YAAY,EAAE,uBAAuB,CAAA;IACrC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE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AC,aAAa,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC7D,YAAY,EAAE,uBAAuB,CAAA;IACrC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC7E,qBAAqB,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC,CAAA;IACzF,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,IAAI,EAAE,MAAM,CAAA;CACb;AASD,eAAO,MAAM,oBAAoB,+EAM9B;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,YAAY,EAAE,2BAA2B,CAAA;IACzC,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAE1D,UAAU,EAAE,yBAAyB,CAAA;IACrC,aAAa,CAAC,EAAE,uBAAuB,CAAA;CACxC,KAAG,KAAK,CAAC,SAoFT,CAAA;AAED,eAAO,MAAM,sBAAsB,QAAO,uBAMzC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/client/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAKlE,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE9D,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/client/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAKlE,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE9D,eAAO,MAAM,sBAAsB,aACvB,wBAAwB,KACjC,uBAiOF,CAAA;AAED,wBAAgB,0BAA0B,CACxC,wBAAwB,EAAE,wBAAwB,EAClD,OAAO,CAAC,EAAE,mBAAmB,EAC7B,KAAK,CAAC,EAAE,4BAA4B,EACpC,IAAI,CAAC,EAAE,MAAM,GACZ,2BAA2B,CAQ7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/server/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIlF,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/server/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIlF,eAAO,MAAM,sBAAsB,aACvB,wBAAwB,KACjC,uBA0HF,CAAA;AAED,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,kBAAkB,EAChC,MAAM,EAAE,eAAe,EACvB,iBAAiB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,2BAA2B,CAAC,CAYtC"}
|
|
@@ -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":"AAA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K,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":[]}
|
|
@@ -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 {
|
|
@@ -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';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useLexicalComposerContext","eventFiles","$getNearestNodeFromDOMNode","$getNodeByKey","isHTMLElement","React","useEffect","useRef","useState","createPortal","useEditorConfigContext","Point","calculateDistanceFromScrollerElem","getNodeCloseToPoint","getTopLevelNodeKeys","isOnHandleElement","setHandlePosition","getBoundingClientRectWithoutTransform","setTargetLine","DRAGGABLE_BLOCK_MENU_CLASSNAME","DRAG_DATA_FORMAT","prevIndex","Infinity","getCurrentIndex","keysLength","Math","floor","setDragImage","dataTransfer","draggableBlockElem","transform","style","setTimeout","hideTargetLine","targetLineElem","lastTargetBlockElem","opacity","marginBottom","marginTop","useDraggableBlockMenu","editor","anchorElem","isEditable","scrollerElem","parentElement","menuRef","targetLineRef","debugHighlightRef","isDraggingBlockRef","highlightTimersRef","setDraggableBlockElem","lastTargetBlock","setLastTargetBlock","editorConfig","blockHandleHorizontalOffset","admin","hideGutter","onDocumentMouseMove","event","target","distanceFromScrollerElem","pageX","pageY","topLevelNodeKeys","blockElem","_draggableBlockElem","foundAtIndex","isFoundNodeEmptyParagraph","cache_threshold","horizontalOffset","point","x","y","startIndex","length","useEdgeAsDefault","verbose","document","addEventListener","removeEventListener","current","onDragover","isFileTransfer","targetBlockElem","fuzzy","preventDefault","dropEffect","isBelow","willStayInSamePosition","getBoundingClientRect","width","boundingBox","elem","onDrop","dragData","getData","update","draggedNode","targetNode","height","targetBlockElemHeight","top","targetBlockElemTop","mouseY","window","scrollY","insertAfter","insertBefore","remove","allPrevHighlighters","querySelectorAll","forEach","highlighter","newInsertedElem","getElementByKey","getKey","highlightTimer","newInsertedElemRect","highlightElem","createElement","className","backgroundColor","transition","zIndex","pointerEvents","boxSizing","borderRadius","position","body","appendChild","left","fadeTimer","removeTimer","push","clearTimeout","onDragStart","effectAllowed","nodeKey","node","setData","onDragEnd","_jsxs","Fragment","_jsx","draggable","ref","type","DraggableBlockPlugin","t0","t1","undefined","_editable"],"sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\nimport type { DragEvent as ReactDragEvent } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { eventFiles } from '@lexical/rich-text'\nimport { $getNearestNodeFromDOMNode, $getNodeByKey, isHTMLElement } from 'lexical'\nimport * as React from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../config/client/EditorConfigProvider.js'\nimport { Point } from '../../../utils/point.js'\nimport { calculateDistanceFromScrollerElem } from '../utils/calculateDistanceFromScrollerElem.js'\nimport { getNodeCloseToPoint } from '../utils/getNodeCloseToPoint.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\nimport { isOnHandleElement } from '../utils/isOnHandleElement.js'\nimport { setHandlePosition } from '../utils/setHandlePosition.js'\nimport { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js'\nimport './index.css'\nimport { setTargetLine } from './setTargetLine.js'\n\nconst DRAGGABLE_BLOCK_MENU_CLASSNAME = 'draggable-block-menu'\nconst DRAG_DATA_FORMAT = 'application/x-lexical-drag-block'\n\nlet prevIndex = Infinity\n\nfunction getCurrentIndex(keysLength: number): number {\n if (keysLength === 0) {\n return Infinity\n }\n if (prevIndex >= 0 && prevIndex < keysLength) {\n return prevIndex\n }\n\n return Math.floor(keysLength / 2)\n}\n\nfunction setDragImage(dataTransfer: DataTransfer, draggableBlockElem: HTMLElement) {\n const { transform } = draggableBlockElem.style\n\n // Remove dragImage borders\n dataTransfer.setDragImage(draggableBlockElem, 0, 0)\n\n setTimeout(() => {\n draggableBlockElem.style.transform = transform\n })\n}\n\nfunction hideTargetLine(\n targetLineElem: HTMLElement | null,\n lastTargetBlockElem: HTMLElement | null,\n) {\n if (targetLineElem) {\n targetLineElem.style.opacity = '0'\n }\n if (lastTargetBlockElem) {\n lastTargetBlockElem.style.opacity = ''\n // Delete marginBottom and marginTop values we set\n lastTargetBlockElem.style.marginBottom = ''\n lastTargetBlockElem.style.marginTop = ''\n //lastTargetBlock.style.border = 'none'\n }\n}\n\nfunction useDraggableBlockMenu(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n isEditable: boolean,\n): React.ReactElement {\n const scrollerElem = anchorElem.parentElement\n\n const menuRef = useRef<HTMLButtonElement>(null)\n const targetLineRef = useRef<HTMLDivElement>(null)\n const debugHighlightRef = useRef<HTMLDivElement>(null)\n const isDraggingBlockRef = useRef<boolean>(false)\n const highlightTimersRef = useRef<ReturnType<typeof setTimeout>[]>([])\n const [draggableBlockElem, setDraggableBlockElem] = useState<HTMLElement | null>(null)\n const [lastTargetBlock, setLastTargetBlock] = useState<{\n boundingBox?: DOMRect\n elem: HTMLElement | null\n isBelow: boolean\n } | null>(null)\n\n const { editorConfig } = useEditorConfigContext()\n\n const blockHandleHorizontalOffset = editorConfig?.admin?.hideGutter ? -44 : -8\n\n useEffect(() => {\n /**\n * Handles positioning of the drag handle\n */\n function onDocumentMouseMove(event: MouseEvent) {\n const target = event.target\n if (!isHTMLElement(target)) {\n return\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n )\n if (distanceFromScrollerElem === -1) {\n setDraggableBlockElem(null)\n return\n }\n\n if (isOnHandleElement(target, DRAGGABLE_BLOCK_MENU_CLASSNAME)) {\n return\n }\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: _draggableBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n cache_threshold: 0,\n editor,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: false,\n verbose: false,\n })\n\n prevIndex = foundAtIndex\n\n //if (DEBUG && _draggableBlockElem) {\n //targetBlockElem.style.border = '3px solid red'\n // highlightElemOriginalPosition(debugHighlightRef, _draggableBlockElem, anchorElem)\n //}\n\n if (!_draggableBlockElem && !isFoundNodeEmptyParagraph) {\n return\n }\n\n if (draggableBlockElem !== _draggableBlockElem) {\n setDraggableBlockElem(_draggableBlockElem)\n }\n }\n\n // Since the draggableBlockElem is outside the actual editor, we need to listen to the document\n // to be able to detect when the mouse is outside the editor and respect a buffer around\n // the scrollerElem to avoid the draggableBlockElem disappearing too early.\n document?.addEventListener('mousemove', onDocumentMouseMove)\n\n return () => {\n document?.removeEventListener('mousemove', onDocumentMouseMove)\n }\n }, [scrollerElem, anchorElem, editor, draggableBlockElem])\n\n useEffect(() => {\n if (menuRef.current) {\n setHandlePosition(\n draggableBlockElem,\n menuRef.current,\n anchorElem,\n blockHandleHorizontalOffset,\n )\n }\n }, [anchorElem, draggableBlockElem, blockHandleHorizontalOffset])\n\n useEffect(() => {\n function onDragover(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n\n const { pageY, target } = event\n if (!isHTMLElement(target)) {\n return false\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: targetBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: true,\n verbose: true,\n })\n\n prevIndex = foundAtIndex\n\n const targetLineElem = targetLineRef.current\n // targetBlockElem === null shouldn't happen\n if (targetBlockElem === null || targetLineElem === null) {\n return false\n }\n\n // Always prevent default and set dropEffect during drag to maintain the move cursor\n event.preventDefault()\n event.dataTransfer!.dropEffect = 'move'\n\n if (draggableBlockElem !== targetBlockElem) {\n const { isBelow, willStayInSamePosition } = setTargetLine(\n editorConfig?.admin?.hideGutter ? '0px' : 'var(--spacer-5)',\n blockHandleHorizontalOffset +\n (editorConfig?.admin?.hideGutter\n ? (menuRef?.current?.getBoundingClientRect()?.width ?? 0)\n : -(menuRef?.current?.getBoundingClientRect()?.width ?? 0)),\n targetLineElem,\n targetBlockElem,\n lastTargetBlock!,\n pageY,\n anchorElem,\n event,\n debugHighlightRef,\n isFoundNodeEmptyParagraph,\n )\n\n if (!willStayInSamePosition) {\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow,\n })\n }\n } else if (lastTargetBlock?.elem) {\n hideTargetLine(targetLineElem, lastTargetBlock.elem)\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow: false,\n })\n }\n\n return true\n }\n\n function onDrop(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n const { dataTransfer, pageY, target } = event\n const dragData = dataTransfer?.getData(DRAG_DATA_FORMAT) || ''\n\n editor.update(() => {\n const draggedNode = $getNodeByKey(dragData)\n if (!draggedNode) {\n return false\n }\n if (!isHTMLElement(target)) {\n return false\n }\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const { blockElem: targetBlockElem, isFoundNodeEmptyParagraph } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n useEdgeAsDefault: true,\n })\n\n if (!targetBlockElem) {\n return false\n }\n const targetNode = $getNearestNodeFromDOMNode(targetBlockElem)\n if (!targetNode) {\n return false\n }\n if (targetNode === draggedNode) {\n return true\n }\n\n const { height: targetBlockElemHeight, top: targetBlockElemTop } =\n getBoundingClientRectWithoutTransform(targetBlockElem)\n\n const mouseY = pageY\n const isBelow = mouseY >= targetBlockElemTop + targetBlockElemHeight / 2 + window.scrollY\n\n if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n // below targetBlockElem\n targetNode.insertAfter(draggedNode)\n } else {\n // above targetBlockElem\n targetNode.insertBefore(draggedNode)\n }\n } else {\n //\n targetNode.insertBefore(draggedNode)\n targetNode.remove()\n }\n\n /*\n if (pageY >= targetBlockElemTop + targetBlockElemHeight / 2) {\n targetNode.insertAfter(draggedNode)\n } else {\n targetNode.insertBefore(draggedNode)\n }*/\n if (draggableBlockElem !== null) {\n setDraggableBlockElem(null)\n }\n\n // find all previous elements with lexical-block-highlighter class and remove them\n const allPrevHighlighters = document.querySelectorAll('.lexical-block-highlighter')\n allPrevHighlighters.forEach((highlighter) => {\n highlighter.remove()\n })\n\n const newInsertedElem = editor.getElementByKey(draggedNode.getKey())\n const highlightTimer = setTimeout(() => {\n // add new temp html element to newInsertedElem with the same height and width and the class block-selected\n // to highlight the new inserted element\n const newInsertedElemRect = newInsertedElem?.getBoundingClientRect()\n if (!newInsertedElemRect) {\n return\n }\n const highlightElem = document.createElement('div')\n highlightElem.className = 'lexical-block-highlighter'\n\n highlightElem.style.backgroundColor = 'var(--theme-elevation-1000'\n highlightElem.style.transition = 'opacity 0.5s ease-in-out'\n highlightElem.style.zIndex = '1'\n highlightElem.style.pointerEvents = 'none'\n highlightElem.style.boxSizing = 'border-box'\n highlightElem.style.borderRadius = '4px'\n highlightElem.style.position = 'absolute'\n document.body.appendChild(highlightElem)\n\n highlightElem.style.opacity = '0.1'\n\n highlightElem.style.height = `${newInsertedElemRect.height + 8}px`\n highlightElem.style.width = `${newInsertedElemRect.width + 8}px`\n highlightElem.style.top = `${newInsertedElemRect.top + window.scrollY - 4}px`\n highlightElem.style.left = `${newInsertedElemRect.left - 4}px`\n\n const fadeTimer = setTimeout(() => {\n highlightElem.style.opacity = '0'\n const removeTimer = setTimeout(() => {\n highlightElem.remove()\n }, 500)\n highlightTimersRef.current.push(removeTimer)\n }, 1000)\n highlightTimersRef.current.push(fadeTimer)\n }, 120)\n highlightTimersRef.current.push(highlightTimer)\n })\n\n return true\n }\n\n // register onDragover event listeners:\n document.addEventListener('dragover', onDragover)\n // register onDrop event listeners:\n document.addEventListener('drop', onDrop)\n\n return () => {\n document.removeEventListener('dragover', onDragover)\n document.removeEventListener('drop', onDrop)\n highlightTimersRef.current.forEach(clearTimeout)\n highlightTimersRef.current = []\n }\n }, [\n scrollerElem,\n blockHandleHorizontalOffset,\n anchorElem,\n editor,\n lastTargetBlock,\n draggableBlockElem,\n editorConfig?.admin?.hideGutter,\n ])\n\n function onDragStart(event: ReactDragEvent<HTMLButtonElement>): void {\n const dataTransfer = event.dataTransfer\n if (!dataTransfer || !draggableBlockElem) {\n return\n }\n setDragImage(dataTransfer, draggableBlockElem)\n dataTransfer.effectAllowed = 'move'\n let nodeKey = ''\n editor.update(() => {\n const node = $getNearestNodeFromDOMNode(draggableBlockElem)\n if (node) {\n nodeKey = node.getKey()\n }\n })\n isDraggingBlockRef.current = true\n dataTransfer.setData(DRAG_DATA_FORMAT, nodeKey)\n }\n\n function onDragEnd(): void {\n isDraggingBlockRef.current = false\n if (lastTargetBlock?.elem) {\n hideTargetLine(targetLineRef.current, lastTargetBlock?.elem)\n }\n }\n\n return createPortal(\n <React.Fragment>\n <button\n aria-label=\"Drag to move\"\n className=\"icon draggable-block-menu\"\n draggable\n onDragEnd={onDragEnd}\n onDragStart={onDragStart}\n ref={menuRef}\n type=\"button\"\n >\n <div className={isEditable ? 'icon' : ''} />\n </button>\n <div className=\"draggable-block-target-line\" ref={targetLineRef} />\n <div className=\"debug-highlight\" ref={debugHighlightRef} />\n </React.Fragment>,\n anchorElem,\n )\n}\n\nexport function DraggableBlockPlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactElement {\n const [editor] = useLexicalComposerContext()\n return useDraggableBlockMenu(editor, anchorElem, editor._editable)\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SA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,EAAM;MACzB3D,cAAA,CAAea,aAAA,CAAckC,OAAO,EAAE7B,eAAA,EAAiByC,IAAA;IACzD;EACF;EAEA,oBAAOnF,YAAA,cACLoI,KAAA,CAACxI,KAAA,CAAMyI,QAAQ;4BACbC,IAAA,CAAC;MACC,cAAW;MACXvB,SAAA,EAAU;MACVwB,SAAS;MACTJ,SAAA,EAAWA,SAAA;MACXL,WAAA,EAAaA,WAAA;MACbU,GAAA,EAAKpG,OAAA;MACLqG,IAAA,EAAK;gBAEL,aAAAH,IAAA,CAAC;QAAIvB,SAAA,EAAW9E,UAAA,GAAa,SAAS;;qBAExCqG,IAAA,CAAC;MAAIvB,SAAA,EAAU;MAA8ByB,GAAA,EAAKnG;qBAClDiG,IAAA,CAAC;MAAIvB,SAAA,EAAU;MAAkByB,GAAA,EAAKlG;;MAExCN,UAAA;AAEJ;AAEA,OAAO,SAAA0G,qBAAAC,EAAA;EAA8B;IAAA3G,UAAA,EAAA4G;EAAA,IAAAD,EAIpC;EAHC,MAAA3G,UAAA,GAAA4G,EAA0B,KAAAC,SAAA,GAAAzE,QAAA,CAAAmD,IAAA,GAA1BqB,EAA0B;EAI1B,OAAA7G,MAAA,IAAiBxC,yBAAA;EAAA,OACVuC,qBAAA,CAAsBC,MAAA,EAAQC,UAAA,EAAYD,MAAA,CAAA+G,SAAgB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["useLexicalComposerContext","eventFiles","$getNearestNodeFromDOMNode","$getNodeByKey","isHTMLElement","React","useEffect","useRef","useState","createPortal","useEditorConfigContext","Point","calculateDistanceFromScrollerElem","getNodeCloseToPoint","getTopLevelNodeKeys","isOnHandleElement","setHandlePosition","getBoundingClientRectWithoutTransform","setTargetLine","DRAGGABLE_BLOCK_MENU_CLASSNAME","DRAG_DATA_FORMAT","prevIndex","Infinity","getCurrentIndex","keysLength","Math","floor","setDragImage","dataTransfer","draggableBlockElem","transform","style","setTimeout","hideTargetLine","targetLineElem","lastTargetBlockElem","opacity","marginBottom","marginTop","useDraggableBlockMenu","editor","anchorElem","isEditable","scrollerElem","parentElement","menuRef","targetLineRef","debugHighlightRef","isDraggingBlockRef","highlightTimersRef","setDraggableBlockElem","lastTargetBlock","setLastTargetBlock","editorConfig","blockHandleHorizontalOffset","admin","hideGutter","onDocumentMouseMove","event","target","distanceFromScrollerElem","pageX","pageY","topLevelNodeKeys","blockElem","_draggableBlockElem","foundAtIndex","isFoundNodeEmptyParagraph","cache_threshold","horizontalOffset","point","x","y","startIndex","length","useEdgeAsDefault","verbose","document","addEventListener","removeEventListener","current","onDragover","isFileTransfer","targetBlockElem","fuzzy","preventDefault","dropEffect","isBelow","willStayInSamePosition","getBoundingClientRect","width","boundingBox","elem","onDrop","dragData","getData","update","draggedNode","targetNode","height","targetBlockElemHeight","top","targetBlockElemTop","mouseY","window","scrollY","insertAfter","insertBefore","remove","allPrevHighlighters","querySelectorAll","forEach","highlighter","newInsertedElem","getElementByKey","getKey","highlightTimer","newInsertedElemRect","highlightElem","createElement","className","backgroundColor","transition","zIndex","pointerEvents","boxSizing","borderRadius","position","body","appendChild","left","fadeTimer","removeTimer","push","clearTimeout","onDragStart","effectAllowed","nodeKey","node","setData","onDragEnd","_jsxs","Fragment","_jsx","draggable","ref","type","DraggableBlockPlugin","t0","t1","undefined","_editable"],"sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\nimport type { DragEvent as ReactDragEvent } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { eventFiles } from '@lexical/rich-text'\nimport { $getNearestNodeFromDOMNode, $getNodeByKey, isHTMLElement } from 'lexical'\nimport * as React from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../config/client/EditorConfigProvider.js'\nimport { Point } from '../../../utils/point.js'\nimport { calculateDistanceFromScrollerElem } from '../utils/calculateDistanceFromScrollerElem.js'\nimport { getNodeCloseToPoint } from '../utils/getNodeCloseToPoint.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\nimport { isOnHandleElement } from '../utils/isOnHandleElement.js'\nimport { setHandlePosition } from '../utils/setHandlePosition.js'\nimport { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js'\nimport './index.css'\nimport { setTargetLine } from './setTargetLine.js'\n\nconst DRAGGABLE_BLOCK_MENU_CLASSNAME = 'draggable-block-menu'\nconst DRAG_DATA_FORMAT = 'application/x-lexical-drag-block'\n\nlet prevIndex = Infinity\n\nfunction getCurrentIndex(keysLength: number): number {\n if (keysLength === 0) {\n return Infinity\n }\n if (prevIndex >= 0 && prevIndex < keysLength) {\n return prevIndex\n }\n\n return Math.floor(keysLength / 2)\n}\n\nfunction setDragImage(dataTransfer: DataTransfer, draggableBlockElem: HTMLElement) {\n const { transform } = draggableBlockElem.style\n\n // Remove dragImage borders\n dataTransfer.setDragImage(draggableBlockElem, 0, 0)\n\n setTimeout(() => {\n draggableBlockElem.style.transform = transform\n })\n}\n\nfunction hideTargetLine(\n targetLineElem: HTMLElement | null,\n lastTargetBlockElem: HTMLElement | null,\n) {\n if (targetLineElem) {\n targetLineElem.style.opacity = '0'\n }\n if (lastTargetBlockElem) {\n lastTargetBlockElem.style.opacity = ''\n // Delete marginBottom and marginTop values we set\n lastTargetBlockElem.style.marginBottom = ''\n lastTargetBlockElem.style.marginTop = ''\n //lastTargetBlock.style.border = 'none'\n }\n}\n\nfunction useDraggableBlockMenu(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n isEditable: boolean,\n): React.ReactElement {\n const scrollerElem = anchorElem.parentElement\n\n const menuRef = useRef<HTMLButtonElement>(null)\n const targetLineRef = useRef<HTMLDivElement>(null)\n const debugHighlightRef = useRef<HTMLDivElement>(null)\n const isDraggingBlockRef = useRef<boolean>(false)\n const highlightTimersRef = useRef<ReturnType<typeof setTimeout>[]>([])\n const [draggableBlockElem, setDraggableBlockElem] = useState<HTMLElement | null>(null)\n const [lastTargetBlock, setLastTargetBlock] = useState<{\n boundingBox?: DOMRect\n elem: HTMLElement | null\n isBelow: boolean\n } | null>(null)\n\n const { editorConfig } = useEditorConfigContext()\n\n const blockHandleHorizontalOffset = editorConfig?.admin?.hideGutter ? -44 : -8\n\n useEffect(() => {\n /**\n * Handles positioning of the drag handle\n */\n function onDocumentMouseMove(event: MouseEvent) {\n const target = event.target\n if (!isHTMLElement(target)) {\n return\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n )\n if (distanceFromScrollerElem === -1) {\n setDraggableBlockElem(null)\n return\n }\n\n if (isOnHandleElement(target, DRAGGABLE_BLOCK_MENU_CLASSNAME)) {\n return\n }\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: _draggableBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n cache_threshold: 0,\n editor,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: false,\n verbose: false,\n })\n\n prevIndex = foundAtIndex\n\n //if (DEBUG && _draggableBlockElem) {\n //targetBlockElem.style.border = '3px solid red'\n // highlightElemOriginalPosition(debugHighlightRef, _draggableBlockElem, anchorElem)\n //}\n\n if (!_draggableBlockElem && !isFoundNodeEmptyParagraph) {\n return\n }\n\n if (draggableBlockElem !== _draggableBlockElem) {\n setDraggableBlockElem(_draggableBlockElem)\n }\n }\n\n // Since the draggableBlockElem is outside the actual editor, we need to listen to the document\n // to be able to detect when the mouse is outside the editor and respect a buffer around\n // the scrollerElem to avoid the draggableBlockElem disappearing too early.\n document?.addEventListener('mousemove', onDocumentMouseMove)\n\n return () => {\n document?.removeEventListener('mousemove', onDocumentMouseMove)\n }\n }, [scrollerElem, anchorElem, editor, draggableBlockElem])\n\n useEffect(() => {\n if (menuRef.current) {\n setHandlePosition(\n draggableBlockElem,\n menuRef.current,\n anchorElem,\n blockHandleHorizontalOffset,\n )\n }\n }, [anchorElem, draggableBlockElem, blockHandleHorizontalOffset])\n\n useEffect(() => {\n function onDragover(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n\n const { pageY, target } = event\n if (!isHTMLElement(target)) {\n return false\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: targetBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: true,\n verbose: true,\n })\n\n prevIndex = foundAtIndex\n\n const targetLineElem = targetLineRef.current\n // targetBlockElem === null shouldn't happen\n if (targetBlockElem === null || targetLineElem === null) {\n return false\n }\n\n // Always prevent default and set dropEffect during drag to maintain the move cursor\n event.preventDefault()\n event.dataTransfer!.dropEffect = 'move'\n\n if (draggableBlockElem !== targetBlockElem) {\n const { isBelow, willStayInSamePosition } = setTargetLine(\n editorConfig?.admin?.hideGutter ? '0px' : 'var(--spacer-5)',\n blockHandleHorizontalOffset +\n (editorConfig?.admin?.hideGutter\n ? (menuRef?.current?.getBoundingClientRect()?.width ?? 0)\n : -(menuRef?.current?.getBoundingClientRect()?.width ?? 0)),\n targetLineElem,\n targetBlockElem,\n lastTargetBlock!,\n pageY,\n anchorElem,\n event,\n debugHighlightRef,\n isFoundNodeEmptyParagraph,\n )\n\n if (!willStayInSamePosition) {\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow,\n })\n }\n } else if (lastTargetBlock?.elem) {\n hideTargetLine(targetLineElem, lastTargetBlock.elem)\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow: false,\n })\n }\n\n return true\n }\n\n function onDrop(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n const { dataTransfer, pageY, target } = event\n const dragData = dataTransfer?.getData(DRAG_DATA_FORMAT) || ''\n\n editor.update(() => {\n const draggedNode = $getNodeByKey(dragData)\n if (!draggedNode) {\n return false\n }\n if (!isHTMLElement(target)) {\n return false\n }\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const { blockElem: targetBlockElem, isFoundNodeEmptyParagraph } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n useEdgeAsDefault: true,\n })\n\n if (!targetBlockElem) {\n return false\n }\n const targetNode = $getNearestNodeFromDOMNode(targetBlockElem)\n if (!targetNode) {\n return false\n }\n if (targetNode === draggedNode) {\n return true\n }\n\n const { height: targetBlockElemHeight, top: targetBlockElemTop } =\n getBoundingClientRectWithoutTransform(targetBlockElem)\n\n const mouseY = pageY\n const isBelow = mouseY >= targetBlockElemTop + targetBlockElemHeight / 2 + window.scrollY\n\n if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n // below targetBlockElem\n targetNode.insertAfter(draggedNode)\n } else {\n // above targetBlockElem\n targetNode.insertBefore(draggedNode)\n }\n } else {\n //\n targetNode.insertBefore(draggedNode)\n targetNode.remove()\n }\n\n /*\n if (pageY >= targetBlockElemTop + targetBlockElemHeight / 2) {\n targetNode.insertAfter(draggedNode)\n } else {\n targetNode.insertBefore(draggedNode)\n }*/\n if (draggableBlockElem !== null) {\n setDraggableBlockElem(null)\n }\n\n // find all previous elements with lexical-block-highlighter class and remove them\n const allPrevHighlighters = document.querySelectorAll('.lexical-block-highlighter')\n allPrevHighlighters.forEach((highlighter) => {\n highlighter.remove()\n })\n\n const newInsertedElem = editor.getElementByKey(draggedNode.getKey())\n const highlightTimer = setTimeout(() => {\n // add new temp html element to newInsertedElem with the same height and width and the class block-selected\n // to highlight the new inserted element\n const newInsertedElemRect = newInsertedElem?.getBoundingClientRect()\n if (!newInsertedElemRect) {\n return\n }\n const highlightElem = document.createElement('div')\n highlightElem.className = 'lexical-block-highlighter'\n\n highlightElem.style.backgroundColor = 'var(--color-bg-inverse)'\n highlightElem.style.transition = 'opacity 0.5s ease-in-out'\n highlightElem.style.zIndex = '1'\n highlightElem.style.pointerEvents = 'none'\n highlightElem.style.boxSizing = 'border-box'\n highlightElem.style.borderRadius = '4px'\n highlightElem.style.position = 'absolute'\n document.body.appendChild(highlightElem)\n\n highlightElem.style.opacity = '0.1'\n\n highlightElem.style.height = `${newInsertedElemRect.height + 8}px`\n highlightElem.style.width = `${newInsertedElemRect.width + 8}px`\n highlightElem.style.top = `${newInsertedElemRect.top + window.scrollY - 4}px`\n highlightElem.style.left = `${newInsertedElemRect.left - 4}px`\n\n const fadeTimer = setTimeout(() => {\n highlightElem.style.opacity = '0'\n const removeTimer = setTimeout(() => {\n highlightElem.remove()\n }, 500)\n highlightTimersRef.current.push(removeTimer)\n }, 1000)\n highlightTimersRef.current.push(fadeTimer)\n }, 120)\n highlightTimersRef.current.push(highlightTimer)\n })\n\n return true\n }\n\n // register onDragover event listeners:\n document.addEventListener('dragover', onDragover)\n // register onDrop event listeners:\n document.addEventListener('drop', onDrop)\n\n return () => {\n document.removeEventListener('dragover', onDragover)\n document.removeEventListener('drop', onDrop)\n highlightTimersRef.current.forEach(clearTimeout)\n highlightTimersRef.current = []\n }\n }, [\n scrollerElem,\n blockHandleHorizontalOffset,\n anchorElem,\n editor,\n lastTargetBlock,\n draggableBlockElem,\n editorConfig?.admin?.hideGutter,\n ])\n\n function onDragStart(event: ReactDragEvent<HTMLButtonElement>): void {\n const dataTransfer = event.dataTransfer\n if (!dataTransfer || !draggableBlockElem) {\n return\n }\n setDragImage(dataTransfer, draggableBlockElem)\n dataTransfer.effectAllowed = 'move'\n let nodeKey = ''\n editor.update(() => {\n const node = $getNearestNodeFromDOMNode(draggableBlockElem)\n if (node) {\n nodeKey = node.getKey()\n }\n })\n isDraggingBlockRef.current = true\n dataTransfer.setData(DRAG_DATA_FORMAT, nodeKey)\n }\n\n function onDragEnd(): void {\n isDraggingBlockRef.current = false\n if (lastTargetBlock?.elem) {\n hideTargetLine(targetLineRef.current, lastTargetBlock?.elem)\n }\n }\n\n return createPortal(\n <React.Fragment>\n <button\n aria-label=\"Drag to move\"\n className=\"icon draggable-block-menu\"\n draggable\n onDragEnd={onDragEnd}\n onDragStart={onDragStart}\n ref={menuRef}\n type=\"button\"\n >\n <div className={isEditable ? 'icon' : ''} />\n </button>\n <div className=\"draggable-block-target-line\" ref={targetLineRef} />\n <div className=\"debug-highlight\" ref={debugHighlightRef} />\n </React.Fragment>,\n anchorElem,\n )\n}\n\nexport function DraggableBlockPlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactElement {\n const [editor] = useLexicalComposerContext()\n return useDraggableBlockMenu(editor, anchorElem, editor._editable)\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SAASC,0BAA0B,EAAEC,aAAa,EAAEC,aAAa,QAAQ;AACzE,YAAYC,KAAA,MAAW;AACvB,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAC5C,SAASC,YAAY,QAAQ;AAE7B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,KAAK,QAAQ;AACtB,SAASC,iCAAiC,QAAQ;AAClD,SAASC,mBAAmB,QAAQ;AACpC,SAASC,mBAAm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AAKpG,OAAA;MACLqG,IAAA,EAAK;gBAEL,aAAAH,IAAA,CAAC;QAAIvB,SAAA,EAAW9E,UAAA,GAAa,SAAS;;qBAExCqG,IAAA,CAAC;MAAIvB,SAAA,EAAU;MAA8ByB,GAAA,EAAKnG;qBAClDiG,IAAA,CAAC;MAAIvB,SAAA,EAAU;MAAkByB,GAAA,EAAKlG;;MAExCN,UAAA;AAEJ;AAEA,OAAO,SAAA0G,qBAAAC,EAAA;EAA8B;IAAA3G,UAAA,EAAA4G;EAAA,IAAAD,EAIpC;EAHC,MAAA3G,UAAA,GAAA4G,EAA0B,KAAAC,SAAA,GAAAzE,QAAA,CAAAmD,IAAA,GAA1BqB,EAA0B;EAI1B,OAAA7G,MAAA,IAAiBxC,yBAAA;EAAA,OACVuC,qBAAA,CAAsBC,MAAA,EAAQC,UAAA,EAAYD,MAAA,CAAA+G,SAAgB;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateDistanceFromScrollerElem.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,eAAO,MAAM,iCAAiC,
|
|
1
|
+
{"version":3,"file":"calculateDistanceFromScrollerElem.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,eAAO,MAAM,iCAAiC,iBAC9B,WAAW,GAAG,IAAI,SACzB,MAAM,SACN,MAAM,UACL,WAAW,qBACD,MAAM,mBACR,MAAM,KACrB,MAwBF,CAAA"}
|
|
@@ -131,8 +131,7 @@
|
|
|
131
131
|
.LexicalEditorTheme__tabNode.LexicalEditorTheme__textUnderline::after {
|
|
132
132
|
content: '';
|
|
133
133
|
position: absolute;
|
|
134
|
-
|
|
135
|
-
right: 0;
|
|
134
|
+
inset-inline: 0;
|
|
136
135
|
bottom: 0.15em;
|
|
137
136
|
border-bottom: 0.1em solid currentColor;
|
|
138
137
|
}
|
|
@@ -140,8 +139,7 @@
|
|
|
140
139
|
.LexicalEditorTheme__tabNode.LexicalEditorTheme__textStrikethrough::before {
|
|
141
140
|
content: '';
|
|
142
141
|
position: absolute;
|
|
143
|
-
|
|
144
|
-
right: 0;
|
|
142
|
+
inset-inline: 0;
|
|
145
143
|
top: 0.69em;
|
|
146
144
|
border-top: 0.1em solid currentColor;
|
|
147
145
|
}
|
|
@@ -150,8 +148,7 @@
|
|
|
150
148
|
.LexicalEditorTheme__tabNode.LexicalEditorTheme__textUnderlineStrikethrough::after {
|
|
151
149
|
content: '';
|
|
152
150
|
position: absolute;
|
|
153
|
-
|
|
154
|
-
right: 0;
|
|
151
|
+
inset-inline: 0;
|
|
155
152
|
}
|
|
156
153
|
|
|
157
154
|
.LexicalEditorTheme__tabNode.LexicalEditorTheme__textUnderlineStrikethrough::before {
|
|
@@ -201,7 +198,7 @@
|
|
|
201
198
|
content: '';
|
|
202
199
|
display: block;
|
|
203
200
|
position: absolute;
|
|
204
|
-
top: -
|
|
201
|
+
top: calc(var(--stroke-width-medium) * -1);
|
|
205
202
|
width: var(--spacer-3);
|
|
206
203
|
border-top: var(--stroke-width-small) solid var(--color-text);
|
|
207
204
|
animation: CursorBlink 1.1s steps(2, start) infinite;
|
|
@@ -263,7 +260,8 @@
|
|
|
263
260
|
.LexicalEditorTheme__listItem {
|
|
264
261
|
font-family: var(--text-body-large-font-family);
|
|
265
262
|
font-size: var(--text-body-large-font-size);
|
|
266
|
-
margin:
|
|
263
|
+
margin-block-end: var(--spacer-3);
|
|
264
|
+
margin-inline-start: var(--spacer-6);
|
|
267
265
|
}
|
|
268
266
|
|
|
269
267
|
.LexicalEditorTheme__listItem[style*='text-align: center'],
|
|
@@ -280,24 +278,25 @@
|
|
|
280
278
|
}
|
|
281
279
|
|
|
282
280
|
.LexicalEditorTheme__listItem[dir='rtl'] {
|
|
283
|
-
margin: 0
|
|
281
|
+
margin-block-end: 0.4em;
|
|
282
|
+
margin-inline-end: var(--spacer-6);
|
|
284
283
|
}
|
|
285
284
|
|
|
286
285
|
.LexicalEditorTheme__listItemChecked,
|
|
287
286
|
.LexicalEditorTheme__listItemUnchecked {
|
|
288
287
|
position: relative;
|
|
289
|
-
padding-
|
|
290
|
-
margin-
|
|
288
|
+
padding-inline-start: var(--spacer-4);
|
|
289
|
+
margin-inline-start: var(--spacer-3);
|
|
291
290
|
list-style-type: none;
|
|
292
291
|
outline: none;
|
|
293
292
|
}
|
|
294
293
|
|
|
295
294
|
.LexicalEditorTheme__listItemUnchecked[dir='rtl'],
|
|
296
295
|
.LexicalEditorTheme__listItemChecked[dir='rtl'] {
|
|
297
|
-
margin-
|
|
298
|
-
padding-
|
|
299
|
-
padding-
|
|
300
|
-
margin-
|
|
296
|
+
margin-inline-start: 0;
|
|
297
|
+
padding-inline-start: 0;
|
|
298
|
+
padding-inline-end: var(--spacer-4);
|
|
299
|
+
margin-inline-end: var(--spacer-3);
|
|
301
300
|
}
|
|
302
301
|
|
|
303
302
|
.LexicalEditorTheme__listItemChecked {
|
|
@@ -310,7 +309,7 @@
|
|
|
310
309
|
width: var(--spacer-3);
|
|
311
310
|
height: var(--spacer-3);
|
|
312
311
|
top: 0;
|
|
313
|
-
|
|
312
|
+
inset-inline-start: 0;
|
|
314
313
|
cursor: pointer;
|
|
315
314
|
display: block;
|
|
316
315
|
position: absolute;
|
|
@@ -320,14 +319,14 @@
|
|
|
320
319
|
|
|
321
320
|
.LexicalEditorTheme__listItemUnchecked[dir='rtl']:before,
|
|
322
321
|
.LexicalEditorTheme__listItemChecked[dir='rtl']:before {
|
|
323
|
-
|
|
324
|
-
|
|
322
|
+
inset-inline-start: auto;
|
|
323
|
+
inset-inline-end: 0;
|
|
325
324
|
}
|
|
326
325
|
|
|
327
326
|
.LexicalEditorTheme__listItemUnchecked:focus:before,
|
|
328
327
|
.LexicalEditorTheme__listItemChecked:focus:before {
|
|
329
328
|
outline: 0;
|
|
330
|
-
box-shadow: 0 0 0
|
|
329
|
+
box-shadow: 0 0 0 var(--stroke-width-medium) var(--color-border-selected);
|
|
331
330
|
}
|
|
332
331
|
|
|
333
332
|
.LexicalEditorTheme__listItemUnchecked:before {
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
position: relative;
|
|
6
6
|
tab-size: 1;
|
|
7
7
|
outline: 0;
|
|
8
|
-
padding
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
padding-
|
|
8
|
+
padding: var(--spacer-3) var(--spacer-3);
|
|
9
|
+
/* Reserve space for the InsertParagraphAtEnd hover "+" affordance, which
|
|
10
|
+
overlaps this bottom padding; shrinking it would cover the last line. */
|
|
11
|
+
padding-bottom: var(--spacer-4);
|
|
12
12
|
|
|
13
13
|
&:focus-visible {
|
|
14
14
|
outline: none !important;
|
|
@@ -19,35 +19,43 @@
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
> .editor-container
|
|
25
|
-
> .editor-scroller
|
|
26
|
-
> .editor {
|
|
27
|
-
> .ContentEditable__root {
|
|
22
|
+
@media (min-width: 768px) {
|
|
23
|
+
.ContentEditable__root {
|
|
28
24
|
padding: var(--spacer-4) var(--spacer-5);
|
|
29
25
|
}
|
|
26
|
+
|
|
27
|
+
.rich-text-lexical:not(.rich-text-lexical--show-gutter)
|
|
28
|
+
> .rich-text-lexical__wrap
|
|
29
|
+
> .rich-text-lexical__editor-content
|
|
30
|
+
> .editor-container
|
|
31
|
+
> .editor-scroller
|
|
32
|
+
> .editor
|
|
33
|
+
> .ContentEditable__root {
|
|
34
|
+
padding: var(--spacer-2) 0;
|
|
35
|
+
}
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
html[data-theme='light'] {
|
|
33
39
|
.rich-text-lexical.rich-text-lexical--show-gutter {
|
|
34
40
|
&.error:not(:hover) {
|
|
35
41
|
> .rich-text-lexical__wrap
|
|
42
|
+
> .rich-text-lexical__editor-content
|
|
36
43
|
> .editor-container
|
|
37
44
|
> .editor-scroller
|
|
38
45
|
> .editor
|
|
39
46
|
> .ContentEditable__root::before {
|
|
40
|
-
border-
|
|
47
|
+
border-inline-start: var(--stroke-width-medium) solid var(--color-border-danger);
|
|
41
48
|
}
|
|
42
49
|
}
|
|
43
50
|
|
|
44
51
|
&.error:hover {
|
|
45
52
|
> .rich-text-lexical__wrap
|
|
53
|
+
> .rich-text-lexical__editor-content
|
|
46
54
|
> .editor-container
|
|
47
55
|
> .editor-scroller
|
|
48
56
|
> .editor
|
|
49
57
|
> .ContentEditable__root::before {
|
|
50
|
-
border-
|
|
58
|
+
border-inline-start: var(--stroke-width-medium) solid var(--color-border-danger);
|
|
51
59
|
}
|
|
52
60
|
}
|
|
53
61
|
}
|
|
@@ -68,11 +76,12 @@
|
|
|
68
76
|
.rich-text-lexical.rich-text-lexical--show-gutter {
|
|
69
77
|
&.error {
|
|
70
78
|
> .rich-text-lexical__wrap
|
|
79
|
+
> .rich-text-lexical__editor-content
|
|
71
80
|
> .editor-container
|
|
72
81
|
> .editor-scroller
|
|
73
82
|
> .editor
|
|
74
83
|
> .ContentEditable__root::before {
|
|
75
|
-
border-
|
|
84
|
+
border-inline-start: var(--stroke-width-medium) solid var(--color-border-danger);
|
|
76
85
|
}
|
|
77
86
|
}
|
|
78
87
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Transformer } from '@lexical/markdown';
|
|
2
|
+
import type { ElementNode } from 'lexical';
|
|
3
|
+
/**
|
|
4
|
+
* Payload's markdown import. Wraps `@lexical/markdown`'s `$convertFromMarkdownString`
|
|
5
|
+
* with Payload's `normalizeMarkdown` preprocessing (nested code fences + table-row
|
|
6
|
+
* whitespace handling).
|
|
7
|
+
*
|
|
8
|
+
* TODO: Remove this wrapper and the `normalizeMarkdown` import once
|
|
9
|
+
* https://github.com/facebook/lexical/pull/8734 is merged and we upgrade to a
|
|
10
|
+
* release that includes it. At that point callers can use `@lexical/markdown`'s
|
|
11
|
+
* `$convertFromMarkdownString` directly.
|
|
12
|
+
*
|
|
13
|
+
* @param shouldPreserveNewLines By setting this to true, new lines will be preserved between conversions.
|
|
14
|
+
* @param shouldMergeAdjacentLines By setting this to true, adjacent non empty lines will be merged according to commonmark spec: https://spec.commonmark.org/0.24/#example-177. Not applicable if shouldPreserveNewLines = true.
|
|
15
|
+
*/
|
|
16
|
+
export declare function $convertFromMarkdownString(markdown: string, transformers?: Array<Transformer>, node?: ElementNode, shouldPreserveNewLines?: boolean, shouldMergeAdjacentLines?: boolean): void;
|
|
17
|
+
//# sourceMappingURL=convertFromMarkdownString.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertFromMarkdownString.d.ts","sourceRoot":"","sources":["../../../../src/lexical/utils/markdown/convertFromMarkdownString.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAU1C;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,YAAY,GAAE,KAAK,CAAC,WAAW,CAAgB,EAC/C,IAAI,CAAC,EAAE,WAAW,EAClB,sBAAsB,UAAQ,EAC9B,wBAAwB,UAAQ,GAC/B,IAAI,CASN"}
|