@payloadcms/richtext-lexical 3.0.0-beta.48 → 3.0.0-beta.49
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/README.md +1 -1
- package/dist/cell/index.d.ts +1 -1
- package/dist/cell/index.d.ts.map +1 -1
- package/dist/cell/index.js +1 -2
- package/dist/cell/index.js.map +1 -1
- package/dist/exports/client/Component-6AVANNNR.js +2 -0
- package/dist/exports/client/Component-6AVANNNR.js.map +7 -0
- package/dist/exports/client/Component-SZVAYRJX.js +2 -0
- package/dist/exports/client/Component-SZVAYRJX.js.map +7 -0
- package/dist/exports/client/Field-U5PHZTST.js +2 -0
- package/dist/exports/client/Field-U5PHZTST.js.map +7 -0
- package/dist/exports/client/RelationshipComponent-FGUPLCD2.js +2 -0
- package/dist/exports/client/RelationshipComponent-FGUPLCD2.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -0
- package/dist/exports/client/chunk-33ZTAHVL.js +2 -0
- package/dist/exports/client/chunk-33ZTAHVL.js.map +7 -0
- package/dist/exports/client/chunk-35NZOHAF.js +2 -0
- package/dist/exports/client/chunk-35NZOHAF.js.map +7 -0
- package/dist/exports/client/chunk-3PZ2ZFQG.js +3 -0
- package/dist/exports/client/chunk-3PZ2ZFQG.js.map +7 -0
- package/dist/exports/client/chunk-FSTRW2TI.js +2 -0
- package/dist/exports/client/chunk-FSTRW2TI.js.map +7 -0
- package/dist/exports/client/chunk-Y5455JF3.js +2 -0
- package/dist/exports/client/chunk-Y5455JF3.js.map +7 -0
- package/dist/exports/client/component-FFLILIUZ.js +2 -0
- package/dist/exports/client/component-FFLILIUZ.js.map +7 -0
- package/dist/exports/client/component-GR6KYTLO.js +2 -0
- package/dist/exports/client/component-GR6KYTLO.js.map +7 -0
- package/dist/exports/client/component-RAVN56DE.js +2 -0
- package/dist/exports/client/component-RAVN56DE.js.map +7 -0
- package/dist/exports/client/index.d.ts +52 -0
- package/dist/exports/client/index.d.ts.map +1 -0
- package/dist/exports/client/index.js +36 -0
- package/dist/exports/client/index.js.map +7 -0
- package/dist/field/Field.d.ts +1 -0
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +2 -7
- package/dist/field/Field.js.map +1 -1
- package/dist/field/bundled.css +0 -0
- package/dist/field/features/align/feature.server.d.ts.map +1 -1
- package/dist/field/features/align/feature.server.js +2 -1
- package/dist/field/features/align/feature.server.js.map +1 -1
- package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
- package/dist/field/features/blockquote/feature.server.js +2 -1
- package/dist/field/features/blockquote/feature.server.js.map +1 -1
- package/dist/field/features/blocks/component/BlockContent.js +1 -9
- package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
- package/dist/field/features/blocks/component/FormSavePlugin.d.ts +1 -2
- package/dist/field/features/blocks/component/FormSavePlugin.d.ts.map +1 -1
- package/dist/field/features/blocks/component/FormSavePlugin.js +2 -2
- package/dist/field/features/blocks/component/FormSavePlugin.js.map +1 -1
- package/dist/field/features/blocks/component/index.d.ts.map +1 -1
- package/dist/field/features/blocks/component/index.js +2 -12
- package/dist/field/features/blocks/component/index.js.map +1 -1
- package/dist/field/features/blocks/component/removeEmptyArrayValues.d.ts +1 -1
- package/dist/field/features/blocks/component/removeEmptyArrayValues.d.ts.map +1 -1
- package/dist/field/features/blocks/component/removeEmptyArrayValues.js.map +1 -1
- package/dist/field/features/blocks/drawer/index.d.ts.map +1 -1
- package/dist/field/features/blocks/drawer/index.js +1 -4
- package/dist/field/features/blocks/drawer/index.js.map +1 -1
- package/dist/field/features/blocks/feature.server.d.ts +1 -1
- package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
- package/dist/field/features/blocks/feature.server.js +3 -3
- package/dist/field/features/blocks/feature.server.js.map +1 -1
- package/dist/field/features/converters/html/field/index.d.ts +1 -1
- package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
- package/dist/field/features/converters/html/field/index.js.map +1 -1
- package/dist/field/features/createFeaturePropComponent.d.ts.map +1 -1
- package/dist/field/features/createFeaturePropComponent.js +1 -3
- package/dist/field/features/createFeaturePropComponent.js.map +1 -1
- package/dist/field/features/debug/testRecorder/feature.server.d.ts.map +1 -1
- package/dist/field/features/debug/testRecorder/feature.server.js +2 -1
- package/dist/field/features/debug/testRecorder/feature.server.js.map +1 -1
- package/dist/field/features/debug/testRecorder/plugin/index.js +0 -1
- package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -1
- package/dist/field/features/debug/treeView/feature.server.d.ts.map +1 -1
- package/dist/field/features/debug/treeView/feature.server.js +2 -1
- package/dist/field/features/debug/treeView/feature.server.js.map +1 -1
- package/dist/field/features/debug/treeView/plugin/index.js +0 -1
- package/dist/field/features/debug/treeView/plugin/index.js.map +1 -1
- package/dist/field/features/format/bold/feature.server.d.ts.map +1 -1
- package/dist/field/features/format/bold/feature.server.js +2 -1
- package/dist/field/features/format/bold/feature.server.js.map +1 -1
- package/dist/field/features/format/inlineCode/feature.server.d.ts.map +1 -1
- package/dist/field/features/format/inlineCode/feature.server.js +2 -1
- package/dist/field/features/format/inlineCode/feature.server.js.map +1 -1
- package/dist/field/features/format/italic/feature.server.d.ts.map +1 -1
- package/dist/field/features/format/italic/feature.server.js +2 -1
- package/dist/field/features/format/italic/feature.server.js.map +1 -1
- package/dist/field/features/format/strikethrough/feature.server.d.ts.map +1 -1
- package/dist/field/features/format/strikethrough/feature.server.js +2 -1
- package/dist/field/features/format/strikethrough/feature.server.js.map +1 -1
- package/dist/field/features/format/subscript/feature.server.d.ts.map +1 -1
- package/dist/field/features/format/subscript/feature.server.js +2 -1
- package/dist/field/features/format/subscript/feature.server.js.map +1 -1
- package/dist/field/features/format/superscript/feature.server.d.ts.map +1 -1
- package/dist/field/features/format/superscript/feature.server.js +2 -1
- package/dist/field/features/format/superscript/feature.server.js.map +1 -1
- package/dist/field/features/format/underline/feature.server.d.ts.map +1 -1
- package/dist/field/features/format/underline/feature.server.js +2 -1
- package/dist/field/features/format/underline/feature.server.js.map +1 -1
- package/dist/field/features/heading/feature.client.d.ts.map +1 -1
- package/dist/field/features/heading/feature.client.js +1 -2
- package/dist/field/features/heading/feature.client.js.map +1 -1
- package/dist/field/features/heading/feature.server.d.ts.map +1 -1
- package/dist/field/features/heading/feature.server.js +2 -1
- package/dist/field/features/heading/feature.server.js.map +1 -1
- package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -1
- package/dist/field/features/horizontalRule/feature.server.js +2 -1
- package/dist/field/features/horizontalRule/feature.server.js.map +1 -1
- package/dist/field/features/horizontalRule/plugin/index.js +0 -1
- package/dist/field/features/horizontalRule/plugin/index.js.map +1 -1
- package/dist/field/features/indent/feature.server.d.ts.map +1 -1
- package/dist/field/features/indent/feature.server.js +2 -1
- package/dist/field/features/indent/feature.server.js.map +1 -1
- package/dist/field/features/link/drawer/baseFields.d.ts +1 -2
- package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
- package/dist/field/features/link/drawer/baseFields.js.map +1 -1
- package/dist/field/features/link/drawer/index.d.ts.map +1 -1
- package/dist/field/features/link/drawer/index.js +2 -10
- package/dist/field/features/link/drawer/index.js.map +1 -1
- package/dist/field/features/link/drawer/types.d.ts +1 -1
- package/dist/field/features/link/drawer/types.d.ts.map +1 -1
- package/dist/field/features/link/drawer/types.js.map +1 -1
- package/dist/field/features/link/feature.server.d.ts +1 -2
- package/dist/field/features/link/feature.server.d.ts.map +1 -1
- package/dist/field/features/link/feature.server.js +5 -4
- package/dist/field/features/link/feature.server.js.map +1 -1
- package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
- package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +3 -8
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/index.js +0 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +1 -2
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
- package/dist/field/features/link/validate.d.ts +1 -1
- package/dist/field/features/link/validate.d.ts.map +1 -1
- package/dist/field/features/link/validate.js.map +1 -1
- package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
- package/dist/field/features/lists/checklist/feature.server.js +2 -1
- package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
- package/dist/field/features/lists/orderedList/feature.server.d.ts.map +1 -1
- package/dist/field/features/lists/orderedList/feature.server.js +2 -1
- package/dist/field/features/lists/orderedList/feature.server.js.map +1 -1
- package/dist/field/features/lists/unorderedList/feature.server.d.ts.map +1 -1
- package/dist/field/features/lists/unorderedList/feature.server.js +2 -1
- package/dist/field/features/lists/unorderedList/feature.server.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/feature.server.d.ts.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/feature.server.js +2 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/feature.server.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +0 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -2
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/feature.server.d.ts.map +1 -1
- package/dist/field/features/migrations/slateToLexical/feature.server.js +2 -1
- package/dist/field/features/migrations/slateToLexical/feature.server.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +0 -1
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -2
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/field/features/paragraph/feature.server.d.ts.map +1 -1
- package/dist/field/features/paragraph/feature.server.js +2 -1
- package/dist/field/features/paragraph/feature.server.js.map +1 -1
- package/dist/field/features/relationship/drawer/index.js +1 -1
- package/dist/field/features/relationship/drawer/index.js.map +1 -1
- package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
- package/dist/field/features/relationship/feature.server.js +2 -1
- package/dist/field/features/relationship/feature.server.js.map +1 -1
- package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
- package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +2 -8
- package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
- package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
- package/dist/field/features/relationship/plugins/index.js +2 -3
- package/dist/field/features/relationship/plugins/index.js.map +1 -1
- package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.d.ts.map +1 -1
- package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.js +1 -3
- package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.js.map +1 -1
- package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -1
- package/dist/field/features/toolbars/fixed/Toolbar/index.js +1 -3
- package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -1
- package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -1
- package/dist/field/features/toolbars/fixed/feature.server.js +2 -1
- package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -1
- package/dist/field/features/toolbars/inline/Toolbar/index.js +0 -1
- package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -1
- package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -1
- package/dist/field/features/toolbars/inline/feature.server.js +2 -1
- package/dist/field/features/toolbars/inline/feature.server.js.map +1 -1
- package/dist/field/features/toolbars/shared/ToolbarButton/index.js +0 -1
- package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +1 -2
- package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
- package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js +1 -2
- package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +1 -2
- package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/field/features/types.d.ts +1 -3
- package/dist/field/features/types.d.ts.map +1 -1
- package/dist/field/features/types.js.map +1 -1
- package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts +1 -1
- package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
- package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +3 -10
- package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
- package/dist/field/features/upload/component/index.d.ts.map +1 -1
- package/dist/field/features/upload/component/index.js +1 -9
- package/dist/field/features/upload/component/index.js.map +1 -1
- package/dist/field/features/upload/drawer/index.js +1 -1
- package/dist/field/features/upload/drawer/index.js.map +1 -1
- package/dist/field/features/upload/feature.server.d.ts +1 -1
- package/dist/field/features/upload/feature.server.d.ts.map +1 -1
- package/dist/field/features/upload/feature.server.js +3 -2
- package/dist/field/features/upload/feature.server.js.map +1 -1
- package/dist/field/features/upload/nodes/UploadNode.d.ts +1 -2
- package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
- package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
- package/dist/field/features/upload/plugin/index.js +1 -1
- package/dist/field/features/upload/plugin/index.js.map +1 -1
- package/dist/field/features/upload/validate.js +1 -1
- package/dist/field/features/upload/validate.js.map +1 -1
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js +35 -99
- package/dist/field/index.js.map +1 -1
- package/dist/field/lexical/LexicalEditor.js +1 -2
- package/dist/field/lexical/LexicalEditor.js.map +1 -1
- package/dist/field/lexical/LexicalProvider.d.ts +1 -2
- package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/field/lexical/LexicalProvider.js +1 -1
- package/dist/field/lexical/LexicalProvider.js.map +1 -1
- package/dist/field/lexical/config/server/loader.d.ts +1 -1
- package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
- package/dist/field/lexical/config/server/loader.js.map +1 -1
- package/dist/field/lexical/config/server/sanitize.d.ts +1 -1
- package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/field/lexical/config/server/sanitize.js.map +1 -1
- package/dist/field/lexical/nodes/index.d.ts.map +1 -1
- package/dist/field/lexical/nodes/index.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/index.js +2 -3
- package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +0 -1
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +0 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/field/lexical/theme/EditorTheme.js +0 -1
- package/dist/field/lexical/theme/EditorTheme.js.map +1 -1
- package/dist/field/lexical/ui/ContentEditable.js +0 -1
- package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/generateComponentMap.d.ts +1 -1
- package/dist/generateComponentMap.d.ts.map +1 -1
- package/dist/generateComponentMap.js.map +1 -1
- package/dist/generateSchemaMap.d.ts +1 -1
- package/dist/generateSchemaMap.d.ts.map +1 -1
- package/dist/generateSchemaMap.js.map +1 -1
- package/dist/index.d.ts +0 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -22
- package/dist/index.js.map +1 -1
- package/dist/populateGraphQL/populate.d.ts +1 -1
- package/dist/populateGraphQL/populate.d.ts.map +1 -1
- package/dist/populateGraphQL/populate.js +1 -1
- package/dist/populateGraphQL/populate.js.map +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
- package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts +1 -2
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js +1 -1
- package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -1
- package/dist/types.d.ts +1 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/useLexicalFeature.d.ts.map +1 -1
- package/dist/useLexicalFeature.js +1 -3
- package/dist/useLexicalFeature.js.map +1 -1
- package/dist/validate/index.d.ts +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/validateNodes.d.ts +1 -1
- package/dist/validate/validateNodes.d.ts.map +1 -1
- package/dist/validate/validateNodes.js.map +1 -1
- package/package.json +22 -22
- package/components.d.ts +0 -6
- package/components.js +0 -7
- package/dist/exports/components.d.ts +0 -11
- package/dist/exports/components.d.ts.map +0 -1
- package/dist/exports/components.js +0 -12
- package/dist/exports/components.js.map +0 -1
- package/dist/field/features/blocks/component/index.scss +0 -149
- package/dist/field/features/debug/testRecorder/plugin/index.scss +0 -49
- package/dist/field/features/debug/treeView/plugin/index.scss +0 -78
- package/dist/field/features/horizontalRule/plugin/index.scss +0 -20
- package/dist/field/features/link/drawer/index.scss +0 -50
- package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +0 -86
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.scss +0 -14
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.scss +0 -14
- package/dist/field/features/relationship/nodes/components/index.scss +0 -97
- package/dist/field/features/toolbars/fixed/Toolbar/index.scss +0 -119
- package/dist/field/features/toolbars/inline/Toolbar/index.scss +0 -53
- package/dist/field/features/toolbars/shared/ToolbarButton/index.scss +0 -39
- package/dist/field/features/toolbars/shared/ToolbarDropdown/index.scss +0 -112
- package/dist/field/features/upload/component/index.scss +0 -152
- package/dist/field/index.scss +0 -25
- package/dist/field/lexical/LexicalEditor.scss +0 -49
- package/dist/field/lexical/plugins/SlashMenu/index.scss +0 -61
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +0 -31
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +0 -72
- package/dist/field/lexical/theme/EditorTheme.scss +0 -509
- package/dist/field/lexical/ui/ContentEditable.scss +0 -76
- package/dist/scss/app.scss +0 -208
- package/dist/scss/colors.scss +0 -269
- package/dist/scss/queries.scss +0 -27
- package/dist/scss/resets.scss +0 -17
- package/dist/scss/styles.scss +0 -11
- package/dist/scss/svg.scss +0 -10
- package/dist/scss/toasts.scss +0 -111
- package/dist/scss/type.scss +0 -117
- package/dist/scss/vars.scss +0 -213
- package/dist/scss/z-index.scss +0 -9
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/field/lexical/config/client/EditorConfigProvider.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport * as React from 'react'\nimport { createContext, useContext, useMemo, useRef, useState } from 'react'\n\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\n// Should always produce a 20 character pseudo-random string\nfunction generateQuickGuid(): string {\n return Math.random().toString(36).substring(2, 12) + Math.random().toString(36).substring(2, 12)\n}\n\nexport interface EditorConfigContextType {\n // Editor focus handling\n blurEditor: (editorContext: EditorConfigContextType) => void\n childrenEditors: React.RefObject<Map<string, EditorConfigContextType>>\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n field: FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n // Editor focus handling\n focusEditor: (editorContext: EditorConfigContextType) => void\n focusedEditor: EditorConfigContextType | null\n parentEditor: EditorConfigContextType\n registerChild: (uuid: string, editorContext: EditorConfigContextType) => void\n unregisterChild?: (uuid: string) => void\n uuid: string\n}\n\nconst Context: React.Context<EditorConfigContextType> = createContext({\n editorConfig: null,\n field: null,\n uuid: null,\n})\n\nexport const EditorConfigProvider = ({\n children,\n editorConfig,\n editorContainerRef,\n fieldProps,\n parentContext,\n}: {\n children: React.ReactNode\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n fieldProps: FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n parentContext?: EditorConfigContextType\n}): React.ReactNode => {\n const [editor] = useLexicalComposerContext()\n // State to store the UUID\n const [uuid] = useState(generateQuickGuid())\n\n const childrenEditors = useRef<Map<string, EditorConfigContextType>>(new Map())\n const [focusedEditor, setFocusedEditor] = useState<EditorConfigContextType | null>(null)\n const focusHistory = useRef<Set<string>>(new Set())\n\n const editorContext = useMemo(\n () =>\n ({\n blurEditor: (editorContext: EditorConfigContextType) => {\n //setFocusedEditor(null) // Clear focused editor\n focusHistory.current.clear() // Reset focus history when focus is lost\n },\n childrenEditors,\n editor,\n editorConfig,\n editorContainerRef,\n field: fieldProps,\n focusEditor: (editorContext: EditorConfigContextType) => {\n const editorUUID = editorContext.uuid\n\n // Avoid recursion by checking if this editor is already focused in this cycle\n if (focusHistory.current.has(editorUUID)) {\n return\n }\n\n // Add this editor to the history to prevent future recursions in this cycle\n focusHistory.current.add(editorUUID)\n setFocusedEditor(editorContext)\n\n // Propagate focus event to parent and children, ensuring they do not refocus this editor\n if (parentContext?.uuid) {\n parentContext.focusEditor(editorContext)\n }\n childrenEditors.current.forEach((childEditor, childUUID) => {\n childEditor.focusEditor(editorContext)\n })\n\n focusHistory.current.clear()\n },\n focusedEditor,\n parentEditor: parentContext,\n registerChild: (childUUID, childEditorContext) => {\n if (!childrenEditors.current.has(childUUID)) {\n const newMap = new Map(childrenEditors.current)\n newMap.set(childUUID, childEditorContext)\n childrenEditors.current = newMap\n }\n },\n unregisterChild: (childUUID) => {\n if (childrenEditors.current.has(childUUID)) {\n const newMap = new Map(childrenEditors.current)\n newMap.delete(childUUID)\n childrenEditors.current = newMap\n }\n },\n\n uuid,\n }) as EditorConfigContextType,\n [\n editor,\n childrenEditors,\n editorConfig,\n editorContainerRef,\n fieldProps,\n focusedEditor,\n parentContext,\n uuid,\n ],\n )\n\n return <Context.Provider value={editorContext}>{children}</Context.Provider>\n}\n\nexport const useEditorConfigContext = (): EditorConfigContextType => {\n const context = useContext(Context)\n if (context === undefined) {\n throw new Error('useEditorConfigContext must be used within an EditorConfigProvider')\n }\n return context\n}\n"],
|
|
5
|
+
"mappings": "AAKA,OAAS,6BAAAA,MAAiC,2CAE1C,OAAS,iBAAAC,EAAe,cAAAC,EAAY,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QA8H5D,cAAAC,MAAA,oBAzHT,SAASC,GAA4B,CACnC,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAG,EAAE,EAAI,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAG,EAAE,CACjG,C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ACF,GACF,CACED,EACAE,EACAN,EACAC,EACAC,EACAK,EACAJ,EACAE,CACF,CACF,EAEA,OAAOV,EAACE,EAAQ,SAAR,CAAiB,MAAOa,EAAgB,SAAAX,EAAS,CAC3D,EAEaiB,EAAyB,IAA+B,CACnE,IAAMC,EAAU1B,EAAWM,CAAO,EAClC,GAAIoB,IAAY,OACd,MAAM,IAAI,MAAM,oEAAoE,EAEtF,OAAOA,CACT",
|
|
6
|
+
"names": ["useLexicalComposerContext", "createContext", "useContext", "useMemo", "useRef", "useState", "jsx", "generateQuickGuid", "Context", "EditorConfigProvider", "children", "editorConfig", "editorContainerRef", "fieldProps", "parentContext", "editor", "uuid", "childrenEditors", "focusedEditor", "setFocusedEditor", "focusHistory", "editorContext", "editorUUID", "childEditor", "childUUID", "childEditorContext", "newMap", "useEditorConfigContext", "context"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{d as a}from"./chunk-3PZ2ZFQG.js";import{useLexicalComposerContext as u}from"@lexical/react/LexicalComposerContext.js";import{useLexicalNodeSelection as C}from"@lexical/react/useLexicalNodeSelection.js";import{addClassNamesToElement as E,mergeRegister as d,removeClassNamesFromElement as N}from"@lexical/utils";import{$getNodeByKey as p,$getSelection as g,$isNodeSelection as M,CLICK_COMMAND as S,COMMAND_PRIORITY_LOW as m,KEY_BACKSPACE_COMMAND as D,KEY_DELETE_COMMAND as _}from"lexical";import{useCallback as y,useEffect as c}from"react";var f="selected";function $({nodeKey:t}){let[r]=u(),[o,i,n]=C(t),s=y(e=>{if(o&&M(g())){e.preventDefault();let l=p(t);if(a(l))return l.remove(),!0}return!1},[o,t]);return c(()=>d(r.registerCommand(S,e=>{let l=r.getElementByKey(t);return e.target===l?(e.shiftKey||n(),i(!o),!0):!1},m),r.registerCommand(_,s,m),r.registerCommand(D,s,m)),[n,r,o,t,s,i]),c(()=>{let e=r.getElementByKey(t);e!==null&&(o?E(e,f):N(e,f))},[r,o,t]),null}export{$ as HorizontalRuleComponent};
|
|
2
|
+
//# sourceMappingURL=component-FFLILIUZ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/field/features/horizontalRule/component/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport type { NodeKey } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { addClassNamesToElement, mergeRegister, removeClassNamesFromElement } from '@lexical/utils'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport { useCallback, useEffect } from 'react'\n\nimport { $isHorizontalRuleNode } from '../nodes/HorizontalRuleNode.js'\n\nconst isSelectedClassName = 'selected'\n\n/**\n * React component rendered in the lexical editor, WITHIN the hr element created by createDOM of the HorizontalRuleNode.\n *\n * @param nodeKey every node has a unique key (this key is not saved to the database and thus may differ between sessions). It's useful for working with the CURRENT lexical editor state\n */\nexport function HorizontalRuleComponent({ nodeKey }: { nodeKey: NodeKey }) {\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const $onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isHorizontalRuleNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n CLICK_COMMAND,\n (event: MouseEvent) => {\n const hrElem = editor.getElementByKey(nodeKey)\n\n if (event.target === hrElem) {\n if (!event.shiftKey) {\n clearSelection()\n }\n setSelected(!isSelected)\n return true\n }\n\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected])\n\n useEffect(() => {\n const hrElem = editor.getElementByKey(nodeKey)\n if (hrElem !== null) {\n if (isSelected) {\n addClassNamesToElement(hrElem, isSelectedClassName)\n } else {\n removeClassNamesFromElement(hrElem, isSelectedClassName)\n }\n }\n }, [editor, isSelected, nodeKey])\n\n return null\n}\n"],
|
|
5
|
+
"mappings": "qDAIA,OAAS,6BAAAA,MAAiC,2CAC1C,OAAS,2BAAAC,MAA+B,4CACxC,OAAS,0BAAAC,EAAwB,iBAAAC,EAAe,+BAAAC,MAAmC,iBACnF,OACE,iBAAAC,EACA,iBAAAC,EACA,oBAAAC,EACA,iBAAAC,EACA,wBAAAC,EACA,yBAAAC,EACA,sBAAAC,MACK,UACP,OAAS,eAAAC,EAAa,aAAAC,MAAiB,QAIvC,IAAMC,EAAsB,WAOrB,SAASC,EAAwB,CAAE,QAAAC,CAAQ,EAAyB,CACzE,GAAM,CAACC,CAAM,EAAIC,EAA0B,EACrC,CAACC,EAAYC,EAAaC,CAAc,EAAIC,EAAwBN,CAAO,EAE3EO,EAAYC,EACfC,GAAyB,CACxB,GAAIN,GAAcO,EAAiBC,EAAc,CAAC,EAAG,CACnDF,EAAM,eAAe,EACrB,IAAMG,EAAOC,EAAcb,CAAO,EAClC,GAAIc,EAAsBF,CAAI,EAC5B,OAAAA,EAAK,OAAO,EACL,EAEX,CACA,MAAO,EACT,EACA,CAACT,EAAYH,CAAO,CACtB,EAEA,OAAAe,EAAU,IACDC,EACLf,EAAO,gBACLgB,EACCR,GAAsB,CACrB,IAAMS,EAASjB,EAAO,gBAAgBD,CAAO,EAE7C,OAAIS,EAAM,SAAWS,GACdT,EAAM,UACTJ,EAAe,EAEjBD,EAAY,CAACD,CAAU,EAChB,IAGF,EACT,EACAgB,CACF,EACAlB,EAAO,gBAAgBmB,EAAoBb,EAAWY,CAAoB,EAC1ElB,EAAO,gBAAgBoB,EAAuBd,EAAWY,CAAoB,CAC/E,EACC,CAACd,EAAgBJ,EAAQE,EAAYH,EAASO,EAAWH,CAAW,CAAC,EAExEW,EAAU,IAAM,CACd,IAAMG,EAASjB,EAAO,gBAAgBD,CAAO,EACzCkB,IAAW,OACTf,EACFmB,EAAuBJ,EAAQpB,CAAmB,EAElDyB,EAA4BL,EAAQpB,CAAmB,EAG7D,EAAG,CAACG,EAAQE,EAAYH,CAAO,CAAC,EAEzB,IACT",
|
|
6
|
+
"names": ["useLexicalComposerContext", "useLexicalNodeSelection", "addClassNamesToElement", "mergeRegister", "removeClassNamesFromElement", "$getNodeByKey", "$getSelection", "$isNodeSelection", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "useCallback", "useEffect", "isSelectedClassName", "HorizontalRuleComponent", "nodeKey", "editor", "useLexicalComposerContext", "isSelected", "setSelected", "clearSelection", "useLexicalNodeSelection", "$onDelete", "useCallback", "event", "$isNodeSelection", "$getSelection", "node", "$getNodeByKey", "$isHorizontalRuleNode", "useEffect", "mergeRegister", "CLICK_COMMAND", "hrElem", "COMMAND_PRIORITY_LOW", "KEY_DELETE_COMMAND", "KEY_BACKSPACE_COMMAND", "addClassNamesToElement", "removeClassNamesFromElement"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{a as j,b as W,e as Y}from"./chunk-33ZTAHVL.js";import{b as N}from"./chunk-Y5455JF3.js";import{useLexicalComposerContext as Ce}from"@lexical/react/LexicalComposerContext.js";import{useLexicalNodeSelection as ge}from"@lexical/react/useLexicalNodeSelection.js";import{mergeRegister as ve}from"@lexical/utils";import{getTranslation as ye}from"@payloadcms/translations";import{Button as T,DrawerToggler as De,File as be,useConfig as he,useDocumentDrawer as Re,useDrawerSlug as Se,usePayloadAPI as _e,useTranslation as Ee}from"@payloadcms/ui/client";import{$getNodeByKey as z,$getSelection as we,$isNodeSelection as Ne,CLICK_COMMAND as Ue,COMMAND_PRIORITY_LOW as O,KEY_BACKSPACE_COMMAND as Pe,KEY_DELETE_COMMAND as Fe}from"lexical";import{useCallback as U,useEffect as $e,useReducer as xe,useRef as Me,useState as Le}from"react";import{useModal as X}from"@faceless-ui/modal";import{useLexicalComposerContext as Z}from"@lexical/react/LexicalComposerContext.js";import{getTranslation as ee}from"@payloadcms/translations";import{Drawer as te,Form as oe,FormSubmit as ae,RenderFields as re,useConfig as le,useDocumentInfo as ie,useFieldProps as ne,useTranslation as se}from"@payloadcms/ui/client";import{getFormState as H}from"@payloadcms/ui/shared";import{$getNodeByKey as de}from"lexical";import{deepCopyObject as ce}from"payload/shared";import{useCallback as V,useEffect as me,useState as pe}from"react";import{v4 as ue}from"uuid";import{jsx as L,jsxs as fe}from"react/jsx-runtime";var q=d=>{let{data:{fields:P,relationTo:F,value:C},drawerSlug:a,nodeKey:R,relatedCollection:g}=d,[S]=Z(),{closeModal:m}=X(),{i18n:r,t:l}=se(),{id:n}=ie(),{schemaPath:v}=ne(),i=le(),[p,$]=pe(!1),{field:{richTextComponentMap:y}}=N(),_=`feature.upload.fields.${g.slug}`,c=`${v}.feature.upload.${g.slug}`,s=y.get(_);me(()=>{(async()=>{let b=await H({apiRoute:i.routes.api,body:{id:n,data:ce(P||{}),operation:"update",schemaPath:c},serverURL:i.serverURL});$(b)})()},[i.routes.api,i.serverURL,c,n,P]);let x=V(async({formState:D})=>await H({apiRoute:i.routes.api,body:{id:n,formState:D,operation:"update",schemaPath:c},serverURL:i.serverURL}),[i.routes.api,i.serverURL,c,n]),E=V((D,b)=>{S.update(()=>{let u=de(R);if(u){let f={...u.getData(),fields:b};u.setData(f)}}),m(a)},[m,S,a,R]);return L(te,{slug:a,title:l("general:editLabel",{label:ee(g.labels.singular,r)}),children:p!==!1&&fe(oe,{beforeSubmit:[x],disableValidationOnSubmit:!0,fields:s,initialState:p,onChange:[x],onSubmit:E,uuid:ue(),children:[L(re,{fieldMap:Array.isArray(s)?s:[],forceRender:!0,path:"",readOnly:!1,schemaPath:c}),L(ae,{children:l("fields:saveChanges")})]})})};import{jsx as e,jsxs as h}from"react/jsx-runtime";var o="lexical-upload",G={depth:0},Te=d=>{let{data:{fields:P,relationTo:F,value:C},nodeKey:a}=d,{collections:R,routes:{api:g},serverURL:S}=he(),m=Me(null),[r]=Ce(),[l,n,v]=ge(a),{editorConfig:i,field:p}=N(),{i18n:$,t:y}=Ee(),[_,c]=xe(t=>t+1,0),[s,x]=Le(()=>R.find(t=>t.slug===F)),E=Se("upload-drawer"),[D,b,{closeDrawer:u}]=Re({id:C,collectionSlug:s.slug}),[{data:f},{setParams:A}]=_e(`${S}${g}/${s.slug}/${C}`,{initialParams:G}),K=f?.thumbnailURL||f?.url,J=U(()=>{r.update(()=>{z(a).remove()})},[r,a]),Q=U(t=>{A({...G,cacheBust:_}),c(),u()},[A,_,u]),M=U(t=>{if(l&&Ne(we())){t.preventDefault();let k=z(a);if(Y(k))return k.remove(),!0}return!1},[l,a]),I=U(t=>{let w=t;return w.target===m.current||m.current?.contains(w.target)?(w.shiftKey?n(!l):l||(v(),n(!0)),!0):!1},[l,n,v]);$e(()=>ve(r.registerCommand(Ue,I,O),r.registerCommand(Fe,M,O),r.registerCommand(Pe,M,O)),[v,r,l,a,M,n,I]);let B=(i?.resolvedFeatureMap?.get("upload")?.clientFeatureProps).collections?.[s.slug]?.hasExtraFields;return h("div",{className:[o,l&&`${o}--selected`].filter(Boolean).join(" "),contentEditable:!1,ref:m,children:[h("div",{className:`${o}__card`,children:[h("div",{className:`${o}__topRow`,children:[e("div",{className:`${o}__thumbnail`,children:K?e("img",{alt:f?.filename,"data-lexical-upload-id":C,"data-lexical-upload-relation-to":F,src:K}):e(be,{})}),h("div",{className:`${o}__topRowRightPanel`,children:[e("div",{className:`${o}__collectionLabel`,children:ye(s.labels.singular,$)}),r.isEditable()&&h("div",{className:`${o}__actions`,children:[B?e(De,{className:`${o}__upload-drawer-toggler`,disabled:p?.readOnly,slug:E,children:e(T,{buttonStyle:"icon-label",el:"div",icon:"edit",onClick:t=>{t.preventDefault()},round:!0,tooltip:y("fields:editRelationship")})}):null,e(T,{buttonStyle:"icon-label",disabled:p?.readOnly,el:"div",icon:"swap",onClick:()=>{r.dispatchCommand(W,{replace:{nodeKey:a}})},round:!0,tooltip:y("fields:swapUpload")}),e(T,{buttonStyle:"icon-label",className:`${o}__removeButton`,disabled:p?.readOnly,icon:"x",onClick:t=>{t.preventDefault(),J()},round:!0,tooltip:y("fields:removeUpload")})]})]})]}),e("div",{className:`${o}__bottomRow`,children:e(b,{className:`${o}__doc-drawer-toggler`,children:e("strong",{children:f?.filename})})})]}),C&&e(D,{onSave:Q}),B?e(q,{drawerSlug:E,relatedCollection:s,...d}):null]})},st=d=>e(j,{...d,uploads:!0,children:e(Te,{...d})});export{st as UploadComponent};
|
|
2
|
+
//# sourceMappingURL=component-GR6KYTLO.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/field/features/upload/component/index.tsx", "../../../src/field/features/upload/component/ExtraFieldsDrawer/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport type { ClientCollectionConfig } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n DrawerToggler,\n File,\n useConfig,\n useDocumentDrawer,\n useDrawerSlug,\n usePayloadAPI,\n useTranslation,\n} from '@payloadcms/ui/client'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport React, { useCallback, useEffect, useReducer, useRef, useState } from 'react'\n\nimport type { ClientComponentProps } from '../../types.js'\nimport type { UploadFeaturePropsClient } from '../feature.client.js'\nimport type { UploadData } from '../nodes/UploadNode.js'\n\nimport { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js'\nimport { EnabledRelationshipsCondition } from '../../relationship/utils/EnabledRelationshipsCondition.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport { $isUploadNode } from '../nodes/UploadNode.js'\nimport { ExtraFieldsUploadDrawer } from './ExtraFieldsDrawer/index.js'\nconst baseClass = 'lexical-upload'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n data: UploadData\n nodeKey: string\n}\n\nconst Component: React.FC<ElementProps> = (props) => {\n const {\n data: { fields, relationTo, value },\n nodeKey,\n } = props\n\n const {\n collections,\n routes: { api },\n serverURL,\n } = useConfig()\n const uploadRef = useRef<HTMLDivElement | null>(null)\n\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const { editorConfig, field } = useEditorConfigContext()\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection, setRelatedCollection] = useState<ClientCollectionConfig>(() =>\n collections.find((coll) => coll.slug === relationTo),\n )\n\n const drawerSlug = useDrawerSlug('upload-drawer')\n\n const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n // Get the referenced document\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${value}`,\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (json) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n dispatchCacheBust()\n closeDrawer()\n },\n [setParams, cacheBust, closeDrawer],\n )\n\n const $onDelete = useCallback(\n (payload: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n const event: KeyboardEvent = payload\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isUploadNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n const onClick = useCallback(\n (payload: MouseEvent) => {\n const event = payload\n // Check if uploadRef.target or anything WITHIN uploadRef.target was clicked\n if (event.target === uploadRef.current || uploadRef.current?.contains(event.target as Node)) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n if (!isSelected) {\n clearSelection()\n setSelected(true)\n }\n }\n return true\n }\n\n return false\n },\n [isSelected, setSelected, clearSelection],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW),\n\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected, onClick])\n\n const hasExtraFields = (\n editorConfig?.resolvedFeatureMap?.get('upload')\n ?.clientFeatureProps as ClientComponentProps<UploadFeaturePropsClient>\n ).collections?.[relatedCollection.slug]?.hasExtraFields\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={uploadRef}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__topRow`}>\n {/* TODO: migrate to use @payloadcms/ui/elements/Thumbnail component */}\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC ? (\n <img\n alt={data?.filename}\n data-lexical-upload-id={value}\n data-lexical-upload-relation-to={relationTo}\n src={thumbnailSRC}\n />\n ) : (\n <File />\n )}\n </div>\n <div className={`${baseClass}__topRowRightPanel`}>\n <div className={`${baseClass}__collectionLabel`}>\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n {hasExtraFields ? (\n <DrawerToggler\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={field?.readOnly}\n slug={drawerSlug}\n >\n <Button\n buttonStyle=\"icon-label\"\n el=\"div\"\n icon=\"edit\"\n onClick={(e) => {\n e.preventDefault()\n }}\n round\n tooltip={t('fields:editRelationship')}\n />\n </DrawerToggler>\n ) : null}\n\n <Button\n buttonStyle=\"icon-label\"\n disabled={field?.readOnly}\n el=\"div\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapUpload')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeUpload()\n }}\n round\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n <div className={`${baseClass}__bottomRow`}>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <strong>{data?.filename}</strong>\n </DocumentDrawerToggler>\n </div>\n </div>\n {value && <DocumentDrawer onSave={updateUpload} />}\n {hasExtraFields ? (\n <ExtraFieldsUploadDrawer\n drawerSlug={drawerSlug}\n relatedCollection={relatedCollection}\n {...props}\n />\n ) : null}\n </div>\n )\n}\n\nexport const UploadComponent = (props: ElementProps): React.ReactNode => {\n return (\n <EnabledRelationshipsCondition {...props} uploads>\n <Component {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n", "'use client'\nimport type { FormProps } from '@payloadcms/ui/forms/Form'\nimport type { ClientCollectionConfig, FormState } from 'payload'\n\nimport { useModal } from '@faceless-ui/modal'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Drawer,\n Form,\n FormSubmit,\n RenderFields,\n useConfig,\n useDocumentInfo,\n useFieldProps,\n useTranslation,\n} from '@payloadcms/ui/client'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport { $getNodeByKey } from 'lexical'\nimport { deepCopyObject } from 'payload/shared'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { UploadData, UploadNode } from '../../nodes/UploadNode.js'\nimport type { ElementProps } from '../index.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\n\n/**\n * This handles the extra fields, e.g. captions or alt text, which are\n * potentially added to the upload feature.\n */\nexport const ExtraFieldsUploadDrawer: React.FC<\n ElementProps & {\n drawerSlug: string\n relatedCollection: ClientCollectionConfig\n }\n> = (props) => {\n const {\n data: { fields, relationTo, value },\n drawerSlug,\n nodeKey,\n relatedCollection,\n } = props\n\n const [editor] = useLexicalComposerContext()\n\n const { closeModal } = useModal()\n\n const { i18n, t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const config = useConfig()\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `feature.upload.fields.${relatedCollection.slug}`\n const schemaFieldsPath = `${schemaPath}.feature.upload.${relatedCollection.slug}`\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: deepCopyObject(fields || {}),\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n void awaitInitialState()\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id, fields])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n return await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id],\n )\n\n const handleUpdateEditData = useCallback(\n (_, data) => {\n // Update lexical node (with key nodeKey) with new data\n editor.update(() => {\n const uploadNode: UploadNode | null = $getNodeByKey(nodeKey)\n if (uploadNode) {\n const newData: UploadData = {\n ...uploadNode.getData(),\n fields: data,\n }\n uploadNode.setData(newData)\n }\n })\n\n closeModal(drawerSlug)\n },\n [closeModal, editor, drawerSlug, nodeKey],\n )\n\n return (\n <Drawer\n slug={drawerSlug}\n title={t('general:editLabel', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n >\n {initialState !== false && (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n // @ts-expect-error TODO: Fix this\n fields={fieldMap}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleUpdateEditData}\n uuid={uuid()}\n >\n <RenderFields\n fieldMap={Array.isArray(fieldMap) ? fieldMap : []}\n forceRender\n path=\"\" // See Blocks feature path for details as for why this is empty\n readOnly={false}\n schemaPath={schemaFieldsPath}\n />\n <FormSubmit>{t('fields:saveChanges')}</FormSubmit>\n </Form>\n )}\n </Drawer>\n )\n}\n"],
|
|
5
|
+
"mappings": "2GAGA,OAAS,6BAAAA,OAAiC,2CAC1C,OAAS,2BAAAC,OAA+B,4CACxC,OAAS,iBAAAC,OAAqB,iBAC9B,OAAS,kBAAAC,OAAsB,2BAC/B,OACE,UAAAC,EACA,iBAAAC,GACA,QAAAC,GACA,aAAAC,GACA,qBAAAC,GACA,iBAAAC,GACA,iBAAAC,GACA,kBAAAC,OACK,wBACP,OACE,iBAAAC,EACA,iBAAAC,GACA,oBAAAC,GACA,iBAAAC,GACA,wB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AAe,OAAQW,EAAc,EAC/CgB,EACCjE,EAACwE,EAAA,CACC,WAAYpC,EACZ,kBAAmBJ,EAClB,GAAG3B,EACN,EACE,MACN,CAEJ,EAEaoE,GAAmBpE,GAE5BL,EAAC0E,EAAA,CAA+B,GAAGrE,EAAO,QAAO,GAC/C,SAAAL,EAACI,GAAA,CAAW,GAAGC,EAAO,EACxB",
|
|
6
|
+
"names": ["useLexicalComposerContext", "useLexicalNodeSelection", "mergeRegister", "getTranslation", "Button", "DrawerToggler", "File", "useConfig", "useDocumentDrawer", "useDrawerSlug", "usePayloadAPI", "useTranslation", "$getNodeByKey", "$getSelection", "$isNodeSelection", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "useCallback", "useEffect", "useReducer", "useRef", "useState", "useModal", "useLexicalComposerContext", "getTranslation", "Drawer", "Form", "FormSubmit", "RenderFields", "useConfig", "useDocumentInfo", "useFieldProps", "useTranslation", "getFormState", "$getNodeByKey", "deepCopyObject", "useCallback", "useEffect", "useState", "uuid", "jsx", "jsxs", "ExtraFieldsUploadDrawer", "props", "fields", "relationTo", "value", "drawerSlug", "nodeKey", "relatedCollection", "editor", "useLexicalComposerContext", "closeModal", "useModal", "i18n", "t", "useTranslation", "id", "useDocumentInfo", "schemaPath", "useFieldProps", "config", "useConfig", "initialState", "setInitialState", "useState", "richTextComponentMap", "useEditorConfigContext", "componentMapRenderedFieldsPath", "schemaFieldsPath", "fieldMap", "useEffect", "state", "getFormState", "deepCopyObject", "onChange", "useCallback", "prevFormState", "handleUpdateEditData", "_", "data", "uploadNode", "$getNodeByKey", "newData", "Drawer", "getTranslation", "Form", "uuid", "RenderFields", "FormSubmit", "jsx", "jsxs", "baseClass", "initialParams", "Component", "props", "fields", "relationTo", "value", "nodeKey", "collections", "api", "serverURL", "useConfig", "uploadRef", "useRef", "editor", "useLexicalComposerContext", "isSelected", "setSelected", "clearSelection", "useLexicalNodeSelection", "editorConfig", "field", "useEditorConfigContext", "i18n", "t", "useTranslation", "cacheBust", "dispatchCacheBust", "useReducer", "state", "relatedCollection", "setRelatedCollection", "useState", "coll", "drawerSlug", "useDrawerSlug", "DocumentDrawer", "DocumentDrawerToggler", "closeDrawer", "useDocumentDrawer", "data", "setParams", "usePayloadAPI", "thumbnailSRC", "removeUpload", "useCallback", "$getNodeByKey", "updateUpload", "json", "$onDelete", "payload", "$isNodeSelection", "$getSelection", "node", "$isUploadNode", "onClick", "event", "useEffect", "mergeRegister", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_DELETE_COMMAND", "KEY_BACKSPACE_COMMAND", "hasExtraFields", "File", "getTranslation", "DrawerToggler", "Button", "e", "INSERT_UPLOAD_WITH_DRAWER_COMMAND", "ExtraFieldsUploadDrawer", "UploadComponent", "EnabledRelationshipsCondition"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{b as D}from"./chunk-Y5455JF3.js";import{Collapsible as oe,Form as te,Pill as ae,SectionTitle as re,ShimmerEffect as le,useConfig as se,useDocumentInfo as ie,useFieldProps as ne,useFormSubmitted as ce,useTranslation as de}from"@payloadcms/ui/client";import{useCallback as me,useEffect as pe,useMemo as fe,useState as ue}from"react";import{getTranslation as ye}from"@payloadcms/translations";import{getFormState as V}from"@payloadcms/ui/shared";import{v4 as he}from"uuid";import{useLexicalComposerContext as j}from"@lexical/react/LexicalComposerContext.js";import{getTranslation as W}from"@payloadcms/translations";import{Button as z,Collapsible as H,ErrorPill as J,Pill as q,RenderFields as G,SectionTitle as Q,useDocumentInfo as X,useFormSubmitted as Y,useTranslation as Z}from"@payloadcms/ui/client";import ee from"deep-equal";import{$getNodeByKey as M}from"lexical";import w,{useCallback as x}from"react";import{useAllFormFields as U}from"@payloadcms/ui/client";import{reduceFieldsToValues as I}from"@payloadcms/ui/shared";import{useEffect as K}from"react";function E({fields:i}){for(let e in i){let a=i[e];Array.isArray(a.rows)&&"value"in a&&(a.disableFormData=!0)}return i}var O=i=>{let{onChange:e}=i,[a]=U(),o=E({fields:a}),m=I(o,!0);return K(()=>{e&&e({fullFieldsWithValues:o,newFormData:m})},[m,e,o]),null};import{jsx as F,jsxs as A}from"react/jsx-runtime";var L=i=>{let{baseClass:e,field:a,formData:o,formSchema:m,nodeKey:n,reducedBlock:{labels:g},schemaPath:_}=i,{i18n:S}=Z(),[c]=j(),{getDocPreferences:y,setDocFieldPreferences:P}=X(),[T,B]=w.useState(()=>{let r=!1;return y().then(d=>{let t=d?.fields[a.name]?.collapsed;t&&t.includes(o.id)&&(r=!0,B(!0))}),r}),s=Y(),[p,k]=w.useState(0),h=s&&p>0,R=[`${e}__row`,h?`${e}__row--has-errors`:`${e}__row--no-errors`].filter(Boolean).join(" "),N=x(({fullFieldsWithValues:r,newFormData:d})=>{d={...d,id:o.id,blockType:o.blockType};function v(t){for(let l in t){let b=t[l];Array.isArray(b)&&!b?.length?delete t[l]:b&&typeof b=="object"?v(b):b==null&&delete t[l]}}if(v(d),v(o),ee(o,d)||setTimeout(()=>{c.update(()=>{let t=M(n);t&&t.setFields(d)})},0),s){let t=0;for(let l of Object.values(r))l?.valid===!1&&t++;k(t)}},[c,n,s,o]),$=x(r=>{y().then(d=>{let t=d?.fields[a.name]?.collapsed,l=t&&t?.length?t:[];r?l.includes(o.id)||l.push(o.id):l.includes(o.id)&&l.splice(l.indexOf(o.id),1),P(a.name,{collapsed:l,hello:"hi"})})},[y,a.name,P,o.id]),C=x(()=>{c.update(()=>{M(n).remove()})},[c,n]);return A(w.Fragment,{children:[F(H,{className:R,collapsibleStyle:h?"error":"default",header:A("div",{className:`${e}__block-header`,children:[A("div",{children:[F(q,{className:`${e}__block-pill ${e}__block-pill-${o?.blockType}`,pillStyle:"white",children:typeof g.singular=="string"?W(g.singular,S):"[Singular Label]"}),F(Q,{path:"blockName",readOnly:a?.readOnly}),h&&F(J,{count:p,i18n:S,withMessage:!0})]}),c.isEditable()&&F(z,{buttonStyle:"icon-label",className:`${e}__removeButton`,disabled:a?.readOnly,icon:"x",onClick:r=>{r.preventDefault(),C()},round:!0,tooltip:"Remove Block"})]}),isCollapsed:T,onToggle:r=>{$(r),B(r)},children:F(G,{className:`${e}__fields`,fieldMap:Array.isArray(m)?m:[],forceRender:!0,margins:"small",path:"",readOnly:!1,schemaPath:_})},0),F(O,{onChange:N})]})};import{jsx as u,jsxs as be}from"react/jsx-runtime";var f="lexical-block",Ie=i=>{let{formData:e,nodeKey:a}=i,o=se(),m=ce(),{id:n}=ie(),{path:g,schemaPath:_}=ne(),{editorConfig:S,field:c}=D(),[y,P]=ue(!1),{field:{richTextComponentMap:T}}=D(),B=`feature.blocks.fields.${e?.blockType}`,s=`${_}.feature.blocks.${e?.blockType}`,p=S?.resolvedFeatureMap?.get("blocks")?.clientFeatureProps?.reducedBlocks?.find(C=>C.slug===e?.blockType),k=T.get(B);pe(()=>{e&&(async()=>{let r=await V({apiRoute:o.routes.api,body:{id:n,data:JSON.parse(JSON.stringify(e)),operation:"update",schemaPath:s},serverURL:o.serverURL});r&&P({...r,blockName:{initialValue:"",passesCondition:!0,valid:!0,value:e.blockName}})})()},[o.routes.api,o.serverURL,s,n]);let h=me(async({formState:C})=>({...await V({apiRoute:o.routes.api,body:{id:n,formState:C,operation:"update",schemaPath:s},serverURL:o.serverURL}),blockName:{initialValue:"",passesCondition:!0,valid:!0,value:e.blockName}}),[o.routes.api,o.serverURL,s,n,e.blockName]),{i18n:R}=de(),N=[`${f}__row`,`${f}__row--no-errors`].filter(Boolean).join(" "),$=fe(()=>p&&y!==!1?u(te,{beforeSubmit:[h],fields:k,initialState:y,onChange:[h],submitted:m,uuid:he(),children:u(L,{baseClass:f,field:c,formData:e,formSchema:Array.isArray(k)?k:[],nodeKey:a,path:`${g}.feature.blocks.${e.blockType}`,reducedBlock:p,schemaPath:s})}):u(oe,{className:N,collapsibleStyle:"default",header:u("div",{className:`${f}__block-header`,children:be("div",{children:[u(ae,{className:`${f}__block-pill ${f}__block-pill-${e?.blockType}`,pillStyle:"white",children:typeof p.labels.singular=="string"?ye(p.labels.singular,R):"[Singular Label]"}),u(re,{path:"blockName",readOnly:c?.readOnly})]})}),children:u(le,{height:"35vh"})},0),[N,k,c,a,R,m,y,p,h,s,g]);return u("div",{className:f+" "+f+"-"+e.blockType,children:$})};export{Ie as BlockComponent};
|
|
2
|
+
//# sourceMappingURL=component-RAVN56DE.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/field/features/blocks/component/index.tsx", "../../../src/field/features/blocks/component/BlockContent.tsx", "../../../src/field/features/blocks/component/FormSavePlugin.tsx", "../../../src/field/features/blocks/component/removeEmptyArrayValues.ts"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport type { FormProps } from '@payloadcms/ui/forms/Form'\n\nimport {\n Collapsible,\n Form,\n Pill,\n SectionTitle,\n ShimmerEffect,\n useConfig,\n useDocumentInfo,\n useFieldProps,\n useFormSubmitted,\n useTranslation,\n} from '@payloadcms/ui/client'\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\n\nimport { type BlockFields } from '../nodes/BlocksNode.js'\nconst baseClass = 'lexical-block'\nimport type { ReducedBlock } from '@payloadcms/ui/utilities/buildComponentMap'\nimport type { FormState } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport { v4 as uuid } from 'uuid'\n\nimport type { ClientComponentProps } from '../../types.js'\nimport type { BlocksFeatureClientProps } from '../feature.client.js'\n\nimport { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js'\nimport { BlockContent } from './BlockContent.js'\ntype Props = {\n children?: React.ReactNode\n\n formData: BlockFields\n nodeKey?: string\n /**\n * This transformedFormData already comes wrapped in blockFieldWrapperName\n */\n transformedFormData: BlockFields\n}\n\nexport const BlockComponent: React.FC<Props> = (props) => {\n const { formData, nodeKey } = props\n const config = useConfig()\n const submitted = useFormSubmitted()\n const { id } = useDocumentInfo()\n const { path, schemaPath } = useFieldProps()\n const { editorConfig, field: parentLexicalRichTextField } = useEditorConfigContext()\n\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `feature.blocks.fields.${formData?.blockType}`\n const schemaFieldsPath = `${schemaPath}.feature.blocks.${formData?.blockType}`\n\n const reducedBlock: ReducedBlock = (\n editorConfig?.resolvedFeatureMap?.get('blocks')\n ?.clientFeatureProps as ClientComponentProps<BlocksFeatureClientProps>\n )?.reducedBlocks?.find((block) => block.slug === formData?.blockType)\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath)\n // Field Schema\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: JSON.parse(JSON.stringify(formData)),\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n if (state) {\n setInitialState({\n ...state,\n blockName: {\n initialValue: '',\n passesCondition: true,\n valid: true,\n value: formData.blockName,\n },\n })\n }\n }\n\n if (formData) {\n void awaitInitialState()\n }\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n const formState = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n\n return {\n ...formState,\n blockName: {\n initialValue: '',\n passesCondition: true,\n valid: true,\n value: formData.blockName,\n },\n }\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id, formData.blockName],\n )\n const { i18n } = useTranslation()\n\n const classNames = [`${baseClass}__row`, `${baseClass}__row--no-errors`].filter(Boolean).join(' ')\n\n // Memoized Form JSX\n const formContent = useMemo(() => {\n return reducedBlock && initialState !== false ? (\n <Form\n beforeSubmit={[onChange]}\n // @ts-expect-error TODO: Fix this\n fields={fieldMap}\n initialState={initialState}\n onChange={[onChange]}\n submitted={submitted}\n uuid={uuid()}\n >\n <BlockContent\n baseClass={baseClass}\n field={parentLexicalRichTextField}\n formData={formData}\n formSchema={Array.isArray(fieldMap) ? fieldMap : []}\n nodeKey={nodeKey}\n path={`${path}.feature.blocks.${formData.blockType}`}\n reducedBlock={reducedBlock}\n schemaPath={schemaFieldsPath}\n />\n </Form>\n ) : (\n <Collapsible\n className={classNames}\n collapsibleStyle=\"default\"\n header={\n <div className={`${baseClass}__block-header`}>\n <div>\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`}\n pillStyle=\"white\"\n >\n {typeof reducedBlock.labels.singular === 'string'\n ? getTranslation(reducedBlock.labels.singular, i18n)\n : '[Singular Label]'}\n </Pill>\n <SectionTitle path=\"blockName\" readOnly={parentLexicalRichTextField?.readOnly} />\n </div>\n </div>\n }\n key={0}\n >\n <ShimmerEffect height=\"35vh\" />\n </Collapsible>\n )\n }, [\n classNames,\n fieldMap,\n parentLexicalRichTextField,\n nodeKey,\n i18n,\n submitted,\n initialState,\n reducedBlock,\n onChange,\n schemaFieldsPath,\n path,\n ]) // Adding formData to the dependencies here might break it\n return <div className={baseClass + ' ' + baseClass + '-' + formData.blockType}>{formContent}</div>\n}\n", "import type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { FieldMap, ReducedBlock } from '@payloadcms/ui/utilities/buildComponentMap'\nimport type { CollapsedPreferences, Data, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Collapsible,\n ErrorPill,\n Pill,\n RenderFields,\n SectionTitle,\n useDocumentInfo,\n useFormSubmitted,\n useTranslation,\n} from '@payloadcms/ui/client'\nimport isDeepEqual from 'deep-equal'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback } from 'react'\n\nimport type { SanitizedClientEditorConfig } from '../../../lexical/config/types.js'\nimport type { BlockFields, BlockNode } from '../nodes/BlocksNode.js'\n\nimport { FormSavePlugin } from './FormSavePlugin.js'\n\ntype Props = {\n baseClass: string\n field: FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n formData: BlockFields\n formSchema: FieldMap\n nodeKey: string\n path: string\n reducedBlock: ReducedBlock\n schemaPath: string\n}\n\n/**\n * The actual content of the Block. This should be INSIDE a Form component,\n * scoped to the block. All format operations in here are thus scoped to the block's form, and\n * not the whole document.\n */\nexport const BlockContent: React.FC<Props> = (props) => {\n const {\n baseClass,\n field,\n formData,\n formSchema,\n nodeKey,\n reducedBlock: { labels },\n schemaPath,\n } = props\n\n const { i18n } = useTranslation()\n const [editor] = useLexicalComposerContext()\n // Used for saving collapsed to preferences (and gettin' it from there again)\n // Remember, these preferences are scoped to the whole document, not just this form. This\n // is important to consider for the data path used in setDocFieldPreferences\n const { getDocPreferences, setDocFieldPreferences } = useDocumentInfo()\n\n const [isCollapsed, setIsCollapsed] = React.useState<boolean>(() => {\n let initialState = false\n\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences = currentDocPreferences?.fields[field.name]\n\n const collapsedArray = currentFieldPreferences?.collapsed\n\n if (collapsedArray && collapsedArray.includes(formData.id)) {\n initialState = true\n setIsCollapsed(true)\n }\n })\n return initialState\n })\n\n const hasSubmitted = useFormSubmitted()\n\n const [errorCount, setErrorCount] = React.useState(0)\n\n const fieldHasErrors = hasSubmitted && errorCount > 0\n\n const classNames = [\n `${baseClass}__row`,\n fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,\n ]\n .filter(Boolean)\n .join(' ')\n\n const onFormChange = useCallback(\n ({\n fullFieldsWithValues,\n newFormData,\n }: {\n fullFieldsWithValues: FormState\n newFormData: Data\n }) => {\n newFormData = {\n ...newFormData,\n id: formData.id,\n blockType: formData.blockType,\n }\n\n // Recursively remove all undefined values from even being present in formData, as they will\n // cause isDeepEqual to return false if, for example, formData has a key that fields.data\n // does not have, even if it's undefined.\n // Currently, this happens if a block has another sub-blocks field. Inside formData, that sub-blocks field has an undefined blockName property.\n // Inside of fields.data however, that sub-blocks blockName property does not exist at all.\n function removeUndefinedAndNullAndEmptyArraysRecursively(obj: object) {\n for (const key in obj) {\n const value = obj[key]\n if (Array.isArray(value) && !value?.length) {\n delete obj[key]\n } else if (value && typeof value === 'object') {\n removeUndefinedAndNullAndEmptyArraysRecursively(value)\n } else if (value === undefined || value === null) {\n delete obj[key]\n }\n }\n }\n removeUndefinedAndNullAndEmptyArraysRecursively(newFormData)\n\n removeUndefinedAndNullAndEmptyArraysRecursively(formData)\n\n // Only update if the data has actually changed. Otherwise, we may be triggering an unnecessary value change,\n // which would trigger the \"Leave without saving\" dialog unnecessarily\n if (!isDeepEqual(formData, newFormData)) {\n // Running this in the next tick in the meantime fixes this issue: https://github.com/payloadcms/payload/issues/4108\n // I don't know why. When this is called immediately, it might focus out of a nested lexical editor field if an update is made there.\n // My hypothesis is that the nested editor might not have fully finished its update cycle yet. By updating in the next tick, we\n // ensure that the nested editor has finished its update cycle before we update the block node.\n setTimeout(() => {\n editor.update(() => {\n const node: BlockNode = $getNodeByKey(nodeKey)\n if (node) {\n node.setFields(newFormData as BlockFields)\n }\n })\n }, 0)\n }\n\n // update error count\n if (hasSubmitted) {\n let rowErrorCount = 0\n for (const formField of Object.values(fullFieldsWithValues)) {\n if (formField?.valid === false) {\n rowErrorCount++\n }\n }\n setErrorCount(rowErrorCount)\n }\n },\n [editor, nodeKey, hasSubmitted, formData],\n )\n\n const onCollapsedChange = useCallback(\n (changedCollapsed: boolean) => {\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences = currentDocPreferences?.fields[field.name]\n\n const collapsedArray = currentFieldPreferences?.collapsed\n\n const newCollapsed: CollapsedPreferences =\n collapsedArray && collapsedArray?.length ? collapsedArray : []\n\n if (changedCollapsed) {\n if (!newCollapsed.includes(formData.id)) {\n newCollapsed.push(formData.id)\n }\n } else {\n if (newCollapsed.includes(formData.id)) {\n newCollapsed.splice(newCollapsed.indexOf(formData.id), 1)\n }\n }\n\n setDocFieldPreferences(field.name, {\n collapsed: newCollapsed,\n hello: 'hi',\n })\n })\n },\n [getDocPreferences, field.name, setDocFieldPreferences, formData.id],\n )\n\n const removeBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n return (\n <React.Fragment>\n <Collapsible\n className={classNames}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n header={\n <div className={`${baseClass}__block-header`}>\n <div>\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`}\n pillStyle=\"white\"\n >\n {typeof labels.singular === 'string'\n ? getTranslation(labels.singular, i18n)\n : '[Singular Label]'}\n </Pill>\n <SectionTitle path=\"blockName\" readOnly={field?.readOnly} />\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n {editor.isEditable() && (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeBlock()\n }}\n round\n tooltip=\"Remove Block\"\n />\n )}\n </div>\n }\n isCollapsed={isCollapsed}\n key={0}\n onToggle={(incomingCollapsedState) => {\n onCollapsedChange(incomingCollapsedState)\n setIsCollapsed(incomingCollapsedState)\n }}\n >\n <RenderFields\n className={`${baseClass}__fields`}\n fieldMap={Array.isArray(formSchema) ? formSchema : []}\n forceRender\n margins=\"small\"\n path=\"\" // Leaving path empty makes it so field values are not prefixed / scoped by the entire schemaPath. e.g. we can access \"myField\" instead of \"someLexicalField.feature.blocks.someArrayB\" // TODO: Could there be any implications leaving path different than schemaPath?\n readOnly={false}\n schemaPath={schemaPath} // Having the correct schemaPath here allows sub-fields (like array > addRow) to run correct form-state calls and retrieve their needed form state from the server\n />\n </Collapsible>\n\n <FormSavePlugin onChange={onFormChange} />\n </React.Fragment>\n )\n}\n", "import type { Data, FormState } from 'payload'\nimport type React from 'react'\n\nimport { useAllFormFields } from '@payloadcms/ui/client'\nimport { reduceFieldsToValues } from '@payloadcms/ui/shared'\nimport { useEffect } from 'react'\n\nimport { removeEmptyArrayValues } from './removeEmptyArrayValues.js'\n\ntype Props = {\n onChange?: ({\n fullFieldsWithValues,\n newFormData,\n }: {\n fullFieldsWithValues: FormState\n newFormData: Data\n }) => void\n}\n\nexport const FormSavePlugin: React.FC<Props> = (props) => {\n const { onChange } = props\n\n const [_fields] = useAllFormFields()\n\n const fields = removeEmptyArrayValues({ fields: _fields })\n\n // Pass in fields, and indicate if you'd like to \"unflatten\" field data.\n // The result below will reflect the data stored in the form at the given time\n const newFormData = reduceFieldsToValues(fields, true)\n\n useEffect(() => {\n if (onChange) {\n onChange({ fullFieldsWithValues: fields, newFormData })\n }\n }, [newFormData, onChange, fields])\n\n return null\n}\n", "import type { FormState } from 'payload'\n\n/**\n * By default, if an array field is empty, it will be included in the form state with a value of 0.\n * We do not need this behavior here, By setting `disableFormData` to true, we can prevent the field from being included in the form state\n * like that.\n * @param fields form state\n */\nexport function removeEmptyArrayValues({ fields }: { fields: FormState }): FormState {\n for (const key in fields) {\n const field = fields[key]\n if (Array.isArray(field.rows) && 'value' in field) {\n field.disableFormData = true\n }\n }\n return fields\n}\n"],
|
|
5
|
+
"mappings": "qDAIA,OACE,eAAAA,GACA,QAAAC,GACA,QAAAC,GACA,gBAAAC,GACA,iBAAAC,GACA,aAAAC,GACA,mBAAAC,GACA,iBAAAC,GACA,oBAAAC,GACA,kBAAAC,OACK,wBACP,OAAgB,eAAAC,GAAa,aAAAC,GAAW,WAAAC,GAAS,YAAAC,OAAgB,QAOjE,OAAS,kBAAAC,OAAsB,2BAC/B,OAAS,gBAAAC,MAAoB,wBAC7B,OAAS,MAAMC,OAAY,OCrB3B,OAAS,6BAAA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AWN,EACX,iBAAiB,UACjB,OACEpC,EAAC,OAAI,UAAW,GAAGE,CAAS,iBAC1B,SAAAD,GAAC,OACC,UAAAD,EAAC2C,GAAA,CACC,UAAW,GAAGzC,CAAS,gBAAgBA,CAAS,gBAAgBG,GAAU,SAAS,GACnF,UAAU,QAET,gBAAOoB,EAAa,OAAO,UAAa,SACrCmB,GAAenB,EAAa,OAAO,SAAUS,CAAI,EACjD,mBACN,EACAlC,EAAC6C,GAAA,CAAa,KAAK,YAAY,SAAU5B,GAA4B,SAAU,GACjF,EACF,EAIF,SAAAjB,EAAC8C,GAAA,CAAc,OAAO,OAAO,GAFxB,CAGP,EAED,CACDV,EACAT,EACAV,EACAX,EACA4B,EACAzB,EACAU,EACAM,EACAM,EACAP,EACAX,CACF,CAAC,EACD,OAAOb,EAAC,OAAI,UAAWE,EAAY,IAAMA,EAAY,IAAMG,EAAS,UAAY,SAAAgC,EAAY,CAC9F",
|
|
6
|
+
"names": ["Collapsible", "Form", "Pill", "SectionTitle", "ShimmerEffect", "useConfig", "useDocumentInfo", "useFieldProps", "useFormSubmitted", "useTranslation", "useCallback", "useEffect", "useMemo", "useState", "getTranslation", "getFormState", "uuid", "useLexicalComposerContext", "getTranslation", "Button", "Collapsible", "ErrorPill", "Pill", "RenderFields", "SectionTitle", "useDocumentInfo", "useFormSubmitted", "useTranslation", "isDeepEqual", "$getNodeByKey", "React", "useCallback", "useAllFormFields", "reduceFieldsToValues", "useEffect", "removeEmptyArrayValues", "fields", "key", "field", "FormSavePlugin", "props", "onChange", "_fields", "useAllFormFields", "fields", "removeEmptyArrayValues", "newFormData", "reduceFieldsToValues", "useEffect", "jsx", "jsxs", "BlockContent", "props", "baseClass", "field", "formData", "formSchema", "nodeKey", "labels", "schemaPath", "i18n", "useTranslation", "editor", "useLexicalComposerContext", "getDocPreferences", "setDocFieldPreferences", "useDocumentInfo", "isCollapsed", "setIsCollapsed", "React", "initialState", "currentDocPreferences", "collapsedArray", "hasSubmitted", "useFormSubmitted", "errorCount", "setErrorCount", "fieldHasErrors", "classNames", "onFormChange", "useCallback", "fullFieldsWithValues", "newFormData", "removeUndefinedAndNullAndEmptyArraysRecursively", "obj", "key", "value", "isDeepEqual", "node", "$getNodeByKey", "rowErrorCount", "formField", "onCollapsedChange", "changedCollapsed", "newCollapsed", "removeBlock", "Collapsible", "Pill", "getTranslation", "SectionTitle", "ErrorPill", "Button", "e", "incomingCollapsedState", "RenderFields", "FormSavePlugin", "jsx", "jsxs", "baseClass", "BlockComponent", "props", "formData", "nodeKey", "config", "useConfig", "submitted", "useFormSubmitted", "id", "useDocumentInfo", "path", "schemaPath", "useFieldProps", "editorConfig", "parentLexicalRichTextField", "useEditorConfigContext", "initialState", "setInitialState", "useState", "richTextComponentMap", "componentMapRenderedFieldsPath", "schemaFieldsPath", "reducedBlock", "block", "fieldMap", "useEffect", "state", "getFormState", "onChange", "useCallback", "prevFormState", "i18n", "useTranslation", "classNames", "formContent", "useMemo", "Form", "uuid", "BlockContent", "Collapsible", "Pill", "getTranslation", "SectionTitle", "ShimmerEffect"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export { RichTextCell } from '../../cell/index.js';
|
|
2
|
+
export { AlignFeatureClientComponent } from '../../field/features/align/feature.client.js';
|
|
3
|
+
export { BlockquoteFeatureClientComponent } from '../../field/features/blockquote/feature.client.js';
|
|
4
|
+
export { BlocksFeatureClientComponent } from '../../field/features/blocks/feature.client.js';
|
|
5
|
+
export { createClientComponent } from '../../field/features/createClientComponent.js';
|
|
6
|
+
export { TestRecorderFeatureClientComponent } from '../../field/features/debug/testRecorder/feature.client.js';
|
|
7
|
+
export { TreeViewFeatureClientComponent } from '../../field/features/debug/treeView/feature.client.js';
|
|
8
|
+
export { BoldFeatureClientComponent } from '../../field/features/format/bold/feature.client.js';
|
|
9
|
+
export { InlineCodeFeatureClientComponent } from '../../field/features/format/inlineCode/feature.client.js';
|
|
10
|
+
export { ItalicFeatureClientComponent } from '../../field/features/format/italic/feature.client.js';
|
|
11
|
+
export { toolbarFormatGroupWithItems } from '../../field/features/format/shared/toolbarFormatGroup.js';
|
|
12
|
+
export { StrikethroughFeatureClientComponent } from '../../field/features/format/strikethrough/feature.client.js';
|
|
13
|
+
export { SubscriptFeatureClientComponent } from '../../field/features/format/subscript/feature.client.js';
|
|
14
|
+
export { SuperscriptFeatureClientComponent } from '../../field/features/format/superscript/feature.client.js';
|
|
15
|
+
export { UnderlineFeatureClientComponent } from '../../field/features/format/underline/feature.client.js';
|
|
16
|
+
export { HeadingFeatureClientComponent } from '../../field/features/heading/feature.client.js';
|
|
17
|
+
export { HorizontalRuleFeatureClientComponent } from '../../field/features/horizontalRule/feature.client.js';
|
|
18
|
+
export { IndentFeatureClientComponent } from '../../field/features/indent/feature.client.js';
|
|
19
|
+
export { LinkFeatureClientComponent } from '../../field/features/link/feature.client.js';
|
|
20
|
+
export { ChecklistFeatureClientComponent } from '../../field/features/lists/checklist/feature.client.js';
|
|
21
|
+
export { OrderedListFeatureClientComponent } from '../../field/features/lists/orderedList/feature.client.js';
|
|
22
|
+
export { UnorderedListFeatureClientComponent } from '../../field/features/lists/unorderedList/feature.client.js';
|
|
23
|
+
export { LexicalPluginToLexicalFeatureClientComponent } from '../../field/features/migrations/lexicalPluginToLexical/feature.client.js';
|
|
24
|
+
export { SlateToLexicalFeatureClientComponent } from '../../field/features/migrations/slateToLexical/feature.client.js';
|
|
25
|
+
export { ParagraphFeatureClientComponent } from '../../field/features/paragraph/feature.client.js';
|
|
26
|
+
export { RelationshipFeatureClientComponent } from '../../field/features/relationship/feature.client.js';
|
|
27
|
+
export { toolbarAddDropdownGroupWithItems } from '../../field/features/shared/toolbar/addDropdownGroup.js';
|
|
28
|
+
export { toolbarFeatureButtonsGroupWithItems } from '../../field/features/shared/toolbar/featureButtonsGroup.js';
|
|
29
|
+
export { toolbarTextDropdownGroupWithItems } from '../../field/features/shared/toolbar/textDropdownGroup.js';
|
|
30
|
+
export { FixedToolbarFeatureClientComponent } from '../../field/features/toolbars/fixed/feature.client.js';
|
|
31
|
+
export { InlineToolbarFeatureClientComponent } from '../../field/features/toolbars/inline/feature.client.js';
|
|
32
|
+
export { ToolbarButton } from '../../field/features/toolbars/shared/ToolbarButton/index.js';
|
|
33
|
+
export { ToolbarDropdown } from '../../field/features/toolbars/shared/ToolbarDropdown/index.js';
|
|
34
|
+
export { UploadFeatureClientComponent } from '../../field/features/upload/feature.client.js';
|
|
35
|
+
export { RichTextField } from '../../field/index.js';
|
|
36
|
+
export { type EditorConfigContextType, EditorConfigProvider, useEditorConfigContext, } from '../../field/lexical/config/client/EditorConfigProvider.js';
|
|
37
|
+
export { defaultEditorLexicalConfig } from '../../field/lexical/config/client/default.js';
|
|
38
|
+
export { sanitizeClientEditorConfig, sanitizeClientFeatures, } from '../../field/lexical/config/client/sanitize.js';
|
|
39
|
+
export { CAN_USE_DOM } from '../../field/lexical/utils/canUseDOM.js';
|
|
40
|
+
export { cloneDeep } from '../../field/lexical/utils/cloneDeep.js';
|
|
41
|
+
export { getDOMRangeRect } from '../../field/lexical/utils/getDOMRangeRect.js';
|
|
42
|
+
export { getSelectedNode } from '../../field/lexical/utils/getSelectedNode.js';
|
|
43
|
+
export { isHTMLElement } from '../../field/lexical/utils/guard.js';
|
|
44
|
+
export { invariant } from '../../field/lexical/utils/invariant.js';
|
|
45
|
+
export { joinClasses } from '../../field/lexical/utils/joinClasses.js';
|
|
46
|
+
export { createBlockNode } from '../../field/lexical/utils/markdown/createBlockNode.js';
|
|
47
|
+
export { Point, isPoint } from '../../field/lexical/utils/point.js';
|
|
48
|
+
export { Rect } from '../../field/lexical/utils/rect.js';
|
|
49
|
+
export { setFloatingElemPosition } from '../../field/lexical/utils/setFloatingElemPosition.js';
|
|
50
|
+
export { setFloatingElemPositionForLinkEditor } from '../../field/lexical/utils/setFloatingElemPositionForLinkEditor.js';
|
|
51
|
+
export { addSwipeDownListener, addSwipeLeftListener, addSwipeRightListener, addSwipeUpListener, } from '../../field/lexical/utils/swipe.js';
|
|
52
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAA;AAC1F,OAAO,EAAE,gCAAgC,EAAE,MAAM,mDAAmD,CAAA;AACpG,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAA;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAA;AACrF,OAAO,EAAE,kCAAkC,EAAE,MAAM,2DAA2D,CAAA;AAC9G,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAA;AACtG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oDAAoD,CAAA;AAC/F,OAAO,EAAE,gCAAgC,EAAE,MAAM,0DAA0D,CAAA;AAC3G,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAA;AACnG,OAAO,EAAE,2BAA2B,EAAE,MAAM,0DAA0D,CAAA;AACtG,OAAO,EAAE,mCAAmC,EAAE,MAAM,6DAA6D,CAAA;AACjH,OAAO,EAAE,+BAA+B,EAAE,MAAM,yDAAyD,CAAA;AACzG,OAAO,EAAE,iCAAiC,EAAE,MAAM,2DAA2D,CAAA;AAC7G,OAAO,EAAE,+BAA+B,EAAE,MAAM,yDAAyD,CAAA;AACzG,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAA;AAC9F,OAAO,EAAE,oCAAoC,EAAE,MAAM,uDAAuD,CAAA;AAC5G,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAA;AAC5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAA;AACxF,OAAO,EAAE,+BAA+B,EAAE,MAAM,wDAAwD,CAAA;AACxG,O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