@payloadcms/richtext-lexical 3.0.0-beta.24 → 3.0.0-beta.26
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 +8 -2
- package/dist/exports/components.d.ts.map +1 -1
- package/dist/exports/components.js +8 -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 +126 -46
- 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/{inlineToolbarAlignGroup.js → toolbarAlignGroup.js} +3 -3
- package/dist/field/features/align/toolbarAlignGroup.js.map +1 -0
- package/dist/field/features/blockquote/feature.client.d.ts +1 -1
- package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
- package/dist/field/features/blockquote/feature.client.js +39 -25
- package/dist/field/features/blockquote/feature.client.js.map +1 -1
- package/dist/field/features/blockquote/feature.server.d.ts +1 -1
- package/dist/field/features/blockquote/feature.server.js +3 -3
- package/dist/field/features/blockquote/feature.server.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 +39 -8
- package/dist/field/features/blocks/feature.client.js.map +1 -1
- package/dist/field/features/blocks/feature.server.d.ts +2 -5
- package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
- package/dist/field/features/blocks/feature.server.js +2 -2
- package/dist/field/features/blocks/feature.server.js.map +1 -1
- package/dist/field/features/blocks/plugin/index.d.ts +3 -2
- package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
- package/dist/field/features/blocks/plugin/index.js +2 -2
- package/dist/field/features/blocks/plugin/index.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/plugin/index.d.ts +2 -2
- package/dist/field/features/debug/testRecorder/plugin/index.d.ts.map +1 -1
- package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -1
- package/dist/field/features/debug/treeView/plugin/index.d.ts +2 -2
- package/dist/field/features/debug/treeView/plugin/index.d.ts.map +1 -1
- package/dist/field/features/debug/treeView/plugin/index.js +2 -2
- package/dist/field/features/debug/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 +23 -19
- package/dist/field/features/format/bold/feature.client.js.map +1 -1
- package/dist/field/features/format/inlineCode/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/inlineCode/feature.client.js +23 -19
- package/dist/field/features/format/inlineCode/feature.client.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 +23 -19
- 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 +23 -19
- 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 +23 -19
- 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 +23 -19
- 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 +23 -19
- 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 +49 -29
- package/dist/field/features/heading/feature.client.js.map +1 -1
- package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -1
- package/dist/field/features/horizontalRule/feature.client.js +27 -4
- package/dist/field/features/horizontalRule/feature.client.js.map +1 -1
- package/dist/field/features/horizontalRule/plugin/index.d.ts +2 -1
- package/dist/field/features/horizontalRule/plugin/index.d.ts.map +1 -1
- package/dist/field/features/horizontalRule/plugin/index.js +2 -2
- package/dist/field/features/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 +41 -37
- 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/drawer/baseFields.d.ts +2 -2
- package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
- package/dist/field/features/link/drawer/baseFields.js +2 -1
- package/dist/field/features/link/drawer/baseFields.js.map +1 -1
- package/dist/field/features/link/drawer/types.d.ts +2 -2
- package/dist/field/features/link/drawer/types.d.ts.map +1 -1
- package/dist/field/features/link/drawer/types.js.map +1 -1
- package/dist/field/features/link/feature.client.d.ts.map +1 -1
- package/dist/field/features/link/feature.client.js +54 -40
- package/dist/field/features/link/feature.client.js.map +1 -1
- package/dist/field/features/link/feature.server.d.ts +10 -3
- package/dist/field/features/link/feature.server.d.ts.map +1 -1
- package/dist/field/features/link/feature.server.js +3 -3
- package/dist/field/features/link/feature.server.js.map +1 -1
- package/dist/field/features/link/plugins/autoLink/index.d.ts +3 -2
- package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
- package/dist/field/features/link/plugins/autoLink/index.js +2 -2
- package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
- package/dist/field/features/link/plugins/clickableLink/index.d.ts +3 -2
- package/dist/field/features/link/plugins/clickableLink/index.d.ts.map +1 -1
- package/dist/field/features/link/plugins/clickableLink/index.js +2 -2
- package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +75 -68
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts +3 -4
- package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +2 -2
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +3 -3
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +2 -2
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
- package/dist/field/features/link/plugins/link/index.d.ts +3 -1
- package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
- package/dist/field/features/link/plugins/link/index.js +2 -2
- package/dist/field/features/link/plugins/link/index.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/link/validate.js.map +1 -1
- package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
- package/dist/field/features/lists/checklist/feature.client.js +44 -19
- package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
- package/dist/field/features/lists/checklist/plugin/index.d.ts +2 -2
- package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
- package/dist/field/features/lists/checklist/plugin/index.js +2 -2
- package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
- package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -1
- package/dist/field/features/lists/orderedList/feature.client.js +44 -19
- package/dist/field/features/lists/orderedList/feature.client.js.map +1 -1
- package/dist/field/features/lists/plugin/index.d.ts +2 -2
- package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
- package/dist/field/features/lists/plugin/index.js +2 -2
- package/dist/field/features/lists/plugin/index.js.map +1 -1
- package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -1
- package/dist/field/features/lists/unorderedList/feature.client.js +44 -19
- package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js +2 -2
- package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
- package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
- package/dist/field/features/paragraph/feature.client.js +36 -22
- 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 +31 -9
- package/dist/field/features/relationship/feature.client.js.map +1 -1
- package/dist/field/features/relationship/feature.server.d.ts +10 -1
- package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
- package/dist/field/features/relationship/feature.server.js +2 -2
- package/dist/field/features/relationship/feature.server.js.map +1 -1
- package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
- package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +4 -2
- package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
- package/dist/field/features/relationship/plugins/index.d.ts +2 -2
- package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
- package/dist/field/features/relationship/plugins/index.js +6 -6
- package/dist/field/features/relationship/plugins/index.js.map +1 -1
- package/dist/field/features/relationship/populationPromise.d.ts +2 -1
- package/dist/field/features/relationship/populationPromise.d.ts.map +1 -1
- package/dist/field/features/relationship/populationPromise.js +25 -20
- 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/{inlineToolbar → toolbar}/textDropdownGroup.js +2 -2
- package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +4 -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 +4 -0
- package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
- package/dist/field/{lexical/plugins → features}/toolbars/inline/Toolbar/index.js +67 -23
- package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
- package/dist/field/{lexical/plugins → features}/toolbars/inline/Toolbar/index.scss +3 -8
- 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/toolbars/inline → features/toolbars/shared}/ToolbarButton/index.js +21 -8
- package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
- package/dist/field/{lexical/plugins/toolbars/inline → 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/toolbars/inline → features/toolbars/shared}/ToolbarDropdown/DropDown.js +25 -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/toolbars/inline → features/toolbars/shared}/ToolbarDropdown/index.scss +25 -13
- package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars}/types.d.ts +16 -8
- 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 +27 -19
- package/dist/field/features/types.d.ts.map +1 -1
- package/dist/field/features/types.js.map +1 -1
- package/dist/field/features/upload/component/index.d.ts.map +1 -1
- package/dist/field/features/upload/component/index.js +6 -2
- package/dist/field/features/upload/component/index.js.map +1 -1
- package/dist/field/features/upload/feature.client.d.ts.map +1 -1
- package/dist/field/features/upload/feature.client.js +29 -4
- package/dist/field/features/upload/feature.client.js.map +1 -1
- package/dist/field/features/upload/feature.server.d.ts +10 -3
- package/dist/field/features/upload/feature.server.d.ts.map +1 -1
- package/dist/field/features/upload/feature.server.js +2 -2
- package/dist/field/features/upload/feature.server.js.map +1 -1
- package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
- package/dist/field/features/upload/nodes/UploadNode.js +18 -2
- package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
- package/dist/field/features/upload/plugin/index.d.ts +3 -2
- package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
- package/dist/field/features/upload/plugin/index.js +2 -2
- package/dist/field/features/upload/plugin/index.js.map +1 -1
- package/dist/field/features/upload/populationPromise.d.ts.map +1 -1
- package/dist/field/features/upload/populationPromise.js +5 -2
- package/dist/field/features/upload/populationPromise.js.map +1 -1
- package/dist/field/features/upload/validate.d.ts.map +1 -1
- package/dist/field/features/upload/validate.js +3 -0
- package/dist/field/features/upload/validate.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/EditorPlugin.d.ts +1 -0
- package/dist/field/lexical/EditorPlugin.d.ts.map +1 -1
- package/dist/field/lexical/EditorPlugin.js +6 -3
- package/dist/field/lexical/EditorPlugin.js.map +1 -1
- package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/field/lexical/LexicalEditor.js +25 -4
- package/dist/field/lexical/LexicalEditor.js.map +1 -1
- 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 +1 -0
- 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 +5 -3
- package/dist/field/lexical/config/server/default.js.map +1 -1
- package/dist/field/lexical/config/server/loader.d.ts +2 -1
- package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
- package/dist/field/lexical/config/server/loader.js +2 -1
- package/dist/field/lexical/config/server/loader.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +6 -6
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/index.js +10 -10
- package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +2 -2
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +6 -3
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +8 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +25 -6
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
- 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/field/lexical/utils/setFloatingElemPosition.d.ts +11 -1
- package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
- package/dist/field/lexical/utils/setFloatingElemPosition.js +3 -2
- package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -7
- 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/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +11 -11
- package/dist/field/features/align/inlineToolbarAlignGroup.d.ts +0 -3
- package/dist/field/features/align/inlineToolbarAlignGroup.d.ts.map +0 -1
- package/dist/field/features/align/inlineToolbarAlignGroup.js.map +0 -1
- package/dist/field/features/format/shared/inlineToolbarFormatGroup.d.ts +0 -3
- package/dist/field/features/format/shared/inlineToolbarFormatGroup.d.ts.map +0 -1
- package/dist/field/features/format/shared/inlineToolbarFormatGroup.js +0 -10
- package/dist/field/features/format/shared/inlineToolbarFormatGroup.js.map +0 -1
- package/dist/field/features/indent/inlineToolbarIndentGroup.d.ts +0 -3
- package/dist/field/features/indent/inlineToolbarIndentGroup.d.ts.map +0 -1
- package/dist/field/features/indent/inlineToolbarIndentGroup.js +0 -10
- package/dist/field/features/indent/inlineToolbarIndentGroup.js.map +0 -1
- package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.d.ts +0 -3
- package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.d.ts.map +0 -1
- package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.js +0 -10
- package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.js.map +0 -1
- package/dist/field/features/shared/inlineToolbar/textDropdownGroup.d.ts +0 -3
- package/dist/field/features/shared/inlineToolbar/textDropdownGroup.d.ts.map +0 -1
- package/dist/field/features/shared/inlineToolbar/textDropdownGroup.js.map +0 -1
- package/dist/field/lexical/plugins/toolbars/fixed/types.d.ts +0 -40
- package/dist/field/lexical/plugins/toolbars/fixed/types.d.ts.map +0 -1
- package/dist/field/lexical/plugins/toolbars/fixed/types.js.map +0 -1
- package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.d.ts +0 -6
- package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.d.ts.map +0 -1
- package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.js.map +0 -1
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.d.ts +0 -8
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.d.ts.map +0 -1
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.js.map +0 -1
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.d.ts +0 -17
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.d.ts.map +0 -1
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.js.map +0 -1
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.d.ts +0 -18
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.d.ts.map +0 -1
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js +0 -42
- package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js.map +0 -1
- package/dist/field/lexical/plugins/toolbars/inline/types.d.ts.map +0 -1
- package/dist/field/lexical/plugins/toolbars/inline/types.js +0 -3
- package/dist/field/lexical/plugins/toolbars/inline/types.js.map +0 -1
- /package/dist/field/{lexical/plugins/toolbars/fixed → features/toolbars}/types.js +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { $isHeadingNode } from '@lexical/rich-text';
|
|
2
3
|
import { $createHeadingNode, HeadingNode } from '@lexical/rich-text';
|
|
3
4
|
import { $setBlocksType } from '@lexical/selection';
|
|
4
|
-
import { $getSelection } from 'lexical';
|
|
5
|
+
import { $getSelection, $isRangeSelection } from 'lexical';
|
|
5
6
|
import { H1Icon } from '../../lexical/ui/icons/H1/index.js';
|
|
6
7
|
import { H2Icon } from '../../lexical/ui/icons/H2/index.js';
|
|
7
8
|
import { H3Icon } from '../../lexical/ui/icons/H3/index.js';
|
|
@@ -9,7 +10,7 @@ import { H4Icon } from '../../lexical/ui/icons/H4/index.js';
|
|
|
9
10
|
import { H5Icon } from '../../lexical/ui/icons/H5/index.js';
|
|
10
11
|
import { H6Icon } from '../../lexical/ui/icons/H6/index.js';
|
|
11
12
|
import { createClientComponent } from '../createClientComponent.js';
|
|
12
|
-
import {
|
|
13
|
+
import { toolbarTextDropdownGroupWithItems } from '../shared/toolbar/textDropdownGroup.js';
|
|
13
14
|
import { MarkdownTransformer } from './markdownTransformer.js';
|
|
14
15
|
const setHeading = (headingSize)=>{
|
|
15
16
|
const selection = $getSelection();
|
|
@@ -24,17 +25,48 @@ const iconImports = {
|
|
|
24
25
|
h6: H6Icon
|
|
25
26
|
};
|
|
26
27
|
const HeadingFeatureClient = (props)=>{
|
|
27
|
-
const { enabledHeadingSizes = [
|
|
28
|
-
'h1',
|
|
29
|
-
'h2',
|
|
30
|
-
'h3',
|
|
31
|
-
'h4',
|
|
32
|
-
'h5',
|
|
33
|
-
'h6'
|
|
34
|
-
] } = props;
|
|
35
28
|
return {
|
|
36
29
|
clientFeatureProps: props,
|
|
37
30
|
feature: ()=>{
|
|
31
|
+
const { enabledHeadingSizes = [
|
|
32
|
+
'h1',
|
|
33
|
+
'h2',
|
|
34
|
+
'h3',
|
|
35
|
+
'h4',
|
|
36
|
+
'h5',
|
|
37
|
+
'h6'
|
|
38
|
+
] } = props;
|
|
39
|
+
const toolbarGroups = [
|
|
40
|
+
toolbarTextDropdownGroupWithItems(enabledHeadingSizes.map((headingSize, i)=>{
|
|
41
|
+
return {
|
|
42
|
+
ChildComponent: iconImports[headingSize],
|
|
43
|
+
isActive: ({ selection })=>{
|
|
44
|
+
if (!$isRangeSelection(selection)) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
for (const node of selection.getNodes()){
|
|
48
|
+
if ($isHeadingNode(node) && node.getTag() === headingSize) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const parent = node.getParent();
|
|
52
|
+
if ($isHeadingNode(parent) && parent.getTag() === headingSize) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
},
|
|
59
|
+
key: headingSize,
|
|
60
|
+
label: `Heading ${headingSize.charAt(1)}`,
|
|
61
|
+
onSelect: ({ editor })=>{
|
|
62
|
+
editor.update(()=>{
|
|
63
|
+
setHeading(headingSize);
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
order: i + 2
|
|
67
|
+
};
|
|
68
|
+
}))
|
|
69
|
+
];
|
|
38
70
|
return {
|
|
39
71
|
clientFeatureProps: props,
|
|
40
72
|
markdownTransformers: [
|
|
@@ -46,16 +78,15 @@ const HeadingFeatureClient = (props)=>{
|
|
|
46
78
|
slashMenu: {
|
|
47
79
|
groups: enabledHeadingSizes?.length ? [
|
|
48
80
|
{
|
|
49
|
-
displayName: 'Basic',
|
|
50
81
|
items: enabledHeadingSizes.map((headingSize)=>{
|
|
51
82
|
return {
|
|
52
83
|
Icon: iconImports[headingSize],
|
|
53
|
-
displayName: `Heading ${headingSize.charAt(1)}`,
|
|
54
84
|
key: `heading-${headingSize.charAt(1)}`,
|
|
55
85
|
keywords: [
|
|
56
86
|
'heading',
|
|
57
87
|
headingSize
|
|
58
88
|
],
|
|
89
|
+
label: `Heading ${headingSize.charAt(1)}`,
|
|
59
90
|
onSelect: ({ editor })=>{
|
|
60
91
|
editor.update(()=>{
|
|
61
92
|
setHeading(headingSize);
|
|
@@ -63,27 +94,16 @@ const HeadingFeatureClient = (props)=>{
|
|
|
63
94
|
}
|
|
64
95
|
};
|
|
65
96
|
}),
|
|
66
|
-
key: 'basic'
|
|
97
|
+
key: 'basic',
|
|
98
|
+
label: 'Basic'
|
|
67
99
|
}
|
|
68
100
|
] : []
|
|
69
101
|
},
|
|
102
|
+
toolbarFixed: {
|
|
103
|
+
groups: enabledHeadingSizes?.length ? toolbarGroups : []
|
|
104
|
+
},
|
|
70
105
|
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
|
-
};
|
|
85
|
-
}))
|
|
86
|
-
] : []
|
|
106
|
+
groups: enabledHeadingSizes?.length ? toolbarGroups : []
|
|
87
107
|
}
|
|
88
108
|
};
|
|
89
109
|
}
|
|
@@ -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 { 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 {
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/heading/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { HeadingTagType } from '@lexical/rich-text'\n\nimport { $isHeadingNode } from '@lexical/rich-text'\nimport { $createHeadingNode, HeadingNode } from '@lexical/rich-text'\nimport { $setBlocksType } from '@lexical/selection'\nimport { $getSelection, $isRangeSelection } from 'lexical'\n\nimport type { ToolbarGroup } from '../toolbars/types.js'\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 { toolbarTextDropdownGroupWithItems } from '../shared/toolbar/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 return {\n clientFeatureProps: props,\n feature: () => {\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n const toolbarGroups: ToolbarGroup[] = [\n toolbarTextDropdownGroupWithItems(\n enabledHeadingSizes.map((headingSize, i) => {\n return {\n ChildComponent: iconImports[headingSize],\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isHeadingNode(node) && node.getTag() === headingSize) {\n continue\n }\n\n const parent = node.getParent()\n if ($isHeadingNode(parent) && parent.getTag() === headingSize) {\n continue\n }\n\n return false\n }\n return true\n },\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 return {\n clientFeatureProps: props,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [HeadingNode],\n slashMenu: {\n groups: enabledHeadingSizes?.length\n ? [\n {\n items: enabledHeadingSizes.map((headingSize) => {\n return {\n Icon: iconImports[headingSize],\n key: `heading-${headingSize.charAt(1)}`,\n keywords: ['heading', headingSize],\n label: `Heading ${headingSize.charAt(1)}`,\n onSelect: ({ editor }) => {\n editor.update(() => {\n setHeading(headingSize)\n })\n },\n }\n }),\n key: 'basic',\n label: 'Basic',\n },\n ]\n : [],\n },\n toolbarFixed: {\n groups: enabledHeadingSizes?.length ? toolbarGroups : [],\n },\n toolbarInline: {\n groups: enabledHeadingSizes?.length ? toolbarGroups : [],\n },\n }\n },\n }\n}\n\nexport const HeadingFeatureClientComponent = createClientComponent(HeadingFeatureClient)\n"],"names":["$isHeadingNode","$createHeadingNode","HeadingNode","$setBlocksType","$getSelection","$isRangeSelection","H1Icon","H2Icon","H3Icon","H4Icon","H5Icon","H6Icon","createClientComponent","toolbarTextDropdownGroupWithItems","MarkdownTransformer","setHeading","headingSize","selection","iconImports","h1","h2","h3","h4","h5","h6","HeadingFeatureClient","props","clientFeatureProps","feature","enabledHeadingSizes","toolbarGroups","map","i","ChildComponent","isActive","node","getNodes","getTag","parent","getParent","key","label","charAt","onSelect","editor","update","order","markdownTransformers","nodes","slashMenu","groups","length","items","Icon","keywords","toolbarFixed","toolbarInline","HeadingFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,cAAc,QAAQ,qBAAoB;AACnD,SAASC,kBAAkB,EAAEC,WAAW,QAAQ,qBAAoB;AACpE,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,aAAa,EAAEC,iBAAiB,QAAQ,UAAS;AAM1D,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,iCAAiC,QAAQ,yCAAwC;AAC1F,SAASC,mBAAmB,QAAQ,2BAA0B;AAE9D,MAAMC,aAAa,CAACC;IAClB,MAAMC,YAAYb;IAClBD,eAAec,WAAW,IAAMhB,mBAAmBe;AACrD;AAEA,MAAME,cAAc;IAClBC,IAAIb;IACJc,IAAIb;IACJc,IAAIb;IACJc,IAAIb;IACJc,IAAIb;IACJc,IAAIb;AACN;AAEA,MAAMc,uBAA2E,CAACC;IAChF,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,MAAM,EAAEC,sBAAsB;gBAAC;gBAAM;gBAAM;gBAAM;gBAAM;gBAAM;aAAK,EAAE,GAAGH;YAEvE,MAAMI,gBAAgC;gBACpCjB,kCACEgB,oBAAoBE,GAAG,CAAC,CAACf,aAAagB;oBACpC,OAAO;wBACLC,gBAAgBf,WAAW,CAACF,YAAY;wBACxCkB,UAAU,CAAC,EAAEjB,SAAS,EAAE;4BACtB,IAAI,CAACZ,kBAAkBY,YAAY;gCACjC,OAAO;4BACT;4BACA,KAAK,MAAMkB,QAAQlB,UAAUmB,QAAQ,GAAI;gCACvC,IAAIpC,eAAemC,SAASA,KAAKE,MAAM,OAAOrB,aAAa;oCACzD;gCACF;gCAEA,MAAMsB,SAASH,KAAKI,SAAS;gCAC7B,IAAIvC,eAAesC,WAAWA,OAAOD,MAAM,OAAOrB,aAAa;oCAC7D;gCACF;gCAEA,OAAO;4BACT;4BACA,OAAO;wBACT;wBACAwB,KAAKxB;wBACLyB,OAAO,CAAC,QAAQ,EAAEzB,YAAY0B,MAAM,CAAC,GAAG,CAAC;wBACzCC,UAAU,CAAC,EAAEC,MAAM,EAAE;4BACnBA,OAAOC,MAAM,CAAC;gCACZ9B,WAAWC;4BACb;wBACF;wBACA8B,OAAOd,IAAI;oBACb;gBACF;aAEH;YAED,OAAO;gBACLL,oBAAoBD;gBACpBqB,sBAAsB;oBAACjC,oBAAoBe;iBAAqB;gBAChEmB,OAAO;oBAAC9C;iBAAY;gBACpB+C,WAAW;oBACTC,QAAQrB,qBAAqBsB,SACzB;wBACE;4BACEC,OAAOvB,oBAAoBE,GAAG,CAAC,CAACf;gCAC9B,OAAO;oCACLqC,MAAMnC,WAAW,CAACF,YAAY;oCAC9BwB,KAAK,CAAC,QAAQ,EAAExB,YAAY0B,MAAM,CAAC,GAAG,CAAC;oCACvCY,UAAU;wCAAC;wCAAWtC;qCAAY;oCAClCyB,OAAO,CAAC,QAAQ,EAAEzB,YAAY0B,MAAM,CAAC,GAAG,CAAC;oCACzCC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,MAAM,CAAC;4CACZ9B,WAAWC;wCACb;oCACF;gCACF;4BACF;4BACAwB,KAAK;4BACLC,OAAO;wBACT;qBACD,GACD,EAAE;gBACR;gBACAc,cAAc;oBACZL,QAAQrB,qBAAqBsB,SAASrB,gBAAgB,EAAE;gBAC1D;gBACA0B,eAAe;oBACbN,QAAQrB,qBAAqBsB,SAASrB,gBAAgB,EAAE;gBAC1D;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAM2B,gCAAgC7C,sBAAsBa,sBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalRule/feature.client.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalRule/feature.client.tsx"],"names":[],"mappings":";AA2EA,eAAO,MAAM,oCAAoC,+BAEhD,CAAA"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { $isNodeSelection } from 'lexical';
|
|
2
3
|
import { HorizontalRuleIcon } from '../../lexical/ui/icons/HorizontalRule/index.js';
|
|
3
4
|
import { createClientComponent } from '../createClientComponent.js';
|
|
5
|
+
import { toolbarAddDropdownGroupWithItems } from '../shared/toolbar/addDropdownGroup.js';
|
|
4
6
|
import { MarkdownTransformer } from './markdownTransformer.js';
|
|
5
|
-
import { HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from './nodes/HorizontalRuleNode.js';
|
|
7
|
+
import { $isHorizontalRuleNode, HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from './nodes/HorizontalRuleNode.js';
|
|
6
8
|
import { HorizontalRulePlugin } from './plugin/index.js';
|
|
7
9
|
const HorizontalRuleFeatureClient = (props)=>{
|
|
8
10
|
return {
|
|
@@ -24,11 +26,9 @@ const HorizontalRuleFeatureClient = (props)=>{
|
|
|
24
26
|
slashMenu: {
|
|
25
27
|
groups: [
|
|
26
28
|
{
|
|
27
|
-
displayName: 'Basic',
|
|
28
29
|
items: [
|
|
29
30
|
{
|
|
30
31
|
Icon: HorizontalRuleIcon,
|
|
31
|
-
displayName: `Horizontal Rule`,
|
|
32
32
|
key: 'horizontalRule',
|
|
33
33
|
keywords: [
|
|
34
34
|
'hr',
|
|
@@ -36,14 +36,37 @@ const HorizontalRuleFeatureClient = (props)=>{
|
|
|
36
36
|
'line',
|
|
37
37
|
'separator'
|
|
38
38
|
],
|
|
39
|
+
label: `Horizontal Rule`,
|
|
39
40
|
onSelect: ({ editor })=>{
|
|
40
41
|
editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
],
|
|
44
|
-
key: 'basic'
|
|
45
|
+
key: 'basic',
|
|
46
|
+
label: 'Basic'
|
|
45
47
|
}
|
|
46
48
|
]
|
|
49
|
+
},
|
|
50
|
+
toolbarFixed: {
|
|
51
|
+
groups: [
|
|
52
|
+
toolbarAddDropdownGroupWithItems([
|
|
53
|
+
{
|
|
54
|
+
ChildComponent: HorizontalRuleIcon,
|
|
55
|
+
isActive: ({ selection })=>{
|
|
56
|
+
if (!$isNodeSelection(selection) || !selection.getNodes().length) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
const firstNode = selection.getNodes()[0];
|
|
60
|
+
return $isHorizontalRuleNode(firstNode);
|
|
61
|
+
},
|
|
62
|
+
key: 'horizontalRule',
|
|
63
|
+
label: `Horizontal Rule`,
|
|
64
|
+
onSelect: ({ editor })=>{
|
|
65
|
+
editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
])
|
|
69
|
+
]
|
|
47
70
|
}
|
|
48
71
|
})
|
|
49
72
|
};
|
|
@@ -1 +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 {
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/horizontalRule/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isNodeSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { HorizontalRuleIcon } from '../../lexical/ui/icons/HorizontalRule/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { toolbarAddDropdownGroupWithItems } from '../shared/toolbar/addDropdownGroup.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\nimport {\n $isHorizontalRuleNode,\n HorizontalRuleNode,\n INSERT_HORIZONTAL_RULE_COMMAND,\n} 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 items: [\n {\n Icon: HorizontalRuleIcon,\n key: 'horizontalRule',\n keywords: ['hr', 'horizontal rule', 'line', 'separator'],\n label: `Horizontal Rule`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined)\n },\n },\n ],\n key: 'basic',\n label: 'Basic',\n },\n ],\n },\n toolbarFixed: {\n groups: [\n toolbarAddDropdownGroupWithItems([\n {\n ChildComponent: HorizontalRuleIcon,\n isActive: ({ selection }) => {\n if (!$isNodeSelection(selection) || !selection.getNodes().length) {\n return false\n }\n\n const firstNode = selection.getNodes()[0]\n return $isHorizontalRuleNode(firstNode)\n },\n key: 'horizontalRule',\n label: `Horizontal Rule`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined)\n },\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const HorizontalRuleFeatureClientComponent = createClientComponent(\n HorizontalRuleFeatureClient,\n)\n"],"names":["$isNodeSelection","HorizontalRuleIcon","createClientComponent","toolbarAddDropdownGroupWithItems","MarkdownTransformer","$isHorizontalRuleNode","HorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","HorizontalRuleFeatureClient","props","clientFeatureProps","feature","markdownTransformers","nodes","plugins","Component","position","slashMenu","groups","items","Icon","key","keywords","label","onSelect","editor","dispatchCommand","undefined","toolbarFixed","ChildComponent","isActive","selection","getNodes","length","firstNode","HorizontalRuleFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,gBAAgB,QAAQ,UAAS;AAI1C,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,gCAAgC,QAAQ,wCAAuC;AACxF,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SACEC,qBAAqB,EACrBC,kBAAkB,EAClBC,8BAA8B,QACzB,gCAA+B;AACtC,SAASC,oBAAoB,QAAQ,oBAAmB;AAExD,MAAMC,8BAAwE,CAACC;IAC7E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,sBAAsB;oBAACT;iBAAoB;gBAC3CU,OAAO;oBAACR;iBAAmB;gBAC3BS,SAAS;oBACP;wBACEC,WAAWR;wBACXS,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,QAAQ;wBACN;4BACEC,OAAO;gCACL;oCACEC,MAAMpB;oCACNqB,KAAK;oCACLC,UAAU;wCAAC;wCAAM;wCAAmB;wCAAQ;qCAAY;oCACxDC,OAAO,CAAC,eAAe,CAAC;oCACxBC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,eAAe,CAACpB,gCAAgCqB;oCACzD;gCACF;6BACD;4BACDN,KAAK;4BACLE,OAAO;wBACT;qBACD;gBACH;gBACAK,cAAc;oBACZV,QAAQ;wBACNhB,iCAAiC;4BAC/B;gCACE2B,gBAAgB7B;gCAChB8B,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAI,CAAChC,iBAAiBgC,cAAc,CAACA,UAAUC,QAAQ,GAAGC,MAAM,EAAE;wCAChE,OAAO;oCACT;oCAEA,MAAMC,YAAYH,UAAUC,QAAQ,EAAE,CAAC,EAAE;oCACzC,OAAO5B,sBAAsB8B;gCAC/B;gCACAb,KAAK;gCACLE,OAAO,CAAC,eAAe,CAAC;gCACxBC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACpB,gCAAgCqB;gCACzD;4BACF;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMQ,uCAAuClC,sBAClDO,6BACD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { PluginComponent } from '../../types.js';
|
|
1
2
|
import './index.scss';
|
|
2
3
|
/**
|
|
3
4
|
* Registers the INSERT_HORIZONTAL_RULE_COMMAND lexical command and defines the behavior for when it is called.
|
|
4
5
|
*/
|
|
5
|
-
export declare
|
|
6
|
+
export declare const HorizontalRulePlugin: PluginComponent<undefined>;
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalRule/plugin/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalRule/plugin/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAMrD,OAAO,cAAc,CAAA;AAErB;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,SAAS,CA2B3D,CAAA"}
|
|
@@ -7,7 +7,7 @@ import { $createHorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from '../no
|
|
|
7
7
|
import './index.scss';
|
|
8
8
|
/**
|
|
9
9
|
* Registers the INSERT_HORIZONTAL_RULE_COMMAND lexical command and defines the behavior for when it is called.
|
|
10
|
-
*/ export
|
|
10
|
+
*/ export const HorizontalRulePlugin = ()=>{
|
|
11
11
|
const [editor] = useLexicalComposerContext();
|
|
12
12
|
useEffect(()=>{
|
|
13
13
|
return editor.registerCommand(INSERT_HORIZONTAL_RULE_COMMAND, (type)=>{
|
|
@@ -26,6 +26,6 @@ import './index.scss';
|
|
|
26
26
|
editor
|
|
27
27
|
]);
|
|
28
28
|
return null;
|
|
29
|
-
}
|
|
29
|
+
};
|
|
30
30
|
|
|
31
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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 type { PluginComponent } from '../../types.js'\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 const HorizontalRulePlugin: PluginComponent<undefined> = () => {\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;AAIjC,SACEC,yBAAyB,EACzBC,8BAA8B,QACzB,iCAAgC;AACvC,OAAO,eAAc;AAErB;;CAEC,GACD,OAAO,MAAMC,uBAAmD;IAC9D,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,EAAC"}
|
|
@@ -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":";AAmEA,eAAO,MAAM,4BAA4B,+BAA6C,CAAA"}
|
|
@@ -3,49 +3,53 @@ 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 { toolbarIndentGroupWithItems } from './toolbarIndentGroup.js';
|
|
7
|
+
const toolbarGroups = [
|
|
8
|
+
toolbarIndentGroupWithItems([
|
|
9
|
+
{
|
|
10
|
+
ChildComponent: IndentDecreaseIcon,
|
|
11
|
+
isActive: ()=>false,
|
|
12
|
+
isEnabled: ({ selection })=>{
|
|
13
|
+
if (!selection || !selection?.getNodes()?.length) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
for (const node of selection.getNodes()){
|
|
17
|
+
// If at least one node is indented, this should be active
|
|
18
|
+
if ('__indent' in node && node.__indent > 0 || node.getParent() && '__indent' in node.getParent() && node.getParent().__indent > 0) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
},
|
|
24
|
+
key: 'indentDecrease',
|
|
25
|
+
label: `Decrease Indent`,
|
|
26
|
+
onSelect: ({ editor })=>{
|
|
27
|
+
editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);
|
|
28
|
+
},
|
|
29
|
+
order: 1
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
ChildComponent: IndentIncreaseIcon,
|
|
33
|
+
isActive: ()=>false,
|
|
34
|
+
key: 'indentIncrease',
|
|
35
|
+
label: `Increase Indent`,
|
|
36
|
+
onSelect: ({ editor })=>{
|
|
37
|
+
editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined);
|
|
38
|
+
},
|
|
39
|
+
order: 2
|
|
40
|
+
}
|
|
41
|
+
])
|
|
42
|
+
];
|
|
7
43
|
const IndentFeatureClient = (props)=>{
|
|
8
44
|
return {
|
|
9
45
|
clientFeatureProps: props,
|
|
10
46
|
feature: ()=>({
|
|
11
47
|
clientFeatureProps: props,
|
|
48
|
+
toolbarFixed: {
|
|
49
|
+
groups: toolbarGroups
|
|
50
|
+
},
|
|
12
51
|
toolbarInline: {
|
|
13
|
-
groups:
|
|
14
|
-
indentGroupWithItems([
|
|
15
|
-
{
|
|
16
|
-
ChildComponent: IndentDecreaseIcon,
|
|
17
|
-
isActive: ()=>false,
|
|
18
|
-
isEnabled: ({ selection })=>{
|
|
19
|
-
if (!selection || !selection?.getNodes()?.length) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
for (const node of selection.getNodes()){
|
|
23
|
-
// If at least one node is indented, this should be active
|
|
24
|
-
if ('__indent' in node && node.__indent > 0 || node.getParent() && '__indent' in node.getParent() && node.getParent().__indent > 0) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return false;
|
|
29
|
-
},
|
|
30
|
-
key: 'indentDecrease',
|
|
31
|
-
label: `Decrease Indent`,
|
|
32
|
-
onSelect: ({ editor })=>{
|
|
33
|
-
editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);
|
|
34
|
-
},
|
|
35
|
-
order: 1
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
ChildComponent: IndentIncreaseIcon,
|
|
39
|
-
isActive: ()=>false,
|
|
40
|
-
key: 'indentIncrease',
|
|
41
|
-
label: `Increase Indent`,
|
|
42
|
-
onSelect: ({ editor })=>{
|
|
43
|
-
editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined);
|
|
44
|
-
},
|
|
45
|
-
order: 2
|
|
46
|
-
}
|
|
47
|
-
])
|
|
48
|
-
]
|
|
52
|
+
groups: toolbarGroups
|
|
49
53
|
}
|
|
50
54
|
})
|
|
51
55
|
};
|
|
@@ -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 { ToolbarGroup } from '../toolbars/types.js'\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 { toolbarIndentGroupWithItems } from './toolbarIndentGroup.js'\n\nconst toolbarGroups: ToolbarGroup[] = [\n toolbarIndentGroupWithItems([\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() && '__indent' in node.getParent() && 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\nconst IndentFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }),\n }\n}\n\nexport const IndentFeatureClientComponent = createClientComponent(IndentFeatureClient)\n"],"names":["INDENT_CONTENT_COMMAND","OUTDENT_CONTENT_COMMAND","IndentDecreaseIcon","IndentIncreaseIcon","createClientComponent","toolbarIndentGroupWithItems","toolbarGroups","ChildComponent","isActive","isEnabled","selection","getNodes","length","node","__indent","getParent","key","label","onSelect","editor","dispatchCommand","undefined","order","IndentFeatureClient","props","clientFeatureProps","feature","toolbarFixed","groups","toolbarInline","IndentFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,sBAAsB,EAAEC,uBAAuB,QAAQ,UAAS;AAKzE,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,2BAA2B,QAAQ,0BAAyB;AAErE,MAAMC,gBAAgC;IACpCD,4BAA4B;QAC1B;YACEE,gBAAgBL;YAChBM,UAAU,IAAM;YAChBC,WAAW,CAAC,EAAEC,SAAS,EAAE;gBACvB,IAAI,CAACA,aAAa,CAACA,WAAWC,YAAYC,QAAQ;oBAChD,OAAO;gBACT;gBACA,KAAK,MAAMC,QAAQH,UAAUC,QAAQ,GAAI;oBACvC,0DAA0D;oBAC1D,IACE,AAAC,cAAcE,QAAQ,AAACA,KAAKC,QAAQ,GAAc,KAClDD,KAAKE,SAAS,MAAM,cAAcF,KAAKE,SAAS,MAAMF,KAAKE,SAAS,GAAGD,QAAQ,GAAG,GACnF;wBACA,OAAO;oBACT;gBACF;gBACA,OAAO;YACT;YACAE,KAAK;YACLC,OAAO,CAAC,eAAe,CAAC;YACxBC,UAAU,CAAC,EAAEC,MAAM,EAAE;gBACnBA,OAAOC,eAAe,CAACnB,yBAAyBoB;YAClD;YACAC,OAAO;QACT;QACA;YACEf,gBAAgBJ;YAChBK,UAAU,IAAM;YAChBQ,KAAK;YACLC,OAAO,CAAC,eAAe,CAAC;YACxBC,UAAU,CAAC,EAAEC,MAAM,EAAE;gBACnBA,OAAOC,eAAe,CAACpB,wBAAwBqB;YACjD;YACAC,OAAO;QACT;KACD;CACF;AAED,MAAMC,sBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,cAAc;oBACZC,QAAQtB;gBACV;gBACAuB,eAAe;oBACbD,QAAQtB;gBACV;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMwB,+BAA+B1B,sBAAsBmB,qBAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbarIndentGroup.d.ts","sourceRoot":"","sources":["../../../../src/field/features/indent/toolbarIndentGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE1E,eAAO,MAAM,2BAA2B,UAAW,gBAAgB,EAAE,KAAG,YAOvE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/indent/toolbarIndentGroup.ts"],"sourcesContent":["import type { ToolbarGroup, ToolbarGroupItem } from '../toolbars/types.js'\n\nexport const toolbarIndentGroupWithItems = (items: ToolbarGroupItem[]): ToolbarGroup => {\n return {\n type: 'buttons',\n items,\n key: 'indent',\n order: 35,\n }\n}\n"],"names":["toolbarIndentGroupWithItems","items","type","key","order"],"rangeMappings":";;;;;;;","mappings":"AAEA,OAAO,MAAMA,8BAA8B,CAACC;IAC1C,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SanitizedConfig } from 'payload/config';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const getBaseFields: (config: SanitizedConfig, enabledCollections: false | string[], disabledCollections: false | string[]) =>
|
|
2
|
+
import type { Field } from 'payload/types';
|
|
3
|
+
export declare const getBaseFields: (config: SanitizedConfig, enabledCollections: false | string[], disabledCollections: false | string[], maxDepth?: number) => Field[];
|
|
4
4
|
//# sourceMappingURL=baseFields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseFields.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/link/drawer/baseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"baseFields.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/link/drawer/baseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAyB,MAAM,eAAe,CAAA;AAIjE,eAAO,MAAM,aAAa,WAChB,eAAe,sBACH,KAAK,GAAG,MAAM,EAAE,uBACf,KAAK,GAAG,MAAM,EAAE,aAC1B,MAAM,KAChB,KAAK,EAsGP,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { validateUrl } from '../../../lexical/utils/url.js';
|
|
2
|
-
export const getBaseFields = (config, enabledCollections, disabledCollections)=>{
|
|
2
|
+
export const getBaseFields = (config, enabledCollections, disabledCollections, maxDepth)=>{
|
|
3
3
|
let enabledRelations;
|
|
4
4
|
/**
|
|
5
5
|
* Figure out which relations should be enabled (enabledRelations) based on a collection's admin.enableRichTextLink property,
|
|
@@ -78,6 +78,7 @@ export const getBaseFields = (config, enabledCollections, disabledCollections)=>
|
|
|
78
78
|
}
|
|
79
79
|
} : null,
|
|
80
80
|
label: ({ t })=>t('fields:chooseDocumentToLink'),
|
|
81
|
+
maxDepth,
|
|
81
82
|
relationTo: enabledRelations,
|
|
82
83
|
required: true
|
|
83
84
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/link/drawer/baseFields.ts"],"sourcesContent":["import type { User } from 'payload/auth'\nimport type { SanitizedConfig } from 'payload/config'\nimport type { Field,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/link/drawer/baseFields.ts"],"sourcesContent":["import type { User } from 'payload/auth'\nimport type { SanitizedConfig } from 'payload/config'\nimport type { Field, RadioField, TextField } from 'payload/types'\n\nimport { validateUrl } from '../../../lexical/utils/url.js'\n\nexport const getBaseFields = (\n config: SanitizedConfig,\n enabledCollections: false | string[],\n disabledCollections: false | string[],\n maxDepth?: number,\n): Field[] => {\n let enabledRelations: string[]\n\n /**\n * Figure out which relations should be enabled (enabledRelations) based on a collection's admin.enableRichTextLink property,\n * or the Link Feature's enabledCollections and disabledCollections properties which override it.\n */\n if (enabledCollections) {\n enabledRelations = enabledCollections\n } else if (disabledCollections) {\n enabledRelations = config.collections\n .filter(({ slug }) => !disabledCollections.includes(slug))\n .map(({ slug }) => slug)\n } else {\n enabledRelations = config.collections\n .filter(({ admin: { enableRichTextLink, hidden } }) => {\n if (typeof hidden !== 'function' && hidden) {\n return false\n }\n return enableRichTextLink\n })\n .map(({ slug }) => slug)\n }\n\n const baseFields: Field[] = [\n {\n name: 'text',\n type: 'text',\n label: ({ t }) => t('fields:textToDisplay'),\n required: true,\n },\n {\n name: 'linkType',\n type: 'radio',\n admin: {\n description: ({ t }) => t('fields:chooseBetweenCustomTextOrDocument'),\n },\n defaultValue: 'custom',\n label: ({ t }) => t('fields:linkType'),\n options: [\n {\n label: ({ t }) => t('fields:customURL'),\n value: 'custom',\n },\n ],\n required: true,\n } as RadioField,\n {\n name: 'url',\n type: 'text',\n label: ({ t }) => t('fields:enterURL'),\n required: true,\n validate: (value: string) => {\n if (!validateUrl(value)) {\n return 'Invalid URL'\n }\n },\n },\n ]\n\n // Only display internal link-specific fields / options / conditions if there are enabled relations\n if (enabledRelations?.length) {\n ;(baseFields[1] as RadioField).options.push({\n label: ({ t }) => t('fields:internalLink'),\n value: 'internal',\n })\n ;(baseFields[2] as TextField).admin = {\n condition: ({ linkType }) => linkType !== 'internal',\n }\n\n baseFields.push({\n name: 'doc',\n admin: {\n condition: ({ linkType }) => {\n return linkType === 'internal'\n },\n },\n // when admin.hidden is a function we need to dynamically call hidden with the user to know if the collection should be shown\n type: 'relationship',\n filterOptions:\n !enabledCollections && !disabledCollections\n ? ({ relationTo, user }) => {\n const hidden = config.collections.find(({ slug }) => slug === relationTo).admin.hidden\n if (typeof hidden === 'function' && hidden({ user } as { user: User })) {\n return false\n }\n }\n : null,\n label: ({ t }) => t('fields:chooseDocumentToLink'),\n maxDepth,\n relationTo: enabledRelations,\n required: true,\n })\n }\n\n baseFields.push({\n name: 'newTab',\n type: 'checkbox',\n label: ({ t }) => t('fields:openInNewTab'),\n })\n\n return baseFields\n}\n"],"names":["validateUrl","getBaseFields","config","enabledCollections","disabledCollections","maxDepth","enabledRelations","collections","filter","slug","includes","map","admin","enableRichTextLink","hidden","baseFields","name","type","label","t","required","description","defaultValue","options","value","validate","length","push","condition","linkType","filterOptions","relationTo","user","find"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,WAAW,QAAQ,gCAA+B;AAE3D,OAAO,MAAMC,gBAAgB,CAC3BC,QACAC,oBACAC,qBACAC;IAEA,IAAIC;IAEJ;;;GAGC,GACD,IAAIH,oBAAoB;QACtBG,mBAAmBH;IACrB,OAAO,IAAIC,qBAAqB;QAC9BE,mBAAmBJ,OAAOK,WAAW,CAClCC,MAAM,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAK,CAACL,oBAAoBM,QAAQ,CAACD,OACnDE,GAAG,CAAC,CAAC,EAAEF,IAAI,EAAE,GAAKA;IACvB,OAAO;QACLH,mBAAmBJ,OAAOK,WAAW,CAClCC,MAAM,CAAC,CAAC,EAAEI,OAAO,EAAEC,kBAAkB,EAAEC,MAAM,EAAE,EAAE;YAChD,IAAI,OAAOA,WAAW,cAAcA,QAAQ;gBAC1C,OAAO;YACT;YACA,OAAOD;QACT,GACCF,GAAG,CAAC,CAAC,EAAEF,IAAI,EAAE,GAAKA;IACvB;IAEA,MAAMM,aAAsB;QAC1B;YACEC,MAAM;YACNC,MAAM;YACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNL,OAAO;gBACLS,aAAa,CAAC,EAAEF,CAAC,EAAE,GAAKA,EAAE;YAC5B;YACAG,cAAc;YACdJ,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBI,SAAS;gBACP;oBACEL,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;oBACpBK,OAAO;gBACT;aACD;YACDJ,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBC,UAAU;YACVK,UAAU,CAACD;gBACT,IAAI,CAACxB,YAAYwB,QAAQ;oBACvB,OAAO;gBACT;YACF;QACF;KACD;IAED,mGAAmG;IACnG,IAAIlB,kBAAkBoB,QAAQ;QAC1BX,UAAU,CAAC,EAAE,CAAgBQ,OAAO,CAACI,IAAI,CAAC;YAC1CT,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBK,OAAO;QACT;QACET,UAAU,CAAC,EAAE,CAAeH,KAAK,GAAG;YACpCgB,WAAW,CAAC,EAAEC,QAAQ,EAAE,GAAKA,aAAa;QAC5C;QAEAd,WAAWY,IAAI,CAAC;YACdX,MAAM;YACNJ,OAAO;gBACLgB,WAAW,CAAC,EAAEC,QAAQ,EAAE;oBACtB,OAAOA,aAAa;gBACtB;YACF;YACA,6HAA6H;YAC7HZ,MAAM;YACNa,eACE,CAAC3B,sBAAsB,CAACC,sBACpB,CAAC,EAAE2B,UAAU,EAAEC,IAAI,EAAE;gBACnB,MAAMlB,SAASZ,OAAOK,WAAW,CAAC0B,IAAI,CAAC,CAAC,EAAExB,IAAI,EAAE,GAAKA,SAASsB,YAAYnB,KAAK,CAACE,MAAM;gBACtF,IAAI,OAAOA,WAAW,cAAcA,OAAO;oBAAEkB;gBAAK,IAAsB;oBACtE,OAAO;gBACT;YACF,IACA;YACNd,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBd;YACA0B,YAAYzB;YACZc,UAAU;QACZ;IACF;IAEAL,WAAWY,IAAI,CAAC;QACdX,MAAM;QACNC,MAAM;QACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;IACtB;IAEA,OAAOJ;AACT,EAAC"}
|
|
@@ -3,8 +3,8 @@ import type { LinkFields } from '../nodes/types.js';
|
|
|
3
3
|
export interface Props {
|
|
4
4
|
drawerSlug: string;
|
|
5
5
|
handleModalSubmit: (fields: FormState, data: Record<string, unknown>) => void;
|
|
6
|
-
stateData
|
|
6
|
+
stateData: {} | (LinkFields & {
|
|
7
7
|
text: string;
|
|
8
|
-
};
|
|
8
|
+
});
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/link/drawer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,MAAM,WAAW,KAAK;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IAC7E,SAAS,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/link/drawer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,MAAM,WAAW,KAAK;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IAC7E,SAAS,EAAE,EAAE,GAAG,CAAC,UAAU,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAChD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/link/drawer/types.ts"],"sourcesContent":["import type { FormState } from 'payload/types'\n\nimport type { LinkFields } from '../nodes/types.js'\n\nexport interface Props {\n drawerSlug: string\n handleModalSubmit: (fields: FormState, data: Record<string, unknown>) => void\n stateData
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/link/drawer/types.ts"],"sourcesContent":["import type { FormState } from 'payload/types'\n\nimport type { LinkFields } from '../nodes/types.js'\n\nexport interface Props {\n drawerSlug: string\n handleModalSubmit: (fields: FormState, data: Record<string, unknown>) => void\n stateData: {} | (LinkFields & { text: string })\n}\n"],"names":[],"rangeMappings":"","mappings":"AAIA,WAIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/feature.client.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/feature.client.tsx"],"names":[],"mappings":";AASA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAA;AAexE,MAAM,MAAM,WAAW,GAAG,6BAA6B,CAAA;AAyFvD,eAAO,MAAM,0BAA0B,+FAA2C,CAAA"}
|