@payloadcms/richtext-lexical 3.84.1 → 4.0.0-internal.38b7f1d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/exports/client/Field-PJW7KUJG.js +2 -0
- package/dist/exports/client/Field-PJW7KUJG.js.map +7 -0
- package/dist/exports/client/RelationshipComponent-5RONAYJM.js +2 -0
- package/dist/exports/client/RelationshipComponent-5RONAYJM.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-44G3K3W7.js +2 -0
- package/dist/exports/client/chunk-44G3K3W7.js.map +7 -0
- package/dist/exports/client/chunk-WSAPGI3Z.js +2 -0
- package/dist/exports/client/chunk-WSAPGI3Z.js.map +7 -0
- package/dist/exports/client/component-53Y3RYR5.js +2 -0
- package/dist/exports/client/component-53Y3RYR5.js.map +7 -0
- package/dist/exports/client/componentInline-PM4PLNUK.js +2 -0
- package/dist/exports/client/index.d.ts +0 -2
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +30 -30
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
- package/dist/features/align/client/toolbarAlignGroup.js +1 -0
- package/dist/features/align/client/toolbarAlignGroup.js.map +1 -1
- package/dist/features/blockquote/server/index.d.ts.map +1 -1
- package/dist/features/blockquote/server/index.js +0 -39
- package/dist/features/blockquote/server/index.js.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.d.ts +10 -0
- package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/blocks/client/component/index.css +178 -0
- package/dist/features/blocks/client/component/index.d.ts +1 -1
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +88 -16
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.css +85 -0
- package/dist/features/blocks/client/componentInline/index.d.ts +1 -1
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +29 -6
- 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 +0 -2
- package/dist/features/blocks/client/index.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js +3 -0
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.css +26 -0
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js +4 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +40 -0
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js +7 -8
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/index.css +171 -0
- package/dist/features/debug/jsxConverter/client/plugin/index.d.ts +1 -1
- package/dist/features/debug/jsxConverter/client/plugin/index.d.ts.map +1 -1
- package/dist/features/debug/jsxConverter/client/plugin/index.js +1 -0
- package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
- package/dist/features/debug/jsxConverter/client/plugin/style.css +9 -0
- package/dist/features/debug/testRecorder/client/plugin/index.css +51 -0
- package/dist/features/debug/testRecorder/client/plugin/index.d.ts +1 -1
- package/dist/features/debug/testRecorder/client/plugin/index.d.ts.map +1 -1
- package/dist/features/debug/testRecorder/client/plugin/index.js +1 -0
- package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
- package/dist/features/debug/treeView/client/plugin/index.css +81 -0
- package/dist/features/debug/treeView/client/plugin/index.d.ts +1 -1
- package/dist/features/debug/treeView/client/plugin/index.d.ts.map +1 -1
- package/dist/features/debug/treeView/client/plugin/index.js +1 -0
- package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.css +91 -0
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +3 -2
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.css +11 -0
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +1 -0
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.css +166 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts +17 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js +219 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.css +235 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +95 -104
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
- package/dist/features/experimental_table/server/index.d.ts.map +1 -1
- package/dist/features/experimental_table/server/index.js +0 -102
- package/dist/features/experimental_table/server/index.js.map +1 -1
- package/dist/features/heading/server/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.js +0 -39
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/horizontalRule/client/plugin/index.css +25 -0
- package/dist/features/horizontalRule/client/plugin/index.d.ts +1 -1
- package/dist/features/horizontalRule/client/plugin/index.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/plugin/index.js +73 -4
- package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
- package/dist/features/horizontalRule/server/index.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/index.js +0 -8
- package/dist/features/horizontalRule/server/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +28 -8
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.css +112 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js +1 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
- package/dist/features/link/server/index.d.ts.map +1 -1
- package/dist/features/link/server/index.js +0 -71
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
- package/dist/features/lists/checklist/server/index.js +0 -7
- 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 +0 -7
- package/dist/features/lists/orderedList/server/index.js.map +1 -1
- package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/unorderedList/server/index.js +0 -7
- 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 +27 -2
- package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
- package/dist/features/relationship/client/components/index.css +112 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.css +87 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.css +43 -0
- package/dist/features/toolbars/inline/client/Toolbar/index.d.ts +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.js +1 -0
- package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.css +57 -0
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +80 -74
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +4 -0
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.css +214 -0
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +11 -7
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/features/toolbars/types.d.ts +4 -0
- package/dist/features/toolbars/types.d.ts.map +1 -1
- package/dist/features/toolbars/types.js.map +1 -1
- package/dist/features/typesServer.d.ts +0 -17
- 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 +218 -0
- 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 +86 -63
- package/dist/features/upload/client/component/index.js.map +1 -1
- package/dist/features/upload/client/component/pending/index.d.ts +0 -1
- package/dist/features/upload/client/component/pending/index.d.ts.map +1 -1
- package/dist/features/upload/client/component/pending/index.js.map +1 -1
- package/dist/features/upload/server/index.d.ts.map +1 -1
- package/dist/features/upload/server/index.js +0 -78
- package/dist/features/upload/server/index.js.map +1 -1
- package/dist/field/Diff/converters/listitem/index.css +44 -0
- package/dist/field/Diff/converters/listitem/index.d.ts +1 -1
- package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/listitem/index.js +1 -0
- package/dist/field/Diff/converters/listitem/index.js.map +1 -1
- package/dist/field/Diff/converters/relationship/index.css +68 -0
- package/dist/field/Diff/converters/relationship/index.d.ts +1 -1
- package/dist/field/Diff/converters/relationship/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/relationship/index.js +1 -0
- package/dist/field/Diff/converters/relationship/index.js.map +1 -1
- package/dist/field/Diff/converters/unknown/index.css +37 -0
- package/dist/field/Diff/converters/unknown/index.d.ts +1 -1
- package/dist/field/Diff/converters/unknown/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/unknown/index.js +1 -0
- package/dist/field/Diff/converters/unknown/index.js.map +1 -1
- package/dist/field/Diff/converters/upload/index.css +112 -0
- package/dist/field/Diff/converters/upload/index.d.ts +1 -1
- package/dist/field/Diff/converters/upload/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/upload/index.js +1 -0
- package/dist/field/Diff/converters/upload/index.js.map +1 -1
- package/dist/field/Diff/index.css +101 -0
- package/dist/field/Diff/index.d.ts +1 -1
- package/dist/field/Diff/index.d.ts.map +1 -1
- package/dist/field/Diff/index.js +1 -0
- package/dist/field/Diff/index.js.map +1 -1
- package/dist/field/Field.d.ts +2 -2
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +11 -9
- package/dist/field/Field.js.map +1 -1
- package/dist/field/ViewSelector.css +32 -0
- package/dist/field/ViewSelector.d.ts +1 -1
- package/dist/field/ViewSelector.d.ts.map +1 -1
- package/dist/field/ViewSelector.js +1 -0
- package/dist/field/ViewSelector.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.css +60 -0
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.css +50 -0
- package/dist/lexical/LexicalEditor.d.ts +1 -1
- package/dist/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/lexical/LexicalEditor.js +1 -0
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/config/server/loader.d.ts.map +1 -1
- package/dist/lexical/config/server/loader.js +12 -9
- package/dist/lexical/config/server/loader.js.map +1 -1
- package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/server/sanitize.js +0 -6
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.css +11 -0
- package/dist/lexical/plugins/DecoratorPlugin/index.d.ts +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.js +1 -0
- package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +52 -0
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +1 -0
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.css +65 -0
- package/dist/lexical/plugins/SlashMenu/index.d.ts +1 -1
- package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.js +2 -0
- package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +40 -0
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +1 -0
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +84 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +15 -8
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
- package/dist/lexical/theme/EditorTheme.css +359 -0
- package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
- package/dist/lexical/theme/EditorTheme.js +1 -0
- package/dist/lexical/theme/EditorTheme.js.map +1 -1
- package/dist/lexical/ui/ContentEditable.css +95 -0
- package/dist/lexical/ui/ContentEditable.d.ts +1 -1
- package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +1 -0
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/lexical/ui/icons/Add/index.d.ts +4 -1
- package/dist/lexical/ui/icons/Add/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Add/index.js +19 -12
- package/dist/lexical/ui/icons/Add/index.js.map +1 -1
- package/dist/lexical/ui/icons/Add/index.svg +2 -3
- package/dist/lexical/ui/icons/Add/light.svg +2 -3
- package/dist/lexical/ui/icons/AlignCenter/index.d.ts +3 -1
- package/dist/lexical/ui/icons/AlignCenter/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignCenter/index.js +15 -19
- package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignJustify/index.d.ts +3 -1
- package/dist/lexical/ui/icons/AlignJustify/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignJustify/index.js +15 -19
- package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignLeft/index.d.ts +3 -1
- package/dist/lexical/ui/icons/AlignLeft/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignLeft/index.js +15 -19
- package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignRight/index.d.ts +3 -1
- package/dist/lexical/ui/icons/AlignRight/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignRight/index.js +15 -19
- package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
- package/dist/lexical/ui/icons/Block/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Block/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Block/index.js +13 -28
- package/dist/lexical/ui/icons/Block/index.js.map +1 -1
- package/dist/lexical/ui/icons/Blockquote/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Blockquote/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Blockquote/index.js +9 -6
- package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
- package/dist/lexical/ui/icons/Bold/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Bold/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Bold/index.js +13 -8
- package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
- package/dist/lexical/ui/icons/Checklist/index.d.ts +4 -1
- package/dist/lexical/ui/icons/Checklist/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Checklist/index.js +17 -18
- package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
- package/dist/lexical/ui/icons/Code/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Code/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Code/index.js +15 -13
- package/dist/lexical/ui/icons/Code/index.js.map +1 -1
- package/dist/lexical/ui/icons/CodeBlock/index.d.ts +4 -1
- package/dist/lexical/ui/icons/CodeBlock/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/CodeBlock/index.js +18 -7
- package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
- package/dist/lexical/ui/icons/Collapse/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Collapse/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Collapse/index.js +10 -8
- package/dist/lexical/ui/icons/Collapse/index.js.map +1 -1
- package/dist/lexical/ui/icons/DraggableBlock/index.svg +7 -7
- package/dist/lexical/ui/icons/DraggableBlock/light.svg +7 -7
- package/dist/lexical/ui/icons/Expand/index.d.ts +5 -0
- package/dist/lexical/ui/icons/Expand/index.d.ts.map +1 -0
- package/dist/lexical/ui/icons/Expand/index.js +22 -0
- package/dist/lexical/ui/icons/Expand/index.js.map +1 -0
- package/dist/lexical/ui/icons/H1/index.d.ts +3 -1
- package/dist/lexical/ui/icons/H1/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H1/index.js +9 -6
- package/dist/lexical/ui/icons/H1/index.js.map +1 -1
- package/dist/lexical/ui/icons/H2/index.d.ts +3 -1
- package/dist/lexical/ui/icons/H2/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H2/index.js +9 -6
- package/dist/lexical/ui/icons/H2/index.js.map +1 -1
- package/dist/lexical/ui/icons/H3/index.d.ts +3 -1
- package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H3/index.js +9 -6
- package/dist/lexical/ui/icons/H3/index.js.map +1 -1
- package/dist/lexical/ui/icons/H4/index.d.ts +3 -1
- package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H4/index.js +9 -6
- package/dist/lexical/ui/icons/H4/index.js.map +1 -1
- package/dist/lexical/ui/icons/H5/index.d.ts +3 -1
- package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H5/index.js +9 -6
- package/dist/lexical/ui/icons/H5/index.js.map +1 -1
- package/dist/lexical/ui/icons/H6/index.d.ts +3 -1
- package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H6/index.js +9 -6
- package/dist/lexical/ui/icons/H6/index.js.map +1 -1
- package/dist/lexical/ui/icons/HorizontalRule/index.d.ts +3 -1
- package/dist/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/HorizontalRule/index.js +11 -11
- package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
- package/dist/lexical/ui/icons/IndentDecrease/index.d.ts +3 -1
- package/dist/lexical/ui/icons/IndentDecrease/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/IndentDecrease/index.js +18 -22
- package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
- package/dist/lexical/ui/icons/IndentIncrease/index.d.ts +3 -1
- package/dist/lexical/ui/icons/IndentIncrease/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/IndentIncrease/index.js +15 -22
- package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
- package/dist/lexical/ui/icons/InlineBlocks/index.d.ts +3 -1
- package/dist/lexical/ui/icons/InlineBlocks/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/InlineBlocks/index.js +9 -6
- package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
- package/dist/lexical/ui/icons/Italic/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Italic/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Italic/index.js +13 -8
- package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
- package/dist/lexical/ui/icons/Link/index.d.ts +4 -1
- package/dist/lexical/ui/icons/Link/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Link/index.js +14 -9
- package/dist/lexical/ui/icons/Link/index.js.map +1 -1
- package/dist/lexical/ui/icons/Meatballs/index.d.ts +4 -1
- package/dist/lexical/ui/icons/Meatballs/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Meatballs/index.js +19 -15
- package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
- package/dist/lexical/ui/icons/OrderedList/index.d.ts +4 -1
- package/dist/lexical/ui/icons/OrderedList/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/OrderedList/index.js +19 -25
- package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
- package/dist/lexical/ui/icons/Page/index.d.ts +5 -0
- package/dist/lexical/ui/icons/Page/index.d.ts.map +1 -0
- package/dist/lexical/ui/icons/Page/index.js +21 -0
- package/dist/lexical/ui/icons/Page/index.js.map +1 -0
- package/dist/lexical/ui/icons/Relationship/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Relationship/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Relationship/index.js +13 -25
- package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
- package/dist/lexical/ui/icons/Strikethrough/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Strikethrough/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Strikethrough/index.js +13 -13
- package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
- package/dist/lexical/ui/icons/Subscript/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Subscript/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Subscript/index.js +10 -7
- package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
- package/dist/lexical/ui/icons/Superscript/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Superscript/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Superscript/index.js +10 -7
- package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
- package/dist/lexical/ui/icons/Table/index.d.ts +4 -1
- package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Table/index.js +20 -15
- package/dist/lexical/ui/icons/Table/index.js.map +1 -1
- package/dist/lexical/ui/icons/Text/index.d.ts +4 -1
- package/dist/lexical/ui/icons/Text/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Text/index.js +17 -8
- package/dist/lexical/ui/icons/Text/index.js.map +1 -1
- package/dist/lexical/ui/icons/Trash/index.d.ts +10 -0
- package/dist/lexical/ui/icons/Trash/index.d.ts.map +1 -0
- package/dist/lexical/ui/icons/Trash/index.js +29 -0
- package/dist/lexical/ui/icons/Trash/index.js.map +1 -0
- package/dist/lexical/ui/icons/Underline/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Underline/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Underline/index.js +16 -14
- package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
- package/dist/lexical/ui/icons/UnorderedList/index.d.ts +3 -1
- package/dist/lexical/ui/icons/UnorderedList/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/UnorderedList/index.js +13 -40
- package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
- package/dist/lexical/ui/icons/Upload/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Upload/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Upload/index.js +15 -22
- package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
- package/dist/utilities/buildEditorState.d.ts.map +1 -1
- package/dist/utilities/buildEditorState.js +13 -0
- package/dist/utilities/buildEditorState.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts +1 -0
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +34 -18
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
- package/package.json +10 -15
- package/dist/exports/client/Component-DOSSWC76.js +0 -2
- package/dist/exports/client/Component-DOSSWC76.js.map +0 -7
- package/dist/exports/client/Component-MBLHTKDK.js +0 -2
- package/dist/exports/client/Component-MBLHTKDK.js.map +0 -7
- package/dist/exports/client/Field-4UEGQMIN.js +0 -2
- package/dist/exports/client/Field-4UEGQMIN.js.map +0 -7
- package/dist/exports/client/RelationshipComponent-BG3DPV3T.js +0 -2
- package/dist/exports/client/RelationshipComponent-BG3DPV3T.js.map +0 -7
- package/dist/exports/client/chunk-F26IQ5RE.js +0 -2
- package/dist/exports/client/chunk-F26IQ5RE.js.map +0 -7
- package/dist/exports/client/chunk-YWIZCGSY.js +0 -2
- package/dist/exports/client/chunk-YWIZCGSY.js.map +0 -7
- package/dist/exports/client/component-XIHC3W6W.js +0 -2
- package/dist/exports/client/component-XIHC3W6W.js.map +0 -7
- package/dist/exports/client/componentInline-CBBUBQ7P.js +0 -2
- package/dist/exports/server/migrate.d.ts +0 -16
- package/dist/exports/server/migrate.d.ts.map +0 -1
- package/dist/exports/server/migrate.js +0 -16
- package/dist/exports/server/migrate.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts +0 -4
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js +0 -7
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts +0 -4
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js +0 -38
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts +0 -4
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js +0 -9
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts +0 -4
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js +0 -33
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts +0 -6
- package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js +0 -9
- package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts +0 -70
- package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js +0 -104
- package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts +0 -27
- package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js +0 -2
- package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts +0 -39
- package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/field/index.js +0 -122
- package/dist/features/converters/lexicalToHtml_deprecated/field/index.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts +0 -12
- package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/index.js +0 -11
- package/dist/features/converters/lexicalToHtml_deprecated/index.js.map +0 -1
- package/dist/features/lists/htmlConverter.d.ts +0 -5
- package/dist/features/lists/htmlConverter.d.ts.map +0 -1
- package/dist/features/lists/htmlConverter.js +0 -81
- package/dist/features/lists/htmlConverter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js +0 -22
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js +0 -33
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js +0 -24
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js +0 -25
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js +0 -22
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js +0 -28
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +0 -22
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js +0 -9
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts +0 -19
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +0 -78
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts +0 -23
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.js +0 -2
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts +0 -2
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.js +0 -10
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts +0 -10
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.js +0 -49
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts +0 -9
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +0 -15
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +0 -33
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +0 -74
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js +0 -23
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js +0 -24
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js +0 -33
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js +0 -30
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js +0 -26
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js +0 -26
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js +0 -15
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js +0 -27
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js +0 -26
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js +0 -18
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.js +0 -12
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/index.d.ts +0 -19
- package/dist/features/migrations/slateToLexical/converter/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/index.js +0 -130
- package/dist/features/migrations/slateToLexical/converter/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/types.d.ts +0 -16
- package/dist/features/migrations/slateToLexical/converter/types.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/types.js +0 -2
- package/dist/features/migrations/slateToLexical/converter/types.js.map +0 -1
- package/dist/features/migrations/slateToLexical/feature.client.d.ts +0 -2
- package/dist/features/migrations/slateToLexical/feature.client.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/feature.client.js +0 -10
- package/dist/features/migrations/slateToLexical/feature.client.js.map +0 -1
- package/dist/features/migrations/slateToLexical/feature.server.d.ts +0 -40
- package/dist/features/migrations/slateToLexical/feature.server.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/feature.server.js +0 -68
- package/dist/features/migrations/slateToLexical/feature.server.js.map +0 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts +0 -9
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +0 -15
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +0 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +0 -33
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +0 -74
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +0 -1
- package/dist/lexical/ui/icons/AI/index.d.ts +0 -3
- package/dist/lexical/ui/icons/AI/index.d.ts.map +0 -1
- package/dist/lexical/ui/icons/AI/index.js +0 -34
- package/dist/lexical/ui/icons/AI/index.js.map +0 -1
- package/dist/lexical/ui/icons/Caret/index.svg +0 -3
- package/dist/lexical/ui/icons/Edit/index.svg +0 -10
- package/dist/lexical/ui/icons/Remove/index.svg +0 -4
- package/dist/utilities/migrateSlateToLexical/index.d.ts +0 -15
- package/dist/utilities/migrateSlateToLexical/index.d.ts.map +0 -1
- package/dist/utilities/migrateSlateToLexical/index.js +0 -152
- package/dist/utilities/migrateSlateToLexical/index.js.map +0 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts +0 -10
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +0 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +0 -85
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +0 -1
- /package/dist/exports/client/{componentInline-CBBUBQ7P.js.map → componentInline-PM4PLNUK.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","Collapsible","Drawer","EditDepthProvider","ErrorPill","Form","formatDrawerSlug","FormSubmit","Pill","RenderFields","SectionTitle","useConfig","useDocumentForm","useDocumentInfo","useEditDepth","useFormSubmitted","useServerFunctions","useTranslation","abortAndIgnore","$getNodeByKey","deepCopyObjectSimpleWithoutReactComponents","reduceFieldsToValues","React","useCallback","useEffect","useMemo","useRef","v4","uuid","useEditorConfigContext","useLexicalDrawer","$isBlockNode","BlockContent","useBlockComponentContext","removeEmptyArrayValues","BlockComponent","props","cacheBuster","className","baseClass","CustomBlock","CustomBlockFromProps","CustomLabel","CustomLabelFromProps","formData","nodeKey","submitted","id","collectionSlug","globalSlug","fieldProps","featureClientSchemaMap","field","parentLexicalRichTextField","initialLexicalFormState","schemaPath","uuidFromContext","fields","parentDocumentFields","onChangeAbortControllerRef","AbortController","editDepth","errorCount","setErrorCount","useState","config","drawerSlug","slug","depth","toggleDrawer","getDocPreferences","setDocFieldPreferences","editor","isEditable","blockType","getFormState","schemaFieldsPath","initialState","setInitialState","cachedFormState","formState","mergedState","Object","fromEntries","entries","map","fieldName","fieldState","initialValue","value","blockName","passesCondition","valid","hasMounted","prevCacheBuster","current","formUuid","setCustomLabel","undefined","customComponents","BlockLabel","setCustomBlock","Block","resolvedCustomBlock","_jsx","isEditor","isJSXConverter","resolvedCustomLabel","abortController","awaitInitialState","state","data","docPermissions","docPreferences","documentFormState","excludeFiles","initialBlockData","operation","readOnly","renderAllFields","signal","newFormStateData","update","node","newData","setFields","_components","isCollapsed","setIsCollapsed","collapsed","componentMapRenderedBlockPath","clientSchemaMap","blocksField","clientBlock","blockReferences","blocksMap","blocks","i18n","t","onChange","prevFormState","submit","controller","newFormState","initialBlockFormState","setTimeout","rowErrorCount","formField","values","removeBlock","remove","blockDisplayName","labels","singular","onCollapsedChange","changedCollapsed","then","currentDocPreferences","currentFieldPreferences","name","collapsedArray","newCollapsed","length","includes","push","splice","indexOf","hello","EditButton","buttonStyle","disabled","el","icon","onClick","e","preventDefault","stopPropagation","onMouseDown","round","size","tooltip","label","RemoveButton","BlockCollapsible","Actions","children","collapsibleProps","disableBlockName","editButton","fieldHasErrors","Label","CustomPill","removeButton","filter","Boolean","join","collapsibleStyle","header","_jsxs","pillStyle","admin","path","count","withMessage","_Fragment","onToggle","incomingCollapsedState","blockID","BlockDrawer","title","forceRender","parentIndexPath","parentPath","parentSchemaPath","permissions","programmaticSubmit","style","display","beforeSubmit","onSubmit","formSchema"],"sources":["../../../../../src/features/blocks/client/component/index.tsx"],"sourcesContent":["'use client'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Collapsible,\n Drawer,\n EditDepthProvider,\n ErrorPill,\n Form,\n formatDrawerSlug,\n FormSubmit,\n Pill,\n RenderFields,\n SectionTitle,\n useConfig,\n useDocumentForm,\n useDocumentInfo,\n useEditDepth,\n useFormSubmitted,\n useServerFunctions,\n useTranslation,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { $getNodeByKey } from 'lexical'\nimport {\n type BlocksFieldClient,\n type ClientBlock,\n type CollapsedPreferences,\n type FormState,\n} from 'payload'\nimport { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from 'payload/shared'\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { ViewMapBlockComponentProps } from '../../../../types.js'\nimport type { BlockFields } from '../../server/nodes/BlocksNode.js'\n\nimport './index.scss'\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { $isBlockNode } from '../nodes/BlocksNode.js'\nimport {\n type BlockCollapsibleWithErrorProps,\n BlockContent,\n useBlockComponentContext,\n} from './BlockContent.js'\nimport { removeEmptyArrayValues } from './removeEmptyArrayValues.js'\n\nexport type BlockComponentProps<TFormData extends Record<string, unknown> = BlockFields> = {\n /**\n * Can be modified by the node in order to trigger the re-fetch of the initial state based on the\n * formData. This is useful when node.setFields() is explicitly called from outside of the form - in\n * this case, the new field state is likely not reflected in the form state, so we need to re-fetch\n */\n readonly cacheBuster: number\n readonly className: string\n /**\n * Custom block component from view map\n * Will be rendered with useBlockComponentContext hook.\n */\n readonly CustomBlock?: React.FC<ViewMapBlockComponentProps>\n /**\n * Custom block label from view map\n * Will be rendered with useBlockComponentContext hook.\n */\n readonly CustomLabel?: React.FC<ViewMapBlockComponentProps>\n /**\n * The block's form data (field values).\n */\n readonly formData: TFormData\n /**\n * The unique key identifying this block node in the current editor instance.\n */\n readonly nodeKey: string\n}\n\nexport const BlockComponent: React.FC<BlockComponentProps> = (props) => {\n const {\n cacheBuster,\n className: baseClass,\n CustomBlock: CustomBlockFromProps,\n CustomLabel: CustomLabelFromProps,\n formData,\n nodeKey,\n } = props\n\n const submitted = useFormSubmitted()\n const { id, collectionSlug, globalSlug } = useDocumentInfo()\n const {\n fieldProps: {\n featureClientSchemaMap,\n field: parentLexicalRichTextField,\n initialLexicalFormState,\n schemaPath,\n },\n uuid: uuidFromContext,\n } = useEditorConfigContext()\n\n const { fields: parentDocumentFields } = useDocumentForm()\n const onChangeAbortControllerRef = useRef(new AbortController())\n const editDepth = useEditDepth()\n const [errorCount, setErrorCount] = React.useState(0)\n\n const { config } = useConfig()\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-blocks-create-${uuidFromContext}-${formData.id}`,\n depth: editDepth,\n })\n const { toggleDrawer } = useLexicalDrawer(drawerSlug)\n\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 const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n\n const blockType = formData.blockType\n\n const { getFormState } = useServerFunctions()\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.${blockType}.fields`\n\n const [initialState, setInitialState] = React.useState<false | FormState | undefined>(() => {\n // Initial form state that was calculated server-side. May have stale values\n const cachedFormState = initialLexicalFormState?.[formData.id]?.formState\n if (!cachedFormState) {\n return false\n }\n\n // Merge current formData values into the cached form state\n // This ensures that when the component remounts (e.g., due to view changes), we don't lose user edits\n const mergedState = Object.fromEntries(\n Object.entries(cachedFormState).map(([fieldName, fieldState]) => [\n fieldName,\n fieldName in formData\n ? {\n ...fieldState,\n initialValue: formData[fieldName],\n value: formData[fieldName],\n }\n : fieldState,\n ]),\n )\n\n // Manually add blockName, as it's not part of cachedFormState\n mergedState.blockName = {\n initialValue: formData.blockName,\n passesCondition: true,\n valid: true,\n value: formData.blockName,\n }\n\n return mergedState\n })\n\n const hasMounted = useRef(false)\n const prevCacheBuster = useRef(cacheBuster)\n useEffect(() => {\n if (hasMounted.current) {\n if (prevCacheBuster.current !== cacheBuster) {\n setInitialState(false)\n }\n prevCacheBuster.current = cacheBuster\n } else {\n hasMounted.current = true\n }\n }, [cacheBuster])\n\n const [formUuid] = React.useState(() => uuid())\n\n // Server-rendered custom components (from admin.components, NOT viewMap).\n // When viewMap components exist (CustomBlockFromProps/CustomLabelFromProps),\n // we render them directly with formData instead, so these states are unused.\n const [CustomLabel, setCustomLabel] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomLabelFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.BlockLabel ?? undefined\n })\n\n const [CustomBlock, setCustomBlock] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomBlockFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.Block ?? undefined\n })\n\n // When viewMap components exist, render directly with formData (always current from\n // the lexical node). When they don't, fall back to server-rendered state.\n const resolvedCustomBlock = useMemo(() => {\n if (CustomBlockFromProps) {\n return (\n <CustomBlockFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useBlockComponentContext={useBlockComponentContext}\n />\n )\n }\n return CustomBlock\n }, [CustomBlockFromProps, baseClass, formData, nodeKey, CustomBlock])\n\n const resolvedCustomLabel = useMemo(() => {\n if (CustomLabelFromProps) {\n return (\n <CustomLabelFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useBlockComponentContext={useBlockComponentContext}\n />\n )\n }\n return CustomLabel\n }, [CustomLabelFromProps, baseClass, formData, nodeKey, CustomLabel])\n\n // Initial state for newly created blocks\n useEffect(() => {\n const abortController = new AbortController()\n\n const awaitInitialState = async () => {\n /*\n * This will only run if a new block is created. For all existing blocks that are loaded when the document is loaded, or when the form is saved,\n * this is not run, as the lexical field RSC will fetch the state server-side and pass it to the client. That way, we avoid unnecessary client-side\n * requests. Though for newly created blocks, we need to fetch the state client-side, as the server doesn't know about the block yet.\n */\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: formData,\n docPermissions: { fields: true },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n globalSlug,\n initialBlockData: formData,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: abortController.signal,\n })\n\n if (state) {\n state.blockName = {\n initialValue: formData.blockName,\n passesCondition: true,\n valid: true,\n value: formData.blockName,\n }\n\n const newFormStateData: BlockFields = reduceFieldsToValues(\n deepCopyObjectSimpleWithoutReactComponents(state, { excludeFiles: true }),\n true,\n ) as BlockFields\n\n // Things like default values may come back from the server => update the node with the new data\n editor.update(() => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isBlockNode(node)) {\n const newData = newFormStateData\n newData.blockType = blockType\n\n node.setFields(newData, true)\n }\n })\n\n setInitialState(state)\n if (!CustomLabelFromProps) {\n setCustomLabel(state._components?.customComponents?.BlockLabel ?? undefined)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state._components?.customComponents?.Block ?? undefined)\n }\n }\n }\n\n if (formData && !initialState) {\n void awaitInitialState()\n }\n\n return () => {\n abortAndIgnore(abortController)\n }\n }, [\n getFormState,\n schemaFieldsPath,\n isEditable,\n id,\n CustomLabelFromProps,\n CustomBlockFromProps,\n formData,\n editor,\n nodeKey,\n initialState,\n collectionSlug,\n globalSlug,\n getDocPreferences,\n parentDocumentFields,\n blockType,\n ])\n\n const [isCollapsed, setIsCollapsed] = React.useState<boolean>(\n initialLexicalFormState?.[formData.id]?.collapsed ?? false,\n )\n\n const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.${blockType}`\n\n const clientSchemaMap = featureClientSchemaMap['blocks']\n\n const blocksField: BlocksFieldClient | undefined = clientSchemaMap?.[\n componentMapRenderedBlockPath\n ]?.[0] as BlocksFieldClient\n\n const clientBlock: ClientBlock | undefined = blocksField.blockReferences\n ? typeof blocksField?.blockReferences?.[0] === 'string'\n ? config.blocksMap[blocksField?.blockReferences?.[0]]\n : blocksField?.blockReferences?.[0]\n : blocksField?.blocks?.[0]\n\n const { i18n, t } = useTranslation<object, string>()\n\n const onChange = useCallback(\n async ({ formState: prevFormState, submit }: { formState: FormState; submit?: boolean }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state: newFormState } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n formState: prevFormState,\n globalSlug,\n initialBlockFormState: prevFormState,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: submit ? true : false,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!newFormState) {\n return prevFormState\n }\n\n if (prevFormState.blockName) {\n newFormState.blockName = prevFormState.blockName\n }\n\n const newFormStateData: BlockFields = reduceFieldsToValues(\n removeEmptyArrayValues({\n fields: deepCopyObjectSimpleWithoutReactComponents(newFormState, { excludeFiles: true }),\n }),\n true,\n ) as BlockFields\n\n setTimeout(() => {\n editor.update(() => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isBlockNode(node)) {\n const newData = newFormStateData\n newData.blockType = blockType\n node.setFields(newData, true)\n }\n })\n }, 0)\n\n if (submit) {\n if (!CustomLabelFromProps) {\n setCustomLabel(newFormState._components?.customComponents?.BlockLabel ?? undefined)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(newFormState._components?.customComponents?.Block ?? undefined)\n }\n\n let rowErrorCount = 0\n for (const formField of Object.values(newFormState)) {\n if (formField?.valid === false) {\n rowErrorCount++\n }\n }\n setErrorCount(rowErrorCount)\n }\n\n return newFormState\n },\n\n [\n getFormState,\n id,\n collectionSlug,\n getDocPreferences,\n globalSlug,\n schemaFieldsPath,\n blockType,\n parentDocumentFields,\n isEditable,\n editor,\n nodeKey,\n CustomBlockFromProps,\n CustomLabelFromProps,\n ],\n )\n\n useEffect(() => {\n return () => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [])\n\n const removeBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const blockDisplayName = clientBlock?.labels?.singular\n ? getTranslation(clientBlock.labels.singular, i18n)\n : clientBlock?.slug\n\n const onCollapsedChange = useCallback(\n (changedCollapsed: boolean) => {\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences =\n currentDocPreferences?.fields?.[parentLexicalRichTextField.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(parentLexicalRichTextField.name, {\n collapsed: newCollapsed,\n hello: 'hi',\n })\n })\n },\n [getDocPreferences, parentLexicalRichTextField.name, setDocFieldPreferences, formData.id],\n )\n\n const EditButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__editButton`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"edit\"\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n toggleDrawer()\n return false\n }}\n onMouseDown={(e) => {\n // Needed to preserve lexical selection for toggleDrawer lexical selection restore.\n // I believe this is needed due to this button (usually) being inside of a collapsible.\n e.preventDefault()\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\n />\n ),\n [baseClass, isEditable, t, blockDisplayName, toggleDrawer],\n )\n\n const RemoveButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeBlock()\n }}\n round\n tooltip=\"Remove Block\"\n />\n ),\n [baseClass, isEditable, removeBlock],\n )\n\n const BlockCollapsible = useMemo(\n () =>\n ({\n Actions,\n children,\n className,\n collapsibleProps,\n disableBlockName,\n editButton,\n errorCount,\n fieldHasErrors,\n Label,\n Pill: CustomPill,\n removeButton,\n }: BlockCollapsibleWithErrorProps) => {\n return (\n <div className={`${baseClass}__container ${baseClass}-${blockType}`}>\n <Collapsible\n className={[\n `${baseClass}__row`,\n fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n header={\n <div className={`${baseClass}__block-header`}>\n {typeof Label !== 'undefined' ? (\n Label\n ) : typeof resolvedCustomLabel !== 'undefined' ? (\n resolvedCustomLabel\n ) : (\n <div className={`${baseClass}__block-label`}>\n {typeof CustomPill !== 'undefined' ? (\n CustomPill\n ) : (\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${blockType}`}\n pillStyle=\"white\"\n size=\"small\"\n >\n {blockDisplayName ?? blockType}\n </Pill>\n )}\n {!disableBlockName && !clientBlock?.admin?.disableBlockName && (\n <SectionTitle path=\"blockName\" readOnly={!isEditable} />\n )}\n\n {fieldHasErrors && (\n <ErrorPill count={errorCount ?? 0} i18n={i18n} withMessage />\n )}\n </div>\n )}\n\n <div className={`${baseClass}__block-actions`}>\n {typeof Actions !== 'undefined' ? (\n Actions\n ) : (\n <>\n {(resolvedCustomBlock && editButton !== false) ||\n (!resolvedCustomBlock && editButton) ? (\n <EditButton />\n ) : null}\n {removeButton !== false && isEditable ? <RemoveButton /> : null}\n </>\n )}\n </div>\n </div>\n }\n isCollapsed={isCollapsed}\n key={0}\n onToggle={(incomingCollapsedState) => {\n onCollapsedChange(incomingCollapsedState)\n setIsCollapsed(incomingCollapsedState)\n }}\n {...(collapsibleProps || {})}\n >\n {children}\n </Collapsible>\n </div>\n )\n },\n [\n resolvedCustomBlock,\n resolvedCustomLabel,\n EditButton,\n RemoveButton,\n blockDisplayName,\n baseClass,\n clientBlock?.admin?.disableBlockName,\n blockType,\n i18n,\n isCollapsed,\n onCollapsedChange,\n isEditable,\n ],\n )\n\n const blockID = formData?.id\n\n const BlockDrawer = useMemo(\n () => () => (\n <EditDepthProvider>\n <Drawer\n className={''}\n slug={drawerSlug}\n title={t(`lexical:blocks:inlineBlocks:${blockID ? 'edit' : 'create'}`, {\n label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label'),\n })}\n >\n {initialState ? (\n <>\n <RenderFields\n fields={clientBlock?.fields ?? []}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={true}\n readOnly={!isEditable}\n />\n <FormSubmit programmaticSubmit={true}>{t('fields:saveChanges')}</FormSubmit>\n </>\n ) : null}\n </Drawer>\n </EditDepthProvider>\n ),\n [\n initialState,\n drawerSlug,\n blockID,\n blockDisplayName,\n t,\n isEditable,\n clientBlock?.fields,\n schemaFieldsPath,\n // DO NOT ADD FORMDATA HERE! Adding formData will kick you out of sub block editors while writing.\n ],\n )\n\n // Memoized Form JSX\n const Block = useMemo(() => {\n if (!initialState) {\n return null\n }\n return (\n <div data-block-drawer-slug={drawerSlug} style={{ display: 'contents' }}>\n <Form\n beforeSubmit={[\n async ({ formState }) => {\n // This is only called when form is submitted from drawer - usually only the case if the block has a custom Block component\n return await onChange({ formState, submit: true })\n },\n ]}\n el=\"div\"\n fields={clientBlock?.fields ?? []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={(formState, newData) => {\n // This is only called when form is submitted from drawer - usually only the case if the block has a custom Block component\n newData.blockType = blockType\n editor.update(() => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isBlockNode(node)) {\n node.setFields(newData as BlockFields, true)\n }\n })\n toggleDrawer()\n }}\n submitted={submitted}\n uuid={formUuid}\n >\n <BlockContent\n baseClass={baseClass}\n BlockDrawer={BlockDrawer}\n Collapsible={BlockCollapsible}\n CustomBlock={resolvedCustomBlock}\n CustomLabel={resolvedCustomLabel}\n EditButton={EditButton}\n errorCount={errorCount}\n formSchema={clientBlock?.fields ?? []}\n initialState={initialState}\n nodeKey={nodeKey}\n RemoveButton={RemoveButton}\n />\n </Form>\n </div>\n )\n }, [\n BlockCollapsible,\n BlockDrawer,\n resolvedCustomBlock,\n resolvedCustomLabel,\n blockType,\n drawerSlug,\n RemoveButton,\n EditButton,\n baseClass,\n editor,\n errorCount,\n toggleDrawer,\n clientBlock?.fields,\n formUuid,\n initialState,\n nodeKey,\n onChange,\n submitted,\n ])\n\n if (!clientBlock) {\n return (\n <BlockCollapsible disableBlockName={true} fieldHasErrors={true}>\n <div className={`${baseClass}-not-found`}>\n Error: Block '{blockType}' not found in the config but exists in the lexical data\n </div>\n </BlockCollapsible>\n )\n }\n\n return Block\n}\n"],"mappings":"AAAA;;;AAEA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SACEC,MAAM,EACNC,WAAW,EACXC,MAAM,EACNC,iBAAiB,EACjBC,SAAS,EACTC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,EACVC,IAAI,EACJC,YAAY,EACZC,YAAY,EACZC,SAAS,EACTC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,gBAAgB,EAChBC,kBAAkB,EAClBC,cAAc,QACT;AACP,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,QAAQ;AAO9B,SAASC,0CAA0C,EAAEC,oBAAoB,QAAQ;AACjF,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ;AAC/D,SAASC,EAAA,IAAMC,IAAI,QAAQ;AAM3B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,YAAY,QAAQ;AAC7B,SAEEC,YAAY,EACZC,wBAAwB,QACnB;AACP,SAASC,sBAAsB,QAAQ;AA8BvC,OAAO,MAAMC,cAAA,GAAiDC,KAAA;EAC5D,MAAM;IACJC,WAAW;IACXC,SAAA,EAAWC,SAAS;IACpBC,WAAA,EAAaC,oBAAoB;IACjCC,WAAA,EAAa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alComposerContext","useLexicalEditable","getTranslation","Button","Collapsible","Drawer","EditDepthProvider","ErrorPill","Form","formatDrawerSlug","FormSubmit","MoreIcon","Pill","Popup","PopupList","RenderFields","SectionTitle","useConfig","useDocumentForm","useDocumentInfo","useEditDepth","useFormSubmitted","useServerFunctions","useTranslation","XIcon","abortAndIgnore","$getNodeByKey","$getRoot","SKIP_DOM_SELECTION_TAG","deepCopyObjectSimpleWithoutReactComponents","reduceFieldsToValues","React","useCallback","useEffect","useMemo","useRef","v4","uuid","useEditorConfigContext","useLexicalDrawer","$isBlockNode","BlockContent","useBlockComponentContext","removeEmptyArrayValues","BlockComponent","props","cacheBuster","className","baseClass","CustomBlock","CustomBlockFromProps","CustomLabel","CustomLabelFromProps","formData","nodeKey","submitted","id","collectionSlug","globalSlug","fieldProps","featureClientSchemaMap","field","parentLexicalRichTextField","initialLexicalFormState","schemaPath","uuidFromContext","fields","parentDocumentFields","onChangeAbortControllerRef","AbortController","editDepth","errorCount","setErrorCount","useState","config","drawerSlug","slug","depth","toggleDrawer","getDocPreferences","setDocFieldPreferences","editor","isEditable","blockType","getFormState","schemaFieldsPath","initialState","setInitialState","cachedFormState","formState","mergedState","Object","fromEntries","entries","map","fieldName","fieldState","initialValue","value","blockName","passesCondition","valid","hasMounted","prevCacheBuster","current","formUuid","setCustomLabel","undefined","customComponents","BlockLabel","setCustomBlock","Block","resolvedCustomBlock","_jsx","isEditor","isJSXConverter","resolvedCustomLabel","abortController","awaitInitialState","state","data","docPermissions","docPreferences","documentFormState","excludeFiles","initialBlockData","operation","readOnly","renderAllFields","signal","newFormStateData","update","node","newData","setFields","tag","_components","isCollapsed","setIsCollapsed","collapsed","componentMapRenderedBlockPath","clientSchemaMap","blocksField","clientBlock","blockReferences","blocksMap","blocks","i18n","t","onChange","prevFormState","submit","controller","newFormState","initialBlockFormState","setTimeout","rowErrorCount","formField","values","removeBlock","remove","rowIndex","setRowIndex","updateIndex","getEditorState","read","root","children","getChildren","blockCount","child","getKey","registerUpdateListener","blockDisplayName","labels","singular","onCollapsedChange","changedCollapsed","then","currentDocPreferences","currentFieldPreferences","name","collapsedArray","newCollapsed","length","includes","push","splice","indexOf","hello","EditButton","buttonStyle","disabled","el","icon","onClick","e","preventDefault","stopPropagation","onMouseDown","round","size","tooltip","label","RemoveButton","BlockCollapsible","Actions","collapsibleProps","disableBlockName","editButton","fieldHasErrors","Label","CustomPill","removeButton","showDragHandle","showRowNumber","actions","button","buttonClassName","caret","horizontalAlign","render","close","_jsxs","ButtonGroup","buttonSize","filter","Boolean","join","collapsibleStyle","dragHandleProps","attributes","role","tabIndex","listeners","header","String","padStart","pillStyle","admin","path","count","withMessage","onToggle","incomingCollapsedState","blockID","BlockDrawer","title","_Fragment","forceRender","parentIndexPath","parentPath","parentSchemaPath","permissions","programmaticSubmit","style","display","beforeSubmit","onSubmit","formSchema"],"sources":["../../../../../src/features/blocks/client/component/index.tsx"],"sourcesContent":["'use client'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Collapsible,\n Drawer,\n EditDepthProvider,\n ErrorPill,\n Form,\n formatDrawerSlug,\n FormSubmit,\n MoreIcon,\n Pill,\n Popup,\n PopupList,\n RenderFields,\n SectionTitle,\n useConfig,\n useDocumentForm,\n useDocumentInfo,\n useEditDepth,\n useFormSubmitted,\n useServerFunctions,\n useTranslation,\n XIcon,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { $getNodeByKey, $getRoot, SKIP_DOM_SELECTION_TAG } from 'lexical'\nimport {\n type BlocksFieldClient,\n type ClientBlock,\n type CollapsedPreferences,\n type FormState,\n} from 'payload'\nimport { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from 'payload/shared'\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { ViewMapBlockComponentProps } from '../../../../types.js'\nimport type { BlockFields } from '../../server/nodes/BlocksNode.js'\n\nimport './index.css'\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { $isBlockNode } from '../nodes/BlocksNode.js'\nimport {\n type BlockCollapsibleWithErrorProps,\n BlockContent,\n useBlockComponentContext,\n} from './BlockContent.js'\nimport { removeEmptyArrayValues } from './removeEmptyArrayValues.js'\n\nexport type BlockComponentProps<TFormData extends Record<string, unknown> = BlockFields> = {\n /**\n * Can be modified by the node in order to trigger the re-fetch of the initial state based on the\n * formData. This is useful when node.setFields() is explicitly called from outside of the form - in\n * this case, the new field state is likely not reflected in the form state, so we need to re-fetch\n */\n readonly cacheBuster: number\n readonly className: string\n /**\n * Custom block component from view map\n * Will be rendered with useBlockComponentContext hook.\n */\n readonly CustomBlock?: React.FC<ViewMapBlockComponentProps>\n /**\n * Custom block label from view map\n * Will be rendered with useBlockComponentContext hook.\n */\n readonly CustomLabel?: React.FC<ViewMapBlockComponentProps>\n /**\n * The block's form data (field values).\n */\n readonly formData: TFormData\n /**\n * The unique key identifying this block node in the current editor instance.\n */\n readonly nodeKey: string\n}\n\nexport const BlockComponent: React.FC<BlockComponentProps> = (props) => {\n const {\n cacheBuster,\n className: baseClass,\n CustomBlock: CustomBlockFromProps,\n CustomLabel: CustomLabelFromProps,\n formData,\n nodeKey,\n } = props\n\n const submitted = useFormSubmitted()\n const { id, collectionSlug, globalSlug } = useDocumentInfo()\n const {\n fieldProps: {\n featureClientSchemaMap,\n field: parentLexicalRichTextField,\n initialLexicalFormState,\n schemaPath,\n },\n uuid: uuidFromContext,\n } = useEditorConfigContext()\n\n const { fields: parentDocumentFields } = useDocumentForm()\n const onChangeAbortControllerRef = useRef(new AbortController())\n const editDepth = useEditDepth()\n const [errorCount, setErrorCount] = React.useState(0)\n\n const { config } = useConfig()\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-blocks-create-${uuidFromContext}-${formData.id}`,\n depth: editDepth,\n })\n const { toggleDrawer } = useLexicalDrawer(drawerSlug)\n\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 const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n\n const blockType = formData.blockType\n\n const { getFormState } = useServerFunctions()\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.${blockType}.fields`\n\n const [initialState, setInitialState] = React.useState<false | FormState | undefined>(() => {\n // Initial form state that was calculated server-side. May have stale values\n const cachedFormState = initialLexicalFormState?.[formData.id]?.formState\n if (!cachedFormState) {\n return false\n }\n\n // Merge current formData values into the cached form state\n // This ensures that when the component remounts (e.g., due to view changes), we don't lose user edits\n const mergedState = Object.fromEntries(\n Object.entries(cachedFormState).map(([fieldName, fieldState]) => [\n fieldName,\n fieldName in formData\n ? {\n ...fieldState,\n initialValue: formData[fieldName],\n value: formData[fieldName],\n }\n : fieldState,\n ]),\n )\n\n // Manually add blockName, as it's not part of cachedFormState\n mergedState.blockName = {\n initialValue: formData.blockName,\n passesCondition: true,\n valid: true,\n value: formData.blockName,\n }\n\n return mergedState\n })\n\n const hasMounted = useRef(false)\n const prevCacheBuster = useRef(cacheBuster)\n useEffect(() => {\n if (hasMounted.current) {\n if (prevCacheBuster.current !== cacheBuster) {\n setInitialState(false)\n }\n prevCacheBuster.current = cacheBuster\n } else {\n hasMounted.current = true\n }\n }, [cacheBuster])\n\n const [formUuid] = React.useState(() => uuid())\n\n // Server-rendered custom components (from admin.components, NOT viewMap).\n // When viewMap components exist (CustomBlockFromProps/CustomLabelFromProps),\n // we render them directly with formData instead, so these states are unused.\n const [CustomLabel, setCustomLabel] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomLabelFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.BlockLabel ?? undefined\n })\n\n const [CustomBlock, setCustomBlock] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomBlockFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.Block ?? undefined\n })\n\n // When viewMap components exist, render directly with formData (always current from\n // the lexical node). When they don't, fall back to server-rendered state.\n const resolvedCustomBlock = useMemo(() => {\n if (CustomBlockFromProps) {\n return (\n <CustomBlockFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useBlockComponentContext={useBlockComponentContext}\n />\n )\n }\n return CustomBlock\n }, [CustomBlockFromProps, baseClass, formData, nodeKey, CustomBlock])\n\n const resolvedCustomLabel = useMemo(() => {\n if (CustomLabelFromProps) {\n return (\n <CustomLabelFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useBlockComponentContext={useBlockComponentContext}\n />\n )\n }\n return CustomLabel\n }, [CustomLabelFromProps, baseClass, formData, nodeKey, CustomLabel])\n\n // Initial state for newly created blocks\n useEffect(() => {\n const abortController = new AbortController()\n\n const awaitInitialState = async () => {\n /*\n * This will only run if a new block is created. For all existing blocks that are loaded when the document is loaded, or when the form is saved,\n * this is not run, as the lexical field RSC will fetch the state server-side and pass it to the client. That way, we avoid unnecessary client-side\n * requests. Though for newly created blocks, we need to fetch the state client-side, as the server doesn't know about the block yet.\n */\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: formData,\n docPermissions: { fields: true },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n globalSlug,\n initialBlockData: formData,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: abortController.signal,\n })\n\n if (state) {\n state.blockName = {\n initialValue: formData.blockName,\n passesCondition: true,\n valid: true,\n value: formData.blockName,\n }\n\n const newFormStateData: BlockFields = reduceFieldsToValues(\n deepCopyObjectSimpleWithoutReactComponents(state, { excludeFiles: true }),\n true,\n ) as BlockFields\n\n // Things like default values may come back from the server => update the node with the new data\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isBlockNode(node)) {\n const newData = newFormStateData\n newData.blockType = blockType\n\n node.setFields(newData, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n\n setInitialState(state)\n if (!CustomLabelFromProps) {\n setCustomLabel(state._components?.customComponents?.BlockLabel ?? undefined)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state._components?.customComponents?.Block ?? undefined)\n }\n }\n }\n\n if (formData && !initialState) {\n void awaitInitialState()\n }\n\n return () => {\n abortAndIgnore(abortController)\n }\n }, [\n getFormState,\n schemaFieldsPath,\n isEditable,\n id,\n CustomLabelFromProps,\n CustomBlockFromProps,\n formData,\n editor,\n nodeKey,\n initialState,\n collectionSlug,\n globalSlug,\n getDocPreferences,\n parentDocumentFields,\n blockType,\n ])\n\n const [isCollapsed, setIsCollapsed] = React.useState<boolean>(\n initialLexicalFormState?.[formData.id]?.collapsed ?? false,\n )\n\n const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.${blockType}`\n\n const clientSchemaMap = featureClientSchemaMap['blocks']\n\n const blocksField: BlocksFieldClient | undefined = clientSchemaMap?.[\n componentMapRenderedBlockPath\n ]?.[0] as BlocksFieldClient\n\n const clientBlock: ClientBlock | undefined = blocksField.blockReferences\n ? typeof blocksField?.blockReferences?.[0] === 'string'\n ? config.blocksMap[blocksField?.blockReferences?.[0]]\n : blocksField?.blockReferences?.[0]\n : blocksField?.blocks?.[0]\n\n const { i18n, t } = useTranslation<object, string>()\n\n const onChange = useCallback(\n async ({ formState: prevFormState, submit }: { formState: FormState; submit?: boolean }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state: newFormState } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n formState: prevFormState,\n globalSlug,\n initialBlockFormState: prevFormState,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: submit ? true : false,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!newFormState) {\n return prevFormState\n }\n\n if (prevFormState.blockName) {\n newFormState.blockName = prevFormState.blockName\n }\n\n const newFormStateData: BlockFields = reduceFieldsToValues(\n removeEmptyArrayValues({\n fields: deepCopyObjectSimpleWithoutReactComponents(newFormState, { excludeFiles: true }),\n }),\n true,\n ) as BlockFields\n\n setTimeout(() => {\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isBlockNode(node)) {\n const newData = newFormStateData\n newData.blockType = blockType\n node.setFields(newData, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n }, 0)\n\n if (submit) {\n if (!CustomLabelFromProps) {\n setCustomLabel(newFormState._components?.customComponents?.BlockLabel ?? undefined)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(newFormState._components?.customComponents?.Block ?? undefined)\n }\n\n let rowErrorCount = 0\n for (const formField of Object.values(newFormState)) {\n if (formField?.valid === false) {\n rowErrorCount++\n }\n }\n setErrorCount(rowErrorCount)\n }\n\n return newFormState\n },\n\n [\n getFormState,\n id,\n collectionSlug,\n getDocPreferences,\n globalSlug,\n schemaFieldsPath,\n blockType,\n parentDocumentFields,\n isEditable,\n editor,\n nodeKey,\n CustomBlockFromProps,\n CustomLabelFromProps,\n ],\n )\n\n useEffect(() => {\n return () => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [])\n\n const removeBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const [rowIndex, setRowIndex] = React.useState<number>(0)\n\n useEffect(() => {\n const updateIndex = () => {\n editor.getEditorState().read(() => {\n const root = $getRoot()\n const children = root.getChildren()\n let blockCount = 0\n for (const child of children) {\n if ($isBlockNode(child)) {\n if (child.getKey() === nodeKey) {\n setRowIndex(blockCount)\n return\n }\n blockCount++\n }\n }\n })\n }\n updateIndex()\n return editor.registerUpdateListener(() => {\n updateIndex()\n })\n }, [editor, nodeKey])\n\n const blockDisplayName = clientBlock?.labels?.singular\n ? getTranslation(clientBlock.labels.singular, i18n)\n : clientBlock?.slug\n\n const onCollapsedChange = useCallback(\n (changedCollapsed: boolean) => {\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences =\n currentDocPreferences?.fields?.[parentLexicalRichTextField.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(parentLexicalRichTextField.name, {\n collapsed: newCollapsed,\n hello: 'hi',\n })\n })\n },\n [getDocPreferences, parentLexicalRichTextField.name, setDocFieldPreferences, formData.id],\n )\n\n const EditButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__editButton`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"edit\"\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n toggleDrawer()\n return false\n }}\n onMouseDown={(e) => {\n // Needed to preserve lexical selection for toggleDrawer lexical selection restore.\n // I believe this is needed due to this button (usually) being inside of a collapsible.\n e.preventDefault()\n }}\n round\n size=\"medium\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\n />\n ),\n [baseClass, isEditable, t, blockDisplayName, toggleDrawer],\n )\n\n const RemoveButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeBlock()\n }}\n round\n tooltip=\"Remove Block\"\n />\n ),\n [baseClass, isEditable, removeBlock],\n )\n\n const BlockCollapsible = useMemo(\n () =>\n ({\n Actions,\n children,\n className,\n collapsibleProps,\n disableBlockName,\n editButton,\n errorCount,\n fieldHasErrors,\n Label,\n Pill: CustomPill,\n removeButton,\n showDragHandle = true,\n showRowNumber = true,\n }: BlockCollapsibleWithErrorProps) => {\n return (\n <div className={`${baseClass}__container ${baseClass}-${blockType}`}>\n <Collapsible\n actions={\n typeof Actions !== 'undefined' ? (\n Actions\n ) : isEditable ? (\n <Popup\n button={<MoreIcon />}\n buttonClassName={`${baseClass}__actions-button`}\n caret={false}\n horizontalAlign=\"right\"\n render={({ close }) => (\n <PopupList.ButtonGroup buttonSize=\"medium\">\n {((resolvedCustomBlock && editButton !== false) ||\n (!resolvedCustomBlock && editButton)) && (\n <PopupList.Button\n onClick={() => {\n toggleDrawer()\n close()\n }}\n >\n {t('general:edit')}\n </PopupList.Button>\n )}\n {removeButton !== false && (\n <PopupList.Button\n onClick={() => {\n removeBlock()\n close()\n }}\n >\n <XIcon />\n {t('general:remove')}\n </PopupList.Button>\n )}\n </PopupList.ButtonGroup>\n )}\n size=\"large\"\n />\n ) : null\n }\n className={[\n `${baseClass}__row`,\n fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n dragHandleProps={\n showDragHandle\n ? {\n id: nodeKey,\n attributes: { role: 'button', tabIndex: 0 },\n listeners: {},\n }\n : undefined\n }\n header={\n <div className={`${baseClass}__block-header`}>\n {typeof Label !== 'undefined' ? (\n Label\n ) : typeof resolvedCustomLabel !== 'undefined' ? (\n resolvedCustomLabel\n ) : (\n <div className={`${baseClass}__block-label`}>\n {showRowNumber && (\n <span className={`${baseClass}__block-number`}>\n {String(rowIndex + 1).padStart(2, '0')}\n </span>\n )}\n {typeof CustomPill !== 'undefined' ? (\n CustomPill\n ) : (\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${blockType}`}\n pillStyle=\"white\"\n size=\"small\"\n >\n {blockDisplayName ?? blockType}\n </Pill>\n )}\n {!disableBlockName && !clientBlock?.admin?.disableBlockName && (\n <SectionTitle path=\"blockName\" readOnly={!isEditable} />\n )}\n\n {fieldHasErrors && (\n <ErrorPill count={errorCount ?? 0} i18n={i18n} withMessage />\n )}\n </div>\n )}\n </div>\n }\n isCollapsed={isCollapsed}\n key={0}\n onToggle={(incomingCollapsedState) => {\n onCollapsedChange(incomingCollapsedState)\n setIsCollapsed(incomingCollapsedState)\n }}\n {...(collapsibleProps || {})}\n >\n {children}\n </Collapsible>\n </div>\n )\n },\n [\n resolvedCustomBlock,\n resolvedCustomLabel,\n blockDisplayName,\n baseClass,\n clientBlock?.admin?.disableBlockName,\n blockType,\n i18n,\n isCollapsed,\n onCollapsedChange,\n isEditable,\n nodeKey,\n removeBlock,\n rowIndex,\n t,\n toggleDrawer,\n ],\n )\n\n const blockID = formData?.id\n\n const BlockDrawer = useMemo(\n () => () => (\n <EditDepthProvider>\n <Drawer\n className={''}\n slug={drawerSlug}\n title={t(`lexical:blocks:inlineBlocks:${blockID ? 'edit' : 'create'}`, {\n label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label'),\n })}\n >\n {initialState ? (\n <>\n <RenderFields\n fields={clientBlock?.fields ?? []}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={true}\n readOnly={!isEditable}\n />\n <FormSubmit programmaticSubmit={true}>{t('fields:saveChanges')}</FormSubmit>\n </>\n ) : null}\n </Drawer>\n </EditDepthProvider>\n ),\n [\n initialState,\n drawerSlug,\n blockID,\n blockDisplayName,\n t,\n isEditable,\n clientBlock?.fields,\n schemaFieldsPath,\n // DO NOT ADD FORMDATA HERE! Adding formData will kick you out of sub block editors while writing.\n ],\n )\n\n // Memoized Form JSX\n const Block = useMemo(() => {\n if (!initialState) {\n return null\n }\n return (\n <div data-block-drawer-slug={drawerSlug} style={{ display: 'contents' }}>\n <Form\n beforeSubmit={[\n async ({ formState }) => {\n // This is only called when form is submitted from drawer - usually only the case if the block has a custom Block component\n return await onChange({ formState, submit: true })\n },\n ]}\n el=\"div\"\n fields={clientBlock?.fields ?? []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={(formState, newData) => {\n // This is only called when form is submitted from drawer - usually only the case if the block has a custom Block component\n newData.blockType = blockType\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isBlockNode(node)) {\n node.setFields(newData as BlockFields, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n toggleDrawer()\n }}\n submitted={submitted}\n uuid={formUuid}\n >\n <BlockContent\n baseClass={baseClass}\n BlockDrawer={BlockDrawer}\n Collapsible={BlockCollapsible}\n CustomBlock={resolvedCustomBlock}\n CustomLabel={resolvedCustomLabel}\n EditButton={EditButton}\n errorCount={errorCount}\n formSchema={clientBlock?.fields ?? []}\n initialState={initialState}\n nodeKey={nodeKey}\n RemoveButton={RemoveButton}\n />\n </Form>\n </div>\n )\n }, [\n BlockCollapsible,\n BlockDrawer,\n resolvedCustomBlock,\n resolvedCustomLabel,\n blockType,\n drawerSlug,\n RemoveButton,\n EditButton,\n baseClass,\n editor,\n errorCount,\n toggleDrawer,\n clientBlock?.fields,\n formUuid,\n initialState,\n nodeKey,\n onChange,\n submitted,\n ])\n\n if (!clientBlock) {\n return (\n <BlockCollapsible disableBlockName={true} fieldHasErrors={true}>\n <div className={`${baseClass}-not-found`}>\n Error: Block '{blockType}' not found in the config but exists in the lexical data\n </div>\n </BlockCollapsible>\n )\n }\n\n return Block\n}\n"],"mappings":"AAAA;;;AAEA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SACEC,MAAM,EACNC,WAAW,EACXC,MAAM,EACNC,iBAAiB,EACjBC,SAAS,EACTC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,EACVC,QAAQ,EACRC,IAAI,EACJC,KAAK,EACLC,SAAS,EACTC,YAAY,EACZC,YAAY,EACZC,SAAS,EACTC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,gBAAgB,EAChBC,kBAAkB,EAClBC,cAAc,EACdC,KAAK,QACA;AACP,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,EAAEC,QAAQ,EAAEC,sBAAsB,QAAQ;AAOhE,SAASC,0CAA0C,EAAEC,oBAAoB,QAAQ;AACjF,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ;AAC/D,SAASC,EAAA,IAAMC,IAAI,QAAQ;AAK3B,OAAO;AACP,SAASC,sBAAsB,QAAQ;AACvC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,YAAY,QAAQ;AAC7B,SAEEC,YAAY,EACZC,wBAAwB,QACnB;AACP,SAASC,sBAAsB,QAAQ;AA8BvC,OAAO,MAAMC,cAAA,GAAiDC,KAAA;EAC5D,MAAM;IACJC,WAAW;IACXC,SAAA,EAAWC,SAAS;IACpBC,WAAA,EAAaC,oBAAoB;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EAAa7E,MAAA,EACbuC,QAAA,EACAnB,YAAA,EACAhC,OAAA,EACA+F,QAAA,EACA9F,SAAA,CACD;EAED,IAAI,CAACwF,WAAA,EAAa;IAChB,oBACE9B,IAAA,CAAC4F,gBAAA;MAAiBG,gBAAA,EAAkB;MAAME,cAAA,EAAgB;gBACxD,aAAAa,KAAA,CAAC;QAAIhL,SAAA,EAAW,GAAGC,SAAA,YAAqB;mBAAE,kBACzBmC,SAAA,EAAU;;;EAIjC;EAEA,OAAO4B,KAAA;AACT","ignoreList":[]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
@layer payload-default {
|
|
2
|
+
.LexicalEditorTheme__inlineBlock {
|
|
3
|
+
--inline-block-max-width: 18rem;
|
|
4
|
+
--inline-block-not-found-max-width: 25rem;
|
|
5
|
+
display: inline-block;
|
|
6
|
+
|
|
7
|
+
&.decorator-selected {
|
|
8
|
+
box-shadow: unset !important;
|
|
9
|
+
outline: unset !important;
|
|
10
|
+
|
|
11
|
+
.LexicalEditorTheme__inlineBlock__container {
|
|
12
|
+
box-shadow: 0 0 0 2px var(--color-border-selected);
|
|
13
|
+
outline: none;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&::selection {
|
|
18
|
+
background: transparent;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.LexicalEditorTheme__inlineBlock__container {
|
|
23
|
+
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
|
|
24
|
+
margin-right: var(--spacer-1);
|
|
25
|
+
margin-left: var(--spacer-1);
|
|
26
|
+
padding: 0;
|
|
27
|
+
padding-inline-start: var(--spacer-2);
|
|
28
|
+
background: var(--color-bg);
|
|
29
|
+
outline: var(--stroke-width-small) solid var(--color-border);
|
|
30
|
+
border-radius: var(--radius-medium);
|
|
31
|
+
max-width: var(--inline-block-max-width);
|
|
32
|
+
font-family: var(--font-body);
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
outline: var(--stroke-width-small) solid var(--color-border);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.LexicalEditorTheme__inlineBlock-not-found {
|
|
43
|
+
max-width: var(--inline-block-not-found-max-width);
|
|
44
|
+
color: var(--color-text-danger);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.LexicalEditorTheme__inlineBlock__wrap {
|
|
48
|
+
flex-grow: 1;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.LexicalEditorTheme__inlineBlock__actions {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
|
|
56
|
+
& > .btn {
|
|
57
|
+
width: (var(--spacer-3));
|
|
58
|
+
height: (var(--spacer-3));
|
|
59
|
+
margin: 2px;
|
|
60
|
+
|
|
61
|
+
&:not(:disabled):hover {
|
|
62
|
+
background: var(--color-bg-hover);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
& > * {
|
|
66
|
+
height: 100%;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.LexicalEditorTheme__inlineBlock__removeButton.btn {
|
|
72
|
+
padding: 0;
|
|
73
|
+
margin: 2px;
|
|
74
|
+
color: var(--color-icon-secondary);
|
|
75
|
+
|
|
76
|
+
line {
|
|
77
|
+
stroke-width: var(--stroke-width-small);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&:disabled {
|
|
81
|
+
color: var(--color-icon-tertiary);
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FormState } from 'payload';
|
|
2
|
-
import './index.
|
|
2
|
+
import './index.css';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import type { ViewMapInlineBlockComponentProps } from '../../../../types.js';
|
|
5
5
|
import type { InlineBlockFields } from '../../server/nodes/InlineBlocksNode.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/componentInline/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAwC,SAAS,EAAE,MAAM,SAAS,CAAA;AAwB9E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/componentInline/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAwC,SAAS,EAAE,MAAM,SAAS,CAAA;AAwB9E,OAAO,aAAa,CAAA;AAGpB,OAAO,KAAiE,MAAM,OAAO,CAAA;AAGrF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAA;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAMhE,MAAM,MAAM,yBAAyB,CACnC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,iBAAiB,IAC3D;IACF,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,gCAAgC,CAAC,CAAA;IACjE,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,gCAAgC,CAAC,CAAA;CAClE,GAAG,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC,CAAA;AAE9F,MAAM,MAAM,+BAA+B,GAAG;IAC5C,UAAU,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACrB,YAAY,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAAA;IAC3C,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,CAAC,CAAA;IAC9D,KAAK,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;CACxB,CAAA;AAMD,eAAO,MAAM,8BAA8B,uCAA+C,CAAA;AAE1F,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,CA8fvF,CAAA"}
|
|
@@ -6,7 +6,8 @@ import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
|
|
|
6
6
|
import { getTranslation } from '@payloadcms/translations';
|
|
7
7
|
import { Button, Drawer, EditDepthProvider, Form, formatDrawerSlug, FormSubmit, RenderFields, ShimmerEffect, useConfig, useDocumentForm, useDocumentInfo, useEditDepth, useServerFunctions, useTranslation } from '@payloadcms/ui';
|
|
8
8
|
import { abortAndIgnore } from '@payloadcms/ui/shared';
|
|
9
|
-
import { $getNodeByKey } from 'lexical';
|
|
9
|
+
import { $getNodeByKey, SKIP_DOM_SELECTION_TAG } from 'lexical';
|
|
10
|
+
import './index.css';
|
|
10
11
|
import { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from 'payload/shared';
|
|
11
12
|
import React, { createContext, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
12
13
|
import { v4 as uuid } from 'uuid';
|
|
@@ -205,6 +206,11 @@ export const InlineBlockComponent = props => {
|
|
|
205
206
|
newData.blockType = formData.blockType;
|
|
206
207
|
node.setFields(newData, true);
|
|
207
208
|
}
|
|
209
|
+
},
|
|
210
|
+
// Without this, the outer editor's reconciler resets DOM selection
|
|
211
|
+
// back into its own root, kicking focus out of any nested richText.
|
|
212
|
+
{
|
|
213
|
+
tag: SKIP_DOM_SELECTION_TAG
|
|
208
214
|
});
|
|
209
215
|
setInitialState(state);
|
|
210
216
|
if (!CustomLabelFromProps) {
|
|
@@ -291,6 +297,11 @@ export const InlineBlockComponent = props => {
|
|
|
291
297
|
if (node_0 && $isInlineBlockNode(node_0)) {
|
|
292
298
|
node_0.setFields(newData_0, true);
|
|
293
299
|
}
|
|
300
|
+
},
|
|
301
|
+
// Without this, the outer editor's reconciler resets DOM selection
|
|
302
|
+
// back into its own root, kicking focus out of any nested richText.
|
|
303
|
+
{
|
|
304
|
+
tag: SKIP_DOM_SELECTION_TAG
|
|
294
305
|
});
|
|
295
306
|
}, [editor, nodeKey, formData]);
|
|
296
307
|
const RemoveButton = useMemo(() => () => /*#__PURE__*/_jsx(Button, {
|
|
@@ -300,10 +311,11 @@ export const InlineBlockComponent = props => {
|
|
|
300
311
|
icon: "x",
|
|
301
312
|
onClick: e => {
|
|
302
313
|
e.preventDefault();
|
|
314
|
+
e.stopPropagation();
|
|
303
315
|
removeInlineBlock();
|
|
304
316
|
},
|
|
305
317
|
round: true,
|
|
306
|
-
size: "
|
|
318
|
+
size: "medium",
|
|
307
319
|
tooltip: t('lexical:blocks:inlineBlocks:remove', {
|
|
308
320
|
label: blockDisplayName
|
|
309
321
|
})
|
|
@@ -318,7 +330,7 @@ export const InlineBlockComponent = props => {
|
|
|
318
330
|
toggleDrawer();
|
|
319
331
|
},
|
|
320
332
|
round: true,
|
|
321
|
-
size: "
|
|
333
|
+
size: "medium",
|
|
322
334
|
tooltip: t('lexical:blocks:inlineBlocks:edit', {
|
|
323
335
|
label: blockDisplayName
|
|
324
336
|
})
|
|
@@ -328,9 +340,20 @@ export const InlineBlockComponent = props => {
|
|
|
328
340
|
className
|
|
329
341
|
}) => /*#__PURE__*/_jsx("div", {
|
|
330
342
|
className: [`${baseClass}__container`, baseClass + '-' + formData.blockType, className].filter(Boolean).join(' '),
|
|
343
|
+
...(isEditable ? {
|
|
344
|
+
onClick: () => toggleDrawer(),
|
|
345
|
+
onKeyDown: e_0 => {
|
|
346
|
+
if (e_0.key === 'Enter' || e_0.key === ' ') {
|
|
347
|
+
e_0.preventDefault();
|
|
348
|
+
toggleDrawer();
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
role: 'button',
|
|
352
|
+
tabIndex: 0
|
|
353
|
+
} : {}),
|
|
331
354
|
ref: inlineBlockElemElemRef,
|
|
332
355
|
children: children
|
|
333
|
-
}), [baseClass, formData.blockType]);
|
|
356
|
+
}), [baseClass, formData.blockType, isEditable, toggleDrawer]);
|
|
334
357
|
const Label = useMemo(() => {
|
|
335
358
|
if (resolvedCustomLabel) {
|
|
336
359
|
return () => resolvedCustomLabel;
|
|
@@ -407,9 +430,9 @@ export const InlineBlockComponent = props => {
|
|
|
407
430
|
children: [initialState ? /*#__PURE__*/_jsx(Label, {}) : /*#__PURE__*/_jsx(ShimmerEffect, {
|
|
408
431
|
height: "15px",
|
|
409
432
|
width: "40px"
|
|
410
|
-
}), isEditable ? /*#__PURE__*/
|
|
433
|
+
}), isEditable ? /*#__PURE__*/_jsx("div", {
|
|
411
434
|
className: `${baseClass}__actions`,
|
|
412
|
-
children:
|
|
435
|
+
children: /*#__PURE__*/_jsx(RemoveButton, {})
|
|
413
436
|
}) : null]
|
|
414
437
|
})]
|
|
415
438
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","Drawer","EditDepthProvider","Form","formatDrawerSlug","FormSubmit","RenderFields","ShimmerEffect","useConfig","useDocumentForm","useDocumentInfo","useEditDepth","useServerFunctions","useTranslation","abortAndIgnore","$getNodeByKey","deepCopyObjectSimpleWithoutReactComponents","reduceFieldsToValues","React","createContext","useCallback","useEffect","useMemo","useRef","v4","uuid","useEditorConfigContext","useLexicalDrawer","$isInlineBlockNode","InlineBlockComponentContext","initialState","useInlineBlockComponentContext","use","InlineBlockComponent","props","cacheBuster","className","baseClass","CustomBlock","CustomBlockFromProps","CustomLabel","CustomLabelFromProps","formData","nodeKey","editor","isEditable","i18n","t","createdInlineBlock","fieldProps","featureClientSchemaMap","initialLexicalFormState","schemaPath","setCreatedInlineBlock","uuidFromContext","fields","parentDocumentFields","getFormState","editDepth","firstTimeDrawer","setInitialState","useState","cachedFormState","id","formState","Object","fromEntries","entries","map","fieldName","fieldState","initialValue","value","hasMounted","prevCacheBuster","current","formUuid","setCustomLabel","undefined","customComponents","BlockLabel","setCustomBlock","Block","resolvedCustomBlock","_jsx","isEditor","isJSXConverter","resolvedCustomLabel","drawerSlug","slug","depth","toggleDrawer","inlineBlockElemElemRef","collectionSlug","getDocPreferences","globalSlug","config","componentMapRenderedBlockPath","blockType","clientSchemaMap","blocksField","clientBlock","blockReferences","blocksMap","blocks","clientBlockFields","getKey","length","removeInlineBlock","update","remove","blockDisplayName","labels","singular","onChangeAbortControllerRef","AbortController","schemaFieldsPath","abortController","awaitInitialState","state","data","docPermissions","docPreferences","documentFormState","excludeFiles","initialBlockData","initialBlockFormState","operation","readOnly","renderAllFields","signal","newFormStateData","node","newData","setFields","onChange","prevFormState","submit","controller","isStateOutOfSync","keys","some","key","onFormSubmit","RemoveButton","buttonStyle","disabled","icon","onClick","e","preventDefault","round","size","tooltip","label","EditButton","el","InlineBlockContainer","children","filter","Boolean","join","ref","Label","_jsxs","beforeSubmit","disableValidationOnSubmit","onSubmit","title","_Fragment","forceRender","parentIndexPath","parentPath","parentSchemaPath","permissions","programmaticSubmit","height","width"],"sources":["../../../../../src/features/blocks/client/componentInline/index.tsx"],"sourcesContent":["'use client'\n\nimport type { BlocksFieldClient, ClientBlock, Data, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Drawer,\n EditDepthProvider,\n Form,\n formatDrawerSlug,\n FormSubmit,\n RenderFields,\n ShimmerEffect,\n useConfig,\n useDocumentForm,\n useDocumentInfo,\n useEditDepth,\n useServerFunctions,\n useTranslation,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { $getNodeByKey } from 'lexical'\n\nimport './index.scss'\n\nimport { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from 'payload/shared'\nimport React, { createContext, useCallback, useEffect, useMemo, useRef } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { ViewMapInlineBlockComponentProps } from '../../../../types.js'\nimport type { InlineBlockFields } from '../../server/nodes/InlineBlocksNode.js'\nimport type { BlockComponentProps } from '../component/index.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js'\n\nexport type InlineBlockComponentProps<\n TFormData extends Record<string, unknown> = InlineBlockFields,\n> = {\n readonly CustomBlock?: React.FC<ViewMapInlineBlockComponentProps>\n readonly CustomLabel?: React.FC<ViewMapInlineBlockComponentProps>\n} & Pick<BlockComponentProps<TFormData>, 'cacheBuster' | 'className' | 'formData' | 'nodeKey'>\n\nexport type InlineBlockComponentContextType = {\n EditButton?: React.FC\n initialState: false | FormState | undefined\n InlineBlockContainer?: React.FC<{ children: React.ReactNode }>\n Label?: React.FC\n nodeKey?: string\n RemoveButton?: React.FC\n}\n\nconst InlineBlockComponentContext = createContext<InlineBlockComponentContextType>({\n initialState: false,\n})\n\nexport const useInlineBlockComponentContext = () => React.use(InlineBlockComponentContext)\n\nexport const InlineBlockComponent: React.FC<InlineBlockComponentProps<InlineBlockFields>> = (\n props,\n) => {\n const {\n cacheBuster,\n className: baseClass,\n CustomBlock: CustomBlockFromProps,\n CustomLabel: CustomLabelFromProps,\n formData,\n nodeKey,\n } = props\n\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n const { i18n, t } = useTranslation<object, string>()\n const {\n createdInlineBlock,\n fieldProps: { featureClientSchemaMap, initialLexicalFormState, schemaPath },\n setCreatedInlineBlock,\n uuid: uuidFromContext,\n } = useEditorConfigContext()\n const { fields: parentDocumentFields } = useDocumentForm()\n\n const { getFormState } = useServerFunctions()\n const editDepth = useEditDepth()\n const firstTimeDrawer = useRef(false)\n\n const [initialState, setInitialState] = React.useState<false | FormState | undefined>(() => {\n // Initial form state that was calculated server-side. May have stale values\n const cachedFormState = initialLexicalFormState?.[formData.id]?.formState\n if (!cachedFormState) {\n return false\n }\n\n // Merge current formData values into the cached form state\n // This ensures that when the component remounts (e.g., due to view changes), we don't lose user edits\n return Object.fromEntries(\n Object.entries(cachedFormState).map(([fieldName, fieldState]) => [\n fieldName,\n fieldName in formData\n ? {\n ...fieldState,\n initialValue: formData[fieldName],\n value: formData[fieldName],\n }\n : fieldState,\n ]),\n )\n })\n\n const hasMounted = useRef(false)\n const prevCacheBuster = useRef(cacheBuster)\n useEffect(() => {\n if (hasMounted.current) {\n if (prevCacheBuster.current !== cacheBuster) {\n setInitialState(false)\n }\n prevCacheBuster.current = cacheBuster\n } else {\n hasMounted.current = true\n }\n }, [cacheBuster])\n\n const [formUuid] = React.useState(() => uuid())\n\n // Server-rendered custom components (from admin.components, NOT viewMap).\n // When viewMap components exist, we render them directly with formData instead.\n const [CustomLabel, setCustomLabel] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomLabelFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.BlockLabel ?? undefined\n })\n\n const [CustomBlock, setCustomBlock] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomBlockFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.Block ?? undefined\n })\n\n const resolvedCustomBlock = useMemo(() => {\n if (CustomBlockFromProps) {\n return (\n <CustomBlockFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomBlock\n }, [CustomBlockFromProps, baseClass, formData, nodeKey, CustomBlock])\n\n const resolvedCustomLabel = useMemo(() => {\n if (CustomLabelFromProps) {\n return (\n <CustomLabelFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomLabel\n }, [CustomLabelFromProps, baseClass, formData, nodeKey, CustomLabel])\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-inlineBlocks-create-${uuidFromContext}-${formData.id}`,\n depth: editDepth,\n })\n const { toggleDrawer } = useLexicalDrawer(drawerSlug, true)\n\n const inlineBlockElemElemRef = useRef<HTMLDivElement | null>(null)\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n const { config } = useConfig()\n\n const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${formData.blockType}`\n\n const clientSchemaMap = featureClientSchemaMap['blocks']\n\n const blocksField: BlocksFieldClient = clientSchemaMap?.[\n componentMapRenderedBlockPath\n ]?.[0] as BlocksFieldClient\n\n const clientBlock: ClientBlock | undefined = blocksField.blockReferences\n ? typeof blocksField?.blockReferences?.[0] === 'string'\n ? config.blocksMap[blocksField?.blockReferences?.[0]]\n : blocksField?.blockReferences?.[0]\n : blocksField?.blocks?.[0]\n\n const clientBlockFields = clientBlock?.fields ?? []\n\n // Open drawer on \"mount\"\n useEffect(() => {\n if (!firstTimeDrawer.current && createdInlineBlock?.getKey() === nodeKey) {\n // > 2 because they always have \"id\" and \"blockName\" fields\n if (clientBlockFields.length > 2) {\n toggleDrawer()\n }\n setCreatedInlineBlock?.(undefined)\n firstTimeDrawer.current = true\n }\n }, [clientBlockFields.length, createdInlineBlock, nodeKey, setCreatedInlineBlock, toggleDrawer])\n\n const removeInlineBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const blockDisplayName = clientBlock?.labels?.singular\n ? getTranslation(clientBlock?.labels.singular, i18n)\n : clientBlock?.slug\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${clientBlock?.slug}.fields`\n\n // Initial state for newly created blocks\n useEffect(() => {\n const abortController = new AbortController()\n\n const awaitInitialState = async () => {\n /*\n * This will only run if a new block is created. For all existing blocks that are loaded when the document is loaded, or when the form is saved,\n * this is not run, as the lexical field RSC will fetch the state server-side and pass it to the client. That way, we avoid unnecessary client-side\n * requests. Though for newly created blocks, we need to fetch the state client-side, as the server doesn't know about the block yet.\n */\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: formData,\n docPermissions: { fields: true },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n globalSlug,\n initialBlockData: formData,\n initialBlockFormState: formData,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: abortController.signal,\n })\n\n if (state) {\n const newFormStateData: InlineBlockFields = reduceFieldsToValues(\n deepCopyObjectSimpleWithoutReactComponents(state, { excludeFiles: true }),\n true,\n ) as InlineBlockFields\n\n // Things like default values may come back from the server => update the node with the new data\n editor.update(() => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n const newData = newFormStateData\n newData.blockType = formData.blockType\n\n node.setFields(newData, true)\n }\n })\n\n setInitialState(state)\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n }\n\n if (formData && !initialState) {\n void awaitInitialState()\n }\n\n return () => {\n abortAndIgnore(abortController)\n }\n }, [\n getFormState,\n editor,\n nodeKey,\n isEditable,\n CustomLabelFromProps,\n CustomBlockFromProps,\n schemaFieldsPath,\n id,\n formData,\n initialState,\n collectionSlug,\n globalSlug,\n getDocPreferences,\n parentDocumentFields,\n ])\n\n /**\n * HANDLE ONCHANGE\n */\n const onChange = useCallback(\n async ({ formState: prevFormState, submit }: { formState: FormState; submit?: boolean }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n formState: prevFormState,\n globalSlug,\n initialBlockFormState: prevFormState,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: submit ? true : false,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n if (submit) {\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n\n return state\n },\n [\n getFormState,\n id,\n collectionSlug,\n getDocPreferences,\n parentDocumentFields,\n globalSlug,\n isEditable,\n schemaFieldsPath,\n CustomBlockFromProps,\n CustomLabelFromProps,\n ],\n )\n // cleanup effect\n useEffect(() => {\n const isStateOutOfSync = (formData: InlineBlockFields, initialState: FormState) => {\n return Object.keys(initialState).some(\n (key) => initialState[key] && formData[key] !== initialState[key].value,\n )\n }\n\n return () => {\n // If the component is unmounted (either via removeInlineBlock or via lexical itself) and the form state got changed before,\n // we need to reset the initial state to force a re-fetch of the initial state when it gets mounted again (e.g. via lexical history undo).\n // Otherwise it would use an outdated initial state.\n if (initialState && isStateOutOfSync(formData, initialState)) {\n setInitialState(false)\n }\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [formData, initialState])\n\n /**\n * HANDLE FORM SUBMIT\n */\n const onFormSubmit = useCallback(\n (formState: FormState, newData: Data) => {\n newData.blockType = formData.blockType\n\n editor.update(() => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n node.setFields(newData as InlineBlockFields, true)\n }\n })\n },\n [editor, nodeKey, formData],\n )\n\n const RemoveButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeInlineBlock()\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:remove', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, removeInlineBlock, t],\n )\n\n const EditButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__editButton`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"edit\"\n onClick={() => {\n toggleDrawer()\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, t, toggleDrawer],\n )\n\n const InlineBlockContainer = useMemo(\n () =>\n ({ children, className }: { children: React.ReactNode; className?: string }) => (\n <div\n className={[`${baseClass}__container`, baseClass + '-' + formData.blockType, className]\n .filter(Boolean)\n .join(' ')}\n ref={inlineBlockElemElemRef}\n >\n {children}\n </div>\n ),\n [baseClass, formData.blockType],\n )\n\n const Label = useMemo(() => {\n if (resolvedCustomLabel) {\n return () => resolvedCustomLabel\n } else {\n return () => (\n <div>{clientBlock?.labels ? getTranslation(clientBlock?.labels.singular, i18n) : ''}</div>\n )\n }\n }, [resolvedCustomLabel, clientBlock?.labels, i18n])\n\n if (!clientBlock) {\n return (\n <InlineBlockContainer className={`${baseClass}-not-found`}>\n <span>Error: Block '{formData.blockType}' not found</span>\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )\n }\n\n return (\n <Form\n beforeSubmit={[\n async ({ formState }) => {\n // This is only called when form is submitted from drawer\n return await onChange({ formState, submit: true })\n },\n ]}\n disableValidationOnSubmit\n el=\"div\"\n fields={clientBlock?.fields}\n initialState={initialState || {}}\n onChange={[onChange]}\n onSubmit={(formState, data) => {\n onFormSubmit(formState, data)\n toggleDrawer()\n }}\n uuid={formUuid}\n >\n <EditDepthProvider>\n <Drawer\n className={''}\n slug={drawerSlug}\n title={t(`lexical:blocks:inlineBlocks:${formData?.id ? 'edit' : 'create'}`, {\n label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label'),\n })}\n >\n {initialState ? (\n <>\n <RenderFields\n fields={clientBlock?.fields}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={true}\n readOnly={!isEditable}\n />\n <FormSubmit programmaticSubmit={true}>{t('fields:saveChanges')}</FormSubmit>\n </>\n ) : null}\n </Drawer>\n </EditDepthProvider>\n {resolvedCustomBlock ? (\n <InlineBlockComponentContext\n value={{\n EditButton,\n initialState,\n InlineBlockContainer,\n Label,\n nodeKey,\n RemoveButton,\n }}\n >\n {resolvedCustomBlock}\n </InlineBlockComponentContext>\n ) : (\n <InlineBlockContainer>\n {initialState ? <Label /> : <ShimmerEffect height=\"15px\" width=\"40px\" />}\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <EditButton />\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )}\n </Form>\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SACEC,MAAM,EACNC,MAAM,EACNC,iBAAiB,EACjBC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,EACVC,YAAY,EACZC,aAAa,EACbC,SAAS,EACTC,eAAe,EACfC,eAAe,EACfC,YAA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ACpBuB,YAAA,CAAa/E,WAAA,EAAWwD,IAAA;MACxB7B,YAAA;IACF;IACAlE,IAAA,EAAMmD,QAAA;4BAENQ,IAAA,CAAClF,iBAAA;gBACC,aAAAkF,IAAA,CAACnF,MAAA;QACCmC,SAAA,EAAW;QACXqD,IAAA,EAAMD,UAAA;QACNgF,KAAA,EAAOzH,CAAA,CAAE,+BAA+BL,QAAA,EAAUqB,EAAA,GAAK,SAAS,UAAU,EAAE;UAC1E2F,KAAA,EAAO3C,gBAAA,IAAoBhE,CAAA,CAAE;QAC/B;kBAECjB,YAAA,gBACCsI,KAAA,CAAAK,SAAA;kCACErF,IAAA,CAAC9E,YAAA;YACCiD,MAAA,EAAQ8C,WAAA,EAAa9C,MAAA;YACrBmH,WAAW;YACXC,eAAA,EAAgB;YAChBC,UAAA,EAAW;YACXC,gBAAA,EAAkBzD,gBAAA;YAClB0D,WAAA,EAAa;YACb9C,QAAA,EAAU,CAACnF;2BAEbuC,IAAA,CAAC/E,UAAA;YAAW0K,kBAAA,EAAoB;sBAAOhI,CAAA,CAAE;;aAEzC;;QAGPoC,mBAAA,gBACCC,IAAA,CAACvD,2BAAA;MACC2C,KAAA,EAAO;QACLmF,UAAA;QACA7H,YAAA;QACA+H,oBAAA;QACAM,KAAA;QACAxH,OAAA;QACAqG;MACF;gBAEC7D;sBAGHiF,KAAA,CAACP,oBAAA;iBACE/H,YAAA,gBAAesD,IAAA,CAAC+E,KAAA,qBAAW/E,IAAA,CAAC7E,aAAA;QAAcyK,MAAA,EAAO;QAAOC,KAAA,EAAM;UAC9DpI,UAAA,gBACCuH,KAAA,CAAC;QAAIhI,SAAA,EAAW,GAAGC,SAAA,WAAoB;gCACrC+C,IAAA,CAACuE,UAAA,O,aACDvE,IAAA,CAAC4D,YAAA;WAED;;;AAKd","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","Drawer","EditDepthProvider","Form","formatDrawerSlug","FormSubmit","RenderFields","ShimmerEffect","useConfig","useDocumentForm","useDocumentInfo","useEditDepth","useServerFunctions","useTranslation","abortAndIgnore","$getNodeByKey","SKIP_DOM_SELECTION_TAG","deepCopyObjectSimpleWithoutReactComponents","reduceFieldsToValues","React","createContext","useCallback","useEffect","useMemo","useRef","v4","uuid","useEditorConfigContext","useLexicalDrawer","$isInlineBlockNode","InlineBlockComponentContext","initialState","useInlineBlockComponentContext","use","InlineBlockComponent","props","cacheBuster","className","baseClass","CustomBlock","CustomBlockFromProps","CustomLabel","CustomLabelFromProps","formData","nodeKey","editor","isEditable","i18n","t","createdInlineBlock","fieldProps","featureClientSchemaMap","initialLexicalFormState","schemaPath","setCreatedInlineBlock","uuidFromContext","fields","parentDocumentFields","getFormState","editDepth","firstTimeDrawer","setInitialState","useState","cachedFormState","id","formState","Object","fromEntries","entries","map","fieldName","fieldState","initialValue","value","hasMounted","prevCacheBuster","current","formUuid","setCustomLabel","undefined","customComponents","BlockLabel","setCustomBlock","Block","resolvedCustomBlock","_jsx","isEditor","isJSXConverter","resolvedCustomLabel","drawerSlug","slug","depth","toggleDrawer","inlineBlockElemElemRef","collectionSlug","getDocPreferences","globalSlug","config","componentMapRenderedBlockPath","blockType","clientSchemaMap","blocksField","clientBlock","blockReferences","blocksMap","blocks","clientBlockFields","getKey","length","removeInlineBlock","update","remove","blockDisplayName","labels","singular","onChangeAbortControllerRef","AbortController","schemaFieldsPath","abortController","awaitInitialState","state","data","docPermissions","docPreferences","documentFormState","excludeFiles","initialBlockData","initialBlockFormState","operation","readOnly","renderAllFields","signal","newFormStateData","node","newData","setFields","tag","onChange","prevFormState","submit","controller","isStateOutOfSync","keys","some","key","onFormSubmit","RemoveButton","buttonStyle","disabled","icon","onClick","e","preventDefault","stopPropagation","round","size","tooltip","label","EditButton","el","InlineBlockContainer","children","filter","Boolean","join","onKeyDown","role","tabIndex","ref","Label","_jsxs","beforeSubmit","disableValidationOnSubmit","onSubmit","title","_Fragment","forceRender","parentIndexPath","parentPath","parentSchemaPath","permissions","programmaticSubmit","height","width"],"sources":["../../../../../src/features/blocks/client/componentInline/index.tsx"],"sourcesContent":["'use client'\n\nimport type { BlocksFieldClient, ClientBlock, Data, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Drawer,\n EditDepthProvider,\n Form,\n formatDrawerSlug,\n FormSubmit,\n RenderFields,\n ShimmerEffect,\n useConfig,\n useDocumentForm,\n useDocumentInfo,\n useEditDepth,\n useServerFunctions,\n useTranslation,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { $getNodeByKey, SKIP_DOM_SELECTION_TAG } from 'lexical'\n\nimport './index.css'\n\nimport { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from 'payload/shared'\nimport React, { createContext, useCallback, useEffect, useMemo, useRef } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { ViewMapInlineBlockComponentProps } from '../../../../types.js'\nimport type { InlineBlockFields } from '../../server/nodes/InlineBlocksNode.js'\nimport type { BlockComponentProps } from '../component/index.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js'\n\nexport type InlineBlockComponentProps<\n TFormData extends Record<string, unknown> = InlineBlockFields,\n> = {\n readonly CustomBlock?: React.FC<ViewMapInlineBlockComponentProps>\n readonly CustomLabel?: React.FC<ViewMapInlineBlockComponentProps>\n} & Pick<BlockComponentProps<TFormData>, 'cacheBuster' | 'className' | 'formData' | 'nodeKey'>\n\nexport type InlineBlockComponentContextType = {\n EditButton?: React.FC\n initialState: false | FormState | undefined\n InlineBlockContainer?: React.FC<{ children: React.ReactNode }>\n Label?: React.FC\n nodeKey?: string\n RemoveButton?: React.FC\n}\n\nconst InlineBlockComponentContext = createContext<InlineBlockComponentContextType>({\n initialState: false,\n})\n\nexport const useInlineBlockComponentContext = () => React.use(InlineBlockComponentContext)\n\nexport const InlineBlockComponent: React.FC<InlineBlockComponentProps<InlineBlockFields>> = (\n props,\n) => {\n const {\n cacheBuster,\n className: baseClass,\n CustomBlock: CustomBlockFromProps,\n CustomLabel: CustomLabelFromProps,\n formData,\n nodeKey,\n } = props\n\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n const { i18n, t } = useTranslation<object, string>()\n const {\n createdInlineBlock,\n fieldProps: { featureClientSchemaMap, initialLexicalFormState, schemaPath },\n setCreatedInlineBlock,\n uuid: uuidFromContext,\n } = useEditorConfigContext()\n const { fields: parentDocumentFields } = useDocumentForm()\n\n const { getFormState } = useServerFunctions()\n const editDepth = useEditDepth()\n const firstTimeDrawer = useRef(false)\n\n const [initialState, setInitialState] = React.useState<false | FormState | undefined>(() => {\n // Initial form state that was calculated server-side. May have stale values\n const cachedFormState = initialLexicalFormState?.[formData.id]?.formState\n if (!cachedFormState) {\n return false\n }\n\n // Merge current formData values into the cached form state\n // This ensures that when the component remounts (e.g., due to view changes), we don't lose user edits\n return Object.fromEntries(\n Object.entries(cachedFormState).map(([fieldName, fieldState]) => [\n fieldName,\n fieldName in formData\n ? {\n ...fieldState,\n initialValue: formData[fieldName],\n value: formData[fieldName],\n }\n : fieldState,\n ]),\n )\n })\n\n const hasMounted = useRef(false)\n const prevCacheBuster = useRef(cacheBuster)\n useEffect(() => {\n if (hasMounted.current) {\n if (prevCacheBuster.current !== cacheBuster) {\n setInitialState(false)\n }\n prevCacheBuster.current = cacheBuster\n } else {\n hasMounted.current = true\n }\n }, [cacheBuster])\n\n const [formUuid] = React.useState(() => uuid())\n\n // Server-rendered custom components (from admin.components, NOT viewMap).\n // When viewMap components exist, we render them directly with formData instead.\n const [CustomLabel, setCustomLabel] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomLabelFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.BlockLabel ?? undefined\n })\n\n const [CustomBlock, setCustomBlock] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomBlockFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.Block ?? undefined\n })\n\n const resolvedCustomBlock = useMemo(() => {\n if (CustomBlockFromProps) {\n return (\n <CustomBlockFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomBlock\n }, [CustomBlockFromProps, baseClass, formData, nodeKey, CustomBlock])\n\n const resolvedCustomLabel = useMemo(() => {\n if (CustomLabelFromProps) {\n return (\n <CustomLabelFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomLabel\n }, [CustomLabelFromProps, baseClass, formData, nodeKey, CustomLabel])\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-inlineBlocks-create-${uuidFromContext}-${formData.id}`,\n depth: editDepth,\n })\n const { toggleDrawer } = useLexicalDrawer(drawerSlug, true)\n\n const inlineBlockElemElemRef = useRef<HTMLDivElement | null>(null)\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n const { config } = useConfig()\n\n const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${formData.blockType}`\n\n const clientSchemaMap = featureClientSchemaMap['blocks']\n\n const blocksField: BlocksFieldClient = clientSchemaMap?.[\n componentMapRenderedBlockPath\n ]?.[0] as BlocksFieldClient\n\n const clientBlock: ClientBlock | undefined = blocksField.blockReferences\n ? typeof blocksField?.blockReferences?.[0] === 'string'\n ? config.blocksMap[blocksField?.blockReferences?.[0]]\n : blocksField?.blockReferences?.[0]\n : blocksField?.blocks?.[0]\n\n const clientBlockFields = clientBlock?.fields ?? []\n\n // Open drawer on \"mount\"\n useEffect(() => {\n if (!firstTimeDrawer.current && createdInlineBlock?.getKey() === nodeKey) {\n // > 2 because they always have \"id\" and \"blockName\" fields\n if (clientBlockFields.length > 2) {\n toggleDrawer()\n }\n setCreatedInlineBlock?.(undefined)\n firstTimeDrawer.current = true\n }\n }, [clientBlockFields.length, createdInlineBlock, nodeKey, setCreatedInlineBlock, toggleDrawer])\n\n const removeInlineBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const blockDisplayName = clientBlock?.labels?.singular\n ? getTranslation(clientBlock?.labels.singular, i18n)\n : clientBlock?.slug\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${clientBlock?.slug}.fields`\n\n // Initial state for newly created blocks\n useEffect(() => {\n const abortController = new AbortController()\n\n const awaitInitialState = async () => {\n /*\n * This will only run if a new block is created. For all existing blocks that are loaded when the document is loaded, or when the form is saved,\n * this is not run, as the lexical field RSC will fetch the state server-side and pass it to the client. That way, we avoid unnecessary client-side\n * requests. Though for newly created blocks, we need to fetch the state client-side, as the server doesn't know about the block yet.\n */\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: formData,\n docPermissions: { fields: true },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n globalSlug,\n initialBlockData: formData,\n initialBlockFormState: formData,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: abortController.signal,\n })\n\n if (state) {\n const newFormStateData: InlineBlockFields = reduceFieldsToValues(\n deepCopyObjectSimpleWithoutReactComponents(state, { excludeFiles: true }),\n true,\n ) as InlineBlockFields\n\n // Things like default values may come back from the server => update the node with the new data\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n const newData = newFormStateData\n newData.blockType = formData.blockType\n\n node.setFields(newData, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n\n setInitialState(state)\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n }\n\n if (formData && !initialState) {\n void awaitInitialState()\n }\n\n return () => {\n abortAndIgnore(abortController)\n }\n }, [\n getFormState,\n editor,\n nodeKey,\n isEditable,\n CustomLabelFromProps,\n CustomBlockFromProps,\n schemaFieldsPath,\n id,\n formData,\n initialState,\n collectionSlug,\n globalSlug,\n getDocPreferences,\n parentDocumentFields,\n ])\n\n /**\n * HANDLE ONCHANGE\n */\n const onChange = useCallback(\n async ({ formState: prevFormState, submit }: { formState: FormState; submit?: boolean }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n formState: prevFormState,\n globalSlug,\n initialBlockFormState: prevFormState,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: submit ? true : false,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n if (submit) {\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n\n return state\n },\n [\n getFormState,\n id,\n collectionSlug,\n getDocPreferences,\n parentDocumentFields,\n globalSlug,\n isEditable,\n schemaFieldsPath,\n CustomBlockFromProps,\n CustomLabelFromProps,\n ],\n )\n // cleanup effect\n useEffect(() => {\n const isStateOutOfSync = (formData: InlineBlockFields, initialState: FormState) => {\n return Object.keys(initialState).some(\n (key) => initialState[key] && formData[key] !== initialState[key].value,\n )\n }\n\n return () => {\n // If the component is unmounted (either via removeInlineBlock or via lexical itself) and the form state got changed before,\n // we need to reset the initial state to force a re-fetch of the initial state when it gets mounted again (e.g. via lexical history undo).\n // Otherwise it would use an outdated initial state.\n if (initialState && isStateOutOfSync(formData, initialState)) {\n setInitialState(false)\n }\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [formData, initialState])\n\n /**\n * HANDLE FORM SUBMIT\n */\n const onFormSubmit = useCallback(\n (formState: FormState, newData: Data) => {\n newData.blockType = formData.blockType\n\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n node.setFields(newData as InlineBlockFields, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n },\n [editor, nodeKey, formData],\n )\n\n const RemoveButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n removeInlineBlock()\n }}\n round\n size=\"medium\"\n tooltip={t('lexical:blocks:inlineBlocks:remove', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, removeInlineBlock, t],\n )\n\n const EditButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__editButton`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"edit\"\n onClick={() => {\n toggleDrawer()\n }}\n round\n size=\"medium\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, t, toggleDrawer],\n )\n\n const InlineBlockContainer = useMemo(\n () =>\n ({ children, className }: { children: React.ReactNode; className?: string }) => (\n <div\n className={[`${baseClass}__container`, baseClass + '-' + formData.blockType, className]\n .filter(Boolean)\n .join(' ')}\n {...(isEditable\n ? {\n onClick: () => toggleDrawer(),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n toggleDrawer()\n }\n },\n role: 'button',\n tabIndex: 0,\n }\n : {})}\n ref={inlineBlockElemElemRef}\n >\n {children}\n </div>\n ),\n [baseClass, formData.blockType, isEditable, toggleDrawer],\n )\n\n const Label = useMemo(() => {\n if (resolvedCustomLabel) {\n return () => resolvedCustomLabel\n } else {\n return () => (\n <div>{clientBlock?.labels ? getTranslation(clientBlock?.labels.singular, i18n) : ''}</div>\n )\n }\n }, [resolvedCustomLabel, clientBlock?.labels, i18n])\n\n if (!clientBlock) {\n return (\n <InlineBlockContainer className={`${baseClass}-not-found`}>\n <span>Error: Block '{formData.blockType}' not found</span>\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )\n }\n\n return (\n <Form\n beforeSubmit={[\n async ({ formState }) => {\n // This is only called when form is submitted from drawer\n return await onChange({ formState, submit: true })\n },\n ]}\n disableValidationOnSubmit\n el=\"div\"\n fields={clientBlock?.fields}\n initialState={initialState || {}}\n onChange={[onChange]}\n onSubmit={(formState, data) => {\n onFormSubmit(formState, data)\n toggleDrawer()\n }}\n uuid={formUuid}\n >\n <EditDepthProvider>\n <Drawer\n className={''}\n slug={drawerSlug}\n title={t(`lexical:blocks:inlineBlocks:${formData?.id ? 'edit' : 'create'}`, {\n label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label'),\n })}\n >\n {initialState ? (\n <>\n <RenderFields\n fields={clientBlock?.fields}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={true}\n readOnly={!isEditable}\n />\n <FormSubmit programmaticSubmit={true}>{t('fields:saveChanges')}</FormSubmit>\n </>\n ) : null}\n </Drawer>\n </EditDepthProvider>\n {resolvedCustomBlock ? (\n <InlineBlockComponentContext\n value={{\n EditButton,\n initialState,\n InlineBlockContainer,\n Label,\n nodeKey,\n RemoveButton,\n }}\n >\n {resolvedCustomBlock}\n </InlineBlockComponentContext>\n ) : (\n <InlineBlockContainer>\n {initialState ? <Label /> : <ShimmerEffect height=\"15px\" width=\"40px\" />}\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )}\n </Form>\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SACEC,MAAM,EACNC,MAAM,EACNC,iBAAiB,EACjBC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,EACVC,YAAY,EACZC,aAAa,EACbC,SAAS,EACTC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,kBAAkB,EAClBC,cAAc,QACT;AACP,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,EAAEC,sBAAsB,QAAQ;AAEtD,OAAO;AAEP,SAASC,0CAA0C,EAAEC,oBAAoB,QAAQ;AACjF,OAAOC,KAAA,IAASC,aAAa,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ;AAC9E,SAASC,EAAA,IAAMC,IAAI,QAAQ;AAM3B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,kBAAkB,QAAQ;AAkBnC,MAAMC,2BAAA,gB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,QAAA,EAAUA,CAAC5G,WAAA,EAAWwD,IAAA;MACpBwB,YAAA,CAAahF,WAAA,EAAWwD,IAAA;MACxB7B,YAAA;IACF;IACAlE,IAAA,EAAMmD,QAAA;4BAENQ,IAAA,CAACnF,iBAAA;gBACC,aAAAmF,IAAA,CAACpF,MAAA;QACCoC,SAAA,EAAW;QACXqD,IAAA,EAAMD,UAAA;QACNqF,KAAA,EAAO9H,CAAA,CAAE,+BAA+BL,QAAA,EAAUqB,EAAA,GAAK,SAAS,UAAU,EAAE;UAC1E6F,KAAA,EAAO7C,gBAAA,IAAoBhE,CAAA,CAAE;QAC/B;kBAECjB,YAAA,gBACC2I,KAAA,CAAAK,SAAA;kCACE1F,IAAA,CAAC/E,YAAA;YACCkD,MAAA,EAAQ8C,WAAA,EAAa9C,MAAA;YACrBwH,WAAW;YACXC,eAAA,EAAgB;YAChBC,UAAA,EAAW;YACXC,gBAAA,EAAkB9D,gBAAA;YAClB+D,WAAA,EAAa;YACbnD,QAAA,EAAU,CAACnF;2BAEbuC,IAAA,CAAChF,UAAA;YAAWgL,kBAAA,EAAoB;sBAAOrI,CAAA,CAAE;;aAEzC;;QAGPoC,mBAAA,gBACCC,IAAA,CAACvD,2BAAA;MACC2C,KAAA,EAAO;QACLqF,UAAA;QACA/H,YAAA;QACAiI,oBAAA;QACAS,KAAA;QACA7H,OAAA;QACAsG;MACF;gBAEC9D;sBAGHsF,KAAA,CAACV,oBAAA;iBACEjI,YAAA,gBAAesD,IAAA,CAACoF,KAAA,qBAAWpF,IAAA,CAAC9E,aAAA;QAAc+K,MAAA,EAAO;QAAOC,KAAA,EAAM;UAC9DzI,UAAA,gBACCuC,IAAA,CAAC;QAAIhD,SAAA,EAAW,GAAGC,SAAA,WAAoB;kBACrC,aAAA+C,IAAA,CAAC6D,YAAA;WAED;;;AAKd","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/blocks/client/index.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/blocks/client/index.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,mBAAmB,8EAyL/B,CAAA"}
|
|
@@ -106,7 +106,6 @@ export const BlocksFeatureClient = createClientFeature(({
|
|
|
106
106
|
ChildComponent: BlockIcon,
|
|
107
107
|
items: clientBlocks.map((block, index) => {
|
|
108
108
|
return {
|
|
109
|
-
ChildComponent: getBlockImageComponent(block, BlockIcon),
|
|
110
109
|
isActive: undefined,
|
|
111
110
|
key: 'block-' + block.slug,
|
|
112
111
|
label: ({
|
|
@@ -133,7 +132,6 @@ export const BlocksFeatureClient = createClientFeature(({
|
|
|
133
132
|
ChildComponent: InlineBlocksIcon,
|
|
134
133
|
items: clientInlineBlocks.map((inlineBlock, index) => {
|
|
135
134
|
return {
|
|
136
|
-
ChildComponent: getBlockImageComponent(inlineBlock, InlineBlocksIcon),
|
|
137
135
|
isActive: undefined,
|
|
138
136
|
key: 'inlineBlock-' + inlineBlock.slug,
|
|
139
137
|
label: ({
|