@payloadcms/richtext-lexical 3.0.0-alpha.67 → 3.0.0-alpha.68
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
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
import { $createHeadingNode, HeadingNode } from '@lexical/rich-text';
|
|
3
3
|
import { $setBlocksType } from '@lexical/selection';
|
|
4
4
|
import { $getSelection } from 'lexical';
|
|
5
|
-
import { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
|
|
6
5
|
import { H1Icon } from '../../lexical/ui/icons/H1/index.js';
|
|
7
6
|
import { H2Icon } from '../../lexical/ui/icons/H2/index.js';
|
|
8
7
|
import { H3Icon } from '../../lexical/ui/icons/H3/index.js';
|
|
9
8
|
import { H4Icon } from '../../lexical/ui/icons/H4/index.js';
|
|
10
9
|
import { H5Icon } from '../../lexical/ui/icons/H5/index.js';
|
|
11
10
|
import { H6Icon } from '../../lexical/ui/icons/H6/index.js';
|
|
12
|
-
import { TextDropdownSectionWithEntries } from '../common/floatingSelectToolbarTextDropdownSection/index.js';
|
|
13
11
|
import { createClientComponent } from '../createClientComponent.js';
|
|
12
|
+
import { inlineToolbarTextDropdownGroupWithItems } from '../shared/inlineToolbar/textDropdownGroup.js';
|
|
14
13
|
import { MarkdownTransformer } from './markdownTransformer.js';
|
|
15
14
|
const setHeading = (headingSize)=>{
|
|
16
15
|
const selection = $getSelection();
|
|
@@ -38,24 +37,6 @@ const HeadingFeatureClient = (props)=>{
|
|
|
38
37
|
feature: ()=>{
|
|
39
38
|
return {
|
|
40
39
|
clientFeatureProps: props,
|
|
41
|
-
floatingSelectToolbar: {
|
|
42
|
-
sections: [
|
|
43
|
-
...enabledHeadingSizes.map((headingSize, i)=>TextDropdownSectionWithEntries([
|
|
44
|
-
{
|
|
45
|
-
ChildComponent: iconImports[headingSize],
|
|
46
|
-
isActive: ()=>false,
|
|
47
|
-
key: headingSize,
|
|
48
|
-
label: `Heading ${headingSize.charAt(1)}`,
|
|
49
|
-
onClick: ({ editor })=>{
|
|
50
|
-
editor.update(()=>{
|
|
51
|
-
setHeading(headingSize);
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
order: i + 2
|
|
55
|
-
}
|
|
56
|
-
]))
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
40
|
markdownTransformers: [
|
|
60
41
|
MarkdownTransformer(enabledHeadingSizes)
|
|
61
42
|
],
|
|
@@ -63,27 +44,46 @@ const HeadingFeatureClient = (props)=>{
|
|
|
63
44
|
HeadingNode
|
|
64
45
|
],
|
|
65
46
|
slashMenu: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
47
|
+
groups: enabledHeadingSizes?.length ? [
|
|
48
|
+
{
|
|
49
|
+
displayName: 'Basic',
|
|
50
|
+
items: enabledHeadingSizes.map((headingSize)=>{
|
|
51
|
+
return {
|
|
52
|
+
Icon: iconImports[headingSize],
|
|
53
|
+
displayName: `Heading ${headingSize.charAt(1)}`,
|
|
54
|
+
key: `heading-${headingSize.charAt(1)}`,
|
|
55
|
+
keywords: [
|
|
56
|
+
'heading',
|
|
57
|
+
headingSize
|
|
58
|
+
],
|
|
59
|
+
onSelect: ({ editor })=>{
|
|
60
|
+
editor.update(()=>{
|
|
80
61
|
setHeading(headingSize);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}),
|
|
66
|
+
key: 'basic'
|
|
67
|
+
}
|
|
68
|
+
] : []
|
|
69
|
+
},
|
|
70
|
+
toolbarInline: {
|
|
71
|
+
groups: enabledHeadingSizes?.length ? [
|
|
72
|
+
inlineToolbarTextDropdownGroupWithItems(enabledHeadingSizes.map((headingSize, i)=>{
|
|
73
|
+
return {
|
|
74
|
+
ChildComponent: iconImports[headingSize],
|
|
75
|
+
isActive: ()=>false,
|
|
76
|
+
key: headingSize,
|
|
77
|
+
label: `Heading ${headingSize.charAt(1)}`,
|
|
78
|
+
onSelect: ({ editor })=>{
|
|
79
|
+
editor.update(()=>{
|
|
80
|
+
setHeading(headingSize);
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
order: i + 2
|
|
84
84
|
};
|
|
85
|
-
})
|
|
86
|
-
]
|
|
85
|
+
}))
|
|
86
|
+
] : []
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/heading/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { HeadingTagType } from '@lexical/rich-text'\n\nimport { $createHeadingNode, HeadingNode } from '@lexical/rich-text'\nimport { $setBlocksType } from '@lexical/selection'\nimport { $getSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { HeadingFeatureProps } from './feature.server.js'\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/heading/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { HeadingTagType } from '@lexical/rich-text'\n\nimport { $createHeadingNode, HeadingNode } from '@lexical/rich-text'\nimport { $setBlocksType } from '@lexical/selection'\nimport { $getSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { HeadingFeatureProps } from './feature.server.js'\n\nimport { H1Icon } from '../../lexical/ui/icons/H1/index.js'\nimport { H2Icon } from '../../lexical/ui/icons/H2/index.js'\nimport { H3Icon } from '../../lexical/ui/icons/H3/index.js'\nimport { H4Icon } from '../../lexical/ui/icons/H4/index.js'\nimport { H5Icon } from '../../lexical/ui/icons/H5/index.js'\nimport { H6Icon } from '../../lexical/ui/icons/H6/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { inlineToolbarTextDropdownGroupWithItems } from '../shared/inlineToolbar/textDropdownGroup.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nconst setHeading = (headingSize: HeadingTagType) => {\n const selection = $getSelection()\n $setBlocksType(selection, () => $createHeadingNode(headingSize))\n}\n\nconst iconImports = {\n h1: H1Icon,\n h2: H2Icon,\n h3: H3Icon,\n h4: H4Icon,\n h5: H5Icon,\n h6: H6Icon,\n}\n\nconst HeadingFeatureClient: FeatureProviderProviderClient<HeadingFeatureProps> = (props) => {\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [HeadingNode],\n slashMenu: {\n groups: enabledHeadingSizes?.length\n ? [\n {\n displayName: 'Basic',\n items: enabledHeadingSizes.map((headingSize) => {\n return {\n Icon: iconImports[headingSize],\n displayName: `Heading ${headingSize.charAt(1)}`,\n key: `heading-${headingSize.charAt(1)}`,\n keywords: ['heading', headingSize],\n onSelect: ({ editor }) => {\n editor.update(() => {\n setHeading(headingSize)\n })\n },\n }\n }),\n key: 'basic',\n },\n ]\n : [],\n },\n toolbarInline: {\n groups: enabledHeadingSizes?.length\n ? [\n inlineToolbarTextDropdownGroupWithItems(\n enabledHeadingSizes.map((headingSize, i) => {\n return {\n ChildComponent: iconImports[headingSize],\n isActive: () => false,\n key: headingSize,\n label: `Heading ${headingSize.charAt(1)}`,\n onSelect: ({ editor }) => {\n editor.update(() => {\n setHeading(headingSize)\n })\n },\n order: i + 2,\n }\n }),\n ),\n ]\n : [],\n },\n }\n },\n }\n}\n\nexport const HeadingFeatureClientComponent = createClientComponent(HeadingFeatureClient)\n"],"names":["$createHeadingNode","HeadingNode","$setBlocksType","$getSelection","H1Icon","H2Icon","H3Icon","H4Icon","H5Icon","H6Icon","createClientComponent","inlineToolbarTextDropdownGroupWithItems","MarkdownTransformer","setHeading","headingSize","selection","iconImports","h1","h2","h3","h4","h5","h6","HeadingFeatureClient","props","enabledHeadingSizes","clientFeatureProps","feature","markdownTransformers","nodes","slashMenu","groups","length","displayName","items","map","Icon","charAt","key","keywords","onSelect","editor","update","toolbarInline","i","ChildComponent","isActive","label","order","HeadingFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,qBAAoB;AACpE,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,aAAa,QAAQ,UAAS;AAKvC,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,uCAAuC,QAAQ,+CAA8C;AACtG,SAASC,mBAAmB,QAAQ,2BAA0B;AAE9D,MAAMC,aAAa,CAACC;IAClB,MAAMC,YAAYZ;IAClBD,eAAea,WAAW,IAAMf,mBAAmBc;AACrD;AAEA,MAAME,cAAc;IAClBC,IAAIb;IACJc,IAAIb;IACJc,IAAIb;IACJc,IAAIb;IACJc,IAAIb;IACJc,IAAIb;AACN;AAEA,MAAMc,uBAA2E,CAACC;IAChF,MAAM,EAAEC,sBAAsB;QAAC;QAAM;QAAM;QAAM;QAAM;QAAM;KAAK,EAAE,GAAGD;IAEvE,OAAO;QACLE,oBAAoBF;QACpBG,SAAS;YACP,OAAO;gBACLD,oBAAoBF;gBACpBI,sBAAsB;oBAAChB,oBAAoBa;iBAAqB;gBAChEI,OAAO;oBAAC5B;iBAAY;gBACpB6B,WAAW;oBACTC,QAAQN,qBAAqBO,SACzB;wBACE;4BACEC,aAAa;4BACbC,OAAOT,oBAAoBU,GAAG,CAAC,CAACrB;gCAC9B,OAAO;oCACLsB,MAAMpB,WAAW,CAACF,YAAY;oCAC9BmB,aAAa,CAAC,QAAQ,EAAEnB,YAAYuB,MAAM,CAAC,GAAG,CAAC;oCAC/CC,KAAK,CAAC,QAAQ,EAAExB,YAAYuB,MAAM,CAAC,GAAG,CAAC;oCACvCE,UAAU;wCAAC;wCAAWzB;qCAAY;oCAClC0B,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,MAAM,CAAC;4CACZ7B,WAAWC;wCACb;oCACF;gCACF;4BACF;4BACAwB,KAAK;wBACP;qBACD,GACD,EAAE;gBACR;gBACAK,eAAe;oBACbZ,QAAQN,qBAAqBO,SACzB;wBACErB,wCACEc,oBAAoBU,GAAG,CAAC,CAACrB,aAAa8B;4BACpC,OAAO;gCACLC,gBAAgB7B,WAAW,CAACF,YAAY;gCACxCgC,UAAU,IAAM;gCAChBR,KAAKxB;gCACLiC,OAAO,CAAC,QAAQ,EAAEjC,YAAYuB,MAAM,CAAC,GAAG,CAAC;gCACzCG,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,MAAM,CAAC;wCACZ7B,WAAWC;oCACb;gCACF;gCACAkC,OAAOJ,IAAI;4BACb;wBACF;qBAEH,GACD,EAAE;gBACR;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMK,gCAAgCvC,sBAAsBa,sBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalRule/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAkBtC;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,OAmDxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/horizontalRule/component/index.tsx"],"sourcesContent":["'use client'\n\nimport type { NodeKey } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport { useCallback, useEffect } from 'react'\n\nimport { $isHorizontalRuleNode } from '../nodes/HorizontalRuleNode.js'\n\n/**\n * React component rendered in the lexical editor, WITHIN the hr element created by createDOM of the HorizontalRuleNode.\n *\n * @param nodeKey every node has a unique key (this key is not saved to the database and thus may differ between sessions). It's useful for working with the CURRENT lexical editor state\n */\nexport function HorizontalRuleComponent({ nodeKey }: { nodeKey: NodeKey }) {\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isHorizontalRuleNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n CLICK_COMMAND,\n (event: MouseEvent) => {\n const hrElem = editor.getElementByKey(nodeKey)\n\n if (event.target === hrElem) {\n if (!event.shiftKey) {\n clearSelection()\n }\n setSelected(!isSelected)\n return true\n }\n\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n editor.registerCommand(KEY_DELETE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, onDelete, setSelected])\n\n useEffect(() => {\n const hrElem = editor.getElementByKey(nodeKey)\n if (hrElem !== null) {\n hrElem.className = isSelected ? 'selected' : ''\n }\n }, [editor, isSelected, nodeKey])\n\n return null\n}\n"],"names":["useLexicalComposerContext","useLexicalNodeSelection","mergeRegister","$getNodeByKey","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","useCallback","useEffect","$isHorizontalRuleNode","HorizontalRuleComponent","nodeKey","editor","isSelected","setSelected","clearSelection","onDelete","event","preventDefault","node","remove","registerCommand","hrElem","getElementByKey","target","shiftKey","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,uBAAuB,QAAQ,4CAA2C;AACnF,SAASC,aAAa,QAAQ,iBAAgB;AAC9C,SACEC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb,UAAS;AAChB,SAASC,WAAW,EAAEC,SAAS,QAAQ,QAAO;AAE9C,SAASC,qBAAqB,QAAQ,iCAAgC;AAEtE;;;;CAIC,GACD,OAAO,SAASC,wBAAwB,EAAEC,OAAO,EAAwB;IACvE,MAAM,CAACC,OAAO,GAAGf;IACjB,MAAM,CAACgB,YAAYC,aAAaC,eAAe,GAAGjB,wBAAwBa;IAE1E,MAAMK,WAAWT,YACf,CAACU;QACC,IAAIJ,cAAcX,iBAAiBD,kBAAkB;YACnDgB,MAAMC,cAAc;YACpB,MAAMC,OAAOnB,cAAcW;YAC3B,IAAIF,sBAAsBU,OAAO;gBAC/BA,KAAKC,MAAM;gBACX,OAAO;YACT;QACF;QACA,OAAO;IACT,GACA;QAACP;QAAYF;KAAQ;IAGvBH,UAAU;QACR,OAAOT,cACLa,OAAOS,eAAe,CACpBlB,eACA,CAACc;YACC,MAAMK,SAASV,OAAOW,eAAe,CAACZ;YAEtC,IAAIM,MAAMO,MAAM,KAAKF,QAAQ;gBAC3B,IAAI,CAACL,MAAMQ,QAAQ,EAAE;oBACnBV;gBACF;gBACAD,YAAY,CAACD;gBACb,OAAO;YACT;YAEA,OAAO;QACT,GACAT,uBAEFQ,OAAOS,eAAe,CAACf,oBAAoBU,UAAUZ,uBACrDQ,OAAOS,eAAe,CAAChB,uBAAuBW,UAAUZ;IAE5D,GAAG;QAACW;QAAgBH;QAAQC;QAAYF;QAASK;QAAUF;KAAY;IAEvEN,UAAU;QACR,MAAMc,SAASV,OAAOW,eAAe,CAACZ;QACtC,IAAIW,WAAW,MAAM;YACnBA,OAAOI,SAAS,GAAGb,aAAa,aAAa;QAC/C;IACF,GAAG;QAACD;QAAQC;QAAYF;KAAQ;IAEhC,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/
|
|
1
|
+
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalRule/feature.client.tsx"],"names":[],"mappings":";AA8CA,eAAO,MAAM,oCAAoC,+BAEhD,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
|
|
3
2
|
import { HorizontalRuleIcon } from '../../lexical/ui/icons/HorizontalRule/index.js';
|
|
4
3
|
import { createClientComponent } from '../createClientComponent.js';
|
|
5
4
|
import { MarkdownTransformer } from './markdownTransformer.js';
|
|
@@ -23,14 +22,14 @@ const HorizontalRuleFeatureClient = (props)=>{
|
|
|
23
22
|
}
|
|
24
23
|
],
|
|
25
24
|
slashMenu: {
|
|
26
|
-
|
|
25
|
+
groups: [
|
|
27
26
|
{
|
|
28
27
|
displayName: 'Basic',
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
new SlashMenuOption(`horizontalrule`, {
|
|
28
|
+
items: [
|
|
29
|
+
{
|
|
32
30
|
Icon: HorizontalRuleIcon,
|
|
33
31
|
displayName: `Horizontal Rule`,
|
|
32
|
+
key: 'horizontalRule',
|
|
34
33
|
keywords: [
|
|
35
34
|
'hr',
|
|
36
35
|
'horizontal rule',
|
|
@@ -40,8 +39,9 @@ const HorizontalRuleFeatureClient = (props)=>{
|
|
|
40
39
|
onSelect: ({ editor })=>{
|
|
41
40
|
editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined);
|
|
42
41
|
}
|
|
43
|
-
}
|
|
44
|
-
]
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
key: 'basic'
|
|
45
45
|
}
|
|
46
46
|
]
|
|
47
47
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/horizontalRule/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { HorizontalRuleIcon } from '../../lexical/ui/icons/HorizontalRule/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\nimport { HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from './nodes/HorizontalRuleNode.js'\nimport { HorizontalRulePlugin } from './plugin/index.js'\n\nconst HorizontalRuleFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n markdownTransformers: [MarkdownTransformer],\n nodes: [HorizontalRuleNode],\n plugins: [\n {\n Component: HorizontalRulePlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n groups: [\n {\n displayName: 'Basic',\n items: [\n {\n Icon: HorizontalRuleIcon,\n displayName: `Horizontal Rule`,\n key: 'horizontalRule',\n keywords: ['hr', 'horizontal rule', 'line', 'separator'],\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined)\n },\n },\n ],\n key: 'basic',\n },\n ],\n },\n }),\n }\n}\n\nexport const HorizontalRuleFeatureClientComponent = createClientComponent(\n HorizontalRuleFeatureClient,\n)\n"],"names":["HorizontalRuleIcon","createClientComponent","MarkdownTransformer","HorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","HorizontalRuleFeatureClient","props","clientFeatureProps","feature","markdownTransformers","nodes","plugins","Component","position","slashMenu","groups","displayName","items","Icon","key","keywords","onSelect","editor","dispatchCommand","undefined","HorizontalRuleFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,kBAAkB,EAAEC,8BAA8B,QAAQ,gCAA+B;AAClG,SAASC,oBAAoB,QAAQ,oBAAmB;AAExD,MAAMC,8BAAwE,CAACC;IAC7E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,sBAAsB;oBAACR;iBAAoB;gBAC3CS,OAAO;oBAACR;iBAAmB;gBAC3BS,SAAS;oBACP;wBACEC,WAAWR;wBACXS,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,QAAQ;wBACN;4BACEC,aAAa;4BACbC,OAAO;gCACL;oCACEC,MAAMnB;oCACNiB,aAAa,CAAC,eAAe,CAAC;oCAC9BG,KAAK;oCACLC,UAAU;wCAAC;wCAAM;wCAAmB;wCAAQ;qCAAY;oCACxDC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,eAAe,CAACpB,gCAAgCqB;oCACzD;gCACF;6BACD;4BACDL,KAAK;wBACP;qBACD;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMM,uCAAuCzB,sBAClDK,6BACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/
|
|
1
|
+
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalRule/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAOhE,eAAO,MAAM,qBAAqB,EAAE,6BAA6B,CAAC,SAAS,EAAE,SAAS,CA4BrF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/horizontalRule/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../types.js'\n\nimport { createNode } from '../typeUtilities.js'\nimport { HorizontalRuleFeatureClientComponent } from './feature.client.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\nimport { HorizontalRuleNode } from './nodes/HorizontalRuleNode.js'\n\nexport const HorizontalRuleFeature: FeatureProviderProviderServer<undefined, undefined> = (\n props,\n) => {\n return {\n feature: () => {\n return {\n ClientComponent: HorizontalRuleFeatureClientComponent,\n clientFeatureProps: null,\n markdownTransformers: [MarkdownTransformer],\n nodes: [\n createNode({\n converters: {\n html: {\n converter: () => {\n return `<hr/>`\n },\n nodeTypes: [HorizontalRuleNode.getType()],\n },\n },\n node: HorizontalRuleNode,\n }),\n ],\n serverFeatureProps: props,\n }\n },\n key: 'horizontalRule',\n serverFeatureProps: props,\n }\n}\n"],"names":["createNode","HorizontalRuleFeatureClientComponent","MarkdownTransformer","HorizontalRuleNode","HorizontalRuleFeature","props","feature","ClientComponent","clientFeatureProps","markdownTransformers","nodes","converters","html","converter","nodeTypes","getType","node","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,UAAU,QAAQ,sBAAqB;AAChD,SAASC,oCAAoC,QAAQ,sBAAqB;AAC1E,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,kBAAkB,QAAQ,gCAA+B;AAElE,OAAO,MAAMC,wBAA6E,CACxFC;IAEA,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,oBAAoB;gBACpBC,sBAAsB;oBAACP;iBAAoB;gBAC3CQ,OAAO;oBACLV,WAAW;wBACTW,YAAY;4BACVC,MAAM;gCACJC,WAAW;oCACT,OAAO,CAAC,KAAK,CAAC;gCAChB;gCACAC,WAAW;oCAACX,mBAAmBY,OAAO;iCAAG;4BAC3C;wBACF;wBACAC,MAAMb;oBACR;iBACD;gBACDc,oBAAoBZ;YACtB;QACF;QACAa,KAAK;QACLD,oBAAoBZ;IACtB;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdownTransformer.d.ts","sourceRoot":"","sources":["../../../../src/field/features/
|
|
1
|
+
{"version":3,"file":"markdownTransformer.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalRule/markdownTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAQ3D,eAAO,MAAM,mBAAmB,EAAE,kBAiBjC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/horizontalRule/markdownTransformer.ts"],"sourcesContent":["import type { ElementTransformer } from '@lexical/markdown'\n\nimport {\n $createHorizontalRuleNode,\n $isHorizontalRuleNode,\n HorizontalRuleNode,\n} from './nodes/HorizontalRuleNode.js'\n\nexport const MarkdownTransformer: ElementTransformer = {\n type: 'element',\n dependencies: [HorizontalRuleNode],\n export: (node, exportChildren) => {\n if (!$isHorizontalRuleNode(node)) {\n return null\n }\n return '---'\n },\n // match ---\n regExp: /^---\\s*$/,\n replace: (parentNode) => {\n const node = $createHorizontalRuleNode()\n if (node) {\n parentNode.replace(node)\n }\n },\n}\n"],"names":["$createHorizontalRuleNode","$isHorizontalRuleNode","HorizontalRuleNode","MarkdownTransformer","type","dependencies","export","node","exportChildren","regExp","replace","parentNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SACEA,yBAAyB,EACzBC,qBAAqB,EACrBC,kBAAkB,QACb,gCAA+B;AAEtC,OAAO,MAAMC,sBAA0C;IACrDC,MAAM;IACNC,cAAc;QAACH;KAAmB;IAClCI,QAAQ,CAACC,MAAMC;QACb,IAAI,CAACP,sBAAsBM,OAAO;YAChC,OAAO;QACT;QACA,OAAO;IACT;IACA,YAAY;IACZE,QAAQ;IACRC,SAAS,CAACC;QACR,MAAMJ,OAAOP;QACb,IAAIO,MAAM;YACRI,WAAWD,OAAO,CAACH;QACrB;IACF;AACF,EAAC"}
|
package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.d.ts.map
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalRuleNode.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/
|
|
1
|
+
{"version":3,"file":"HorizontalRuleNode.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalRule/nodes/HorizontalRuleNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EACf,cAAc,EACd,WAAW,EACX,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAyB,aAAa,EAAiB,MAAM,SAAS,CAAA;AAC7E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,qBAAqB,CAAA;AAEhE,eAAO,MAAM,8BAA8B,EAAE,cAAc,CAAC,IAAI,CAE/D,CAAA;AAED;;;;;;GAMG;AACH,qBAAa,kBAAmB,SAAQ,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;IACvE,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,kBAAkB,GAAG,kBAAkB;IAI1D,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB;;;;OAIG;IACH,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;IAS3C;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,4BAA4B,GAAG,kBAAkB;IAInF;;OAEG;IACH,SAAS,IAAI,WAAW;IAIxB;;OAEG;IACH,QAAQ,IAAI,KAAK,CAAC,YAAY;IAI9B;;;;OAIG;IACH,SAAS,IAAI,eAAe;IAG5B;;OAEG;IACH,UAAU,IAAI,qBAAqB;IAOnC,cAAc,IAAI,MAAM;IAIxB,QAAQ,IAAI,KAAK;IAIjB,SAAS,IAAI,OAAO;CAGrB;AAMD,wBAAgB,yBAAyB,IAAI,kBAAkB,CAE9D;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GACnC,IAAI,IAAI,kBAAkB,CAE5B"}
|
package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.js.map
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/horizontalRule/nodes/HorizontalRuleNode.tsx"],"sourcesContent":["import type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n LexicalCommand,\n LexicalNode,\n SerializedLexicalNode,\n} from 'lexical'\n\nimport { $applyNodeReplacement, DecoratorNode, createCommand } from 'lexical'\nimport * as React from 'react'\n\nconst HorizontalRuleComponent = React.lazy(() =>\n import('../component/index.js').then((module) => ({\n default: module.HorizontalRuleComponent,\n })),\n)\n\n/**\n * Serialized representation of a horizontal rule node. Serialized = converted to JSON. This is what is stored in the database / in the lexical editor state.\n */\nexport type SerializedHorizontalRuleNode = SerializedLexicalNode\n\nexport const INSERT_HORIZONTAL_RULE_COMMAND: LexicalCommand<void> = createCommand(\n 'INSERT_HORIZONTAL_RULE_COMMAND',\n)\n\n/**\n * This node is a DecoratorNode. DecoratorNodes allow you to render React components in the editor.\n *\n * They need both createDom and decorate functions. createDom => outside of the html. decorate => React Component inside of the html.\n *\n * If we used DecoratorBlockNode instead, we would only need a decorate method\n */\nexport class HorizontalRuleNode extends DecoratorNode<React.ReactElement> {\n static clone(node: HorizontalRuleNode): HorizontalRuleNode {\n return new HorizontalRuleNode(node.__key)\n }\n\n static getType(): string {\n return 'horizontalrule'\n }\n\n /**\n * Defines what happens if you copy an hr element from another page and paste it into the lexical editor\n *\n * This also determines the behavior of lexical's internal HTML -> Lexical converter\n */\n static importDOM(): DOMConversionMap | null {\n return {\n hr: () => ({\n conversion: convertHorizontalRuleElement,\n priority: 0,\n }),\n }\n }\n\n /**\n * The data for this node is stored serialized as JSON. This is the \"load function\" of that node: it takes the saved data and converts it into a node.\n */\n static importJSON(serializedNode: SerializedHorizontalRuleNode): HorizontalRuleNode {\n return $createHorizontalRuleNode()\n }\n\n /**\n * Determines how the hr element is rendered in the lexical editor. This is only the \"initial\" / \"outer\" HTML element.\n */\n createDOM(): HTMLElement {\n return document.createElement('hr')\n }\n\n /**\n * Allows you to render a React component within whatever createDOM returns.\n */\n decorate(): React.ReactElement {\n return <HorizontalRuleComponent nodeKey={this.__key} />\n }\n\n /**\n * Opposite of importDOM, this function defines what happens when you copy an hr element from the lexical editor and paste it into another page.\n *\n * This also determines the behavior of lexical's internal Lexical -> HTML converter\n */\n exportDOM(): DOMExportOutput {\n return { element: document.createElement('hr') }\n }\n /**\n * Opposite of importJSON. This determines what data is saved in the database / in the lexical editor state.\n */\n exportJSON(): SerializedLexicalNode {\n return {\n type: 'horizontalrule',\n version: 1,\n }\n }\n\n getTextContent(): string {\n return '\\n'\n }\n\n isInline(): false {\n return false\n }\n\n updateDOM(): boolean {\n return false\n }\n}\n\nfunction convertHorizontalRuleElement(): DOMConversionOutput {\n return { node: $createHorizontalRuleNode() }\n}\n\nexport function $createHorizontalRuleNode(): HorizontalRuleNode {\n return $applyNodeReplacement(new HorizontalRuleNode())\n}\n\nexport function $isHorizontalRuleNode(\n node: LexicalNode | null | undefined,\n): node is HorizontalRuleNode {\n return node instanceof HorizontalRuleNode\n}\n"],"names":["$applyNodeReplacement","DecoratorNode","createCommand","React","HorizontalRuleComponent","lazy","then","module","default","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRuleNode","clone","node","__key","getType","importDOM","hr","conversion","convertHorizontalRuleElement","priority","importJSON","serializedNode","$createHorizontalRuleNode","createDOM","document","createElement","decorate","nodeKey","exportDOM","element","exportJSON","type","version","getTextContent","isInline","updateDOM","$isHorizontalRuleNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AASA,SAASA,qBAAqB,EAAEC,aAAa,EAAEC,aAAa,QAAQ,UAAS;AAC7E,YAAYC,WAAW,QAAO;AAE9B,MAAMC,wCAA0BD,MAAME,IAAI,CAAC,IACzC,MAAM,CAAC,yBAAyBC,IAAI,CAAC,CAACC,SAAY,CAAA;YAChDC,SAASD,OAAOH,uBAAuB;QACzC,CAAA;AAQF,OAAO,MAAMK,iCAAuDP,cAClE,kCACD;AAED;;;;;;CAMC,GACD,OAAO,MAAMQ,2BAA2BT;IACtC,OAAOU,MAAMC,IAAwB,EAAsB;QACzD,OAAO,IAAIF,mBAAmBE,KAAKC,KAAK;IAC1C;IAEA,OAAOC,UAAkB;QACvB,OAAO;IACT;IAEA;;;;GAIC,GACD,OAAOC,YAAqC;QAC1C,OAAO;YACLC,IAAI,IAAO,CAAA;oBACTC,YAAYC;oBACZC,UAAU;gBACZ,CAAA;QACF;IACF;IAEA;;GAEC,GACD,OAAOC,WAAWC,cAA4C,EAAsB;QAClF,OAAOC;IACT;IAEA;;GAEC,GACDC,YAAyB;QACvB,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEA;;GAEC,GACDC,WAA+B;QAC7B,qBAAO,oBAACtB;YAAwBuB,SAAS,IAAI,CAACd,KAAK;;IACrD;IAEA;;;;GAIC,GACDe,YAA6B;QAC3B,OAAO;YAAEC,SAASL,SAASC,aAAa,CAAC;QAAM;IACjD;IACA;;GAEC,GACDK,aAAoC;QAClC,OAAO;YACLC,MAAM;YACNC,SAAS;QACX;IACF;IAEAC,iBAAyB;QACvB,OAAO;IACT;IAEAC,WAAkB;QAChB,OAAO;IACT;IAEAC,YAAqB;QACnB,OAAO;IACT;AACF;AAEA,SAASjB;IACP,OAAO;QAAEN,MAAMU;IAA4B;AAC7C;AAEA,OAAO,SAASA;IACd,OAAOtB,sBAAsB,IAAIU;AACnC;AAEA,OAAO,SAAS0B,sBACdxB,IAAoC;IAEpC,OAAOA,gBAAgBF;AACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalRule/plugin/index.tsx"],"names":[],"mappings":"AAWA,OAAO,cAAc,CAAA;AAErB;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CA2B3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/horizontalRule/plugin/index.tsx"],"sourcesContent":["'use client'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot } from '@lexical/utils'\nimport { $getSelection, $isRangeSelection, COMMAND_PRIORITY_EDITOR } from 'lexical'\nimport { useEffect } from 'react'\n\nimport {\n $createHorizontalRuleNode,\n INSERT_HORIZONTAL_RULE_COMMAND,\n} from '../nodes/HorizontalRuleNode.js'\nimport './index.scss'\n\n/**\n * Registers the INSERT_HORIZONTAL_RULE_COMMAND lexical command and defines the behavior for when it is called.\n */\nexport function HorizontalRulePlugin(): null {\n const [editor] = useLexicalComposerContext()\n\n useEffect(() => {\n return editor.registerCommand(\n INSERT_HORIZONTAL_RULE_COMMAND,\n (type) => {\n const selection = $getSelection()\n\n if (!$isRangeSelection(selection)) {\n return false\n }\n\n const focusNode = selection.focus.getNode()\n\n if (focusNode !== null) {\n const horizontalRuleNode = $createHorizontalRuleNode()\n $insertNodeToNearestRoot(horizontalRuleNode)\n }\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return null\n}\n"],"names":["useLexicalComposerContext","$insertNodeToNearestRoot","$getSelection","$isRangeSelection","COMMAND_PRIORITY_EDITOR","useEffect","$createHorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","editor","registerCommand","type","selection","focusNode","focus","getNode","horizontalRuleNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,wBAAwB,QAAQ,iBAAgB;AACzD,SAASC,aAAa,EAAEC,iBAAiB,EAAEC,uBAAuB,QAAQ,UAAS;AACnF,SAASC,SAAS,QAAQ,QAAO;AAEjC,SACEC,yBAAyB,EACzBC,8BAA8B,QACzB,iCAAgC;AACvC,OAAO,eAAc;AAErB;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,CAACC,OAAO,GAAGT;IAEjBK,UAAU;QACR,OAAOI,OAAOC,eAAe,CAC3BH,gCACA,CAACI;YACC,MAAMC,YAAYV;YAElB,IAAI,CAACC,kBAAkBS,YAAY;gBACjC,OAAO;YACT;YAEA,MAAMC,YAAYD,UAAUE,KAAK,CAACC,OAAO;YAEzC,IAAIF,cAAc,MAAM;gBACtB,MAAMG,qBAAqBV;gBAC3BL,yBAAyBe;YAC3B;YAEA,OAAO;QACT,GACAZ;IAEJ,GAAG;QAACK;KAAO;IAEX,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/indent/feature.client.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/indent/feature.client.tsx"],"names":[],"mappings":";AA+DA,eAAO,MAAM,4BAA4B,+BAA6C,CAAA"}
|
|
@@ -3,15 +3,15 @@ import { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } from 'lexical';
|
|
|
3
3
|
import { IndentDecreaseIcon } from '../../lexical/ui/icons/IndentDecrease/index.js';
|
|
4
4
|
import { IndentIncreaseIcon } from '../../lexical/ui/icons/IndentIncrease/index.js';
|
|
5
5
|
import { createClientComponent } from '../createClientComponent.js';
|
|
6
|
-
import {
|
|
6
|
+
import { indentGroupWithItems } from './inlineToolbarIndentGroup.js';
|
|
7
7
|
const IndentFeatureClient = (props)=>{
|
|
8
8
|
return {
|
|
9
9
|
clientFeatureProps: props,
|
|
10
10
|
feature: ()=>({
|
|
11
11
|
clientFeatureProps: props,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
toolbarInline: {
|
|
13
|
+
groups: [
|
|
14
|
+
indentGroupWithItems([
|
|
15
15
|
{
|
|
16
16
|
ChildComponent: IndentDecreaseIcon,
|
|
17
17
|
isActive: ()=>false,
|
|
@@ -27,21 +27,19 @@ const IndentFeatureClient = (props)=>{
|
|
|
27
27
|
}
|
|
28
28
|
return false;
|
|
29
29
|
},
|
|
30
|
-
key: '
|
|
30
|
+
key: 'indentDecrease',
|
|
31
31
|
label: `Decrease Indent`,
|
|
32
|
-
|
|
32
|
+
onSelect: ({ editor })=>{
|
|
33
33
|
editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);
|
|
34
34
|
},
|
|
35
35
|
order: 1
|
|
36
|
-
}
|
|
37
|
-
]),
|
|
38
|
-
IndentSectionWithEntries([
|
|
36
|
+
},
|
|
39
37
|
{
|
|
40
38
|
ChildComponent: IndentIncreaseIcon,
|
|
41
39
|
isActive: ()=>false,
|
|
42
|
-
key: '
|
|
40
|
+
key: 'indentIncrease',
|
|
43
41
|
label: `Increase Indent`,
|
|
44
|
-
|
|
42
|
+
onSelect: ({ editor })=>{
|
|
45
43
|
editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined);
|
|
46
44
|
},
|
|
47
45
|
order: 2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/indent/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { IndentDecreaseIcon } from '../../lexical/ui/icons/IndentDecrease/index.js'\nimport { IndentIncreaseIcon } from '../../lexical/ui/icons/IndentIncrease/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/indent/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { IndentDecreaseIcon } from '../../lexical/ui/icons/IndentDecrease/index.js'\nimport { IndentIncreaseIcon } from '../../lexical/ui/icons/IndentIncrease/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { indentGroupWithItems } from './inlineToolbarIndentGroup.js'\n\nconst IndentFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n toolbarInline: {\n groups: [\n indentGroupWithItems([\n {\n ChildComponent: IndentDecreaseIcon,\n isActive: () => false,\n isEnabled: ({ selection }) => {\n if (!selection || !selection?.getNodes()?.length) {\n return false\n }\n for (const node of selection.getNodes()) {\n // If at least one node is indented, this should be active\n if (\n ('__indent' in node && (node.__indent as number) > 0) ||\n (node.getParent() &&\n '__indent' in node.getParent() &&\n node.getParent().__indent > 0)\n ) {\n return true\n }\n }\n return false\n },\n key: 'indentDecrease',\n label: `Decrease Indent`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined)\n },\n order: 1,\n },\n {\n ChildComponent: IndentIncreaseIcon,\n isActive: () => false,\n key: 'indentIncrease',\n label: `Increase Indent`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined)\n },\n order: 2,\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const IndentFeatureClientComponent = createClientComponent(IndentFeatureClient)\n"],"names":["INDENT_CONTENT_COMMAND","OUTDENT_CONTENT_COMMAND","IndentDecreaseIcon","IndentIncreaseIcon","createClientComponent","indentGroupWithItems","IndentFeatureClient","props","clientFeatureProps","feature","toolbarInline","groups","ChildComponent","isActive","isEnabled","selection","getNodes","length","node","__indent","getParent","key","label","onSelect","editor","dispatchCommand","undefined","order","IndentFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,sBAAsB,EAAEC,uBAAuB,QAAQ,UAAS;AAIzE,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,oBAAoB,QAAQ,gCAA+B;AAEpE,MAAMC,sBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,eAAe;oBACbC,QAAQ;wBACNN,qBAAqB;4BACnB;gCACEO,gBAAgBV;gCAChBW,UAAU,IAAM;gCAChBC,WAAW,CAAC,EAAEC,SAAS,EAAE;oCACvB,IAAI,CAACA,aAAa,CAACA,WAAWC,YAAYC,QAAQ;wCAChD,OAAO;oCACT;oCACA,KAAK,MAAMC,QAAQH,UAAUC,QAAQ,GAAI;wCACvC,0DAA0D;wCAC1D,IACE,AAAC,cAAcE,QAAQ,AAACA,KAAKC,QAAQ,GAAc,KAClDD,KAAKE,SAAS,MACb,cAAcF,KAAKE,SAAS,MAC5BF,KAAKE,SAAS,GAAGD,QAAQ,GAAG,GAC9B;4CACA,OAAO;wCACT;oCACF;oCACA,OAAO;gCACT;gCACAE,KAAK;gCACLC,OAAO,CAAC,eAAe,CAAC;gCACxBC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACxB,yBAAyByB;gCAClD;gCACAC,OAAO;4BACT;4BACA;gCACEf,gBAAgBT;gCAChBU,UAAU,IAAM;gCAChBQ,KAAK;gCACLC,OAAO,CAAC,eAAe,CAAC;gCACxBC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACzB,wBAAwB0B;gCACjD;gCACAC,OAAO;4BACT;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,+BAA+BxB,sBAAsBE,qBAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inlineToolbarIndentGroup.d.ts","sourceRoot":"","sources":["../../../../src/field/features/indent/inlineToolbarIndentGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,gDAAgD,CAAA;AAEvD,eAAO,MAAM,oBAAoB,UAAW,sBAAsB,EAAE,KAAG,kBAOtE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/indent/inlineToolbarIndentGroup.ts"],"sourcesContent":["import type {\n InlineToolbarGroup,\n InlineToolbarGroupItem,\n} from '../../lexical/plugins/toolbars/inline/types.js'\n\nexport const indentGroupWithItems = (items: InlineToolbarGroupItem[]): InlineToolbarGroup => {\n return {\n type: 'buttons',\n items,\n key: 'indent',\n order: 3,\n }\n}\n"],"names":["indentGroupWithItems","items","type","key","order"],"rangeMappings":";;;;;;;","mappings":"AAKA,OAAO,MAAMA,uBAAuB,CAACC;IACnC,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
|
|
@@ -3,8 +3,8 @@ import { $findMatchingParent } from '@lexical/utils';
|
|
|
3
3
|
import { $getSelection, $isRangeSelection } from 'lexical';
|
|
4
4
|
import { LinkIcon } from '../../lexical/ui/icons/Link/index.js';
|
|
5
5
|
import { getSelectedNode } from '../../lexical/utils/getSelectedNode.js';
|
|
6
|
-
import { FeaturesSectionWithEntries } from '../common/floatingSelectToolbarFeaturesButtonsSection/index.js';
|
|
7
6
|
import { createClientComponent } from '../createClientComponent.js';
|
|
7
|
+
import { inlineToolbarFeatureButtonsGroupWithItems } from '../shared/inlineToolbar/featureButtonsGroup.js';
|
|
8
8
|
import { AutoLinkNode } from './nodes/AutoLinkNode.js';
|
|
9
9
|
import { $isLinkNode, LinkNode, TOGGLE_LINK_COMMAND } from './nodes/LinkNode.js';
|
|
10
10
|
import { AutoLinkPlugin } from './plugins/autoLink/index.js';
|
|
@@ -17,9 +17,31 @@ const LinkFeatureClient = (props)=>{
|
|
|
17
17
|
clientFeatureProps: props,
|
|
18
18
|
feature: ()=>({
|
|
19
19
|
clientFeatureProps: props,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
nodes: [
|
|
21
|
+
LinkNode,
|
|
22
|
+
AutoLinkNode
|
|
23
|
+
],
|
|
24
|
+
plugins: [
|
|
25
|
+
{
|
|
26
|
+
Component: LinkPlugin,
|
|
27
|
+
position: 'normal'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
Component: AutoLinkPlugin,
|
|
31
|
+
position: 'normal'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
Component: ClickableLinkPlugin,
|
|
35
|
+
position: 'normal'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
Component: FloatingLinkEditorPlugin,
|
|
39
|
+
position: 'floatingAnchorElem'
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
toolbarInline: {
|
|
43
|
+
groups: [
|
|
44
|
+
inlineToolbarFeatureButtonsGroupWithItems([
|
|
23
45
|
{
|
|
24
46
|
ChildComponent: LinkIcon,
|
|
25
47
|
isActive: ({ selection })=>{
|
|
@@ -32,7 +54,7 @@ const LinkFeatureClient = (props)=>{
|
|
|
32
54
|
},
|
|
33
55
|
key: 'link',
|
|
34
56
|
label: `Link`,
|
|
35
|
-
|
|
57
|
+
onSelect: ({ editor, isActive })=>{
|
|
36
58
|
if (!isActive) {
|
|
37
59
|
let selectedText = null;
|
|
38
60
|
editor.getEditorState().read(()=>{
|
|
@@ -57,29 +79,7 @@ const LinkFeatureClient = (props)=>{
|
|
|
57
79
|
}
|
|
58
80
|
])
|
|
59
81
|
]
|
|
60
|
-
}
|
|
61
|
-
nodes: [
|
|
62
|
-
LinkNode,
|
|
63
|
-
AutoLinkNode
|
|
64
|
-
],
|
|
65
|
-
plugins: [
|
|
66
|
-
{
|
|
67
|
-
Component: LinkPlugin,
|
|
68
|
-
position: 'normal'
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
Component: AutoLinkPlugin,
|
|
72
|
-
position: 'normal'
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
Component: ClickableLinkPlugin,
|
|
76
|
-
position: 'normal'
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
Component: FloatingLinkEditorPlugin,
|
|
80
|
-
position: 'floatingAnchorElem'
|
|
81
|
-
}
|
|
82
|
-
]
|
|
82
|
+
}
|
|
83
83
|
})
|
|
84
84
|
};
|
|
85
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/link/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $findMatchingParent } from '@lexical/utils'\nimport { $getSelection, $isRangeSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { ExclusiveLinkCollectionsProps } from './feature.server.js'\nimport type { LinkFields } from './nodes/types.js'\n\nimport { LinkIcon } from '../../lexical/ui/icons/Link/index.js'\nimport { getSelectedNode } from '../../lexical/utils/getSelectedNode.js'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/link/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $findMatchingParent } from '@lexical/utils'\nimport { $getSelection, $isRangeSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { ExclusiveLinkCollectionsProps } from './feature.server.js'\nimport type { LinkFields } from './nodes/types.js'\n\nimport { LinkIcon } from '../../lexical/ui/icons/Link/index.js'\nimport { getSelectedNode } from '../../lexical/utils/getSelectedNode.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { inlineToolbarFeatureButtonsGroupWithItems } from '../shared/inlineToolbar/featureButtonsGroup.js'\nimport { AutoLinkNode } from './nodes/AutoLinkNode.js'\nimport { $isLinkNode, LinkNode, TOGGLE_LINK_COMMAND } from './nodes/LinkNode.js'\nimport { AutoLinkPlugin } from './plugins/autoLink/index.js'\nimport { ClickableLinkPlugin } from './plugins/clickableLink/index.js'\nimport { TOGGLE_LINK_WITH_MODAL_COMMAND } from './plugins/floatingLinkEditor/LinkEditor/commands.js'\nimport { FloatingLinkEditorPlugin } from './plugins/floatingLinkEditor/index.js'\nimport { LinkPlugin } from './plugins/link/index.js'\n\nexport type ClientProps = ExclusiveLinkCollectionsProps\n\nconst LinkFeatureClient: FeatureProviderProviderClient<ClientProps> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n nodes: [LinkNode, AutoLinkNode],\n plugins: [\n {\n Component: LinkPlugin,\n position: 'normal',\n },\n {\n Component: AutoLinkPlugin,\n position: 'normal',\n },\n {\n Component: ClickableLinkPlugin,\n position: 'normal',\n },\n {\n Component: FloatingLinkEditorPlugin,\n position: 'floatingAnchorElem',\n },\n ],\n toolbarInline: {\n groups: [\n inlineToolbarFeatureButtonsGroupWithItems([\n {\n ChildComponent: LinkIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n const selectedNode = getSelectedNode(selection)\n const linkParent = $findMatchingParent(selectedNode, $isLinkNode)\n return linkParent != null\n }\n return false\n },\n key: 'link',\n label: `Link`,\n onSelect: ({ editor, isActive }) => {\n if (!isActive) {\n let selectedText = null\n editor.getEditorState().read(() => {\n selectedText = $getSelection().getTextContent()\n })\n const linkFields: LinkFields = {\n doc: null,\n linkType: 'custom',\n newTab: false,\n url: 'https://',\n }\n editor.dispatchCommand(TOGGLE_LINK_WITH_MODAL_COMMAND, {\n fields: linkFields,\n text: selectedText,\n })\n } else {\n // remove link\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, null)\n }\n },\n order: 1,\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const LinkFeatureClientComponent = createClientComponent(LinkFeatureClient)\n"],"names":["$findMatchingParent","$getSelection","$isRangeSelection","LinkIcon","getSelectedNode","createClientComponent","inlineToolbarFeatureButtonsGroupWithItems","AutoLinkNode","$isLinkNode","LinkNode","TOGGLE_LINK_COMMAND","AutoLinkPlugin","ClickableLinkPlugin","TOGGLE_LINK_WITH_MODAL_COMMAND","FloatingLinkEditorPlugin","LinkPlugin","LinkFeatureClient","props","clientFeatureProps","feature","nodes","plugins","Component","position","toolbarInline","groups","ChildComponent","isActive","selection","selectedNode","linkParent","key","label","onSelect","editor","selectedText","getEditorState","read","getTextContent","linkFields","doc","linkType","newTab","url","dispatchCommand","fields","text","order","LinkFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,mBAAmB,QAAQ,iBAAgB;AACpD,SAASC,aAAa,EAAEC,iBAAiB,QAAQ,UAAS;AAM1D,SAASC,QAAQ,QAAQ,uCAAsC;AAC/D,SAASC,eAAe,QAAQ,yCAAwC;AACxE,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,yCAAyC,QAAQ,iDAAgD;AAC1G,SAASC,YAAY,QAAQ,0BAAyB;AACtD,SAASC,WAAW,EAAEC,QAAQ,EAAEC,mBAAmB,QAAQ,sBAAqB;AAChF,SAASC,cAAc,QAAQ,8BAA6B;AAC5D,SAASC,mBAAmB,QAAQ,mCAAkC;AACtE,SAASC,8BAA8B,QAAQ,sDAAqD;AACpG,SAASC,wBAAwB,QAAQ,wCAAuC;AAChF,SAASC,UAAU,QAAQ,0BAAyB;AAIpD,MAAMC,oBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,OAAO;oBAACX;oBAAUF;iBAAa;gBAC/Bc,SAAS;oBACP;wBACEC,WAAWP;wBACXQ,UAAU;oBACZ;oBACA;wBACED,WAAWX;wBACXY,UAAU;oBACZ;oBACA;wBACED,WAAWV;wBACXW,UAAU;oBACZ;oBACA;wBACED,WAAWR;wBACXS,UAAU;oBACZ;iBACD;gBACDC,eAAe;oBACbC,QAAQ;wBACNnB,0CAA0C;4BACxC;gCACEoB,gBAAgBvB;gCAChBwB,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAI1B,kBAAkB0B,YAAY;wCAChC,MAAMC,eAAezB,gBAAgBwB;wCACrC,MAAME,aAAa9B,oBAAoB6B,cAAcrB;wCACrD,OAAOsB,cAAc;oCACvB;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,OAAO,CAAC,IAAI,CAAC;gCACbC,UAAU,CAAC,EAAEC,MAAM,EAAEP,QAAQ,EAAE;oCAC7B,IAAI,CAACA,UAAU;wCACb,IAAIQ,eAAe;wCACnBD,OAAOE,cAAc,GAAGC,IAAI,CAAC;4CAC3BF,eAAelC,gBAAgBqC,cAAc;wCAC/C;wCACA,MAAMC,aAAyB;4CAC7BC,KAAK;4CACLC,UAAU;4CACVC,QAAQ;4CACRC,KAAK;wCACP;wCACAT,OAAOU,eAAe,CAAC/B,gCAAgC;4CACrDgC,QAAQN;4CACRO,MAAMX;wCACR;oCACF,OAAO;wCACL,cAAc;wCACdD,OAAOU,eAAe,CAAClC,qBAAqB;oCAC9C;gCACF;gCACAqC,OAAO;4BACT;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,6BAA6B3C,sBAAsBW,mBAAkB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ChecklistFeatureClientComponent: import("react").FC<undefined>;
|
|
3
3
|
//# sourceMappingURL=feature.client.d.ts.map
|