@payloadcms/richtext-lexical 4.0.0-internal.38b7f1d → 4.0.0-internal.5f0cd13
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/cell/rscEntry.d.ts +1 -1
- package/dist/cell/rscEntry.d.ts.map +1 -1
- package/dist/cell/rscEntry.js.map +1 -1
- package/dist/exports/client/{Field-PJW7KUJG.js → Field-G5Z2HM5Y.js} +2 -2
- package/dist/exports/client/Field-G5Z2HM5Y.js.map +7 -0
- package/dist/exports/client/{RelationshipComponent-5RONAYJM.js → RelationshipComponent-YCPAKOL7.js} +2 -2
- package/dist/exports/client/RelationshipComponent-YCPAKOL7.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/{chunk-QJ5EETIB.js → chunk-6QWQ7JV4.js} +2 -2
- package/dist/exports/client/{chunk-FTT5KJ6W.js → chunk-LH634DPU.js} +1 -1
- package/dist/exports/client/chunk-LH634DPU.js.map +7 -0
- package/dist/exports/client/{chunk-BZZVLW4U.js → chunk-RJ5MAOKZ.js} +1 -1
- package/dist/exports/client/chunk-RJ5MAOKZ.js.map +7 -0
- package/dist/exports/client/{chunk-44G3K3W7.js → chunk-UAKNDD6R.js} +2 -2
- package/dist/exports/client/chunk-UAKNDD6R.js.map +7 -0
- package/dist/exports/client/component-HKTAZ77E.js +2 -0
- package/dist/exports/client/component-HKTAZ77E.js.map +7 -0
- package/dist/exports/client/componentInline-D3A6OW76.js +2 -0
- package/dist/exports/client/index.js +16 -16
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/react/index.d.ts +1 -1
- package/dist/exports/react/index.d.ts.map +1 -1
- package/dist/exports/react/index.js.map +1 -1
- package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
- package/dist/features/blockquote/server/index.d.ts +1 -4
- package/dist/features/blockquote/server/index.d.ts.map +1 -1
- package/dist/features/blockquote/server/index.js +2 -0
- package/dist/features/blockquote/server/index.js.map +1 -1
- package/dist/features/blockquote/server/schema.d.ts +8 -0
- package/dist/features/blockquote/server/schema.d.ts.map +1 -0
- package/dist/features/blockquote/server/schema.js +15 -0
- package/dist/features/blockquote/server/schema.js.map +1 -0
- package/dist/features/blocks/client/component/index.d.ts +2 -2
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +2 -2
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.d.ts +2 -2
- 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/client/markdown/markdownTransformer.d.ts.map +1 -1
- package/dist/features/blocks/client/markdown/markdownTransformer.js +4 -4
- package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts +2 -2
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +2 -2
- package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/blocks/client/plugin/index.d.ts +1 -1
- package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
- package/dist/features/blocks/client/plugin/index.js.map +1 -1
- package/dist/features/blocks/server/graphQLPopulationPromise.d.ts +1 -2
- package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/blocks/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/blocks/server/index.d.ts +1 -0
- package/dist/features/blocks/server/index.d.ts.map +1 -1
- package/dist/features/blocks/server/index.js +20 -66
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
- package/dist/features/blocks/server/markdown/markdownTransformer.js +4 -4
- package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts +1 -18
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +2 -10
- package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/blocks/server/schema.d.ts +45 -0
- package/dist/features/blocks/server/schema.d.ts.map +1 -0
- package/dist/features/blocks/server/schema.js +136 -0
- package/dist/features/blocks/server/schema.js.map +1 -0
- package/dist/features/blocks/server/validate.d.ts +1 -2
- package/dist/features/blocks/server/validate.d.ts.map +1 -1
- package/dist/features/blocks/server/validate.js.map +1 -1
- package/dist/features/converters/htmlToLexical/index.d.ts +1 -1
- package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
- package/dist/features/converters/htmlToLexical/index.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/blockquote.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/linebreak.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/link.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/paragraph.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/tab.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/table.js +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/table.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/text.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/defaultConverters.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/types.d.ts +2 -1
- package/dist/features/converters/lexicalToHtml/async/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/types.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/link.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/tab.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/table.js +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/table.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/text.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts +1 -1
- package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/defaultConverters.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/types.d.ts +2 -1
- package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/Component/index.d.ts +4 -2
- package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/link.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/tab.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/table.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/text.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/defaultConverters.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/index.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/types.d.ts +1 -1
- package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
- package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
- package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +1 -1
- package/dist/features/converters/lexicalToPlaintext/shared/findConverterForNode.js.map +1 -1
- package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts +1 -1
- package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToPlaintext/sync/types.js.map +1 -1
- package/dist/features/converters/markdownToLexical/index.d.ts +1 -1
- package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
- package/dist/features/converters/markdownToLexical/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.css +4 -4
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.css +1 -1
- package/dist/features/experimental_table/server/index.d.ts +1 -6
- package/dist/features/experimental_table/server/index.d.ts.map +1 -1
- package/dist/features/experimental_table/server/index.js +4 -0
- package/dist/features/experimental_table/server/index.js.map +1 -1
- package/dist/features/experimental_table/server/schema.d.ts +27 -0
- package/dist/features/experimental_table/server/schema.d.ts.map +1 -0
- package/dist/features/experimental_table/server/schema.js +104 -0
- package/dist/features/experimental_table/server/schema.js.map +1 -0
- package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
- package/dist/features/heading/server/index.d.ts +2 -4
- package/dist/features/heading/server/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.js +2 -0
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/heading/server/schema.d.ts +10 -0
- package/dist/features/heading/server/schema.d.ts.map +1 -0
- package/dist/features/heading/server/schema.js +37 -0
- package/dist/features/heading/server/schema.js.map +1 -0
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/horizontalRule/server/index.d.ts +1 -0
- package/dist/features/horizontalRule/server/index.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/index.js +2 -0
- package/dist/features/horizontalRule/server/index.js.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -5
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/horizontalRule/server/schema.d.ts +7 -0
- package/dist/features/horizontalRule/server/schema.d.ts.map +1 -0
- package/dist/features/horizontalRule/server/schema.js +25 -0
- package/dist/features/horizontalRule/server/schema.js.map +1 -0
- package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
- package/dist/features/link/client/index.d.ts.map +1 -1
- package/dist/features/link/client/index.js.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.d.ts +1 -1
- package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.css +2 -2
- package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/types.js.map +1 -1
- package/dist/features/link/client/plugins/link/index.js.map +1 -1
- package/dist/features/link/markdownTransformer.d.ts +1 -1
- package/dist/features/link/markdownTransformer.d.ts.map +1 -1
- package/dist/features/link/markdownTransformer.js.map +1 -1
- package/dist/features/link/markdownTransformer.spec.js.map +1 -1
- package/dist/features/link/nodes/AutoLinkNode.d.ts +3 -3
- package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/AutoLinkNode.js +2 -1
- package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
- package/dist/features/link/nodes/LinkNode.d.ts +3 -3
- package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/LinkNode.js +2 -1
- package/dist/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/features/link/server/baseFields.d.ts.map +1 -1
- package/dist/features/link/server/baseFields.js.map +1 -1
- package/dist/features/link/server/graphQLPopulationPromise.d.ts +1 -1
- package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/link/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/link/server/index.d.ts +2 -1
- package/dist/features/link/server/index.d.ts.map +1 -1
- package/dist/features/link/server/index.js +3 -0
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/link/server/schema.d.ts +32 -0
- package/dist/features/link/server/schema.d.ts.map +1 -0
- package/dist/features/link/server/schema.js +166 -0
- package/dist/features/link/server/schema.js.map +1 -0
- package/dist/features/link/server/validate.d.ts +1 -1
- package/dist/features/link/server/validate.d.ts.map +1 -1
- package/dist/features/link/server/validate.js.map +1 -1
- package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
- package/dist/features/lists/checklist/server/index.js +3 -0
- 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 +3 -0
- package/dist/features/lists/orderedList/server/index.js.map +1 -1
- package/dist/features/lists/plugin/index.d.ts +0 -9
- package/dist/features/lists/plugin/index.d.ts.map +1 -1
- package/dist/features/lists/plugin/index.js.map +1 -1
- package/dist/features/lists/shared/markdown.d.ts.map +1 -1
- package/dist/features/lists/shared/schema.d.ts +18 -0
- package/dist/features/lists/shared/schema.d.ts.map +1 -0
- package/dist/features/lists/shared/schema.js +62 -0
- package/dist/features/lists/shared/schema.js.map +1 -0
- package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/unorderedList/server/index.js +3 -0
- package/dist/features/lists/unorderedList/server/index.js.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.d.ts +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.js +2 -2
- package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
- package/dist/features/relationship/client/components/index.css +2 -2
- package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.d.ts +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.d.ts +1 -1
- package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.js +9 -40
- package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/relationship/server/index.d.ts +1 -0
- package/dist/features/relationship/server/index.d.ts.map +1 -1
- package/dist/features/relationship/server/index.js +2 -0
- package/dist/features/relationship/server/index.js.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +1 -10
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/relationship/server/schema.d.ts +28 -0
- package/dist/features/relationship/server/schema.d.ts.map +1 -0
- package/dist/features/relationship/server/schema.js +83 -0
- package/dist/features/relationship/server/schema.js.map +1 -0
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +23 -0
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -0
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +34 -0
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -0
- package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
- package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
- package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +1 -2
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.css +4 -4
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/features/toolbars/types.d.ts +1 -1
- package/dist/features/toolbars/types.d.ts.map +1 -1
- package/dist/features/toolbars/types.js.map +1 -1
- package/dist/features/typesClient.d.ts +1 -1
- package/dist/features/typesClient.d.ts.map +1 -1
- package/dist/features/typesClient.js.map +1 -1
- package/dist/features/typesServer.d.ts +18 -41
- package/dist/features/typesServer.d.ts.map +1 -1
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/component/index.css +14 -18
- package/dist/features/upload/client/component/index.d.ts +1 -1
- package/dist/features/upload/client/component/index.d.ts.map +1 -1
- package/dist/features/upload/client/component/index.js +4 -4
- package/dist/features/upload/client/component/index.js.map +1 -1
- package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.d.ts +1 -1
- package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/client/plugin/index.d.ts +1 -1
- package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/upload/server/index.d.ts +1 -0
- package/dist/features/upload/server/index.d.ts.map +1 -1
- package/dist/features/upload/server/index.js +3 -2
- package/dist/features/upload/server/index.js.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.d.ts +1 -55
- package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/server/nodes/conversions.d.ts.map +1 -1
- package/dist/features/upload/server/nodes/conversions.js.map +1 -1
- package/dist/features/upload/server/schema.d.ts +52 -0
- package/dist/features/upload/server/schema.d.ts.map +1 -0
- package/dist/features/upload/server/schema.js +113 -0
- package/dist/features/upload/server/schema.js.map +1 -0
- package/dist/features/upload/server/validate.d.ts +1 -1
- package/dist/features/upload/server/validate.d.ts.map +1 -1
- package/dist/features/upload/server/validate.js.map +1 -1
- package/dist/field/Diff/converters/link.d.ts +1 -1
- package/dist/field/Diff/converters/link.d.ts.map +1 -1
- package/dist/field/Diff/converters/link.js.map +1 -1
- package/dist/field/Diff/converters/listitem/index.css +44 -8
- package/dist/field/Diff/converters/listitem/index.d.ts +1 -1
- package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/listitem/index.js.map +1 -1
- package/dist/field/Diff/converters/relationship/index.css +76 -36
- package/dist/field/Diff/converters/relationship/index.d.ts +1 -1
- package/dist/field/Diff/converters/relationship/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/relationship/index.js +10 -28
- package/dist/field/Diff/converters/relationship/index.js.map +1 -1
- package/dist/field/Diff/converters/unknown/index.js.map +1 -1
- package/dist/field/Diff/converters/upload/index.css +106 -43
- package/dist/field/Diff/converters/upload/index.d.ts +1 -1
- package/dist/field/Diff/converters/upload/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/upload/index.js +6 -2
- package/dist/field/Diff/converters/upload/index.js.map +1 -1
- package/dist/field/Diff/index.css +116 -61
- package/dist/field/Diff/index.js.map +1 -1
- package/dist/field/Field.d.ts +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +3 -4
- package/dist/field/Field.js.map +1 -1
- package/dist/field/RenderLexical/index.d.ts +2 -2
- package/dist/field/RenderLexical/index.d.ts.map +1 -1
- package/dist/field/RenderLexical/index.js.map +1 -1
- package/dist/field/RichTextViewProvider.d.ts +1 -1
- package/dist/field/RichTextViewProvider.d.ts.map +1 -1
- package/dist/field/RichTextViewProvider.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js.map +1 -1
- package/dist/field/rscEntry.d.ts +1 -1
- package/dist/field/rscEntry.d.ts.map +1 -1
- package/dist/field/rscEntry.js.map +1 -1
- package/dist/hooks.d.ts +6 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +548 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +11 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -618
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalProvider.d.ts +1 -1
- package/dist/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.d.ts +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
- package/dist/lexical/config/client/loader.d.ts +1 -1
- package/dist/lexical/config/client/loader.d.ts.map +1 -1
- package/dist/lexical/config/client/loader.js.map +1 -1
- package/dist/lexical/config/client/sanitize.d.ts +1 -1
- package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/client/sanitize.js.map +1 -1
- package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/server/sanitize.js +9 -11
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/config/types.d.ts +1 -1
- package/dist/lexical/config/types.d.ts.map +1 -1
- package/dist/lexical/config/types.js.map +1 -1
- package/dist/lexical/nodes/index.d.ts +1 -1
- package/dist/lexical/nodes/index.d.ts.map +1 -1
- package/dist/lexical/nodes/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
- package/dist/lexical/theme/EditorTheme.css +4 -4
- package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
- package/dist/types/builtInNodes.d.ts +14 -0
- package/dist/types/builtInNodes.d.ts.map +1 -0
- package/dist/types/builtInNodes.js +203 -0
- package/dist/types/builtInNodes.js.map +1 -0
- package/dist/{types.d.ts → types/index.d.ts} +9 -10
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/jsonSchemaHelpers.d.ts +28 -0
- package/dist/types/jsonSchemaHelpers.d.ts.map +1 -0
- package/dist/types/jsonSchemaHelpers.js +54 -0
- package/dist/types/jsonSchemaHelpers.js.map +1 -0
- package/dist/types/nodeTypes.d.ts +86 -0
- package/dist/types/nodeTypes.d.ts.map +1 -0
- package/dist/types/nodeTypes.js +6 -0
- package/dist/types/nodeTypes.js.map +1 -0
- package/dist/types/schema.d.ts +6 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/schema.js +73 -0
- package/dist/types/schema.js.map +1 -0
- package/dist/utilities/buildEditorState.d.ts +1 -1
- package/dist/utilities/buildEditorState.d.ts.map +1 -1
- package/dist/utilities/buildEditorState.js.map +1 -1
- package/dist/utilities/buildInitialState.js.map +1 -1
- package/dist/utilities/createClientFeature.d.ts +1 -1
- package/dist/utilities/createClientFeature.d.ts.map +1 -1
- package/dist/utilities/createClientFeature.js.map +1 -1
- package/dist/utilities/editorConfigFactory.d.ts +1 -1
- package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
- package/dist/utilities/editorConfigFactory.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.d.ts +1 -1
- package/dist/utilities/generateImportMap.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.js.map +1 -1
- package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
- package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
- package/dist/utilities/initLexicalFeatures.d.ts +1 -1
- package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
- package/dist/utilities/initLexicalFeatures.js.map +1 -1
- package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/package.json +13 -13
- package/dist/exports/client/Field-PJW7KUJG.js.map +0 -7
- package/dist/exports/client/RelationshipComponent-5RONAYJM.js.map +0 -7
- package/dist/exports/client/chunk-44G3K3W7.js.map +0 -7
- package/dist/exports/client/chunk-BZZVLW4U.js.map +0 -7
- package/dist/exports/client/chunk-FTT5KJ6W.js.map +0 -7
- package/dist/exports/client/component-53Y3RYR5.js +0 -2
- package/dist/exports/client/component-53Y3RYR5.js.map +0 -7
- package/dist/exports/client/componentInline-PM4PLNUK.js +0 -2
- package/dist/features/link/nodes/types.d.ts +0 -27
- package/dist/features/link/nodes/types.d.ts.map +0 -1
- package/dist/features/link/nodes/types.js +0 -2
- package/dist/features/link/nodes/types.js.map +0 -1
- package/dist/nodeTypes.d.ts +0 -74
- package/dist/nodeTypes.d.ts.map +0 -1
- package/dist/nodeTypes.js +0 -5
- package/dist/nodeTypes.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- /package/dist/exports/client/{chunk-QJ5EETIB.js.map → chunk-6QWQ7JV4.js.map} +0 -0
- /package/dist/exports/client/{componentInline-PM4PLNUK.js.map → componentInline-D3A6OW76.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipNode.js","names":["$applyNodeReplacement","React","RelationshipServerNode","RelationshipComponent","lazy","then","module","default","$relationshipElementToNode","domNode","id","getAttribute","relationTo","node","$createRelationshipNode","value","RelationshipNode","clone","getType","importDOM","div","hasAttribute","conversion","priority","importJSON","serializedNode","version","importedData","setFormat","format","decorate","editor","config","_jsx","className","theme","relationship","data","__data","__format","nodeKey","getKey","exportJSON","$isRelationshipNode"],"sources":["../../../../../src/features/relationship/client/nodes/RelationshipNode.tsx"],"sourcesContent":["'use client'\nimport type { JSX } from 'react'\n\nimport {\n $applyNodeReplacement,\n type DOMConversionMap,\n type DOMConversionOutput,\n type EditorConfig,\n type LexicalEditor,\n type LexicalNode,\n} from 'lexical'\nimport * as React from 'react'\n\nimport type {
|
|
1
|
+
{"version":3,"file":"RelationshipNode.js","names":["$applyNodeReplacement","React","RelationshipServerNode","RelationshipComponent","lazy","then","module","default","$relationshipElementToNode","domNode","id","getAttribute","relationTo","node","$createRelationshipNode","value","RelationshipNode","clone","getType","importDOM","div","hasAttribute","conversion","priority","importJSON","serializedNode","version","importedData","setFormat","format","decorate","editor","config","_jsx","className","theme","relationship","data","__data","__format","nodeKey","getKey","exportJSON","$isRelationshipNode"],"sources":["../../../../../src/features/relationship/client/nodes/RelationshipNode.tsx"],"sourcesContent":["'use client'\nimport type { JSX } from 'react'\n\nimport {\n $applyNodeReplacement,\n type DOMConversionMap,\n type DOMConversionOutput,\n type EditorConfig,\n type LexicalEditor,\n type LexicalNode,\n} from 'lexical'\nimport * as React from 'react'\n\nimport type { RelationshipData, SerializedRelationshipNode } from '../../server/schema.js'\n\nimport { RelationshipServerNode } from '../../server/nodes/RelationshipNode.js'\n\nconst RelationshipComponent = React.lazy(() =>\n import('../components/RelationshipComponent.js').then((module) => ({\n default: module.RelationshipComponent,\n })),\n)\n\nfunction $relationshipElementToNode(domNode: HTMLDivElement): DOMConversionOutput | null {\n const id = domNode.getAttribute('data-lexical-relationship-id')\n const relationTo = domNode.getAttribute('data-lexical-relationship-relationTo')\n\n if (id != null && relationTo != null) {\n const node = $createRelationshipNode({\n relationTo,\n value: id,\n })\n return { node }\n }\n return null\n}\n\nexport class RelationshipNode extends RelationshipServerNode {\n static override clone(node: RelationshipServerNode): RelationshipServerNode {\n return super.clone(node)\n }\n\n static override getType(): string {\n return super.getType()\n }\n\n static override importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {\n div: (domNode: HTMLDivElement) => {\n if (\n !domNode.hasAttribute('data-lexical-relationship-relationTo') ||\n !domNode.hasAttribute('data-lexical-relationship-id')\n ) {\n return null\n }\n return {\n conversion: $relationshipElementToNode,\n priority: 2,\n }\n },\n }\n }\n\n static override importJSON(serializedNode: SerializedRelationshipNode): RelationshipNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n\n const importedData: RelationshipData = {\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n const node = $createRelationshipNode(importedData)\n node.setFormat(serializedNode.format)\n return node\n }\n\n override decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element {\n return (\n <RelationshipComponent\n className={config.theme.relationship ?? 'LexicalEditorTheme__relationship'}\n data={this.__data}\n format={this.__format}\n nodeKey={this.getKey()}\n />\n )\n }\n\n override exportJSON(): SerializedRelationshipNode {\n return super.exportJSON()\n }\n}\n\nexport function $createRelationshipNode(data: RelationshipData): RelationshipNode {\n return $applyNodeReplacement(\n new RelationshipNode({\n data,\n }),\n )\n}\n\nexport function $isRelationshipNode(\n node: LexicalNode | null | RelationshipNode | undefined,\n): node is RelationshipNode {\n return node instanceof RelationshipNode\n}\n"],"mappings":"AAAA;;;AAGA,SACEA,qBAAqB,QAMhB;AACP,YAAYC,KAAA,MAAW;AAIvB,SAASC,sBAAsB,QAAQ;AAEvC,MAAMC,qBAAA,gBAAwBF,KAAA,CAAMG,IAAI,CAAC,MACvC,MAAM,CAAC,0CAA0CC,IAAI,CAAEC,MAAA,KAAY;EACjEC,OAAA,EAASD,MAAA,CAAOH;AAClB;AAGF,SAASK,2BAA2BC,OAAuB;EACzD,MAAMC,EAAA,GAAKD,OAAA,CAAQE,YAAY,CAAC;EAChC,MAAMC,UAAA,GAAaH,OAAA,CAAQE,YAAY,CAAC;EAExC,IAAID,EAAA,IAAM,QAAQE,UAAA,IAAc,MAAM;IACpC,MAAMC,IAAA,GAAOC,uBAAA,CAAwB;MACnCF,UAAA;MACAG,KAAA,EAAOL;IACT;IACA,OAAO;MAAEG;IAAK;EAChB;EACA,OAAO;AACT;AAEA,OAAO,MAAMG,gBAAA,SAAyBd,sBAAA;EACpC,OAAgBe,MAAMJ,IAA4B,EAA0B;IAC1E,OAAO,KAAK,CAACI,KAAA,CAAMJ,IAAA;EACrB;EAEA,OAAgBK,QAAA,EAAkB;IAChC,OAAO,KAAK,CAACA,OAAA;EACf;EAEA,OAAgBC,UAAA,EAAqD;IACnE,OAAO;MACLC,GAAA,EAAMX,OAAA;QACJ,IACE,CAACA,OAAA,CAAQY,YAAY,CAAC,2CACtB,CAACZ,OAAA,CAAQY,YAAY,CAAC,iCACtB;UACA,OAAO;QACT;QACA,OAAO;UACLC,UAAA,EAAYd,0BAAA;UACZe,QAAA,EAAU;QACZ;MACF;IACF;EACF;EAEA,OAAgBC,WAAWC,cAA0C,EAAoB;IACvF,IAAIA,cAAA,CAAeC,OAAO,KAAK,KAAMD,cAAA,EAAgBV,KAAA,EAAqCL,EAAA,EAAI;MAC5Fe,cAAA,CAAeV,KAAK,GAAGU,cAAC,CAAeV,KAAK,CAA+BL,EAAE;IAC/E;IAEA,MAAMiB,YAAA,GAAiC;MACrCf,UAAA,EAAYa,cAAA,CAAeb,UAAU;MACrCG,KAAA,EAAOU,cAAA,CAAeV;IACxB;IACA,MAAMF,IAAA,GAAOC,uBAAA,CAAwBa,YAAA;IACrCd,IAAA,CAAKe,SAAS,CAACH,cAAA,CAAeI,MAAM;IACpC,OAAOhB,IAAA;EACT;EAESiB,SAASC,MAAqB,EAAEC,MAAoB,EAAe;IAC1E,oBACEC,IAAA,CAAC9B,qBAAA;MACC+B,SAAA,EAAWF,MAAA,CAAOG,KAAK,CAACC,YAAY,IAAI;MACxCC,IAAA,EAAM,IAAI,CAACC,MAAM;MACjBT,MAAA,EAAQ,IAAI,CAACU,QAAQ;MACrBC,OAAA,EAAS,IAAI,CAACC,MAAM;;EAG1B;EAESC,WAAA,EAAyC;IAChD,OAAO,KAAK,CAACA,UAAA;EACf;AACF;AAEA,OAAO,SAAS5B,wBAAwBuB,IAAsB;EAC5D,OAAOrC,qBAAA,CACL,IAAIgB,gBAAA,CAAiB;IACnBqB;EACF;AAEJ;AAEA,OAAO,SAASM,oBACd9B,IAAuD;EAEvD,OAAOA,IAAA,YAAgBG,gBAAA;AACzB","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LexicalCommand } from 'lexical';
|
|
2
2
|
import type { PluginComponent } from '../../../typesClient.js';
|
|
3
3
|
import type { RelationshipFeatureProps } from '../../server/index.js';
|
|
4
|
-
import type { RelationshipData } from '../../server/
|
|
4
|
+
import type { RelationshipData } from '../../server/schema.js';
|
|
5
5
|
export declare const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData>;
|
|
6
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/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,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,
|
|
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,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AACrE,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,wBAAwB,CAuCxE,CAAA"}
|
|
@@ -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","disabledCollections","t2","enabledCollections","t3","collectionSlugsBlacklist","collectionSlugsWhitelist","enabledCollectionSlugs","t4","t5","hasNodes","Error","registerCommand","_temp","t6","_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 { RelationshipFeatureProps } from '../../server/index.js'\nimport type { RelationshipData } from '../../server/
|
|
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","disabledCollections","t2","enabledCollections","t3","collectionSlugsBlacklist","collectionSlugsWhitelist","enabledCollectionSlugs","t4","t5","hasNodes","Error","registerCommand","_temp","t6","_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 { RelationshipFeatureProps } 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<RelationshipFeatureProps> = ({ clientProps }) => {\n const [editor] = useLexicalComposerContext()\n\n const { enabledCollectionSlugs } = useEnabledRelationships({\n collectionSlugsBlacklist: clientProps?.disabledCollections,\n collectionSlugsWhitelist: clientProps?.enabledCollections,\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,GAAgEC,EAAA;EAAA,MAAAC,CAAA,GAAAjB,EAAA;EAAC;IAAAkB;EAAA,IAAAF,EAAe;EAC3F,OAAAG,MAAA,IAAiBlB,yBAAA;EAGW,MAAAmB,EAAA,GAAAF,WAAA,EAAAG,mBAAA;EACA,MAAAC,EAAA,GAAAJ,WAAA,EAAAK,kBAAA;EAAa,IAAAC,EAAA;EAAA,IAAAP,CAAA,QAAAG,EAAA,IAAAH,CAAA,QAAAK,EAAA;IAFkBE,EAAA;MAAAC,wBAAA,EAC/BL,EAAa;MAAAM,wBAAA,EACbJ;IAAa;IACzCL,CAAA,MAAAG,EAAA;IAAAH,CAAA,MAAAK,EAAA;IAAAL,CAAA,MAAAO,EAAA;EAAA;IAAAA,EAAA,GAAAP,CAAA;EAAA;EAHA;IAAAU;EAAA,IAAmCd,uBAAA,CAAwBW,EAG3D;EAAA,IAAAI,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAZ,CAAA,QAAAE,MAAA;IAEUS,EAAA,GAAAA,CAAA;MAAA,KACHT,MAAA,CAAAW,QAAA,EAAAlB,gBAAA,CAAkC;QAAA,UAAAmB,KAAA,CACrB;MAAA;MAAA,OAGXZ,MAAA,CAAAa,eAAA,CAAAlB,2BAAA,EAAAmB,KAAA,EAAA1B,uBAqBL;IAAA;IAEDsB,EAAA,IAACV,MAAA;IAAOF,CAAA,MAAAE,MAAA;IAAAF,CAAA,MAAAW,EAAA;IAAAX,CAAA,MAAAY,EAAA;EAAA;IAAAD,EAAA,GAAAX,CAAA;IAAAY,EAAA,GAAAZ,CAAA;EAAA;EA5BXR,SAAA,CAAUmB,EA4BV,EAAGC,EAAQ;EAAA,IAAAK,EAAA;EAAA,IAAAjB,CAAA,QAAAU,sBAAA;IAEJO,EAAA,GAAAC,IAAA,CAAAzB,kBAAA;MAAAiB;IAAA,C;;;;;;SAAAO,E;CACT;AAvC6E,SAAAD,MAAAG,OAAA;EAgBrE,MAAAC,SAAA,GAAkBjC,aAAA,MAAmBD,qBAAA;EAAA,IAEjCG,iBAAA,CAAkB+B,SAAA;IACpB,MAAAC,gBAAA,GAAyB3B,uBAAA,CAAwByB,OAAA;IAEjD;MAAAG;IAAA,IAAkBF,SAAA;IAClB,MAAAG,SAAA,GAAkBD,KAAA,CAAAE,OAAA,CAAa;IAE/BvC,wBAAA,CAAyBoC,gBAAA;IAAA,IAGrBjC,gBAAA,CAAiBmC,SAAA,MAAeA,SAAA,CAAAE,OAAiB;MACnDF,SAAA,CAAAG,MAAA,CAAgB;IAAA;EAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -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;AAOrE,KAAK,8BAA8B,GAAG;IACpC,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IACnC,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,KAAK,6BAA6B,GAAG;IACnC,kBAAkB,EAAE,sBAAsB,EAAE,CAAA;IAC5C,sBAAsB,EAAE,cAAc,EAAE,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,uBAAuB,GAClC,UAAU,8BAA8B,KACvC,6BAmBF,CAAA"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useConfig, useEntityVisibility } from '@payloadcms/ui';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import { filterEnabledRelationshipCollections } from '../../shared/filterEnabledRelationshipCollections.js';
|
|
5
6
|
export const useEnabledRelationships = options => {
|
|
6
7
|
const {
|
|
7
8
|
collectionSlugsBlacklist,
|
|
@@ -16,49 +17,17 @@ export const useEnabledRelationships = options => {
|
|
|
16
17
|
const {
|
|
17
18
|
visibleEntities
|
|
18
19
|
} = useEntityVisibility();
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
slug,
|
|
27
|
-
admin: {
|
|
28
|
-
enableRichTextRelationship
|
|
29
|
-
},
|
|
30
|
-
upload
|
|
31
|
-
} = collection;
|
|
32
|
-
// Check visibility
|
|
33
|
-
if (!visibleEntities?.collections.includes(slug)) {
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
// Check rich text relationship and upload settings
|
|
37
|
-
if (uploads) {
|
|
38
|
-
if (!enableRichTextRelationship || !upload) {
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
if (upload || !enableRichTextRelationship) {
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// Check whitelist (if provided, only include slugs in the whitelist)
|
|
47
|
-
if (whitelistSet && !whitelistSet.has(slug)) {
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
// Check blacklist (if provided, exclude slugs in the blacklist)
|
|
51
|
-
if (blacklistSet && blacklistSet.has(slug)) {
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
enabledCollectionSlugs.push(slug);
|
|
55
|
-
enabledCollections.push(collection);
|
|
56
|
-
}
|
|
20
|
+
return React.useMemo(() => {
|
|
21
|
+
const enabledCollections = filterEnabledRelationshipCollections(collections, {
|
|
22
|
+
disabledCollections: collectionSlugsBlacklist,
|
|
23
|
+
enabledCollections: collectionSlugsWhitelist,
|
|
24
|
+
uploads,
|
|
25
|
+
visibleSlugs: visibleEntities?.collections
|
|
26
|
+
});
|
|
57
27
|
return {
|
|
58
28
|
enabledCollections,
|
|
59
|
-
enabledCollectionSlugs
|
|
29
|
+
enabledCollectionSlugs: enabledCollections.map(c => c.slug)
|
|
60
30
|
};
|
|
61
31
|
}, [collections, visibleEntities, uploads, collectionSlugsWhitelist, collectionSlugsBlacklist]);
|
|
62
|
-
return result;
|
|
63
32
|
};
|
|
64
33
|
//# sourceMappingURL=useEnabledRelationships.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEnabledRelationships.js","names":["useConfig","useEntityVisibility","React","useEnabledRelationships","options","collectionSlugsBlacklist","collectionSlugsWhitelist","uploads","config","collections","visibleEntities","
|
|
1
|
+
{"version":3,"file":"useEnabledRelationships.js","names":["useConfig","useEntityVisibility","React","filterEnabledRelationshipCollections","useEnabledRelationships","options","collectionSlugsBlacklist","collectionSlugsWhitelist","uploads","config","collections","visibleEntities","useMemo","enabledCollections","disabledCollections","visibleSlugs","enabledCollectionSlugs","map","c","slug"],"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\nimport { filterEnabledRelationshipCollections } from '../../shared/filterEnabledRelationshipCollections.js'\n\ntype UseEnabledRelationshipsOptions = {\n collectionSlugsBlacklist?: string[]\n collectionSlugsWhitelist?: string[]\n uploads?: boolean\n}\n\ntype UseEnabledRelationshipsResult = {\n enabledCollections: ClientCollectionConfig[]\n enabledCollectionSlugs: CollectionSlug[]\n}\n\nexport const useEnabledRelationships = (\n options?: UseEnabledRelationshipsOptions,\n): UseEnabledRelationshipsResult => {\n const { collectionSlugsBlacklist, collectionSlugsWhitelist, uploads = false } = options || {}\n const {\n config: { collections },\n } = useConfig()\n const { visibleEntities } = useEntityVisibility()\n\n return React.useMemo(() => {\n const enabledCollections = filterEnabledRelationshipCollections(collections, {\n disabledCollections: collectionSlugsBlacklist,\n enabledCollections: collectionSlugsWhitelist,\n uploads,\n visibleSlugs: visibleEntities?.collections,\n })\n return {\n enabledCollections,\n enabledCollectionSlugs: enabledCollections.map((c) => c.slug),\n }\n }, [collections, visibleEntities, uploads, collectionSlugsWhitelist, collectionSlugsBlacklist])\n}\n"],"mappings":"AAAA;;AAGA,SAASA,SAAS,EAAEC,mBAAmB,QAAQ;AAC/C,YAAYC,KAAA,MAAW;AAEvB,SAASC,oCAAoC,QAAQ;AAarD,OAAO,MAAMC,uBAAA,GACXC,OAAA;EAEA,MAAM;IAAEC,wBAAwB;IAAEC,wBAAwB;IAAEC,OAAA,GAAU;EAAK,CAAE,GAAGH,OAAA,IAAW,CAAC;EAC5F,MAAM;IACJI,MAAA,EAAQ;MAAEC;IAAW;EAAE,CACxB,GAAGV,SAAA;EACJ,MAAM;IAAEW;EAAe,CAAE,GAAGV,mBAAA;EAE5B,OAAOC,KAAA,CAAMU,OAAO,CAAC;IACnB,MAAMC,kBAAA,GAAqBV,oCAAA,CAAqCO,WAAA,EAAa;MAC3EI,mBAAA,EAAqBR,wBAAA;MACrBO,kBAAA,EAAoBN,wBAAA;MACpBC,OAAA;MACAO,YAAA,EAAcJ,eAAA,EAAiBD;IACjC;IACA,OAAO;MACLG,kBAAA;MACAG,sBAAA,EAAwBH,kBAAA,CAAmBI,GAAG,CAAEC,CAAA,IAAMA,CAAA,CAAEC,IAAI;IAC9D;EACF,GAAG,CAACT,WAAA,EAAaC,eAAA,EAAiBH,OAAA,EAASD,wBAAA,EAA0BD,wBAAA,CAAyB;AAChG","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PopulationPromise } from '../../typesServer.js';
|
|
2
2
|
import type { RelationshipFeatureProps } from './index.js';
|
|
3
|
-
import type { SerializedRelationshipNode } from './
|
|
3
|
+
import type { SerializedRelationshipNode } from './schema.js';
|
|
4
4
|
export declare const relationshipPopulationPromiseHOC: (props: RelationshipFeatureProps) => 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,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,
|
|
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,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAI7D,eAAO,MAAM,gCAAgC,GAC3C,OAAO,wBAAwB,KAC9B,iBAAiB,CAAC,0BAA0B,CAwC9C,CAAA"}
|
|
@@ -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","relationTo","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 { RelationshipFeatureProps } from './index.js'\nimport type { SerializedRelationshipNode } from './
|
|
1
|
+
{"version":3,"file":"graphQLPopulationPromise.js","names":["populate","relationshipPopulationPromiseHOC","props","relationshipPopulationPromise","currentDepth","depth","draft","node","overrideAccess","populationPromises","req","showHiddenFields","value","id","collection","payload","collections","relationTo","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 { RelationshipFeatureProps } from './index.js'\nimport type { SerializedRelationshipNode } from './schema.js'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\n\nexport const relationshipPopulationPromiseHOC = (\n props: RelationshipFeatureProps,\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) {\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,EAAO;MACf;MACA,MAAMC,EAAA,GAAKN,IAAA,EAAMK,KAAA,EAAOC,EAAA,IAAMN,IAAA,EAAMK,KAAA,CAAM;AAAA;MAE1C,MAAME,UAAA,GAAaJ,GAAA,CAAIK,OAAO,CAACC,WAAW,CAACT,IAAA,EAAMU,UAAA,CAAW;MAE5D,IAAIH,UAAA,EAAY;QACd,MAAMI,aAAA,GACJhB,KAAA,EAAOiB,QAAA,KAAaC,SAAA,IAAalB,KAAA,EAAOiB,QAAA,GAAWd,KAAA,GAAQH,KAAA,EAAOiB,QAAA,GAAWd,KAAA;QAE/EI,kBAAA,CAAmBY,IAAI,CACrBrB,QAAA,CAAS;UACPa,EAAA;UACAS,cAAA,EAAgBR,UAAA,CAAWS,MAAM,CAACC,IAAI;UACtCpB,YAAA;UACAqB,IAAA,EAAMlB,IAAA;UACNF,KAAA,EAAOa,aAAA;UACPZ,KAAA;UACAoB,GAAA,EAAK;UACLlB,cAAA;UACAE,GAAA;UACAC;QACF;MAEJ;IACF;EACF;EAEA,OAAOR,6BAAA;AACT","ignoreList":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CollectionSlug } from 'payload';
|
|
2
|
+
export type { RelationshipData, SerializedRelationshipNode } from './schema.js';
|
|
2
3
|
export type ExclusiveRelationshipFeatureProps = {
|
|
3
4
|
/**
|
|
4
5
|
* The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.
|
|
@@ -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;AAU7C,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,eAAO,MAAM,mBAAmB,qJAqE9B,CAAA"}
|
|
@@ -4,6 +4,7 @@ import { createNode } from '../../typeUtilities.js';
|
|
|
4
4
|
import { relationshipPopulationPromiseHOC } from './graphQLPopulationPromise.js';
|
|
5
5
|
import { i18n } from './i18n.js';
|
|
6
6
|
import { RelationshipServerNode } from './nodes/RelationshipNode.js';
|
|
7
|
+
import { createRelationshipNodeJSONSchema } from './schema.js';
|
|
7
8
|
export const RelationshipFeature = createServerFeature({
|
|
8
9
|
feature: ({
|
|
9
10
|
props
|
|
@@ -58,6 +59,7 @@ export const RelationshipFeature = createServerFeature({
|
|
|
58
59
|
return node;
|
|
59
60
|
}]
|
|
60
61
|
},
|
|
62
|
+
jsonSchema: createRelationshipNodeJSONSchema(props),
|
|
61
63
|
node: RelationshipServerNode
|
|
62
64
|
})]
|
|
63
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["populate","createServerFeature","createNode","relationshipPopulationPromiseHOC","i18n","RelationshipServerNode","RelationshipFeature","feature","props","maxDepth","clientFeatureProps","ClientFeature","nodes","graphQLPopulationPromises","hooks","afterRead","currentDepth","depth","draft","node","overrideAccess","populateArg","populationPromises","req","showHiddenFields","value","collection","payload","collections","relationTo","id","populateDepth","undefined","push","collectionSlug","config","slug","data","key","select","defaultPopulate"],"sources":["../../../../src/features/relationship/server/index.ts"],"sourcesContent":["import type { CollectionSlug } from 'payload'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { relationshipPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { RelationshipServerNode } from './nodes/RelationshipNode.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?: CollectionSlug[]\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?: CollectionSlug[]\n }\n\nexport type RelationshipFeatureProps = {\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} & ExclusiveRelationshipFeatureProps\n\nexport const RelationshipFeature = createServerFeature<\n RelationshipFeatureProps,\n RelationshipFeatureProps,\n ExclusiveRelationshipFeatureProps\n>({\n feature: ({ props }) => {\n // we don't need to pass maxDepth to the client, it's only used on the server\n const { maxDepth, ...clientFeatureProps } = props ?? {}\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#RelationshipFeatureClient',\n clientFeatureProps,\n i18n,\n nodes: [\n createNode({\n graphQLPopulationPromises: [relationshipPopulationPromiseHOC(props)],\n hooks: {\n afterRead: [\n ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n populateArg,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (!node?.value) {\n return node\n }\n const collection = req.payload.collections[node?.relationTo]\n\n if (!collection) {\n return node\n }\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const populateDepth = maxDepth !== undefined && maxDepth < depth ? 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 select:\n populateArg?.[collection.config.slug] ?? collection.config.defaultPopulate,\n showHiddenFields,\n }),\n )\n\n return node\n },\n ],\n },\n node: RelationshipServerNode,\n }),\n ],\n }\n },\n key: 'relationship',\n})\n"],"mappings":"AAEA,SAASA,QAAQ,QAAQ;AACzB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,gCAAgC,QAAQ;AACjD,SAASC,IAAI,QAAQ;AACrB,SAASC,sBAAsB,QAAQ;
|
|
1
|
+
{"version":3,"file":"index.js","names":["populate","createServerFeature","createNode","relationshipPopulationPromiseHOC","i18n","RelationshipServerNode","createRelationshipNodeJSONSchema","RelationshipFeature","feature","props","maxDepth","clientFeatureProps","ClientFeature","nodes","graphQLPopulationPromises","hooks","afterRead","currentDepth","depth","draft","node","overrideAccess","populateArg","populationPromises","req","showHiddenFields","value","collection","payload","collections","relationTo","id","populateDepth","undefined","push","collectionSlug","config","slug","data","key","select","defaultPopulate","jsonSchema"],"sources":["../../../../src/features/relationship/server/index.ts"],"sourcesContent":["import type { CollectionSlug } from 'payload'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { relationshipPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { RelationshipServerNode } from './nodes/RelationshipNode.js'\nimport { createRelationshipNodeJSONSchema } from './schema.js'\n\nexport type { RelationshipData, SerializedRelationshipNode } from './schema.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?: CollectionSlug[]\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?: CollectionSlug[]\n }\n\nexport type RelationshipFeatureProps = {\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} & ExclusiveRelationshipFeatureProps\n\nexport const RelationshipFeature = createServerFeature<\n RelationshipFeatureProps,\n RelationshipFeatureProps,\n ExclusiveRelationshipFeatureProps\n>({\n feature: ({ props }) => {\n // we don't need to pass maxDepth to the client, it's only used on the server\n const { maxDepth, ...clientFeatureProps } = props ?? {}\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#RelationshipFeatureClient',\n clientFeatureProps,\n i18n,\n nodes: [\n createNode({\n graphQLPopulationPromises: [relationshipPopulationPromiseHOC(props)],\n hooks: {\n afterRead: [\n ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n populateArg,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (!node?.value) {\n return node\n }\n const collection = req.payload.collections[node?.relationTo]\n\n if (!collection) {\n return node\n }\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const populateDepth = maxDepth !== undefined && maxDepth < depth ? 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 select:\n populateArg?.[collection.config.slug] ?? collection.config.defaultPopulate,\n showHiddenFields,\n }),\n )\n\n return node\n },\n ],\n },\n jsonSchema: createRelationshipNodeJSONSchema(props),\n node: RelationshipServerNode,\n }),\n ],\n }\n },\n key: 'relationship',\n})\n"],"mappings":"AAEA,SAASA,QAAQ,QAAQ;AACzB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,gCAAgC,QAAQ;AACjD,SAASC,IAAI,QAAQ;AACrB,SAASC,sBAAsB,QAAQ;AACvC,SAASC,gCAAgC,QAAQ;AAoCjD,OAAO,MAAMC,mBAAA,GAAsBN,mBAAA,CAIjC;EACAO,OAAA,EAASA,CAAC;IAAEC;EAAK,CAAE;IACjB;IACA,MAAM;MAAEC,QAAQ;MAAE,GAAGC;IAAA,CAAoB,GAAGF,KAAA,IAAS,CAAC;IACtD,OAAO;MACLG,aAAA,EAAe;MACfD,kBAAA;MACAP,IAAA;MACAS,KAAA,EAAO,CACLX,UAAA,CAAW;QACTY,yBAAA,EAA2B,CAACX,gCAAA,CAAiCM,KAAA,EAAO;QACpEM,KAAA,EAAO;UACLC,SAAA,EAAW,CACT,CAAC;YACCC,YAAY;YACZC,KAAK;YACLC,KAAK;YACLC,IAAI;YACJC,cAAc;YACdC,WAAW;YACXC,kBAAkB;YAClBC,GAAG;YACHC;UAAgB,CACjB;YACC,IAAI,CAACL,IAAA,EAAMM,KAAA,EAAO;cAChB,OAAON,IAAA;YACT;YACA,MAAMO,UAAA,GAAaH,GAAA,CAAII,OAAO,CAACC,WAAW,CAACT,IAAA,EAAMU,UAAA,CAAW;YAE5D,IAAI,CAACH,UAAA,EAAY;cACf,OAAOP,IAAA;YACT;YACA;YACA,MAAMW,EAAA,GAAKX,IAAA,EAAMM,KAAA,EAAOK,EAAA,IAAMX,IAAA,EAAMM,KAAA,CAAM;AAAA;YAE1C,MAAMM,aAAA,GAAgBtB,QAAA,KAAauB,SAAA,IAAavB,QAAA,GAAWQ,KAAA,GAAQR,QAAA,GAAWQ,KAAA;YAE9EK,kBAAA,CAAmBW,IAAI,CACrBlC,QAAA,CAAS;cACP+B,EAAA;cACAI,cAAA,EAAgBR,UAAA,CAAWS,MAAM,CAACC,IAAI;cACtCpB,YAAA;cACAqB,IAAA,EAAMlB,IAAA;cACNF,KAAA,EAAOc,aAAA;cACPb,KAAA;cACAoB,GAAA,EAAK;cACLlB,cAAA;cACAG,GAAA;cACAgB,MAAA,EACElB,WAAA,GAAcK,UAAA,CAAWS,MAAM,CAACC,IAAI,CAAC,IAAIV,UAAA,CAAWS,MAAM,CAACK,eAAe;cAC5EhB;YACF;YAGF,OAAOL,IAAA;UACT;QAEJ;QACAsB,UAAA,EAAYpC,gCAAA,CAAiCG,KAAA;QAC7CW,IAAA,EAAMf;MACR;IAEJ;EACF;EACAkC,GAAA,EAAK;AACP","ignoreList":[]}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
|
|
2
|
-
import type { CollectionSlug, DataFromCollectionSlug } from 'payload';
|
|
3
1
|
import type { JSX } from 'react';
|
|
4
2
|
import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
|
|
5
3
|
import { type DOMConversionMap, type DOMExportOutput, type EditorConfig, type ElementFormatType, type LexicalEditor, type LexicalNode, type NodeKey } from 'lexical';
|
|
6
|
-
import type {
|
|
7
|
-
export type RelationshipData = {
|
|
8
|
-
[TCollectionSlug in CollectionSlug]: {
|
|
9
|
-
relationTo: TCollectionSlug;
|
|
10
|
-
value: DataFromCollectionSlug<TCollectionSlug> | number | string;
|
|
11
|
-
};
|
|
12
|
-
}[CollectionSlug];
|
|
13
|
-
export type SerializedRelationshipNode = RelationshipData & StronglyTypedLeafNode<SerializedDecoratorBlockNode, 'relationship'>;
|
|
4
|
+
import type { RelationshipData, SerializedRelationshipNode } from '../schema.js';
|
|
14
5
|
export declare class RelationshipServerNode extends DecoratorBlockNode {
|
|
15
6
|
__data: RelationshipData;
|
|
16
7
|
constructor({ data, format, key, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/relationship/server/nodes/RelationshipNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"RelationshipNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/relationship/server/nodes/RelationshipNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAA;AAEhF,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,OAAO,EACb,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAgBhF,qBAAa,sBAAuB,SAAQ,kBAAkB;IAC5D,MAAM,EAAE,gBAAgB,CAAA;gBAEZ,EACV,IAAI,EACJ,MAAM,EACN,GAAG,GACJ,EAAE;QACD,IAAI,EAAE,gBAAgB,CAAA;QACtB,MAAM,CAAC,EAAE,iBAAiB,CAAA;QAC1B,GAAG,CAAC,EAAE,OAAO,CAAA;KACd;WAKe,KAAK,CAAC,IAAI,EAAE,sBAAsB,GAAG,sBAAsB;WAQ3D,OAAO,IAAI,MAAM;WAIjB,SAAS,IAAI,gBAAgB,CAAC,cAAc,CAAC,GAAG,IAAI;WAiBpD,UAAU,CAAC,cAAc,EAAE,0BAA0B,GAAG,sBAAsB;IAc9F,MAAM,CAAC,QAAQ,IAAI,KAAK;IAIf,SAAS,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW;IAM7C,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO;IAIpE,SAAS,IAAI,eAAe;IAa5B,UAAU,IAAI,0BAA0B;IASjD,OAAO,IAAI,gBAAgB;IAIlB,cAAc,IAAI,MAAM;IAIjC,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;CAItC;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,gBAAgB,GAAG,sBAAsB,CAM5F;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,sBAAsB,GAAG,SAAS,GAC5D,IAAI,IAAI,sBAAsB,CAEhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipNode.js","names":["DecoratorBlockNode","addClassNamesToElement","$applyNodeReplacement","$relationshipElementToServerNode","domNode","id","getAttribute","relationTo","node","$createServerRelationshipNode","value","RelationshipServerNode","__data","constructor","data","format","key","clone","__format","__key","getType","importDOM","div","hasAttribute","conversion","priority","importJSON","serializedNode","version","importedData","setFormat","isInline","createDOM","config","element","document","createElement","theme","relationship","decorate","_editor","_config","exportDOM","setAttribute","String","text","createTextNode","getTextContent","append","exportJSON","getData","type","getLatest","setData","writable","getWritable","$isServerRelationshipNode"],"sources":["../../../../../src/features/relationship/server/nodes/RelationshipNode.tsx"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"RelationshipNode.js","names":["DecoratorBlockNode","addClassNamesToElement","$applyNodeReplacement","$relationshipElementToServerNode","domNode","id","getAttribute","relationTo","node","$createServerRelationshipNode","value","RelationshipServerNode","__data","constructor","data","format","key","clone","__format","__key","getType","importDOM","div","hasAttribute","conversion","priority","importJSON","serializedNode","version","importedData","setFormat","isInline","createDOM","config","element","document","createElement","theme","relationship","decorate","_editor","_config","exportDOM","setAttribute","String","text","createTextNode","getTextContent","append","exportJSON","getData","type","getLatest","setData","writable","getWritable","$isServerRelationshipNode"],"sources":["../../../../../src/features/relationship/server/nodes/RelationshipNode.tsx"],"sourcesContent":["import type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport { addClassNamesToElement } from '@lexical/utils'\nimport {\n $applyNodeReplacement,\n type DOMConversionMap,\n type DOMConversionOutput,\n type DOMExportOutput,\n type EditorConfig,\n type ElementFormatType,\n type LexicalEditor,\n type LexicalNode,\n type NodeKey,\n} from 'lexical'\n\nimport type { RelationshipData, SerializedRelationshipNode } from '../schema.js'\n\nfunction $relationshipElementToServerNode(domNode: HTMLDivElement): DOMConversionOutput | null {\n const id = domNode.getAttribute('data-lexical-relationship-id')\n const relationTo = domNode.getAttribute('data-lexical-relationship-relationTo')\n\n if (id != null && relationTo != null) {\n const node = $createServerRelationshipNode({\n relationTo,\n value: id,\n })\n return { node }\n }\n return null\n}\n\nexport class RelationshipServerNode extends DecoratorBlockNode {\n __data: RelationshipData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: RelationshipData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static override clone(node: RelationshipServerNode): RelationshipServerNode {\n return new this({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'relationship'\n }\n\n static override importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {\n div: (domNode: HTMLDivElement) => {\n if (\n !domNode.hasAttribute('data-lexical-relationship-relationTo') ||\n !domNode.hasAttribute('data-lexical-relationship-id')\n ) {\n return null\n }\n return {\n conversion: $relationshipElementToServerNode,\n priority: 2,\n }\n },\n }\n }\n\n static override importJSON(serializedNode: SerializedRelationshipNode): RelationshipServerNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n\n const importedData: RelationshipData = {\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n const node = $createServerRelationshipNode(importedData)\n node.setFormat(serializedNode.format)\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n override createDOM(config?: EditorConfig): HTMLElement {\n const element = document.createElement('div')\n addClassNamesToElement(element, config?.theme?.relationship)\n return element\n }\n\n override decorate(_editor: LexicalEditor, _config: EditorConfig): JSX.Element {\n return null as unknown as JSX.Element\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('div')\n element.setAttribute(\n 'data-lexical-relationship-id',\n String(typeof this.__data?.value === 'object' ? this.__data?.value?.id : this.__data?.value),\n )\n element.setAttribute('data-lexical-relationship-relationTo', this.__data?.relationTo)\n\n const text = document.createTextNode(this.getTextContent())\n element.append(text)\n return { element }\n }\n\n override exportJSON(): SerializedRelationshipNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'relationship',\n version: 2,\n }\n }\n\n getData(): RelationshipData {\n return this.getLatest().__data\n }\n\n override getTextContent(): string {\n return `${this.__data?.relationTo} relation to ${typeof this.__data?.value === 'object' ? this.__data?.value?.id : this.__data?.value}`\n }\n\n setData(data: RelationshipData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n}\n\nexport function $createServerRelationshipNode(data: RelationshipData): RelationshipServerNode {\n return $applyNodeReplacement(\n new RelationshipServerNode({\n data,\n }),\n )\n}\n\nexport function $isServerRelationshipNode(\n node: LexicalNode | null | RelationshipServerNode | undefined,\n): node is RelationshipServerNode {\n return node instanceof RelationshipServerNode\n}\n"],"mappings":"AAEA,SAASA,kBAAkB,QAAQ;AACnC,SAASC,sBAAsB,QAAQ;AACvC,SACEC,qBAAqB,QAShB;AAIP,SAASC,iCAAiCC,OAAuB;EAC/D,MAAMC,EAAA,GAAKD,OAAA,CAAQE,YAAY,CAAC;EAChC,MAAMC,UAAA,GAAaH,OAAA,CAAQE,YAAY,CAAC;EAExC,IAAID,EAAA,IAAM,QAAQE,UAAA,IAAc,MAAM;IACpC,MAAMC,IAAA,GAAOC,6BAAA,CAA8B;MACzCF,UAAA;MACAG,KAAA,EAAOL;IACT;IACA,OAAO;MAAEG;IAAK;EAChB;EACA,OAAO;AACT;AAEA,OAAO,MAAMG,sBAAA,SAA+BX,kBAAA;EAC1CY,MAAA;EAEAC,YAAY;IACVC,IAAI;IACJC,MAAM;IACNC;EAAG,CAKJ,EAAE;IACD,KAAK,CAACD,MAAA,EAAQC,GAAA;IACd,IAAI,CAACJ,MAAM,GAAGE,IAAA;EAChB;EAEA,OAAgBG,MAAMT,IAA4B,EAA0B;IAC1E,OAAO,IAAI,IAAI,CAAC;MACdM,IAAA,EAAMN,IAAA,CAAKI,MAAM;MACjBG,MAAA,EAAQP,IAAA,CAAKU,QAAQ;MACrBF,GAAA,EAAKR,IAAA,CAAKW;IACZ;EACF;EAEA,OAAgBC,QAAA,EAAkB;IAChC,OAAO;EACT;EAEA,OAAgBC,UAAA,EAAqD;IACnE,OAAO;MACLC,GAAA,EAAMlB,OAAA;QACJ,IACE,CAACA,OAAA,CAAQmB,YAAY,CAAC,2CACtB,CAACnB,OAAA,CAAQmB,YAAY,CAAC,iCACtB;UACA,OAAO;QACT;QACA,OAAO;UACLC,UAAA,EAAYrB,gCAAA;UACZsB,QAAA,EAAU;QACZ;MACF;IACF;EACF;EAEA,OAAgBC,WAAWC,cAA0C,EAA0B;IAC7F,IAAIA,cAAA,CAAeC,OAAO,KAAK,KAAMD,cAAA,EAAgBjB,KAAA,EAAqCL,EAAA,EAAI;MAC5FsB,cAAA,CAAejB,KAAK,GAAGiB,cAAC,CAAejB,KAAK,CAA+BL,EAAE;IAC/E;IAEA,MAAMwB,YAAA,GAAiC;MACrCtB,UAAA,EAAYoB,cAAA,CAAepB,UAAU;MACrCG,KAAA,EAAOiB,cAAA,CAAejB;IACxB;IACA,MAAMF,IAAA,GAAOC,6BAAA,CAA8BoB,YAAA;IAC3CrB,IAAA,CAAKsB,SAAS,CAACH,cAAA,CAAeZ,MAAM;IACpC,OAAOP,IAAA;EACT;EAEA,OAAOuB,SAAA,EAAkB;IACvB,OAAO;EACT;EAESC,UAAUC,MAAqB,EAAe;IACrD,MAAMC,OAAA,GAAUC,QAAA,CAASC,aAAa,CAAC;IACvCnC,sBAAA,CAAuBiC,OAAA,EAASD,MAAA,EAAQI,KAAA,EAAOC,YAAA;IAC/C,OAAOJ,OAAA;EACT;EAESK,SAASC,OAAsB,EAAEC,OAAqB,EAAe;IAC5E,OAAO;EACT;EAESC,UAAA,EAA6B;IACpC,MAAMR,OAAA,GAAUC,QAAA,CAASC,aAAa,CAAC;IACvCF,OAAA,CAAQS,YAAY,CAClB,gCACAC,MAAA,CAAO,OAAO,IAAI,CAAChC,MAAM,EAAEF,KAAA,KAAU,WAAW,IAAI,CAACE,MAAM,EAAEF,KAAA,EAAOL,EAAA,GAAK,IAAI,CAACO,MAAM,EAAEF,KAAA;IAExFwB,OAAA,CAAQS,YAAY,CAAC,wCAAwC,IAAI,CAAC/B,MAAM,EAAEL,UAAA;IAE1E,MAAMsC,IAAA,GAAOV,QAAA,CAASW,cAAc,CAAC,IAAI,CAACC,cAAc;IACxDb,OAAA,CAAQc,MAAM,CAACH,IAAA;IACf,OAAO;MAAEX;IAAQ;EACnB;EAESe,WAAA,EAAyC;IAChD,OAAO;MACL,GAAG,KAAK,CAACA,UAAA,EAAY;MACrB,GAAG,IAAI,CAACC,OAAO,EAAE;MACjBC,IAAA,EAAM;MACNvB,OAAA,EAAS;IACX;EACF;EAEAsB,QAAA,EAA4B;IAC1B,OAAO,IAAI,CAACE,SAAS,GAAGxC,MAAM;EAChC;EAESmC,eAAA,EAAyB;IAChC,OAAO,GAAG,IAAI,CAACnC,MAAM,EAAEL,UAAA,gBAA0B,OAAO,IAAI,CAACK,MAAM,EAAEF,KAAA,KAAU,WAAW,IAAI,CAACE,MAAM,EAAEF,KAAA,EAAOL,EAAA,GAAK,IAAI,CAACO,MAAM,EAAEF,KAAA,EAAO;EACzI;EAEA2C,QAAQvC,IAAsB,EAAQ;IACpC,MAAMwC,QAAA,GAAW,IAAI,CAACC,WAAW;IACjCD,QAAA,CAAS1C,MAAM,GAAGE,IAAA;EACpB;AACF;AAEA,OAAO,SAASL,8BAA8BK,IAAsB;EAClE,OAAOZ,qBAAA,CACL,IAAIS,sBAAA,CAAuB;IACzBG;EACF;AAEJ;AAEA,OAAO,SAAS0C,0BACdhD,IAA6D;EAE7D,OAAOA,IAAA,YAAgBG,sBAAA;AACzB","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CollectionSlug, DataFromCollectionSlug, UploadCollectionSlug } from 'payload';
|
|
2
|
+
import type { LexicalElementFormat } from '../../../types/nodeTypes.js';
|
|
3
|
+
import type { JSONSchemaFn } from '../../typesServer.js';
|
|
4
|
+
import type { RelationshipFeatureProps } from './index.js';
|
|
5
|
+
export type RelationshipData = {
|
|
6
|
+
[TCollectionSlug in CollectionSlug]: {
|
|
7
|
+
relationTo: TCollectionSlug;
|
|
8
|
+
value: DataFromCollectionSlug<TCollectionSlug> | number | string;
|
|
9
|
+
};
|
|
10
|
+
}[CollectionSlug];
|
|
11
|
+
/**
|
|
12
|
+
* Exclude upload collection slugs. This matches runtime behavior, as well as the json schema.
|
|
13
|
+
*/
|
|
14
|
+
export type NonUploadCollectionSlug = [Exclude<CollectionSlug, UploadCollectionSlug>] extends [
|
|
15
|
+
never
|
|
16
|
+
] ? CollectionSlug : Exclude<CollectionSlug, UploadCollectionSlug>;
|
|
17
|
+
export type SerializedRelationshipNode<TSlugs extends CollectionSlug = NonUploadCollectionSlug> = {
|
|
18
|
+
[TSlug in TSlugs]: {
|
|
19
|
+
relationTo: TSlug;
|
|
20
|
+
value: DataFromCollectionSlug<TSlug> | number | string;
|
|
21
|
+
};
|
|
22
|
+
}[TSlugs] & {
|
|
23
|
+
format: LexicalElementFormat;
|
|
24
|
+
type: 'relationship';
|
|
25
|
+
version: number;
|
|
26
|
+
};
|
|
27
|
+
export declare const createRelationshipNodeJSONSchema: (props: RelationshipFeatureProps | undefined) => JSONSchemaFn;
|
|
28
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/server/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAE3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAK1D,MAAM,MAAM,gBAAgB,GAAG;KAC5B,eAAe,IAAI,cAAc,GAAG;QACnC,UAAU,EAAE,eAAe,CAAA;QAC3B,KAAK,EAAE,sBAAsB,CAAC,eAAe,CAAC,GAAG,MAAM,GAAG,MAAM,CAAA;KACjE;CACF,CAAC,cAAc,CAAC,CAAA;AAEjB;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC,SAAS;IAC5F,KAAK;CACN,GACG,cAAc,GACd,OAAO,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAA;AAEjD,MAAM,MAAM,0BAA0B,CAAC,MAAM,SAAS,cAAc,GAAG,uBAAuB,IAAI;KAC/F,KAAK,IAAI,MAAM,GAAG;QACjB,UAAU,EAAE,KAAK,CAAA;QACjB,KAAK,EAAE,sBAAsB,CAAC,KAAK,CAAC,GAAG,MAAM,GAAG,MAAM,CAAA;KACvD;CACF,CAAC,MAAM,CAAC,GAAG;IACV,MAAM,EAAE,oBAAoB,CAAA;IAC5B,IAAI,EAAE,cAAc,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAcD,eAAO,MAAM,gCAAgC,GAC1C,OAAO,wBAAwB,GAAG,SAAS,KAAG,YAgD9C,CAAA"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { formatSchema } from '../../../types/jsonSchemaHelpers.js';
|
|
2
|
+
import { filterEnabledRelationshipCollections } from '../shared/filterEnabledRelationshipCollections.js';
|
|
3
|
+
/** MUST stay byte-for-byte in sync with the runtime `SerializedRelationshipNode` declared above. */
|
|
4
|
+
const SERIALIZED_RELATIONSHIP_NODE_TS = `export type SerializedRelationshipNode<TSlugs extends keyof Config['collections']> = {
|
|
5
|
+
type: 'relationship';
|
|
6
|
+
format: LexicalElementFormat;
|
|
7
|
+
version: number;
|
|
8
|
+
} & {
|
|
9
|
+
[TSlug in TSlugs]: {
|
|
10
|
+
relationTo: TSlug;
|
|
11
|
+
value: number | string | Config['collections'][TSlug];
|
|
12
|
+
};
|
|
13
|
+
}[TSlugs];`;
|
|
14
|
+
export const createRelationshipNodeJSONSchema = props => ({
|
|
15
|
+
collectionIDFieldTypes,
|
|
16
|
+
config,
|
|
17
|
+
typeStringDefinitions
|
|
18
|
+
}) => {
|
|
19
|
+
typeStringDefinitions.add(SERIALIZED_RELATIONSHIP_NODE_TS);
|
|
20
|
+
const enabledCollections = config?.collections ? filterEnabledRelationshipCollections(config.collections, {
|
|
21
|
+
disabledCollections: props?.disabledCollections,
|
|
22
|
+
enabledCollections: props?.enabledCollections,
|
|
23
|
+
uploads: false
|
|
24
|
+
}) : [];
|
|
25
|
+
const variants = enabledCollections.map(collection => {
|
|
26
|
+
const slug = collection.slug;
|
|
27
|
+
const idType = collectionIDFieldTypes[slug] ?? 'string';
|
|
28
|
+
return {
|
|
29
|
+
type: 'object',
|
|
30
|
+
additionalProperties: false,
|
|
31
|
+
properties: {
|
|
32
|
+
type: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
const: 'relationship'
|
|
35
|
+
},
|
|
36
|
+
format: formatSchema,
|
|
37
|
+
relationTo: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
const: slug
|
|
40
|
+
},
|
|
41
|
+
value: {
|
|
42
|
+
oneOf: [{
|
|
43
|
+
type: idType
|
|
44
|
+
}, {
|
|
45
|
+
$ref: `#/definitions/${slug}`
|
|
46
|
+
}]
|
|
47
|
+
},
|
|
48
|
+
version: {
|
|
49
|
+
type: 'integer'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
required: ['format', 'relationTo', 'type', 'value', 'version']
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
let schema;
|
|
56
|
+
if (variants.length === 0) {
|
|
57
|
+
schema = {
|
|
58
|
+
type: 'object',
|
|
59
|
+
additionalProperties: true,
|
|
60
|
+
properties: {
|
|
61
|
+
type: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
const: 'relationship'
|
|
64
|
+
},
|
|
65
|
+
version: {
|
|
66
|
+
type: 'integer'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
required: ['type', 'version']
|
|
70
|
+
};
|
|
71
|
+
} else {
|
|
72
|
+
const slugUnion = enabledCollections.map(c => `'${c.slug}'`).join(' | ');
|
|
73
|
+
const baseSchema = variants.length === 1 ? variants[0] : {
|
|
74
|
+
oneOf: variants
|
|
75
|
+
};
|
|
76
|
+
schema = {
|
|
77
|
+
...baseSchema,
|
|
78
|
+
tsType: `SerializedRelationshipNode<${slugUnion}>`
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return schema;
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","names":["formatSchema","filterEnabledRelationshipCollections","SERIALIZED_RELATIONSHIP_NODE_TS","createRelationshipNodeJSONSchema","props","collectionIDFieldTypes","config","typeStringDefinitions","add","enabledCollections","collections","disabledCollections","uploads","variants","map","collection","slug","idType","type","additionalProperties","properties","const","format","relationTo","value","oneOf","$ref","version","required","schema","length","slugUnion","c","join","baseSchema","tsType"],"sources":["../../../../src/features/relationship/server/schema.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type { CollectionSlug, DataFromCollectionSlug, UploadCollectionSlug } from 'payload'\n\nimport type { LexicalElementFormat } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaFn } from '../../typesServer.js'\nimport type { RelationshipFeatureProps } from './index.js'\n\nimport { formatSchema } from '../../../types/jsonSchemaHelpers.js'\nimport { filterEnabledRelationshipCollections } from '../shared/filterEnabledRelationshipCollections.js'\n\nexport type RelationshipData = {\n [TCollectionSlug in CollectionSlug]: {\n relationTo: TCollectionSlug\n value: DataFromCollectionSlug<TCollectionSlug> | number | string\n }\n}[CollectionSlug]\n\n/**\n * Exclude upload collection slugs. This matches runtime behavior, as well as the json schema.\n */\nexport type NonUploadCollectionSlug = [Exclude<CollectionSlug, UploadCollectionSlug>] extends [\n never,\n]\n ? CollectionSlug\n : Exclude<CollectionSlug, UploadCollectionSlug>\n\nexport type SerializedRelationshipNode<TSlugs extends CollectionSlug = NonUploadCollectionSlug> = {\n [TSlug in TSlugs]: {\n relationTo: TSlug\n value: DataFromCollectionSlug<TSlug> | number | string\n }\n}[TSlugs] & {\n format: LexicalElementFormat\n type: 'relationship'\n version: number\n}\n\n/** MUST stay byte-for-byte in sync with the runtime `SerializedRelationshipNode` declared above. */\nconst SERIALIZED_RELATIONSHIP_NODE_TS = `export type SerializedRelationshipNode<TSlugs extends keyof Config['collections']> = {\n type: 'relationship';\n format: LexicalElementFormat;\n version: number;\n} & {\n [TSlug in TSlugs]: {\n relationTo: TSlug;\n value: number | string | Config['collections'][TSlug];\n };\n}[TSlugs];`\n\nexport const createRelationshipNodeJSONSchema =\n (props: RelationshipFeatureProps | undefined): JSONSchemaFn =>\n ({ collectionIDFieldTypes, config, typeStringDefinitions }) => {\n typeStringDefinitions.add(SERIALIZED_RELATIONSHIP_NODE_TS)\n const enabledCollections = config?.collections\n ? filterEnabledRelationshipCollections(config.collections, {\n disabledCollections: props?.disabledCollections,\n enabledCollections: props?.enabledCollections,\n uploads: false,\n })\n : []\n\n const variants: JSONSchema4[] = enabledCollections.map((collection) => {\n const slug = collection.slug\n const idType: 'number' | 'string' = collectionIDFieldTypes[slug] ?? 'string'\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'relationship' },\n format: formatSchema,\n relationTo: { type: 'string', const: slug },\n value: {\n oneOf: [{ type: idType }, { $ref: `#/definitions/${slug}` }],\n },\n version: { type: 'integer' },\n },\n required: ['format', 'relationTo', 'type', 'value', 'version'],\n }\n })\n\n let schema: JSONSchema4\n if (variants.length === 0) {\n schema = {\n type: 'object',\n additionalProperties: true,\n properties: {\n type: { type: 'string', const: 'relationship' },\n version: { type: 'integer' },\n },\n required: ['type', 'version'],\n }\n } else {\n const slugUnion = enabledCollections.map((c) => `'${c.slug}'`).join(' | ')\n const baseSchema: JSONSchema4 = variants.length === 1 ? variants[0]! : { oneOf: variants }\n schema = { ...baseSchema, tsType: `SerializedRelationshipNode<${slugUnion}>` }\n }\n\n return schema\n }\n"],"mappings":"AAOA,SAASA,YAAY,QAAQ;AAC7B,SAASC,oCAAoC,QAAQ;AA6BrD;AACA,MAAMC,+BAAA,GAAkC;;;;;;;;;WAS7B;AAEX,OAAO,MAAMC,gCAAA,GACVC,KAAA,IACD,CAAC;EAAEC,sBAAsB;EAAEC,MAAM;EAAEC;AAAqB,CAAE;EACxDA,qBAAA,CAAsBC,GAAG,CAACN,+BAAA;EAC1B,MAAMO,kBAAA,GAAqBH,MAAA,EAAQI,WAAA,GAC/BT,oCAAA,CAAqCK,MAAA,CAAOI,WAAW,EAAE;IACvDC,mBAAA,EAAqBP,KAAA,EAAOO,mBAAA;IAC5BF,kBAAA,EAAoBL,KAAA,EAAOK,kBAAA;IAC3BG,OAAA,EAAS;EACX,KACA,EAAE;EAEN,MAAMC,QAAA,GAA0BJ,kBAAA,CAAmBK,GAAG,CAAEC,UAAA;IACtD,MAAMC,IAAA,GAAOD,UAAA,CAAWC,IAAI;IAC5B,MAAMC,MAAA,GAA8BZ,sBAAsB,CAACW,IAAA,CAAK,IAAI;IACpE,OAAO;MACLE,IAAA,EAAM;MACNC,oBAAA,EAAsB;MACtBC,UAAA,EAAY;QACVF,IAAA,EAAM;UAAEA,IAAA,EAAM;UAAUG,KAAA,EAAO;QAAe;QAC9CC,MAAA,EAAQtB,YAAA;QACRuB,UAAA,EAAY;UAAEL,IAAA,EAAM;UAAUG,KAAA,EAAOL;QAAK;QAC1CQ,KAAA,EAAO;UACLC,KAAA,EAAO,CAAC;YAAEP,IAAA,EAAMD;UAAO,GAAG;YAAES,IAAA,EAAM,iBAAiBV,IAAA;UAAO;QAC5D;QACAW,OAAA,EAAS;UAAET,IAAA,EAAM;QAAU;MAC7B;MACAU,QAAA,EAAU,CAAC,UAAU,cAAc,QAAQ,SAAS;IACtD;EACF;EAEA,IAAIC,MAAA;EACJ,IAAIhB,QAAA,CAASiB,MAAM,KAAK,GAAG;IACzBD,MAAA,GAAS;MACPX,IAAA,EAAM;MACNC,oBAAA,EAAsB;MACtBC,UAAA,EAAY;QACVF,IAAA,EAAM;UAAEA,IAAA,EAAM;UAAUG,KAAA,EAAO;QAAe;QAC9CM,OAAA,EAAS;UAAET,IAAA,EAAM;QAAU;MAC7B;MACAU,QAAA,EAAU,CAAC,QAAQ;IACrB;EACF,OAAO;IACL,MAAMG,SAAA,GAAYtB,kBAAA,CAAmBK,GAAG,CAAEkB,CAAA,IAAM,IAAIA,CAAA,CAAEhB,IAAI,GAAG,EAAEiB,IAAI,CAAC;IACpE,MAAMC,UAAA,GAA0BrB,QAAA,CAASiB,MAAM,KAAK,IAAIjB,QAAQ,CAAC,EAAE,GAAI;MAAEY,KAAA,EAAOZ;IAAS;IACzFgB,MAAA,GAAS;MAAE,GAAGK,UAAU;MAAEC,MAAA,EAAQ,8BAA8BJ,SAAA;IAAa;EAC/E;EAEA,OAAOF,MAAA;AACT","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type CollectionLike = {
|
|
2
|
+
admin?: {
|
|
3
|
+
enableRichTextRelationship?: boolean;
|
|
4
|
+
};
|
|
5
|
+
slug: string;
|
|
6
|
+
upload?: unknown;
|
|
7
|
+
};
|
|
8
|
+
export type FilterEnabledRelationshipCollectionsOptions = {
|
|
9
|
+
/** `disabledCollections` feature prop — slug blacklist. */
|
|
10
|
+
disabledCollections?: readonly string[];
|
|
11
|
+
/** `enabledCollections` feature prop — slug whitelist. */
|
|
12
|
+
enabledCollections?: readonly string[];
|
|
13
|
+
/** When `true`, only upload-enabled collections; when `false`, only non-upload ones. */
|
|
14
|
+
uploads: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Slugs the current user can see, supplied by the client at runtime.
|
|
17
|
+
* Server-side type generation passes `undefined` to skip the check.
|
|
18
|
+
*/
|
|
19
|
+
visibleSlugs?: readonly string[];
|
|
20
|
+
};
|
|
21
|
+
export declare const filterEnabledRelationshipCollections: <TCollection extends CollectionLike>(collections: readonly TCollection[], { disabledCollections, enabledCollections, uploads, visibleSlugs, }: FilterEnabledRelationshipCollectionsOptions) => TCollection[];
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=filterEnabledRelationshipCollections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterEnabledRelationshipCollections.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/shared/filterEnabledRelationshipCollections.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE;QACN,0BAA0B,CAAC,EAAE,OAAO,CAAA;KACrC,CAAA;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,2CAA2C,GAAG;IACxD,2DAA2D;IAC3D,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,wFAAwF;IACxF,OAAO,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,oCAAoC,GAAI,WAAW,SAAS,cAAc,EACrF,aAAa,SAAS,WAAW,EAAE,EACnC,qEAKG,2CAA2C,KAC7C,WAAW,EA4Bb,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const filterEnabledRelationshipCollections = (collections, {
|
|
2
|
+
disabledCollections,
|
|
3
|
+
enabledCollections,
|
|
4
|
+
uploads,
|
|
5
|
+
visibleSlugs
|
|
6
|
+
}) => {
|
|
7
|
+
const whitelistSet = enabledCollections?.length ? new Set(enabledCollections) : null;
|
|
8
|
+
const blacklistSet = disabledCollections?.length ? new Set(disabledCollections) : null;
|
|
9
|
+
return collections.filter(collection => {
|
|
10
|
+
const {
|
|
11
|
+
slug,
|
|
12
|
+
admin,
|
|
13
|
+
upload
|
|
14
|
+
} = collection;
|
|
15
|
+
if (visibleSlugs && !visibleSlugs.includes(slug)) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
if (uploads) {
|
|
19
|
+
if (!admin?.enableRichTextRelationship || !upload) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
} else if (upload || !admin?.enableRichTextRelationship) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
if (whitelistSet && !whitelistSet.has(slug)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (blacklistSet && blacklistSet.has(slug)) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=filterEnabledRelationshipCollections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterEnabledRelationshipCollections.js","names":["filterEnabledRelationshipCollections","collections","disabledCollections","enabledCollections","uploads","visibleSlugs","whitelistSet","length","Set","blacklistSet","filter","collection","slug","admin","upload","includes","enableRichTextRelationship","has"],"sources":["../../../../src/features/relationship/shared/filterEnabledRelationshipCollections.ts"],"sourcesContent":["type CollectionLike = {\n admin?: {\n enableRichTextRelationship?: boolean\n }\n slug: string\n upload?: unknown\n}\n\nexport type FilterEnabledRelationshipCollectionsOptions = {\n /** `disabledCollections` feature prop — slug blacklist. */\n disabledCollections?: readonly string[]\n /** `enabledCollections` feature prop — slug whitelist. */\n enabledCollections?: readonly string[]\n /** When `true`, only upload-enabled collections; when `false`, only non-upload ones. */\n uploads: boolean\n /**\n * Slugs the current user can see, supplied by the client at runtime.\n * Server-side type generation passes `undefined` to skip the check.\n */\n visibleSlugs?: readonly string[]\n}\n\nexport const filterEnabledRelationshipCollections = <TCollection extends CollectionLike>(\n collections: readonly TCollection[],\n {\n disabledCollections,\n enabledCollections,\n uploads,\n visibleSlugs,\n }: FilterEnabledRelationshipCollectionsOptions,\n): TCollection[] => {\n const whitelistSet = enabledCollections?.length ? new Set(enabledCollections) : null\n const blacklistSet = disabledCollections?.length ? new Set(disabledCollections) : null\n\n return collections.filter((collection) => {\n const { slug, admin, upload } = collection\n\n if (visibleSlugs && !visibleSlugs.includes(slug)) {\n return false\n }\n\n if (uploads) {\n if (!admin?.enableRichTextRelationship || !upload) {\n return false\n }\n } else if (upload || !admin?.enableRichTextRelationship) {\n return false\n }\n\n if (whitelistSet && !whitelistSet.has(slug)) {\n return false\n }\n if (blacklistSet && blacklistSet.has(slug)) {\n return false\n }\n\n return true\n })\n}\n"],"mappings":"AAsBA,OAAO,MAAMA,oCAAA,GAAuCA,CAClDC,WAAA,EACA;EACEC,mBAAmB;EACnBC,kBAAkB;EAClBC,OAAO;EACPC;AAAY,CACgC;EAE9C,MAAMC,YAAA,GAAeH,kBAAA,EAAoBI,MAAA,GAAS,IAAIC,GAAA,CAAIL,kBAAA,IAAsB;EAChF,MAAMM,YAAA,GAAeP,mBAAA,EAAqBK,MAAA,GAAS,IAAIC,GAAA,CAAIN,mBAAA,IAAuB;EAElF,OAAOD,WAAA,CAAYS,MAAM,CAAEC,UAAA;IACzB,MAAM;MAAEC,IAAI;MAAEC,KAAK;MAAEC;IAAM,CAAE,GAAGH,UAAA;IAEhC,IAAIN,YAAA,IAAgB,CAACA,YAAA,CAAaU,QAAQ,CAACH,IAAA,GAAO;MAChD,OAAO;IACT;IAEA,IAAIR,OAAA,EAAS;MACX,IAAI,CAACS,KAAA,EAAOG,0BAAA,IAA8B,CAACF,MAAA,EAAQ;QACjD,OAAO;MACT;IACF,OAAO,IAAIA,MAAA,IAAU,CAACD,KAAA,EAAOG,0BAAA,EAA4B;MACvD,OAAO;IACT;IAEA,IAAIV,YAAA,IAAgB,CAACA,YAAA,CAAaW,GAAG,CAACL,IAAA,GAAO;MAC3C,OAAO;IACT;IACA,IAAIH,YAAA,IAAgBA,YAAA,CAAaQ,GAAG,CAACL,IAAA,GAAO;MAC1C,OAAO;IACT;IAEA,OAAO;EACT;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addDropdownGroup.d.ts","sourceRoot":"","sources":["../../../../src/features/shared/toolbar/addDropdownGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAI7E,eAAO,MAAM,gCAAgC,
|
|
1
|
+
{"version":3,"file":"addDropdownGroup.d.ts","sourceRoot":"","sources":["../../../../src/features/shared/toolbar/addDropdownGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAI7E,eAAO,MAAM,gCAAgC,GAAI,OAAO,gBAAgB,EAAE,KAAG,YAQ5E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featureButtonsGroup.d.ts","sourceRoot":"","sources":["../../../../src/features/shared/toolbar/featureButtonsGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE7E,eAAO,MAAM,mCAAmC,
|
|
1
|
+
{"version":3,"file":"featureButtonsGroup.d.ts","sourceRoot":"","sources":["../../../../src/features/shared/toolbar/featureButtonsGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE7E,eAAO,MAAM,mCAAmC,GAAI,OAAO,gBAAgB,EAAE,KAAG,YAO/E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textDropdownGroup.d.ts","sourceRoot":"","sources":["../../../../src/features/shared/toolbar/textDropdownGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAI7E,eAAO,MAAM,iCAAiC,
|
|
1
|
+
{"version":3,"file":"textDropdownGroup.d.ts","sourceRoot":"","sources":["../../../../src/features/shared/toolbar/textDropdownGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAI7E,eAAO,MAAM,iCAAiC,GAAI,OAAO,gBAAgB,EAAE,KAAG,YAQ7E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/toolbars/shared/ToolbarButton/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,OAAO,KAA4D,MAAM,OAAO,CAAA;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGtD,OAAO,aAAa,CAAA;AAIpB,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/toolbars/shared/ToolbarButton/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,OAAO,KAA4D,MAAM,OAAO,CAAA;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGtD,OAAO,aAAa,CAAA;AAIpB,eAAO,MAAM,aAAa,GAAI,8CAM3B;IACD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAA;IAC3B,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,EAAE,gBAAgB,CAAA;CACvB,sBAmFA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropDown.d.ts","sourceRoot":"","sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/DropDown.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA4B,KAAK,aAAa,EAAE,MAAM,SAAS,CAAA;AACtE,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAA;AAGhG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAUtD,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,GACR,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,IAAI,EAAE,gBAAgB,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,GAAG,KAAK,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"DropDown.d.ts","sourceRoot":"","sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/DropDown.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA4B,KAAK,aAAa,EAAE,MAAM,SAAS,CAAA;AACtE,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAA;AAGhG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAUtD,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,GACR,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,IAAI,EAAE,gBAAgB,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,GAAG,KAAK,CAAC,SAAS,CAiElB;AAyFD,wBAAgB,QAAQ,CAAC,EACvB,eAAe,EACf,eAAe,EACf,QAAQ,EACR,QAAgB,EAChB,WAAW,EACX,IAAI,EACJ,wBAAwB,EACxB,KAAK,EACL,oBAAoB,GACrB,EAAE;IACD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACf,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B,GAAG,KAAK,CAAC,SAAS,CA0FlB"}
|
|
@@ -35,7 +35,7 @@ export function DropDownItem({
|
|
|
35
35
|
}, [ref, registerItem]);
|
|
36
36
|
return /*#__PURE__*/_jsx(Button, {
|
|
37
37
|
"aria-label": tooltip,
|
|
38
|
-
buttonStyle: "
|
|
38
|
+
buttonStyle: "ghost",
|
|
39
39
|
className: className,
|
|
40
40
|
disabled: enabled === false,
|
|
41
41
|
extraButtonProps: {
|
|
@@ -43,7 +43,6 @@ export function DropDownItem({
|
|
|
43
43
|
},
|
|
44
44
|
icon: Icon,
|
|
45
45
|
iconPosition: "left",
|
|
46
|
-
iconStyle: "none",
|
|
47
46
|
onClick: () => {
|
|
48
47
|
if (enabled !== false) {
|
|
49
48
|
editor.focus(() => {
|