@payloadcms/richtext-lexical 4.0.0-internal.c3ac604 → 4.0.0-internal.cb69780
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/client/Field-TS5CRYHE.js +2 -0
- package/dist/exports/client/Field-TS5CRYHE.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
- package/dist/exports/client/{chunk-SSMQFWCQ.js.map → chunk-3LRZDIIG.js.map} +4 -4
- package/dist/exports/client/{chunk-ESITTE3C.js → chunk-ZFGDYZDE.js} +2 -2
- package/dist/exports/client/{chunk-ESITTE3C.js.map → chunk-ZFGDYZDE.js.map} +2 -2
- package/dist/exports/client/componentInline-55HZXGUS.js +2 -0
- package/dist/exports/client/index.d.ts +1 -1
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +26 -26
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
- package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
- package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
- package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
- package/dist/features/blocks/client/component/index.d.ts +0 -6
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +133 -76
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
- package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
- package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
- package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +2 -2
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/server/index.js +2 -2
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
- package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
- package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
- package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
- package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
- package/dist/features/heading/constants.d.ts +2 -0
- package/dist/features/heading/constants.d.ts.map +1 -0
- package/dist/features/heading/constants.js +2 -0
- package/dist/features/heading/constants.js.map +1 -0
- package/dist/features/heading/server/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.js +5 -1
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/heading/server/validate.d.ts +6 -0
- package/dist/features/heading/server/validate.d.ts.map +1 -0
- package/dist/features/heading/server/validate.js +15 -0
- package/dist/features/heading/server/validate.js.map +1 -0
- package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
- package/dist/features/indent/client/IndentPlugin.js +122 -1
- package/dist/features/indent/client/IndentPlugin.js.map +1 -1
- package/dist/features/indent/server/i18n.d.ts.map +1 -1
- package/dist/features/indent/server/i18n.js +74 -37
- package/dist/features/indent/server/i18n.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +6 -3
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/server/index.js +2 -2
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
- package/dist/features/lists/checklist/server/index.js +5 -2
- package/dist/features/lists/checklist/server/index.js.map +1 -1
- package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/orderedList/server/index.js +5 -2
- package/dist/features/lists/orderedList/server/index.js.map +1 -1
- package/dist/features/lists/shared/constants.d.ts +2 -0
- package/dist/features/lists/shared/constants.d.ts.map +1 -0
- package/dist/features/lists/shared/constants.js +2 -0
- package/dist/features/lists/shared/constants.js.map +1 -0
- package/dist/features/lists/shared/validate.d.ts +5 -0
- package/dist/features/lists/shared/validate.d.ts.map +1 -0
- package/dist/features/lists/shared/validate.js +15 -0
- package/dist/features/lists/shared/validate.js.map +1 -0
- package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/unorderedList/server/index.js +5 -2
- package/dist/features/lists/unorderedList/server/index.js.map +1 -1
- package/dist/features/relationship/client/index.d.ts +2 -2
- package/dist/features/relationship/client/index.d.ts.map +1 -1
- package/dist/features/relationship/client/index.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.d.ts +2 -2
- package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +27 -31
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
- package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
- package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/relationship/server/index.d.ts +8 -1
- package/dist/features/relationship/server/index.d.ts.map +1 -1
- package/dist/features/relationship/server/index.js +28 -11
- package/dist/features/relationship/server/index.js.map +1 -1
- package/dist/features/relationship/server/schema.d.ts +2 -2
- package/dist/features/relationship/server/schema.d.ts.map +1 -1
- package/dist/features/relationship/server/schema.js +5 -10
- package/dist/features/relationship/server/schema.js.map +1 -1
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
- package/dist/features/table/client/index.d.ts.map +1 -0
- package/dist/features/table/client/index.js.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
- package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +41 -18
- package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
- package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
- package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
- package/dist/features/table/client/utils/debounce.js.map +1 -0
- package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
- package/dist/features/table/client/utils/useDebounce.js.map +1 -0
- package/dist/features/table/markdownTransformer.d.ts.map +1 -0
- package/dist/features/table/markdownTransformer.js.map +1 -0
- package/dist/features/table/server/index.d.ts +3 -0
- package/dist/features/table/server/index.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/server/index.js +4 -4
- package/dist/features/table/server/index.js.map +1 -0
- package/dist/features/table/server/schema.d.ts.map +1 -0
- package/dist/features/table/server/schema.js.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.css +77 -3
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +4 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -11
- package/dist/features/typesServer.d.ts +1 -1
- package/dist/features/typesServer.d.ts.map +1 -1
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/index.d.ts +3 -2
- package/dist/features/upload/client/index.d.ts.map +1 -1
- package/dist/features/upload/client/index.js.map +1 -1
- package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
- package/dist/features/upload/client/plugin/index.js +47 -52
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/upload/server/index.d.ts +6 -2
- package/dist/features/upload/server/index.d.ts.map +1 -1
- package/dist/features/upload/server/index.js +20 -16
- package/dist/features/upload/server/index.js.map +1 -1
- package/dist/features/upload/server/schema.d.ts +2 -2
- package/dist/features/upload/server/schema.d.ts.map +1 -1
- package/dist/features/upload/server/schema.js +4 -8
- package/dist/features/upload/server/schema.js.map +1 -1
- package/dist/features/upload/server/validate.d.ts +2 -2
- package/dist/features/upload/server/validate.d.ts.map +1 -1
- package/dist/features/upload/server/validate.js +3 -0
- package/dist/features/upload/server/validate.js.map +1 -1
- package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/listitem/index.js +2 -1
- package/dist/field/Diff/converters/listitem/index.js.map +1 -1
- package/dist/field/Diff/index.d.ts +3 -2
- package/dist/field/Diff/index.d.ts.map +1 -1
- package/dist/field/Diff/index.js +1 -0
- package/dist/field/Diff/index.js.map +1 -1
- package/dist/field/RenderLexical/index.d.ts +3 -1
- package/dist/field/RenderLexical/index.d.ts.map +1 -1
- package/dist/field/RenderLexical/index.js +23 -23
- package/dist/field/RenderLexical/index.js.map +1 -1
- package/dist/field/ViewSelector.d.ts.map +1 -1
- package/dist/field/ViewSelector.js +1 -0
- package/dist/field/ViewSelector.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.css +10 -10
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +68 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.css +20 -9
- package/dist/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/lexical/LexicalEditor.js +61 -64
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/config/server/loader.d.ts +1 -1
- package/dist/lexical/config/server/loader.d.ts.map +1 -1
- package/dist/lexical/config/server/loader.js +2 -2
- package/dist/lexical/config/server/loader.js.map +1 -1
- package/dist/lexical/config/server/sanitize.d.ts +1 -1
- package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/server/sanitize.js +2 -2
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -24
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +1 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
- package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
- package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
- package/dist/lexical/ui/ContentEditable.d.ts +2 -1
- package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +9 -6
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H3/index.js +13 -6
- package/dist/lexical/ui/icons/H3/index.js.map +1 -1
- package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H4/index.js +13 -6
- package/dist/lexical/ui/icons/H4/index.js.map +1 -1
- package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H5/index.js +13 -6
- package/dist/lexical/ui/icons/H5/index.js.map +1 -1
- package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H6/index.js +13 -6
- package/dist/lexical/ui/icons/H6/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/nodeTypes.d.ts +1 -1
- package/dist/types/nodeTypes.d.ts.map +1 -1
- package/dist/types/nodeTypes.js.map +1 -1
- package/dist/utilities/createServerFeature.d.ts +1 -1
- package/dist/utilities/createServerFeature.d.ts.map +1 -1
- package/dist/utilities/createServerFeature.js +2 -2
- package/dist/utilities/createServerFeature.js.map +1 -1
- package/dist/utilities/editorConfigFactory.d.ts +6 -6
- package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
- package/dist/utilities/editorConfigFactory.js +9 -9
- package/dist/utilities/editorConfigFactory.js.map +1 -1
- package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
- package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
- package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
- package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/index.js +6 -3
- package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
- package/package.json +22 -22
- package/dist/dependencyChecker.spec.js +0 -16
- package/dist/dependencyChecker.spec.js.map +0 -1
- package/dist/exports/client/Field-IZKDIUJY.js +0 -2
- package/dist/exports/client/Field-IZKDIUJY.js.map +0 -7
- package/dist/exports/client/chunk-SSMQFWCQ.js +0 -2
- package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
- package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
- package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
- package/dist/features/experimental_table/client/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
- package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
- package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
- package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
- package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
- package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
- package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
- package/dist/features/experimental_table/server/index.d.ts +0 -3
- package/dist/features/experimental_table/server/index.d.ts.map +0 -1
- package/dist/features/experimental_table/server/index.js.map +0 -1
- package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
- package/dist/features/experimental_table/server/schema.js.map +0 -1
- package/dist/features/link/markdownTransformer.spec.js +0 -195
- package/dist/features/link/markdownTransformer.spec.js.map +0 -1
- package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
- package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
- package/dist/lexical/utils/url.spec.js +0 -114
- package/dist/lexical/utils/url.spec.js.map +0 -1
- package/dist/utilities/jsx/jsx.spec.js +0 -178
- package/dist/utilities/jsx/jsx.spec.js.map +0 -1
- /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-55HZXGUS.js.map} +0 -0
- /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
- /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
- /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
|
@@ -4,6 +4,7 @@ import { createServerFeature } from '../../../../utilities/createServerFeature.j
|
|
|
4
4
|
import { createNode } from '../../../typeUtilities.js';
|
|
5
5
|
import { listItemNodeJSONSchema, listNodeJSONSchema } from '../../shared/schema.js';
|
|
6
6
|
import { shouldRegisterListBaseNodes } from '../../shared/shouldRegisterListBaseNodes.js';
|
|
7
|
+
import { listItemValidation, listValidation } from '../../shared/validate.js';
|
|
7
8
|
import { i18n } from './i18n.js';
|
|
8
9
|
export const OrderedListFeature = createServerFeature({
|
|
9
10
|
feature: ({
|
|
@@ -15,10 +16,12 @@ export const OrderedListFeature = createServerFeature({
|
|
|
15
16
|
markdownTransformers: [ORDERED_LIST],
|
|
16
17
|
nodes: shouldRegisterListBaseNodes('ordered', featureProviderMap) ? [createNode({
|
|
17
18
|
jsonSchema: listNodeJSONSchema,
|
|
18
|
-
node: ListNode
|
|
19
|
+
node: ListNode,
|
|
20
|
+
validations: [listValidation]
|
|
19
21
|
}), createNode({
|
|
20
22
|
jsonSchema: listItemNodeJSONSchema,
|
|
21
|
-
node: ListItemNode
|
|
23
|
+
node: ListItemNode,
|
|
24
|
+
validations: [listItemValidation]
|
|
22
25
|
})] : []
|
|
23
26
|
};
|
|
24
27
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ListItemNode","ListNode","ORDERED_LIST","createServerFeature","createNode","listItemNodeJSONSchema","listNodeJSONSchema","shouldRegisterListBaseNodes","i18n","OrderedListFeature","feature","featureProviderMap","ClientFeature","markdownTransformers","nodes","jsonSchema","node","key"],"sources":["../../../../../src/features/lists/orderedList/server/index.ts"],"sourcesContent":["import { ListItemNode, ListNode } from '@lexical/list'\nimport { ORDERED_LIST } from '@lexical/markdown'\n\nimport { createServerFeature } from '../../../../utilities/createServerFeature.js'\nimport { createNode } from '../../../typeUtilities.js'\nimport { listItemNodeJSONSchema, listNodeJSONSchema } from '../../shared/schema.js'\nimport { shouldRegisterListBaseNodes } from '../../shared/shouldRegisterListBaseNodes.js'\nimport { i18n } from './i18n.js'\n\nexport const OrderedListFeature = createServerFeature({\n feature: ({ featureProviderMap }) => {\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#OrderedListFeatureClient',\n i18n,\n markdownTransformers: [ORDERED_LIST],\n nodes: shouldRegisterListBaseNodes('ordered', featureProviderMap)\n ? [\n createNode({\n jsonSchema: listNodeJSONSchema,\n node: ListNode,\n }),\n createNode({\n jsonSchema: listItemNodeJSONSchema,\n node: ListItemNode,\n }),\n ]\n : [],\n }\n },\n key: 'orderedList',\n})\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,QAAQ,QAAQ;AACvC,SAASC,YAAY,QAAQ;AAE7B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,sBAAsB,EAAEC,kBAAkB,QAAQ;AAC3D,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,IAAI,QAAQ;AAErB,OAAO,MAAMC,kBAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["ListItemNode","ListNode","ORDERED_LIST","createServerFeature","createNode","listItemNodeJSONSchema","listNodeJSONSchema","shouldRegisterListBaseNodes","listItemValidation","listValidation","i18n","OrderedListFeature","feature","featureProviderMap","ClientFeature","markdownTransformers","nodes","jsonSchema","node","validations","key"],"sources":["../../../../../src/features/lists/orderedList/server/index.ts"],"sourcesContent":["import { ListItemNode, ListNode } from '@lexical/list'\nimport { ORDERED_LIST } from '@lexical/markdown'\n\nimport { createServerFeature } from '../../../../utilities/createServerFeature.js'\nimport { createNode } from '../../../typeUtilities.js'\nimport { listItemNodeJSONSchema, listNodeJSONSchema } from '../../shared/schema.js'\nimport { shouldRegisterListBaseNodes } from '../../shared/shouldRegisterListBaseNodes.js'\nimport { listItemValidation, listValidation } from '../../shared/validate.js'\nimport { i18n } from './i18n.js'\n\nexport const OrderedListFeature = createServerFeature({\n feature: ({ featureProviderMap }) => {\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#OrderedListFeatureClient',\n i18n,\n markdownTransformers: [ORDERED_LIST],\n nodes: shouldRegisterListBaseNodes('ordered', featureProviderMap)\n ? [\n createNode({\n jsonSchema: listNodeJSONSchema,\n node: ListNode,\n validations: [listValidation],\n }),\n createNode({\n jsonSchema: listItemNodeJSONSchema,\n node: ListItemNode,\n validations: [listItemValidation],\n }),\n ]\n : [],\n }\n },\n key: 'orderedList',\n})\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,QAAQ,QAAQ;AACvC,SAASC,YAAY,QAAQ;AAE7B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,sBAAsB,EAAEC,kBAAkB,QAAQ;AAC3D,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,kBAAkB,EAAEC,cAAc,QAAQ;AACnD,SAASC,IAAI,QAAQ;AAErB,OAAO,MAAMC,kBAAA,GAAqBR,mBAAA,CAAoB;EACpDS,OAAA,EAASA,CAAC;IAAEC;EAAkB,CAAE;IAC9B,OAAO;MACLC,aAAA,EAAe;MACfJ,IAAA;MACAK,oBAAA,EAAsB,CAACb,YAAA,CAAa;MACpCc,KAAA,EAAOT,2BAAA,CAA4B,WAAWM,kBAAA,IAC1C,CACET,UAAA,CAAW;QACTa,UAAA,EAAYX,kBAAA;QACZY,IAAA,EAAMjB,QAAA;QACNkB,WAAA,EAAa,CAACV,cAAA;MAChB,IACAL,UAAA,CAAW;QACTa,UAAA,EAAYZ,sBAAA;QACZa,IAAA,EAAMlB,YAAA;QACNmB,WAAA,EAAa,CAACX,kBAAA;MAChB,GACD,GACD;IACN;EACF;EACAY,GAAA,EAAK;AACP","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/lists/shared/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,aAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","names":["ALLOWED_LIST_TAGS","Set"],"sources":["../../../../src/features/lists/shared/constants.ts"],"sourcesContent":["export const ALLOWED_LIST_TAGS = new Set(['ol', 'ul'])\n"],"mappings":"AAAA,OAAO,MAAMA,iBAAA,GAAoB,IAAIC,GAAA,CAAI,CAAC,MAAM,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SerializedListItemNode, SerializedListNode } from '@lexical/list';
|
|
2
|
+
import type { NodeValidation } from '../../typesServer.js';
|
|
3
|
+
export declare const listItemValidation: NodeValidation<SerializedListItemNode>;
|
|
4
|
+
export declare const listValidation: NodeValidation<SerializedListNode>;
|
|
5
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/features/lists/shared/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAI1D,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,sBAAsB,CAMrE,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,kBAAkB,CAE7D,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ALLOWED_LIST_TAGS } from './constants.js';
|
|
2
|
+
export const listItemValidation = ({
|
|
3
|
+
node
|
|
4
|
+
}) => {
|
|
5
|
+
if (typeof node.value !== 'number' || !Number.isFinite(node.value)) {
|
|
6
|
+
return 'List item value must be a finite number.';
|
|
7
|
+
}
|
|
8
|
+
return true;
|
|
9
|
+
};
|
|
10
|
+
export const listValidation = ({
|
|
11
|
+
node
|
|
12
|
+
}) => {
|
|
13
|
+
return ALLOWED_LIST_TAGS.has(node.tag) ? true : 'List tag must be one of ol, ul.';
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","names":["ALLOWED_LIST_TAGS","listItemValidation","node","value","Number","isFinite","listValidation","has","tag"],"sources":["../../../../src/features/lists/shared/validate.ts"],"sourcesContent":["import type { SerializedListItemNode, SerializedListNode } from '@lexical/list'\n\nimport type { NodeValidation } from '../../typesServer.js'\n\nimport { ALLOWED_LIST_TAGS } from './constants.js'\n\nexport const listItemValidation: NodeValidation<SerializedListItemNode> = ({ node }) => {\n if (typeof node.value !== 'number' || !Number.isFinite(node.value)) {\n return 'List item value must be a finite number.'\n }\n\n return true\n}\n\nexport const listValidation: NodeValidation<SerializedListNode> = ({ node }) => {\n return ALLOWED_LIST_TAGS.has(node.tag) ? true : 'List tag must be one of ol, ul.'\n}\n"],"mappings":"AAIA,SAASA,iBAAiB,QAAQ;AAElC,OAAO,MAAMC,kBAAA,GAA6DA,CAAC;EAAEC;AAAI,CAAE;EACjF,IAAI,OAAOA,IAAA,CAAKC,KAAK,KAAK,YAAY,CAACC,MAAA,CAAOC,QAAQ,CAACH,IAAA,CAAKC,KAAK,GAAG;IAClE,OAAO;EACT;EAEA,OAAO;AACT;AAEA,OAAO,MAAMG,cAAA,GAAqDA,CAAC;EAAEJ;AAAI,CAAE;EACzE,OAAOF,iBAAA,CAAkBO,GAAG,CAACL,IAAA,CAAKM,GAAG,IAAI,OAAO;AAClD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/lists/unorderedList/server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/lists/unorderedList/server/index.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,oBAAoB,kGAmB/B,CAAA"}
|
|
@@ -3,6 +3,7 @@ import { UNORDERED_LIST } from '@lexical/markdown';
|
|
|
3
3
|
import { createServerFeature } from '../../../../utilities/createServerFeature.js';
|
|
4
4
|
import { createNode } from '../../../typeUtilities.js';
|
|
5
5
|
import { listItemNodeJSONSchema, listNodeJSONSchema } from '../../shared/schema.js';
|
|
6
|
+
import { listItemValidation, listValidation } from '../../shared/validate.js';
|
|
6
7
|
import { i18n } from './i18n.js';
|
|
7
8
|
export const UnorderedListFeature = createServerFeature({
|
|
8
9
|
feature: {
|
|
@@ -11,10 +12,12 @@ export const UnorderedListFeature = createServerFeature({
|
|
|
11
12
|
markdownTransformers: [UNORDERED_LIST],
|
|
12
13
|
nodes: [createNode({
|
|
13
14
|
jsonSchema: listNodeJSONSchema,
|
|
14
|
-
node: ListNode
|
|
15
|
+
node: ListNode,
|
|
16
|
+
validations: [listValidation]
|
|
15
17
|
}), createNode({
|
|
16
18
|
jsonSchema: listItemNodeJSONSchema,
|
|
17
|
-
node: ListItemNode
|
|
19
|
+
node: ListItemNode,
|
|
20
|
+
validations: [listItemValidation]
|
|
18
21
|
})]
|
|
19
22
|
},
|
|
20
23
|
key: 'unorderedList'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ListItemNode","ListNode","UNORDERED_LIST","createServerFeature","createNode","listItemNodeJSONSchema","listNodeJSONSchema","i18n","UnorderedListFeature","feature","ClientFeature","markdownTransformers","nodes","jsonSchema","node","key"],"sources":["../../../../../src/features/lists/unorderedList/server/index.ts"],"sourcesContent":["import { ListItemNode, ListNode } from '@lexical/list'\nimport { UNORDERED_LIST } from '@lexical/markdown'\n\nimport { createServerFeature } from '../../../../utilities/createServerFeature.js'\nimport { createNode } from '../../../typeUtilities.js'\nimport { listItemNodeJSONSchema, listNodeJSONSchema } from '../../shared/schema.js'\nimport { i18n } from './i18n.js'\n\nexport const UnorderedListFeature = createServerFeature({\n feature: {\n ClientFeature: '@payloadcms/richtext-lexical/client#UnorderedListFeatureClient',\n i18n,\n markdownTransformers: [UNORDERED_LIST],\n nodes: [\n createNode({\n jsonSchema: listNodeJSONSchema,\n node: ListNode,\n }),\n createNode({\n jsonSchema: listItemNodeJSONSchema,\n node: ListItemNode,\n }),\n ],\n },\n key: 'unorderedList',\n})\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,QAAQ,QAAQ;AACvC,SAASC,cAAc,QAAQ;AAE/B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,sBAAsB,EAAEC,kBAAkB,QAAQ;AAC3D,SAASC,IAAI,QAAQ;AAErB,OAAO,MAAMC,oBAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["ListItemNode","ListNode","UNORDERED_LIST","createServerFeature","createNode","listItemNodeJSONSchema","listNodeJSONSchema","listItemValidation","listValidation","i18n","UnorderedListFeature","feature","ClientFeature","markdownTransformers","nodes","jsonSchema","node","validations","key"],"sources":["../../../../../src/features/lists/unorderedList/server/index.ts"],"sourcesContent":["import { ListItemNode, ListNode } from '@lexical/list'\nimport { UNORDERED_LIST } from '@lexical/markdown'\n\nimport { createServerFeature } from '../../../../utilities/createServerFeature.js'\nimport { createNode } from '../../../typeUtilities.js'\nimport { listItemNodeJSONSchema, listNodeJSONSchema } from '../../shared/schema.js'\nimport { listItemValidation, listValidation } from '../../shared/validate.js'\nimport { i18n } from './i18n.js'\n\nexport const UnorderedListFeature = createServerFeature({\n feature: {\n ClientFeature: '@payloadcms/richtext-lexical/client#UnorderedListFeatureClient',\n i18n,\n markdownTransformers: [UNORDERED_LIST],\n nodes: [\n createNode({\n jsonSchema: listNodeJSONSchema,\n node: ListNode,\n validations: [listValidation],\n }),\n createNode({\n jsonSchema: listItemNodeJSONSchema,\n node: ListItemNode,\n validations: [listItemValidation],\n }),\n ],\n },\n key: 'unorderedList',\n})\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,QAAQ,QAAQ;AACvC,SAASC,cAAc,QAAQ;AAE/B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,sBAAsB,EAAEC,kBAAkB,QAAQ;AAC3D,SAASC,kBAAkB,EAAEC,cAAc,QAAQ;AACnD,SAASC,IAAI,QAAQ;AAErB,OAAO,MAAMC,oBAAA,GAAuBP,mBAAA,CAAoB;EACtDQ,OAAA,EAAS;IACPC,aAAA,EAAe;IACfH,IAAA;IACAI,oBAAA,EAAsB,CAACX,cAAA,CAAe;IACtCY,KAAA,EAAO,CACLV,UAAA,CAAW;MACTW,UAAA,EAAYT,kBAAA;MACZU,IAAA,EAAMf,QAAA;MACNgB,WAAA,EAAa,CAACT,cAAA;IAChB,IACAJ,UAAA,CAAW;MACTW,UAAA,EAAYV,sBAAA;MACZW,IAAA,EAAMhB,YAAA;MACNiB,WAAA,EAAa,CAACV,kBAAA;IAChB;EAEJ;EACAW,GAAA,EAAK;AACP","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const RelationshipFeatureClient: import("../../typesClient.js").FeatureProviderProviderClient<
|
|
1
|
+
import type { RelationshipFeatureClientProps } from '../server/index.js';
|
|
2
|
+
export declare const RelationshipFeatureClient: import("../../typesClient.js").FeatureProviderProviderClient<RelationshipFeatureClientProps, RelationshipFeatureClientProps>;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/client/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/client/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAA;AAUxE,eAAO,MAAM,yBAAyB,8HAuDpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["$isNodeSelection","RelationshipIcon","createClientFeature","slashMenuBasicGroupWithItems","toolbarAddDropdownGroupWithItems","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","$isRelationshipNode","RelationshipNode","RelationshipPlugin","RelationshipFeatureClient","nodes","plugins","Component","position","slashMenu","groups","Icon","key","keywords","label","i18n","t","onSelect","editor","dispatchCommand","replace","toolbarFixed","ChildComponent","isActive","selection","getNodes","length","firstNode"],"sources":["../../../../src/features/relationship/client/index.tsx"],"sourcesContent":["'use client'\n\nimport { $isNodeSelection } from 'lexical'\n\nimport type {
|
|
1
|
+
{"version":3,"file":"index.js","names":["$isNodeSelection","RelationshipIcon","createClientFeature","slashMenuBasicGroupWithItems","toolbarAddDropdownGroupWithItems","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","$isRelationshipNode","RelationshipNode","RelationshipPlugin","RelationshipFeatureClient","nodes","plugins","Component","position","slashMenu","groups","Icon","key","keywords","label","i18n","t","onSelect","editor","dispatchCommand","replace","toolbarFixed","ChildComponent","isActive","selection","getNodes","length","firstNode"],"sources":["../../../../src/features/relationship/client/index.tsx"],"sourcesContent":["'use client'\n\nimport { $isNodeSelection } from 'lexical'\n\nimport type { RelationshipFeatureClientProps } from '../server/index.js'\n\nimport { RelationshipIcon } from '../../../lexical/ui/icons/Relationship/index.js'\nimport { createClientFeature } from '../../../utilities/createClientFeature.js'\nimport { slashMenuBasicGroupWithItems } from '../../shared/slashMenu/basicGroup.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\nexport const RelationshipFeatureClient = createClientFeature<RelationshipFeatureClientProps>({\n nodes: [RelationshipNode],\n plugins: [\n {\n Component: RelationshipPlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n groups: [\n slashMenuBasicGroupWithItems([\n {\n Icon: RelationshipIcon,\n key: 'relationship',\n keywords: ['relationship', 'relation', 'rel'],\n label: ({ i18n }) => {\n return i18n.t('lexical:relationship:label')\n },\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 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: ({ i18n }) => {\n return i18n.t('lexical:relationship:label')\n },\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"],"mappings":"AAAA;;AAEA,SAASA,gBAAgB,QAAQ;AAIjC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,gCAAgC,QAAQ;AACjD,SAASC,uCAAuC,QAAQ;AACxD,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ;AACtD,SAASC,kBAAkB,QAAQ;AAEnC,OAAO,MAAMC,yBAAA,GAA4BP,mBAAA,CAAoD;EAC3FQ,KAAA,EAAO,CAACH,gBAAA,CAAiB;EACzBI,OAAA,EAAS,CACP;IACEC,SAAA,EAAWJ,kBAAA;IACXK,QAAA,EAAU;EACZ,EACD;EACDC,SAAA,EAAW;IACTC,MAAA,EAAQ,CACNZ,4BAAA,CAA6B,CAC3B;MACEa,IAAA,EAAMf,gBAAA;MACNgB,GAAA,EAAK;MACLC,QAAA,EAAU,CAAC,gBAAgB,YAAY,MAAM;MAC7CC,KAAA,EAAOA,CAAC;QAAEC;MAAI,CAAE;QACd,OAAOA,IAAA,CAAKC,CAAC,CAAC;MAChB;MACAC,QAAA,EAAUA,CAAC;QAAEC;MAAM,CAAE;QACnB;QACAA,MAAA,CAAOC,eAAe,CAACnB,uCAAA,EAAyC;UAC9DoB,OAAA,EAAS;QACX;MACF;IACF,EACD;EAEL;EACAC,YAAA,EAAc;IACZX,MAAA,EAAQ,CACNX,gCAAA,CAAiC,CAC/B;MACEuB,cAAA,EAAgB1B,gBAAA;MAChB2B,QAAA,EAAUA,CAAC;QAAEC;MAAS,CAAE;QACtB,IAAI,CAAC7B,gBAAA,CAAiB6B,SAAA,KAAc,CAACA,SAAA,CAAUC,QAAQ,GAAGC,MAAM,EAAE;UAChE,OAAO;QACT;QAEA,MAAMC,SAAA,GAAYH,SAAA,CAAUC,QAAQ,EAAE,CAAC,EAAE;QACzC,OAAOxB,mBAAA,CAAoB0B,SAAA;MAC7B;MACAf,GAAA,EAAK;MACLE,KAAA,EAAOA,CAAC;QAAEC;MAAI,CAAE;QACd,OAAOA,IAAA,CAAKC,CAAC,CAAC;MAChB;MACAC,QAAA,EAAUA,CAAC;QAAEC;MAAM,CAAE;QACnB;QACAA,MAAA,CAAOC,eAAe,CAACnB,uCAAA,EAAyC;UAC9DoB,OAAA,EAAS;QACX;MACF;IACF,EACD;EAEL;AACF","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LexicalCommand } from 'lexical';
|
|
2
2
|
import type { PluginComponent } from '../../../typesClient.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { RelationshipFeatureClientProps } from '../../server/index.js';
|
|
4
4
|
import type { RelationshipData } from '../../server/schema.js';
|
|
5
5
|
export declare const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData>;
|
|
6
|
-
export declare const RelationshipPlugin: PluginComponent<
|
|
6
|
+
export declare const RelationshipPlugin: PluginComponent<RelationshipFeatureClientProps>;
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/relationship/client/plugins/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAc7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/relationship/client/plugins/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAc7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAA;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAM9D,eAAO,MAAM,2BAA2B,EAAE,cAAc,CAAC,gBAAgB,CAExE,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,8BAA8B,CAwC9E,CAAA"}
|
|
@@ -11,57 +11,53 @@ import { $createRelationshipNode, RelationshipNode } from '../nodes/Relationship
|
|
|
11
11
|
import { useEnabledRelationships } from '../utils/useEnabledRelationships.js';
|
|
12
12
|
export const INSERT_RELATIONSHIP_COMMAND = createCommand('INSERT_RELATIONSHIP_COMMAND');
|
|
13
13
|
export const RelationshipPlugin = t0 => {
|
|
14
|
-
const $ = _c(
|
|
14
|
+
const $ = _c(7);
|
|
15
15
|
const {
|
|
16
16
|
clientProps
|
|
17
17
|
} = t0;
|
|
18
18
|
const [editor] = useLexicalComposerContext();
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
t3 = {
|
|
24
|
-
collectionSlugsBlacklist: t1,
|
|
25
|
-
collectionSlugsWhitelist: t2
|
|
19
|
+
let t1;
|
|
20
|
+
if ($[0] !== clientProps.enabledCollectionSlugs) {
|
|
21
|
+
t1 = {
|
|
22
|
+
enabledCollectionSlugs: clientProps.enabledCollectionSlugs
|
|
26
23
|
};
|
|
27
|
-
$[0] =
|
|
28
|
-
$[1] =
|
|
29
|
-
$[2] = t3;
|
|
24
|
+
$[0] = clientProps.enabledCollectionSlugs;
|
|
25
|
+
$[1] = t1;
|
|
30
26
|
} else {
|
|
31
|
-
|
|
27
|
+
t1 = $[1];
|
|
32
28
|
}
|
|
33
29
|
const {
|
|
34
30
|
enabledCollectionSlugs
|
|
35
|
-
} = useEnabledRelationships(
|
|
36
|
-
let
|
|
37
|
-
let
|
|
38
|
-
if ($[
|
|
39
|
-
|
|
31
|
+
} = useEnabledRelationships(t1);
|
|
32
|
+
let t2;
|
|
33
|
+
let t3;
|
|
34
|
+
if ($[2] !== editor) {
|
|
35
|
+
t2 = () => {
|
|
40
36
|
if (!editor.hasNodes([RelationshipNode])) {
|
|
41
37
|
throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");
|
|
42
38
|
}
|
|
43
39
|
return editor.registerCommand(INSERT_RELATIONSHIP_COMMAND, _temp, COMMAND_PRIORITY_EDITOR);
|
|
44
40
|
};
|
|
45
|
-
|
|
46
|
-
$[
|
|
47
|
-
$[
|
|
48
|
-
$[
|
|
41
|
+
t3 = [editor];
|
|
42
|
+
$[2] = editor;
|
|
43
|
+
$[3] = t2;
|
|
44
|
+
$[4] = t3;
|
|
49
45
|
} else {
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
t2 = $[3];
|
|
47
|
+
t3 = $[4];
|
|
52
48
|
}
|
|
53
|
-
useEffect(
|
|
54
|
-
let
|
|
55
|
-
if ($[
|
|
56
|
-
|
|
49
|
+
useEffect(t2, t3);
|
|
50
|
+
let t4;
|
|
51
|
+
if ($[5] !== enabledCollectionSlugs) {
|
|
52
|
+
t4 = _jsx(RelationshipDrawer, {
|
|
57
53
|
enabledCollectionSlugs
|
|
58
54
|
});
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
55
|
+
$[5] = enabledCollectionSlugs;
|
|
56
|
+
$[6] = t4;
|
|
61
57
|
} else {
|
|
62
|
-
|
|
58
|
+
t4 = $[6];
|
|
63
59
|
}
|
|
64
|
-
return
|
|
60
|
+
return t4;
|
|
65
61
|
};
|
|
66
62
|
function _temp(payload) {
|
|
67
63
|
const selection = $getSelection() || $getPreviousSelection();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$insertNodeToNearestRoot","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","useEffect","RelationshipDrawer","$createRelationshipNode","RelationshipNode","useEnabledRelationships","INSERT_RELATIONSHIP_COMMAND","RelationshipPlugin","t0","$","clientProps","editor","t1","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$insertNodeToNearestRoot","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","useEffect","RelationshipDrawer","$createRelationshipNode","RelationshipNode","useEnabledRelationships","INSERT_RELATIONSHIP_COMMAND","RelationshipPlugin","t0","$","clientProps","editor","t1","enabledCollectionSlugs","t2","t3","hasNodes","Error","registerCommand","_temp","t4","_jsx","payload","selection","relationshipNode","focus","focusNode","getNode","__first","remove"],"sources":["../../../../../src/features/relationship/client/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 {\n $getPreviousSelection,\n $getSelection,\n $isParagraphNode,\n $isRangeSelection,\n COMMAND_PRIORITY_EDITOR,\n createCommand,\n} from 'lexical'\nimport { useEffect } from 'react'\n\nimport type { PluginComponent } from '../../../typesClient.js'\nimport type { RelationshipFeatureClientProps } from '../../server/index.js'\nimport type { RelationshipData } from '../../server/schema.js'\n\nimport { RelationshipDrawer } from '../drawer/index.js'\nimport { $createRelationshipNode, RelationshipNode } from '../nodes/RelationshipNode.js'\nimport { useEnabledRelationships } from '../utils/useEnabledRelationships.js'\n\nexport const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData> = createCommand(\n 'INSERT_RELATIONSHIP_COMMAND',\n)\n\nexport const RelationshipPlugin: PluginComponent<RelationshipFeatureClientProps> = ({\n clientProps,\n}) => {\n const [editor] = useLexicalComposerContext()\n\n const { enabledCollectionSlugs } = useEnabledRelationships({\n enabledCollectionSlugs: clientProps.enabledCollectionSlugs,\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 selection = $getSelection() || $getPreviousSelection()\n\n if ($isRangeSelection(selection)) {\n const relationshipNode = $createRelationshipNode(payload)\n // we need to get the focus node before inserting the block node, as $insertNodeToNearestRoot can change the focus node\n const { focus } = selection\n const focusNode = focus.getNode()\n // Insert relationship node BEFORE potentially removing focusNode, as $insertNodeToNearestRoot errors if the focusNode doesn't exist\n $insertNodeToNearestRoot(relationshipNode)\n\n // Delete the node it it's an empty paragraph\n if ($isParagraphNode(focusNode) && !focusNode.__first) {\n focusNode.remove()\n }\n }\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return <RelationshipDrawer enabledCollectionSlugs={enabledCollectionSlugs} />\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,wBAAwB,QAAQ;AACzC,SACEC,qBAAqB,EACrBC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,EACjBC,uBAAuB,EACvBC,aAAa,QACR;AACP,SAASC,SAAS,QAAQ;AAM1B,SAASC,kBAAkB,QAAQ;AACnC,SAASC,uBAAuB,EAAEC,gBAAgB,QAAQ;AAC1D,SAASC,uBAAuB,QAAQ;AAExC,OAAO,MAAMC,2BAAA,GAAgEN,aAAA,CAC3E;AAGF,OAAO,MAAMO,kBAAA,GAAsEC,EAAA;EAAA,MAAAC,CAAA,GAAAjB,EAAA;EAAC;IAAAkB;EAAA,IAAAF,EAEnF;EACC,OAAAG,MAAA,IAAiBlB,yBAAA;EAAA,IAAAmB,EAAA;EAAA,IAAAH,CAAA,QAAAC,WAAA,CAAAG,sBAAA;IAE0CD,EAAA;MAAAC,sBAAA,EACjCH,WAAA,CAAAG;IAAA;IAC1BJ,CAAA,MAAAC,WAAA,CAAAG,sBAAA;IAAAJ,CAAA,MAAAG,EAAA;EAAA;IAAAA,EAAA,GAAAH,CAAA;EAAA;EAFA;IAAAI;EAAA,IAAmCR,uBAAA,CAAwBO,EAE3D;EAAA,IAAAE,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAN,CAAA,QAAAE,MAAA;IAEUG,EAAA,GAAAA,CAAA;MAAA,KACHH,MAAA,CAAAK,QAAA,EAAAZ,gBAAA,CAAkC;QAAA,UAAAa,KAAA,CACrB;MAAA;MAAA,OAGXN,MAAA,CAAAO,eAAA,CAAAZ,2BAAA,EAAAa,KAAA,EAAApB,uBAqBL;IAAA;IAEDgB,EAAA,IAACJ,MAAA;IAAOF,CAAA,MAAAE,MAAA;IAAAF,CAAA,MAAAK,EAAA;IAAAL,CAAA,MAAAM,EAAA;EAAA;IAAAD,EAAA,GAAAL,CAAA;IAAAM,EAAA,GAAAN,CAAA;EAAA;EA5BXR,SAAA,CAAUa,EA4BV,EAAGC,EAAQ;EAAA,IAAAK,EAAA;EAAA,IAAAX,CAAA,QAAAI,sBAAA;IAEJO,EAAA,GAAAC,IAAA,CAAAnB,kBAAA;MAAAW;IAAA,C;;;;;;SAAAO,E;CACT;AAxCmF,SAAAD,MAAAG,OAAA;EAiB3E,MAAAC,SAAA,GAAkB3B,aAAA,MAAmBD,qBAAA;EAAA,IAEjCG,iBAAA,CAAkByB,SAAA;IACpB,MAAAC,gBAAA,GAAyBrB,uBAAA,CAAwBmB,OAAA;IAEjD;MAAAG;IAAA,IAAkBF,SAAA;IAClB,MAAAG,SAAA,GAAkBD,KAAA,CAAAE,OAAA,CAAa;IAE/BjC,wBAAA,CAAyB8B,gBAAA;IAAA,IAGrB3B,gBAAA,CAAiB6B,SAAA,MAAeA,SAAA,CAAAE,OAAiB;MACnDF,SAAA,CAAAG,MAAA,CAAgB;IAAA;EAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type { ClientCollectionConfig, CollectionSlug } from 'payload';
|
|
2
2
|
type UseEnabledRelationshipsOptions = {
|
|
3
|
-
|
|
4
|
-
collectionSlugsWhitelist?: string[];
|
|
5
|
-
uploads?: boolean;
|
|
3
|
+
enabledCollectionSlugs: CollectionSlug[];
|
|
6
4
|
};
|
|
7
5
|
type UseEnabledRelationshipsResult = {
|
|
8
6
|
enabledCollections: ClientCollectionConfig[];
|
|
9
7
|
enabledCollectionSlugs: CollectionSlug[];
|
|
10
8
|
};
|
|
11
|
-
export declare const useEnabledRelationships: (
|
|
9
|
+
export declare const useEnabledRelationships: ({ enabledCollectionSlugs, }: UseEnabledRelationshipsOptions) => UseEnabledRelationshipsResult;
|
|
12
10
|
export {};
|
|
13
11
|
//# sourceMappingURL=useEnabledRelationships.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEnabledRelationships.d.ts","sourceRoot":"","sources":["../../../../../src/features/relationship/client/utils/useEnabledRelationships.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"useEnabledRelationships.d.ts","sourceRoot":"","sources":["../../../../../src/features/relationship/client/utils/useEnabledRelationships.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAKrE,KAAK,8BAA8B,GAAG;IACpC,sBAAsB,EAAE,cAAc,EAAE,CAAA;CACzC,CAAA;AAED,KAAK,6BAA6B,GAAG;IACnC,kBAAkB,EAAE,sBAAsB,EAAE,CAAA;IAC5C,sBAAsB,EAAE,cAAc,EAAE,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,uBAAuB,gCAEjC,8BAA8B,KAAG,6BAiBnC,CAAA"}
|
|
@@ -1,33 +1,66 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { useConfig, useEntityVisibility } from '@payloadcms/ui';
|
|
4
5
|
import * as React from 'react';
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
export const useEnabledRelationships = t0 => {
|
|
7
|
+
const $ = _c(11);
|
|
7
8
|
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
uploads = false
|
|
11
|
-
} = options || {};
|
|
9
|
+
enabledCollectionSlugs
|
|
10
|
+
} = t0;
|
|
12
11
|
const {
|
|
13
|
-
config:
|
|
14
|
-
collections
|
|
15
|
-
}
|
|
12
|
+
config: t1
|
|
16
13
|
} = useConfig();
|
|
14
|
+
const {
|
|
15
|
+
collections
|
|
16
|
+
} = t1;
|
|
17
17
|
const {
|
|
18
18
|
visibleEntities
|
|
19
19
|
} = useEntityVisibility();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
let t2;
|
|
21
|
+
let t3;
|
|
22
|
+
if ($[0] !== collections || $[1] !== enabledCollectionSlugs || $[2] !== visibleEntities) {
|
|
23
|
+
let t4;
|
|
24
|
+
if ($[5] !== enabledCollectionSlugs || $[6] !== visibleEntities) {
|
|
25
|
+
t4 = t5 => {
|
|
26
|
+
const {
|
|
27
|
+
slug
|
|
28
|
+
} = t5;
|
|
29
|
+
return enabledCollectionSlugs.includes(slug) && (!visibleEntities?.collections || visibleEntities.collections.includes(slug));
|
|
30
|
+
};
|
|
31
|
+
$[5] = enabledCollectionSlugs;
|
|
32
|
+
$[6] = visibleEntities;
|
|
33
|
+
$[7] = t4;
|
|
34
|
+
} else {
|
|
35
|
+
t4 = $[7];
|
|
36
|
+
}
|
|
37
|
+
const enabledCollections = collections.filter(t4);
|
|
38
|
+
t2 = enabledCollections;
|
|
39
|
+
t3 = enabledCollections.map(_temp);
|
|
40
|
+
$[0] = collections;
|
|
41
|
+
$[1] = enabledCollectionSlugs;
|
|
42
|
+
$[2] = visibleEntities;
|
|
43
|
+
$[3] = t2;
|
|
44
|
+
$[4] = t3;
|
|
45
|
+
} else {
|
|
46
|
+
t2 = $[3];
|
|
47
|
+
t3 = $[4];
|
|
48
|
+
}
|
|
49
|
+
let t4;
|
|
50
|
+
if ($[8] !== t2 || $[9] !== t3) {
|
|
51
|
+
t4 = {
|
|
52
|
+
enabledCollections: t2,
|
|
53
|
+
enabledCollectionSlugs: t3
|
|
30
54
|
};
|
|
31
|
-
|
|
55
|
+
$[8] = t2;
|
|
56
|
+
$[9] = t3;
|
|
57
|
+
$[10] = t4;
|
|
58
|
+
} else {
|
|
59
|
+
t4 = $[10];
|
|
60
|
+
}
|
|
61
|
+
return t4;
|
|
32
62
|
};
|
|
63
|
+
function _temp(c) {
|
|
64
|
+
return c.slug;
|
|
65
|
+
}
|
|
33
66
|
//# sourceMappingURL=useEnabledRelationships.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEnabledRelationships.js","names":["
|
|
1
|
+
{"version":3,"file":"useEnabledRelationships.js","names":["c","_c","useConfig","useEntityVisibility","React","useEnabledRelationships","t0","$","enabledCollectionSlugs","config","t1","collections","visibleEntities","t2","t3","t4","t5","slug","includes","enabledCollections","filter","map","_temp"],"sources":["../../../../../src/features/relationship/client/utils/useEnabledRelationships.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, CollectionSlug } from 'payload'\n\nimport { useConfig, useEntityVisibility } from '@payloadcms/ui'\nimport * as React from 'react'\n\ntype UseEnabledRelationshipsOptions = {\n enabledCollectionSlugs: CollectionSlug[]\n}\n\ntype UseEnabledRelationshipsResult = {\n enabledCollections: ClientCollectionConfig[]\n enabledCollectionSlugs: CollectionSlug[]\n}\n\nexport const useEnabledRelationships = ({\n enabledCollectionSlugs,\n}: UseEnabledRelationshipsOptions): UseEnabledRelationshipsResult => {\n const {\n config: { collections },\n } = useConfig()\n const { visibleEntities } = useEntityVisibility()\n\n return React.useMemo(() => {\n const enabledCollections = collections.filter(\n ({ slug }) =>\n enabledCollectionSlugs.includes(slug) &&\n (!visibleEntities?.collections || visibleEntities.collections.includes(slug)),\n )\n return {\n enabledCollections,\n enabledCollectionSlugs: enabledCollections.map((c) => c.slug),\n }\n }, [collections, enabledCollectionSlugs, visibleEntities])\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAGA,SAASC,SAAS,EAAEC,mBAAmB,QAAQ;AAC/C,YAAYC,KAAA,MAAW;AAWvB,OAAO,MAAMC,uBAAA,GAA0BC,EAAA;EAAA,MAAAC,CAAA,GAAAN,EAAA;EAAC;IAAAO;EAAA,IAAAF,EAEP;EAC/B;IAAAG,MAAA,EAAAC;EAAA,IAEIR,SAAA;EADM;IAAAS;EAAA,IAAAD,EAAe;EAEzB;IAAAE;EAAA,IAA4BT,mBAAA;EAAA,IAAAU,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAP,CAAA,QAAAI,WAAA,IAAAJ,CAAA,QAAAC,sBAAA,IAAAD,CAAA,QAAAK,eAAA;IAAA,IAAAG,EAAA;IAAA,IAAAR,CAAA,QAAAC,sBAAA,IAAAD,CAAA,QAAAK,eAAA;MAIxBG,EAAA,GAAAC,EAAA;QAAC;UAAAC;QAAA,IAAAD,EAAQ;QAAA,OACPR,sBAAA,CAAAU,QAAA,CAAgCD,IAAA,MAC/B,CAACL,eAAA,EAAAD,WAAA,IAAgCC,eAAA,CAAAD,WAAA,CAAAO,QAAA,CAAqCD,IAAA,CAAI;MAAA;MAAAV,CAAA,MAAAC,sBAAA;MAAAD,CAAA,MAAAK,eAAA;MAAAL,CAAA,MAAAQ,EAAA;IAAA;MAAAA,EAAA,GAAAR,CAAA;IAAA;IAH/E,MAAAY,kBAAA,GAA2BR,WAAA,CAAAS,MAAA,CACzBL,EAE6E;IAG7EI,EAAA,CAAAA,CAAA,CAAAA,kBAAA;IACwBL,EAAA,GAAAK,kBAAA,CAAAE,GAAA,CAAAC,KAAoC;IAAAf,CAAA,MAAAI,WAAA;IAAAJ,CAAA,MAAAC,sBAAA;IAAAD,CAAA,MAAAK,eAAA;IAAAL,CAAA,MAAAM,EAAA;IAAAN,CAAA,MAAAO,EAAA;EAAA;IAAAD,EAAA,GAAAN,CAAA;IAAAO,EAAA,GAAAP,CAAA;EAAA;EAAA,IAAAQ,EAAA;EAAA,IAAAR,CAAA,QAAAM,EAAA,IAAAN,CAAA,QAAAO,EAAA;IAFvDC,EAAA;MAAAI,kBAAA,EACLA,EAAA;MAAAX,sBAAA,EACwBM;IAAoC;IAC9DP,CAAA,MAAAM,EAAA;IAAAN,CAAA,MAAAO,EAAA;IAAAP,CAAA,OAAAQ,EAAA;EAAA;IAAAA,EAAA,GAAAR,CAAA;EAAA;EAAA,OAHOQ,EAGP;AAAA,CAEJ;AAnBuC,SAAAO,MAAAtB,CAAA;EAAA,OAgBqBA,CAAA,CAAAiB,IAAA;AAAA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PopulationPromise } from '../../typesServer.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RelationshipFeatureServerProps } from './index.js';
|
|
3
3
|
import type { SerializedRelationshipNode } from './schema.js';
|
|
4
|
-
export declare const relationshipPopulationPromiseHOC: (props:
|
|
4
|
+
export declare const relationshipPopulationPromiseHOC: (props: RelationshipFeatureServerProps) => PopulationPromise<SerializedRelationshipNode>;
|
|
5
5
|
//# sourceMappingURL=graphQLPopulationPromise.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphQLPopulationPromise.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/server/graphQLPopulationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"graphQLPopulationPromise.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/server/graphQLPopulationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAA;AAChE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAI7D,eAAO,MAAM,gCAAgC,UACpC,8BAA8B,KACpC,iBAAiB,CAAC,0BAA0B,CAwC9C,CAAA"}
|
|
@@ -10,13 +10,13 @@ export const relationshipPopulationPromiseHOC = props => {
|
|
|
10
10
|
req,
|
|
11
11
|
showHiddenFields
|
|
12
12
|
}) => {
|
|
13
|
-
if (node?.value) {
|
|
13
|
+
if (node?.value && props.enabledCollectionSlugs.includes(node.relationTo)) {
|
|
14
14
|
// @ts-expect-error
|
|
15
15
|
const id = node?.value?.id || node?.value // for backwards-compatibility
|
|
16
16
|
;
|
|
17
17
|
const collection = req.payload.collections[node?.relationTo];
|
|
18
18
|
if (collection) {
|
|
19
|
-
const populateDepth = props
|
|
19
|
+
const populateDepth = props.maxDepth !== undefined && props.maxDepth < depth ? props.maxDepth : depth;
|
|
20
20
|
populationPromises.push(populate({
|
|
21
21
|
id,
|
|
22
22
|
collectionSlug: collection.config.slug,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphQLPopulationPromise.js","names":["populate","relationshipPopulationPromiseHOC","props","relationshipPopulationPromise","currentDepth","depth","draft","node","overrideAccess","populationPromises","req","showHiddenFields","value","id","collection","payload","collections","
|
|
1
|
+
{"version":3,"file":"graphQLPopulationPromise.js","names":["populate","relationshipPopulationPromiseHOC","props","relationshipPopulationPromise","currentDepth","depth","draft","node","overrideAccess","populationPromises","req","showHiddenFields","value","enabledCollectionSlugs","includes","relationTo","id","collection","payload","collections","populateDepth","maxDepth","undefined","push","collectionSlug","config","slug","data","key"],"sources":["../../../../src/features/relationship/server/graphQLPopulationPromise.ts"],"sourcesContent":["import type { PopulationPromise } from '../../typesServer.js'\nimport type { RelationshipFeatureServerProps } from './index.js'\nimport type { SerializedRelationshipNode } from './schema.js'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\n\nexport const relationshipPopulationPromiseHOC = (\n props: RelationshipFeatureServerProps,\n): PopulationPromise<SerializedRelationshipNode> => {\n const relationshipPopulationPromise: PopulationPromise<SerializedRelationshipNode> = ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (node?.value && props.enabledCollectionSlugs.includes(node.relationTo)) {\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 collectionSlug: collection.config.slug,\n currentDepth,\n data: node,\n depth: populateDepth,\n draft,\n key: 'value',\n overrideAccess,\n req,\n showHiddenFields,\n }),\n )\n }\n }\n }\n\n return relationshipPopulationPromise\n}\n"],"mappings":"AAIA,SAASA,QAAQ,QAAQ;AAEzB,OAAO,MAAMC,gCAAA,GACXC,KAAA;EAEA,MAAMC,6BAAA,GAA+EA,CAAC;IACpFC,YAAY;IACZC,KAAK;IACLC,KAAK;IACLC,IAAI;IACJC,cAAc;IACdC,kBAAkB;IAClBC,GAAG;IACHC;EAAgB,CACjB;IACC,IAAIJ,IAAA,EAAMK,KAAA,IAASV,KAAA,CAAMW,sBAAsB,CAACC,QAAQ,CAACP,IAAA,CAAKQ,UAAU,GAAG;MACzE;MACA,MAAMC,EAAA,GAAKT,IAAA,EAAMK,KAAA,EAAOI,EAAA,IAAMT,IAAA,EAAMK,KAAA,CAAM;AAAA;MAE1C,MAAMK,UAAA,GAAaP,GAAA,CAAIQ,OAAO,CAACC,WAAW,CAACZ,IAAA,EAAMQ,UAAA,CAAW;MAE5D,IAAIE,UAAA,EAAY;QACd,MAAMG,aAAA,GACJlB,KAAA,CAAMmB,QAAQ,KAAKC,SAAA,IAAapB,KAAA,CAAMmB,QAAQ,GAAGhB,KAAA,GAAQH,KAAA,CAAMmB,QAAQ,GAAGhB,KAAA;QAE5EI,kBAAA,CAAmBc,IAAI,CACrBvB,QAAA,CAAS;UACPgB,EAAA;UACAQ,cAAA,EAAgBP,UAAA,CAAWQ,MAAM,CAACC,IAAI;UACtCtB,YAAA;UACAuB,IAAA,EAAMpB,IAAA;UACNF,KAAA,EAAOe,aAAA;UACPd,KAAA;UACAsB,GAAA,EAAK;UACLpB,cAAA;UACAE,GAAA;UACAC;QACF;MAEJ;IACF;EACF;EAEA,OAAOR,6BAAA;AACT","ignoreList":[]}
|
|
@@ -24,5 +24,12 @@ export type RelationshipFeatureProps = {
|
|
|
24
24
|
*/
|
|
25
25
|
maxDepth?: number;
|
|
26
26
|
} & ExclusiveRelationshipFeatureProps;
|
|
27
|
-
export
|
|
27
|
+
export type RelationshipFeatureServerProps = {
|
|
28
|
+
/** Collection policy resolved during feature initialization. */
|
|
29
|
+
enabledCollectionSlugs: CollectionSlug[];
|
|
30
|
+
} & RelationshipFeatureProps;
|
|
31
|
+
export type RelationshipFeatureClientProps = {
|
|
32
|
+
enabledCollectionSlugs: CollectionSlug[];
|
|
33
|
+
};
|
|
34
|
+
export declare const RelationshipFeature: import("../../typesServer.js").FeatureProviderProviderServer<RelationshipFeatureProps, RelationshipFeatureServerProps, RelationshipFeatureClientProps>;
|
|
28
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAW7C,YAAY,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAE/E,MAAM,MAAM,iCAAiC,GACzC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAA;IAGtC,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,cAAc,EAAE,CAAA;CACtC,CAAA;AAEL,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,iCAAiC,CAAA;AAErC,MAAM,MAAM,8BAA8B,GAAG;IAC3C,gEAAgE;IAChE,sBAAsB,EAAE,cAAc,EAAE,CAAA;CACzC,GAAG,wBAAwB,CAAA;AAE5B,MAAM,MAAM,8BAA8B,GAAG;IAC3C,sBAAsB,EAAE,cAAc,EAAE,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,mBAAmB,wJA0F9B,CAAA"}
|
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
import { populate } from '../../../populateGraphQL/populate.js';
|
|
2
2
|
import { createServerFeature } from '../../../utilities/createServerFeature.js';
|
|
3
3
|
import { createNode } from '../../typeUtilities.js';
|
|
4
|
+
import { filterEnabledRelationshipCollections } from '../shared/filterEnabledRelationshipCollections.js';
|
|
4
5
|
import { relationshipPopulationPromiseHOC } from './graphQLPopulationPromise.js';
|
|
5
6
|
import { i18n } from './i18n.js';
|
|
6
7
|
import { RelationshipServerNode } from './nodes/RelationshipNode.js';
|
|
7
8
|
import { createRelationshipNodeJSONSchema } from './schema.js';
|
|
8
9
|
export const RelationshipFeature = createServerFeature({
|
|
9
10
|
feature: ({
|
|
10
|
-
|
|
11
|
+
config,
|
|
12
|
+
props: unsanitizedProps
|
|
11
13
|
}) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const props = {
|
|
15
|
+
...unsanitizedProps,
|
|
16
|
+
enabledCollectionSlugs: filterEnabledRelationshipCollections(config.collections, {
|
|
17
|
+
...unsanitizedProps,
|
|
18
|
+
uploads: false
|
|
19
|
+
}).map(({
|
|
20
|
+
slug
|
|
21
|
+
}) => slug)
|
|
22
|
+
};
|
|
17
23
|
return {
|
|
18
24
|
ClientFeature: '@payloadcms/richtext-lexical/client#RelationshipFeatureClient',
|
|
19
|
-
clientFeatureProps
|
|
25
|
+
clientFeatureProps: {
|
|
26
|
+
enabledCollectionSlugs: props.enabledCollectionSlugs
|
|
27
|
+
},
|
|
20
28
|
i18n,
|
|
21
29
|
nodes: [createNode({
|
|
22
30
|
graphQLPopulationPromises: [relationshipPopulationPromiseHOC(props)],
|
|
@@ -32,7 +40,7 @@ export const RelationshipFeature = createServerFeature({
|
|
|
32
40
|
req,
|
|
33
41
|
showHiddenFields
|
|
34
42
|
}) => {
|
|
35
|
-
if (!node?.value) {
|
|
43
|
+
if (!node?.value || !props.enabledCollectionSlugs.includes(node.relationTo)) {
|
|
36
44
|
return node;
|
|
37
45
|
}
|
|
38
46
|
const collection = req.payload.collections[node?.relationTo];
|
|
@@ -42,7 +50,7 @@ export const RelationshipFeature = createServerFeature({
|
|
|
42
50
|
// @ts-expect-error
|
|
43
51
|
const id = node?.value?.id || node?.value // for backwards-compatibility
|
|
44
52
|
;
|
|
45
|
-
const populateDepth = maxDepth !== undefined && maxDepth < depth ? maxDepth : depth;
|
|
53
|
+
const populateDepth = props.maxDepth !== undefined && props.maxDepth < depth ? props.maxDepth : depth;
|
|
46
54
|
populationPromises.push(populate({
|
|
47
55
|
id,
|
|
48
56
|
collectionSlug: collection.config.slug,
|
|
@@ -60,8 +68,17 @@ export const RelationshipFeature = createServerFeature({
|
|
|
60
68
|
}]
|
|
61
69
|
},
|
|
62
70
|
jsonSchema: createRelationshipNodeJSONSchema(props),
|
|
63
|
-
node: RelationshipServerNode
|
|
64
|
-
|
|
71
|
+
node: RelationshipServerNode,
|
|
72
|
+
validations: [({
|
|
73
|
+
node,
|
|
74
|
+
validation: {
|
|
75
|
+
options: {
|
|
76
|
+
req
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}) => props.enabledCollectionSlugs.includes(node.relationTo) ? true : req.t('validation:invalidSelection')]
|
|
80
|
+
})],
|
|
81
|
+
sanitizedServerFeatureProps: props
|
|
65
82
|
};
|
|
66
83
|
},
|
|
67
84
|
key: 'relationship'
|