@payloadcms/richtext-lexical 4.0.0-internal.7e57eed → 4.0.0-internal.8089ef7
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-MT4FK3IP.js +2 -0
- package/dist/exports/client/Field-MT4FK3IP.js.map +7 -0
- package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
- package/dist/exports/client/{chunk-SSMQFWCQ.js.map → chunk-3LRZDIIG.js.map} +4 -4
- package/dist/exports/client/chunk-E6LSRRP2.js +2 -0
- package/dist/exports/client/chunk-E6LSRRP2.js.map +7 -0
- package/dist/exports/client/chunk-ZQX5HXUL.js +2 -0
- package/dist/exports/client/{chunk-43E5QYAA.js.map → chunk-ZQX5HXUL.js.map} +3 -3
- package/dist/exports/client/{component-D5QLYS7W.js → component-6DQLENIE.js} +2 -2
- package/dist/exports/client/componentInline-HNE5G4TE.js +2 -0
- package/dist/exports/client/index.js +28 -28
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
- package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
- package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
- package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
- package/dist/features/blocks/client/component/index.d.ts +0 -6
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +169 -101
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
- package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
- package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
- package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
- package/dist/features/blocks/client/componentInline/index.css +0 -1
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +30 -22
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
- package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
- package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
- package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
- package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/server/index.js +2 -2
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
- package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/blocks/server/schema.d.ts +2 -0
- package/dist/features/blocks/server/schema.d.ts.map +1 -1
- package/dist/features/blocks/server/schema.js +7 -9
- package/dist/features/blocks/server/schema.js.map +1 -1
- package/dist/features/blocks/server/validate.js +1 -1
- package/dist/features/blocks/server/validate.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
- package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
- package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +3 -3
- package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
- package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
- package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
- package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
- package/dist/features/heading/constants.d.ts +2 -0
- package/dist/features/heading/constants.d.ts.map +1 -0
- package/dist/features/heading/constants.js +2 -0
- package/dist/features/heading/constants.js.map +1 -0
- package/dist/features/heading/server/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.js +5 -1
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/heading/server/validate.d.ts +6 -0
- package/dist/features/heading/server/validate.d.ts.map +1 -0
- package/dist/features/heading/server/validate.js +15 -0
- package/dist/features/heading/server/validate.js.map +1 -0
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +11 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +17 -0
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +2 -2
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/horizontalRule/server/schema.d.ts +1 -0
- package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/schema.js +6 -5
- package/dist/features/horizontalRule/server/schema.js.map +1 -1
- package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
- package/dist/features/indent/client/IndentPlugin.js +122 -1
- package/dist/features/indent/client/IndentPlugin.js.map +1 -1
- package/dist/features/indent/server/i18n.d.ts.map +1 -1
- package/dist/features/indent/server/i18n.js +74 -37
- package/dist/features/indent/server/i18n.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 +8 -5
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -1
- package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/AutoLinkNode.js +2 -10
- package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
- package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/LinkNode.js +2 -15
- package/dist/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/features/link/server/index.js +2 -2
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/link/server/validate.js +1 -1
- package/dist/features/link/server/validate.js.map +1 -1
- package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
- package/dist/features/lists/checklist/server/index.js +5 -2
- 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 +5 -2
- package/dist/features/lists/orderedList/server/index.js.map +1 -1
- package/dist/features/lists/shared/constants.d.ts +2 -0
- package/dist/features/lists/shared/constants.d.ts.map +1 -0
- package/dist/features/lists/shared/constants.js +2 -0
- package/dist/features/lists/shared/constants.js.map +1 -0
- package/dist/features/lists/shared/validate.d.ts +5 -0
- package/dist/features/lists/shared/validate.d.ts.map +1 -0
- package/dist/features/lists/shared/validate.js +15 -0
- package/dist/features/lists/shared/validate.js.map +1 -0
- package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/unorderedList/server/index.js +5 -2
- package/dist/features/lists/unorderedList/server/index.js.map +1 -1
- package/dist/features/relationship/client/components/index.css +3 -6
- package/dist/features/relationship/client/index.d.ts +2 -2
- package/dist/features/relationship/client/index.d.ts.map +1 -1
- package/dist/features/relationship/client/index.js.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
- package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.d.ts +2 -2
- package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +27 -31
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
- package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
- package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/relationship/server/index.d.ts +8 -1
- package/dist/features/relationship/server/index.d.ts.map +1 -1
- package/dist/features/relationship/server/index.js +28 -11
- package/dist/features/relationship/server/index.js.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
- package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/relationship/server/schema.d.ts +3 -2
- package/dist/features/relationship/server/schema.d.ts.map +1 -1
- package/dist/features/relationship/server/schema.js +9 -12
- package/dist/features/relationship/server/schema.js.map +1 -1
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.css +0 -1
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js +17 -44
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
- package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
- package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js +41 -18
- package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
- package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
- package/dist/features/table/server/index.js +2 -2
- package/dist/features/table/server/index.js.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.css +77 -3
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +19 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.js +17 -2
- package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
- 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 +85 -32
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -12
- package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
- package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
- package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +79 -0
- package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
- package/dist/features/typesServer.d.ts +17 -12
- 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 +0 -2
- package/dist/features/upload/client/index.d.ts +3 -2
- package/dist/features/upload/client/index.d.ts.map +1 -1
- package/dist/features/upload/client/index.js.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.js +0 -7
- package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
- package/dist/features/upload/client/plugin/index.js +50 -53
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/upload/server/index.d.ts +7 -3
- package/dist/features/upload/server/index.d.ts.map +1 -1
- package/dist/features/upload/server/index.js +20 -16
- package/dist/features/upload/server/index.js.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.js +1 -9
- package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/server/schema.d.ts +4 -16
- package/dist/features/upload/server/schema.d.ts.map +1 -1
- package/dist/features/upload/server/schema.js +8 -10
- package/dist/features/upload/server/schema.js.map +1 -1
- package/dist/features/upload/server/validate.d.ts +2 -2
- package/dist/features/upload/server/validate.d.ts.map +1 -1
- package/dist/features/upload/server/validate.js +4 -1
- package/dist/features/upload/server/validate.js.map +1 -1
- package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/listitem/index.js +2 -1
- package/dist/field/Diff/converters/listitem/index.js.map +1 -1
- package/dist/field/Diff/converters/relationship/index.css +0 -1
- package/dist/field/Diff/converters/unknown/index.css +0 -1
- package/dist/field/Diff/converters/upload/index.css +0 -1
- package/dist/field/Diff/converters/upload/index.js.map +1 -1
- package/dist/field/Diff/index.css +0 -2
- package/dist/field/Diff/index.d.ts +3 -2
- package/dist/field/Diff/index.d.ts.map +1 -1
- package/dist/field/Diff/index.js +3 -2
- package/dist/field/Diff/index.js.map +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +8 -1
- package/dist/field/Field.js.map +1 -1
- package/dist/field/RenderLexical/index.d.ts +3 -1
- package/dist/field/RenderLexical/index.d.ts.map +1 -1
- package/dist/field/RenderLexical/index.js +23 -23
- package/dist/field/RenderLexical/index.js.map +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 +10 -11
- package/dist/field/rscEntry.d.ts +2 -2
- package/dist/field/rscEntry.d.ts.map +1 -1
- package/dist/field/rscEntry.js.map +1 -1
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +68 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -4
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.css +21 -10
- package/dist/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/lexical/LexicalEditor.js +61 -64
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/config/server/loader.d.ts +1 -1
- package/dist/lexical/config/server/loader.d.ts.map +1 -1
- package/dist/lexical/config/server/loader.js +2 -2
- package/dist/lexical/config/server/loader.js.map +1 -1
- package/dist/lexical/config/server/sanitize.d.ts +1 -1
- package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/server/sanitize.js +2 -2
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
- package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -24
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.css +0 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +1 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
- package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
- package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
- package/dist/lexical/theme/EditorTheme.css +0 -2
- package/dist/lexical/ui/ContentEditable.d.ts +2 -1
- package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +21 -7
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H3/index.js +13 -6
- package/dist/lexical/ui/icons/H3/index.js.map +1 -1
- package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H4/index.js +13 -6
- package/dist/lexical/ui/icons/H4/index.js.map +1 -1
- package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H5/index.js +13 -6
- package/dist/lexical/ui/icons/H5/index.js.map +1 -1
- package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H6/index.js +13 -6
- package/dist/lexical/ui/icons/H6/index.js.map +1 -1
- package/dist/presets/llmInstructions.d.ts +2 -0
- package/dist/presets/llmInstructions.d.ts.map +1 -0
- package/dist/presets/llmInstructions.js +13 -0
- package/dist/presets/llmInstructions.js.map +1 -0
- package/dist/types/builtInNodes.d.ts +1 -1
- package/dist/types/builtInNodes.d.ts.map +1 -1
- package/dist/types/builtInNodes.js +8 -3
- package/dist/types/builtInNodes.js.map +1 -1
- package/dist/types/index.d.ts +4 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/jsonSchemaHelpers.d.ts +5 -1
- package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
- package/dist/types/jsonSchemaHelpers.js +7 -2
- package/dist/types/jsonSchemaHelpers.js.map +1 -1
- package/dist/types/nodeTypes.d.ts +5 -0
- package/dist/types/nodeTypes.d.ts.map +1 -1
- package/dist/types/nodeTypes.js.map +1 -1
- package/dist/utilities/buildInitialState.d.ts +3 -2
- package/dist/utilities/buildInitialState.d.ts.map +1 -1
- package/dist/utilities/buildInitialState.js +1 -0
- package/dist/utilities/buildInitialState.js.map +1 -1
- package/dist/utilities/createServerFeature.d.ts +1 -1
- package/dist/utilities/createServerFeature.d.ts.map +1 -1
- package/dist/utilities/createServerFeature.js +2 -2
- package/dist/utilities/createServerFeature.js.map +1 -1
- package/dist/utilities/editorConfigFactory.d.ts +6 -6
- package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
- package/dist/utilities/editorConfigFactory.js +9 -9
- package/dist/utilities/editorConfigFactory.js.map +1 -1
- package/dist/utilities/generateImportMap.d.ts +2 -2
- package/dist/utilities/generateImportMap.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.js.map +1 -1
- package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
- package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
- package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
- package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/index.js +6 -3
- package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
- package/dist/validate/hasText.d.ts +2 -2
- package/dist/validate/hasText.d.ts.map +1 -1
- package/dist/validate/hasText.js.map +1 -1
- package/dist/validate/index.d.ts +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/package.json +24 -24
- package/dist/dependencyChecker.spec.js +0 -16
- package/dist/dependencyChecker.spec.js.map +0 -1
- package/dist/exports/client/Field-IZKDIUJY.js +0 -2
- package/dist/exports/client/Field-IZKDIUJY.js.map +0 -7
- package/dist/exports/client/bundled.css +0 -1
- package/dist/exports/client/chunk-43E5QYAA.js +0 -2
- package/dist/exports/client/chunk-ESITTE3C.js +0 -2
- package/dist/exports/client/chunk-ESITTE3C.js.map +0 -7
- package/dist/exports/client/chunk-SSMQFWCQ.js +0 -2
- package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
- package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
- package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
- package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
- package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
- package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
- package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
- package/dist/features/link/markdownTransformer.spec.js +0 -195
- package/dist/features/link/markdownTransformer.spec.js.map +0 -1
- package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
- package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
- package/dist/lexical/utils/url.spec.js +0 -114
- package/dist/lexical/utils/url.spec.js.map +0 -1
- package/dist/utilities/jsx/jsx.spec.js +0 -178
- package/dist/utilities/jsx/jsx.spec.js.map +0 -1
- /package/dist/exports/client/{component-D5QLYS7W.js.map → component-6DQLENIE.js.map} +0 -0
- /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-HNE5G4TE.js.map} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LexicalEditor } from 'lexical';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import { useBlockReordering } from '../useBlockReordering.js';
|
|
4
|
+
export declare function BlockReordering({ children, editor, nodeKey, }: {
|
|
5
|
+
children: (props: {
|
|
6
|
+
reorderInstructionsID: string;
|
|
7
|
+
} & ReturnType<typeof useBlockReordering>) => ReactNode;
|
|
8
|
+
editor: LexicalEditor;
|
|
9
|
+
nodeKey: string;
|
|
10
|
+
}): ReactNode;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/blocks/client/component/BlockReordering/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAE7D,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,CACR,KAAK,EAAE;QAAE,qBAAqB,EAAE,MAAM,CAAA;KAAE,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,KAC7E,SAAS,CAAA;IACd,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;CAChB,aAKA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useId } from 'react';
|
|
2
|
+
import { useBlockReordering } from '../useBlockReordering.js';
|
|
3
|
+
export function BlockReordering({
|
|
4
|
+
children,
|
|
5
|
+
editor,
|
|
6
|
+
nodeKey
|
|
7
|
+
}) {
|
|
8
|
+
const reorder = useBlockReordering({
|
|
9
|
+
editor,
|
|
10
|
+
nodeKey
|
|
11
|
+
});
|
|
12
|
+
const reorderInstructionsID = useId();
|
|
13
|
+
return children({
|
|
14
|
+
...reorder,
|
|
15
|
+
reorderInstructionsID
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["useId","useBlockReordering","BlockReordering","children","editor","nodeKey","reorder","reorderInstructionsID"],"sources":["../../../../../../src/features/blocks/client/component/BlockReordering/index.tsx"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\nimport type { ReactNode } from 'react'\n\nimport { useId } from 'react'\n\nimport { useBlockReordering } from '../useBlockReordering.js'\n\nexport function BlockReordering({\n children,\n editor,\n nodeKey,\n}: {\n children: (\n props: { reorderInstructionsID: string } & ReturnType<typeof useBlockReordering>,\n ) => ReactNode\n editor: LexicalEditor\n nodeKey: string\n}) {\n const reorder = useBlockReordering({ editor, nodeKey })\n const reorderInstructionsID = useId()\n\n return children({ ...reorder, reorderInstructionsID })\n}\n"],"mappings":"AAGA,SAASA,KAAK,QAAQ;AAEtB,SAASC,kBAAkB,QAAQ;AAEnC,OAAO,SAASC,gBAAgB;EAC9BC,QAAQ;EACRC,MAAM;EACNC;AAAO,CAOR;EACC,MAAMC,OAAA,GAAUL,kBAAA,CAAmB;IAAEG,MAAA;IAAQC;EAAQ;EACrD,MAAME,qBAAA,GAAwBP,KAAA;EAE9B,OAAOG,QAAA,CAAS;IAAE,GAAGG,OAAO;IAAEC;EAAsB;AACtD","ignoreList":[]}
|
|
@@ -21,13 +21,7 @@ export type BlockComponentProps<TFormData extends Record<string, unknown> = Bloc
|
|
|
21
21
|
* Will be rendered with useBlockComponentContext hook.
|
|
22
22
|
*/
|
|
23
23
|
readonly CustomLabel?: React.FC<ViewMapBlockComponentProps>;
|
|
24
|
-
/**
|
|
25
|
-
* The block's form data (field values).
|
|
26
|
-
*/
|
|
27
24
|
readonly formData: TFormData;
|
|
28
|
-
/**
|
|
29
|
-
* The unique key identifying this block node in the current editor instance.
|
|
30
|
-
*/
|
|
31
25
|
readonly nodeKey: string;
|
|
32
26
|
};
|
|
33
27
|
export declare const BlockComponent: React.FC<BlockComponentProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAkD,MAAM,OAAO,CAAA;AAGtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAA;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEzD,OAAO,aAAa,CAAA;AACpB,OAAO,8CAA8C,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAkD,MAAM,OAAO,CAAA;AAGtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAA;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEzD,OAAO,aAAa,CAAA;AACpB,OAAO,8CAA8C,CAAA;AAmBrD,MAAM,MAAM,mBAAmB,CAAC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW,IAAI;IACzF;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAA;IAC3D;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAA;IAC3D,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAmzBxD,CAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
4
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
5
5
|
import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
|
|
6
6
|
import { getTranslation } from '@payloadcms/translations';
|
|
7
7
|
import { Button, Collapsible, Drawer, EditDepthProvider, ErrorPill, Form, formatDrawerSlug, MoreIcon, Pill, Popup, PopupList, RenderFields, SectionTitle, useConfig, useDocumentForm, useDocumentInfo, useEditDepth, useFormSubmitted, useServerFunctions, useTranslation, XIcon } from '@payloadcms/ui';
|
|
8
8
|
import { abortAndIgnore } from '@payloadcms/ui/shared';
|
|
9
9
|
import { $getNodeByKey, $getRoot, SKIP_DOM_SELECTION_TAG } from 'lexical';
|
|
10
|
-
import { deepCopyObjectSimpleWithoutReactComponents
|
|
10
|
+
import { deepCopyObjectSimpleWithoutReactComponents } from 'payload/shared';
|
|
11
11
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
12
12
|
import { v4 as uuid } from 'uuid';
|
|
13
13
|
import './index.css';
|
|
@@ -15,9 +15,10 @@ import '../../../../utilities/fieldsDrawer/index.css';
|
|
|
15
15
|
import { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js';
|
|
16
16
|
import { RegisterFormSubmit, useDrawerSubmit } from '../../../../utilities/fieldsDrawer/useDrawerSubmit.js';
|
|
17
17
|
import { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js';
|
|
18
|
+
import { getCachedFormStateIfDataMatches, reduceFormStateToBlockData } from '../getCachedFormStateIfDataMatches.js';
|
|
18
19
|
import { $isBlockNode } from '../nodes/BlocksNode.js';
|
|
19
20
|
import { BlockContent, useBlockComponentContext } from './BlockContent.js';
|
|
20
|
-
import {
|
|
21
|
+
import { BlockReordering } from './BlockReordering/index.js';
|
|
21
22
|
export const BlockComponent = props => {
|
|
22
23
|
const {
|
|
23
24
|
cacheBuster,
|
|
@@ -68,31 +69,43 @@ export const BlockComponent = props => {
|
|
|
68
69
|
const [editor] = useLexicalComposerContext();
|
|
69
70
|
const isEditable = useLexicalEditable();
|
|
70
71
|
const blockType = formData.blockType;
|
|
72
|
+
const formDataRef = useRef(formData);
|
|
73
|
+
formDataRef.current = formData;
|
|
74
|
+
const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.${blockType}`;
|
|
75
|
+
const clientSchemaMap = featureClientSchemaMap['blocks'];
|
|
76
|
+
const blocksField = clientSchemaMap?.[componentMapRenderedBlockPath]?.[0];
|
|
77
|
+
const blockOrSlug = blocksField?.blocks?.[0];
|
|
78
|
+
const clientBlock = typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug;
|
|
71
79
|
const {
|
|
72
80
|
getFormState
|
|
73
81
|
} = useServerFunctions();
|
|
74
82
|
const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.${blockType}.fields`;
|
|
75
83
|
const [initialState, setInitialState] = React.useState(() => {
|
|
76
84
|
// Initial form state that was calculated server-side. May have stale values
|
|
77
|
-
const
|
|
85
|
+
const cachedState = initialLexicalFormState?.[formData.id];
|
|
86
|
+
const cachedFormState = cachedState?.formState;
|
|
78
87
|
if (!cachedFormState) {
|
|
79
88
|
return false;
|
|
80
89
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
const matchingCachedState = getCachedFormStateIfDataMatches({
|
|
91
|
+
cachedFormState,
|
|
92
|
+
cachedSchemaPath: cachedState.schemaPath,
|
|
93
|
+
currentSchemaPath: schemaFieldsPath,
|
|
94
|
+
formData
|
|
95
|
+
});
|
|
96
|
+
if (!matchingCachedState) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
88
99
|
// Manually add blockName, as it's not part of cachedFormState
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
return {
|
|
101
|
+
...matchingCachedState,
|
|
102
|
+
blockName: {
|
|
103
|
+
initialValue: formData.blockName,
|
|
104
|
+
passesCondition: true,
|
|
105
|
+
valid: true,
|
|
106
|
+
value: formData.blockName
|
|
107
|
+
}
|
|
94
108
|
};
|
|
95
|
-
return mergedState;
|
|
96
109
|
});
|
|
97
110
|
const hasMounted = useRef(false);
|
|
98
111
|
const prevCacheBuster = useRef(cacheBuster);
|
|
@@ -191,9 +204,9 @@ export const BlockComponent = props => {
|
|
|
191
204
|
valid: true,
|
|
192
205
|
value: formData.blockName
|
|
193
206
|
};
|
|
194
|
-
const newFormStateData =
|
|
207
|
+
const newFormStateData = reduceFormStateToBlockData(deepCopyObjectSimpleWithoutReactComponents(state, {
|
|
195
208
|
excludeFiles: true
|
|
196
|
-
})
|
|
209
|
+
}));
|
|
197
210
|
// Things like default values may come back from the server => update the node with the new data
|
|
198
211
|
editor.update(() => {
|
|
199
212
|
const node = $getNodeByKey(nodeKey);
|
|
@@ -217,19 +230,14 @@ export const BlockComponent = props => {
|
|
|
217
230
|
}
|
|
218
231
|
}
|
|
219
232
|
};
|
|
220
|
-
if (formData && !initialState) {
|
|
233
|
+
if (clientBlock && formData && !initialState) {
|
|
221
234
|
void awaitInitialState();
|
|
222
235
|
}
|
|
223
236
|
return () => {
|
|
224
237
|
abortAndIgnore(abortController);
|
|
225
238
|
};
|
|
226
|
-
}, [getFormState, schemaFieldsPath, isEditable, id, CustomLabelFromProps, CustomBlockFromProps, formData, editor, nodeKey, initialState, collectionSlug, globalSlug, getDocPreferences, parentDocumentFields, blockType]);
|
|
239
|
+
}, [getFormState, schemaFieldsPath, isEditable, id, CustomLabelFromProps, CustomBlockFromProps, formData, editor, nodeKey, initialState, collectionSlug, globalSlug, getDocPreferences, parentDocumentFields, blockType, clientBlock]);
|
|
227
240
|
const [isCollapsed, setIsCollapsed] = React.useState(initialLexicalFormState?.[formData.id]?.collapsed ?? false);
|
|
228
|
-
const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.${blockType}`;
|
|
229
|
-
const clientSchemaMap = featureClientSchemaMap['blocks'];
|
|
230
|
-
const blocksField = clientSchemaMap?.[componentMapRenderedBlockPath]?.[0];
|
|
231
|
-
const blockOrSlug = blocksField?.blocks?.[0];
|
|
232
|
-
const clientBlock = typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug;
|
|
233
241
|
const {
|
|
234
242
|
i18n,
|
|
235
243
|
t
|
|
@@ -241,11 +249,15 @@ export const BlockComponent = props => {
|
|
|
241
249
|
abortAndIgnore(onChangeAbortControllerRef.current);
|
|
242
250
|
const controller = new AbortController();
|
|
243
251
|
onChangeAbortControllerRef.current = controller;
|
|
252
|
+
const blockData = reduceFormStateToBlockData(deepCopyObjectSimpleWithoutReactComponents(prevFormState, {
|
|
253
|
+
excludeFiles: true
|
|
254
|
+
}), formDataRef.current);
|
|
244
255
|
const {
|
|
245
256
|
state: newFormState
|
|
246
257
|
} = await getFormState({
|
|
247
258
|
id,
|
|
248
259
|
collectionSlug,
|
|
260
|
+
data: blockData,
|
|
249
261
|
docPermissions: {
|
|
250
262
|
fields: true
|
|
251
263
|
},
|
|
@@ -255,7 +267,7 @@ export const BlockComponent = props => {
|
|
|
255
267
|
}),
|
|
256
268
|
formState: prevFormState,
|
|
257
269
|
globalSlug,
|
|
258
|
-
|
|
270
|
+
initialBlockData: blockData,
|
|
259
271
|
operation: 'update',
|
|
260
272
|
readOnly: !isEditable,
|
|
261
273
|
renderAllFields: submit ? true : false,
|
|
@@ -268,11 +280,9 @@ export const BlockComponent = props => {
|
|
|
268
280
|
if (prevFormState.blockName) {
|
|
269
281
|
newFormState.blockName = prevFormState.blockName;
|
|
270
282
|
}
|
|
271
|
-
const newFormStateData_0 =
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
})
|
|
275
|
-
}), true);
|
|
283
|
+
const newFormStateData_0 = reduceFormStateToBlockData(deepCopyObjectSimpleWithoutReactComponents(newFormState, {
|
|
284
|
+
excludeFiles: true
|
|
285
|
+
}), blockData);
|
|
276
286
|
setTimeout(() => {
|
|
277
287
|
editor.update(() => {
|
|
278
288
|
const node_0 = $getNodeByKey(nodeKey);
|
|
@@ -394,7 +404,7 @@ export const BlockComponent = props => {
|
|
|
394
404
|
round: true,
|
|
395
405
|
tooltip: "Remove Block"
|
|
396
406
|
}), [baseClass, isEditable, removeBlock]);
|
|
397
|
-
const BlockCollapsible = useMemo(() => ({
|
|
407
|
+
const BlockCollapsible = useMemo(() => function BlockCollapsible({
|
|
398
408
|
Actions,
|
|
399
409
|
children: children_0,
|
|
400
410
|
className,
|
|
@@ -408,77 +418,134 @@ export const BlockComponent = props => {
|
|
|
408
418
|
removeButton,
|
|
409
419
|
showDragHandle = true,
|
|
410
420
|
showRowNumber = true
|
|
411
|
-
})
|
|
412
|
-
return /*#__PURE__*/_jsx(
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
421
|
+
}) {
|
|
422
|
+
return /*#__PURE__*/_jsx(BlockReordering, {
|
|
423
|
+
editor: editor,
|
|
424
|
+
nodeKey: nodeKey,
|
|
425
|
+
children: ({
|
|
426
|
+
isReordering,
|
|
427
|
+
move,
|
|
428
|
+
onBlur,
|
|
429
|
+
onKeyDown,
|
|
430
|
+
reorderInstructionsID,
|
|
431
|
+
targetIndex
|
|
432
|
+
}) => /*#__PURE__*/_jsx("div", {
|
|
433
|
+
className: `${baseClass}__container ${baseClass}-${blockType}`,
|
|
434
|
+
onKeyDownCapture: event => {
|
|
435
|
+
const target = event.target;
|
|
436
|
+
if (event.altKey || event.ctrlKey || event.metaKey || target.closest('.collapsible')?.parentElement !== event.currentTarget) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
// Handle controls before Lexical consumes keys using its retained text selection.
|
|
440
|
+
if (target.matches('.collapsible__drag') && (event.key !== 'Escape' || isReordering) && [' ', 'ArrowDown', 'ArrowUp', 'Enter', 'Escape', 'Tab'].includes(event.key)) {
|
|
441
|
+
onKeyDown(event);
|
|
442
|
+
event.stopPropagation();
|
|
443
|
+
} else if (event.key === 'Tab' && target.matches('.collapsible__toggle')) {
|
|
444
|
+
event.stopPropagation();
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
children: /*#__PURE__*/_jsxs(Collapsible, {
|
|
448
|
+
actions: typeof Actions !== 'undefined' ? Actions : isEditable ? /*#__PURE__*/_jsx(Popup, {
|
|
449
|
+
button: /*#__PURE__*/_jsx(MoreIcon, {}),
|
|
450
|
+
buttonAriaLabel: t('general:moreOptions'),
|
|
451
|
+
buttonClassName: `${baseClass}__actions-button`,
|
|
452
|
+
caret: false,
|
|
453
|
+
horizontalAlign: "right",
|
|
454
|
+
popupType: "menu",
|
|
455
|
+
render: ({
|
|
456
|
+
close
|
|
457
|
+
}) => /*#__PURE__*/_jsxs(PopupList.ButtonGroup, {
|
|
458
|
+
buttonSize: "medium",
|
|
459
|
+
children: [/*#__PURE__*/_jsx(PopupList.Button, {
|
|
460
|
+
onClick: () => {
|
|
461
|
+
close();
|
|
462
|
+
move({
|
|
463
|
+
direction: -1
|
|
464
|
+
});
|
|
465
|
+
},
|
|
466
|
+
children: t('general:moveUp')
|
|
467
|
+
}), /*#__PURE__*/_jsx(PopupList.Button, {
|
|
468
|
+
onClick: () => {
|
|
469
|
+
close();
|
|
470
|
+
move({
|
|
471
|
+
direction: 1
|
|
472
|
+
});
|
|
473
|
+
},
|
|
474
|
+
children: t('general:moveDown')
|
|
475
|
+
}), (resolvedCustomBlock && editButton !== false || !resolvedCustomBlock && editButton) && /*#__PURE__*/_jsx(PopupList.Button, {
|
|
476
|
+
onClick: () => {
|
|
477
|
+
toggleDrawer();
|
|
478
|
+
close();
|
|
479
|
+
},
|
|
480
|
+
children: t('general:edit')
|
|
481
|
+
}), removeButton !== false && /*#__PURE__*/_jsxs(PopupList.Button, {
|
|
482
|
+
onClick: () => {
|
|
483
|
+
removeBlock();
|
|
484
|
+
close();
|
|
485
|
+
},
|
|
486
|
+
children: [/*#__PURE__*/_jsx(XIcon, {}), t('general:remove')]
|
|
487
|
+
})]
|
|
488
|
+
}),
|
|
489
|
+
size: "large"
|
|
490
|
+
}) : null,
|
|
491
|
+
className: [`${baseClass}__row`, fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`, className].filter(Boolean).join(' '),
|
|
492
|
+
collapsibleStyle: fieldHasErrors ? 'error' : 'default',
|
|
493
|
+
dragHandleProps: showDragHandle && isEditable ? {
|
|
494
|
+
id: nodeKey,
|
|
495
|
+
attributes: {
|
|
496
|
+
'aria-describedby': reorderInstructionsID,
|
|
497
|
+
'aria-pressed': isReordering,
|
|
498
|
+
role: 'button',
|
|
499
|
+
tabIndex: 0
|
|
500
|
+
},
|
|
501
|
+
listeners: {
|
|
502
|
+
onBlur
|
|
503
|
+
}
|
|
504
|
+
} : undefined,
|
|
505
|
+
header: /*#__PURE__*/_jsx("div", {
|
|
506
|
+
className: `${baseClass}__block-header`,
|
|
507
|
+
children: typeof Label !== 'undefined' ? Label : typeof resolvedCustomLabel !== 'undefined' ? resolvedCustomLabel : /*#__PURE__*/_jsxs("div", {
|
|
508
|
+
className: `${baseClass}__block-label`,
|
|
509
|
+
children: [showRowNumber && /*#__PURE__*/_jsx("span", {
|
|
510
|
+
className: `${baseClass}__block-number`,
|
|
511
|
+
children: String(rowIndex + 1).padStart(2, '0')
|
|
512
|
+
}), typeof CustomPill !== 'undefined' ? CustomPill : /*#__PURE__*/_jsx(Pill, {
|
|
513
|
+
className: `${baseClass}__block-pill ${baseClass}__block-pill-${blockType}`,
|
|
514
|
+
pillStyle: "white",
|
|
515
|
+
size: "small",
|
|
516
|
+
children: blockDisplayName ?? blockType
|
|
517
|
+
}), !disableBlockName && !clientBlock?.admin?.disableBlockName && /*#__PURE__*/_jsx(SectionTitle, {
|
|
518
|
+
path: "blockName",
|
|
519
|
+
readOnly: !isEditable
|
|
520
|
+
}), fieldHasErrors && /*#__PURE__*/_jsx(ErrorPill, {
|
|
521
|
+
count: errorCount_0 ?? 0,
|
|
522
|
+
i18n: i18n,
|
|
523
|
+
withMessage: true
|
|
524
|
+
})]
|
|
525
|
+
})
|
|
437
526
|
}),
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
dragHandleProps: showDragHandle ? {
|
|
443
|
-
id: nodeKey,
|
|
444
|
-
attributes: {
|
|
445
|
-
role: 'button',
|
|
446
|
-
tabIndex: 0
|
|
527
|
+
isCollapsed: isCollapsed,
|
|
528
|
+
onToggle: incomingCollapsedState => {
|
|
529
|
+
onCollapsedChange(incomingCollapsedState);
|
|
530
|
+
setIsCollapsed(incomingCollapsedState);
|
|
447
531
|
},
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
children: [showRowNumber && /*#__PURE__*/_jsx("span", {
|
|
455
|
-
className: `${baseClass}__block-number`,
|
|
456
|
-
children: String(rowIndex + 1).padStart(2, '0')
|
|
457
|
-
}), typeof CustomPill !== 'undefined' ? CustomPill : /*#__PURE__*/_jsx(Pill, {
|
|
458
|
-
className: `${baseClass}__block-pill ${baseClass}__block-pill-${blockType}`,
|
|
459
|
-
pillStyle: "white",
|
|
460
|
-
size: "small",
|
|
461
|
-
children: blockDisplayName ?? blockType
|
|
462
|
-
}), !disableBlockName && !clientBlock?.admin?.disableBlockName && /*#__PURE__*/_jsx(SectionTitle, {
|
|
463
|
-
path: "blockName",
|
|
464
|
-
readOnly: !isEditable
|
|
465
|
-
}), fieldHasErrors && /*#__PURE__*/_jsx(ErrorPill, {
|
|
466
|
-
count: errorCount_0 ?? 0,
|
|
467
|
-
i18n: i18n,
|
|
468
|
-
withMessage: true
|
|
532
|
+
...(collapsibleProps || {}),
|
|
533
|
+
AfterCollapsible: /*#__PURE__*/_jsxs(_Fragment, {
|
|
534
|
+
children: [collapsibleProps?.AfterCollapsible, /*#__PURE__*/_jsx("span", {
|
|
535
|
+
className: "sr-only",
|
|
536
|
+
role: "status",
|
|
537
|
+
children: isReordering ? `${t('general:order')}: ${(targetIndex ?? 0) + 1}` : ''
|
|
469
538
|
})]
|
|
470
|
-
})
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
},
|
|
477
|
-
|
|
478
|
-
children: children_0
|
|
479
|
-
}, 0)
|
|
539
|
+
}),
|
|
540
|
+
children: [/*#__PURE__*/_jsxs("span", {
|
|
541
|
+
className: "sr-only",
|
|
542
|
+
id: reorderInstructionsID,
|
|
543
|
+
children: ["Space / Enter · ", t('general:moveUp'), " ↑ · ", t('general:moveDown'), " ↓ ·", ' ', t('general:cancel'), " Escape"]
|
|
544
|
+
}), children_0]
|
|
545
|
+
}, 0)
|
|
546
|
+
})
|
|
480
547
|
});
|
|
481
|
-
}, [resolvedCustomBlock, resolvedCustomLabel, blockDisplayName, baseClass, clientBlock?.admin?.disableBlockName, blockType, i18n, isCollapsed, onCollapsedChange, isEditable, nodeKey, removeBlock, rowIndex, t, toggleDrawer]);
|
|
548
|
+
}, [editor, resolvedCustomBlock, resolvedCustomLabel, blockDisplayName, baseClass, clientBlock?.admin?.disableBlockName, blockType, i18n, isCollapsed, onCollapsedChange, isEditable, nodeKey, removeBlock, rowIndex, t, toggleDrawer]);
|
|
482
549
|
const blockID = formData?.id;
|
|
483
550
|
const {
|
|
484
551
|
headerActions,
|
|
@@ -532,8 +599,9 @@ export const BlockComponent = props => {
|
|
|
532
599
|
fields: clientBlock?.fields ?? [],
|
|
533
600
|
initialState: initialState,
|
|
534
601
|
onChange: [onChange],
|
|
535
|
-
onSubmit:
|
|
602
|
+
onSubmit: formState_0 => {
|
|
536
603
|
// This is only called when form is submitted from drawer - usually only the case if the block has a custom Block component
|
|
604
|
+
const newData_1 = reduceFormStateToBlockData(formState_0, formDataRef.current);
|
|
537
605
|
newData_1.blockType = blockType;
|
|
538
606
|
editor.update(() => {
|
|
539
607
|
const node_1 = $getNodeByKey(nodeKey);
|