@payloadcms/richtext-lexical 4.0.0-internal.1f9ae9a → 4.0.0-internal.293e026
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/@types/assets.d.js +2 -0
- package/dist/@types/assets.d.js.map +1 -0
- package/dist/cell/rscEntry.d.ts.map +1 -1
- package/dist/cell/rscEntry.js +5 -5
- package/dist/cell/rscEntry.js.map +1 -1
- package/dist/exports/client/Field-VYBSMSRY.js +2 -0
- package/dist/exports/client/Field-VYBSMSRY.js.map +7 -0
- package/dist/exports/client/{RelationshipComponent-RZL743CS.js → RelationshipComponent-YCPAKOL7.js} +1 -1
- package/dist/exports/client/RelationshipComponent-YCPAKOL7.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-5VIL27GI.js +2 -0
- package/dist/exports/client/chunk-5VIL27GI.js.map +7 -0
- package/dist/exports/client/chunk-ESITTE3C.js +2 -0
- package/dist/exports/client/chunk-ESITTE3C.js.map +7 -0
- package/dist/exports/client/chunk-UD4DQ4AK.js +2 -0
- package/dist/exports/client/chunk-UD4DQ4AK.js.map +7 -0
- package/dist/exports/client/{component-CVM4OESA.js → component-PHZQBOJE.js} +2 -2
- package/dist/exports/client/component-PHZQBOJE.js.map +7 -0
- package/dist/exports/client/componentInline-H24N7GUG.js +2 -0
- package/dist/exports/client/index.d.ts +1 -0
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +25 -25
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/server/rsc.browser.d.ts +11 -0
- package/dist/exports/server/rsc.browser.d.ts.map +1 -0
- package/dist/exports/server/rsc.browser.js +10 -0
- package/dist/exports/server/rsc.browser.js.map +1 -0
- 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 -1
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +16 -8
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.d.ts +2 -1
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +15 -7
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/index.d.ts.map +1 -1
- package/dist/features/blocks/client/index.js +4 -2
- package/dist/features/blocks/client/index.js.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 +1 -1
- 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 +1 -1
- 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/premade/CodeBlock/Component/Block.d.ts.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js +1 -0
- package/dist/features/blocks/premade/CodeBlock/Component/Block.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 +24 -72
- package/dist/features/blocks/server/index.js.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 +139 -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/lexicalToHtml/async/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/types.d.ts +14 -15
- 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/sync/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/types.d.ts +14 -15
- 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 +5 -4
- package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/types.d.ts +12 -14
- 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/lexicalToPlaintext/sync/types.d.ts +12 -14
- 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/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 +107 -0
- package/dist/features/experimental_table/server/schema.js.map +1 -0
- 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/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/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.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 +169 -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/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.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 +80 -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/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/features/typesServer.d.ts +17 -40
- 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 +2 -2
- 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.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 +129 -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/upload/index.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/clientEntry.d.ts +29 -0
- package/dist/field/clientEntry.d.ts.map +1 -0
- package/dist/field/clientEntry.js +86 -0
- package/dist/field/clientEntry.js.map +1 -0
- package/dist/field/index.css +9 -12
- package/dist/field/index.js +1 -1
- package/dist/field/index.js.map +1 -1
- package/dist/field/rscEntry.d.ts.map +1 -1
- package/dist/field/rscEntry.js +2 -0
- package/dist/field/rscEntry.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +47 -4
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/lexical/LexicalEditor.js +36 -2
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/lexical/LexicalProvider.js +22 -7
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/loader.d.ts.map +1 -1
- package/dist/lexical/config/client/loader.js +5 -1
- package/dist/lexical/config/client/loader.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/plugins/DecoratorPlugin/index.js.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/index.d.ts +16 -17
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/jsonSchemaHelpers.d.ts +30 -0
- package/dist/types/jsonSchemaHelpers.d.ts.map +1 -0
- package/dist/types/jsonSchemaHelpers.js +58 -0
- package/dist/types/jsonSchemaHelpers.js.map +1 -0
- package/dist/types/nodeTypes.d.ts +115 -61
- package/dist/types/nodeTypes.d.ts.map +1 -1
- package/dist/types/nodeTypes.js +3 -2
- package/dist/types/nodeTypes.js.map +1 -1
- package/dist/types/schema.d.ts.map +1 -1
- package/dist/types/schema.js +67 -65
- package/dist/types/schema.js.map +1 -1
- package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
- package/dist/utilities/applyBaseFilterToFields.js +1 -2
- package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
- package/dist/utilities/buildEditorState.d.ts +17 -3
- package/dist/utilities/buildEditorState.d.ts.map +1 -1
- package/dist/utilities/buildEditorState.js +8 -0
- package/dist/utilities/buildEditorState.js.map +1 -1
- package/dist/utilities/buildInitialState.d.ts +2 -1
- package/dist/utilities/buildInitialState.d.ts.map +1 -1
- package/dist/utilities/buildInitialState.js.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.js +19 -10
- package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.d.ts +4 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.js +8 -7
- package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
- package/dist/utilities/fieldsDrawer/index.css +12 -0
- package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +29 -0
- package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -0
- package/dist/utilities/fieldsDrawer/useDrawerSubmit.js +97 -0
- package/dist/utilities/fieldsDrawer/useDrawerSubmit.js.map +1 -0
- package/dist/utilities/generateImportMap.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.js +7 -3
- package/dist/utilities/generateImportMap.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
- package/package.json +8 -7
- package/dist/exports/client/Field-G5Z2HM5Y.js +0 -2
- package/dist/exports/client/Field-G5Z2HM5Y.js.map +0 -7
- package/dist/exports/client/RelationshipComponent-RZL743CS.js.map +0 -7
- package/dist/exports/client/chunk-6QWQ7JV4.js +0 -2
- package/dist/exports/client/chunk-6QWQ7JV4.js.map +0 -7
- package/dist/exports/client/chunk-FEJXFRL7.js +0 -2
- package/dist/exports/client/chunk-FEJXFRL7.js.map +0 -7
- package/dist/exports/client/chunk-INBEEENE.js +0 -2
- package/dist/exports/client/chunk-INBEEENE.js.map +0 -7
- package/dist/exports/client/component-CVM4OESA.js.map +0 -7
- package/dist/exports/client/componentInline-JJZ2NKW2.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/exports/client/{componentInline-JJZ2NKW2.js.map → componentInline-H24N7GUG.js.map} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ImportMap, RichTextFieldClientProps } from 'payload';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { FeatureClientSchemaMap } from '../types/index.js';
|
|
4
|
+
type SerializedFeatureMetadata = {
|
|
5
|
+
ClientFeature?: {
|
|
6
|
+
clientProps?: Record<string, any>;
|
|
7
|
+
path: string;
|
|
8
|
+
} | string;
|
|
9
|
+
clientFeatureProps?: Record<string, any>;
|
|
10
|
+
componentImports?: Record<string, {
|
|
11
|
+
clientProps?: Record<string, any>;
|
|
12
|
+
path: string;
|
|
13
|
+
} | string>;
|
|
14
|
+
key: string;
|
|
15
|
+
order: number;
|
|
16
|
+
};
|
|
17
|
+
export type ClientEntryLexicalFieldProps = {
|
|
18
|
+
featureClientSchemaMap?: FeatureClientSchemaMap;
|
|
19
|
+
features?: Record<string, SerializedFeatureMetadata>;
|
|
20
|
+
importMap: ImportMap;
|
|
21
|
+
} & RichTextFieldClientProps;
|
|
22
|
+
/**
|
|
23
|
+
* Client-only entry point for the Lexical rich text field.
|
|
24
|
+
* Resolves feature providers and component imports from the import map on the client,
|
|
25
|
+
* bypassing the RSC entry point that requires server-only data.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ClientEntryLexicalField: React.FC<ClientEntryLexicalFieldProps>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=clientEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientEntry.d.ts","sourceRoot":"","sources":["../../src/field/clientEntry.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAuB,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAGvF,OAAO,KAAkB,MAAM,OAAO,CAAA;AAMtC,OAAO,KAAK,EAAE,sBAAsB,EAA6B,MAAM,mBAAmB,CAAA;AAI1F,KAAK,yBAAyB,GAAG;IAC/B,aAAa,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAA;IAC5E,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,CAAA;IAC/F,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAA;IACpD,SAAS,EAAE,SAAS,CAAA;CACrB,GAAG,wBAAwB,CAAA;AAE5B;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAqF1E,CAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { getFromImportMap } from 'payload/shared';
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
import { RichTextField } from './index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Client-only entry point for the Lexical rich text field.
|
|
9
|
+
* Resolves feature providers and component imports from the import map on the client,
|
|
10
|
+
* bypassing the RSC entry point that requires server-only data.
|
|
11
|
+
*/
|
|
12
|
+
export const ClientEntryLexicalField = props => {
|
|
13
|
+
const {
|
|
14
|
+
featureClientSchemaMap = {},
|
|
15
|
+
features = {},
|
|
16
|
+
field,
|
|
17
|
+
forceRender,
|
|
18
|
+
importMap,
|
|
19
|
+
path,
|
|
20
|
+
permissions,
|
|
21
|
+
readOnly,
|
|
22
|
+
schemaPath
|
|
23
|
+
} = props;
|
|
24
|
+
const {
|
|
25
|
+
clientFeatures,
|
|
26
|
+
featureClientImportMap
|
|
27
|
+
} = useMemo(() => {
|
|
28
|
+
const resolvedClientFeatures = {};
|
|
29
|
+
const resolvedFeatureImportMap = {};
|
|
30
|
+
const sortedFeatures = Object.entries(features).sort(([, a], [, b]) => a.order - b.order);
|
|
31
|
+
for (const [featureKey, featureMeta] of sortedFeatures) {
|
|
32
|
+
resolvedClientFeatures[featureKey] = {};
|
|
33
|
+
if (featureMeta.ClientFeature) {
|
|
34
|
+
const clientFeatureProvider = getFromImportMap({
|
|
35
|
+
importMap,
|
|
36
|
+
PayloadComponent: featureMeta.ClientFeature,
|
|
37
|
+
schemaPath: 'lexical-clientComponent',
|
|
38
|
+
silent: true
|
|
39
|
+
});
|
|
40
|
+
if (clientFeatureProvider) {
|
|
41
|
+
const clientFeatureProps = {
|
|
42
|
+
...(featureMeta.clientFeatureProps ?? {}),
|
|
43
|
+
featureKey: featureMeta.key,
|
|
44
|
+
order: featureMeta.order
|
|
45
|
+
};
|
|
46
|
+
if (typeof featureMeta.ClientFeature === 'object' && featureMeta.ClientFeature.clientProps) {
|
|
47
|
+
clientFeatureProps.clientProps = featureMeta.ClientFeature.clientProps;
|
|
48
|
+
}
|
|
49
|
+
resolvedClientFeatures[featureKey] = {
|
|
50
|
+
clientFeatureProps,
|
|
51
|
+
clientFeatureProvider
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (featureMeta.componentImports && typeof featureMeta.componentImports === 'object') {
|
|
56
|
+
for (const [importKey, payloadComponent] of Object.entries(featureMeta.componentImports)) {
|
|
57
|
+
const resolvedComponent = getFromImportMap({
|
|
58
|
+
importMap,
|
|
59
|
+
PayloadComponent: payloadComponent,
|
|
60
|
+
schemaPath: 'lexical-clientComponent',
|
|
61
|
+
silent: true
|
|
62
|
+
});
|
|
63
|
+
if (resolvedComponent) {
|
|
64
|
+
resolvedFeatureImportMap[`${featureKey}.${importKey}`] = resolvedComponent;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
clientFeatures: resolvedClientFeatures,
|
|
71
|
+
featureClientImportMap: resolvedFeatureImportMap
|
|
72
|
+
};
|
|
73
|
+
}, [features, importMap]);
|
|
74
|
+
return /*#__PURE__*/_jsx(RichTextField, {
|
|
75
|
+
clientFeatures: clientFeatures,
|
|
76
|
+
featureClientImportMap: featureClientImportMap,
|
|
77
|
+
featureClientSchemaMap: featureClientSchemaMap,
|
|
78
|
+
field: field,
|
|
79
|
+
forceRender: forceRender,
|
|
80
|
+
path: path,
|
|
81
|
+
permissions: permissions,
|
|
82
|
+
readOnly: readOnly,
|
|
83
|
+
schemaPath: schemaPath
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=clientEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientEntry.js","names":["getFromImportMap","React","useMemo","RichTextField","ClientEntryLexicalField","props","featureClientSchemaMap","features","field","forceRender","importMap","path","permissions","readOnly","schemaPath","clientFeatures","featureClientImportMap","resolvedClientFeatures","resolvedFeatureImportMap","sortedFeatures","Object","entries","sort","a","b","order","featureKey","featureMeta","ClientFeature","clientFeatureProvider","PayloadComponent","silent","clientFeatureProps","key","clientProps","componentImports","importKey","payloadComponent","resolvedComponent","_jsx"],"sources":["../../src/field/clientEntry.tsx"],"sourcesContent":["'use client'\n\nimport type { ImportMap, RichTextFieldClient, RichTextFieldClientProps } from 'payload'\n\nimport { getFromImportMap } from 'payload/shared'\nimport React, { useMemo } from 'react'\n\nimport type {\n BaseClientFeatureProps,\n FeatureProviderProviderClient,\n} from '../features/typesClient.js'\nimport type { FeatureClientSchemaMap, LexicalRichTextFieldProps } from '../types/index.js'\n\nimport { RichTextField } from './index.js'\n\ntype SerializedFeatureMetadata = {\n ClientFeature?: { clientProps?: Record<string, any>; path: string } | string\n clientFeatureProps?: Record<string, any>\n componentImports?: Record<string, { clientProps?: Record<string, any>; path: string } | string>\n key: string\n order: number\n}\n\nexport type ClientEntryLexicalFieldProps = {\n featureClientSchemaMap?: FeatureClientSchemaMap\n features?: Record<string, SerializedFeatureMetadata>\n importMap: ImportMap\n} & RichTextFieldClientProps\n\n/**\n * Client-only entry point for the Lexical rich text field.\n * Resolves feature providers and component imports from the import map on the client,\n * bypassing the RSC entry point that requires server-only data.\n */\nexport const ClientEntryLexicalField: React.FC<ClientEntryLexicalFieldProps> = (props) => {\n const {\n featureClientSchemaMap = {},\n features = {},\n field,\n forceRender,\n importMap,\n path,\n permissions,\n readOnly,\n schemaPath,\n } = props\n\n const { clientFeatures, featureClientImportMap } = useMemo(() => {\n const resolvedClientFeatures: LexicalRichTextFieldProps['clientFeatures'] = {}\n const resolvedFeatureImportMap: Record<string, any> = {}\n\n const sortedFeatures = Object.entries(features).sort(([, a], [, b]) => a.order - b.order)\n\n for (const [featureKey, featureMeta] of sortedFeatures) {\n resolvedClientFeatures[featureKey] = {}\n\n if (featureMeta.ClientFeature) {\n const clientFeatureProvider = getFromImportMap<FeatureProviderProviderClient | undefined>({\n importMap,\n PayloadComponent: featureMeta.ClientFeature,\n schemaPath: 'lexical-clientComponent',\n silent: true,\n })\n\n if (clientFeatureProvider) {\n const clientFeatureProps: BaseClientFeatureProps<Record<string, any>> = {\n ...(featureMeta.clientFeatureProps ?? {}),\n featureKey: featureMeta.key,\n order: featureMeta.order,\n }\n\n if (\n typeof featureMeta.ClientFeature === 'object' &&\n featureMeta.ClientFeature.clientProps\n ) {\n clientFeatureProps.clientProps = (featureMeta.ClientFeature as any).clientProps\n }\n\n resolvedClientFeatures[featureKey] = {\n clientFeatureProps,\n clientFeatureProvider,\n }\n }\n }\n\n if (featureMeta.componentImports && typeof featureMeta.componentImports === 'object') {\n for (const [importKey, payloadComponent] of Object.entries(featureMeta.componentImports)) {\n const resolvedComponent = getFromImportMap({\n importMap,\n PayloadComponent: payloadComponent,\n schemaPath: 'lexical-clientComponent',\n silent: true,\n })\n if (resolvedComponent) {\n resolvedFeatureImportMap[`${featureKey}.${importKey}`] = resolvedComponent\n }\n }\n }\n }\n\n return {\n clientFeatures: resolvedClientFeatures,\n featureClientImportMap: resolvedFeatureImportMap,\n }\n }, [features, importMap])\n\n return (\n <RichTextField\n clientFeatures={clientFeatures}\n featureClientImportMap={featureClientImportMap}\n featureClientSchemaMap={featureClientSchemaMap}\n field={field as RichTextFieldClient}\n forceRender={forceRender}\n path={path}\n permissions={permissions as LexicalRichTextFieldProps['permissions']}\n readOnly={readOnly}\n schemaPath={schemaPath}\n />\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,gBAAgB,QAAQ;AACjC,OAAOC,KAAA,IAASC,OAAO,QAAQ;AAQ/B,SAASC,aAAa,QAAQ;AAgB9B;;;;;AAKA,OAAO,MAAMC,uBAAA,GAAmEC,KAAA;EAC9E,MAAM;IACJC,sBAAA,GAAyB,CAAC,CAAC;IAC3BC,QAAA,GAAW,CAAC,CAAC;IACbC,KAAK;IACLC,WAAW;IACXC,SAAS;IACTC,IAAI;IACJC,WAAW;IACXC,QAAQ;IACRC;EAAU,CACX,GAAGT,KAAA;EAEJ,MAAM;IAAEU,cAAc;IAAEC;EAAsB,CAAE,GAAGd,OAAA,CAAQ;IACzD,MAAMe,sBAAA,GAAsE,CAAC;IAC7E,MAAMC,wBAAA,GAAgD,CAAC;IAEvD,MAAMC,cAAA,GAAiBC,MAAA,CAAOC,OAAO,CAACd,QAAA,EAAUe,IAAI,CAAC,CAAC,GAAGC,CAAA,CAAE,EAAE,GAAGC,CAAA,CAAE,KAAKD,CAAA,CAAEE,KAAK,GAAGD,CAAA,CAAEC,KAAK;IAExF,KAAK,MAAM,CAACC,UAAA,EAAYC,WAAA,CAAY,IAAIR,cAAA,EAAgB;MACtDF,sBAAsB,CAACS,UAAA,CAAW,GAAG,CAAC;MAEtC,IAAIC,WAAA,CAAYC,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AwBA,sBAAA;IACxBV,sBAAA,EAAwBA,sBAAA;IACxBE,KAAA,EAAOA,KAAA;IACPC,WAAA,EAAaA,WAAA;IACbE,IAAA,EAAMA,IAAA;IACNC,WAAA,EAAaA,WAAA;IACbC,QAAA,EAAUA,QAAA;IACVC,UAAA,EAAYA;;AAGlB","ignoreList":[]}
|
package/dist/field/index.css
CHANGED
|
@@ -37,21 +37,18 @@
|
|
|
37
37
|
position: relative;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
@keyframes fadeInBackground {
|
|
41
|
+
from {
|
|
42
|
+
background-color: transparent;
|
|
43
|
+
}
|
|
44
|
+
to {
|
|
45
|
+
background-color: var(--color-bg-hover);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
40
49
|
.rich-text-lexical--read-only {
|
|
41
50
|
.editor-container {
|
|
42
51
|
.editor {
|
|
43
|
-
@keyframes fadeInBackground {
|
|
44
|
-
from {
|
|
45
|
-
background-color: transparent;
|
|
46
|
-
}
|
|
47
|
-
to {
|
|
48
|
-
background-color: var(--color-bg-hover);
|
|
49
|
-
}
|
|
50
|
-
to {
|
|
51
|
-
background-color: var(--color-bg-hover);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
52
|
animation: fadeInBackground 0.5s ease forwards;
|
|
56
53
|
color: var(--color-text-tertiary);
|
|
57
54
|
}
|
package/dist/field/index.js
CHANGED
|
@@ -82,7 +82,7 @@ export const RichTextFieldImpl = props => {
|
|
|
82
82
|
const filteredClientFeatures = currentViewConfig?.filterFeatures ? currentViewConfig.filterFeatures(clientFeatures) : clientFeatures;
|
|
83
83
|
const featureProvidersLocal = [];
|
|
84
84
|
for (const clientFeature of Object.values(filteredClientFeatures)) {
|
|
85
|
-
if (!clientFeature.clientFeatureProvider) {
|
|
85
|
+
if (!clientFeature.clientFeatureProvider || !clientFeature.clientFeatureProps) {
|
|
86
86
|
continue;
|
|
87
87
|
}
|
|
88
88
|
featureProvidersLocal.push(clientFeature.clientFeatureProvider(clientFeature.clientFeatureProps));
|
package/dist/field/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ShimmerEffect","useConfig","React","lazy","Suspense","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","RichTextViewProvider","useRichTextView","RichTextEditor","then","module","default","RichText","RichTextField","props","_jsx","inheritable","views","RichTextFieldImpl","$","admin","t0","clientFeatures","featureClientImportMap","t1","featureClientSchemaMap","field","lexicalEditorConfig","t2","schemaPath","t3","undefined","_admin","t4","_lexicalEditorConfig","currentView","currentViewAdminConfig","viewLexical","lexical","t5","currentViewLexicalEditorConfig","config","finalSanitizedEditorConfig","setFinalSanitizedEditorConfig","t6","t7","view","currentViewConfig","filteredClientFeatures","filterFeatures","featureProvidersLocal","clientFeature","Object","values","clientFeatureProvider","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ShimmerEffect","useConfig","React","lazy","Suspense","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","RichTextViewProvider","useRichTextView","RichTextEditor","then","module","default","RichText","RichTextField","props","_jsx","inheritable","views","RichTextFieldImpl","$","admin","t0","clientFeatures","featureClientImportMap","t1","featureClientSchemaMap","field","lexicalEditorConfig","t2","schemaPath","t3","undefined","_admin","t4","_lexicalEditorConfig","currentView","currentViewAdminConfig","viewLexical","lexical","t5","currentViewLexicalEditorConfig","config","finalSanitizedEditorConfig","setFinalSanitizedEditorConfig","t6","t7","view","currentViewConfig","filteredClientFeatures","filterFeatures","featureProvidersLocal","clientFeature","Object","values","clientFeatureProvider","clientFeatureProps","push","resolvedClientFeatures","name","unSanitizedEditorConfig","features","t8","fallback","height","_createElement","editorConfig","key"],"sources":["../../src/field/index.tsx"],"sourcesContent":["'use client'\n\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\nimport type { RichTextFieldClient } from 'payload'\n\nimport { ShimmerEffect, useConfig } from '@payloadcms/ui'\nimport React, { lazy, Suspense, useEffect, useState } from 'react'\n\nimport type { FeatureProviderClient } from '../features/typesClient.js'\nimport type { SanitizedClientEditorConfig } from '../lexical/config/types.js'\nimport type { LexicalFieldAdminClientProps, LexicalRichTextFieldProps } from '../types/index.js'\n\nimport { defaultEditorLexicalConfig } from '../lexical/config/client/default.js'\nimport { loadClientFeatures } from '../lexical/config/client/loader.js'\nimport { sanitizeClientEditorConfig } from '../lexical/config/client/sanitize.js'\nimport { RichTextViewProvider, useRichTextView } from './RichTextViewProvider.js'\n\nconst RichTextEditor = lazy(() =>\n import('./Field.js').then((module) => ({ default: module.RichText })),\n)\n\nexport const RichTextField: React.FC<LexicalRichTextFieldProps> = (props) => {\n return (\n <RichTextViewProvider inheritable={true} views={props.views}>\n <RichTextFieldImpl {...props} />\n </RichTextViewProvider>\n )\n}\n\nexport const RichTextFieldImpl: React.FC<LexicalRichTextFieldProps> = (props) => {\n const {\n admin: _admin = {},\n clientFeatures,\n featureClientImportMap = {},\n featureClientSchemaMap,\n field,\n lexicalEditorConfig: _lexicalEditorConfig = defaultEditorLexicalConfig,\n schemaPath,\n views,\n } = props\n const { currentView } = useRichTextView()\n const currentViewAdminConfig: LexicalFieldAdminClientProps = views?.[currentView]?.admin ?? _admin\n const viewLexical = views?.[currentView]?.lexical\n // Resolve function form of lexical config if provided\n const currentViewLexicalEditorConfig: LexicalEditorConfig =\n typeof viewLexical === 'function'\n ? viewLexical(_lexicalEditorConfig)\n : (viewLexical ?? _lexicalEditorConfig)\n\n const { config } = useConfig()\n\n const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] =\n useState<null | SanitizedClientEditorConfig>(null)\n\n useEffect(() => {\n if (finalSanitizedEditorConfig && finalSanitizedEditorConfig.view === currentView) {\n return\n }\n\n const currentViewConfig = views?.[currentView]\n const filteredClientFeatures = currentViewConfig?.filterFeatures\n ? currentViewConfig.filterFeatures(clientFeatures)\n : clientFeatures\n\n const featureProvidersLocal: FeatureProviderClient<any, any>[] = []\n for (const clientFeature of Object.values(filteredClientFeatures)) {\n if (!clientFeature.clientFeatureProvider || !clientFeature.clientFeatureProps) {\n continue\n }\n featureProvidersLocal.push(\n clientFeature.clientFeatureProvider(clientFeature.clientFeatureProps),\n )\n }\n\n const resolvedClientFeatures = loadClientFeatures({\n config,\n featureClientImportMap,\n featureClientSchemaMap,\n field: field as RichTextFieldClient,\n schemaPath: schemaPath ?? field.name,\n unSanitizedEditorConfig: {\n features: featureProvidersLocal,\n lexical: currentViewLexicalEditorConfig,\n },\n })\n\n setFinalSanitizedEditorConfig(\n sanitizeClientEditorConfig(\n resolvedClientFeatures,\n currentViewLexicalEditorConfig,\n currentViewAdminConfig,\n currentView,\n ),\n )\n }, [\n currentViewAdminConfig,\n clientFeatures,\n config,\n featureClientImportMap,\n featureClientSchemaMap,\n field,\n finalSanitizedEditorConfig,\n currentViewLexicalEditorConfig,\n schemaPath,\n currentView,\n views,\n ]) // TODO: Optimize this and use useMemo for this in the future. This might break sub-richtext-blocks from the blocks feature. Need to investigate\n\n return (\n <Suspense fallback={<ShimmerEffect height=\"35vh\" />}>\n {finalSanitizedEditorConfig && (\n <RichTextEditor\n {...props}\n editorConfig={finalSanitizedEditorConfig}\n key={finalSanitizedEditorConfig.view}\n />\n )}\n </Suspense>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;;AAKA,SAASC,aAAa,EAAEC,SAAS,QAAQ;AACzC,OAAOC,KAAA,IAASC,IAAI,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,QAAQ;AAM3D,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,oBAAoB,EAAEC,eAAe,QAAQ;AAEtD,MAAMC,cAAA,gBAAiBT,IAAA,CAAK,MAC1B,MAAM,CAAC,cAAcU,IAAI,CAAEC,MAAA,KAAY;EAAEC,OAAA,EAASD,MAAA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QAAAmD,YAAA,EACKvB,0BAAA;QAAAwB,GAAA,EACTxB,0BAAA,CAAAI;MAAA,C;;;;;;;;SALXe,E;CAUJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rscEntry.d.ts","sourceRoot":"","sources":["../../src/field/rscEntry.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EAGV,oBAAoB,EACrB,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"rscEntry.d.ts","sourceRoot":"","sources":["../../src/field/rscEntry.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EAGV,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAMhB,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,mBAAmB,CAAA;AAO1B,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CACzC;IACE,qBAAqB,EAAE,2BAA2B,CAAA;CACnD,GAAG,oBAAoB,GACtB,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GACxB,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,OAAO,CAAC,GAC3C,oBAAoB,CA0GvB,CAAA"}
|
package/dist/field/rscEntry.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getTranslation } from '@payloadcms/translations';
|
|
3
|
+
import { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent';
|
|
3
4
|
import { renderField } from '@payloadcms/ui/forms/renderField';
|
|
4
5
|
import { getFromImportMap } from 'payload/shared';
|
|
5
6
|
import React from 'react';
|
|
@@ -43,6 +44,7 @@ export const RscEntryLexicalField = async args => {
|
|
|
43
44
|
operation: args.operation,
|
|
44
45
|
permissions: args.permissions,
|
|
45
46
|
preferences: args.preferences,
|
|
47
|
+
renderComponent: args.renderComponent || RenderServerComponent,
|
|
46
48
|
renderFieldFn: renderField,
|
|
47
49
|
req: args.req
|
|
48
50
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rscEntry.js","names":["getTranslation","renderField","getFromImportMap","React","RichTextField","buildInitialState","initLexicalFeatures","RscEntryLexicalField","args","field","path","clientField","name","schemaPath","disabled","readOnly","admin","Error","clientFeatures","featureClientImportMap","featureClientSchemaMap","clientFieldSchemaMap","fieldSchemaMap","i18n","payload","sanitizedEditorConfig","initialLexicalFormState","siblingData","root","children","length","context","id","collectionSlug","documentData","data","lexicalFieldSchemaPath","operation","permissions","preferences","renderFieldFn","req","nodeData","placeholderFromArgs","placeholder","undefined","hideGutter","hideInsertParagraphAtEnd","hideAddBlockButton","hideDraggableBlockElement","props","forceRender","lexicalEditorConfig","lexical","renderedBlocks","views","viewMap","importMap","PayloadComponent","silent","Object","keys","key","_jsx"],"sources":["../../src/field/rscEntry.tsx"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\nimport type {\n ClientComponentProps,\n FieldPaths,\n RichTextFieldClient,\n RichTextField as RichTextFieldType,\n ServerComponentProps,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { renderField } from '@payloadcms/ui/forms/renderField'\nimport { getFromImportMap } from 'payload/shared'\nimport React from 'react'\n\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type {\n LexicalEditorProps,\n LexicalEditorViewMap,\n LexicalFieldAdminClientProps,\n LexicalRichTextFieldProps,\n} from '../types/index.js'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { RichTextField } from '../exports/client/index.js'\nimport { buildInitialState } from '../utilities/buildInitialState.js'\nimport { initLexicalFeatures } from '../utilities/initLexicalFeatures.js'\n\nexport const RscEntryLexicalField: React.FC<\n {\n sanitizedEditorConfig: SanitizedServerEditorConfig\n } & ClientComponentProps &\n Pick<FieldPaths, 'path'> &\n Pick<LexicalEditorProps, 'admin' | 'views'> &\n ServerComponentProps\n> = async (args) => {\n const field: RichTextFieldType = args.field as RichTextFieldType\n const path = args.path ?? (args.clientField as RichTextFieldClient).name\n const schemaPath = args.schemaPath ?? path\n\n const disabled = args?.readOnly || field?.admin?.readOnly\n\n if (!(args?.clientField as RichTextFieldClient)?.name) {\n throw new Error('Initialized lexical RSC field without a field name')\n }\n\n const { clientFeatures, featureClientImportMap, featureClientSchemaMap } = initLexicalFeatures({\n clientFieldSchemaMap: args.clientFieldSchemaMap,\n fieldSchemaMap: args.fieldSchemaMap,\n i18n: args.i18n,\n path,\n payload: args.payload,\n sanitizedEditorConfig: args.sanitizedEditorConfig,\n schemaPath,\n })\n\n let initialLexicalFormState = {}\n if (args.siblingData?.[field.name]?.root?.children?.length) {\n initialLexicalFormState = await buildInitialState({\n context: {\n id: args.id,\n clientFieldSchemaMap: args.clientFieldSchemaMap,\n collectionSlug: args.collectionSlug,\n disabled,\n documentData: args.data,\n field,\n fieldSchemaMap: args.fieldSchemaMap,\n lexicalFieldSchemaPath: schemaPath,\n operation: args.operation,\n permissions: args.permissions,\n preferences: args.preferences,\n renderFieldFn: renderField,\n req: args.req,\n },\n nodeData: args.siblingData?.[field.name]?.root?.children as SerializedLexicalNode[],\n })\n }\n\n const placeholderFromArgs = args.admin?.placeholder\n const placeholder = placeholderFromArgs\n ? getTranslation(placeholderFromArgs, args.i18n)\n : undefined\n\n const admin: LexicalFieldAdminClientProps = {}\n if (placeholder) {\n admin.placeholder = placeholder\n }\n if (args.admin?.hideGutter) {\n admin.hideGutter = true\n }\n if (args.admin?.hideInsertParagraphAtEnd) {\n admin.hideInsertParagraphAtEnd = true\n }\n if (args.admin?.hideAddBlockButton) {\n admin.hideAddBlockButton = true\n }\n if (args.admin?.hideDraggableBlockElement) {\n admin.hideDraggableBlockElement = true\n }\n\n const props: LexicalRichTextFieldProps = {\n clientFeatures,\n featureClientSchemaMap, // TODO: Does client need this? Why cant this just live in the server\n field: args.clientField as RichTextFieldClient,\n forceRender: args.forceRender,\n initialLexicalFormState,\n lexicalEditorConfig: args.sanitizedEditorConfig.lexical,\n path,\n permissions: args.permissions,\n readOnly: args.readOnly,\n renderedBlocks: args.renderedBlocks,\n schemaPath,\n }\n if (args?.views) {\n const viewMap = getFromImportMap<LexicalEditorViewMap>({\n importMap: args.payload.importMap,\n PayloadComponent: args.views,\n schemaPath: 'lexical-viewMap',\n silent: true,\n })\n if (viewMap) {\n props.views = viewMap\n }\n }\n\n if (Object.keys(admin).length) {\n props.admin = admin\n }\n if (Object.keys(featureClientImportMap).length) {\n props.featureClientImportMap = featureClientImportMap\n }\n\n for (const key in props) {\n if (props[key as keyof LexicalRichTextFieldProps] === undefined) {\n delete props[key as keyof LexicalRichTextFieldProps]\n }\n }\n\n return <RichTextField {...props} />\n}\n"],"mappings":";AASA,SAASA,cAAc,QAAQ;AAC/B,SAASC,WAAW,QAAQ;AAC5B,SAASC,gBAAgB,QAAQ;AACjC,OAAOC,KAAA,MAAW;AAUlB;AACA,SAASC,aAAa,QAAQ;AAC9B,SAASC,iBAAiB,QAAQ;AAClC,SAASC,mBAAmB,QAAQ;AAEpC,OAAO,MAAMC,oBAAA,GAOT,MAAOC,IAAA;EACT,MAAMC,KAAA,GAA2BD,IAAA,CAAKC,KAAK;EAC3C,MAAMC,IAAA,GAAOF,IAAA,CAAKE,IAAI,IAAIF,IAAC,CAAKG,WAAW,CAAyBC,IAAI;EACxE,MAAMC,UAAA,GAAaL,IAAA,CAAKK,UAAU,IAAIH,IAAA;EAEtC,MAAMI,QAAA,GAAWN,IAAA,EAAMO,QAAA,IAAYN,KAAA,EAAOO,KAAA,EAAOD,QAAA;EAEjD,IAAI,CAAEP,IAAA,EAAMG,WAAA,EAAqCC,IAAA,EAAM;IACrD,MAAM,IAAIK,KAAA,CAAM;EAClB;EAEA,MAAM;IAAEC,cAAc;IAAEC,sBAAsB;IAAEC;EAAsB,CAAE,GAAGd,mBAAA,CAAoB;IAC7Fe,oBAAA,EAAsBb,IAAA,CAAKa,oBAAoB;IAC/CC,cAAA,EAAgBd,IAAA,CAAKc,cAAc;IACnCC,IAAA,EAAMf,IAAA,CAAKe,IAAI;IACfb,IAAA;IACAc,OAAA,EAAShB,IAAA,CAAKgB,OAAO;IACrBC,qBAAA,EAAuBjB,IAAA,CAAKiB,qBAAqB;IACjDZ;EACF;EAEA,IAAIa,uBAAA,GAA0B,CAAC;EAC/B,IAAIlB,IAAA,CAAKmB,WAAW,GAAGlB,KAAA,CAAMG,IAAI,CAAC,EAAEgB,IAAA,EAAMC,QAAA,EAAUC,MAAA,EAAQ;IAC1DJ,uBAAA,GAA0B,MAAMrB,iBAAA,CAAkB;MAChD0B,OAAA,EAAS;QACPC,EAAA,EAAIxB,IAAA,CAAKwB,EAAE;QACXX,oBAAA,EAAsBb,IAAA,CAAKa,oBAAoB;QAC/CY,cAAA,EAAgBzB,IAAA,CAAKyB,cAAc;QACnCnB,QAAA;QACAoB,YAAA,EAAc1B,IAAA,CAAK2B,IAAI;QACvB1B,KAAA;QACAa,cAAA,EAAgBd,IAAA,CAAKc,cAAc;QACnCc,sBAAA,EAAwBvB,UAAA;QACxBwB,SAAA,EAAW7B,IAAA,CAAK6B,SAAS;QACzBC,WAAA,EAAa9B,IAAA,CAAK8B,WAAW;QAC7BC,WAAA,EAAa/B,IAAA,CAAK+B,WAAW;QAC7BC,aAAA,
|
|
1
|
+
{"version":3,"file":"rscEntry.js","names":["getTranslation","RenderServerComponent","renderField","getFromImportMap","React","RichTextField","buildInitialState","initLexicalFeatures","RscEntryLexicalField","args","field","path","clientField","name","schemaPath","disabled","readOnly","admin","Error","clientFeatures","featureClientImportMap","featureClientSchemaMap","clientFieldSchemaMap","fieldSchemaMap","i18n","payload","sanitizedEditorConfig","initialLexicalFormState","siblingData","root","children","length","context","id","collectionSlug","documentData","data","lexicalFieldSchemaPath","operation","permissions","preferences","renderComponent","renderFieldFn","req","nodeData","placeholderFromArgs","placeholder","undefined","hideGutter","hideInsertParagraphAtEnd","hideAddBlockButton","hideDraggableBlockElement","props","forceRender","lexicalEditorConfig","lexical","renderedBlocks","views","viewMap","importMap","PayloadComponent","silent","Object","keys","key","_jsx"],"sources":["../../src/field/rscEntry.tsx"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\nimport type {\n ClientComponentProps,\n FieldPaths,\n RichTextFieldClient,\n RichTextField as RichTextFieldType,\n ServerComponentProps,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent'\nimport { renderField } from '@payloadcms/ui/forms/renderField'\nimport { getFromImportMap } from 'payload/shared'\nimport React from 'react'\n\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type {\n LexicalEditorProps,\n LexicalEditorViewMap,\n LexicalFieldAdminClientProps,\n LexicalRichTextFieldProps,\n} from '../types/index.js'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { RichTextField } from '../exports/client/index.js'\nimport { buildInitialState } from '../utilities/buildInitialState.js'\nimport { initLexicalFeatures } from '../utilities/initLexicalFeatures.js'\n\nexport const RscEntryLexicalField: React.FC<\n {\n sanitizedEditorConfig: SanitizedServerEditorConfig\n } & ClientComponentProps &\n Pick<FieldPaths, 'path'> &\n Pick<LexicalEditorProps, 'admin' | 'views'> &\n ServerComponentProps\n> = async (args) => {\n const field: RichTextFieldType = args.field as RichTextFieldType\n const path = args.path ?? (args.clientField as RichTextFieldClient).name\n const schemaPath = args.schemaPath ?? path\n\n const disabled = args?.readOnly || field?.admin?.readOnly\n\n if (!(args?.clientField as RichTextFieldClient)?.name) {\n throw new Error('Initialized lexical RSC field without a field name')\n }\n\n const { clientFeatures, featureClientImportMap, featureClientSchemaMap } = initLexicalFeatures({\n clientFieldSchemaMap: args.clientFieldSchemaMap,\n fieldSchemaMap: args.fieldSchemaMap,\n i18n: args.i18n,\n path,\n payload: args.payload,\n sanitizedEditorConfig: args.sanitizedEditorConfig,\n schemaPath,\n })\n\n let initialLexicalFormState = {}\n if (args.siblingData?.[field.name]?.root?.children?.length) {\n initialLexicalFormState = await buildInitialState({\n context: {\n id: args.id,\n clientFieldSchemaMap: args.clientFieldSchemaMap,\n collectionSlug: args.collectionSlug,\n disabled,\n documentData: args.data,\n field,\n fieldSchemaMap: args.fieldSchemaMap,\n lexicalFieldSchemaPath: schemaPath,\n operation: args.operation,\n permissions: args.permissions,\n preferences: args.preferences,\n renderComponent: args.renderComponent || RenderServerComponent,\n renderFieldFn: renderField,\n req: args.req,\n },\n nodeData: args.siblingData?.[field.name]?.root?.children as SerializedLexicalNode[],\n })\n }\n\n const placeholderFromArgs = args.admin?.placeholder\n const placeholder = placeholderFromArgs\n ? getTranslation(placeholderFromArgs, args.i18n)\n : undefined\n\n const admin: LexicalFieldAdminClientProps = {}\n if (placeholder) {\n admin.placeholder = placeholder\n }\n if (args.admin?.hideGutter) {\n admin.hideGutter = true\n }\n if (args.admin?.hideInsertParagraphAtEnd) {\n admin.hideInsertParagraphAtEnd = true\n }\n if (args.admin?.hideAddBlockButton) {\n admin.hideAddBlockButton = true\n }\n if (args.admin?.hideDraggableBlockElement) {\n admin.hideDraggableBlockElement = true\n }\n\n const props: LexicalRichTextFieldProps = {\n clientFeatures,\n featureClientSchemaMap, // TODO: Does client need this? Why cant this just live in the server\n field: args.clientField as RichTextFieldClient,\n forceRender: args.forceRender,\n initialLexicalFormState,\n lexicalEditorConfig: args.sanitizedEditorConfig.lexical,\n path,\n permissions: args.permissions,\n readOnly: args.readOnly,\n renderedBlocks: args.renderedBlocks,\n schemaPath,\n }\n if (args?.views) {\n const viewMap = getFromImportMap<LexicalEditorViewMap>({\n importMap: args.payload.importMap,\n PayloadComponent: args.views,\n schemaPath: 'lexical-viewMap',\n silent: true,\n })\n if (viewMap) {\n props.views = viewMap\n }\n }\n\n if (Object.keys(admin).length) {\n props.admin = admin\n }\n if (Object.keys(featureClientImportMap).length) {\n props.featureClientImportMap = featureClientImportMap\n }\n\n for (const key in props) {\n if (props[key as keyof LexicalRichTextFieldProps] === undefined) {\n delete props[key as keyof LexicalRichTextFieldProps]\n }\n }\n\n return <RichTextField {...props} />\n}\n"],"mappings":";AASA,SAASA,cAAc,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ;AACtC,SAASC,WAAW,QAAQ;AAC5B,SAASC,gBAAgB,QAAQ;AACjC,OAAOC,KAAA,MAAW;AAUlB;AACA,SAASC,aAAa,QAAQ;AAC9B,SAASC,iBAAiB,QAAQ;AAClC,SAASC,mBAAmB,QAAQ;AAEpC,OAAO,MAAMC,oBAAA,GAOT,MAAOC,IAAA;EACT,MAAMC,KAAA,GAA2BD,IAAA,CAAKC,KAAK;EAC3C,MAAMC,IAAA,GAAOF,IAAA,CAAKE,IAAI,IAAIF,IAAC,CAAKG,WAAW,CAAyBC,IAAI;EACxE,MAAMC,UAAA,GAAaL,IAAA,CAAKK,UAAU,IAAIH,IAAA;EAEtC,MAAMI,QAAA,GAAWN,IAAA,EAAMO,QAAA,IAAYN,KAAA,EAAOO,KAAA,EAAOD,QAAA;EAEjD,IAAI,CAAEP,IAAA,EAAMG,WAAA,EAAqCC,IAAA,EAAM;IACrD,MAAM,IAAIK,KAAA,CAAM;EAClB;EAEA,MAAM;IAAEC,cAAc;IAAEC,sBAAsB;IAAEC;EAAsB,CAAE,GAAGd,mBAAA,CAAoB;IAC7Fe,oBAAA,EAAsBb,IAAA,CAAKa,oBAAoB;IAC/CC,cAAA,EAAgBd,IAAA,CAAKc,cAAc;IACnCC,IAAA,EAAMf,IAAA,CAAKe,IAAI;IACfb,IAAA;IACAc,OAAA,EAAShB,IAAA,CAAKgB,OAAO;IACrBC,qBAAA,EAAuBjB,IAAA,CAAKiB,qBAAqB;IACjDZ;EACF;EAEA,IAAIa,uBAAA,GAA0B,CAAC;EAC/B,IAAIlB,IAAA,CAAKmB,WAAW,GAAGlB,KAAA,CAAMG,IAAI,CAAC,EAA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,GAAA,CAAuC;IACtD;EACF;EAEA,oBAAOC,IAAA,CAAC5D,aAAA;IAAe,GAAG+C;;AAC5B","ignoreList":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ export { BlockquoteFeature } from './features/blockquote/server/index.js';
|
|
|
6
6
|
export { CodeBlock } from './features/blocks/premade/CodeBlock/index.js';
|
|
7
7
|
export { BlocksFeature } from './features/blocks/server/index.js';
|
|
8
8
|
export type { BlocksFeatureProps, LexicalBlockClientProps, LexicalBlockLabelClientProps, LexicalBlockLabelServerProps, LexicalBlockServerProps, LexicalInlineBlockClientProps, LexicalInlineBlockLabelClientProps, LexicalInlineBlockLabelServerProps, LexicalInlineBlockServerProps, } from './features/blocks/server/index.js';
|
|
9
|
-
export { $createServerBlockNode, $isServerBlockNode,
|
|
10
|
-
export { $createServerInlineBlockNode, $isServerInlineBlockNode,
|
|
9
|
+
export { $createServerBlockNode, $isServerBlockNode, ServerBlockNode, } from './features/blocks/server/nodes/BlocksNode.js';
|
|
10
|
+
export { $createServerInlineBlockNode, $isServerInlineBlockNode, ServerInlineBlockNode, } from './features/blocks/server/nodes/InlineBlocksNode.js';
|
|
11
|
+
export type { BlockFields, InlineBlockFields } from './features/blocks/server/schema.js';
|
|
11
12
|
export { convertHTMLToLexical } from './features/converters/htmlToLexical/index.js';
|
|
12
13
|
export { lexicalHTMLField } from './features/converters/lexicalToHtml/async/field/index.js';
|
|
13
14
|
export { convertLexicalToMarkdown } from './features/converters/lexicalToMarkdown/index.js';
|
|
@@ -30,14 +31,15 @@ export { HorizontalRuleFeature } from './features/horizontalRule/server/index.js
|
|
|
30
31
|
export { IndentFeature } from './features/indent/server/index.js';
|
|
31
32
|
export { $createAutoLinkNode, $isAutoLinkNode, AutoLinkNode, } from './features/link/nodes/AutoLinkNode.js';
|
|
32
33
|
export { $createLinkNode, $isLinkNode, LinkNode } from './features/link/nodes/LinkNode.js';
|
|
33
|
-
export type { LinkFields } from './features/link/nodes/types.js';
|
|
34
34
|
export { LinkFeature, type LinkFeatureServerProps } from './features/link/server/index.js';
|
|
35
|
+
export type { LinkFields } from './features/link/server/schema.js';
|
|
35
36
|
export { ChecklistFeature } from './features/lists/checklist/server/index.js';
|
|
36
37
|
export { OrderedListFeature } from './features/lists/orderedList/server/index.js';
|
|
37
38
|
export { UnorderedListFeature } from './features/lists/unorderedList/server/index.js';
|
|
38
39
|
export { ParagraphFeature } from './features/paragraph/server/index.js';
|
|
39
40
|
export { RelationshipFeature, type RelationshipFeatureProps, } from './features/relationship/server/index.js';
|
|
40
|
-
export {
|
|
41
|
+
export { RelationshipServerNode } from './features/relationship/server/nodes/RelationshipNode.js';
|
|
42
|
+
export type { RelationshipData } from './features/relationship/server/schema.js';
|
|
41
43
|
export { defaultColors } from './features/textState/defaultColors.js';
|
|
42
44
|
export { TextStateFeature } from './features/textState/feature.server.js';
|
|
43
45
|
export { FixedToolbarFeature } from './features/toolbars/fixed/server/index.js';
|
|
@@ -48,7 +50,8 @@ export type { AfterChangeNodeHook, AfterChangeNodeHookArgs, AfterReadNodeHook, A
|
|
|
48
50
|
export { createNode } from './features/typeUtilities.js';
|
|
49
51
|
export { UploadFeature } from './features/upload/server/index.js';
|
|
50
52
|
export type { UploadFeatureProps } from './features/upload/server/index.js';
|
|
51
|
-
export {
|
|
53
|
+
export { UploadServerNode } from './features/upload/server/nodes/UploadNode.js';
|
|
54
|
+
export type { UploadData } from './features/upload/server/schema.js';
|
|
52
55
|
export type { EditorConfigContextType } from './lexical/config/client/EditorConfigProvider.js';
|
|
53
56
|
export { defaultEditorConfig, defaultEditorFeatures, defaultEditorLexicalConfig, } from './lexical/config/server/default.js';
|
|
54
57
|
export { loadFeatures, sortFeaturesForOptimalLoading } from './lexical/config/server/loader.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index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AAE,MAAM,oCAAoC,CAAA;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAE3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAA;AAElG,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { checkDependencies, deepMergeSimple } from 'payload';
|
|
2
|
+
import { isRSCEnabled } from 'payload/shared';
|
|
2
3
|
import { getLexicalHooks } from './hooks.js';
|
|
3
4
|
import { i18n } from './i18n.js';
|
|
4
5
|
import { defaultEditorFeatures } from './lexical/config/server/default.js';
|
|
@@ -66,18 +67,20 @@ export function lexicalEditor(args) {
|
|
|
66
67
|
supportedLanguagesToMerge[lang] = featureI18n[lang];
|
|
67
68
|
}
|
|
68
69
|
config.i18n.translations = deepMergeSimple(config.i18n.translations, supportedLanguagesToMerge);
|
|
70
|
+
const rscEnabled = isRSCEnabled();
|
|
69
71
|
return {
|
|
70
|
-
CellComponent: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell',
|
|
71
|
-
|
|
72
|
+
CellComponent: rscEnabled ? '@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell' : false,
|
|
73
|
+
ClientFieldComponent: '@payloadcms/richtext-lexical/client#ClientEntryLexicalField',
|
|
74
|
+
DiffComponent: rscEnabled ? '@payloadcms/richtext-lexical/rsc#LexicalDiffComponent' : false,
|
|
72
75
|
editorConfig: finalSanitizedEditorConfig,
|
|
73
76
|
features,
|
|
74
|
-
FieldComponent: {
|
|
77
|
+
FieldComponent: rscEnabled ? {
|
|
75
78
|
path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalField',
|
|
76
79
|
serverProps: {
|
|
77
80
|
admin: args?.admin,
|
|
78
81
|
views: args?.views
|
|
79
82
|
}
|
|
80
|
-
},
|
|
83
|
+
} : false,
|
|
81
84
|
generateImportMap: getGenerateImportMap({
|
|
82
85
|
lexicalEditorArgs: args,
|
|
83
86
|
resolvedFeatureMap
|
|
@@ -85,6 +88,46 @@ export function lexicalEditor(args) {
|
|
|
85
88
|
generateSchemaMap: getGenerateSchemaMap({
|
|
86
89
|
resolvedFeatureMap
|
|
87
90
|
}),
|
|
91
|
+
getClientFieldProps({
|
|
92
|
+
clientFieldSchemaMap,
|
|
93
|
+
path: fieldPath,
|
|
94
|
+
schemaPath: fieldSchemaPath
|
|
95
|
+
}) {
|
|
96
|
+
const serializedFeatures = {};
|
|
97
|
+
for (const [featureKey, resolvedFeature] of finalSanitizedEditorConfig.resolvedFeatureMap) {
|
|
98
|
+
const entry = {
|
|
99
|
+
key: resolvedFeature.key,
|
|
100
|
+
order: resolvedFeature.order
|
|
101
|
+
};
|
|
102
|
+
if (resolvedFeature.ClientFeature) {
|
|
103
|
+
entry.ClientFeature = resolvedFeature.ClientFeature;
|
|
104
|
+
}
|
|
105
|
+
if (resolvedFeature.clientFeatureProps) {
|
|
106
|
+
entry.clientFeatureProps = resolvedFeature.clientFeatureProps;
|
|
107
|
+
}
|
|
108
|
+
if (resolvedFeature.componentImports && typeof resolvedFeature.componentImports === 'object' && !Array.isArray(resolvedFeature.componentImports)) {
|
|
109
|
+
entry.componentImports = resolvedFeature.componentImports;
|
|
110
|
+
}
|
|
111
|
+
serializedFeatures[featureKey] = entry;
|
|
112
|
+
}
|
|
113
|
+
const featureClientSchemaMap = {};
|
|
114
|
+
for (const [featureKey, resolvedFeature] of finalSanitizedEditorConfig.resolvedFeatureMap) {
|
|
115
|
+
if (!resolvedFeature.generateSchemaMap) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
const featureSchemaPath = `${fieldSchemaPath}.lexical_internal_feature.${featureKey}`;
|
|
119
|
+
featureClientSchemaMap[featureKey] = {};
|
|
120
|
+
for (const [key, entry] of clientFieldSchemaMap.entries()) {
|
|
121
|
+
if (key.startsWith(featureSchemaPath)) {
|
|
122
|
+
featureClientSchemaMap[featureKey][key] = 'fields' in entry ? entry.fields : [entry];
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
featureClientSchemaMap,
|
|
128
|
+
features: serializedFeatures
|
|
129
|
+
};
|
|
130
|
+
},
|
|
88
131
|
graphQLPopulationPromises({
|
|
89
132
|
context,
|
|
90
133
|
currentDepth,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["checkDependencies","deepMergeSimple","getLexicalHooks","i18n","defaultEditorFeatures","populateLexicalPopulationPromises","getFieldToJSONSchema","featuresInputToEditorConfig","getGenerateImportMap","getGenerateSchemaMap","getDefaultSanitizedEditorConfig","richTextValidateHOC","checkedDependencies","lexicalTargetVersion","lexicalEditor","args","process","env","NODE_ENV","PAYLOAD_DISABLE_DEPENDENCY_CHECKER","dependencyGroups","name","dependencies","targetVersion","config","isRoot","parentIsLocalized","features","resolvedFeatureMap","finalSanitizedEditorConfig","lexical","result","sanitizedConfig","featureI18n","supportedLanguages","supportedLanguagesToMerge","_lang","lang","lexicalI18nForLang","general","translations","CellComponent","DiffComponent","editorConfig","FieldComponent","path","serverProps","admin","views","generateImportMap","lexicalEditorArgs","generateSchemaMap","graphQLPopulationPromises","context","currentDepth","depth","draft","field","fieldPromises","findMany","flattenLocales","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","size","editorPopulationPromises","hooks","jsonSchema","validate","AlignFeature","BlockquoteFeature","CodeBlock","BlocksFeature","$createServerBlockNode","$isServerBlockNode","ServerBlockNode","$createServerInlineBlockNode","$isServerInlineBlockNode","ServerInlineBlockNode","convertHTMLToLexical","lexicalHTMLField","convertLexicalToMarkdown","convertMarkdownToLexical","getPayloadPopulateFn","getRestPopulateFn","DebugJsxConverterFeature","TestRecorderFeature","TreeViewFeature","EXPERIMENTAL_TableFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","$createAutoLinkNode","$isAutoLinkNode","AutoLinkNode","$createLinkNode","$isLinkNode","LinkNode","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","RelationshipServerNode","defaultColors","TextStateFeature","FixedToolbarFeature","InlineToolbarFeature","createNode","UploadFeature","UploadServerNode","defaultEditorConfig","defaultEditorLexicalConfig","loadFeatures","sortFeaturesForOptimalLoading","sanitizeServerEditorConfig","sanitizeServerFeatures","getEnabledNodes","getEnabledNodesFromServerNodes","DETAIL_TYPE_TO_DETAIL","DOUBLE_LINE_BREAK","ELEMENT_FORMAT_TO_TYPE","ELEMENT_TYPE_TO_FORMAT","IS_ALL_FORMATTING","LTR_REGEX","NodeFormat","NON_BREAKING_SPACE","RTL_REGEX","TEXT_MODE_TO_TYPE","TEXT_TYPE_TO_FORMAT","TEXT_TYPE_TO_MODE","sanitizeUrl","validateUrl","$convertFromMarkdownString","defaultRichTextValue","populate","buildDefaultEditorState","buildEditorState","createServerFeature","editorConfigFactory","extractPropsFromJSXPropsString","extractFrontmatter","frontmatterToObject","objectToFrontmatter","propsToJSXString","upgradeLexicalData"],"sources":["../src/index.ts"],"sourcesContent":["import type { GenericLanguages, GenericTranslationsObject } from '@payloadcms/translations'\n\nimport { checkDependencies, deepMergeSimple } from 'payload'\n\nimport type { FeatureProviderServer, ResolvedServerFeatureMap } from './features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from './lexical/config/types.js'\nimport type {\n AdapterProps,\n LexicalEditorProps,\n LexicalRichTextAdapterProvider,\n} from './types/index.js'\n\nimport { getLexicalHooks } from './hooks.js'\nimport { i18n } from './i18n.js'\nimport { defaultEditorFeatures } from './lexical/config/server/default.js'\nimport { populateLexicalPopulationPromises } from './populateGraphQL/populateLexicalPopulationPromises.js'\nimport { getFieldToJSONSchema } from './types/schema.js'\nimport { featuresInputToEditorConfig } from './utilities/editorConfigFactory.js'\nimport { getGenerateImportMap } from './utilities/generateImportMap.js'\nimport { getGenerateSchemaMap } from './utilities/generateSchemaMap.js'\nimport { getDefaultSanitizedEditorConfig } from './utilities/getDefaultSanitizedEditorConfig.js'\nimport { richTextValidateHOC } from './validate/index.js'\n\nlet checkedDependencies = false\n\nexport const lexicalTargetVersion = '0.41.0'\n\nexport function lexicalEditor(args?: LexicalEditorProps): LexicalRichTextAdapterProvider {\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.PAYLOAD_DISABLE_DEPENDENCY_CHECKER !== 'true' &&\n !checkedDependencies\n ) {\n checkedDependencies = true\n void checkDependencies({\n dependencyGroups: [\n {\n name: 'lexical',\n dependencies: [\n 'lexical',\n '@lexical/headless',\n '@lexical/link',\n '@lexical/list',\n '@lexical/mark',\n '@lexical/react',\n '@lexical/rich-text',\n '@lexical/selection',\n '@lexical/utils',\n ],\n targetVersion: lexicalTargetVersion,\n },\n ],\n })\n }\n return async ({ config, isRoot, parentIsLocalized }) => {\n let features: FeatureProviderServer<unknown, unknown, unknown>[] = []\n let resolvedFeatureMap: ResolvedServerFeatureMap\n\n let finalSanitizedEditorConfig: SanitizedServerEditorConfig // For server only\n if (!args || (!args.features && !args.lexical)) {\n finalSanitizedEditorConfig = await getDefaultSanitizedEditorConfig({\n config,\n parentIsLocalized,\n })\n\n features = defaultEditorFeatures\n\n resolvedFeatureMap = finalSanitizedEditorConfig.resolvedFeatureMap\n } else {\n const result = await featuresInputToEditorConfig({\n config,\n features: args?.features,\n isRoot,\n lexical: args?.lexical,\n parentIsLocalized,\n })\n finalSanitizedEditorConfig = result.sanitizedConfig\n features = result.features\n resolvedFeatureMap = result.resolvedFeatureMap\n }\n\n const featureI18n: Partial<GenericLanguages> = finalSanitizedEditorConfig.features.i18n\n const supportedLanguages = config.i18n?.supportedLanguages\n const supportedLanguagesToMerge: Partial<GenericLanguages> = {}\n for (const _lang in supportedLanguages) {\n if (!(_lang in i18n)) {\n if (featureI18n[_lang as keyof typeof i18n]) {\n supportedLanguagesToMerge[_lang as keyof typeof i18n] =\n featureI18n[_lang as keyof typeof i18n]\n }\n continue\n }\n const lang = _lang as keyof typeof i18n\n const lexicalI18nForLang = ((featureI18n[lang] ??= {}).lexical ??=\n {}) as GenericTranslationsObject\n\n lexicalI18nForLang.general = i18n[lang] ?? {}\n supportedLanguagesToMerge[lang] = featureI18n[lang]\n }\n\n config.i18n.translations = deepMergeSimple(config.i18n.translations, supportedLanguagesToMerge)\n\n return {\n CellComponent: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell',\n DiffComponent: '@payloadcms/richtext-lexical/rsc#LexicalDiffComponent',\n editorConfig: finalSanitizedEditorConfig,\n features,\n FieldComponent: {\n path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalField',\n serverProps: {\n admin: args?.admin,\n views: args?.views,\n // SanitizedEditorConfig is manually passed by `renderField` in `fieldSchemasToFormState/renderField.tsx`\n // in order to reduce the size of the field schema\n },\n },\n generateImportMap: getGenerateImportMap({\n lexicalEditorArgs: args,\n resolvedFeatureMap,\n }),\n generateSchemaMap: getGenerateSchemaMap({\n resolvedFeatureMap,\n }),\n graphQLPopulationPromises({\n context,\n currentDepth,\n depth,\n draft,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n }) {\n // check if there are any features with nodes which have populationPromises for this field\n if (finalSanitizedEditorConfig?.features?.graphQLPopulationPromises?.size) {\n populateLexicalPopulationPromises({\n context,\n currentDepth: currentDepth ?? 0,\n depth,\n draft,\n editorPopulationPromises: finalSanitizedEditorConfig.features.graphQLPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n })\n }\n },\n hooks: getLexicalHooks({\n editorConfig: finalSanitizedEditorConfig,\n }),\n jsonSchema: getFieldToJSONSchema({ editorConfig: finalSanitizedEditorConfig }),\n validate: richTextValidateHOC({\n editorConfig: finalSanitizedEditorConfig,\n }),\n }\n }\n}\n\nexport { AlignFeature } from './features/align/server/index.js'\nexport { BlockquoteFeature } from './features/blockquote/server/index.js'\nexport { CodeBlock } from './features/blocks/premade/CodeBlock/index.js'\nexport { BlocksFeature } from './features/blocks/server/index.js'\nexport type {\n BlocksFeatureProps,\n LexicalBlockClientProps,\n LexicalBlockLabelClientProps,\n LexicalBlockLabelServerProps,\n LexicalBlockServerProps,\n LexicalInlineBlockClientProps,\n LexicalInlineBlockLabelClientProps,\n LexicalInlineBlockLabelServerProps,\n LexicalInlineBlockServerProps,\n} from './features/blocks/server/index.js'\n\nexport {\n $createServerBlockNode,\n $isServerBlockNode,\n type BlockFields,\n ServerBlockNode,\n} from './features/blocks/server/nodes/BlocksNode.js'\n\nexport {\n $createServerInlineBlockNode,\n $isServerInlineBlockNode,\n type InlineBlockFields,\n ServerInlineBlockNode,\n} from './features/blocks/server/nodes/InlineBlocksNode.js'\n\nexport { convertHTMLToLexical } from './features/converters/htmlToLexical/index.js'\n\nexport { lexicalHTMLField } from './features/converters/lexicalToHtml/async/field/index.js'\n\nexport { convertLexicalToMarkdown } from './features/converters/lexicalToMarkdown/index.js'\nexport { convertMarkdownToLexical } from './features/converters/markdownToLexical/index.js'\nexport { getPayloadPopulateFn } from './features/converters/utilities/payloadPopulateFn.js'\n\nexport { getRestPopulateFn } from './features/converters/utilities/restPopulateFn.js'\nexport { DebugJsxConverterFeature } from './features/debug/jsxConverter/server/index.js'\nexport { TestRecorderFeature } from './features/debug/testRecorder/server/index.js'\nexport { TreeViewFeature } from './features/debug/treeView/server/index.js'\nexport { EXPERIMENTAL_TableFeature } from './features/experimental_table/server/index.js'\nexport { BoldFeature } from './features/format/bold/feature.server.js'\nexport { InlineCodeFeature } from './features/format/inlineCode/feature.server.js'\n\nexport { ItalicFeature } from './features/format/italic/feature.server.js'\nexport { StrikethroughFeature } from './features/format/strikethrough/feature.server.js'\nexport { SubscriptFeature } from './features/format/subscript/feature.server.js'\nexport { SuperscriptFeature } from './features/format/superscript/feature.server.js'\nexport { UnderlineFeature } from './features/format/underline/feature.server.js'\nexport { HeadingFeature, type HeadingFeatureProps } from './features/heading/server/index.js'\nexport { HorizontalRuleFeature } from './features/horizontalRule/server/index.js'\n\nexport { IndentFeature } from './features/indent/server/index.js'\nexport {\n $createAutoLinkNode,\n $isAutoLinkNode,\n AutoLinkNode,\n} from './features/link/nodes/AutoLinkNode.js'\nexport { $createLinkNode, $isLinkNode, LinkNode } from './features/link/nodes/LinkNode.js'\n\nexport type { LinkFields } from './features/link/nodes/types.js'\nexport { LinkFeature, type LinkFeatureServerProps } from './features/link/server/index.js'\n\nexport { ChecklistFeature } from './features/lists/checklist/server/index.js'\nexport { OrderedListFeature } from './features/lists/orderedList/server/index.js'\n\nexport { UnorderedListFeature } from './features/lists/unorderedList/server/index.js'\n\nexport { ParagraphFeature } from './features/paragraph/server/index.js'\n\nexport {\n RelationshipFeature,\n type RelationshipFeatureProps,\n} from './features/relationship/server/index.js'\n\nexport {\n type RelationshipData,\n RelationshipServerNode,\n} from './features/relationship/server/nodes/RelationshipNode.js'\nexport { defaultColors } from './features/textState/defaultColors.js'\nexport { TextStateFeature } from './features/textState/feature.server.js'\n\nexport { FixedToolbarFeature } from './features/toolbars/fixed/server/index.js'\n\nexport { InlineToolbarFeature } from './features/toolbars/inline/server/index.js'\nexport type { ToolbarGroup, ToolbarGroupItem } from './features/toolbars/types.js'\nexport type {\n BaseClientFeatureProps,\n ClientFeature,\n ClientFeatureProviderMap,\n FeatureProviderClient,\n FeatureProviderProviderClient,\n PluginComponent,\n PluginComponentWithAnchor,\n ResolvedClientFeature,\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n SanitizedPlugin,\n} from './features/typesClient.js'\n\nexport type {\n AfterChangeNodeHook,\n AfterChangeNodeHookArgs,\n AfterReadNodeHook,\n AfterReadNodeHookArgs,\n BaseNodeHookArgs,\n BeforeChangeNodeHook,\n BeforeChangeNodeHookArgs,\n BeforeValidateNodeHook,\n BeforeValidateNodeHookArgs,\n FeatureProviderProviderServer,\n FeatureProviderServer,\n NodeValidation,\n NodeWithHooks,\n PopulationPromise,\n ResolvedServerFeature,\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n ServerFeature,\n ServerFeatureProviderMap,\n} from './features/typesServer.js'\n\nexport { createNode } from './features/typeUtilities.js' // Only useful in feature.server.ts\n\nexport { UploadFeature } from './features/upload/server/index.js'\nexport type { UploadFeatureProps } from './features/upload/server/index.js'\n\nexport { type UploadData, UploadServerNode } from './features/upload/server/nodes/UploadNode.js'\nexport type { EditorConfigContextType } from './lexical/config/client/EditorConfigProvider.js'\n\nexport {\n defaultEditorConfig,\n defaultEditorFeatures,\n defaultEditorLexicalConfig,\n} from './lexical/config/server/default.js'\nexport { loadFeatures, sortFeaturesForOptimalLoading } from './lexical/config/server/loader.js'\n\nexport {\n sanitizeServerEditorConfig,\n sanitizeServerFeatures,\n} from './lexical/config/server/sanitize.js'\nexport type {\n ClientEditorConfig,\n SanitizedClientEditorConfig,\n SanitizedServerEditorConfig,\n ServerEditorConfig,\n} from './lexical/config/types.js'\nexport type { AdapterProps }\n\nexport { getEnabledNodes, getEnabledNodesFromServerNodes } from './lexical/nodes/index.js'\n\nexport type {\n SlashMenuGroup,\n SlashMenuItem,\n} from './lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nexport {\n DETAIL_TYPE_TO_DETAIL,\n DOUBLE_LINE_BREAK,\n ELEMENT_FORMAT_TO_TYPE,\n ELEMENT_TYPE_TO_FORMAT,\n IS_ALL_FORMATTING,\n LTR_REGEX,\n NodeFormat,\n NON_BREAKING_SPACE,\n RTL_REGEX,\n TEXT_MODE_TO_TYPE,\n TEXT_TYPE_TO_FORMAT,\n TEXT_TYPE_TO_MODE,\n} from './lexical/utils/nodeFormat.js'\n\nexport { sanitizeUrl, validateUrl } from './lexical/utils/url.js'\n\nexport { $convertFromMarkdownString } from './packages/@lexical/markdown/index.js'\n\nexport { defaultRichTextValue } from './populateGraphQL/defaultValue.js'\nexport { populate } from './populateGraphQL/populate.js'\nexport type {\n ClientFeaturesMap,\n LexicalEditorNodeMap,\n LexicalEditorProps,\n LexicalEditorViewMap,\n LexicalFieldAdminProps,\n LexicalRichTextAdapter,\n NodeMapValue,\n SerializedNodeBase,\n ViewMapBlockComponentProps,\n} from './types/index.js'\n\nexport type * from './types/nodeTypes.js'\n\nexport { buildDefaultEditorState, buildEditorState } from './utilities/buildEditorState.js'\nexport { createServerFeature } from './utilities/createServerFeature.js'\n\nexport { editorConfigFactory } from './utilities/editorConfigFactory.js'\nexport type { FieldsDrawerProps } from './utilities/fieldsDrawer/Drawer.js'\n\nexport { extractPropsFromJSXPropsString } from './utilities/jsx/extractPropsFromJSXPropsString.js'\n\nexport {\n extractFrontmatter,\n frontmatterToObject,\n objectToFrontmatter,\n propsToJSXString,\n} from './utilities/jsx/jsx.js'\nexport { upgradeLexicalData } from './utilities/upgradeLexicalData/index.js'\n"],"mappings":"AAEA,SAASA,iBAAiB,EAAEC,eAAe,QAAQ;AAUnD,SAASC,eAAe,QAAQ;AAChC,SAASC,IAAI,QAAQ;AACrB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,iCAAiC,QAAQ;AAClD,SAASC,oBAAoB,QAAQ;AACrC,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,+BAA+B,QAAQ;AAChD,SAASC,mBAAmB,QAAQ;AAEpC,IAAIC,mBAAA,GAAsB;AAE1B,OAAO,MAAMC,oBAAA,GAAuB;AAEpC,OAAO,SAASC,cAAcC,IAAyB;EACrD,IACEC,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,gBACzBF,OAAA,CAAQC,GAAG,CAACE,kCAAkC,KAAK,U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nabled","getLexicalHooks","i18n","defaultEditorFeatures","populateLexicalPopulationPromises","getFieldToJSONSchema","featuresInputToEditorConfig","getGenerateImportMap","getGenerateSchemaMap","getDefaultSanitizedEditorConfig","richTextValidateHOC","checkedDependencies","lexicalTargetVersion","lexicalEditor","args","process","env","NODE_ENV","PAYLOAD_DISABLE_DEPENDENCY_CHECKER","dependencyGroups","name","dependencies","targetVersion","config","isRoot","parentIsLocalized","features","resolvedFeatureMap","finalSanitizedEditorConfig","lexical","result","sanitizedConfig","featureI18n","supportedLanguages","supportedLanguagesToMerge","_lang","lang","lexicalI18nForLang","general","translations","rscEnabled","CellComponent","ClientFieldComponent","DiffComponent","editorConfig","FieldComponent","path","serverProps","admin","views","generateImportMap","lexicalEditorArgs","generateSchemaMap","getClientFieldProps","clientFieldSchemaMap","fieldPath","schemaPath","fieldSchemaPath","serializedFeatures","featureKey","resolvedFeature","entry","key","order","ClientFeature","clientFeatureProps","componentImports","Array","isArray","featureClientSchemaMap","featureSchemaPath","entries","startsWith","fields","graphQLPopulationPromises","context","currentDepth","depth","draft","field","fieldPromises","findMany","flattenLocales","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","size","editorPopulationPromises","hooks","jsonSchema","validate","AlignFeature","BlockquoteFeature","CodeBlock","BlocksFeature","$createServerBlockNode","$isServerBlockNode","ServerBlockNode","$createServerInlineBlockNode","$isServerInlineBlockNode","ServerInlineBlockNode","convertHTMLToLexical","lexicalHTMLField","convertLexicalToMarkdown","convertMarkdownToLexical","getPayloadPopulateFn","getRestPopulateFn","DebugJsxConverterFeature","TestRecorderFeature","TreeViewFeature","EXPERIMENTAL_TableFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","$createAutoLinkNode","$isAutoLinkNode","AutoLinkNode","$createLinkNode","$isLinkNode","LinkNode","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","RelationshipServerNode","defaultColors","TextStateFeature","FixedToolbarFeature","InlineToolbarFeature","createNode","UploadFeature","UploadServerNode","defaultEditorConfig","defaultEditorLexicalConfig","loadFeatures","sortFeaturesForOptimalLoading","sanitizeServerEditorConfig","sanitizeServerFeatures","getEnabledNodes","getEnabledNodesFromServerNodes","DETAIL_TYPE_TO_DETAIL","DOUBLE_LINE_BREAK","ELEMENT_FORMAT_TO_TYPE","ELEMENT_TYPE_TO_FORMAT","IS_ALL_FORMATTING","LTR_REGEX","NodeFormat","NON_BREAKING_SPACE","RTL_REGEX","TEXT_MODE_TO_TYPE","TEXT_TYPE_TO_FORMAT","TEXT_TYPE_TO_MODE","sanitizeUrl","validateUrl","$convertFromMarkdownString","defaultRichTextValue","populate","buildDefaultEditorState","buildEditorState","createServerFeature","editorConfigFactory","extractPropsFromJSXPropsString","extractFrontmatter","frontmatterToObject","objectToFrontmatter","propsToJSXString","upgradeLexicalData"],"sources":["../src/index.ts"],"sourcesContent":["import type { GenericLanguages, GenericTranslationsObject } from '@payloadcms/translations'\n\nimport { checkDependencies, deepMergeSimple } from 'payload'\nimport { isRSCEnabled } from 'payload/shared'\n\nimport type { FeatureProviderServer, ResolvedServerFeatureMap } from './features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from './lexical/config/types.js'\nimport type {\n AdapterProps,\n LexicalEditorProps,\n LexicalRichTextAdapterProvider,\n} from './types/index.js'\n\nimport { getLexicalHooks } from './hooks.js'\nimport { i18n } from './i18n.js'\nimport { defaultEditorFeatures } from './lexical/config/server/default.js'\nimport { populateLexicalPopulationPromises } from './populateGraphQL/populateLexicalPopulationPromises.js'\nimport { getFieldToJSONSchema } from './types/schema.js'\nimport { featuresInputToEditorConfig } from './utilities/editorConfigFactory.js'\nimport { getGenerateImportMap } from './utilities/generateImportMap.js'\nimport { getGenerateSchemaMap } from './utilities/generateSchemaMap.js'\nimport { getDefaultSanitizedEditorConfig } from './utilities/getDefaultSanitizedEditorConfig.js'\nimport { richTextValidateHOC } from './validate/index.js'\n\nlet checkedDependencies = false\n\nexport const lexicalTargetVersion = '0.41.0'\n\nexport function lexicalEditor(args?: LexicalEditorProps): LexicalRichTextAdapterProvider {\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.PAYLOAD_DISABLE_DEPENDENCY_CHECKER !== 'true' &&\n !checkedDependencies\n ) {\n checkedDependencies = true\n void checkDependencies({\n dependencyGroups: [\n {\n name: 'lexical',\n dependencies: [\n 'lexical',\n '@lexical/headless',\n '@lexical/link',\n '@lexical/list',\n '@lexical/mark',\n '@lexical/react',\n '@lexical/rich-text',\n '@lexical/selection',\n '@lexical/utils',\n ],\n targetVersion: lexicalTargetVersion,\n },\n ],\n })\n }\n return async ({ config, isRoot, parentIsLocalized }) => {\n let features: FeatureProviderServer<unknown, unknown, unknown>[] = []\n let resolvedFeatureMap: ResolvedServerFeatureMap\n\n let finalSanitizedEditorConfig: SanitizedServerEditorConfig // For server only\n if (!args || (!args.features && !args.lexical)) {\n finalSanitizedEditorConfig = await getDefaultSanitizedEditorConfig({\n config,\n parentIsLocalized,\n })\n\n features = defaultEditorFeatures\n\n resolvedFeatureMap = finalSanitizedEditorConfig.resolvedFeatureMap\n } else {\n const result = await featuresInputToEditorConfig({\n config,\n features: args?.features,\n isRoot,\n lexical: args?.lexical,\n parentIsLocalized,\n })\n finalSanitizedEditorConfig = result.sanitizedConfig\n features = result.features\n resolvedFeatureMap = result.resolvedFeatureMap\n }\n\n const featureI18n: Partial<GenericLanguages> = finalSanitizedEditorConfig.features.i18n\n const supportedLanguages = config.i18n?.supportedLanguages\n const supportedLanguagesToMerge: Partial<GenericLanguages> = {}\n for (const _lang in supportedLanguages) {\n if (!(_lang in i18n)) {\n if (featureI18n[_lang as keyof typeof i18n]) {\n supportedLanguagesToMerge[_lang as keyof typeof i18n] =\n featureI18n[_lang as keyof typeof i18n]\n }\n continue\n }\n const lang = _lang as keyof typeof i18n\n const lexicalI18nForLang = ((featureI18n[lang] ??= {}).lexical ??=\n {}) as GenericTranslationsObject\n\n lexicalI18nForLang.general = i18n[lang] ?? {}\n supportedLanguagesToMerge[lang] = featureI18n[lang]\n }\n\n config.i18n.translations = deepMergeSimple(config.i18n.translations, supportedLanguagesToMerge)\n\n const rscEnabled = isRSCEnabled()\n\n return {\n CellComponent: rscEnabled ? '@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell' : false,\n ClientFieldComponent: '@payloadcms/richtext-lexical/client#ClientEntryLexicalField',\n DiffComponent: rscEnabled ? '@payloadcms/richtext-lexical/rsc#LexicalDiffComponent' : false,\n editorConfig: finalSanitizedEditorConfig,\n features,\n FieldComponent: rscEnabled\n ? {\n path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalField',\n serverProps: {\n admin: args?.admin,\n views: args?.views,\n },\n }\n : false,\n generateImportMap: getGenerateImportMap({\n lexicalEditorArgs: args,\n resolvedFeatureMap,\n }),\n generateSchemaMap: getGenerateSchemaMap({\n resolvedFeatureMap,\n }),\n getClientFieldProps({ clientFieldSchemaMap, path: fieldPath, schemaPath: fieldSchemaPath }) {\n const serializedFeatures: Record<\n string,\n {\n ClientFeature?: any\n clientFeatureProps?: Record<string, any>\n componentImports?: Record<string, any>\n key: string\n order: number\n }\n > = {}\n\n for (const [featureKey, resolvedFeature] of finalSanitizedEditorConfig.resolvedFeatureMap) {\n const entry: (typeof serializedFeatures)[string] = {\n key: resolvedFeature.key,\n order: resolvedFeature.order,\n }\n\n if (resolvedFeature.ClientFeature) {\n entry.ClientFeature = resolvedFeature.ClientFeature\n }\n\n if (resolvedFeature.clientFeatureProps) {\n entry.clientFeatureProps = resolvedFeature.clientFeatureProps\n }\n\n if (\n resolvedFeature.componentImports &&\n typeof resolvedFeature.componentImports === 'object' &&\n !Array.isArray(resolvedFeature.componentImports)\n ) {\n entry.componentImports = resolvedFeature.componentImports\n }\n\n serializedFeatures[featureKey] = entry\n }\n\n const featureClientSchemaMap: Record<string, Record<string, any>> = {}\n for (const [featureKey, resolvedFeature] of finalSanitizedEditorConfig.resolvedFeatureMap) {\n if (!resolvedFeature.generateSchemaMap) {\n continue\n }\n const featureSchemaPath = `${fieldSchemaPath}.lexical_internal_feature.${featureKey}`\n featureClientSchemaMap[featureKey] = {}\n for (const [key, entry] of clientFieldSchemaMap.entries()) {\n if (key.startsWith(featureSchemaPath)) {\n featureClientSchemaMap[featureKey][key] = 'fields' in entry ? entry.fields : [entry]\n }\n }\n }\n\n return {\n featureClientSchemaMap,\n features: serializedFeatures,\n }\n },\n graphQLPopulationPromises({\n context,\n currentDepth,\n depth,\n draft,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n }) {\n // check if there are any features with nodes which have populationPromises for this field\n if (finalSanitizedEditorConfig?.features?.graphQLPopulationPromises?.size) {\n populateLexicalPopulationPromises({\n context,\n currentDepth: currentDepth ?? 0,\n depth,\n draft,\n editorPopulationPromises: finalSanitizedEditorConfig.features.graphQLPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n })\n }\n },\n hooks: getLexicalHooks({\n editorConfig: finalSanitizedEditorConfig,\n }),\n jsonSchema: getFieldToJSONSchema({ editorConfig: finalSanitizedEditorConfig }),\n validate: richTextValidateHOC({\n editorConfig: finalSanitizedEditorConfig,\n }),\n }\n }\n}\n\nexport { AlignFeature } from './features/align/server/index.js'\nexport { BlockquoteFeature } from './features/blockquote/server/index.js'\nexport { CodeBlock } from './features/blocks/premade/CodeBlock/index.js'\nexport { BlocksFeature } from './features/blocks/server/index.js'\nexport type {\n BlocksFeatureProps,\n LexicalBlockClientProps,\n LexicalBlockLabelClientProps,\n LexicalBlockLabelServerProps,\n LexicalBlockServerProps,\n LexicalInlineBlockClientProps,\n LexicalInlineBlockLabelClientProps,\n LexicalInlineBlockLabelServerProps,\n LexicalInlineBlockServerProps,\n} from './features/blocks/server/index.js'\n\nexport {\n $createServerBlockNode,\n $isServerBlockNode,\n ServerBlockNode,\n} from './features/blocks/server/nodes/BlocksNode.js'\nexport {\n $createServerInlineBlockNode,\n $isServerInlineBlockNode,\n ServerInlineBlockNode,\n} from './features/blocks/server/nodes/InlineBlocksNode.js'\n\nexport type { BlockFields, InlineBlockFields } from './features/blocks/server/schema.js'\n\nexport { convertHTMLToLexical } from './features/converters/htmlToLexical/index.js'\n\nexport { lexicalHTMLField } from './features/converters/lexicalToHtml/async/field/index.js'\n\nexport { convertLexicalToMarkdown } from './features/converters/lexicalToMarkdown/index.js'\nexport { convertMarkdownToLexical } from './features/converters/markdownToLexical/index.js'\nexport { getPayloadPopulateFn } from './features/converters/utilities/payloadPopulateFn.js'\n\nexport { getRestPopulateFn } from './features/converters/utilities/restPopulateFn.js'\nexport { DebugJsxConverterFeature } from './features/debug/jsxConverter/server/index.js'\nexport { TestRecorderFeature } from './features/debug/testRecorder/server/index.js'\nexport { TreeViewFeature } from './features/debug/treeView/server/index.js'\nexport { EXPERIMENTAL_TableFeature } from './features/experimental_table/server/index.js'\nexport { BoldFeature } from './features/format/bold/feature.server.js'\nexport { InlineCodeFeature } from './features/format/inlineCode/feature.server.js'\n\nexport { ItalicFeature } from './features/format/italic/feature.server.js'\nexport { StrikethroughFeature } from './features/format/strikethrough/feature.server.js'\nexport { SubscriptFeature } from './features/format/subscript/feature.server.js'\nexport { SuperscriptFeature } from './features/format/superscript/feature.server.js'\nexport { UnderlineFeature } from './features/format/underline/feature.server.js'\nexport { HeadingFeature, type HeadingFeatureProps } from './features/heading/server/index.js'\nexport { HorizontalRuleFeature } from './features/horizontalRule/server/index.js'\n\nexport { IndentFeature } from './features/indent/server/index.js'\nexport {\n $createAutoLinkNode,\n $isAutoLinkNode,\n AutoLinkNode,\n} from './features/link/nodes/AutoLinkNode.js'\nexport { $createLinkNode, $isLinkNode, LinkNode } from './features/link/nodes/LinkNode.js'\n\nexport { LinkFeature, type LinkFeatureServerProps } from './features/link/server/index.js'\nexport type { LinkFields } from './features/link/server/schema.js'\n\nexport { ChecklistFeature } from './features/lists/checklist/server/index.js'\nexport { OrderedListFeature } from './features/lists/orderedList/server/index.js'\n\nexport { UnorderedListFeature } from './features/lists/unorderedList/server/index.js'\n\nexport { ParagraphFeature } from './features/paragraph/server/index.js'\n\nexport {\n RelationshipFeature,\n type RelationshipFeatureProps,\n} from './features/relationship/server/index.js'\n\nexport { RelationshipServerNode } from './features/relationship/server/nodes/RelationshipNode.js'\nexport type { RelationshipData } from './features/relationship/server/schema.js'\nexport { defaultColors } from './features/textState/defaultColors.js'\nexport { TextStateFeature } from './features/textState/feature.server.js'\n\nexport { FixedToolbarFeature } from './features/toolbars/fixed/server/index.js'\n\nexport { InlineToolbarFeature } from './features/toolbars/inline/server/index.js'\nexport type { ToolbarGroup, ToolbarGroupItem } from './features/toolbars/types.js'\nexport type {\n BaseClientFeatureProps,\n ClientFeature,\n ClientFeatureProviderMap,\n FeatureProviderClient,\n FeatureProviderProviderClient,\n PluginComponent,\n PluginComponentWithAnchor,\n ResolvedClientFeature,\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n SanitizedPlugin,\n} from './features/typesClient.js'\n\nexport type {\n AfterChangeNodeHook,\n AfterChangeNodeHookArgs,\n AfterReadNodeHook,\n AfterReadNodeHookArgs,\n BaseNodeHookArgs,\n BeforeChangeNodeHook,\n BeforeChangeNodeHookArgs,\n BeforeValidateNodeHook,\n BeforeValidateNodeHookArgs,\n FeatureProviderProviderServer,\n FeatureProviderServer,\n NodeValidation,\n NodeWithHooks,\n PopulationPromise,\n ResolvedServerFeature,\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n ServerFeature,\n ServerFeatureProviderMap,\n} from './features/typesServer.js'\n\nexport { createNode } from './features/typeUtilities.js' // Only useful in feature.server.ts\n\nexport { UploadFeature } from './features/upload/server/index.js'\nexport type { UploadFeatureProps } from './features/upload/server/index.js'\n\nexport { UploadServerNode } from './features/upload/server/nodes/UploadNode.js'\nexport type { UploadData } from './features/upload/server/schema.js'\nexport type { EditorConfigContextType } from './lexical/config/client/EditorConfigProvider.js'\n\nexport {\n defaultEditorConfig,\n defaultEditorFeatures,\n defaultEditorLexicalConfig,\n} from './lexical/config/server/default.js'\nexport { loadFeatures, sortFeaturesForOptimalLoading } from './lexical/config/server/loader.js'\n\nexport {\n sanitizeServerEditorConfig,\n sanitizeServerFeatures,\n} from './lexical/config/server/sanitize.js'\nexport type {\n ClientEditorConfig,\n SanitizedClientEditorConfig,\n SanitizedServerEditorConfig,\n ServerEditorConfig,\n} from './lexical/config/types.js'\nexport type { AdapterProps }\n\nexport { getEnabledNodes, getEnabledNodesFromServerNodes } from './lexical/nodes/index.js'\n\nexport type {\n SlashMenuGroup,\n SlashMenuItem,\n} from './lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nexport {\n DETAIL_TYPE_TO_DETAIL,\n DOUBLE_LINE_BREAK,\n ELEMENT_FORMAT_TO_TYPE,\n ELEMENT_TYPE_TO_FORMAT,\n IS_ALL_FORMATTING,\n LTR_REGEX,\n NodeFormat,\n NON_BREAKING_SPACE,\n RTL_REGEX,\n TEXT_MODE_TO_TYPE,\n TEXT_TYPE_TO_FORMAT,\n TEXT_TYPE_TO_MODE,\n} from './lexical/utils/nodeFormat.js'\n\nexport { sanitizeUrl, validateUrl } from './lexical/utils/url.js'\n\nexport { $convertFromMarkdownString } from './packages/@lexical/markdown/index.js'\n\nexport { defaultRichTextValue } from './populateGraphQL/defaultValue.js'\nexport { populate } from './populateGraphQL/populate.js'\nexport type {\n ClientFeaturesMap,\n LexicalEditorNodeMap,\n LexicalEditorProps,\n LexicalEditorViewMap,\n LexicalFieldAdminProps,\n LexicalRichTextAdapter,\n NodeMapValue,\n SerializedNodeBase,\n ViewMapBlockComponentProps,\n} from './types/index.js'\n\nexport type * from './types/nodeTypes.js'\n\nexport { buildDefaultEditorState, buildEditorState } from './utilities/buildEditorState.js'\nexport { createServerFeature } from './utilities/createServerFeature.js'\n\nexport { editorConfigFactory } from './utilities/editorConfigFactory.js'\nexport type { FieldsDrawerProps } from './utilities/fieldsDrawer/Drawer.js'\n\nexport { extractPropsFromJSXPropsString } from './utilities/jsx/extractPropsFromJSXPropsString.js'\n\nexport {\n extractFrontmatter,\n frontmatterToObject,\n objectToFrontmatter,\n propsToJSXString,\n} from './utilities/jsx/jsx.js'\nexport { upgradeLexicalData } from './utilities/upgradeLexicalData/index.js'\n"],"mappings":"AAEA,SAASA,iBAAiB,EAAEC,eAAe,QAAQ;AACnD,SAASC,YAAY,QAAQ;AAU7B,SAASC,eAAe,QAAQ;AAChC,SAASC,IAAI,QAAQ;AACrB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,iCAAiC,QAAQ;AAClD,SAASC,oBAAoB,QAAQ;AACrC,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,+BAA+B,QAAQ;AAChD,SAASC,mBAAmB,QAAQ;AAEpC,IAAIC,mBAAA,GAAsB;AAE1B,OAAO,MAAMC,oBAAA,GAAuB;AAEpC,OAAO,SAASC,cAAcC,IAAyB;EACrD,IACEC,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,gBACzBF,OAAA,CAAQC,GAAG,CAACE,kCAAkC,KAAK,UACnD,CAACP,mBAAA,EACD;IACAA,mBAAA,GAAsB;IACtB,KAAKb,iBAAA,CAAkB;MACrBqB,gBAAA,EAAkB,CAChB;QACEC,IAAA,EAAM;QACNC,YAAA,EAAc,CACZ,WACA,qBACA,iBACA,iBACA,iBACA,kBACA,sBACA,sBACA,iBACD;QACDC,aAAA,EAAeV;MACjB;IAEJ;EACF;EACA,OAAO,OAAO;IAAEW,MAAM;IAAEC,MAAM;IAAEC;EAAiB,CAAE;IACjD,IAAIC,QAAA,GAA+D,EAAE;IACrE,IAAIC,kBAAA;IAEJ,IAAIC,0BAAwD;AAAA;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AK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAGhE,OAAO,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"LexicalEditor.d.ts","sourceRoot":"","sources":["../../src/lexical/LexicalEditor.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAGhE,OAAO,qBAAqB,CAAA;AAuC5B,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAClC;IACE,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC1D,oBAAoB,EAAE,OAAO,CAAA;CAC9B,GAAG,IAAI,CAAC,oBAAoB,EAAE,cAAc,GAAG,UAAU,GAAG,KAAK,CAAC,CAuKpE,CAAA"}
|