@payloadcms/richtext-lexical 3.0.0-beta.23 → 3.0.0-beta.25
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 +3 -2
- package/dist/exports/components.d.ts.map +1 -1
- package/dist/exports/components.js +3 -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 +127 -53
- package/dist/field/features/align/feature.client.js.map +1 -1
- package/dist/field/features/align/toolbarAlignGroup.d.ts +3 -0
- package/dist/field/features/align/toolbarAlignGroup.d.ts.map +1 -0
- package/dist/field/features/align/toolbarAlignGroup.js +12 -0
- package/dist/field/features/align/toolbarAlignGroup.js.map +1 -0
- package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
- package/dist/field/features/blockquote/feature.client.js +50 -34
- package/dist/field/features/blockquote/feature.client.js.map +1 -1
- package/dist/field/features/blocks/component/index.d.ts.map +1 -1
- package/dist/field/features/blocks/component/index.js +1 -1
- package/dist/field/features/blocks/component/index.js.map +1 -1
- package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
- package/dist/field/features/blocks/feature.client.js +56 -27
- package/dist/field/features/blocks/feature.client.js.map +1 -1
- package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
- package/dist/field/features/blocks/populationPromise.js +2 -1
- package/dist/field/features/blocks/populationPromise.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.d.ts.map +1 -1
- package/dist/field/features/format/bold/feature.client.js +25 -21
- package/dist/field/features/format/bold/feature.client.js.map +1 -1
- package/dist/field/features/format/inlineCode/feature.client.d.ts.map +1 -0
- package/dist/field/features/format/inlineCode/feature.client.js +46 -0
- 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.d.ts.map +1 -1
- package/dist/field/features/format/italic/feature.client.js +26 -22
- package/dist/field/features/format/italic/feature.client.js.map +1 -1
- package/dist/field/features/format/shared/toolbarFormatGroup.d.ts +3 -0
- package/dist/field/features/format/shared/toolbarFormatGroup.d.ts.map +1 -0
- package/dist/field/features/format/shared/toolbarFormatGroup.js +10 -0
- package/dist/field/features/format/shared/toolbarFormatGroup.js.map +1 -0
- package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/strikethrough/feature.client.js +26 -22
- package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
- package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/subscript/feature.client.js +24 -20
- package/dist/field/features/format/subscript/feature.client.js.map +1 -1
- package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/superscript/feature.client.js +24 -20
- package/dist/field/features/format/superscript/feature.client.js.map +1 -1
- package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/underline/feature.client.js +24 -20
- 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 +69 -49
- 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/feature.client.d.ts.map +1 -0
- package/dist/field/features/horizontalRule/feature.client.js +76 -0
- 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 +42 -40
- package/dist/field/features/indent/feature.client.js.map +1 -1
- package/dist/field/features/indent/toolbarIndentGroup.d.ts +3 -0
- package/dist/field/features/indent/toolbarIndentGroup.d.ts.map +1 -0
- package/dist/field/features/indent/toolbarIndentGroup.js +10 -0
- package/dist/field/features/indent/toolbarIndentGroup.js.map +1 -0
- package/dist/field/features/link/feature.client.d.ts.map +1 -1
- package/dist/field/features/link/feature.client.js +47 -43
- package/dist/field/features/link/feature.client.js.map +1 -1
- package/dist/field/features/link/populationPromise.d.ts.map +1 -1
- package/dist/field/features/link/populationPromise.js +2 -1
- package/dist/field/features/link/populationPromise.js.map +1 -1
- package/dist/field/features/lists/checklist/feature.client.d.ts +1 -1
- package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
- package/dist/field/features/lists/checklist/feature.client.js +56 -31
- 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/feature.client.d.ts.map +1 -0
- package/dist/field/features/lists/orderedList/feature.client.js +96 -0
- 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/feature.client.js +96 -0
- 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.d.ts.map +1 -1
- package/dist/field/features/paragraph/feature.client.js +44 -30
- package/dist/field/features/paragraph/feature.client.js.map +1 -1
- package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
- package/dist/field/features/relationship/feature.client.js +36 -10
- package/dist/field/features/relationship/feature.client.js.map +1 -1
- package/dist/field/features/relationship/populationPromise.d.ts.map +1 -1
- package/dist/field/features/relationship/populationPromise.js +2 -1
- package/dist/field/features/relationship/populationPromise.js.map +1 -1
- package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts +3 -0
- package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -0
- package/dist/field/features/shared/toolbar/addDropdownGroup.js +12 -0
- package/dist/field/features/shared/toolbar/addDropdownGroup.js.map +1 -0
- package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts +3 -0
- package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -0
- package/dist/field/features/shared/toolbar/featureButtonsGroup.js +10 -0
- package/dist/field/features/shared/toolbar/featureButtonsGroup.js.map +1 -0
- package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts +3 -0
- package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -0
- package/dist/field/features/shared/toolbar/textDropdownGroup.js +12 -0
- package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +6 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.js +152 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.scss +81 -0
- package/dist/field/features/toolbars/fixed/feature.client.d.ts +3 -0
- package/dist/field/features/toolbars/fixed/feature.client.d.ts.map +1 -0
- package/dist/field/features/toolbars/fixed/feature.client.js +20 -0
- package/dist/field/features/toolbars/fixed/feature.client.js.map +1 -0
- package/dist/field/features/toolbars/fixed/feature.server.d.ts +3 -0
- package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
- package/dist/field/features/toolbars/fixed/feature.server.js +16 -0
- package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -0
- package/dist/field/features/toolbars/inline/Toolbar/index.d.ts +6 -0
- package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
- package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/inline/Toolbar}/index.js +64 -38
- package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
- package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/inline/Toolbar}/index.scss +7 -11
- package/dist/field/features/toolbars/inline/feature.client.d.ts +3 -0
- package/dist/field/features/toolbars/inline/feature.client.d.ts.map +1 -0
- package/dist/field/features/toolbars/inline/feature.client.js +20 -0
- package/dist/field/features/toolbars/inline/feature.client.js.map +1 -0
- package/dist/field/features/toolbars/inline/feature.server.d.ts +3 -0
- package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -0
- package/dist/field/features/toolbars/inline/feature.server.js +16 -0
- package/dist/field/features/toolbars/inline/feature.server.js.map +1 -0
- package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +10 -0
- package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -0
- package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.js +16 -12
- package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
- package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.scss +3 -1
- package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +23 -0
- package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -0
- package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/DropDown.js +17 -67
- package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -0
- package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +23 -0
- package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -0
- package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +139 -0
- package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -0
- package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/index.scss +25 -13
- package/dist/field/features/toolbars/types.d.ts +48 -0
- package/dist/field/features/toolbars/types.d.ts.map +1 -0
- package/dist/field/features/toolbars/types.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 +35 -10
- package/dist/field/features/upload/feature.client.js.map +1 -1
- package/dist/field/features/upload/populationPromise.d.ts.map +1 -1
- package/dist/field/features/upload/populationPromise.js +3 -1
- package/dist/field/features/upload/populationPromise.js.map +1 -1
- package/dist/field/lexical/EditorFocusProvider.d.ts +20 -0
- package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -0
- package/dist/field/lexical/EditorFocusProvider.js +78 -0
- package/dist/field/lexical/EditorFocusProvider.js.map +1 -0
- package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/field/lexical/LexicalEditor.js +20 -4
- package/dist/field/lexical/LexicalEditor.js.map +1 -1
- package/dist/field/lexical/LexicalEditor.scss +3 -19
- package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/field/lexical/LexicalProvider.js +3 -2
- package/dist/field/lexical/LexicalProvider.js.map +1 -1
- package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +2 -3
- package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
- package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
- 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 +9 -7
- 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 +17 -25
- 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 +71 -65
- package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/field/lexical/theme/EditorTheme.scss +2 -6
- package/dist/field/lexical/ui/icons/Add/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Add/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Add/index.js +16 -0
- package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
- package/dist/index.d.ts +15 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -12
- package/dist/index.js.map +1 -1
- package/dist/populate/populate.d.ts +2 -1
- package/dist/populate/populate.d.ts.map +1 -1
- package/dist/populate/populate.js +13 -11
- package/dist/populate/populate.js.map +1 -1
- package/dist/populate/populateLexicalPopulationPromises.d.ts +1 -1
- package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -1
- package/dist/populate/populateLexicalPopulationPromises.js +2 -1
- package/dist/populate/populateLexicalPopulationPromises.js.map +1 -1
- package/dist/populate/recurseNestedFields.d.ts +2 -1
- package/dist/populate/recurseNestedFields.d.ts.map +1 -1
- package/dist/populate/recurseNestedFields.js +2 -1
- package/dist/populate/recurseNestedFields.js.map +1 -1
- package/package.json +10 -10
- 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 +0 -12
- 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 +0 -12
- 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.d.ts.map +0 -1
- package/dist/field/features/format/inlinecode/feature.client.js +0 -42
- package/dist/field/features/format/inlinecode/feature.client.js.map +0 -1
- package/dist/field/features/horizontalrule/feature.client.d.ts.map +0 -1
- package/dist/field/features/horizontalrule/feature.client.js +0 -53
- 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.d.ts.map +0 -1
- package/dist/field/features/lists/orderedlist/feature.client.js +0 -71
- 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 +0 -71
- 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 +0 -17
- 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 +0 -18
- 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 +0 -6
- 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 +0 -40
- 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 → features/toolbars}/types.js +0 -0
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
|
|
3
|
-
import { HorizontalRuleIcon } from '../../lexical/ui/icons/HorizontalRule/index.js';
|
|
4
|
-
import { createClientComponent } from '../createClientComponent.js';
|
|
5
|
-
import { MarkdownTransformer } from './markdownTransformer.js';
|
|
6
|
-
import { HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from './nodes/HorizontalRuleNode.js';
|
|
7
|
-
import { HorizontalRulePlugin } from './plugin/index.js';
|
|
8
|
-
const HorizontalRuleFeatureClient = (props)=>{
|
|
9
|
-
return {
|
|
10
|
-
clientFeatureProps: props,
|
|
11
|
-
feature: ()=>({
|
|
12
|
-
clientFeatureProps: props,
|
|
13
|
-
markdownTransformers: [
|
|
14
|
-
MarkdownTransformer
|
|
15
|
-
],
|
|
16
|
-
nodes: [
|
|
17
|
-
HorizontalRuleNode
|
|
18
|
-
],
|
|
19
|
-
plugins: [
|
|
20
|
-
{
|
|
21
|
-
Component: HorizontalRulePlugin,
|
|
22
|
-
position: 'normal'
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
slashMenu: {
|
|
26
|
-
options: [
|
|
27
|
-
{
|
|
28
|
-
displayName: 'Basic',
|
|
29
|
-
key: 'basic',
|
|
30
|
-
options: [
|
|
31
|
-
new SlashMenuOption(`horizontalrule`, {
|
|
32
|
-
Icon: HorizontalRuleIcon,
|
|
33
|
-
displayName: `Horizontal Rule`,
|
|
34
|
-
keywords: [
|
|
35
|
-
'hr',
|
|
36
|
-
'horizontal rule',
|
|
37
|
-
'line',
|
|
38
|
-
'separator'
|
|
39
|
-
],
|
|
40
|
-
onSelect: ({ editor })=>{
|
|
41
|
-
editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined);
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
export const HorizontalRuleFeatureClientComponent = createClientComponent(HorizontalRuleFeatureClient);
|
|
52
|
-
|
|
53
|
-
//# sourceMappingURL=feature.client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/horizontalrule/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\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 options: [\n {\n displayName: 'Basic',\n key: 'basic',\n options: [\n new SlashMenuOption(`horizontalrule`, {\n Icon: HorizontalRuleIcon,\n displayName: `Horizontal Rule`,\n keywords: ['hr', 'horizontal rule', 'line', 'separator'],\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined)\n },\n }),\n ],\n },\n ],\n },\n }),\n }\n}\n\nexport const HorizontalRuleFeatureClientComponent = createClientComponent(\n HorizontalRuleFeatureClient,\n)\n"],"names":["SlashMenuOption","HorizontalRuleIcon","createClientComponent","MarkdownTransformer","HorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","HorizontalRuleFeatureClient","props","clientFeatureProps","feature","markdownTransformers","nodes","plugins","Component","position","slashMenu","options","displayName","key","Icon","keywords","onSelect","editor","dispatchCommand","undefined","HorizontalRuleFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,eAAe,QAAQ,sEAAqE;AACrG,SAASC,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,SAAS;wBACP;4BACEC,aAAa;4BACbC,KAAK;4BACLF,SAAS;gCACP,IAAIjB,gBAAgB,CAAC,cAAc,CAAC,EAAE;oCACpCoB,MAAMnB;oCACNiB,aAAa,CAAC,eAAe,CAAC;oCAC9BG,UAAU;wCAAC;wCAAM;wCAAmB;wCAAQ;qCAAY;oCACxDC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,eAAe,CAACnB,gCAAgCoB;oCACzD;gCACF;6BACD;wBACH;qBACD;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,uCAAuCxB,sBAClDK,6BACD"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { FloatingToolbarSection, FloatingToolbarSectionEntry } from '../../lexical/plugins/FloatingSelectToolbar/types.js';
|
|
2
|
-
export declare const IndentSectionWithEntries: (entries: FloatingToolbarSectionEntry[]) => FloatingToolbarSection;
|
|
3
|
-
//# sourceMappingURL=floatingSelectToolbarIndentSection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"floatingSelectToolbarIndentSection.d.ts","sourceRoot":"","sources":["../../../../src/field/features/indent/floatingSelectToolbarIndentSection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,sDAAsD,CAAA;AAE7D,eAAO,MAAM,wBAAwB,YAC1B,2BAA2B,EAAE,KACrC,sBAOF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/indent/floatingSelectToolbarIndentSection.ts"],"sourcesContent":["import type {\n FloatingToolbarSection,\n FloatingToolbarSectionEntry,\n} from '../../lexical/plugins/FloatingSelectToolbar/types.js'\n\nexport const IndentSectionWithEntries = (\n entries: FloatingToolbarSectionEntry[],\n): FloatingToolbarSection => {\n return {\n type: 'buttons',\n entries,\n key: 'indent',\n order: 3,\n }\n}\n"],"names":["IndentSectionWithEntries","entries","type","key","order"],"rangeMappings":";;;;;;;","mappings":"AAKA,OAAO,MAAMA,2BAA2B,CACtCC;IAEA,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/lists/orderedlist/feature.client.tsx"],"names":[],"mappings":";AAmEA,eAAO,MAAM,iCAAiC,+BAAkD,CAAA"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { INSERT_ORDERED_LIST_COMMAND, ListItemNode, ListNode } from '@lexical/list';
|
|
3
|
-
import { SlashMenuOption } from '../../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
|
|
4
|
-
import { OrderedListIcon } from '../../../lexical/ui/icons/OrderedList/index.js';
|
|
5
|
-
import { TextDropdownSectionWithEntries } from '../../common/floatingSelectToolbarTextDropdownSection/index.js';
|
|
6
|
-
import { createClientComponent } from '../../createClientComponent.js';
|
|
7
|
-
import { LexicalListPlugin } from '../plugin/index.js';
|
|
8
|
-
import { ORDERED_LIST } from './markdownTransformer.js';
|
|
9
|
-
const OrderedListFeatureClient = (props)=>{
|
|
10
|
-
return {
|
|
11
|
-
clientFeatureProps: props,
|
|
12
|
-
feature: ({ featureProviderMap })=>{
|
|
13
|
-
return {
|
|
14
|
-
clientFeatureProps: props,
|
|
15
|
-
floatingSelectToolbar: {
|
|
16
|
-
sections: [
|
|
17
|
-
TextDropdownSectionWithEntries([
|
|
18
|
-
{
|
|
19
|
-
ChildComponent: OrderedListIcon,
|
|
20
|
-
isActive: ()=>false,
|
|
21
|
-
key: 'orderedList',
|
|
22
|
-
label: `Ordered List`,
|
|
23
|
-
onClick: ({ editor })=>{
|
|
24
|
-
editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined);
|
|
25
|
-
},
|
|
26
|
-
order: 10
|
|
27
|
-
}
|
|
28
|
-
])
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
markdownTransformers: [
|
|
32
|
-
ORDERED_LIST
|
|
33
|
-
],
|
|
34
|
-
nodes: featureProviderMap.has('unorderedlist') ? [] : [
|
|
35
|
-
ListNode,
|
|
36
|
-
ListItemNode
|
|
37
|
-
],
|
|
38
|
-
plugins: featureProviderMap.has('unorderedlist') ? [] : [
|
|
39
|
-
{
|
|
40
|
-
Component: LexicalListPlugin,
|
|
41
|
-
position: 'normal'
|
|
42
|
-
}
|
|
43
|
-
],
|
|
44
|
-
slashMenu: {
|
|
45
|
-
options: [
|
|
46
|
-
{
|
|
47
|
-
displayName: 'Lists',
|
|
48
|
-
key: 'lists',
|
|
49
|
-
options: [
|
|
50
|
-
new SlashMenuOption('orderedlist', {
|
|
51
|
-
Icon: OrderedListIcon,
|
|
52
|
-
displayName: 'Ordered List',
|
|
53
|
-
keywords: [
|
|
54
|
-
'ordered list',
|
|
55
|
-
'ol'
|
|
56
|
-
],
|
|
57
|
-
onSelect: ({ editor })=>{
|
|
58
|
-
editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined);
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
export const OrderedListFeatureClientComponent = createClientComponent(OrderedListFeatureClient);
|
|
70
|
-
|
|
71
|
-
//# sourceMappingURL=feature.client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/lists/orderedlist/feature.client.tsx"],"sourcesContent":["'use client'\nimport { INSERT_ORDERED_LIST_COMMAND, ListItemNode, ListNode } from '@lexical/list'\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { SlashMenuOption } from '../../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport { OrderedListIcon } from '../../../lexical/ui/icons/OrderedList/index.js'\nimport { TextDropdownSectionWithEntries } from '../../common/floatingSelectToolbarTextDropdownSection/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { LexicalListPlugin } from '../plugin/index.js'\nimport { ORDERED_LIST } from './markdownTransformer.js'\n\nconst OrderedListFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: ({ featureProviderMap }) => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n TextDropdownSectionWithEntries([\n {\n ChildComponent: OrderedListIcon,\n isActive: () => false,\n key: 'orderedList',\n label: `Ordered List`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined)\n },\n order: 10,\n },\n ]),\n ],\n },\n markdownTransformers: [ORDERED_LIST],\n nodes: featureProviderMap.has('unorderedlist') ? [] : [ListNode, ListItemNode],\n plugins: featureProviderMap.has('unorderedlist')\n ? []\n : [\n {\n Component: LexicalListPlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n options: [\n {\n displayName: 'Lists',\n key: 'lists',\n options: [\n new SlashMenuOption('orderedlist', {\n Icon: OrderedListIcon,\n displayName: 'Ordered List',\n keywords: ['ordered list', 'ol'],\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined)\n },\n }),\n ],\n },\n ],\n },\n }\n },\n }\n}\n\nexport const OrderedListFeatureClientComponent = createClientComponent(OrderedListFeatureClient)\n"],"names":["INSERT_ORDERED_LIST_COMMAND","ListItemNode","ListNode","SlashMenuOption","OrderedListIcon","TextDropdownSectionWithEntries","createClientComponent","LexicalListPlugin","ORDERED_LIST","OrderedListFeatureClient","props","clientFeatureProps","feature","featureProviderMap","floatingSelectToolbar","sections","ChildComponent","isActive","key","label","onClick","editor","dispatchCommand","undefined","order","markdownTransformers","nodes","has","plugins","Component","position","slashMenu","options","displayName","Icon","keywords","onSelect","OrderedListFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,2BAA2B,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,gBAAe;AAInF,SAASC,eAAe,QAAQ,yEAAwE;AACxG,SAASC,eAAe,QAAQ,iDAAgD;AAChF,SAASC,8BAA8B,QAAQ,iEAAgE;AAC/G,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,iBAAiB,QAAQ,qBAAoB;AACtD,SAASC,YAAY,QAAQ,2BAA0B;AAEvD,MAAMC,2BAAqE,CAACC;IAC1E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,CAAC,EAAEC,kBAAkB,EAAE;YAC9B,OAAO;gBACLF,oBAAoBD;gBACpBI,uBAAuB;oBACrBC,UAAU;wBACRV,+BAA+B;4BAC7B;gCACEW,gBAAgBZ;gCAChBa,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,YAAY,CAAC;gCACrBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACtB,6BAA6BuB;gCACtD;gCACAC,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAC,sBAAsB;oBAACjB;iBAAa;gBACpCkB,OAAOb,mBAAmBc,GAAG,CAAC,mBAAmB,EAAE,GAAG;oBAACzB;oBAAUD;iBAAa;gBAC9E2B,SAASf,mBAAmBc,GAAG,CAAC,mBAC5B,EAAE,GACF;oBACE;wBACEE,WAAWtB;wBACXuB,UAAU;oBACZ;iBACD;gBACLC,WAAW;oBACTC,SAAS;wBACP;4BACEC,aAAa;4BACbf,KAAK;4BACLc,SAAS;gCACP,IAAI7B,gBAAgB,eAAe;oCACjC+B,MAAM9B;oCACN6B,aAAa;oCACbE,UAAU;wCAAC;wCAAgB;qCAAK;oCAChCC,UAAU,CAAC,EAAEf,MAAM,EAAE;wCACnBA,OAAOC,eAAe,CAACtB,6BAA6BuB;oCACtD;gCACF;6BACD;wBACH;qBACD;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMc,oCAAoC/B,sBAAsBG,0BAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/lists/unorderedlist/feature.client.tsx"],"names":[],"mappings":";AAkEA,eAAO,MAAM,mCAAmC,+BAAoD,CAAA"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { INSERT_UNORDERED_LIST_COMMAND, ListItemNode, ListNode } from '@lexical/list';
|
|
3
|
-
import { SlashMenuOption } from '../../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
|
|
4
|
-
import { UnorderedListIcon } from '../../../lexical/ui/icons/UnorderedList/index.js';
|
|
5
|
-
import { TextDropdownSectionWithEntries } from '../../common/floatingSelectToolbarTextDropdownSection/index.js';
|
|
6
|
-
import { createClientComponent } from '../../createClientComponent.js';
|
|
7
|
-
import { LexicalListPlugin } from '../plugin/index.js';
|
|
8
|
-
import { UNORDERED_LIST } from './markdownTransformer.js';
|
|
9
|
-
const UnorderedListFeatureClient = (props)=>{
|
|
10
|
-
return {
|
|
11
|
-
clientFeatureProps: props,
|
|
12
|
-
feature: ()=>{
|
|
13
|
-
return {
|
|
14
|
-
clientFeatureProps: props,
|
|
15
|
-
floatingSelectToolbar: {
|
|
16
|
-
sections: [
|
|
17
|
-
TextDropdownSectionWithEntries([
|
|
18
|
-
{
|
|
19
|
-
ChildComponent: UnorderedListIcon,
|
|
20
|
-
isActive: ()=>false,
|
|
21
|
-
key: 'unorderedList',
|
|
22
|
-
label: `Unordered List`,
|
|
23
|
-
onClick: ({ editor })=>{
|
|
24
|
-
editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, undefined);
|
|
25
|
-
},
|
|
26
|
-
order: 11
|
|
27
|
-
}
|
|
28
|
-
])
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
markdownTransformers: [
|
|
32
|
-
UNORDERED_LIST
|
|
33
|
-
],
|
|
34
|
-
nodes: [
|
|
35
|
-
ListNode,
|
|
36
|
-
ListItemNode
|
|
37
|
-
],
|
|
38
|
-
plugins: [
|
|
39
|
-
{
|
|
40
|
-
Component: LexicalListPlugin,
|
|
41
|
-
position: 'normal'
|
|
42
|
-
}
|
|
43
|
-
],
|
|
44
|
-
slashMenu: {
|
|
45
|
-
options: [
|
|
46
|
-
{
|
|
47
|
-
displayName: 'Lists',
|
|
48
|
-
key: 'lists',
|
|
49
|
-
options: [
|
|
50
|
-
new SlashMenuOption('unorderedlist', {
|
|
51
|
-
Icon: UnorderedListIcon,
|
|
52
|
-
displayName: 'Unordered List',
|
|
53
|
-
keywords: [
|
|
54
|
-
'unordered list',
|
|
55
|
-
'ul'
|
|
56
|
-
],
|
|
57
|
-
onSelect: ({ editor })=>{
|
|
58
|
-
editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, undefined);
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
export const UnorderedListFeatureClientComponent = createClientComponent(UnorderedListFeatureClient);
|
|
70
|
-
|
|
71
|
-
//# sourceMappingURL=feature.client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/lists/unorderedlist/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { INSERT_UNORDERED_LIST_COMMAND, ListItemNode, ListNode } from '@lexical/list'\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { SlashMenuOption } from '../../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport { UnorderedListIcon } from '../../../lexical/ui/icons/UnorderedList/index.js'\nimport { TextDropdownSectionWithEntries } from '../../common/floatingSelectToolbarTextDropdownSection/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { LexicalListPlugin } from '../plugin/index.js'\nimport { UNORDERED_LIST } from './markdownTransformer.js'\n\nconst UnorderedListFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n TextDropdownSectionWithEntries([\n {\n ChildComponent: UnorderedListIcon,\n isActive: () => false,\n key: 'unorderedList',\n label: `Unordered List`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, undefined)\n },\n order: 11,\n },\n ]),\n ],\n },\n markdownTransformers: [UNORDERED_LIST],\n nodes: [ListNode, ListItemNode],\n plugins: [\n {\n Component: LexicalListPlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n options: [\n {\n displayName: 'Lists',\n key: 'lists',\n options: [\n new SlashMenuOption('unorderedlist', {\n Icon: UnorderedListIcon,\n displayName: 'Unordered List',\n keywords: ['unordered list', 'ul'],\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, undefined)\n },\n }),\n ],\n },\n ],\n },\n }\n },\n }\n}\n\nexport const UnorderedListFeatureClientComponent = createClientComponent(UnorderedListFeatureClient)\n"],"names":["INSERT_UNORDERED_LIST_COMMAND","ListItemNode","ListNode","SlashMenuOption","UnorderedListIcon","TextDropdownSectionWithEntries","createClientComponent","LexicalListPlugin","UNORDERED_LIST","UnorderedListFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","key","label","onClick","editor","dispatchCommand","undefined","order","markdownTransformers","nodes","plugins","Component","position","slashMenu","options","displayName","Icon","keywords","onSelect","UnorderedListFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,6BAA6B,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,gBAAe;AAIrF,SAASC,eAAe,QAAQ,yEAAwE;AACxG,SAASC,iBAAiB,QAAQ,mDAAkD;AACpF,SAASC,8BAA8B,QAAQ,iEAAgE;AAC/G,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,iBAAiB,QAAQ,qBAAoB;AACtD,SAASC,cAAc,QAAQ,2BAA0B;AAEzD,MAAMC,6BAAuE,CAACC;IAC5E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRT,+BAA+B;4BAC7B;gCACEU,gBAAgBX;gCAChBY,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,cAAc,CAAC;gCACvBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACrB,+BAA+BsB;gCACxD;gCACAC,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAC,sBAAsB;oBAAChB;iBAAe;gBACtCiB,OAAO;oBAACvB;oBAAUD;iBAAa;gBAC/ByB,SAAS;oBACP;wBACEC,WAAWpB;wBACXqB,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,SAAS;wBACP;4BACEC,aAAa;4BACbd,KAAK;4BACLa,SAAS;gCACP,IAAI3B,gBAAgB,iBAAiB;oCACnC6B,MAAM5B;oCACN2B,aAAa;oCACbE,UAAU;wCAAC;wCAAkB;qCAAK;oCAClCC,UAAU,CAAC,EAAEd,MAAM,EAAE;wCACnBA,OAAOC,eAAe,CAACrB,+BAA+BsB;oCACxD;gCACF;6BACD;wBACH;qBACD;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMa,sCAAsC7B,sBAAsBG,4BAA2B"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { FloatingToolbarSectionEntry } from '../types.js';
|
|
3
|
-
import './index.scss';
|
|
4
|
-
export declare const ToolbarButton: ({ children, entry, }: {
|
|
5
|
-
children: React.JSX.Element;
|
|
6
|
-
entry: FloatingToolbarSectionEntry;
|
|
7
|
-
}) => React.JSX.Element;
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAE/D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE9D,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,aAAa,yBAGvB;IACD,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAA;IAC3B,KAAK,EAAE,2BAA2B,CAAA;CACnC,sBA8EA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.tsx"],"sourcesContent":["'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { $getSelection } from 'lexical'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport type { FloatingToolbarSectionEntry } from '../types.js'\n\nimport './index.scss'\n\nconst baseClass = 'floating-select-toolbar-popup__button'\n\nexport const ToolbarButton = ({\n children,\n entry,\n}: {\n children: React.JSX.Element\n entry: FloatingToolbarSectionEntry\n}) => {\n const [editor] = useLexicalComposerContext()\n const [enabled, setEnabled] = useState<boolean>(true)\n const [active, setActive] = useState<boolean>(false)\n const [className, setClassName] = useState<string>(baseClass)\n\n const updateStates = useCallback(() => {\n editor.getEditorState().read(() => {\n const selection = $getSelection()\n if (entry.isActive) {\n const isActive = entry.isActive({ editor, selection })\n if (active !== isActive) {\n setActive(isActive)\n }\n }\n if (entry.isEnabled) {\n const isEnabled = entry.isEnabled({ editor, selection })\n if (enabled !== isEnabled) {\n setEnabled(isEnabled)\n }\n }\n })\n }, [active, editor, enabled, entry])\n\n useEffect(() => {\n updateStates()\n }, [updateStates])\n\n useEffect(() => {\n document.addEventListener('mouseup', updateStates)\n return () => {\n document.removeEventListener('mouseup', updateStates)\n }\n }, [updateStates])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerUpdateListener(() => {\n updateStates()\n }),\n )\n }, [editor, updateStates])\n\n useEffect(() => {\n setClassName(\n [\n baseClass,\n enabled === false ? 'disabled' : '',\n active ? 'active' : '',\n entry?.key ? `${baseClass}-` + entry.key : '',\n ]\n .filter(Boolean)\n .join(' '),\n )\n }, [enabled, active, className])\n\n return (\n <button\n className={className}\n onClick={() => {\n if (enabled !== false) {\n entry.onClick({\n editor,\n isActive: active,\n })\n }\n }}\n onMouseDown={(e) => {\n // This fixes a bug where you are unable to click the button if you are in a NESTED editor (editor in blocks field in editor).\n // Thus only happens if you click on the SVG of the button. Clicking on the outside works. Related issue: https://github.com/payloadcms/payload/issues/4025\n // TODO: Find out why exactly it happens and why e.preventDefault() on the mouseDown fixes it. Write that down here, or potentially fix a root cause, if there is any.\n e.preventDefault()\n }}\n type=\"button\"\n >\n {children}\n </button>\n )\n}\n"],"names":["useLexicalComposerContext","mergeRegister","$getSelection","React","useCallback","useEffect","useState","baseClass","ToolbarButton","children","entry","editor","enabled","setEnabled","active","setActive","className","setClassName","updateStates","getEditorState","read","selection","isActive","isEnabled","document","addEventListener","removeEventListener","registerUpdateListener","key","filter","Boolean","join","button","onClick","onMouseDown","e","preventDefault","type"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,aAAa,QAAQ,iBAAgB;AAC9C,SAASC,aAAa,QAAQ,UAAS;AACvC,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAI/D,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,OAAO,MAAMC,gBAAgB,CAAC,EAC5BC,QAAQ,EACRC,KAAK,EAIN;IACC,MAAM,CAACC,OAAO,GAAGX;IACjB,MAAM,CAACY,SAASC,WAAW,GAAGP,SAAkB;IAChD,MAAM,CAACQ,QAAQC,UAAU,GAAGT,SAAkB;IAC9C,MAAM,CAACU,WAAWC,aAAa,GAAGX,SAAiBC;IAEnD,MAAMW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 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { FloatingToolbarSectionEntry } from '../types.js';
|
|
4
|
-
export declare function DropDownItem({ children, entry, title, }: {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
entry: FloatingToolbarSectionEntry;
|
|
7
|
-
title?: string;
|
|
8
|
-
}): React.ReactNode;
|
|
9
|
-
export declare function DropDown({ Icon, buttonAriaLabel, buttonClassName, children, disabled, stopCloseOnClickSelf, }: {
|
|
10
|
-
Icon?: React.FC;
|
|
11
|
-
buttonAriaLabel?: string;
|
|
12
|
-
buttonClassName: string;
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
stopCloseOnClickSelf?: boolean;
|
|
16
|
-
}): React.ReactNode;
|
|
17
|
-
//# sourceMappingURL=DropDown.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropDown.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAA;AACzF,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAU9D,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,EAAE,2BAA2B,CAAA;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,KAAK,CAAC,SAAS,CA+FlB;AA4ED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,eAAe,EACf,eAAe,EACf,QAAQ,EACR,QAAgB,EAChB,oBAAoB,GACrB,EAAE;IACD,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B,GAAG,KAAK,CAAC,SAAS,CAgFlB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.tsx"],"sourcesContent":["'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { $getSelection } from 'lexical'\nimport { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { FloatingToolbarSectionEntry } from '../types.js'\n\nconst baseClass = 'floating-select-toolbar-popup__dropdown-item'\n\ninterface DropDownContextType {\n registerItem: (ref: React.RefObject<HTMLButtonElement>) => void\n}\n\nconst DropDownContext = React.createContext<DropDownContextType | null>(null)\n\nexport function DropDownItem({\n children,\n entry,\n title,\n}: {\n children: React.ReactNode\n entry: FloatingToolbarSectionEntry\n title?: string\n}): React.ReactNode {\n const [editor] = useLexicalComposerContext()\n const [enabled, setEnabled] = useState<boolean>(true)\n const [active, setActive] = useState<boolean>(false)\n const [className, setClassName] = useState<string>(baseClass)\n\n const updateStates = useCallback(() => {\n editor.getEditorState().read(() => {\n const selection = $getSelection()\n if (entry.isActive) {\n const isActive = entry.isActive({ editor, selection })\n if (active !== isActive) {\n setActive(isActive)\n }\n }\n if (entry.isEnabled) {\n const isEnabled = entry.isEnabled({ editor, selection })\n if (enabled !== isEnabled) {\n setEnabled(isEnabled)\n }\n }\n })\n }, [active, editor, enabled, entry])\n\n useEffect(() => {\n updateStates()\n }, [updateStates])\n\n useEffect(() => {\n document.addEventListener('mouseup', updateStates)\n return () => {\n document.removeEventListener('mouseup', updateStates)\n }\n }, [updateStates])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerUpdateListener(() => {\n updateStates()\n }),\n )\n }, [editor, updateStates])\n\n useEffect(() => {\n setClassName(\n [\n baseClass,\n enabled === false ? 'disabled' : '',\n active ? 'active' : '',\n entry?.key ? `${baseClass}-${entry.key}` : '',\n ]\n .filter(Boolean)\n .join(' '),\n )\n }, [enabled, active, className, entry.key])\n\n const ref = useRef<HTMLButtonElement>(null)\n\n const dropDownContext = React.useContext(DropDownContext)\n\n if (dropDownContext === null) {\n throw new Error('DropDownItem must be used within a DropDown')\n }\n\n const { registerItem } = dropDownContext\n\n useEffect(() => {\n if (ref?.current != null) {\n registerItem(ref)\n }\n }, [ref, registerItem])\n\n return (\n <button\n className={className}\n onClick={() => {\n if (enabled !== false) {\n entry.onClick({\n editor,\n isActive: active,\n })\n }\n }}\n onMouseDown={(e) => {\n // This is required for Firefox compatibility. Without it, the dropdown will disappear without the onClick being called.\n // This only happens in Firefox. Must be something about how Firefox handles focus events differently.\n e.preventDefault()\n }}\n ref={ref}\n title={title}\n type=\"button\"\n >\n {children}\n </button>\n )\n}\n\nfunction DropDownItems({\n children,\n dropDownRef,\n onClose,\n}: {\n children: React.ReactNode\n dropDownRef: React.Ref<HTMLDivElement>\n onClose: () => void\n}): JSX.Element {\n const [items, setItems] = useState<Array<React.RefObject<HTMLButtonElement>>>()\n const [highlightedItem, setHighlightedItem] = useState<React.RefObject<HTMLButtonElement>>()\n\n const registerItem = useCallback(\n (itemRef: React.RefObject<HTMLButtonElement>) => {\n setItems((prev) => (prev != null ? [...prev, itemRef] : [itemRef]))\n },\n [setItems],\n )\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>): void => {\n if (items == null) return\n\n const { key } = event\n\n if (['ArrowDown', 'ArrowUp', 'Escape', 'Tab'].includes(key)) {\n event.preventDefault()\n }\n\n if (key === 'Escape' || key === 'Tab') {\n onClose()\n } else if (key === 'ArrowUp') {\n setHighlightedItem((prev) => {\n if (prev == null) return items[0]\n const index = items.indexOf(prev) - 1\n return items[index === -1 ? items.length - 1 : index]\n })\n } else if (key === 'ArrowDown') {\n setHighlightedItem((prev) => {\n if (prev == null) return items[0]\n return items[items.indexOf(prev) + 1]\n })\n }\n }\n\n const contextValue = useMemo(\n () => ({\n registerItem,\n }),\n [registerItem],\n )\n\n useEffect(() => {\n if (items != null && highlightedItem == null) {\n setHighlightedItem(items[0])\n }\n\n if (highlightedItem?.current != null) {\n highlightedItem.current.focus()\n }\n }, [items, highlightedItem])\n\n return (\n <DropDownContext.Provider value={contextValue}>\n <div\n className=\"floating-select-toolbar-popup__dropdown-items\"\n onKeyDown={handleKeyDown}\n ref={dropDownRef}\n >\n {children}\n </div>\n </DropDownContext.Provider>\n )\n}\n\nexport function DropDown({\n Icon,\n buttonAriaLabel,\n buttonClassName,\n children,\n disabled = false,\n stopCloseOnClickSelf,\n}: {\n Icon?: React.FC\n buttonAriaLabel?: string\n buttonClassName: string\n children: ReactNode\n disabled?: boolean\n stopCloseOnClickSelf?: boolean\n}): React.ReactNode {\n const dropDownRef = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const [showDropDown, setShowDropDown] = useState(false)\n\n const handleClose = (): void => {\n setShowDropDown(false)\n if (buttonRef?.current != null) {\n buttonRef.current.focus()\n }\n }\n\n useEffect(() => {\n const button = buttonRef.current\n const dropDown = dropDownRef.current\n\n if (showDropDown && button !== null && dropDown !== null) {\n const { left, top } = button.getBoundingClientRect()\n const scrollTopOffset = window.pageYOffset || document.documentElement.scrollTop\n dropDown.style.top = `${top + scrollTopOffset + button.offsetHeight + 5}px`\n dropDown.style.left = `${Math.min(left - 5, window.innerWidth - dropDown.offsetWidth - 20)}px`\n }\n }, [dropDownRef, buttonRef, showDropDown])\n\n useEffect(() => {\n const button = buttonRef.current\n\n if (button !== null && showDropDown) {\n const handle = (event: MouseEvent): void => {\n const { target } = event\n if (stopCloseOnClickSelf != null) {\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n if (dropDownRef.current != null && dropDownRef.current.contains(target as Node)) {\n return\n }\n }\n if (!button.contains(target as Node)) {\n setShowDropDown(false)\n }\n }\n document.addEventListener('click', handle)\n\n return () => {\n document.removeEventListener('click', handle)\n }\n }\n }, [dropDownRef, buttonRef, showDropDown, stopCloseOnClickSelf])\n\n return (\n <React.Fragment>\n <button\n aria-label={buttonAriaLabel}\n className={buttonClassName + (showDropDown ? ' active' : '')}\n disabled={disabled}\n onClick={(event) => {\n event.preventDefault()\n setShowDropDown(!showDropDown)\n }}\n onMouseDown={(e) => {\n // This fixes a bug where you are unable to click the button if you are in a NESTED editor (editor in blocks field in editor).\n // Thus only happens if you click on the SVG of the button. Clicking on the outside works. Related issue: https://github.com/payloadcms/payload/issues/4025\n // TODO: Find out why exactly it happens and why e.preventDefault() on the mouseDown fixes it. Write that down here, or potentially fix a root cause, if there is any.\n e.preventDefault()\n }}\n ref={buttonRef}\n type=\"button\"\n >\n <Icon />\n <i className=\"floating-select-toolbar-popup__dropdown-caret\" />\n </button>\n\n {showDropDown &&\n createPortal(\n <DropDownItems dropDownRef={dropDownRef} onClose={handleClose}>\n {children}\n </DropDownItems>,\n document.body,\n )}\n </React.Fragment>\n )\n}\n"],"names":["useLexicalComposerContext","mergeRegister","$getSelection","useCallback","useEffect","useMemo","useRef","useState","React","createPortal","baseClass","DropDownContext","createContext","DropDownItem","children","entry","title","editor","enabled","setEnabled","active","setActive","className","setClassName","updateStates","getEditorState","read","selection","isActive","isEnabled","document","addEventListener","removeEventListener","registerUpdateListener","key","filter","Boolean","join","ref","dropDownContext","useContext","Error","registerItem","current","button","onClick","onMouseDown","e","preventDefault","type","DropDownItems","dropDownRef","onClose","items","setItems","highlightedItem","setHighlightedItem","itemRef","prev","handleKeyDown","event","includes","index","indexOf","length","contextValue","focus","Provider","value","div","onKeyDown","DropDown","Icon","buttonAriaLabel","buttonClassName","disabled","stopCloseOnClickSelf","buttonRef","showDropDown","setShowDropDown","handleClose","dropDown","left","top","getBoundingClientRect","scrollTopOffset","window","pageYOffset","documentElement","scrollTop","style","offsetHeight","Math","min","innerWidth","offsetWidth","handle","target","contains","Fragment","aria-label","i","body"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,aAAa,QAAQ,iBAAgB;AAC9C,SAASC,aAAa,QAAQ,UAAS;AACvC,SAAyBC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AACzF,OAAOC,WAAW,QAAO;AACzB,SAASC,YAAY,QAAQ,YAAW;AAIxC,MAAMC,YAAY;AAMlB,MAAMC,gCAAkBH,MAAMI,aAAa,CAA6B;AAExE,OAAO,SAASC,aAAa,EAC3BC,QAAQ,EACRC,KAAK,EACLC,KAAK,EAKN;IACC,MAAM,CAACC,OAAO,GAAGjB;IACjB,MAAM,CAACkB,SAASC,WAAW,GAAGZ,SAAkB;IAChD,MAAM,CAACa,QAAQC,UAAU,GAAGd,SAAkB;IAC9C,MAAM,CAACe,WAAWC,aAAa,GAAGhB,SAAiBG;IAEnD,MAAMc,eAAerB,YAAY;QAC/Bc,OAAOQ,cAAc,GAAGC,IAAI,CAAC;YAC3B,MAAMC,YAAYzB;YAClB,IAAIa,MAAMa,QAAQ,EAAE;gBAClB,MAAMA,WAAWb,MAAMa,QAAQ,CAAC;oBAAEX;oBAAQU;gBAAU;gBACpD,IAAIP,WAAWQ,UAAU;oBACvBP,U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Ac;YACnC,MAAMkB,SAAS,CAACpC;gBACd,MAAM,EAAEqC,MAAM,EAAE,GAAGrC;gBACnB,IAAIgB,wBAAwB,MAAM;oBAChC,oEAAoE;oBACpE,IAAIzB,YAAYR,OAAO,IAAI,QAAQQ,YAAYR,OAAO,CAACuD,QAAQ,CAACD,SAAiB;wBAC/E;oBACF;gBACF;gBACA,IAAI,CAACrD,OAAOsD,QAAQ,CAACD,SAAiB;oBACpClB,gBAAgB;gBAClB;YACF;YACAjD,SAASC,gBAAgB,CAAC,SAASiE;YAEnC,OAAO;gBACLlE,SAASE,mBAAmB,CAAC,SAASgE;YACxC;QACF;IACF,GAAG;QAAC7C;QAAa0B;QAAWC;QAAcF;KAAqB;IAE/D,qBACE,oBAACpE,MAAM2F,QAAQ,sBACb,oBAACvD;QACCwD,cAAY3B;QACZnD,WAAWoD,kBAAmBI,CAAAA,eAAe,YAAY,EAAC;QAC1DH,UAAUA;QACV9B,SAAS,CAACe;YACRA,MAAMZ,cAAc;YACpB+B,gBAAgB,CAACD;QACnB;QACAhC,aAAa,CAACC;YACZ,8HAA8H;YAC9H,2JAA2J;YAC3J,sKAAsK;YACtKA,EAAEC,cAAc;QAClB;QACAV,KAAKuC;QACL5B,MAAK;qBAEL,oBAACuB,2BACD,oBAAC6B;QAAE/E,WAAU;SAGdwD,8BACCrE,2BACE,oBAACyC;QAAcC,aAAaA;QAAaC,SAAS4B;OAC/ClE,WAEHgB,SAASwE,IAAI;AAIvB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { LexicalEditor } from 'lexical';
|
|
3
|
-
import type { FloatingToolbarSectionEntry } from '../types.js';
|
|
4
|
-
import './index.scss';
|
|
5
|
-
export declare const ToolbarEntry: ({ anchorElem, editor, entry, }: {
|
|
6
|
-
anchorElem: HTMLElement;
|
|
7
|
-
editor: LexicalEditor;
|
|
8
|
-
entry: FloatingToolbarSectionEntry;
|
|
9
|
-
}) => React.JSX.Element;
|
|
10
|
-
export declare const ToolbarDropdown: ({ Icon, anchorElem, classNames, editor, entries, sectionKey, }: {
|
|
11
|
-
Icon?: React.FC;
|
|
12
|
-
anchorElem: HTMLElement;
|
|
13
|
-
classNames?: string[];
|
|
14
|
-
editor: LexicalEditor;
|
|
15
|
-
entries: FloatingToolbarSectionEntry[];
|
|
16
|
-
sectionKey: string;
|
|
17
|
-
}) => React.JSX.Element;
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAG9D,OAAO,cAAc,CAAA;AAErB,eAAO,MAAM,YAAY,mCAItB;IACD,UAAU,EAAE,WAAW,CAAA;IACvB,MAAM,EAAE,aAAa,CAAA;IACrB,KAAK,EAAE,2BAA2B,CAAA;CACnC,sBAeA,CAAA;AAED,eAAO,MAAM,eAAe,mEAOzB;IACD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,UAAU,EAAE,WAAW,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,EAAE,2BAA2B,EAAE,CAAA;IACtC,UAAU,EAAE,MAAM,CAAA;CACnB,sBAkBA,CAAA"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
const baseClass = 'floating-select-toolbar-popup__dropdown';
|
|
4
|
-
import { DropDown, DropDownItem } from './DropDown.js';
|
|
5
|
-
import './index.scss';
|
|
6
|
-
export const ToolbarEntry = ({ anchorElem, editor, entry })=>{
|
|
7
|
-
if (entry.Component) {
|
|
8
|
-
return entry?.Component && /*#__PURE__*/ React.createElement(entry.Component, {
|
|
9
|
-
anchorElem: anchorElem,
|
|
10
|
-
editor: editor,
|
|
11
|
-
entry: entry,
|
|
12
|
-
key: entry.key
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
return /*#__PURE__*/ React.createElement(DropDownItem, {
|
|
16
|
-
entry: entry,
|
|
17
|
-
key: entry.key
|
|
18
|
-
}, entry?.ChildComponent && /*#__PURE__*/ React.createElement(entry.ChildComponent, null), /*#__PURE__*/ React.createElement("span", {
|
|
19
|
-
className: "text"
|
|
20
|
-
}, entry.label));
|
|
21
|
-
};
|
|
22
|
-
export const ToolbarDropdown = ({ Icon, anchorElem, classNames, editor, entries, sectionKey })=>{
|
|
23
|
-
return /*#__PURE__*/ React.createElement(DropDown, {
|
|
24
|
-
Icon: Icon,
|
|
25
|
-
buttonAriaLabel: `${sectionKey} dropdown`,
|
|
26
|
-
buttonClassName: [
|
|
27
|
-
baseClass,
|
|
28
|
-
`${baseClass}-${sectionKey}`,
|
|
29
|
-
...classNames || []
|
|
30
|
-
].filter(Boolean).join(' '),
|
|
31
|
-
key: sectionKey
|
|
32
|
-
}, entries.length && entries.map((entry)=>{
|
|
33
|
-
return /*#__PURE__*/ React.createElement(ToolbarEntry, {
|
|
34
|
-
anchorElem: anchorElem,
|
|
35
|
-
editor: editor,
|
|
36
|
-
entry: entry,
|
|
37
|
-
key: entry.key
|
|
38
|
-
});
|
|
39
|
-
}));
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nconst baseClass = 'floating-select-toolbar-popup__dropdown'\n\nimport type { LexicalEditor } from 'lexical'\n\nimport type { FloatingToolbarSectionEntry } from '../types.js'\n\nimport { DropDown, DropDownItem } from './DropDown.js'\nimport './index.scss'\n\nexport const ToolbarEntry = ({\n anchorElem,\n editor,\n entry,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n entry: FloatingToolbarSectionEntry\n}) => {\n if (entry.Component) {\n return (\n entry?.Component && (\n <entry.Component anchorElem={anchorElem} editor={editor} entry={entry} key={entry.key} />\n )\n )\n }\n\n return (\n <DropDownItem entry={entry} key={entry.key}>\n {entry?.ChildComponent && <entry.ChildComponent />}\n <span className=\"text\">{entry.label}</span>\n </DropDownItem>\n )\n}\n\nexport const ToolbarDropdown = ({\n Icon,\n anchorElem,\n classNames,\n editor,\n entries,\n sectionKey,\n}: {\n Icon?: React.FC\n anchorElem: HTMLElement\n classNames?: string[]\n editor: LexicalEditor\n entries: FloatingToolbarSectionEntry[]\n sectionKey: string\n}) => {\n return (\n <DropDown\n Icon={Icon}\n buttonAriaLabel={`${sectionKey} dropdown`}\n buttonClassName={[baseClass, `${baseClass}-${sectionKey}`, ...(classNames || [])]\n .filter(Boolean)\n .join(' ')}\n key={sectionKey}\n >\n {entries.length &&\n entries.map((entry) => {\n return (\n <ToolbarEntry anchorElem={anchorElem} editor={editor} entry={entry} key={entry.key} />\n )\n })}\n </DropDown>\n )\n}\n"],"names":["React","baseClass","DropDown","DropDownItem","ToolbarEntry","anchorElem","editor","entry","Component","key","ChildComponent","span","className","label","ToolbarDropdown","Icon","classNames","entries","sectionKey","buttonAriaLabel","buttonClassName","filter","Boolean","join","length","map"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,OAAOA,WAAW,QAAO;AAEzB,MAAMC,YAAY;AAMlB,SAASC,QAAQ,EAAEC,YAAY,QAAQ,gBAAe;AACtD,OAAO,eAAc;AAErB,OAAO,MAAMC,eAAe,CAAC,EAC3BC,UAAU,EACVC,MAAM,EACNC,KAAK,EAKN;IACC,IAAIA,MAAMC,SAAS,EAAE;QACnB,OACED,OAAOC,2BACL,oBAACD,MAAMC,SAAS;YAACH,YAAYA;YAAYC,QAAQA;YAAQC,OAAOA;YAAOE,KAAKF,MAAME,GAAG;;IAG3F;IAEA,qBACE,oBAACN;QAAaI,OAAOA;QAAOE,KAAKF,MAAME,GAAG;OACvCF,OAAOG,gCAAkB,oBAACH,MAAMG,cAAc,uBAC/C,oBAACC;QAAKC,WAAU;OAAQL,MAAMM,KAAK;AAGzC,EAAC;AAED,OAAO,MAAMC,kBAAkB,CAAC,EAC9BC,IAAI,EACJV,UAAU,EACVW,UAAU,EACVV,MAAM,EACNW,OAAO,EACPC,UAAU,EAQX;IACC,qBACE,oBAAChB;QACCa,MAAMA;QACNI,iBAAiB,CAAC,EAAED,WAAW,SAAS,CAAC;QACzCE,iBAAiB;YAACnB;YAAW,CAAC,EAAEA,UAAU,CAAC,EAAEiB,WAAW,CAAC;eAAMF,cAAc,EAAE;SAAE,CAC9EK,MAAM,CAACC,SACPC,IAAI,CAAC;QACRd,KAAKS;OAEJD,QAAQO,MAAM,IACbP,QAAQQ,GAAG,CAAC,CAAClB;QACX,qBACE,oBAACH;YAAaC,YAAYA;YAAYC,QAAQA;YAAQC,OAAOA;YAAOE,KAAKF,MAAME,GAAG;;IAEtF;AAGR,EAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/plugins/FloatingSelectToolbar/index.tsx"],"names":[],"mappings":";AAuBA,OAAO,cAAc,CAAA;AA2VrB,wBAAgB,2BAA2B,CAAC,EAC1C,UAA0B,GAC3B,EAAE;IACD,UAAU,CAAC,EAAE,WAAW,CAAA;CACzB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAGrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/lexical/plugins/FloatingSelectToolbar/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { mergeRegister } from '@lexical/utils'\nimport {\n $getSelection,\n $isRangeSelection,\n $isTextNode,\n COMMAND_PRIORITY_LOW,\n SELECTION_CHANGE_COMMAND,\n} from 'lexical'\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { FloatingToolbarSection, FloatingToolbarSectionEntry } from './types.js'\n\nimport { useEditorConfigContext } from '../../config/client/EditorConfigProvider.js'\nimport { getDOMRangeRect } from '../../utils/getDOMRangeRect.js'\nimport { setFloatingElemPosition } from '../../utils/setFloatingElemPosition.js'\nimport { ToolbarButton } from './ToolbarButton/index.js'\nimport { ToolbarDropdown } from './ToolbarDropdown/index.js'\nimport './index.scss'\n\nfunction ButtonSectionEntry({\n anchorElem,\n editor,\n entry,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n entry: FloatingToolbarSectionEntry\n}): React.ReactNode {\n if (entry.Component) {\n return (\n entry?.Component && (\n <entry.Component anchorElem={anchorElem} editor={editor} entry={entry} key={entry.key} />\n )\n )\n }\n\n return (\n <ToolbarButton entry={entry} key={entry.key}>\n {entry?.ChildComponent && <entry.ChildComponent />}\n </ToolbarButton>\n )\n}\n\nfunction ToolbarSection({\n anchorElem,\n editor,\n index,\n section,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n index: number\n section: FloatingToolbarSection\n}): React.ReactNode {\n const { editorConfig } = useEditorConfigContext()\n\n const Icon =\n section?.type === 'dropdown' && section.entries.length && section.ChildComponent\n ? section.ChildComponent\n : null\n\n return (\n <div\n className={`floating-select-toolbar-popup__section floating-select-toolbar-popup__section-${section.key}`}\n key={section.key}\n >\n {section.type === 'dropdown' &&\n section.entries.length &&\n (Icon ? (\n <ToolbarDropdown\n Icon={Icon}\n anchorElem={anchorElem}\n editor={editor}\n entries={section.entries}\n sectionKey={section.key}\n />\n ) : (\n <ToolbarDropdown\n anchorElem={anchorElem}\n editor={editor}\n entries={section.entries}\n sectionKey={section.key}\n />\n ))}\n {section.type === 'buttons' &&\n section.entries.length &&\n section.entries.map((entry) => {\n return (\n <ButtonSectionEntry\n anchorElem={anchorElem}\n editor={editor}\n entry={entry}\n key={entry.key}\n />\n )\n })}\n {index < editorConfig.features.floatingSelectToolbar?.sections.length - 1 && (\n <div className=\"divider\" />\n )}\n </div>\n )\n}\n\nfunction FloatingSelectToolbar({\n anchorElem,\n editor,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n}): React.ReactNode {\n const floatingToolbarRef = useRef<HTMLDivElement | null>(null)\n const caretRef = useRef<HTMLDivElement | null>(null)\n\n const { editorConfig } = useEditorConfigContext()\n\n const closeFloatingToolbar = useCallback(() => {\n if (floatingToolbarRef?.current) {\n const isOpacityZero = floatingToolbarRef.current.style.opacity === '0'\n const isPointerEventsNone = floatingToolbarRef.current.style.pointerEvents === 'none'\n\n if (!isOpacityZero) {\n floatingToolbarRef.current.style.opacity = '0'\n }\n if (!isPointerEventsNone) {\n floatingToolbarRef.current.style.pointerEvents = 'none'\n }\n }\n }, [floatingToolbarRef])\n\n const mouseMoveListener = useCallback(\n (e: MouseEvent) => {\n if (floatingToolbarRef?.current && (e.buttons === 1 || e.buttons === 3)) {\n const isOpacityZero = floatingToolbarRef.current.style.opacity === '0'\n const isPointerEventsNone = floatingToolbarRef.current.style.pointerEvents === 'none'\n if (!isOpacityZero || !isPointerEventsNone) {\n // Check if the mouse is not over the popup\n const x = e.clientX\n const y = e.clientY\n const elementUnderMouse = document.elementFromPoint(x, y)\n if (!floatingToolbarRef.current.contains(elementUnderMouse)) {\n // Mouse is not over the target element => not a normal click, but probably a drag\n closeFloatingToolbar()\n }\n }\n }\n },\n [closeFloatingToolbar],\n )\n\n const mouseUpListener = useCallback(() => {\n if (floatingToolbarRef?.current) {\n if (floatingToolbarRef.current.style.opacity !== '1') {\n floatingToolbarRef.current.style.opacity = '1'\n }\n if (floatingToolbarRef.current.style.pointerEvents !== 'auto') {\n floatingToolbarRef.current.style.pointerEvents = 'auto'\n }\n }\n }, [floatingToolbarRef])\n\n useEffect(() => {\n document.addEventListener('mousemove', mouseMoveListener)\n document.addEventListener('mouseup', mouseUpListener)\n\n return () => {\n document.removeEventListener('mousemove', mouseMoveListener)\n document.removeEventListener('mouseup', mouseUpListener)\n }\n }, [floatingToolbarRef, mouseMoveListener, mouseUpListener])\n\n const updateTextFormatFloatingToolbar = useCallback(() => {\n const selection = $getSelection()\n\n const nativeSelection = window.getSelection()\n\n if (floatingToolbarRef.current === null) {\n return\n }\n\n const rootElement = editor.getRootElement()\n if (\n selection !== null &&\n nativeSelection !== null &&\n !nativeSelection.isCollapsed &&\n rootElement !== null &&\n rootElement.contains(nativeSelection.anchorNode)\n ) {\n const rangeRect = getDOMRangeRect(nativeSelection, rootElement)\n\n // Position floating toolbar\n const offsetIfFlipped = setFloatingElemPosition(\n rangeRect, // selection to position around\n floatingToolbarRef.current, // what to position\n anchorElem, // anchor elem\n 'center',\n )\n\n // Position caret\n if (caretRef.current) {\n setFloatingElemPosition(\n rangeRect, // selection to position around\n caretRef.current, // what to position\n floatingToolbarRef.current, // anchor elem\n 'center',\n 10,\n 5,\n true,\n offsetIfFlipped,\n )\n }\n }\n }, [editor, anchorElem])\n\n useEffect(() => {\n const scrollerElem = anchorElem.parentElement\n\n const update = () => {\n editor.getEditorState().read(() => {\n updateTextFormatFloatingToolbar()\n })\n }\n\n window.addEventListener('resize', update)\n if (scrollerElem) {\n scrollerElem.addEventListener('scroll', update)\n }\n\n return () => {\n window.removeEventListener('resize', update)\n if (scrollerElem) {\n scrollerElem.removeEventListener('scroll', update)\n }\n }\n }, [editor, updateTextFormatFloatingToolbar, anchorElem])\n\n useEffect(() => {\n editor.getEditorState().read(() => {\n updateTextFormatFloatingToolbar()\n })\n return mergeRegister(\n editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n updateTextFormatFloatingToolbar()\n })\n }),\n\n editor.registerCommand(\n SELECTION_CHANGE_COMMAND,\n () => {\n updateTextFormatFloatingToolbar()\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n )\n }, [editor, updateTextFormatFloatingToolbar])\n\n return (\n <div className=\"floating-select-toolbar-popup\" ref={floatingToolbarRef}>\n <div className=\"caret\" ref={caretRef} />\n {editor.isEditable() && (\n <React.Fragment>\n {editorConfig?.features &&\n editorConfig.features?.floatingSelectToolbar?.sections.map((section, i) => {\n return (\n <ToolbarSection\n anchorElem={anchorElem}\n editor={editor}\n index={i}\n key={section.key}\n section={section}\n />\n )\n })}\n </React.Fragment>\n )}\n </div>\n )\n}\n\nfunction useFloatingTextFormatToolbar(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n): JSX.Element | null {\n const [isText, setIsText] = useState(false)\n\n const updatePopup = useCallback(() => {\n editor.getEditorState().read(() => {\n // Should not to pop up the floating toolbar when using IME input\n if (editor.isComposing()) {\n return\n }\n const selection = $getSelection()\n const nativeSelection = window.getSelection()\n const rootElement = editor.getRootElement()\n\n if (\n nativeSelection !== null &&\n (!$isRangeSelection(selection) ||\n rootElement === null ||\n !rootElement.contains(nativeSelection.anchorNode))\n ) {\n setIsText(false)\n return\n }\n\n if (!$isRangeSelection(selection)) {\n return\n }\n\n if (selection.getTextContent() !== '') {\n const nodes = selection.getNodes()\n let foundNodeWithText = false\n for (const node of nodes) {\n if ($isTextNode(node)) {\n setIsText(true)\n foundNodeWithText = true\n break\n }\n }\n if (!foundNodeWithText) {\n setIsText(false)\n }\n } else {\n setIsText(false)\n }\n\n const rawTextContent = selection.getTextContent().replace(/\\n/g, '')\n if (!selection.isCollapsed() && rawTextContent === '') {\n setIsText(false)\n return\n }\n })\n }, [editor])\n\n useEffect(() => {\n document.addEventListener('selectionchange', updatePopup)\n document.addEventListener('mouseup', updatePopup)\n return () => {\n document.removeEventListener('selectionchange', updatePopup)\n document.removeEventListener('mouseup', updatePopup)\n }\n }, [updatePopup])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerUpdateListener(() => {\n updatePopup()\n }),\n editor.registerRootListener(() => {\n if (editor.getRootElement() === null) {\n setIsText(false)\n }\n }),\n )\n }, [editor, updatePopup])\n\n if (!isText) {\n return null\n }\n\n return createPortal(<FloatingSelectToolbar anchorElem={anchorElem} editor={editor} />, anchorElem)\n}\n\nexport function FloatingSelectToolbarPlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): JSX.Element | null {\n const [editor] = useLexicalComposerContext()\n return useFloatingTextFormatToolbar(editor, anchorElem)\n}\n"],"names":["useLexicalComposerContext","mergeRegister","$getSelection","$isRangeSelection","$isTextNode","COMMAND_PRIORITY_LOW","SELECTION_CHANGE_COMMAND","useCallback","useEffect","useRef","useState","React","createPortal","useEditorConfigContext","getDOMRangeRect","setFloatingElemPosition","ToolbarButton","ToolbarDropdown","ButtonSectionEntry","anchorElem","editor","entry","Component","key","ChildComponent","ToolbarSection","index","section","editorConfig","Icon","type","entries","length","div","className","sectionKey","map","features","floatingSelectToolbar","sections","FloatingSelectToolbar","floatingToolbarRef","caretRef","closeFloatingToolbar","current","isOpacityZero","style","opacity","isPointerEventsNone","pointerEvents","mouseMoveListener","e","buttons","x","clientX","y","clientY","elementUnderMouse","document","elementFromPoint","contains","mouseUpListener","addEventListener","removeEventListener","updateTextFormatFloatingToolbar","selection","nativeSelection","window","getSelection","rootElement","getRootElement","isCollapsed","anchorNode","rangeRect","offsetIfFlipped","scrollerElem","parentElement","update","getEditorState","read","registerUpdateListener","editorState","registerCommand","ref","isEditable","Fragment","i","useFloatingTextFormatToolbar","isText","setIsText","updatePopup","isComposing","getTextContent","nodes","getNodes","foundNodeWithText","node","rawTextContent","replace","registerRootListener","FloatingSelectToolbarPlugin","body"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,WAAW,MAAM0B,mBAAmB,IAAI;gBACrDR,UAAU;gBACV;YACF;QACF;IACF,GAAG;QAACrE;KAAO;IAEXZ,UAAU;QACRkD,SAASI,gBAAgB,CAAC,mBAAmB4B;QAC7ChC,SAASI,gBAAgB,CAAC,WAAW4B;QACrC,OAAO;YACLhC,SAASK,mBAAmB,CAAC,mBAAmB2B;YAChDhC,SAASK,mBAAmB,CAAC,WAAW2B;QAC1C;IACF,GAAG;QAACA;KAAY;IAEhBlF,UAAU;QACR,OAAOP,cACLmB,OAAO4D,sBAAsB,CAAC;YAC5BU;QACF,IACAtE,OAAO+E,oBAAoB,CAAC;YAC1B,IAAI/E,OAAOkD,cAAc,OAAO,MAAM;gBACpCmB,UAAU;YACZ;QACF;IAEJ,GAAG;QAACrE;QAAQsE;KAAY;IAExB,IAAI,CAACF,QAAQ;QACX,OAAO;IACT;IAEA,qBAAO5E,2BAAa,oBAAC4B;QAAsBrB,YAAYA;QAAYC,QAAQA;QAAYD;AACzF;AAEA,OAAO,SAASiF,4BAA4B,EAC1CjF,aAAauC,SAAS2C,IAAI,EAG3B;IACC,MAAM,CAACjF,OAAO,GAAGpB;IACjB,OAAOuF,6BAA6BnE,QAAQD;AAC9C"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { BaseSelection, LexicalEditor } from 'lexical';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
export type FloatingToolbarSection = {
|
|
4
|
-
ChildComponent?: React.FC;
|
|
5
|
-
entries: Array<FloatingToolbarSectionEntry>;
|
|
6
|
-
key: string;
|
|
7
|
-
order?: number;
|
|
8
|
-
type: 'dropdown';
|
|
9
|
-
} | {
|
|
10
|
-
entries: Array<FloatingToolbarSectionEntry>;
|
|
11
|
-
key: string;
|
|
12
|
-
order?: number;
|
|
13
|
-
type: 'buttons';
|
|
14
|
-
};
|
|
15
|
-
export type FloatingToolbarSectionEntry = {
|
|
16
|
-
ChildComponent?: React.FC;
|
|
17
|
-
/** Use component to ignore the children and onClick properties. It does not use the default, pre-defined format Button component */
|
|
18
|
-
Component?: React.FC<{
|
|
19
|
-
anchorElem: HTMLElement;
|
|
20
|
-
editor: LexicalEditor;
|
|
21
|
-
entry: FloatingToolbarSectionEntry;
|
|
22
|
-
}>;
|
|
23
|
-
isActive?: ({ editor, selection }: {
|
|
24
|
-
editor: LexicalEditor;
|
|
25
|
-
selection: BaseSelection;
|
|
26
|
-
}) => boolean;
|
|
27
|
-
isEnabled?: ({ editor, selection, }: {
|
|
28
|
-
editor: LexicalEditor;
|
|
29
|
-
selection: BaseSelection;
|
|
30
|
-
}) => boolean;
|
|
31
|
-
key: string;
|
|
32
|
-
/** The label is displayed as text if the entry is part of a dropdown section */
|
|
33
|
-
label?: string;
|
|
34
|
-
onClick?: ({ editor, isActive }: {
|
|
35
|
-
editor: LexicalEditor;
|
|
36
|
-
isActive: boolean;
|
|
37
|
-
}) => void;
|
|
38
|
-
order?: number;
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/plugins/FloatingSelectToolbar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,MAAM,sBAAsB,GAC9B;IACE,cAAc,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACzB,OAAO,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAA;IAC3C,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,UAAU,CAAA;CACjB,GACD;IACE,OAAO,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAA;IAC3C,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,SAAS,CAAA;CAChB,CAAA;AAEL,MAAM,MAAM,2BAA2B,GAAG;IACxC,cAAc,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACzB,oIAAoI;IACpI,SAAS,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QACnB,UAAU,EAAE,WAAW,CAAA;QACvB,MAAM,EAAE,aAAa,CAAA;QACrB,KAAK,EAAE,2BAA2B,CAAA;KACnC,CAAC,CAAA;IACF,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;QAAE,MAAM,EAAE,aAAa,CAAC;QAAC,SAAS,EAAE,aAAa,CAAA;KAAE,KAAK,OAAO,CAAA;IAClG,SAAS,CAAC,EAAE,CAAC,EACX,MAAM,EACN,SAAS,GACV,EAAE;QACD,MAAM,EAAE,aAAa,CAAA;QACrB,SAAS,EAAE,aAAa,CAAA;KACzB,KAAK,OAAO,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;QAAE,MAAM,EAAE,aAAa,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAA;IACtF,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/lexical/plugins/FloatingSelectToolbar/types.ts"],"sourcesContent":["import type { BaseSelection, LexicalEditor } from 'lexical'\nimport type React from 'react'\n\nexport type FloatingToolbarSection =\n | {\n ChildComponent?: React.FC\n entries: Array<FloatingToolbarSectionEntry>\n key: string\n order?: number\n type: 'dropdown'\n }\n | {\n entries: Array<FloatingToolbarSectionEntry>\n key: string\n order?: number\n type: 'buttons'\n }\n\nexport type FloatingToolbarSectionEntry = {\n ChildComponent?: React.FC\n /** Use component to ignore the children and onClick properties. It does not use the default, pre-defined format Button component */\n Component?: React.FC<{\n anchorElem: HTMLElement\n editor: LexicalEditor\n entry: FloatingToolbarSectionEntry\n }>\n isActive?: ({ editor, selection }: { editor: LexicalEditor; selection: BaseSelection }) => boolean\n isEnabled?: ({\n editor,\n selection,\n }: {\n editor: LexicalEditor\n selection: BaseSelection\n }) => boolean\n key: string\n /** The label is displayed as text if the entry is part of a dropdown section */\n label?: string\n onClick?: ({ editor, isActive }: { editor: LexicalEditor; isActive: boolean }) => void\n order?: number\n}\n"],"names":[],"rangeMappings":"","mappings":"AAkBA,WAqBC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|