@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":"DropDown.js","names":["Button","$addUpdateTag","isDOMNode","React","useCallback","useEffect","useMemo","useRef","useState","createPortal","baseClass","DropDownContext","createContext","DropDownItem","active","children","editor","enabled","Icon","item","itemKey","tooltip","className","key","filter","Boolean","join","ref","dropDownContext","use","Error","registerItem","current","_jsx","buttonStyle","disabled","extraButtonProps","icon","iconPosition","iconStyle","onClick","focus","update","onSelect","isActive","onMouseDown","e","preventDefault","type","DropDownItems","dropdownKey","dropDownRef","itemsContainerClassNames","onClose","items","setItems","highlightedItem","setHighlightedItem","itemRef","prev","handleKeyDown","event","includes","index","indexOf","length","contextValue","value","onKeyDown","DropDown","buttonAriaLabel","buttonClassName","label","stopCloseOnClickSelf","buttonRef","showDropDown","setShowDropDown","handleClose","button","dropDown","left","top","getBoundingClientRect","scrollTopOffset","window","scrollY","document","documentElement","scrollTop","style","offsetHeight","Math","min","innerWidth","offsetWidth","handle","target","contains","addEventListener","removeEventListener","portal","body","_jsxs","Fragment"],"sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/DropDown.tsx"],"sourcesContent":["'use client'\nimport { Button } from '@payloadcms/ui'\nimport { $addUpdateTag, isDOMNode, type LexicalEditor } from 'lexical'\nimport React, { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { ToolbarGroupItem } from '../../types.js'\n\nconst baseClass = 'toolbar-popup__dropdown-item'\n\ninterface DropDownContextType {\n registerItem: (ref: React.RefObject<HTMLButtonElement | null>) => void\n}\n\nconst DropDownContext = React.createContext<DropDownContextType | null>(null)\n\nexport function DropDownItem({\n active,\n children,\n editor,\n enabled,\n Icon,\n item,\n itemKey,\n tooltip,\n}: {\n active?: boolean\n children: React.ReactNode\n editor: LexicalEditor\n enabled?: boolean\n Icon: React.ReactNode\n item: ToolbarGroupItem\n itemKey: string\n tooltip?: string\n}): React.ReactNode {\n const className = useMemo(() => {\n return [\n baseClass,\n enabled === false ? 'disabled' : '',\n active ? 'active' : '',\n item?.key ? `${baseClass}-${item.key}` : '',\n ]\n .filter(Boolean)\n .join(' ')\n }, [enabled, active, item.key])\n\n const ref = useRef<HTMLButtonElement>(null)\n\n const dropDownContext = React.use(DropDownContext)\n\n if (dropDownContext === null) {\n throw new Error('DropDownItem must be used within a DropDown')\n }\n\n const { registerItem } = dropDownContext\n\n useEffect(() => {\n if (ref?.current != null) {\n registerItem(ref)\n }\n }, [ref, registerItem])\n\n return (\n <Button\n aria-label={tooltip}\n buttonStyle=\"none\"\n className={className}\n disabled={enabled === false}\n extraButtonProps={{\n 'data-item-key': itemKey,\n }}\n icon={Icon}\n iconPosition=\"left\"\n iconStyle=\"none\"\n onClick={() => {\n if (enabled !== false) {\n editor.focus(() => {\n editor.update(() => {\n $addUpdateTag('toolbar')\n })\n // We need to wrap the onSelect in the callback, so the editor is properly focused before the onSelect is called.\n item.onSelect?.({\n editor,\n isActive: active!,\n })\n })\n }\n }}\n onMouseDown={(e) => {\n // This is required for Firefox compatibility. Without it, the dropdown will disappear without the onClick being called.\n // This only happens in Firefox. Must be something about how Firefox handles focus events differently.\n e.preventDefault()\n }}\n ref={ref}\n tooltip={tooltip}\n type=\"button\"\n >\n {children}\n </Button>\n )\n}\n\nfunction DropDownItems({\n children,\n dropdownKey,\n dropDownRef,\n itemsContainerClassNames,\n onClose,\n}: {\n children: React.ReactNode\n dropdownKey?: string\n dropDownRef: React.Ref<HTMLDivElement>\n itemsContainerClassNames?: string[]\n onClose: () => void\n}): React.ReactElement {\n const [items, setItems] = useState<Array<React.RefObject<HTMLButtonElement | null>>>()\n const [highlightedItem, setHighlightedItem] =\n useState<React.RefObject<HTMLButtonElement | null>>()\n\n const registerItem = useCallback(\n (itemRef: React.RefObject<HTMLButtonElement | null>) => {\n setItems((prev) => (prev != null ? [...prev, itemRef] : [itemRef]))\n },\n [setItems],\n )\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>): void => {\n if (items == null) {\n return\n }\n\n const { key } = event\n\n if (['ArrowDown', 'ArrowUp', 'Escape', 'Tab'].includes(key)) {\n event.preventDefault()\n }\n\n if (key === 'Escape' || key === 'Tab') {\n onClose()\n } else if (key === 'ArrowUp') {\n setHighlightedItem((prev) => {\n if (prev == null) {\n return items[0]\n }\n const index = items.indexOf(prev) - 1\n return items[index === -1 ? items.length - 1 : index]\n })\n } else if (key === 'ArrowDown') {\n setHighlightedItem((prev) => {\n if (prev == null) {\n return items[0]\n }\n return items[items.indexOf(prev) + 1]\n })\n }\n }\n\n const contextValue = useMemo(\n () => ({\n registerItem,\n }),\n [registerItem],\n )\n\n useEffect(() => {\n if (items != null && highlightedItem == null) {\n setHighlightedItem(items[0])\n }\n\n if (highlightedItem != null && highlightedItem?.current != null) {\n highlightedItem.current.focus()\n }\n }, [items, highlightedItem])\n\n return (\n <DropDownContext value={contextValue}>\n <div\n className={(itemsContainerClassNames ?? ['toolbar-popup__dropdown-items']).join(' ')}\n data-dropdown-key={dropdownKey}\n data-theme=\"dark\"\n onKeyDown={handleKeyDown}\n ref={dropDownRef}\n >\n {children}\n </div>\n </DropDownContext>\n )\n}\n\nexport function DropDown({\n buttonAriaLabel,\n buttonClassName,\n children,\n disabled = false,\n dropdownKey,\n Icon,\n itemsContainerClassNames,\n label,\n stopCloseOnClickSelf,\n}: {\n buttonAriaLabel?: string\n buttonClassName: string\n children: ReactNode\n disabled?: boolean\n dropdownKey: string\n Icon?: React.FC\n itemsContainerClassNames?: string[]\n label?: string\n stopCloseOnClickSelf?: boolean\n}): React.ReactNode {\n const dropDownRef = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const [showDropDown, setShowDropDown] = useState(false)\n\n const handleClose = (): void => {\n setShowDropDown(false)\n if (buttonRef?.current != null) {\n buttonRef.current.focus()\n }\n }\n\n useEffect(() => {\n const button = buttonRef.current\n const dropDown = dropDownRef.current\n\n if (showDropDown && button !== null && dropDown !== null) {\n const { left, top } = button.getBoundingClientRect()\n const scrollTopOffset = window.scrollY || document.documentElement.scrollTop\n dropDown.style.top = `${top + scrollTopOffset + button.offsetHeight + 5}px`\n dropDown.style.left = `${Math.min(left - 5, window.innerWidth - dropDown.offsetWidth - 20)}px`\n }\n }, [dropDownRef, buttonRef, showDropDown])\n\n useEffect(() => {\n const button = buttonRef.current\n\n if (button !== null && showDropDown) {\n const handle = (event: MouseEvent): void => {\n const target = event.target\n if (!isDOMNode(target)) {\n return\n }\n if (stopCloseOnClickSelf) {\n if (dropDownRef.current && dropDownRef.current.contains(target)) {\n return\n }\n }\n if (!button.contains(target)) {\n setShowDropDown(false)\n }\n }\n document.addEventListener('click', handle)\n\n return () => {\n document.removeEventListener('click', handle)\n }\n }\n }, [dropDownRef, buttonRef, showDropDown, stopCloseOnClickSelf])\n\n const portal = createPortal(\n <DropDownItems\n dropdownKey={dropdownKey}\n dropDownRef={dropDownRef}\n itemsContainerClassNames={itemsContainerClassNames}\n onClose={handleClose}\n >\n {children}\n </DropDownItems>,\n document.body,\n )\n\n return (\n <React.Fragment>\n <button\n aria-label={buttonAriaLabel}\n className={buttonClassName + (showDropDown ? ' active' : '')}\n data-dropdown-key={dropdownKey}\n disabled={disabled}\n onClick={(event) => {\n event.preventDefault()\n setShowDropDown(!showDropDown)\n }}\n onMouseDown={(e) => {\n // This fixes a bug where you are unable to click the button if you are in a NESTED editor (editor in blocks field in editor).\n // Thus only happens if you click on the SVG of the button. Clicking on the outside works. Related issue: https://github.com/payloadcms/payload/issues/4025\n // TODO: Find out why exactly it happens and why e.preventDefault() on the mouseDown fixes it. Write that down here, or potentially fix a root cause, if there is any.\n e.preventDefault()\n }}\n ref={buttonRef}\n type=\"button\"\n >\n {Icon && <Icon />}\n {label && <span className=\"toolbar-popup__dropdown-label\">{label}</span>}\n <i className=\"toolbar-popup__dropdown-caret\" />\n </button>\n\n {showDropDown && <React.Fragment>{portal}</React.Fragment>}\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;;AACA,SAASA,MAAM,QAAQ;AACvB,SAASC,aAAa,EAAEC,SAAS,QAA4B;AAC7D,OAAOC,KAAA,IAAyBC,WAAW,EAAEC,SAAS,EAAEC,O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3,"file":"DropDown.js","names":["Button","$addUpdateTag","isDOMNode","React","useCallback","useEffect","useMemo","useRef","useState","createPortal","baseClass","DropDownContext","createContext","DropDownItem","active","children","editor","enabled","Icon","item","itemKey","tooltip","className","key","filter","Boolean","join","ref","dropDownContext","use","Error","registerItem","current","_jsx","buttonStyle","disabled","extraButtonProps","icon","iconPosition","onClick","focus","update","onSelect","isActive","onMouseDown","e","preventDefault","type","DropDownItems","dropdownKey","dropDownRef","itemsContainerClassNames","onClose","items","setItems","highlightedItem","setHighlightedItem","itemRef","prev","handleKeyDown","event","includes","index","indexOf","length","contextValue","value","onKeyDown","DropDown","buttonAriaLabel","buttonClassName","label","stopCloseOnClickSelf","buttonRef","showDropDown","setShowDropDown","handleClose","button","dropDown","left","top","getBoundingClientRect","scrollTopOffset","window","scrollY","document","documentElement","scrollTop","style","offsetHeight","Math","min","innerWidth","offsetWidth","handle","target","contains","addEventListener","removeEventListener","portal","body","_jsxs","Fragment"],"sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/DropDown.tsx"],"sourcesContent":["'use client'\nimport { Button } from '@payloadcms/ui'\nimport { $addUpdateTag, isDOMNode, type LexicalEditor } from 'lexical'\nimport React, { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { ToolbarGroupItem } from '../../types.js'\n\nconst baseClass = 'toolbar-popup__dropdown-item'\n\ninterface DropDownContextType {\n registerItem: (ref: React.RefObject<HTMLButtonElement | null>) => void\n}\n\nconst DropDownContext = React.createContext<DropDownContextType | null>(null)\n\nexport function DropDownItem({\n active,\n children,\n editor,\n enabled,\n Icon,\n item,\n itemKey,\n tooltip,\n}: {\n active?: boolean\n children: React.ReactNode\n editor: LexicalEditor\n enabled?: boolean\n Icon: React.ReactNode\n item: ToolbarGroupItem\n itemKey: string\n tooltip?: string\n}): React.ReactNode {\n const className = useMemo(() => {\n return [\n baseClass,\n enabled === false ? 'disabled' : '',\n active ? 'active' : '',\n item?.key ? `${baseClass}-${item.key}` : '',\n ]\n .filter(Boolean)\n .join(' ')\n }, [enabled, active, item.key])\n\n const ref = useRef<HTMLButtonElement>(null)\n\n const dropDownContext = React.use(DropDownContext)\n\n if (dropDownContext === null) {\n throw new Error('DropDownItem must be used within a DropDown')\n }\n\n const { registerItem } = dropDownContext\n\n useEffect(() => {\n if (ref?.current != null) {\n registerItem(ref)\n }\n }, [ref, registerItem])\n\n return (\n <Button\n aria-label={tooltip}\n buttonStyle=\"ghost\"\n className={className}\n disabled={enabled === false}\n extraButtonProps={{\n 'data-item-key': itemKey,\n }}\n icon={Icon}\n iconPosition=\"left\"\n onClick={() => {\n if (enabled !== false) {\n editor.focus(() => {\n editor.update(() => {\n $addUpdateTag('toolbar')\n })\n // We need to wrap the onSelect in the callback, so the editor is properly focused before the onSelect is called.\n item.onSelect?.({\n editor,\n isActive: active!,\n })\n })\n }\n }}\n onMouseDown={(e) => {\n // This is required for Firefox compatibility. Without it, the dropdown will disappear without the onClick being called.\n // This only happens in Firefox. Must be something about how Firefox handles focus events differently.\n e.preventDefault()\n }}\n ref={ref}\n tooltip={tooltip}\n type=\"button\"\n >\n {children}\n </Button>\n )\n}\n\nfunction DropDownItems({\n children,\n dropdownKey,\n dropDownRef,\n itemsContainerClassNames,\n onClose,\n}: {\n children: React.ReactNode\n dropdownKey?: string\n dropDownRef: React.Ref<HTMLDivElement>\n itemsContainerClassNames?: string[]\n onClose: () => void\n}): React.ReactElement {\n const [items, setItems] = useState<Array<React.RefObject<HTMLButtonElement | null>>>()\n const [highlightedItem, setHighlightedItem] =\n useState<React.RefObject<HTMLButtonElement | null>>()\n\n const registerItem = useCallback(\n (itemRef: React.RefObject<HTMLButtonElement | null>) => {\n setItems((prev) => (prev != null ? [...prev, itemRef] : [itemRef]))\n },\n [setItems],\n )\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>): void => {\n if (items == null) {\n return\n }\n\n const { key } = event\n\n if (['ArrowDown', 'ArrowUp', 'Escape', 'Tab'].includes(key)) {\n event.preventDefault()\n }\n\n if (key === 'Escape' || key === 'Tab') {\n onClose()\n } else if (key === 'ArrowUp') {\n setHighlightedItem((prev) => {\n if (prev == null) {\n return items[0]\n }\n const index = items.indexOf(prev) - 1\n return items[index === -1 ? items.length - 1 : index]\n })\n } else if (key === 'ArrowDown') {\n setHighlightedItem((prev) => {\n if (prev == null) {\n return items[0]\n }\n return items[items.indexOf(prev) + 1]\n })\n }\n }\n\n const contextValue = useMemo(\n () => ({\n registerItem,\n }),\n [registerItem],\n )\n\n useEffect(() => {\n if (items != null && highlightedItem == null) {\n setHighlightedItem(items[0])\n }\n\n if (highlightedItem != null && highlightedItem?.current != null) {\n highlightedItem.current.focus()\n }\n }, [items, highlightedItem])\n\n return (\n <DropDownContext value={contextValue}>\n <div\n className={(itemsContainerClassNames ?? ['toolbar-popup__dropdown-items']).join(' ')}\n data-dropdown-key={dropdownKey}\n data-theme=\"dark\"\n onKeyDown={handleKeyDown}\n ref={dropDownRef}\n >\n {children}\n </div>\n </DropDownContext>\n )\n}\n\nexport function DropDown({\n buttonAriaLabel,\n buttonClassName,\n children,\n disabled = false,\n dropdownKey,\n Icon,\n itemsContainerClassNames,\n label,\n stopCloseOnClickSelf,\n}: {\n buttonAriaLabel?: string\n buttonClassName: string\n children: ReactNode\n disabled?: boolean\n dropdownKey: string\n Icon?: React.FC\n itemsContainerClassNames?: string[]\n label?: string\n stopCloseOnClickSelf?: boolean\n}): React.ReactNode {\n const dropDownRef = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const [showDropDown, setShowDropDown] = useState(false)\n\n const handleClose = (): void => {\n setShowDropDown(false)\n if (buttonRef?.current != null) {\n buttonRef.current.focus()\n }\n }\n\n useEffect(() => {\n const button = buttonRef.current\n const dropDown = dropDownRef.current\n\n if (showDropDown && button !== null && dropDown !== null) {\n const { left, top } = button.getBoundingClientRect()\n const scrollTopOffset = window.scrollY || document.documentElement.scrollTop\n dropDown.style.top = `${top + scrollTopOffset + button.offsetHeight + 5}px`\n dropDown.style.left = `${Math.min(left - 5, window.innerWidth - dropDown.offsetWidth - 20)}px`\n }\n }, [dropDownRef, buttonRef, showDropDown])\n\n useEffect(() => {\n const button = buttonRef.current\n\n if (button !== null && showDropDown) {\n const handle = (event: MouseEvent): void => {\n const target = event.target\n if (!isDOMNode(target)) {\n return\n }\n if (stopCloseOnClickSelf) {\n if (dropDownRef.current && dropDownRef.current.contains(target)) {\n return\n }\n }\n if (!button.contains(target)) {\n setShowDropDown(false)\n }\n }\n document.addEventListener('click', handle)\n\n return () => {\n document.removeEventListener('click', handle)\n }\n }\n }, [dropDownRef, buttonRef, showDropDown, stopCloseOnClickSelf])\n\n const portal = createPortal(\n <DropDownItems\n dropdownKey={dropdownKey}\n dropDownRef={dropDownRef}\n itemsContainerClassNames={itemsContainerClassNames}\n onClose={handleClose}\n >\n {children}\n </DropDownItems>,\n document.body,\n )\n\n return (\n <React.Fragment>\n <button\n aria-label={buttonAriaLabel}\n className={buttonClassName + (showDropDown ? ' active' : '')}\n data-dropdown-key={dropdownKey}\n disabled={disabled}\n onClick={(event) => {\n event.preventDefault()\n setShowDropDown(!showDropDown)\n }}\n onMouseDown={(e) => {\n // This fixes a bug where you are unable to click the button if you are in a NESTED editor (editor in blocks field in editor).\n // Thus only happens if you click on the SVG of the button. Clicking on the outside works. Related issue: https://github.com/payloadcms/payload/issues/4025\n // TODO: Find out why exactly it happens and why e.preventDefault() on the mouseDown fixes it. Write that down here, or potentially fix a root cause, if there is any.\n e.preventDefault()\n }}\n ref={buttonRef}\n type=\"button\"\n >\n {Icon && <Icon />}\n {label && <span className=\"toolbar-popup__dropdown-label\">{label}</span>}\n <i className=\"toolbar-popup__dropdown-caret\" />\n </button>\n\n {showDropDown && <React.Fragment>{portal}</React.Fragment>}\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;;AACA,SAASA,MAAM,QAAQ;AACvB,SAASC,aAAa,EAAEC,SAAS,QAA4B;A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AEH;;;AAGxC","ignoreList":[]}
|
|
@@ -168,15 +168,15 @@
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
.btn__tooltip {
|
|
171
|
-
background-color: var(--
|
|
172
|
-
color: var(--
|
|
171
|
+
background-color: var(--ramp-grey-900);
|
|
172
|
+
color: var(--ramp-grey-100);
|
|
173
173
|
|
|
174
174
|
&.tooltip--position-top::after {
|
|
175
|
-
border-top-color: var(--
|
|
175
|
+
border-top-color: var(--ramp-grey-900);
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
&.tooltip--position-bottom::after {
|
|
179
|
-
border-bottom-color: var(--
|
|
179
|
+
border-bottom-color: var(--ramp-grey-900);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAItC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,gBAAgB,CAAA;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAG/D,OAAO,aAAa,CAAA;AAsEpB,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAItC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,gBAAgB,CAAA;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAG/D,OAAO,aAAa,CAAA;AAsEpB,eAAO,MAAM,eAAe,GAAI,+FAS7B;IACD,UAAU,EAAE,WAAW,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,MAAM,EAAE,aAAa,CAAA;IACrB,KAAK,EAAE,oBAAoB,CAAA;IAC3B,UAAU,EAAE,iBAAiB,CAAA;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACf,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,sBAmCA,CAAA"}
|
|
@@ -2,7 +2,7 @@ import type { I18nClient } from '@payloadcms/translations';
|
|
|
2
2
|
import type { BaseSelection, LexicalEditor } from 'lexical';
|
|
3
3
|
import type React from 'react';
|
|
4
4
|
import type { EditorConfigContextType } from '../../lexical/config/client/EditorConfigProvider.js';
|
|
5
|
-
import type { FeatureClientSchemaMap } from '../../types.js';
|
|
5
|
+
import type { FeatureClientSchemaMap } from '../../types/index.js';
|
|
6
6
|
export type ToolbarGroup = ToolbarButtonsGroup | ToolbarDropdownGroup;
|
|
7
7
|
export type ToolbarDropdownGroup = {
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/toolbars/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAA;AAClG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/toolbars/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,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GAAG,KAAK,CAAC,CAAC,GACnD,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,OAAO,GAAG,KAAK,CAAC,CAAC,CACrE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/features/toolbars/types.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { BaseSelection, LexicalEditor } from 'lexical'\nimport type React from 'react'\n\nimport type { EditorConfigContextType } from '../../lexical/config/client/EditorConfigProvider.js'\nimport type { FeatureClientSchemaMap } from '../../types.js'\n\nexport type ToolbarGroup = ToolbarButtonsGroup | ToolbarDropdownGroup\n\nexport type ToolbarDropdownGroup = {\n /**\n * The dropdown toolbar ChildComponent allows you to pass in a React Component which will be displayed within the dropdown button.\n */\n ChildComponent?: React.FC\n /**\n * If true, the dropdown items will only show icons (text labels are hidden via CSS) and tooltips will be displayed on hover.\n */\n iconOnly?: boolean\n /**\n * This is optional and controls if the toolbar group is highlighted or not.\n */\n isEnabled?: ({\n editor,\n editorConfigContext,\n selection,\n }: {\n editor: LexicalEditor\n editorConfigContext: EditorConfigContextType\n selection: BaseSelection\n }) => boolean\n /**\n * All toolbar items part of this toolbar group need to be added here.\n */\n items: Array<ToolbarGroupItem>\n /**\n * Each toolbar group needs to have a unique key. Groups with the same keys will have their items merged together.\n */\n key: string\n /**\n * The maximum number of active items that can be selected at once.\n * Increasing this will hurt performance, as more nodes need to be checked for their active state.\n *\n * E.g. if this is 1, we can stop checking nodes once we find an active node.\n *\n * @default 1\n */\n maxActiveItems?: number\n /**\n * Determines where the toolbar group will be.\n */\n order?: number\n /**\n * Controls the toolbar group type. Set to `dropdown` to create a buttons toolbar group, which displays toolbar items vertically using their icons and labels, if the dropdown is open.\n */\n type: 'dropdown'\n}\n\nexport type ToolbarButtonsGroup = {\n /**\n * All toolbar items part of this toolbar group need to be added here.\n */\n items: Array<ToolbarGroupItem>\n /**\n * Each toolbar group needs to have a unique key. Groups with the same keys will have their items merged together.\n */\n key: string\n /**\n * Determines where the toolbar group will be.\n */\n order?: number\n /**\n * Controls the toolbar group type. Set to `buttons` to create a buttons toolbar group, which displays toolbar items horizontally using only their icons.\n */\n type: 'buttons'\n}\n\nexport type ToolbarGroupItem = {\n /** A React component which is rendered within your toolbar item's default button component. Usually, you want this to be an icon. */\n ChildComponent?: React.FC\n /** A React component which is rendered in place of the toolbar item's default button component, thus completely replacing it. The `ChildComponent` and `onSelect` properties will be ignored. */\n Component?: React.FC<{\n active?: boolean\n anchorElem: HTMLElement\n editor: LexicalEditor\n enabled?: boolean\n item: ToolbarGroupItem\n }>\n /** This is optional and controls if the toolbar item is highlighted or not. */\n isActive?: ({\n editor,\n editorConfigContext,\n selection,\n }: {\n editor: LexicalEditor\n editorConfigContext: EditorConfigContextType\n selection: BaseSelection\n }) => boolean\n /** This is optional and controls if the toolbar item is clickable or not. If `false` is returned here, it will be grayed out and unclickable. */\n isEnabled?: ({\n editor,\n editorConfigContext,\n selection,\n }: {\n editor: LexicalEditor\n editorConfigContext: EditorConfigContextType\n selection: BaseSelection\n }) => boolean\n /** Each toolbar item needs to have a unique key. */\n key: string\n /** The label will be displayed in your toolbar item, if it's within a dropdown group. In order to make use of i18n, this can be a function. */\n label?:\n | ((args: {\n featureClientSchemaMap: FeatureClientSchemaMap\n i18n: I18nClient<{}, string>\n schemaPath: string\n }) => string)\n | string\n /** Each toolbar item needs to have a unique key. */\n onSelect?: ({ editor, isActive }: { editor: LexicalEditor; isActive: boolean }) => void\n order?: number\n}\n\nexport type CustomGroups = Record<\n string,\n | Partial<Omit<ToolbarButtonsGroup, 'items' | 'key'>>\n | Partial<Omit<ToolbarDropdownGroup, 'isEnabled' | 'items' | 'key'>>\n>\n"],"mappings":"AA0HA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/features/toolbars/types.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { BaseSelection, LexicalEditor } from 'lexical'\nimport type React from 'react'\n\nimport type { EditorConfigContextType } from '../../lexical/config/client/EditorConfigProvider.js'\nimport type { FeatureClientSchemaMap } from '../../types/index.js'\n\nexport type ToolbarGroup = ToolbarButtonsGroup | ToolbarDropdownGroup\n\nexport type ToolbarDropdownGroup = {\n /**\n * The dropdown toolbar ChildComponent allows you to pass in a React Component which will be displayed within the dropdown button.\n */\n ChildComponent?: React.FC\n /**\n * If true, the dropdown items will only show icons (text labels are hidden via CSS) and tooltips will be displayed on hover.\n */\n iconOnly?: boolean\n /**\n * This is optional and controls if the toolbar group is highlighted or not.\n */\n isEnabled?: ({\n editor,\n editorConfigContext,\n selection,\n }: {\n editor: LexicalEditor\n editorConfigContext: EditorConfigContextType\n selection: BaseSelection\n }) => boolean\n /**\n * All toolbar items part of this toolbar group need to be added here.\n */\n items: Array<ToolbarGroupItem>\n /**\n * Each toolbar group needs to have a unique key. Groups with the same keys will have their items merged together.\n */\n key: string\n /**\n * The maximum number of active items that can be selected at once.\n * Increasing this will hurt performance, as more nodes need to be checked for their active state.\n *\n * E.g. if this is 1, we can stop checking nodes once we find an active node.\n *\n * @default 1\n */\n maxActiveItems?: number\n /**\n * Determines where the toolbar group will be.\n */\n order?: number\n /**\n * Controls the toolbar group type. Set to `dropdown` to create a buttons toolbar group, which displays toolbar items vertically using their icons and labels, if the dropdown is open.\n */\n type: 'dropdown'\n}\n\nexport type ToolbarButtonsGroup = {\n /**\n * All toolbar items part of this toolbar group need to be added here.\n */\n items: Array<ToolbarGroupItem>\n /**\n * Each toolbar group needs to have a unique key. Groups with the same keys will have their items merged together.\n */\n key: string\n /**\n * Determines where the toolbar group will be.\n */\n order?: number\n /**\n * Controls the toolbar group type. Set to `buttons` to create a buttons toolbar group, which displays toolbar items horizontally using only their icons.\n */\n type: 'buttons'\n}\n\nexport type ToolbarGroupItem = {\n /** A React component which is rendered within your toolbar item's default button component. Usually, you want this to be an icon. */\n ChildComponent?: React.FC\n /** A React component which is rendered in place of the toolbar item's default button component, thus completely replacing it. The `ChildComponent` and `onSelect` properties will be ignored. */\n Component?: React.FC<{\n active?: boolean\n anchorElem: HTMLElement\n editor: LexicalEditor\n enabled?: boolean\n item: ToolbarGroupItem\n }>\n /** This is optional and controls if the toolbar item is highlighted or not. */\n isActive?: ({\n editor,\n editorConfigContext,\n selection,\n }: {\n editor: LexicalEditor\n editorConfigContext: EditorConfigContextType\n selection: BaseSelection\n }) => boolean\n /** This is optional and controls if the toolbar item is clickable or not. If `false` is returned here, it will be grayed out and unclickable. */\n isEnabled?: ({\n editor,\n editorConfigContext,\n selection,\n }: {\n editor: LexicalEditor\n editorConfigContext: EditorConfigContextType\n selection: BaseSelection\n }) => boolean\n /** Each toolbar item needs to have a unique key. */\n key: string\n /** The label will be displayed in your toolbar item, if it's within a dropdown group. In order to make use of i18n, this can be a function. */\n label?:\n | ((args: {\n featureClientSchemaMap: FeatureClientSchemaMap\n i18n: I18nClient<{}, string>\n schemaPath: string\n }) => string)\n | string\n /** Each toolbar item needs to have a unique key. */\n onSelect?: ({ editor, isActive }: { editor: LexicalEditor; isActive: boolean }) => void\n order?: number\n}\n\nexport type CustomGroups = Record<\n string,\n | Partial<Omit<ToolbarButtonsGroup, 'items' | 'key'>>\n | Partial<Omit<ToolbarDropdownGroup, 'isEnabled' | 'items' | 'key'>>\n>\n"],"mappings":"AA0HA","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ import type { JSX } from 'react';
|
|
|
5
5
|
import type { ClientEditorConfig } from '../lexical/config/types.js';
|
|
6
6
|
import type { SlashMenuGroup } from '../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
|
|
7
7
|
import type { Transformer } from '../packages/@lexical/markdown/index.js';
|
|
8
|
-
import type { FeatureClientSchemaMap } from '../types.js';
|
|
8
|
+
import type { FeatureClientSchemaMap } from '../types/index.js';
|
|
9
9
|
import type { ToolbarGroup } from './toolbars/types.js';
|
|
10
10
|
export type FeatureProviderProviderClient<UnSanitizedClientFeatureProps = undefined, ClientFeatureProps = UnSanitizedClientFeatureProps> = (props: BaseClientFeatureProps<ClientFeatureProps>) => FeatureProviderClient<ClientFeatureProps>;
|
|
11
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typesClient.d.ts","sourceRoot":"","sources":["../../src/features/typesClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,aAAa,EACb,WAAW,EACX,sBAAsB,EACtB,cAAc,EACf,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAA;AACtG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"typesClient.d.ts","sourceRoot":"","sources":["../../src/features/typesClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,aAAa,EACb,WAAW,EACX,sBAAsB,EACtB,cAAc,EACf,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAA;AACtG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAC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EAAE,OAAO,GAAG,WAAW,GAAG,cAAc,GAAG,eAAe,CAAC,CAC/F,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typesClient.js","names":[],"sources":["../../src/features/typesClient.ts"],"sourcesContent":["import type {\n Klass,\n LexicalEditor,\n LexicalNode,\n LexicalNodeReplacement,\n TextFormatType,\n} from 'lexical'\nimport type { ClientConfig, RichTextFieldClient } from 'payload'\nimport type React from 'react'\nimport type { JSX } from 'react'\n\nimport type { ClientEditorConfig } from '../lexical/config/types.js'\nimport type { SlashMenuGroup } from '../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport type { Transformer } from '../packages/@lexical/markdown/index.js'\nimport type { FeatureClientSchemaMap } from '../types.js'\nimport type { ToolbarGroup } from './toolbars/types.js'\n\nexport type FeatureProviderProviderClient<\n UnSanitizedClientFeatureProps = undefined,\n ClientFeatureProps = UnSanitizedClientFeatureProps,\n> = (props: BaseClientFeatureProps<ClientFeatureProps>) => FeatureProviderClient<ClientFeatureProps>\n\n/**\n * No dependencies => Features need to be sorted on the server first, then sent to client in right order\n */\nexport type FeatureProviderClient<\n UnSanitizedClientFeatureProps = undefined,\n ClientFeatureProps = UnSanitizedClientFeatureProps,\n> = {\n /**\n * Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to\n */\n clientFeatureProps: BaseClientFeatureProps<UnSanitizedClientFeatureProps>\n feature:\n | ((props: {\n config: ClientConfig\n featureClientImportMap: Record<string, any>\n featureClientSchemaMap: FeatureClientSchemaMap\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ClientFeatureProviderMap\n field?: RichTextFieldClient\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedClientFeatureMap\n schemaPath: string\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ClientEditorConfig\n }) => ClientFeature<ClientFeatureProps>)\n | ClientFeature<ClientFeatureProps>\n}\n\nexport type PluginComponent<ClientFeatureProps = any> = React.FC<{\n clientProps: ClientFeatureProps\n}>\nexport type PluginComponentWithAnchor<ClientFeatureProps = any> = React.FC<{\n anchorElem: HTMLElement\n clientProps: ClientFeatureProps\n}>\n\n/**\n * Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n */\nexport type SanitizedPlugin =\n | {\n clientProps: any\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent\n key: string\n position: 'bottom' // Determines at which position the Component will be added.\n }\n | {\n clientProps: any\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent\n key: string\n position: 'normal' // Determines at which position the Component will be added.\n }\n | {\n clientProps: any\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent\n key: string\n position: 'top' // Determines at which position the Component will be added.\n }\n | {\n clientProps: any\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponentWithAnchor\n desktopOnly?: boolean\n key: string\n position: 'floatingAnchorElem' // Determines at which position the Component will be added.\n }\n | {\n clientProps: any\n Component: PluginComponent\n key: string\n position: 'aboveContainer'\n }\n | {\n clientProps: any\n Component: PluginComponent\n key: string\n position: 'belowContainer'\n }\n\nexport type ClientFeature<ClientFeatureProps> = {\n /**\n * The text formats which are enabled by this feature.\n */\n enableFormats?: TextFormatType[]\n markdownTransformers?: (\n | ((props: {\n allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>\n allTransformers: Transformer[]\n }) => Transformer)\n | Transformer\n )[]\n nodes?: Array<Klass<LexicalNode> | LexicalNodeReplacement>\n /**\n * Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n */\n plugins?: Array<\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'aboveContainer' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'bottom' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'normal' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'top' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponentWithAnchor<ClientFeatureProps>\n position: 'floatingAnchorElem' // Determines at which position the Component will be added.\n }\n | {\n Component: PluginComponent<ClientFeatureProps>\n position: 'belowContainer' // Determines at which position the Component will be added.\n }\n >\n /**\n * Client Features can register their own providers, which will be nested below the EditorConfigProvider\n */\n providers?: Array<React.FC<{ children: JSX.Element }>>\n /**\n * Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to\n */\n sanitizedClientFeatureProps?: BaseClientFeatureProps<ClientFeatureProps>\n slashMenu?: {\n /**\n * Dynamic groups allow you to add different groups depending on the query string (so, the text after the slash).\n * Thus, to re-calculate the available groups, this function will be called every time you type after the /.\n *\n * The groups provided by dynamicGroups will be merged with the static groups provided by the groups property.\n */\n dynamicGroups?: ({\n editor,\n queryString,\n }: {\n editor: LexicalEditor\n queryString: string\n }) => SlashMenuGroup[]\n /**\n * Static array of groups together with the items in them. These will always be present.\n * While typing after the /, they will be filtered by the query string and the keywords, key and display name of the items.\n */\n groups?: SlashMenuGroup[]\n }\n /**\n * An opt-in, classic fixed toolbar which stays at the top of the editor\n */\n toolbarFixed?: {\n groups: ToolbarGroup[]\n }\n /**\n * The default, floating toolbar which appears when you select text.\n */\n toolbarInline?: {\n /**\n * Array of toolbar groups / sections. Each section can contain multiple toolbar items.\n */\n groups: ToolbarGroup[]\n }\n}\n\nexport type BaseClientFeatureProps<ClientFeatureProps> = ClientFeatureProps extends undefined\n ? {\n featureKey: string\n order: number\n }\n : {\n featureKey: string\n order: number\n } & ClientFeatureProps\n\nexport type ResolvedClientFeature<ClientFeatureProps> = {\n key: string\n order: number\n} & ClientFeature<ClientFeatureProps>\n\nexport type ResolvedClientFeatureMap = Map<string, ResolvedClientFeature<any>>\n\nexport type ClientFeatureProviderMap = Map<string, FeatureProviderClient<any, any>>\n\nexport type SanitizedClientFeatures = {\n /** The keys of all enabled features */\n enabledFeatures: string[]\n enabledFormats: TextFormatType[]\n markdownTransformers: Transformer[]\n\n /**\n * Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n */\n plugins?: Array<SanitizedPlugin>\n slashMenu: {\n /**\n * Dynamic groups allow you to add different groups depending on the query string (so, the text after the slash).\n * Thus, to re-calculate the available groups, this function will be called every time you type after the /.\n *\n * The groups provided by dynamicGroups will be merged with the static groups provided by the groups property.\n */\n dynamicGroups: Array<\n ({ editor, queryString }: { editor: LexicalEditor; queryString: string }) => SlashMenuGroup[]\n >\n /**\n * Static array of groups together with the items in them. These will always be present.\n * While typing after the /, they will be filtered by the query string and the keywords, key and display name of the items.\n */\n groups: SlashMenuGroup[]\n }\n} & Required<\n Pick<ResolvedClientFeature<unknown>, 'nodes' | 'providers' | 'toolbarFixed' | 'toolbarInline'>\n>\n"],"mappings":"AAuNA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"typesClient.js","names":[],"sources":["../../src/features/typesClient.ts"],"sourcesContent":["import type {\n Klass,\n LexicalEditor,\n LexicalNode,\n LexicalNodeReplacement,\n TextFormatType,\n} from 'lexical'\nimport type { ClientConfig, RichTextFieldClient } from 'payload'\nimport type React from 'react'\nimport type { JSX } from 'react'\n\nimport type { ClientEditorConfig } from '../lexical/config/types.js'\nimport type { SlashMenuGroup } from '../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport type { Transformer } from '../packages/@lexical/markdown/index.js'\nimport type { FeatureClientSchemaMap } from '../types/index.js'\nimport type { ToolbarGroup } from './toolbars/types.js'\n\nexport type FeatureProviderProviderClient<\n UnSanitizedClientFeatureProps = undefined,\n ClientFeatureProps = UnSanitizedClientFeatureProps,\n> = (props: BaseClientFeatureProps<ClientFeatureProps>) => FeatureProviderClient<ClientFeatureProps>\n\n/**\n * No dependencies => Features need to be sorted on the server first, then sent to client in right order\n */\nexport type FeatureProviderClient<\n UnSanitizedClientFeatureProps = undefined,\n ClientFeatureProps = UnSanitizedClientFeatureProps,\n> = {\n /**\n * Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to\n */\n clientFeatureProps: BaseClientFeatureProps<UnSanitizedClientFeatureProps>\n feature:\n | ((props: {\n config: ClientConfig\n featureClientImportMap: Record<string, any>\n featureClientSchemaMap: FeatureClientSchemaMap\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ClientFeatureProviderMap\n field?: RichTextFieldClient\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedClientFeatureMap\n schemaPath: string\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ClientEditorConfig\n }) => ClientFeature<ClientFeatureProps>)\n | ClientFeature<ClientFeatureProps>\n}\n\nexport type PluginComponent<ClientFeatureProps = any> = React.FC<{\n clientProps: ClientFeatureProps\n}>\nexport type PluginComponentWithAnchor<ClientFeatureProps = any> = React.FC<{\n anchorElem: HTMLElement\n clientProps: ClientFeatureProps\n}>\n\n/**\n * Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n */\nexport type SanitizedPlugin =\n | {\n clientProps: any\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent\n key: string\n position: 'bottom' // Determines at which position the Component will be added.\n }\n | {\n clientProps: any\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent\n key: string\n position: 'normal' // Determines at which position the Component will be added.\n }\n | {\n clientProps: any\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent\n key: string\n position: 'top' // Determines at which position the Component will be added.\n }\n | {\n clientProps: any\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponentWithAnchor\n desktopOnly?: boolean\n key: string\n position: 'floatingAnchorElem' // Determines at which position the Component will be added.\n }\n | {\n clientProps: any\n Component: PluginComponent\n key: string\n position: 'aboveContainer'\n }\n | {\n clientProps: any\n Component: PluginComponent\n key: string\n position: 'belowContainer'\n }\n\nexport type ClientFeature<ClientFeatureProps> = {\n /**\n * The text formats which are enabled by this feature.\n */\n enableFormats?: TextFormatType[]\n markdownTransformers?: (\n | ((props: {\n allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>\n allTransformers: Transformer[]\n }) => Transformer)\n | Transformer\n )[]\n nodes?: Array<Klass<LexicalNode> | LexicalNodeReplacement>\n /**\n * Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n */\n plugins?: Array<\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'aboveContainer' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'bottom' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'normal' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'top' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponentWithAnchor<ClientFeatureProps>\n position: 'floatingAnchorElem' // Determines at which position the Component will be added.\n }\n | {\n Component: PluginComponent<ClientFeatureProps>\n position: 'belowContainer' // Determines at which position the Component will be added.\n }\n >\n /**\n * Client Features can register their own providers, which will be nested below the EditorConfigProvider\n */\n providers?: Array<React.FC<{ children: JSX.Element }>>\n /**\n * Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to\n */\n sanitizedClientFeatureProps?: BaseClientFeatureProps<ClientFeatureProps>\n slashMenu?: {\n /**\n * Dynamic groups allow you to add different groups depending on the query string (so, the text after the slash).\n * Thus, to re-calculate the available groups, this function will be called every time you type after the /.\n *\n * The groups provided by dynamicGroups will be merged with the static groups provided by the groups property.\n */\n dynamicGroups?: ({\n editor,\n queryString,\n }: {\n editor: LexicalEditor\n queryString: string\n }) => SlashMenuGroup[]\n /**\n * Static array of groups together with the items in them. These will always be present.\n * While typing after the /, they will be filtered by the query string and the keywords, key and display name of the items.\n */\n groups?: SlashMenuGroup[]\n }\n /**\n * An opt-in, classic fixed toolbar which stays at the top of the editor\n */\n toolbarFixed?: {\n groups: ToolbarGroup[]\n }\n /**\n * The default, floating toolbar which appears when you select text.\n */\n toolbarInline?: {\n /**\n * Array of toolbar groups / sections. Each section can contain multiple toolbar items.\n */\n groups: ToolbarGroup[]\n }\n}\n\nexport type BaseClientFeatureProps<ClientFeatureProps> = ClientFeatureProps extends undefined\n ? {\n featureKey: string\n order: number\n }\n : {\n featureKey: string\n order: number\n } & ClientFeatureProps\n\nexport type ResolvedClientFeature<ClientFeatureProps> = {\n key: string\n order: number\n} & ClientFeature<ClientFeatureProps>\n\nexport type ResolvedClientFeatureMap = Map<string, ResolvedClientFeature<any>>\n\nexport type ClientFeatureProviderMap = Map<string, FeatureProviderClient<any, any>>\n\nexport type SanitizedClientFeatures = {\n /** The keys of all enabled features */\n enabledFeatures: string[]\n enabledFormats: TextFormatType[]\n markdownTransformers: Transformer[]\n\n /**\n * Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n */\n plugins?: Array<SanitizedPlugin>\n slashMenu: {\n /**\n * Dynamic groups allow you to add different groups depending on the query string (so, the text after the slash).\n * Thus, to re-calculate the available groups, this function will be called every time you type after the /.\n *\n * The groups provided by dynamicGroups will be merged with the static groups provided by the groups property.\n */\n dynamicGroups: Array<\n ({ editor, queryString }: { editor: LexicalEditor; queryString: string }) => SlashMenuGroup[]\n >\n /**\n * Static array of groups together with the items in them. These will always be present.\n * While typing after the /, they will be filtered by the query string and the keywords, key and display name of the items.\n */\n groups: SlashMenuGroup[]\n }\n} & Required<\n Pick<ResolvedClientFeature<unknown>, 'nodes' | 'providers' | 'toolbarFixed' | 'toolbarInline'>\n>\n"],"mappings":"AAuNA","ignoreList":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { GenericLanguages,
|
|
1
|
+
import type { GenericLanguages, I18nClient } from '@payloadcms/translations';
|
|
2
2
|
import type { JSONSchema4 } from 'json-schema';
|
|
3
3
|
import type { Klass, LexicalNode, LexicalNodeReplacement, SerializedEditorState, SerializedLexicalNode } from 'lexical';
|
|
4
|
-
import type { Field, FieldSchemaMap, ImportMapGenerators, JsonObject, PayloadComponent, PayloadRequest, PopulateType, ReplaceAny, RequestContext, RichTextField, RichTextHooks, SanitizedConfig, TypedFallbackLocale, ValidateOptions, ValidationFieldError } from 'payload';
|
|
4
|
+
import type { Field, FieldSchemaMap, FieldsToJSONSchemaArgs, ImportMapGenerators, JsonObject, PayloadComponent, PayloadRequest, PopulateType, ReplaceAny, RequestContext, RichTextField, RichTextHooks, SanitizedConfig, TypedFallbackLocale, ValidateOptions, ValidationFieldError } from 'payload';
|
|
5
5
|
import type { ServerEditorConfig } from '../lexical/config/types.js';
|
|
6
6
|
import type { Transformer } from '../packages/@lexical/markdown/index.js';
|
|
7
|
-
import type { LexicalRichTextField } from '../types.js';
|
|
7
|
+
import type { LexicalRichTextField } from '../types/index.js';
|
|
8
|
+
import type { ElementNodeSchemaFn } from '../types/jsonSchemaHelpers.js';
|
|
8
9
|
import type { BaseClientFeatureProps } from './typesClient.js';
|
|
9
10
|
export type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {
|
|
10
11
|
context: RequestContext;
|
|
@@ -150,6 +151,14 @@ export type AfterReadNodeHook<T extends SerializedLexicalNode> = (args: AfterRea
|
|
|
150
151
|
export type AfterChangeNodeHook<T extends SerializedLexicalNode> = (args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>) => Promise<T> | T;
|
|
151
152
|
export type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>) => Promise<T> | T;
|
|
152
153
|
export type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>) => Promise<T> | T;
|
|
154
|
+
/** Arguments passed to each node's `jsonSchema` function. */
|
|
155
|
+
export type JSONSchemaArgs = {
|
|
156
|
+
elementNodeSchema: ElementNodeSchemaFn;
|
|
157
|
+
field: LexicalRichTextField;
|
|
158
|
+
/** TS name of the node union - use in `tsType` annotations. */
|
|
159
|
+
nodeUnionName: string;
|
|
160
|
+
} & Pick<FieldsToJSONSchemaArgs, 'collectionIDFieldTypes' | 'config' | 'i18n' | 'interfaceNameDefinitions' | 'typeStringDefinitions'>;
|
|
161
|
+
export type JSONSchemaFn = (args: JSONSchemaArgs) => JSONSchema4;
|
|
153
162
|
export type NodeWithHooks<T extends LexicalNode = any> = {
|
|
154
163
|
/**
|
|
155
164
|
* If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload
|
|
@@ -185,6 +194,12 @@ export type NodeWithHooks<T extends LexicalNode = any> = {
|
|
|
185
194
|
beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
|
|
186
195
|
beforeValidate?: Array<BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
|
|
187
196
|
};
|
|
197
|
+
/**
|
|
198
|
+
* Returns the JSON Schema for this node, plus optional standalone TS
|
|
199
|
+
* source for helper types its `tsType` annotations reference. Nodes
|
|
200
|
+
* without this function are omitted from the strictly-typed union.
|
|
201
|
+
*/
|
|
202
|
+
jsonSchema?: JSONSchemaFn;
|
|
188
203
|
/**
|
|
189
204
|
* The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).
|
|
190
205
|
*/
|
|
@@ -209,25 +224,6 @@ export type ServerFeature<ServerProps, ClientFeatureProps> = {
|
|
|
209
224
|
componentImports?: {
|
|
210
225
|
[key: string]: PayloadComponent;
|
|
211
226
|
} | ImportMapGenerators[0] | PayloadComponent[];
|
|
212
|
-
generatedTypes?: {
|
|
213
|
-
modifyOutputSchema: (args: {
|
|
214
|
-
collectionIDFieldTypes: {
|
|
215
|
-
[key: string]: 'number' | 'string';
|
|
216
|
-
};
|
|
217
|
-
config?: SanitizedConfig;
|
|
218
|
-
/**
|
|
219
|
-
* Current schema which will be modified by this function.
|
|
220
|
-
*/
|
|
221
|
-
currentSchema: JSONSchema4;
|
|
222
|
-
field: LexicalRichTextField;
|
|
223
|
-
i18n?: I18n;
|
|
224
|
-
/**
|
|
225
|
-
* Allows you to define new top-level interfaces that can be re-used in the output schema.
|
|
226
|
-
*/
|
|
227
|
-
interfaceNameDefinitions: Map<string, JSONSchema4>;
|
|
228
|
-
isRequired: boolean;
|
|
229
|
-
}) => JSONSchema4;
|
|
230
|
-
};
|
|
231
227
|
generateSchemaMap?: (args: {
|
|
232
228
|
config: SanitizedConfig;
|
|
233
229
|
field: RichTextField;
|
|
@@ -272,25 +268,6 @@ export type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, an
|
|
|
272
268
|
export type SanitizedServerFeatures = {
|
|
273
269
|
/** The keys of all enabled features */
|
|
274
270
|
enabledFeatures: string[];
|
|
275
|
-
generatedTypes: {
|
|
276
|
-
modifyOutputSchemas: Array<(args: {
|
|
277
|
-
collectionIDFieldTypes: {
|
|
278
|
-
[key: string]: 'number' | 'string';
|
|
279
|
-
};
|
|
280
|
-
config?: SanitizedConfig;
|
|
281
|
-
/**
|
|
282
|
-
* Current schema which will be modified by this function.
|
|
283
|
-
*/
|
|
284
|
-
currentSchema: JSONSchema4;
|
|
285
|
-
field: LexicalRichTextField;
|
|
286
|
-
i18n?: I18n;
|
|
287
|
-
/**
|
|
288
|
-
* Allows you to define new top-level interfaces that can be re-used in the output schema.
|
|
289
|
-
*/
|
|
290
|
-
interfaceNameDefinitions: Map<string, JSONSchema4>;
|
|
291
|
-
isRequired: boolean;
|
|
292
|
-
}) => JSONSchema4>;
|
|
293
|
-
};
|
|
294
271
|
/** The node types mapped to their hooks */
|
|
295
272
|
getSubFields?: Map<string, (args: {
|
|
296
273
|
node: SerializedLexicalNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typesServer.d.ts","sourceRoot":"","sources":["../../src/features/typesServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"typesServer.d.ts","sourceRoot":"","sources":["../../src/features/typesServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC5E,OAAO,KAAK,EAAE,WAAW,EA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AG,CAAC,MAAM,EAAE,KAAK,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAC9E,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;KACnF,CAAA,CAAC,yDAAyD;IAC3D,kDAAkD;IAClD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAA;CAChD,GAAG,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { GenericLanguages, I18n, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Field,\n FieldSchemaMap,\n ImportMapGenerators,\n JsonObject,\n PayloadComponent,\n PayloadRequest,\n PopulateType,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n TypedFallbackLocale,\n ValidateOptions,\n ValidationFieldError,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { Transformer } from '../packages/@lexical/markdown/index.js'\nimport type { LexicalRichTextField } from '../types.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: LexicalRichTextField\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n parentIsLocalized: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: TypedFallbackLocale\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n populateArg?: PopulateType\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n previousNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: ValidationFieldError[]\n mergeLocaleActions: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n previousNode: T\n\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n /**\n * Adds payload components to the importMap.\n *\n * If an object is provided, the imported components will automatically be made available to the client feature, keyed by the object's keys.\n */\n componentImports?:\n | {\n [key: string]: PayloadComponent\n }\n | ImportMapGenerators[0]\n | PayloadComponent[]\n generatedTypes?: {\n modifyOutputSchema: (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: LexicalRichTextField\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n }\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: (\n | ((props: { allNodes: Array<NodeWithHooks>; allTransformers: Transformer[] }) => Transformer)\n | Transformer\n )[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The keys of all enabled features */\n enabledFeatures: string[]\n generatedTypes: {\n modifyOutputSchemas: Array<\n (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: LexicalRichTextField\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n >\n }\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n markdownTransformers: Transformer[]\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'nodes'>>\n"],"mappings":"AAmWA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { GenericLanguages, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Field,\n FieldSchemaMap,\n FieldsToJSONSchemaArgs,\n ImportMapGenerators,\n JsonObject,\n PayloadComponent,\n PayloadRequest,\n PopulateType,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n TypedFallbackLocale,\n ValidateOptions,\n ValidationFieldError,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { Transformer } from '../packages/@lexical/markdown/index.js'\nimport type { LexicalRichTextField } from '../types/index.js'\nimport type { ElementNodeSchemaFn } from '../types/jsonSchemaHelpers.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: LexicalRichTextField\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n parentIsLocalized: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: TypedFallbackLocale\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n populateArg?: PopulateType\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n previousNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: ValidationFieldError[]\n mergeLocaleActions: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n previousNode: T\n\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n/** Arguments passed to each node's `jsonSchema` function. */\nexport type JSONSchemaArgs = {\n elementNodeSchema: ElementNodeSchemaFn\n field: LexicalRichTextField\n /** TS name of the node union - use in `tsType` annotations. */\n nodeUnionName: string\n} & Pick<\n FieldsToJSONSchemaArgs,\n | 'collectionIDFieldTypes'\n | 'config'\n | 'i18n'\n | 'interfaceNameDefinitions'\n | 'typeStringDefinitions'\n>\n\nexport type JSONSchemaFn = (args: JSONSchemaArgs) => JSONSchema4\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * Returns the JSON Schema for this node, plus optional standalone TS\n * source for helper types its `tsType` annotations reference. Nodes\n * without this function are omitted from the strictly-typed union.\n */\n jsonSchema?: JSONSchemaFn\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n /**\n * Adds payload components to the importMap.\n *\n * If an object is provided, the imported components will automatically be made available to the client feature, keyed by the object's keys.\n */\n componentImports?:\n | {\n [key: string]: PayloadComponent\n }\n | ImportMapGenerators[0]\n | PayloadComponent[]\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: (\n | ((props: { allNodes: Array<NodeWithHooks>; allTransformers: Transformer[] }) => Transformer)\n | Transformer\n )[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The keys of all enabled features */\n enabledFeatures: string[]\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n markdownTransformers: Transformer[]\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'nodes'>>\n"],"mappings":"AA2WA","ignoreList":[]}
|
|
@@ -54,16 +54,16 @@
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.LexicalEditorTheme__upload__contents--landscape {
|
|
57
|
-
img,
|
|
58
|
-
svg {
|
|
59
|
-
max-width: var(--upload-media-size);
|
|
60
|
-
min-width: var(--upload-media-size);
|
|
57
|
+
.thumbnail img,
|
|
58
|
+
.thumbnail svg {
|
|
59
|
+
max-width: min(100%, var(--upload-media-size));
|
|
60
|
+
min-width: min(100%, var(--upload-media-size));
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.LexicalEditorTheme__upload__contents--portrait {
|
|
65
|
-
img,
|
|
66
|
-
svg {
|
|
65
|
+
.thumbnail img,
|
|
66
|
+
.thumbnail svg {
|
|
67
67
|
max-height: var(--upload-media-size);
|
|
68
68
|
min-height: var(--upload-media-size);
|
|
69
69
|
}
|
|
@@ -88,14 +88,8 @@
|
|
|
88
88
|
padding: 0 var(--spacer-2);
|
|
89
89
|
background: var(--color-bg-menu);
|
|
90
90
|
border-radius: var(--radius-large);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
0 1px 3px 0 rgba(0, 0, 0, 0.5),
|
|
94
|
-
inset 0 0.5px 0 0 rgba(255, 255, 255, 0.08),
|
|
95
|
-
inset 0 0 0.5px 0 rgba(255, 255, 255, 0.3);
|
|
96
|
-
color: var(--color-white-800);
|
|
97
|
-
opacity: 0;
|
|
98
|
-
transition: opacity 0.15s ease;
|
|
91
|
+
color: var(--color-text);
|
|
92
|
+
/* opacity: 0; */
|
|
99
93
|
pointer-events: none;
|
|
100
94
|
white-space: nowrap;
|
|
101
95
|
z-index: 1;
|
|
@@ -110,7 +104,7 @@
|
|
|
110
104
|
}
|
|
111
105
|
|
|
112
106
|
.btn {
|
|
113
|
-
color: var(--color-
|
|
107
|
+
color: var(--color-text);
|
|
114
108
|
width: var(--spacer-4);
|
|
115
109
|
height: var(--spacer-4);
|
|
116
110
|
min-width: var(--spacer-4);
|
|
@@ -121,11 +115,11 @@
|
|
|
121
115
|
cursor: pointer;
|
|
122
116
|
|
|
123
117
|
&:hover:not(.btn--disabled) {
|
|
124
|
-
background: var(--color-bg-
|
|
118
|
+
background: var(--color-bg-transparent-hover);
|
|
125
119
|
}
|
|
126
120
|
|
|
127
121
|
&:active:not(.btn--disabled) {
|
|
128
|
-
background: var(--color-bg-
|
|
122
|
+
background: var(--color-bg-transparent-pressed);
|
|
129
123
|
}
|
|
130
124
|
}
|
|
131
125
|
}
|
|
@@ -157,7 +151,7 @@
|
|
|
157
151
|
.LexicalEditorTheme__upload__divider {
|
|
158
152
|
width: var(--stroke-width-small);
|
|
159
153
|
height: var(--spacer-6);
|
|
160
|
-
background: var(--
|
|
154
|
+
background: var(--ramp-grey-700);
|
|
161
155
|
flex-shrink: 0;
|
|
162
156
|
}
|
|
163
157
|
|
|
@@ -209,6 +203,8 @@
|
|
|
209
203
|
border-color: var(--color-border-selected);
|
|
210
204
|
background: transparent;
|
|
211
205
|
border-radius: 0;
|
|
206
|
+
max-width: min(100%, var(--upload-media-size));
|
|
207
|
+
min-width: min(100%, var(--upload-media-size));
|
|
212
208
|
}
|
|
213
209
|
|
|
214
210
|
.LexicalEditorTheme__upload--selected img,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ElementFormatType } from 'lexical';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { UploadData } from '../../server/
|
|
3
|
+
import type { UploadData } from '../../server/schema.js';
|
|
4
4
|
import './index.css';
|
|
5
5
|
export type ElementProps = {
|
|
6
6
|
className: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/component/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAsE,MAAM,OAAO,CAAA;AAG1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/component/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAsE,MAAM,OAAO,CAAA;AAG1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AASxD,OAAO,aAAa,CAAA;AAMpB,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAqOlD,CAAA"}
|
|
@@ -173,11 +173,11 @@ export const UploadComponent = props => {
|
|
|
173
173
|
children: data?.filename || t('general:untitled')
|
|
174
174
|
})
|
|
175
175
|
}), hasExtraFields ? /*#__PURE__*/_jsx(Button, {
|
|
176
|
-
buttonStyle: "
|
|
176
|
+
buttonStyle: "ghost",
|
|
177
177
|
className: `${baseClass}__upload-drawer-toggler`,
|
|
178
178
|
disabled: !isEditable,
|
|
179
179
|
el: "button",
|
|
180
|
-
icon: "
|
|
180
|
+
icon: "write",
|
|
181
181
|
onClick: toggleDrawer,
|
|
182
182
|
round: true,
|
|
183
183
|
size: "medium",
|
|
@@ -185,7 +185,7 @@ export const UploadComponent = props => {
|
|
|
185
185
|
}) : null, /*#__PURE__*/_jsx("div", {
|
|
186
186
|
className: `${baseClass}__divider`
|
|
187
187
|
}), /*#__PURE__*/_jsx(Button, {
|
|
188
|
-
buttonStyle: "
|
|
188
|
+
buttonStyle: "ghost",
|
|
189
189
|
className: `${baseClass}__swap-drawer-toggler`,
|
|
190
190
|
disabled: !isEditable,
|
|
191
191
|
el: "button",
|
|
@@ -201,7 +201,7 @@ export const UploadComponent = props => {
|
|
|
201
201
|
size: "medium",
|
|
202
202
|
tooltip: t('fields:swapUpload')
|
|
203
203
|
}), /*#__PURE__*/_jsx(Button, {
|
|
204
|
-
buttonStyle: "
|
|
204
|
+
buttonStyle: "ghost",
|
|
205
205
|
className: `${baseClass}__removeButton`,
|
|
206
206
|
disabled: !isEditable,
|
|
207
207
|
icon: "x",
|