@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,9 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { $isNodeSelection } from 'lexical';
|
|
3
3
|
import { RelationshipIcon } from '../../lexical/ui/icons/Relationship/index.js';
|
|
4
4
|
import { createClientComponent } from '../createClientComponent.js';
|
|
5
|
+
import { toolbarAddDropdownGroupWithItems } from '../shared/toolbar/addDropdownGroup.js';
|
|
5
6
|
import { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './drawer/commands.js';
|
|
6
|
-
import { RelationshipNode } from './nodes/RelationshipNode.js';
|
|
7
|
+
import { $isRelationshipNode, RelationshipNode } from './nodes/RelationshipNode.js';
|
|
7
8
|
import { RelationshipPlugin } from './plugins/index.js';
|
|
8
9
|
const RelationshipFeatureClient = (props)=>{
|
|
9
10
|
return {
|
|
@@ -15,27 +16,23 @@ const RelationshipFeatureClient = (props)=>{
|
|
|
15
16
|
],
|
|
16
17
|
plugins: [
|
|
17
18
|
{
|
|
18
|
-
Component:
|
|
19
|
-
Component: RelationshipPlugin,
|
|
20
|
-
toMergeIntoProps: props
|
|
21
|
-
}),
|
|
19
|
+
Component: RelationshipPlugin,
|
|
22
20
|
position: 'normal'
|
|
23
21
|
}
|
|
24
22
|
],
|
|
25
23
|
slashMenu: {
|
|
26
24
|
groups: [
|
|
27
25
|
{
|
|
28
|
-
displayName: 'Basic',
|
|
29
26
|
items: [
|
|
30
27
|
{
|
|
31
28
|
Icon: RelationshipIcon,
|
|
32
|
-
displayName: 'Relationship',
|
|
33
29
|
key: 'relationship',
|
|
34
30
|
keywords: [
|
|
35
31
|
'relationship',
|
|
36
32
|
'relation',
|
|
37
33
|
'rel'
|
|
38
34
|
],
|
|
35
|
+
label: 'Relationship',
|
|
39
36
|
onSelect: ({ editor })=>{
|
|
40
37
|
// dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND
|
|
41
38
|
editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {
|
|
@@ -44,9 +41,34 @@ const RelationshipFeatureClient = (props)=>{
|
|
|
44
41
|
}
|
|
45
42
|
}
|
|
46
43
|
],
|
|
47
|
-
key: 'basic'
|
|
44
|
+
key: 'basic',
|
|
45
|
+
label: 'Basic'
|
|
48
46
|
}
|
|
49
47
|
]
|
|
48
|
+
},
|
|
49
|
+
toolbarFixed: {
|
|
50
|
+
groups: [
|
|
51
|
+
toolbarAddDropdownGroupWithItems([
|
|
52
|
+
{
|
|
53
|
+
ChildComponent: RelationshipIcon,
|
|
54
|
+
isActive: ({ selection })=>{
|
|
55
|
+
if (!$isNodeSelection(selection) || !selection.getNodes().length) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
const firstNode = selection.getNodes()[0];
|
|
59
|
+
return $isRelationshipNode(firstNode);
|
|
60
|
+
},
|
|
61
|
+
key: 'relationship',
|
|
62
|
+
label: 'Relationship',
|
|
63
|
+
onSelect: ({ editor })=>{
|
|
64
|
+
// dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND
|
|
65
|
+
editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {
|
|
66
|
+
replace: false
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
])
|
|
71
|
+
]
|
|
50
72
|
}
|
|
51
73
|
})
|
|
52
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/relationship/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/relationship/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isNodeSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { RelationshipFeatureProps } from './feature.server.js'\n\nimport { RelationshipIcon } from '../../lexical/ui/icons/Relationship/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { toolbarAddDropdownGroupWithItems } from '../shared/toolbar/addDropdownGroup.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './drawer/commands.js'\nimport { $isRelationshipNode, RelationshipNode } from './nodes/RelationshipNode.js'\nimport { RelationshipPlugin } from './plugins/index.js'\n\nconst RelationshipFeatureClient: FeatureProviderProviderClient<RelationshipFeatureProps> = (\n props,\n) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n nodes: [RelationshipNode],\n plugins: [\n {\n Component: RelationshipPlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n groups: [\n {\n items: [\n {\n Icon: RelationshipIcon,\n key: 'relationship',\n keywords: ['relationship', 'relation', 'rel'],\n label: 'Relationship',\n onSelect: ({ editor }) => {\n // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: false,\n })\n },\n },\n ],\n key: 'basic',\n label: 'Basic',\n },\n ],\n },\n toolbarFixed: {\n groups: [\n toolbarAddDropdownGroupWithItems([\n {\n ChildComponent: RelationshipIcon,\n isActive: ({ selection }) => {\n if (!$isNodeSelection(selection) || !selection.getNodes().length) {\n return false\n }\n\n const firstNode = selection.getNodes()[0]\n return $isRelationshipNode(firstNode)\n },\n key: 'relationship',\n label: 'Relationship',\n onSelect: ({ editor }) => {\n // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: false,\n })\n },\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const RelationshipFeatureClientComponent = createClientComponent(RelationshipFeatureClient)\n"],"names":["$isNodeSelection","RelationshipIcon","createClientComponent","toolbarAddDropdownGroupWithItems","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","$isRelationshipNode","RelationshipNode","RelationshipPlugin","RelationshipFeatureClient","props","clientFeatureProps","feature","nodes","plugins","Component","position","slashMenu","groups","items","Icon","key","keywords","label","onSelect","editor","dispatchCommand","replace","toolbarFixed","ChildComponent","isActive","selection","getNodes","length","firstNode","RelationshipFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,gBAAgB,QAAQ,UAAS;AAK1C,SAASC,gBAAgB,QAAQ,+CAA8C;AAC/E,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,gCAAgC,QA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FeatureProviderProviderServer } from '../types.js';
|
|
2
|
-
export type
|
|
2
|
+
export type ExclusiveRelationshipFeatureProps = {
|
|
3
3
|
/**
|
|
4
4
|
* The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.
|
|
5
5
|
* When this property is set, `enabledCollections` will not be available.
|
|
@@ -14,5 +14,14 @@ export type RelationshipFeatureProps = {
|
|
|
14
14
|
**/
|
|
15
15
|
enabledCollections?: string[];
|
|
16
16
|
};
|
|
17
|
+
export type RelationshipFeatureProps = ExclusiveRelationshipFeatureProps & {
|
|
18
|
+
/**
|
|
19
|
+
* Sets a maximum population depth for this relationship, regardless of the remaining depth when the respective field is reached.
|
|
20
|
+
* This behaves exactly like the maxDepth properties of relationship and upload fields.
|
|
21
|
+
*
|
|
22
|
+
* {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}
|
|
23
|
+
*/
|
|
24
|
+
maxDepth?: number;
|
|
25
|
+
};
|
|
17
26
|
export declare const RelationshipFeature: FeatureProviderProviderServer<RelationshipFeatureProps, RelationshipFeatureProps>;
|
|
18
27
|
//# sourceMappingURL=feature.server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAOhE,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAOhE,MAAM,MAAM,iCAAiC,GACzC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAG9B,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B,CAAA;AAEL,MAAM,MAAM,wBAAwB,GAAG,iCAAiC,GAAG;IACzE;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,6BAA6B,CAC7D,wBAAwB,EACxB,wBAAwB,CAmBzB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createNode } from '../typeUtilities.js';
|
|
2
2
|
import { RelationshipFeatureClientComponent } from './feature.client.js';
|
|
3
3
|
import { RelationshipNode } from './nodes/RelationshipNode.js';
|
|
4
|
-
import {
|
|
4
|
+
import { relationshipPopulationPromiseHOC } from './populationPromise.js';
|
|
5
5
|
export const RelationshipFeature = (props)=>{
|
|
6
6
|
return {
|
|
7
7
|
feature: ()=>{
|
|
@@ -12,7 +12,7 @@ export const RelationshipFeature = (props)=>{
|
|
|
12
12
|
createNode({
|
|
13
13
|
node: RelationshipNode,
|
|
14
14
|
populationPromises: [
|
|
15
|
-
|
|
15
|
+
relationshipPopulationPromiseHOC(props)
|
|
16
16
|
]
|
|
17
17
|
})
|
|
18
18
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/relationship/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../types.js'\n\nimport { createNode } from '../typeUtilities.js'\nimport { RelationshipFeatureClientComponent } from './feature.client.js'\nimport { RelationshipNode } from './nodes/RelationshipNode.js'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/relationship/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../types.js'\n\nimport { createNode } from '../typeUtilities.js'\nimport { RelationshipFeatureClientComponent } from './feature.client.js'\nimport { RelationshipNode } from './nodes/RelationshipNode.js'\nimport { relationshipPopulationPromiseHOC } from './populationPromise.js'\n\nexport type ExclusiveRelationshipFeatureProps =\n | {\n /**\n * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: string[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled. Overrides the `enableRichTextRelationship` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: string[]\n }\n\nexport type RelationshipFeatureProps = ExclusiveRelationshipFeatureProps & {\n /**\n * Sets a maximum population depth for this relationship, regardless of the remaining depth when the respective field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n}\n\nexport const RelationshipFeature: FeatureProviderProviderServer<\n RelationshipFeatureProps,\n RelationshipFeatureProps\n> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: RelationshipFeatureClientComponent,\n clientFeatureProps: props,\n nodes: [\n createNode({\n node: RelationshipNode,\n populationPromises: [relationshipPopulationPromiseHOC(props)],\n }),\n ],\n serverFeatureProps: props,\n }\n },\n key: 'relationship',\n serverFeatureProps: props,\n }\n}\n"],"names":["createNode","RelationshipFeatureClientComponent","RelationshipNode","relationshipPopulationPromiseHOC","RelationshipFeature","props","feature","ClientComponent","clientFeatureProps","nodes","node","populationPromises","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,UAAU,QAAQ,sBAAqB;AAChD,SAASC,kCAAkC,QAAQ,sBAAqB;AACxE,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,gCAAgC,QAAQ,yBAAwB;AAkCzE,OAAO,MAAMC,sBAGT,CAACC;IACH,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,oBAAoBH;gBACpBI,OAAO;oBACLT,WAAW;wBACTU,MAAMR;wBACNS,oBAAoB;4BAACR,iCAAiCE;yBAAO;oBAC/D;iBACD;gBACDO,oBAAoBP;YACtB;QACF;QACAQ,KAAK;QACLD,oBAAoBP;IACtB;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/relationship/nodes/components/RelationshipComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAoBhD,OAAO,KAA+D,MAAM,OAAO,CAAA;AAEnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAK9D,OAAO,cAAc,CAAA;AAQrB,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,gBAAgB,CAAA;IACtB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;
|
|
1
|
+
{"version":3,"file":"RelationshipComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/relationship/nodes/components/RelationshipComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAoBhD,OAAO,KAA+D,MAAM,OAAO,CAAA;AAEnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAK9D,OAAO,cAAc,CAAA;AAQrB,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,gBAAgB,CAAA;IACtB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AA8JD,eAAO,MAAM,qBAAqB,UAAW,KAAK,KAAG,MAAM,SAE1D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/field/features/relationship/nodes/components/RelationshipComponent.tsx"],"sourcesContent":["'use client'\nimport type { ElementFormatType } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button } from '@payloadcms/ui/elements/Button'\nimport { useDocumentDrawer } from '@payloadcms/ui/elements/DocumentDrawer'\nimport usePayloadAPI from '@payloadcms/ui/hooks/usePayloadAPI'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport {\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback, useEffect, useReducer, useRef, useState } from 'react'\n\nimport type { RelationshipData } from '../RelationshipNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from '../../drawer/commands.js'\nimport { $isRelationshipNode } from '../RelationshipNode.js'\nimport './index.scss'\n\nconst baseClass = 'lexical-relationship'\n\nconst initialParams = {\n depth: 0,\n}\n\ntype Props = {\n children?: React.ReactNode\n className?: string\n data: RelationshipData\n format?: ElementFormatType\n nodeKey?: string\n}\n\nconst Component: React.FC<Props> = (props) => {\n const {\n children,\n data: { relationTo, value: id },\n nodeKey,\n } = props\n\n const relationshipElemRef = useRef<HTMLDivElement | null>(null)\n\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n const { field } = useEditorConfigContext()\n const {\n collections,\n routes: { api },\n serverURL,\n } = useConfig()\n\n const [relatedCollection, setRelatedCollection] = useState(() =>\n collections.find((coll) => coll.slug === relationTo),\n )\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${id}`,\n { initialParams },\n )\n\n const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({\n id,\n collectionSlug: relatedCollection.slug,\n })\n\n const removeRelationship = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const updateRelationship = React.useCallback(\n ({ doc }) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n closeDrawer()\n dispatchCacheBust()\n },\n [cacheBust, setParams, closeDrawer],\n )\n\n const onDelete = useCallback(\n (payload: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n const event: KeyboardEvent = payload\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isRelationshipNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n const onClick = useCallback(\n (payload: MouseEvent) => {\n const event = payload\n // Check if relationshipElemRef.target or anything WITHIN relationshipElemRef.target was clicked\n if (\n event.target === relationshipElemRef.current ||\n relationshipElemRef.current?.contains(event.target as Node)\n ) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n clearSelection()\n setSelected(true)\n }\n return true\n }\n\n return false\n },\n [isSelected, setSelected, clearSelection],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW),\n\n editor.registerCommand(KEY_DELETE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, onDelete, setSelected, onClick])\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={relationshipElemRef}\n >\n <div className={`${baseClass}__wrap`}>\n <p className={`${baseClass}__label`}>\n {t('fields:labelRelationship', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n </p>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <p className={`${baseClass}__title`}>\n {data ? data[relatedCollection?.admin?.useAsTitle || 'id'] : id}\n </p>\n </DocumentDrawerToggler>\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__swapButton`}\n disabled={field?.readOnly}\n el=\"div\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapRelationship')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeRelationship()\n }}\n round\n tooltip={t('fields:removeRelationship')}\n />\n </div>\n )}\n\n {id && <DocumentDrawer onSave={updateRelationship} />}\n {children}\n </div>\n )\n}\n\nexport const RelationshipComponent = (props: Props): React.ReactNode => {\n return <Component {...props} />\n}\n"],"names":["useLexicalComposerContext","useLexicalNodeSelection","mergeRegister","getTranslation","Button","useDocumentDrawer","usePayloadAPI","useConfig","useTranslation","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","$getNodeByKey","React","useCallback","useEffect","useReducer","useRef","useState","useEditorConfigContext","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","$isRelationshipNode","baseClass","initialParams","depth","Component","props","children","data","relationTo","value","id","nodeKey","relationshipElemRef","editor","isSelected","setSelected","clearSelection","field","collections","routes","api","serverURL","relatedCollection","setRelatedCollection","find","coll","slug","i18n","t","cacheBust","dispatchCacheBust","state","setParams","DocumentDrawer","DocumentDrawerToggler","closeDrawer","collectionSlug","removeRelationship","update","remove","updateRelationship","doc","onDelete","payload","event","preventDefault","node","onClick","target","current","contains","shiftKey","registerCommand","div","className","filter","Boolean","join","contentEditable","ref","p","label","labels","singular","admin","useAsTitle","isEditable","buttonStyle","disabled","readOnly","el","icon","dispatchCommand","replace","round","tooltip","e","onSave","RelationshipComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,uBAAuB,QAAQ,4CAA2C;AACnF,SAASC,aAAa,QAAQ,iBAAgB;AAC9C,SAASC,cAAc,QAAQ,2BAA0B;AACzD,SAASC,MAAM,QAAQ,iCAAgC;AACvD,SAASC,iBAAiB,QAAQ,yCAAwC;AAC1E,OAAOC,mBAAmB,qCAAoC;AAC9D,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SACEC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb,UAAS;AAChB,SAASC,aAAa,QAAQ,UAAS;AACvC,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAInF,SAASC,sBAAsB,QAAQ,4DAA2D;AAClG,SAASC,uCAAuC,QAAQ,2BAA0B;AAClF,SAASC,mBAAmB,QAAQ,yBAAwB;AAC5D,OAAO,eAAc;AAEr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;QAC7BiC,OAAOlF,eAAe2C,kBAAkBwC,MAAM,CAACC,QAAQ,EAAEpC;IAC3D,mBAEF,oBAACO;QAAsBoB,WAAW,CAAC,EAAErD,UAAU,oBAAoB,CAAC;qBAClE,oBAAC2D;QAAEN,WAAW,CAAC,EAAErD,UAAU,OAAO,CAAC;OAChCM,OAAOA,IAAI,CAACe,mBAAmB0C,OAAOC,cAAc,KAAK,GAAGvD,OAIlEG,OAAOqD,UAAU,oBAChB,oBAACb;QAAIC,WAAW,CAAC,EAAErD,UAAU,SAAS,CAAC;qBACrC,oBAACrB;QACCuF,aAAY;QACZb,WAAW,CAAC,EAAErD,UAAU,YAAY,CAAC;QACrCmE,UAAUnD,OAAOoD;QACjBC,IAAG;QACHC,MAAK;QACLxB,SAAS;YACPlC,OAAO2D,eAAe,CAACzE,yCAAyC;gBAC9D0E,SAAS;oBAAE9D;gBAAQ;YACrB;QACF;QACA+D,OAAAA;QACAC,SAAS/C,EAAE;sBAEb,oBAAChD;QACCuF,aAAY;QACZb,WAAW,CAAC,EAAErD,UAAU,cAAc,CAAC;QACvCmE,UAAUnD,OAAOoD;QACjBE,MAAK;QACLxB,SAAS,CAAC6B;YACRA,EAAE/B,cAAc;YAChBR;QACF;QACAqC,OAAAA;QACAC,SAAS/C,EAAE;SAKhBlB,oBAAM,oBAACuB;QAAe4C,QAAQrC;QAC9BlC;AAGP;AAEA,OAAO,MAAMwE,wBAAwB,CAACzE;IACpC,qBAAO,oBAACD,WAAcC;AACxB,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/field/features/relationship/nodes/components/RelationshipComponent.tsx"],"sourcesContent":["'use client'\nimport type { ElementFormatType } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button } from '@payloadcms/ui/elements/Button'\nimport { useDocumentDrawer } from '@payloadcms/ui/elements/DocumentDrawer'\nimport usePayloadAPI from '@payloadcms/ui/hooks/usePayloadAPI'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport {\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback, useEffect, useReducer, useRef, useState } from 'react'\n\nimport type { RelationshipData } from '../RelationshipNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from '../../drawer/commands.js'\nimport { $isRelationshipNode } from '../RelationshipNode.js'\nimport './index.scss'\n\nconst baseClass = 'lexical-relationship'\n\nconst initialParams = {\n depth: 0,\n}\n\ntype Props = {\n children?: React.ReactNode\n className?: string\n data: RelationshipData\n format?: ElementFormatType\n nodeKey?: string\n}\n\nconst Component: React.FC<Props> = (props) => {\n const {\n children,\n data: { relationTo, value: id },\n nodeKey,\n } = props\n\n const relationshipElemRef = useRef<HTMLDivElement | null>(null)\n\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n const { field } = useEditorConfigContext()\n const {\n collections,\n routes: { api },\n serverURL,\n } = useConfig()\n\n const [relatedCollection, setRelatedCollection] = useState(() =>\n collections.find((coll) => coll.slug === relationTo),\n )\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${id}`,\n { initialParams },\n )\n\n const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({\n id,\n collectionSlug: relatedCollection.slug,\n })\n\n const removeRelationship = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const updateRelationship = React.useCallback(\n ({ doc }) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n closeDrawer()\n dispatchCacheBust()\n },\n [cacheBust, setParams, closeDrawer],\n )\n\n const onDelete = useCallback(\n (payload: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n const event: KeyboardEvent = payload\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isRelationshipNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n const onClick = useCallback(\n (payload: MouseEvent) => {\n const event = payload\n // Check if relationshipElemRef.target or anything WITHIN relationshipElemRef.target was clicked\n if (\n event.target === relationshipElemRef.current ||\n relationshipElemRef.current?.contains(event.target as Node)\n ) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n if (!isSelected) {\n clearSelection()\n setSelected(true)\n }\n }\n return true\n }\n\n return false\n },\n [isSelected, setSelected, clearSelection],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW),\n\n editor.registerCommand(KEY_DELETE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, onDelete, setSelected, onClick])\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={relationshipElemRef}\n >\n <div className={`${baseClass}__wrap`}>\n <p className={`${baseClass}__label`}>\n {t('fields:labelRelationship', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n </p>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <p className={`${baseClass}__title`}>\n {data ? data[relatedCollection?.admin?.useAsTitle || 'id'] : id}\n </p>\n </DocumentDrawerToggler>\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__swapButton`}\n disabled={field?.readOnly}\n el=\"div\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapRelationship')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeRelationship()\n }}\n round\n tooltip={t('fields:removeRelationship')}\n />\n </div>\n )}\n\n {id && <DocumentDrawer onSave={updateRelationship} />}\n {children}\n </div>\n )\n}\n\nexport const RelationshipComponent = (props: Props): React.ReactNode => {\n return <Component {...props} />\n}\n"],"names":["useLexicalComposerContext","useLexicalNodeSelection","mergeRegister","getTranslation","Button","useDocumentDrawer","usePayloadAPI","useConfig","useTranslation","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","$getNodeByKey","React","useCallback","useEffect","useReducer","useRef","useState","useEditorConfigContext","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","$isRelationshipNode","baseClass","initialParams","depth","Component","props","children","data","relationTo","value","id","nodeKey","relationshipElemRef","editor","isSelected","setSelected","clearSelection","field","collections","routes","api","serverURL","relatedCollection","setRelatedCollection","find","coll","slug","i18n","t","cacheBust","dispatchCacheBust","state","setParams","DocumentDrawer","DocumentDrawerToggler","closeDrawer","collectionSlug","removeRelationship","update","remove","updateRelationship","doc","onDelete","payload","event","preventDefault","node","onClick","target","current","contains","shiftKey","registerCommand","div","className","filter","Boolean","join","contentEditable","ref","p","label","labels","singular","admin","useAsTitle","isEditable","buttonStyle","disabled","readOnly","el","icon","dispatchCommand","replace","round","too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QAAIC,WAAW,CAAC,EAAErD,UAAU,SAAS,CAAC;qBACrC,oBAACrB;QACCuF,aAAY;QACZb,WAAW,CAAC,EAAErD,UAAU,YAAY,CAAC;QACrCmE,UAAUnD,OAAOoD;QACjBC,IAAG;QACHC,MAAK;QACLxB,SAAS;YACPlC,OAAO2D,eAAe,CAACzE,yCAAyC;gBAC9D0E,SAAS;oBAAE9D;gBAAQ;YACrB;QACF;QACA+D,OAAAA;QACAC,SAAS/C,EAAE;sBAEb,oBAAChD;QACCuF,aAAY;QACZb,WAAW,CAAC,EAAErD,UAAU,cAAc,CAAC;QACvCmE,UAAUnD,OAAOoD;QACjBE,MAAK;QACLxB,SAAS,CAAC6B;YACRA,EAAE/B,cAAc;YAChBR;QACF;QACAqC,OAAAA;QACAC,SAAS/C,EAAE;SAKhBlB,oBAAM,oBAACuB;QAAe4C,QAAQrC;QAC9BlC;AAGP;AAEA,OAAO,MAAMwE,wBAAwB,CAACzE;IACpC,qBAAO,oBAACD,WAAcC;AACxB,EAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LexicalCommand } from 'lexical';
|
|
2
|
-
import
|
|
2
|
+
import type { PluginComponent } from '../../types.js';
|
|
3
3
|
import type { RelationshipFeatureProps } from '../feature.server.js';
|
|
4
4
|
import type { RelationshipData } from '../nodes/RelationshipNode.js';
|
|
5
5
|
export declare const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData>;
|
|
6
|
-
export declare
|
|
6
|
+
export declare const RelationshipPlugin: PluginComponent<RelationshipFeatureProps>;
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/relationship/plugins/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/relationship/plugins/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAgB7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAKpE,eAAO,MAAM,2BAA2B,EAAE,cAAc,CAAC,gBAAgB,CAExE,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,wBAAwB,CAqDxE,CAAA"}
|
|
@@ -8,14 +8,14 @@ import React from 'react';
|
|
|
8
8
|
import { RelationshipDrawer } from '../drawer/index.js';
|
|
9
9
|
import { $createRelationshipNode, RelationshipNode } from '../nodes/RelationshipNode.js';
|
|
10
10
|
export const INSERT_RELATIONSHIP_COMMAND = createCommand('INSERT_RELATIONSHIP_COMMAND');
|
|
11
|
-
export
|
|
11
|
+
export const RelationshipPlugin = ({ clientProps })=>{
|
|
12
12
|
const [editor] = useLexicalComposerContext();
|
|
13
13
|
const { collections } = useConfig();
|
|
14
14
|
let enabledRelations = null;
|
|
15
|
-
if (
|
|
16
|
-
enabledRelations =
|
|
17
|
-
} else if (
|
|
18
|
-
enabledRelations = collections.filter(({ slug })=>!
|
|
15
|
+
if (clientProps?.enabledCollections) {
|
|
16
|
+
enabledRelations = clientProps?.enabledCollections;
|
|
17
|
+
} else if (clientProps?.disabledCollections) {
|
|
18
|
+
enabledRelations = collections.filter(({ slug })=>!clientProps?.disabledCollections?.includes(slug)).map(({ slug })=>slug);
|
|
19
19
|
}
|
|
20
20
|
useEffect(()=>{
|
|
21
21
|
if (!editor.hasNodes([
|
|
@@ -44,6 +44,6 @@ export function RelationshipPlugin(props) {
|
|
|
44
44
|
return /*#__PURE__*/ React.createElement(RelationshipDrawer, {
|
|
45
45
|
enabledCollectionSlugs: enabledRelations
|
|
46
46
|
});
|
|
47
|
-
}
|
|
47
|
+
};
|
|
48
48
|
|
|
49
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/relationship/plugins/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot } from '@lexical/utils'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport {\n $getPreviousSelection,\n $getSelection,\n $isParagraphNode,\n $isRangeSelection,\n COMMAND_PRIORITY_EDITOR,\n createCommand,\n} from 'lexical'\nimport { useEffect } from 'react'\nimport React from 'react'\n\nimport type { RelationshipFeatureProps } from '../feature.server.js'\nimport type { RelationshipData } from '../nodes/RelationshipNode.js'\n\nimport { RelationshipDrawer } from '../drawer/index.js'\nimport { $createRelationshipNode, RelationshipNode } from '../nodes/RelationshipNode.js'\n\nexport const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData> = createCommand(\n 'INSERT_RELATIONSHIP_COMMAND',\n)\n\nexport
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/relationship/plugins/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot } from '@lexical/utils'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport {\n $getPreviousSelection,\n $getSelection,\n $isParagraphNode,\n $isRangeSelection,\n COMMAND_PRIORITY_EDITOR,\n createCommand,\n} from 'lexical'\nimport { useEffect } from 'react'\nimport React from 'react'\n\nimport type { PluginComponent } from '../../types.js'\nimport type { RelationshipFeatureProps } from '../feature.server.js'\nimport type { RelationshipData } from '../nodes/RelationshipNode.js'\n\nimport { RelationshipDrawer } from '../drawer/index.js'\nimport { $createRelationshipNode, RelationshipNode } from '../nodes/RelationshipNode.js'\n\nexport const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData> = createCommand(\n 'INSERT_RELATIONSHIP_COMMAND',\n)\n\nexport const RelationshipPlugin: PluginComponent<RelationshipFeatureProps> = ({ clientProps }) => {\n const [editor] = useLexicalComposerContext()\n const { collections } = useConfig()\n\n let enabledRelations: string[] = null\n\n if (clientProps?.enabledCollections) {\n enabledRelations = clientProps?.enabledCollections\n } else if (clientProps?.disabledCollections) {\n enabledRelations = collections\n .filter(({ slug }) => !clientProps?.disabledCollections?.includes(slug))\n .map(({ slug }) => slug)\n }\n\n useEffect(() => {\n if (!editor.hasNodes([RelationshipNode])) {\n throw new Error('RelationshipPlugin: RelationshipNode not registered on editor')\n }\n\n return editor.registerCommand<RelationshipData>(\n INSERT_RELATIONSHIP_COMMAND,\n (payload) => {\n const relationshipNode = $createRelationshipNode(payload)\n\n const selection = $getSelection() || $getPreviousSelection()\n\n if ($isRangeSelection(selection)) {\n const { focus } = selection\n const focusNode = focus.getNode()\n\n // First, delete currently selected node if it's an empty paragraph and if there are sufficient\n // paragraph nodes (more than 1) left in the parent node, so that we don't \"trap\" the user\n if (\n $isParagraphNode(focusNode) &&\n focusNode.getTextContentSize() === 0 &&\n focusNode\n .getParent()\n .getChildren()\n .filter((node) => $isParagraphNode(node)).length > 1\n ) {\n focusNode.remove()\n }\n\n $insertNodeToNearestRoot(relationshipNode)\n }\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return <RelationshipDrawer enabledCollectionSlugs={enabledRelations} />\n}\n"],"names":["useLexicalComposerContext","$insertNodeToNearestRoot","useConfig","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","useEffect","React","RelationshipDrawer","$createRelationshipNode","RelationshipNode","INSERT_RELATIONSHIP_COMMAND","RelationshipPlugin","clientProps","editor","collections","enabledRelations","enabledCollections","disabledCollections","filter","slug","includes","map","hasNodes","Error","registerCommand","payload","relationshipNode","selection","focus","focusNode","getNode","getTextContentSize","getParent","getChildren","node","length","remove","enabledCollectionSlugs"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,wBAAwB,QAAQ,iBAAgB;AACzD,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SACEC,qBAAqB,EACrBC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,EACjBC,uBAAuB,EACvBC,aAAa,QACR,UAAS;AAChB,SAASC,SAAS,QAAQ,QAAO;AACjC,OAAOC,WAAW,QAAO;AAMzB,SAASC,kBAAkB,QAAQ,qBAAoB;AACvD,SAASC,uBAAuB,EAAEC,gBAAgB,QAAQ,+BAA8B;AAExF,OAAO,MAAMC,8BAAgEN,cAC3E,+BACD;AAED,OAAO,MAAMO,qBAAgE,CAAC,EAAEC,WAAW,EAAE;IAC3F,MAAM,CAACC,OAAO,GAAGjB;IACjB,MAAM,EAAEkB,WAAW,EAAE,GAAGhB;IAExB,IAAIiB,mBAA6B;IAEjC,IAAIH,aAAaI,oBAAoB;QACnCD,mBAAmBH,aAAaI;IAClC,OAAO,IAAIJ,aAAaK,qBAAqB;QAC3CF,mBAAmBD,YAChBI,MAAM,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAK,CAACP,aAAaK,qBAAqBG,SAASD,OACjEE,GAAG,CAAC,CAAC,EAAEF,IAAI,EAAE,GAAKA;IACvB;IAEAd,UAAU;QACR,IAAI,CAACQ,OAAOS,QAAQ,CAAC;YAACb;SAAiB,GAAG;YACxC,MAAM,IAAIc,MAAM;QAClB;QAEA,OAAOV,OAAOW,eAAe,CAC3Bd,6BACA,CAACe;YACC,MAAMC,mBAAmBlB,wBAAwBiB;YAEjD,MAAME,YAAY3B,mBAAmBD;YAErC,IAAIG,kBAAkByB,YAAY;gBAChC,MAAM,EAAEC,KAAK,EAAE,GAAGD;gBAClB,MAAME,YAAYD,MAAME,OAAO;gBAE/B,+FAA+F;gBAC/F,0FAA0F;gBAC1F,IACE7B,iBAAiB4B,cACjBA,UAAUE,kBAAkB,OAAO,KACnCF,UACGG,SAAS,GACTC,WAAW,GACXf,MAAM,CAAC,CAACgB,OAASjC,iBAAiBiC,OAAOC,MAAM,GAAG,GACrD;oBACAN,UAAUO,MAAM;gBAClB;gBAEAvC,yBAAyB6B;YAC3B;YAEA,OAAO;QACT,GACAvB;IAEJ,GAAG;QAACU;KAAO;IAEX,qBAAO,oBAACN;QAAmB8B,wBAAwBtB;;AACrD,EAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PopulationPromise } from '../types.js';
|
|
2
|
+
import type { RelationshipFeatureProps } from './feature.server.js';
|
|
2
3
|
import type { SerializedRelationshipNode } from './nodes/RelationshipNode.js';
|
|
3
|
-
export declare const
|
|
4
|
+
export declare const relationshipPopulationPromiseHOC: (props: RelationshipFeatureProps) => PopulationPromise<SerializedRelationshipNode>;
|
|
4
5
|
//# sourceMappingURL=populationPromise.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"populationPromise.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/populationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAA;AAI7E,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"populationPromise.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/populationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAA;AAI7E,eAAO,MAAM,gCAAgC,UACpC,wBAAwB,KAC9B,kBAAkB,0BAA0B,CA0C9C,CAAA"}
|
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import { populate } from '../../../populate/populate.js';
|
|
2
|
-
export const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
export const relationshipPopulationPromiseHOC = (props)=>{
|
|
3
|
+
const relationshipPopulationPromise = ({ currentDepth, depth, draft, field, node, overrideAccess, populationPromises, req, showHiddenFields })=>{
|
|
4
|
+
if (node?.value) {
|
|
5
|
+
// @ts-expect-error
|
|
6
|
+
const id = node?.value?.id || node?.value // for backwards-compatibility
|
|
7
|
+
;
|
|
8
|
+
const collection = req.payload.collections[node?.relationTo];
|
|
9
|
+
if (collection) {
|
|
10
|
+
const populateDepth = props?.maxDepth !== undefined && props?.maxDepth < depth ? props?.maxDepth : depth;
|
|
11
|
+
populationPromises.push(populate({
|
|
12
|
+
id,
|
|
13
|
+
collection,
|
|
14
|
+
currentDepth,
|
|
15
|
+
data: node,
|
|
16
|
+
depth: populateDepth,
|
|
17
|
+
draft,
|
|
18
|
+
field,
|
|
19
|
+
key: 'value',
|
|
20
|
+
overrideAccess,
|
|
21
|
+
req,
|
|
22
|
+
showHiddenFields
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
|
-
}
|
|
26
|
+
};
|
|
27
|
+
return relationshipPopulationPromise;
|
|
23
28
|
};
|
|
24
29
|
|
|
25
30
|
//# sourceMappingURL=populationPromise.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/relationship/populationPromise.ts"],"sourcesContent":["import type { PopulationPromise } from '../types.js'\nimport type { SerializedRelationshipNode } from './nodes/RelationshipNode.js'\n\nimport { populate } from '../../../populate/populate.js'\n\nexport const relationshipPopulationPromise: PopulationPromise<SerializedRelationshipNode> = ({\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/relationship/populationPromise.ts"],"sourcesContent":["import type { PopulationPromise } from '../types.js'\nimport type { RelationshipFeatureProps } from './feature.server.js'\nimport type { SerializedRelationshipNode } from './nodes/RelationshipNode.js'\n\nimport { populate } from '../../../populate/populate.js'\n\nexport const relationshipPopulationPromiseHOC = (\n props: RelationshipFeatureProps,\n): PopulationPromise<SerializedRelationshipNode> => {\n const relationshipPopulationPromise: PopulationPromise<SerializedRelationshipNode> = ({\n currentDepth,\n depth,\n draft,\n field,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (node?.value) {\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const collection = req.payload.collections[node?.relationTo]\n\n if (collection) {\n const populateDepth =\n props?.maxDepth !== undefined && props?.maxDepth < depth ? props?.maxDepth : depth\n\n populationPromises.push(\n populate({\n id,\n collection,\n currentDepth,\n data: node,\n depth: populateDepth,\n draft,\n field,\n key: 'value',\n overrideAccess,\n req,\n showHiddenFields,\n }),\n )\n }\n }\n }\n\n return relationshipPopulationPromise\n}\n"],"names":["populate","relationshipPopulationPromiseHOC","props","relationshipPopulationPromise","currentDepth","depth","draft","field","node","overrideAccess","populationPromises","req","showHiddenFields","value","id","collection","payload","collections","relationTo","populateDepth","maxDepth","undefined","push","data","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,QAAQ,QAAQ,gCAA+B;AAExD,OAAO,MAAMC,mCAAmC,CAC9CC;IAEA,MAAMC,gCAA+E,CAAC,EACpFC,YAAY,EACZC,KAAK,EACLC,KAAK,EACLC,KAAK,EACLC,IAAI,EACJC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EACjB;QACC,IAAIJ,MAAMK,OAAO;YACf,mBAAmB;YACnB,MAAMC,KAAKN,MAAMK,OAAOC,MAAMN,MAAMK,MAAM,8BAA8B;;YAExE,MAAME,aAAaJ,IAAIK,OAAO,CAACC,WAAW,CAACT,MAAMU,WAAW;YAE5D,IAAIH,YAAY;gBACd,MAAMI,gBACJjB,OAAOkB,aAAaC,aAAanB,OAAOkB,WAAWf,QAAQH,OAAOkB,WAAWf;gBAE/EK,mBAAmBY,IAAI,CACrBtB,SAAS;oBACPc;oBACAC;oBACAX;oBACAmB,MAAMf;oBACNH,OAAOc;oBACPb;oBACAC;oBACAiB,KAAK;oBACLf;oBACAE;oBACAC;gBACF;YAEJ;QACF;IACF;IAEA,OAAOT;AACT,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addDropdownGroup.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/shared/toolbar/addDropdownGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAI7E,eAAO,MAAM,gCAAgC,UAAW,gBAAgB,EAAE,KAAG,YAQ5E,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AddIcon } from '../../../lexical/ui/icons/Add/index.js';
|
|
2
|
+
export const toolbarAddDropdownGroupWithItems = (items)=>{
|
|
3
|
+
return {
|
|
4
|
+
type: 'dropdown',
|
|
5
|
+
ChildComponent: AddIcon,
|
|
6
|
+
items,
|
|
7
|
+
key: 'add',
|
|
8
|
+
order: 10
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=addDropdownGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/shared/toolbar/addDropdownGroup.ts"],"sourcesContent":["import type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js'\n\nimport { AddIcon } from '../../../lexical/ui/icons/Add/index.js'\n\nexport const toolbarAddDropdownGroupWithItems = (items: ToolbarGroupItem[]): ToolbarGroup => {\n return {\n type: 'dropdown',\n ChildComponent: AddIcon,\n items,\n key: 'add',\n order: 10,\n }\n}\n"],"names":["AddIcon","toolbarAddDropdownGroupWithItems","items","type","ChildComponent","key","order"],"rangeMappings":";;;;;;;;;","mappings":"AAEA,SAASA,OAAO,QAAQ,yCAAwC;AAEhE,OAAO,MAAMC,mCAAmC,CAACC;IAC/C,OAAO;QACLC,MAAM;QACNC,gBAAgBJ;QAChBE;QACAG,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureButtonsGroup.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/shared/toolbar/featureButtonsGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE7E,eAAO,MAAM,mCAAmC,UAAW,gBAAgB,EAAE,KAAG,YAO/E,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/shared/toolbar/featureButtonsGroup.ts"],"sourcesContent":["import type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js'\n\nexport const toolbarFeatureButtonsGroupWithItems = (items: ToolbarGroupItem[]): ToolbarGroup => {\n return {\n type: 'buttons',\n items,\n key: 'features',\n order: 50,\n }\n}\n"],"names":["toolbarFeatureButtonsGroupWithItems","items","type","key","order"],"rangeMappings":";;;;;;;","mappings":"AAEA,OAAO,MAAMA,sCAAsC,CAACC;IAClD,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textDropdownGroup.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/shared/toolbar/textDropdownGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAI7E,eAAO,MAAM,iCAAiC,UAAW,gBAAgB,EAAE,KAAG,YAQ7E,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TextIcon } from '../../../lexical/ui/icons/Text/index.js';
|
|
2
|
-
export const
|
|
2
|
+
export const toolbarTextDropdownGroupWithItems = (items)=>{
|
|
3
3
|
return {
|
|
4
4
|
type: 'dropdown',
|
|
5
5
|
ChildComponent: TextIcon,
|
|
6
6
|
items,
|
|
7
7
|
key: 'text',
|
|
8
|
-
order:
|
|
8
|
+
order: 25
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/shared/toolbar/textDropdownGroup.ts"],"sourcesContent":["import type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js'\n\nimport { TextIcon } from '../../../lexical/ui/icons/Text/index.js'\n\nexport const toolbarTextDropdownGroupWithItems = (items: ToolbarGroupItem[]): ToolbarGroup => {\n return {\n type: 'dropdown',\n ChildComponent: TextIcon,\n items,\n key: 'text',\n order: 25,\n }\n}\n"],"names":["TextIcon","toolbarTextDropdownGroupWithItems","items","type","ChildComponent","key","order"],"rangeMappings":";;;;;;;;;","mappings":"AAEA,SAASA,QAAQ,QAAQ,0CAAyC;AAElE,OAAO,MAAMC,oCAAoC,CAACC;IAChD,OAAO;QACLC,MAAM;QACNC,gBAAgBJ;QAChBE;QACAG,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/toolbars/fixed/Toolbar/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAOlE,OAAO,cAAc,CAAA;AA2KrB,eAAO,MAAM,kBAAkB,EAAE,yBAAyB,CAAC,SAAS,CAqBnE,CAAA"}
|