@payloadcms/richtext-lexical 3.0.0-beta.23 → 3.0.0-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/exports/components.d.ts +2 -2
- package/dist/exports/components.d.ts.map +1 -1
- package/dist/exports/components.js +2 -2
- package/dist/exports/components.js.map +1 -1
- package/dist/field/features/align/feature.client.d.ts.map +1 -1
- package/dist/field/features/align/feature.client.js +15 -21
- package/dist/field/features/align/feature.client.js.map +1 -1
- package/dist/field/features/align/inlineToolbarAlignGroup.d.ts +3 -0
- package/dist/field/features/align/inlineToolbarAlignGroup.d.ts.map +1 -0
- package/dist/field/features/align/{floatingSelectToolbarAlignDropdownSection.js → inlineToolbarAlignGroup.js} +4 -4
- package/dist/field/features/align/inlineToolbarAlignGroup.js.map +1 -0
- package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
- package/dist/field/features/blockquote/feature.client.js +33 -31
- package/dist/field/features/blockquote/feature.client.js.map +1 -1
- package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
- package/dist/field/features/blocks/feature.client.js +25 -27
- package/dist/field/features/blocks/feature.client.js.map +1 -1
- package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts.map +1 -1
- package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js.map +1 -1
- package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts.map +1 -1
- package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js +1 -1
- package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js.map +1 -1
- package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.d.ts.map +1 -1
- package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.js.map +1 -1
- package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts.map +1 -1
- package/dist/field/features/debug/{treeview → treeView}/feature.client.js.map +1 -1
- package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts.map +1 -1
- package/dist/field/features/debug/{treeview → treeView}/feature.server.js +1 -1
- package/dist/field/features/debug/{treeview → treeView}/feature.server.js.map +1 -1
- package/dist/field/features/debug/{treeview → treeView}/plugin/index.d.ts.map +1 -1
- package/dist/field/features/debug/{treeview → treeView}/plugin/index.js.map +1 -1
- package/dist/field/features/format/bold/feature.client.js +7 -7
- package/dist/field/features/format/bold/feature.client.js.map +1 -1
- package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.js +10 -10
- package/dist/field/features/format/inlineCode/feature.client.js.map +1 -0
- package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts.map +1 -1
- package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js +1 -1
- package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js.map +1 -1
- package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts.map +1 -1
- package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js.map +1 -1
- package/dist/field/features/format/italic/feature.client.js +10 -10
- package/dist/field/features/format/italic/feature.client.js.map +1 -1
- package/dist/field/features/format/shared/inlineToolbarFormatGroup.d.ts +3 -0
- package/dist/field/features/format/shared/inlineToolbarFormatGroup.d.ts.map +1 -0
- package/dist/field/features/format/shared/inlineToolbarFormatGroup.js +10 -0
- package/dist/field/features/format/shared/inlineToolbarFormatGroup.js.map +1 -0
- package/dist/field/features/format/strikethrough/feature.client.js +9 -9
- package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
- package/dist/field/features/format/subscript/feature.client.js +5 -5
- package/dist/field/features/format/subscript/feature.client.js.map +1 -1
- package/dist/field/features/format/superscript/feature.client.js +5 -5
- package/dist/field/features/format/superscript/feature.client.js.map +1 -1
- package/dist/field/features/format/underline/feature.client.js +5 -5
- package/dist/field/features/format/underline/feature.client.js.map +1 -1
- package/dist/field/features/heading/feature.client.d.ts.map +1 -1
- package/dist/field/features/heading/feature.client.js +39 -39
- package/dist/field/features/heading/feature.client.js.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/component/index.d.ts.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/component/index.js.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/feature.client.d.ts.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/feature.client.js +7 -7
- package/dist/field/features/horizontalRule/feature.client.js.map +1 -0
- package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.d.ts.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.js +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.js.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.d.ts.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.js.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.d.ts.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.js.map +1 -1
- package/dist/field/features/indent/feature.client.d.ts.map +1 -1
- package/dist/field/features/indent/feature.client.js +9 -11
- package/dist/field/features/indent/feature.client.js.map +1 -1
- package/dist/field/features/indent/inlineToolbarIndentGroup.d.ts +3 -0
- package/dist/field/features/indent/inlineToolbarIndentGroup.d.ts.map +1 -0
- package/dist/field/features/indent/inlineToolbarIndentGroup.js +10 -0
- package/dist/field/features/indent/inlineToolbarIndentGroup.js.map +1 -0
- package/dist/field/features/link/feature.client.js +28 -28
- package/dist/field/features/link/feature.client.js.map +1 -1
- package/dist/field/features/lists/checklist/feature.client.d.ts +1 -1
- package/dist/field/features/lists/checklist/feature.client.js +28 -28
- package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
- package/dist/field/features/lists/checklist/feature.server.d.ts +1 -1
- package/dist/field/features/lists/checklist/feature.server.js +4 -4
- package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
- package/dist/field/features/lists/checklist/markdownTransformers.js +1 -1
- package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
- package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts.map +1 -1
- package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.js +26 -26
- package/dist/field/features/lists/orderedList/feature.client.js.map +1 -0
- package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.d.ts.map +1 -1
- package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.js +1 -1
- package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.js.map +1 -1
- package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.d.ts.map +1 -1
- package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.js +1 -1
- package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.js.map +1 -1
- package/dist/field/features/lists/{common → shared}/markdown.d.ts.map +1 -1
- package/dist/field/features/lists/{common → shared}/markdown.js.map +1 -1
- package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -0
- package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.client.js +24 -24
- package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -0
- package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.d.ts.map +1 -1
- package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.js +1 -1
- package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.js.map +1 -1
- package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.d.ts.map +1 -1
- package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.js +1 -1
- package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.js.map +1 -1
- package/dist/field/features/paragraph/feature.client.js +27 -27
- package/dist/field/features/paragraph/feature.client.js.map +1 -1
- package/dist/field/features/relationship/feature.client.js +7 -7
- package/dist/field/features/relationship/feature.client.js.map +1 -1
- package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.d.ts +3 -0
- package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.d.ts.map +1 -0
- package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.js +10 -0
- package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.js.map +1 -0
- package/dist/field/features/shared/inlineToolbar/textDropdownGroup.d.ts +3 -0
- package/dist/field/features/shared/inlineToolbar/textDropdownGroup.d.ts.map +1 -0
- package/dist/field/features/{common/floatingSelectToolbarTextDropdownSection/index.js → shared/inlineToolbar/textDropdownGroup.js} +4 -4
- package/dist/field/features/shared/inlineToolbar/textDropdownGroup.js.map +1 -0
- package/dist/field/features/types.d.ts +51 -12
- package/dist/field/features/types.d.ts.map +1 -1
- package/dist/field/features/types.js.map +1 -1
- package/dist/field/features/upload/feature.client.d.ts.map +1 -1
- package/dist/field/features/upload/feature.client.js +7 -7
- package/dist/field/features/upload/feature.client.js.map +1 -1
- package/dist/field/lexical/LexicalEditor.js +1 -1
- package/dist/field/lexical/LexicalEditor.js.map +1 -1
- package/dist/field/lexical/LexicalEditor.scss +3 -19
- package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
- package/dist/field/lexical/config/client/sanitize.js +80 -32
- package/dist/field/lexical/config/client/sanitize.js.map +1 -1
- package/dist/field/lexical/config/server/default.d.ts.map +1 -1
- package/dist/field/lexical/config/server/default.js +6 -6
- package/dist/field/lexical/config/server/default.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +9 -9
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +71 -71
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +4 -4
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +3 -3
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +12 -20
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -37
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/index.d.ts +2 -2
- package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/index.js +67 -61
- package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/fixed}/types.d.ts +6 -6
- package/dist/field/lexical/plugins/toolbars/fixed/types.d.ts.map +1 -0
- package/dist/field/lexical/plugins/toolbars/fixed/types.js.map +1 -0
- package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.d.ts.map +1 -0
- package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline/Toolbar}/index.js +32 -32
- package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.js.map +1 -0
- package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline/Toolbar}/index.scss +5 -4
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.d.ts +8 -0
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.d.ts.map +1 -0
- package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline}/ToolbarButton/index.js +9 -9
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.js.map +1 -0
- package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline}/ToolbarButton/index.scss +1 -1
- package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline}/ToolbarDropdown/DropDown.d.ts +3 -3
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.d.ts.map +1 -0
- package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline}/ToolbarDropdown/DropDown.js +12 -12
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.js.map +1 -0
- package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline}/ToolbarDropdown/index.d.ts +6 -6
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.d.ts.map +1 -0
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js +42 -0
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js.map +1 -0
- package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline}/ToolbarDropdown/index.scss +6 -6
- package/dist/field/lexical/plugins/toolbars/inline/types.d.ts +40 -0
- package/dist/field/lexical/plugins/toolbars/inline/types.d.ts.map +1 -0
- package/dist/field/lexical/plugins/toolbars/inline/types.js +3 -0
- package/dist/field/lexical/plugins/toolbars/inline/types.js.map +1 -0
- package/dist/field/lexical/theme/EditorTheme.scss +2 -6
- package/dist/index.d.ts +12 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts +0 -3
- package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts.map +0 -1
- package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js.map +0 -1
- package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts +0 -3
- package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts.map +0 -1
- package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js +0 -10
- package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js.map +0 -1
- package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts +0 -3
- package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts.map +0 -1
- package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js.map +0 -1
- package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts +0 -3
- package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts.map +0 -1
- package/dist/field/features/format/common/floatingSelectToolbarSection.js +0 -10
- package/dist/field/features/format/common/floatingSelectToolbarSection.js.map +0 -1
- package/dist/field/features/format/inlinecode/feature.client.js.map +0 -1
- package/dist/field/features/horizontalrule/feature.client.js.map +0 -1
- package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts +0 -3
- package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts.map +0 -1
- package/dist/field/features/indent/floatingSelectToolbarIndentSection.js +0 -10
- package/dist/field/features/indent/floatingSelectToolbarIndentSection.js.map +0 -1
- package/dist/field/features/indent/index.scss +0 -4
- package/dist/field/features/lists/orderedlist/feature.client.js.map +0 -1
- package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +0 -1
- package/dist/field/features/lists/unorderedlist/feature.client.js.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts +0 -8
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js +0 -42
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js.map +0 -1
- /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts +0 -0
- /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js +0 -0
- /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts +0 -0
- /package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.d.ts +0 -0
- /package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.js +0 -0
- /package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.scss +0 -0
- /package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts +0 -0
- /package/dist/field/features/debug/{treeview → treeView}/feature.client.js +0 -0
- /package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts +0 -0
- /package/dist/field/features/debug/{treeview → treeView}/plugin/index.d.ts +0 -0
- /package/dist/field/features/debug/{treeview → treeView}/plugin/index.js +0 -0
- /package/dist/field/features/debug/{treeview → treeView}/plugin/index.scss +0 -0
- /package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.d.ts +0 -0
- /package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts +0 -0
- /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts +0 -0
- /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/component/index.d.ts +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/component/index.js +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/feature.client.d.ts +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.d.ts +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.d.ts +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.js +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.d.ts +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.js +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.d.ts +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.js +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.scss +0 -0
- /package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts +0 -0
- /package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.d.ts +0 -0
- /package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.d.ts +0 -0
- /package/dist/field/features/lists/{common → shared}/markdown.d.ts +0 -0
- /package/dist/field/features/lists/{common → shared}/markdown.js +0 -0
- /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.client.d.ts +0 -0
- /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.d.ts +0 -0
- /package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.d.ts +0 -0
- /package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/fixed}/types.js +0 -0
- /package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline/Toolbar}/index.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/field/lexical/LexicalEditor.tsx"],"sourcesContent":["'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary.js'\nimport { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin.js'\nimport { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin.js'\nimport { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin.js'\nimport { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin.js'\nimport * as React from 'react'\nimport { useEffect, useState } from 'react'\n\nimport type { LexicalProviderProps } from './LexicalProvider.js'\n\nimport { EditorPlugin } from './EditorPlugin.js'\nimport './LexicalEditor.scss'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/field/lexical/LexicalEditor.tsx"],"sourcesContent":["'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary.js'\nimport { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin.js'\nimport { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin.js'\nimport { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin.js'\nimport { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin.js'\nimport * as React from 'react'\nimport { useEffect, useState } from 'react'\n\nimport type { LexicalProviderProps } from './LexicalProvider.js'\n\nimport { EditorPlugin } from './EditorPlugin.js'\nimport './LexicalEditor.scss'\nimport { MarkdownShortcutPlugin } from './plugins/MarkdownShortcut/index.js'\nimport { SlashMenuPlugin } from './plugins/SlashMenu/index.js'\nimport { AddBlockHandlePlugin } from './plugins/handles/AddBlockHandlePlugin/index.js'\nimport { DraggableBlockPlugin } from './plugins/handles/DraggableBlockPlugin/index.js'\nimport { FloatingSelectToolbarPlugin } from './plugins/toolbars/inline/Toolbar/index.js'\nimport { LexicalContentEditable } from './ui/ContentEditable.js'\n\nexport const LexicalEditor: React.FC<Pick<LexicalProviderProps, 'editorConfig' | 'onChange'>> = (\n props,\n) => {\n const { editorConfig, onChange } = props\n const [editor] = useLexicalComposerContext()\n\n const [floatingAnchorElem, setFloatingAnchorElem] = useState<HTMLDivElement | null>(null)\n const onRef = (_floatingAnchorElem: HTMLDivElement) => {\n if (_floatingAnchorElem !== null) {\n setFloatingAnchorElem(_floatingAnchorElem)\n }\n }\n\n const [isSmallWidthViewport, setIsSmallWidthViewport] = useState<boolean>(false)\n\n useEffect(() => {\n const updateViewPortWidth = () => {\n const isNextSmallWidthViewport = window.matchMedia('(max-width: 768px)').matches\n\n if (isNextSmallWidthViewport !== isSmallWidthViewport) {\n setIsSmallWidthViewport(isNextSmallWidthViewport)\n }\n }\n updateViewPortWidth()\n window.addEventListener('resize', updateViewPortWidth)\n\n return () => {\n window.removeEventListener('resize', updateViewPortWidth)\n }\n }, [isSmallWidthViewport])\n\n const ErrorBoundaryComponent = LexicalErrorBoundary.default || LexicalErrorBoundary\n\n return (\n <React.Fragment>\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'top') {\n return <EditorPlugin key={plugin.key} plugin={plugin} />\n }\n })}\n <RichTextPlugin\n //@ts-expect-error ts being dumb\n ErrorBoundary={ErrorBoundaryComponent}\n contentEditable={\n <div className=\"editor-scroller\">\n <div className=\"editor\" ref={onRef}>\n <LexicalContentEditable />\n </div>\n </div>\n }\n placeholder={\n <p className=\"editor-placeholder\">Start typing, or press '/' for commands...</p>\n }\n />\n <OnChangePlugin\n // Selection changes can be ignored here, reducing the\n // frequency that the FieldComponent and Payload receive updates.\n // Selection changes are only needed if you are saving selection state\n ignoreSelectionChange\n onChange={(editorState, editor, tags) => {\n // Ignore any onChange event triggered by focus only\n if (!tags.has('focus') || tags.size > 1) {\n if (onChange != null) onChange(editorState, editor, tags)\n }\n }}\n />\n {floatingAnchorElem && (\n <React.Fragment>\n {!isSmallWidthViewport && editor.isEditable() && (\n <React.Fragment>\n <DraggableBlockPlugin anchorElem={floatingAnchorElem} />\n <AddBlockHandlePlugin anchorElem={floatingAnchorElem} />\n </React.Fragment>\n )}\n {editorConfig.features.plugins.map((plugin) => {\n if (\n plugin.position === 'floatingAnchorElem' &&\n !(plugin.desktopOnly === true && isSmallWidthViewport)\n ) {\n return (\n <EditorPlugin anchorElem={floatingAnchorElem} key={plugin.key} plugin={plugin} />\n )\n }\n })}\n {editor.isEditable() && (\n <React.Fragment>\n <FloatingSelectToolbarPlugin anchorElem={floatingAnchorElem} />\n <SlashMenuPlugin anchorElem={floatingAnchorElem} />\n </React.Fragment>\n )}\n </React.Fragment>\n )}\n {editor.isEditable() && (\n <React.Fragment>\n <HistoryPlugin />\n {editorConfig?.features?.markdownTransformers?.length > 0 && <MarkdownShortcutPlugin />}\n </React.Fragment>\n )}\n\n <TabIndentationPlugin />\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'normal') {\n return <EditorPlugin key={plugin.key} plugin={plugin} />\n }\n })}\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'bottom') {\n return <EditorPlugin key={plugin.key} plugin={plugin} />\n }\n })}\n </React.Fragment>\n )\n}\n"],"names":["useLexicalComposerContext","LexicalErrorBoundary","HistoryPlugin","OnChangePlugin","RichTextPlugin","TabIndentationPlugin","React","useEffect","useState","EditorPlugin","MarkdownShortcutPlugin","SlashMenuPlugin","AddBlockHandlePlugin","DraggableBlockPlugin","FloatingSelectToolbarPlugin","LexicalContentEditable","LexicalEditor","props","editorConfig","onChange","editor","floatingAnchorElem","setFloatingAnchorElem","onRef","_floatingAnchorElem","isSmallWidthViewport","setIsSmallWidthViewport","updateViewPortWidth","isNextSmallWidthViewport","window","matchMedia","matches","addEventListener","removeEventListener","ErrorBoundaryComponent","default","Fragment","features","plugins","map","plugin","position","key","ErrorBoundary","contentEditable","div","className","ref","placeholder","p","ignoreSelectionChange","editorState","tags","has","size","isEditable","anchorElem","desktopOnly","markdownTransformers","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,OAAOC,0BAA0B,yCAAwC;AACzE,SAASC,aAAa,QAAQ,yCAAwC;AACtE,SAASC,cAAc,QAAQ,0CAAyC;A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KAAK,UAAU;YAChC,qBAAO,oBAAChC;gBAAaiC,KAAKF,OAAOE,GAAG;gBAAEF,QAAQA;;QAChD;IACF,IACCtB,aAAamB,QAAQ,CAACC,OAAO,CAACC,GAAG,CAAC,CAACC;QAClC,IAAIA,OAAOC,QAAQ,KAAK,UAAU;YAChC,qBAAO,oBAAChC;gBAAaiC,KAAKF,OAAOE,GAAG;gBAAEF,QAAQA;;QAChD;IACF;AAGN,EAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import '../../scss/styles';
|
|
2
|
+
|
|
1
3
|
.rich-text-lexical {
|
|
2
4
|
.editor {
|
|
3
5
|
position: relative;
|
|
@@ -23,7 +25,7 @@
|
|
|
23
25
|
.editor-placeholder {
|
|
24
26
|
position: absolute;
|
|
25
27
|
top: 8px;
|
|
26
|
-
left:
|
|
28
|
+
left: 0;
|
|
27
29
|
font-size: 15px;
|
|
28
30
|
color: var(--theme-elevation-500);
|
|
29
31
|
/* Prevent text selection */
|
|
@@ -36,21 +38,3 @@
|
|
|
36
38
|
pointer-events: none;
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
|
-
|
|
40
|
-
.floating-select-toolbar-popup__section-dropdown-align {
|
|
41
|
-
display: flex;
|
|
42
|
-
gap: 2px;
|
|
43
|
-
}
|
|
44
|
-
.floating-select-toolbar-popup__section-features {
|
|
45
|
-
display: flex;
|
|
46
|
-
gap: 2px;
|
|
47
|
-
}
|
|
48
|
-
.floating-select-toolbar-popup__section-dropdown-text {
|
|
49
|
-
display: flex;
|
|
50
|
-
gap: 2px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.floating-select-toolbar-popup__section-format {
|
|
54
|
-
display: flex;
|
|
55
|
-
gap: 2px;
|
|
56
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/client/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElE,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACnG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE9D,eAAO,MAAM,sBAAsB,0CAEhC,
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/client/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElE,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACnG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE9D,eAAO,MAAM,sBAAsB,0CAEhC,uBAgMF,CAAA;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,mBAAmB,EAC5B,wBAAwB,EAAE,wBAAwB,GACjD,2BAA2B,CAM7B"}
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
export const sanitizeClientFeatures = (features)=>{
|
|
3
3
|
const sanitized = {
|
|
4
4
|
enabledFeatures: [],
|
|
5
|
-
floatingSelectToolbar: {
|
|
6
|
-
sections: []
|
|
7
|
-
},
|
|
8
5
|
hooks: {
|
|
9
6
|
load: [],
|
|
10
7
|
save: []
|
|
@@ -13,8 +10,14 @@ export const sanitizeClientFeatures = (features)=>{
|
|
|
13
10
|
nodes: [],
|
|
14
11
|
plugins: [],
|
|
15
12
|
slashMenu: {
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
dynamicGroups: [],
|
|
14
|
+
groups: []
|
|
15
|
+
},
|
|
16
|
+
toolbarFixed: {
|
|
17
|
+
groups: []
|
|
18
|
+
},
|
|
19
|
+
toolbarInline: {
|
|
20
|
+
groups: []
|
|
18
21
|
}
|
|
19
22
|
};
|
|
20
23
|
if (!features?.size) {
|
|
@@ -41,45 +44,64 @@ export const sanitizeClientFeatures = (features)=>{
|
|
|
41
44
|
});
|
|
42
45
|
});
|
|
43
46
|
}
|
|
44
|
-
if (feature.
|
|
45
|
-
for (const
|
|
46
|
-
// 1. find the
|
|
47
|
-
let
|
|
48
|
-
if (!
|
|
49
|
-
|
|
50
|
-
...
|
|
51
|
-
|
|
47
|
+
if (feature.toolbarInline?.groups?.length) {
|
|
48
|
+
for (const group of feature.toolbarInline.groups){
|
|
49
|
+
// 1. find the group with the same key or create new one
|
|
50
|
+
let foundGroup = sanitized.toolbarInline.groups.find((sanitizedGroup)=>sanitizedGroup.key === group.key);
|
|
51
|
+
if (!foundGroup) {
|
|
52
|
+
foundGroup = {
|
|
53
|
+
...group,
|
|
54
|
+
items: []
|
|
55
|
+
};
|
|
56
|
+
} else {
|
|
57
|
+
sanitized.toolbarInline.groups = sanitized.toolbarInline.groups.filter((sanitizedGroup)=>sanitizedGroup.key !== group.key);
|
|
58
|
+
}
|
|
59
|
+
// 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions
|
|
60
|
+
if (group?.items?.length) {
|
|
61
|
+
foundGroup.items = foundGroup.items.concat(group.items);
|
|
62
|
+
}
|
|
63
|
+
sanitized.toolbarInline?.groups.push(foundGroup);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (feature.toolbarFixed?.groups?.length) {
|
|
67
|
+
for (const group of feature.toolbarFixed.groups){
|
|
68
|
+
// 1. find the group with the same key or create new one
|
|
69
|
+
let foundGroup = sanitized.toolbarFixed.groups.find((sanitizedGroup)=>sanitizedGroup.key === group.key);
|
|
70
|
+
if (!foundGroup) {
|
|
71
|
+
foundGroup = {
|
|
72
|
+
...group,
|
|
73
|
+
items: []
|
|
52
74
|
};
|
|
53
75
|
} else {
|
|
54
|
-
sanitized.
|
|
76
|
+
sanitized.toolbarFixed.groups = sanitized.toolbarFixed.groups.filter((sanitizedGroup)=>sanitizedGroup.key !== group.key);
|
|
55
77
|
}
|
|
56
78
|
// 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions
|
|
57
|
-
if (
|
|
58
|
-
|
|
79
|
+
if (group?.items?.length) {
|
|
80
|
+
foundGroup.items = foundGroup.items.concat(group.items);
|
|
59
81
|
}
|
|
60
|
-
sanitized.
|
|
82
|
+
sanitized.toolbarFixed?.groups.push(foundGroup);
|
|
61
83
|
}
|
|
62
84
|
}
|
|
63
|
-
if (feature.slashMenu?.
|
|
64
|
-
if (feature.slashMenu.
|
|
65
|
-
sanitized.slashMenu.
|
|
85
|
+
if (feature.slashMenu?.groups) {
|
|
86
|
+
if (feature.slashMenu.dynamicGroups?.length) {
|
|
87
|
+
sanitized.slashMenu.dynamicGroups = sanitized.slashMenu.dynamicGroups.concat(feature.slashMenu.dynamicGroups);
|
|
66
88
|
}
|
|
67
|
-
for (const optionGroup of feature.slashMenu.
|
|
89
|
+
for (const optionGroup of feature.slashMenu.groups){
|
|
68
90
|
// 1. find the group with the same name or create new one
|
|
69
|
-
let group = sanitized.slashMenu.
|
|
91
|
+
let group = sanitized.slashMenu.groups.find((group)=>group.key === optionGroup.key);
|
|
70
92
|
if (!group) {
|
|
71
93
|
group = {
|
|
72
94
|
...optionGroup,
|
|
73
|
-
|
|
95
|
+
items: []
|
|
74
96
|
};
|
|
75
97
|
} else {
|
|
76
|
-
sanitized.slashMenu.
|
|
98
|
+
sanitized.slashMenu.groups = sanitized.slashMenu.groups.filter((group)=>group.key !== optionGroup.key);
|
|
77
99
|
}
|
|
78
100
|
// 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions
|
|
79
|
-
if (optionGroup?.
|
|
80
|
-
group.
|
|
101
|
+
if (optionGroup?.items?.length) {
|
|
102
|
+
group.items = group.items.concat(optionGroup.items);
|
|
81
103
|
}
|
|
82
|
-
sanitized.slashMenu.
|
|
104
|
+
sanitized.slashMenu.groups.push(group);
|
|
83
105
|
}
|
|
84
106
|
}
|
|
85
107
|
if (feature.markdownTransformers?.length) {
|
|
@@ -87,8 +109,8 @@ export const sanitizeClientFeatures = (features)=>{
|
|
|
87
109
|
}
|
|
88
110
|
sanitized.enabledFeatures.push(feature.key);
|
|
89
111
|
});
|
|
90
|
-
// Sort sanitized.
|
|
91
|
-
sanitized.
|
|
112
|
+
// Sort sanitized.toolbarInline.groups by order property
|
|
113
|
+
sanitized.toolbarInline.groups.sort((a, b)=>{
|
|
92
114
|
if (a.order && b.order) {
|
|
93
115
|
return a.order - b.order;
|
|
94
116
|
} else if (a.order) {
|
|
@@ -99,9 +121,35 @@ export const sanitizeClientFeatures = (features)=>{
|
|
|
99
121
|
return 0;
|
|
100
122
|
}
|
|
101
123
|
});
|
|
102
|
-
// Sort sanitized.
|
|
103
|
-
|
|
104
|
-
|
|
124
|
+
// Sort sanitized.toolbarFixed.groups by order property
|
|
125
|
+
sanitized.toolbarFixed.groups.sort((a, b)=>{
|
|
126
|
+
if (a.order && b.order) {
|
|
127
|
+
return a.order - b.order;
|
|
128
|
+
} else if (a.order) {
|
|
129
|
+
return -1;
|
|
130
|
+
} else if (b.order) {
|
|
131
|
+
return 1;
|
|
132
|
+
} else {
|
|
133
|
+
return 0;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
// Sort sanitized.toolbarInline.groups.[group].entries by order property
|
|
137
|
+
for (const group of sanitized.toolbarInline.groups){
|
|
138
|
+
group.items.sort((a, b)=>{
|
|
139
|
+
if (a.order && b.order) {
|
|
140
|
+
return a.order - b.order;
|
|
141
|
+
} else if (a.order) {
|
|
142
|
+
return -1;
|
|
143
|
+
} else if (b.order) {
|
|
144
|
+
return 1;
|
|
145
|
+
} else {
|
|
146
|
+
return 0;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
// Sort sanitized.toolbarFixed.groups.[group].entries by order property
|
|
151
|
+
for (const group of sanitized.toolbarFixed.groups){
|
|
152
|
+
group.items.sort((a, b)=>{
|
|
105
153
|
if (a.order && b.order) {
|
|
106
154
|
return a.order - b.order;
|
|
107
155
|
} else if (a.order) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/lexical/config/client/sanitize.ts"],"sourcesContent":["'use client'\n\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport type { ResolvedClientFeatureMap, SanitizedClientFeatures } from '../../../features/types.js'\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\nexport const sanitizeClientFeatures = (\n features: ResolvedClientFeatureMap,\n): SanitizedClientFeatures => {\n const sanitized: SanitizedClientFeatures = {\n enabledFeatures: [],\n floatingSelectToolbar: {\n sections: [],\n },\n hooks: {\n load: [],\n save: [],\n },\n markdownTransformers: [],\n nodes: [],\n plugins: [],\n slashMenu: {\n dynamicOptions: [],\n groupsWithOptions: [],\n },\n }\n\n if (!features?.size) {\n return sanitized\n }\n\n features.forEach((feature) => {\n if (feature.hooks) {\n if (feature.hooks?.load?.length) {\n sanitized.hooks.load = sanitized.hooks.load.concat(feature.hooks.load)\n }\n if (feature.hooks?.save?.length) {\n sanitized.hooks.save = sanitized.hooks.save.concat(feature.hooks.save)\n }\n }\n\n if (feature.nodes?.length) {\n sanitized.nodes = sanitized.nodes.concat(feature.nodes)\n }\n if (feature.plugins?.length) {\n feature.plugins.forEach((plugin, i) => {\n sanitized.plugins.push({\n Component: plugin.Component,\n key: feature.key + i,\n position: plugin.position,\n })\n })\n }\n\n if (feature.floatingSelectToolbar?.sections?.length) {\n for (const section of feature.floatingSelectToolbar.sections) {\n // 1. find the section with the same key or create new one\n let foundSection = sanitized.floatingSelectToolbar.sections.find(\n (sanitizedSection) => sanitizedSection.key === section.key,\n )\n if (!foundSection) {\n foundSection = {\n ...section,\n entries: [],\n }\n } else {\n sanitized.floatingSelectToolbar.sections =\n sanitized.floatingSelectToolbar.sections.filter(\n (sanitizedSection) => sanitizedSection.key !== section.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (section?.entries?.length) {\n foundSection.entries = foundSection.entries.concat(section.entries)\n }\n sanitized.floatingSelectToolbar?.sections.push(foundSection)\n }\n }\n\n if (feature.slashMenu?.options) {\n if (feature.slashMenu.dynamicOptions?.length) {\n sanitized.slashMenu.dynamicOptions = sanitized.slashMenu.dynamicOptions.concat(\n feature.slashMenu.dynamicOptions,\n )\n }\n\n for (const optionGroup of feature.slashMenu.options) {\n // 1. find the group with the same name or create new one\n let group = sanitized.slashMenu.groupsWithOptions.find(\n (group) => group.key === optionGroup.key,\n )\n if (!group) {\n group = {\n ...optionGroup,\n options: [],\n }\n } else {\n sanitized.slashMenu.groupsWithOptions = sanitized.slashMenu.groupsWithOptions.filter(\n (group) => group.key !== optionGroup.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (optionGroup?.options?.length) {\n group.options = group.options.concat(optionGroup.options)\n }\n sanitized.slashMenu.groupsWithOptions.push(group)\n }\n }\n\n if (feature.markdownTransformers?.length) {\n sanitized.markdownTransformers = sanitized.markdownTransformers.concat(\n feature.markdownTransformers,\n )\n }\n sanitized.enabledFeatures.push(feature.key)\n })\n\n // Sort sanitized.floatingSelectToolbar.sections by order property\n sanitized.floatingSelectToolbar.sections.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n\n // Sort sanitized.floatingSelectToolbar.sections.[section].entries by order property\n for (const section of sanitized.floatingSelectToolbar.sections) {\n section.entries.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n }\n\n return sanitized\n}\n\nexport function sanitizeClientEditorConfig(\n lexical: LexicalEditorConfig,\n resolvedClientFeatureMap: ResolvedClientFeatureMap,\n): SanitizedClientEditorConfig {\n return {\n features: sanitizeClientFeatures(resolvedClientFeatureMap),\n lexical,\n resolvedFeatureMap: resolvedClientFeatureMap,\n }\n}\n"],"names":["sanitizeClientFeatures","features","sanitized","enabledFeatures","floatingSelectToolbar","sections","hooks","load","save","markdownTransformers","nodes","plugins","slashMenu","dynamicOptions","groupsWithOptions","size","forEach","feature","length","concat","plugin","i","push","Component","key","position","section","foundSection","find","sanitizedSection","entries","filter","options","optionGroup","group","sort","a","b","order","sanitizeClientEditorConfig","lexical","resolvedClientFeatureMap","resolvedFeatureMap"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAOA,OAAO,MAAMA,yBAAyB,CACpCC;IAEA,MAAMC,YAAqC;QACzCC,iBAAiB,EAAE;QACnBC,uBAAuB;YACrBC,UAAU,EAAE;QACd;QACAC,OAAO;YACLC,MAAM,EAAE;YACRC,MAAM,EAAE;QACV;QACAC,sBAAsB,EAAE;QACxBC,OAAO,EAAE;QACTC,SAAS,EAAE;QACXC,WAAW;YACTC,gBAAgB,EAAE;YAClBC,mBAAmB,EAAE;QACvB;IACF;IAEA,IAAI,CAACb,UAAUc,MAAM;QACnB,OAAOb;IACT;IAEAD,SAASe,OAAO,CAAC,CAACC;QAChB,IAAIA,QAAQX,KAAK,EAAE;YACjB,IAAIW,QAAQX,KAAK,EAAEC,MAAMW,QAAQ;gBAC/BhB,UAAUI,KAAK,CAACC,IAAI,GAAGL,UAAUI,KAAK,CAACC,IAAI,CAACY,MAAM,CAACF,QAAQX,KAAK,CAACC,IAAI;YACvE;YACA,IAAIU,QAAQX,KAAK,EAAEE,MAAMU,QAAQ;gBAC/BhB,UAAUI,KAAK,CAACE,IAAI,GAAGN,UAAUI,KAAK,CAACE,IAAI,CAACW,MAAM,CAACF,QAAQX,KAAK,CAACE,IAAI;YACvE;QACF;QAEA,IAAIS,QAAQP,KAAK,EAAEQ,QAAQ;YACzBhB,UAAUQ,KAAK,GAAGR,UAAUQ,KAA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AC,CAACC,GAAGC;YACvB,IAAID,EAAEE,KAAK,IAAID,EAAEC,KAAK,EAAE;gBACtB,OAAOF,EAAEE,KAAK,GAAGD,EAAEC,KAAK;YAC1B,OAAO,IAAIF,EAAEE,KAAK,EAAE;gBAClB,OAAO,CAAC;YACV,OAAO,IAAID,EAAEC,KAAK,EAAE;gBAClB,OAAO;YACT,OAAO;gBACL,OAAO;YACT;QACF;IACF;IAEA,OAAOpC;AACT,EAAC;AAED,OAAO,SAASqC,2BACdC,OAA4B,EAC5BC,wBAAkD;IAElD,OAAO;QACLxC,UAAUD,uBAAuByC;QACjCD;QACAE,oBAAoBD;IACtB;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/lexical/config/client/sanitize.ts"],"sourcesContent":["'use client'\n\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport type { ResolvedClientFeatureMap, SanitizedClientFeatures } from '../../../features/types.js'\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\nexport const sanitizeClientFeatures = (\n features: ResolvedClientFeatureMap,\n): SanitizedClientFeatures => {\n const sanitized: SanitizedClientFeatures = {\n enabledFeatures: [],\n hooks: {\n load: [],\n save: [],\n },\n markdownTransformers: [],\n nodes: [],\n plugins: [],\n slashMenu: {\n dynamicGroups: [],\n groups: [],\n },\n toolbarFixed: {\n groups: [],\n },\n toolbarInline: {\n groups: [],\n },\n }\n\n if (!features?.size) {\n return sanitized\n }\n\n features.forEach((feature) => {\n if (feature.hooks) {\n if (feature.hooks?.load?.length) {\n sanitized.hooks.load = sanitized.hooks.load.concat(feature.hooks.load)\n }\n if (feature.hooks?.save?.length) {\n sanitized.hooks.save = sanitized.hooks.save.concat(feature.hooks.save)\n }\n }\n\n if (feature.nodes?.length) {\n sanitized.nodes = sanitized.nodes.concat(feature.nodes)\n }\n if (feature.plugins?.length) {\n feature.plugins.forEach((plugin, i) => {\n sanitized.plugins.push({\n Component: plugin.Component,\n key: feature.key + i,\n position: plugin.position,\n })\n })\n }\n\n if (feature.toolbarInline?.groups?.length) {\n for (const group of feature.toolbarInline.groups) {\n // 1. find the group with the same key or create new one\n let foundGroup = sanitized.toolbarInline.groups.find(\n (sanitizedGroup) => sanitizedGroup.key === group.key,\n )\n if (!foundGroup) {\n foundGroup = {\n ...group,\n items: [],\n }\n } else {\n sanitized.toolbarInline.groups = sanitized.toolbarInline.groups.filter(\n (sanitizedGroup) => sanitizedGroup.key !== group.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (group?.items?.length) {\n foundGroup.items = foundGroup.items.concat(group.items)\n }\n sanitized.toolbarInline?.groups.push(foundGroup)\n }\n }\n\n if (feature.toolbarFixed?.groups?.length) {\n for (const group of feature.toolbarFixed.groups) {\n // 1. find the group with the same key or create new one\n let foundGroup = sanitized.toolbarFixed.groups.find(\n (sanitizedGroup) => sanitizedGroup.key === group.key,\n )\n if (!foundGroup) {\n foundGroup = {\n ...group,\n items: [],\n }\n } else {\n sanitized.toolbarFixed.groups = sanitized.toolbarFixed.groups.filter(\n (sanitizedGroup) => sanitizedGroup.key !== group.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (group?.items?.length) {\n foundGroup.items = foundGroup.items.concat(group.items)\n }\n sanitized.toolbarFixed?.groups.push(foundGroup)\n }\n }\n\n if (feature.slashMenu?.groups) {\n if (feature.slashMenu.dynamicGroups?.length) {\n sanitized.slashMenu.dynamicGroups = sanitized.slashMenu.dynamicGroups.concat(\n feature.slashMenu.dynamicGroups,\n )\n }\n\n for (const optionGroup of feature.slashMenu.groups) {\n // 1. find the group with the same name or create new one\n let group = sanitized.slashMenu.groups.find((group) => group.key === optionGroup.key)\n if (!group) {\n group = {\n ...optionGroup,\n items: [],\n }\n } else {\n sanitized.slashMenu.groups = sanitized.slashMenu.groups.filter(\n (group) => group.key !== optionGroup.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (optionGroup?.items?.length) {\n group.items = group.items.concat(optionGroup.items)\n }\n sanitized.slashMenu.groups.push(group)\n }\n }\n\n if (feature.markdownTransformers?.length) {\n sanitized.markdownTransformers = sanitized.markdownTransformers.concat(\n feature.markdownTransformers,\n )\n }\n sanitized.enabledFeatures.push(feature.key)\n })\n\n // Sort sanitized.toolbarInline.groups by order property\n sanitized.toolbarInline.groups.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n // Sort sanitized.toolbarFixed.groups by order property\n sanitized.toolbarFixed.groups.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n\n // Sort sanitized.toolbarInline.groups.[group].entries by order property\n for (const group of sanitized.toolbarInline.groups) {\n group.items.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n }\n\n // Sort sanitized.toolbarFixed.groups.[group].entries by order property\n for (const group of sanitized.toolbarFixed.groups) {\n group.items.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n }\n\n return sanitized\n}\n\nexport function sanitizeClientEditorConfig(\n lexical: LexicalEditorConfig,\n resolvedClientFeatureMap: ResolvedClientFeatureMap,\n): SanitizedClientEditorConfig {\n return {\n features: sanitizeClientFeatures(resolvedClientFeatureMap),\n lexical,\n resolvedFeatureMap: resolvedClientFeatureMap,\n }\n}\n"],"names":["sanitizeClientFeatures","features","sanitized","enabledFeatures","hooks","load","save","markdownTransformers","nodes","plugins","slashMenu","dynamicGroups","groups","toolbarFixed","toolbarInline","size","forEach","feature","length","concat","plugin","i","push","Component","key","position","group","foundGroup","find","sanitizedGroup","items","filter","optionGroup","sort","a","b","order","sanitizeClientEditorConfig","lexical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AAEC,KAAK,EAAE;gBACtB,OAAOF,EAAEE,KAAK,GAAGD,EAAEC,KAAK;YAC1B,OAAO,IAAIF,EAAEE,KAAK,EAAE;gBAClB,OAAO,CAAC;YACV,OAAO,IAAID,EAAEC,KAAK,EAAE;gBAClB,OAAO;YACT,OAAO;gBACL,OAAO;YACT;QACF;IACF;IAEA,OAAOlC;AACT,EAAC;AAED,OAAO,SAASmC,2BACdC,OAA4B,EAC5BC,wBAAkD;IAElD,OAAO;QACLtC,UAAUD,uBAAuBuC;QACjCD;QACAE,oBAAoBD;IACtB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/default.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/default.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAuBrD,eAAO,MAAM,0BAA0B,EAAE,mBAGxC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAoB1E,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,kBAGjC,CAAA"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { AlignFeature } from '../../../features/align/feature.server.js';
|
|
2
2
|
import { BlockQuoteFeature } from '../../../features/blockquote/feature.server.js';
|
|
3
3
|
import { BoldFeature } from '../../../features/format/bold/feature.server.js';
|
|
4
|
-
import { InlineCodeFeature } from '../../../features/format/
|
|
4
|
+
import { InlineCodeFeature } from '../../../features/format/inlineCode/feature.server.js';
|
|
5
5
|
import { ItalicFeature } from '../../../features/format/italic/feature.server.js';
|
|
6
6
|
import { StrikethroughFeature } from '../../../features/format/strikethrough/feature.server.js';
|
|
7
7
|
import { SubscriptFeature } from '../../../features/format/subscript/feature.server.js';
|
|
8
8
|
import { SuperscriptFeature } from '../../../features/format/superscript/feature.server.js';
|
|
9
9
|
import { UnderlineFeature } from '../../../features/format/underline/feature.server.js';
|
|
10
10
|
import { HeadingFeature } from '../../../features/heading/feature.server.js';
|
|
11
|
-
import { HorizontalRuleFeature } from '../../../features/
|
|
11
|
+
import { HorizontalRuleFeature } from '../../../features/horizontalRule/feature.server.js';
|
|
12
12
|
import { IndentFeature } from '../../../features/indent/feature.server.js';
|
|
13
13
|
import { LinkFeature } from '../../../features/link/feature.server.js';
|
|
14
|
-
import {
|
|
15
|
-
import { OrderedListFeature } from '../../../features/lists/
|
|
16
|
-
import { UnorderedListFeature } from '../../../features/lists/
|
|
14
|
+
import { ChecklistFeature } from '../../../features/lists/checklist/feature.server.js';
|
|
15
|
+
import { OrderedListFeature } from '../../../features/lists/orderedList/feature.server.js';
|
|
16
|
+
import { UnorderedListFeature } from '../../../features/lists/unorderedList/feature.server.js';
|
|
17
17
|
import { ParagraphFeature } from '../../../features/paragraph/feature.server.js';
|
|
18
18
|
import { RelationshipFeature } from '../../../features/relationship/feature.server.js';
|
|
19
19
|
import { UploadFeature } from '../../../features/upload/feature.server.js';
|
|
@@ -36,7 +36,7 @@ export const defaultEditorFeatures = [
|
|
|
36
36
|
IndentFeature(),
|
|
37
37
|
UnorderedListFeature(),
|
|
38
38
|
OrderedListFeature(),
|
|
39
|
-
|
|
39
|
+
ChecklistFeature(),
|
|
40
40
|
LinkFeature(),
|
|
41
41
|
RelationshipFeature(),
|
|
42
42
|
BlockQuoteFeature(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/lexical/config/server/default.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport type { FeatureProviderServer } from '../../../features/types.js'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/lexical/config/server/default.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport type { FeatureProviderServer } from '../../../features/types.js'\nimport type { ServerEditorConfig } from '../types.js'\n\nimport { AlignFeature } from '../../../features/align/feature.server.js'\nimport { BlockQuoteFeature } from '../../../features/blockquote/feature.server.js'\nimport { BoldFeature } from '../../../features/format/bold/feature.server.js'\nimport { InlineCodeFeature } from '../../../features/format/inlineCode/feature.server.js'\nimport { ItalicFeature } from '../../../features/format/italic/feature.server.js'\nimport { StrikethroughFeature } from '../../../features/format/strikethrough/feature.server.js'\nimport { SubscriptFeature } from '../../../features/format/subscript/feature.server.js'\nimport { SuperscriptFeature } from '../../../features/format/superscript/feature.server.js'\nimport { UnderlineFeature } from '../../../features/format/underline/feature.server.js'\nimport { HeadingFeature } from '../../../features/heading/feature.server.js'\nimport { HorizontalRuleFeature } from '../../../features/horizontalRule/feature.server.js'\nimport { IndentFeature } from '../../../features/indent/feature.server.js'\nimport { LinkFeature } from '../../../features/link/feature.server.js'\nimport { ChecklistFeature } from '../../../features/lists/checklist/feature.server.js'\nimport { OrderedListFeature } from '../../../features/lists/orderedList/feature.server.js'\nimport { UnorderedListFeature } from '../../../features/lists/unorderedList/feature.server.js'\nimport { ParagraphFeature } from '../../../features/paragraph/feature.server.js'\nimport { RelationshipFeature } from '../../../features/relationship/feature.server.js'\nimport { UploadFeature } from '../../../features/upload/feature.server.js'\nimport { LexicalEditorTheme } from '../../theme/EditorTheme.js'\n\nexport const defaultEditorLexicalConfig: LexicalEditorConfig = {\n namespace: 'lexical',\n theme: LexicalEditorTheme,\n}\n\nexport const defaultEditorFeatures: FeatureProviderServer<unknown, unknown>[] = [\n BoldFeature(),\n ItalicFeature(),\n UnderlineFeature(),\n StrikethroughFeature(),\n SubscriptFeature(),\n SuperscriptFeature(),\n InlineCodeFeature(),\n ParagraphFeature(),\n HeadingFeature(),\n AlignFeature(),\n IndentFeature(),\n UnorderedListFeature(),\n OrderedListFeature(),\n ChecklistFeature(),\n LinkFeature(),\n RelationshipFeature(),\n BlockQuoteFeature(),\n UploadFeature(),\n HorizontalRuleFeature(),\n]\n\nexport const defaultEditorConfig: ServerEditorConfig = {\n features: defaultEditorFeatures,\n lexical: defaultEditorLexicalConfig,\n}\n"],"names":["AlignFeature","BlockQuoteFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","UploadFeature","LexicalEditorTheme","defaultEditorLexicalConfig","namespace","theme","defaultEditorFeatures","defaultEditorConfig","features","lexical"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,SAASA,YAAY,QAAQ,4CAA2C;AACxE,SAASC,iBAAiB,QAAQ,iDAAgD;AAClF,SAASC,WAAW,QAAQ,kDAAiD;AAC7E,SAASC,iBAAiB,QAAQ,wDAAuD;AACzF,SAASC,aAAa,QAAQ,oDAAmD;AACjF,SAASC,oBAAoB,QAAQ,2DAA0D;AAC/F,SAASC,gBAAgB,QAAQ,uDAAsD;AACvF,SAASC,kBAAkB,QAAQ,yDAAwD;AAC3F,SAASC,gBAAgB,QAAQ,uDAAsD;AACvF,SAASC,cAAc,QAAQ,8CAA6C;AAC5E,SAASC,qBAAqB,QAAQ,qDAAoD;AAC1F,SAASC,aAAa,QAAQ,6CAA4C;AAC1E,SAASC,WAAW,QAAQ,2CAA0C;AACtE,SAASC,gBAAgB,QAAQ,sDAAqD;AACtF,SAASC,kBAAkB,QAAQ,wDAAuD;AAC1F,SAASC,oBAAoB,QAAQ,0DAAyD;AAC9F,SAASC,gBAAgB,QAAQ,gDAA+C;AAChF,SAASC,mBAAmB,QAAQ,mDAAkD;AACtF,SAASC,aAAa,QAAQ,6CAA4C;AAC1E,SAASC,kBAAkB,QAAQ,6BAA4B;AAE/D,OAAO,MAAMC,6BAAkD;IAC7DC,WAAW;IACXC,OAAOH;AACT,EAAC;AAED,OAAO,MAAMI,wBAAmE;IAC9ErB;IACAE;IACAI;IACAH;IACAC;IACAC;IACAJ;IACAa;IACAP;IACAT;IACAW;IACAI;IACAD;IACAD;IACAD;IACAK;IACAhB;IACAiB;IACAR;CACD,CAAA;AAED,OAAO,MAAMc,sBAA0C;IACrDC,UAAUF;IACVG,SAASN;AACX,EAAC"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import type { LexicalCommand, LexicalEditor, TextNode } from 'lexical';
|
|
2
2
|
import type { MutableRefObject, ReactPortal } from 'react';
|
|
3
3
|
import type { MenuTextMatch } from '../useMenuTriggerMatch.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { SlashMenuGroupInternal, SlashMenuItem, SlashMenuItemInternal } from './types.js';
|
|
5
5
|
export type MenuResolution = {
|
|
6
6
|
getRect: () => DOMRect;
|
|
7
7
|
match?: MenuTextMatch;
|
|
8
8
|
};
|
|
9
9
|
export type MenuRenderFn = (anchorElementRef: MutableRefObject<HTMLElement | null>, itemProps: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
groups: Array<SlashMenuGroupInternal>;
|
|
11
|
+
selectItemAndCleanUp: (selectedItem: SlashMenuItem) => void;
|
|
12
|
+
selectedItemKey: null | string;
|
|
13
|
+
setSelectedItemKey: (itemKey: string) => void;
|
|
14
14
|
}, matchingString: null | string) => JSX.Element | ReactPortal | null;
|
|
15
15
|
export declare function getScrollParent(element: HTMLElement, includeHidden: boolean): HTMLBodyElement | HTMLElement;
|
|
16
16
|
export declare function useDynamicPositioning(resolution: MenuResolution | null, targetElement: HTMLElement | null, onReposition: () => void, onVisibilityChange?: (isInView: boolean) => void): void;
|
|
17
17
|
export declare const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{
|
|
18
18
|
index: number;
|
|
19
|
-
|
|
19
|
+
item: SlashMenuItemInternal;
|
|
20
20
|
}>;
|
|
21
|
-
export declare function LexicalMenu({ anchorElementRef, close, editor,
|
|
21
|
+
export declare function LexicalMenu({ anchorElementRef, close, editor, groups, menuRenderFn, onSelectItem, resolution, shouldSplitNodeWithQuery, }: {
|
|
22
22
|
anchorElementRef: MutableRefObject<HTMLElement>;
|
|
23
23
|
close: () => void;
|
|
24
24
|
editor: LexicalEditor;
|
|
25
|
-
|
|
25
|
+
groups: Array<SlashMenuGroupInternal>;
|
|
26
26
|
menuRenderFn: MenuRenderFn;
|
|
27
|
-
|
|
27
|
+
onSelectItem: (item: SlashMenuItem, textNodeContainingQuery: TextNode | null, closeMenu: () => void, matchingString: string) => void;
|
|
28
28
|
resolution: MenuResolution;
|
|
29
29
|
shouldSplitNodeWithQuery?: boolean;
|
|
30
30
|
}): JSX.Element | null;
|
package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LexicalMenu.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAiB1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"LexicalMenu.d.ts","sourceRoot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