@payloadcms/richtext-lexical 3.68.0-internal-debug.2eb12b9 → 3.68.0-internal-debug.dafc24d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cell/rscEntry.js +13 -5
- package/dist/cell/rscEntry.js.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.js +29 -9
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/blocks/client/component/components/BlockCollapsible.js +7 -3
- package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -1
- package/dist/features/blocks/client/component/components/BlockEditButton.js +6 -2
- package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -1
- package/dist/features/blocks/client/component/components/BlockRemoveButton.js +6 -2
- package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -1
- package/dist/features/blocks/client/component/index.js +124 -43
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/component/index.scss +188 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js +7 -3
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -1
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js +6 -2
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -1
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js +6 -2
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -1
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js +6 -2
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +118 -37
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.scss +90 -0
- package/dist/features/blocks/client/getBlockImageComponent.js +7 -3
- package/dist/features/blocks/client/getBlockImageComponent.js.map +1 -1
- package/dist/features/blocks/client/markdown/markdownTransformer.js +1 -0
- package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.js +7 -3
- package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/client/nodes/InlineBlocksNode.js +7 -3
- package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js +88 -27
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Code.js +7 -3
- package/dist/features/blocks/premade/CodeBlock/Component/Code.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js +13 -4
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.scss +6 -0
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js +19 -6
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.scss +29 -0
- package/dist/features/blocks/premade/CodeBlock/Component/index.scss +97 -0
- package/dist/features/blocks/server/markdown/markdownTransformer.js +1 -0
- package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/Component/index.js +9 -5
- package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js +7 -3
- package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +7 -3
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js +6 -2
- package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js +6 -2
- package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/link.js +13 -5
- package/dist/features/converters/lexicalToJSX/converter/converters/link.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js +38 -14
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js +18 -6
- package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/table.js +31 -11
- package/dist/features/converters/lexicalToJSX/converter/converters/table.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/text.js +43 -15
- package/dist/features/converters/lexicalToJSX/converter/converters/text.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +31 -11
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/index.js +8 -4
- package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
- package/dist/features/debug/jsxConverter/client/plugin/index.js +14 -5
- package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
- package/dist/features/debug/jsxConverter/client/plugin/style.scss +12 -0
- package/dist/features/debug/testRecorder/client/plugin/index.js +62 -21
- package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
- package/dist/features/debug/testRecorder/client/plugin/index.scss +53 -0
- package/dist/features/debug/treeView/client/plugin/index.js +8 -3
- package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
- package/dist/features/debug/treeView/client/plugin/index.scss +80 -0
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +225 -72
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.scss +87 -0
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +32 -11
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.scss +11 -0
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +21 -9
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +26 -9
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.scss +233 -0
- package/dist/features/horizontalRule/client/plugin/index.js +1 -0
- package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
- package/dist/features/horizontalRule/client/plugin/index.scss +23 -0
- package/dist/features/indent/client/IndentPlugin.js +6 -2
- package/dist/features/indent/client/IndentPlugin.js.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.js +3 -0
- package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
- package/dist/features/link/client/plugins/clickableLink/index.js +6 -2
- package/dist/features/link/client/plugins/clickableLink/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +76 -24
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js +8 -3
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.scss +92 -0
- package/dist/features/link/server/baseFields.js +1 -0
- package/dist/features/link/server/baseFields.js.map +1 -1
- package/dist/features/lists/checklist/client/plugin/index.js +6 -2
- package/dist/features/lists/checklist/client/plugin/index.js.map +1 -1
- package/dist/features/lists/plugin/index.js +6 -2
- package/dist/features/lists/plugin/index.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +14 -5
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +7 -3
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.scss +16 -0
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +14 -5
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +7 -3
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.scss +16 -0
- package/dist/features/relationship/client/components/RelationshipComponent.js +56 -19
- package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
- package/dist/features/relationship/client/components/index.scss +95 -0
- package/dist/features/relationship/client/drawer/index.js +18 -6
- package/dist/features/relationship/client/drawer/index.js.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.js +7 -3
- package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +7 -3
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/textState/feature.client.js +18 -6
- package/dist/features/textState/feature.client.js.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +72 -23
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.scss +113 -0
- package/dist/features/toolbars/inline/client/Toolbar/index.js +72 -23
- package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.scss +58 -0
- package/dist/features/toolbars/shared/ToolbarButton/index.js +8 -3
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.scss +46 -0
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +60 -20
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +37 -12
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.scss +129 -0
- package/dist/features/upload/client/component/index.js +92 -31
- package/dist/features/upload/client/component/index.js.map +1 -1
- package/dist/features/upload/client/component/index.scss +191 -0
- package/dist/features/upload/client/component/pending/index.js +14 -5
- package/dist/features/upload/client/component/pending/index.js.map +1 -1
- package/dist/features/upload/client/drawer/index.js +18 -6
- package/dist/features/upload/client/drawer/index.js.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.js +12 -4
- package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/client/plugin/index.js +7 -3
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/field/Diff/converters/listitem/index.js +37 -12
- package/dist/field/Diff/converters/listitem/index.js.map +1 -1
- package/dist/field/Diff/converters/listitem/index.scss +47 -0
- package/dist/field/Diff/converters/relationship/index.js +37 -12
- package/dist/field/Diff/converters/relationship/index.js.map +1 -1
- package/dist/field/Diff/converters/relationship/index.scss +73 -0
- package/dist/field/Diff/converters/unknown/index.js +31 -10
- package/dist/field/Diff/converters/unknown/index.js.map +1 -1
- package/dist/field/Diff/converters/unknown/index.scss +40 -0
- package/dist/field/Diff/converters/upload/index.js +60 -19
- package/dist/field/Diff/converters/upload/index.js.map +1 -1
- package/dist/field/Diff/converters/upload/index.scss +115 -0
- package/dist/field/Diff/index.js +8 -3
- package/dist/field/Diff/index.js.map +1 -1
- package/dist/field/Diff/index.scss +102 -0
- package/dist/field/Field.js +81 -27
- package/dist/field/Field.js.map +1 -1
- package/dist/field/RenderLexical/index.js +36 -12
- package/dist/field/RenderLexical/index.js.map +1 -1
- package/dist/field/index.js +19 -7
- package/dist/field/index.js.map +1 -1
- package/dist/field/index.scss +41 -0
- package/dist/field/rscEntry.js +7 -3
- package/dist/field/rscEntry.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lexical/EditorPlugin.js +13 -5
- package/dist/lexical/EditorPlugin.js.map +1 -1
- package/dist/lexical/LexicalEditor.js +163 -50
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/LexicalEditor.scss +54 -0
- package/dist/lexical/LexicalProvider.js +49 -17
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/EditorConfigProvider.js +7 -3
- package/dist/lexical/config/client/EditorConfigProvider.js.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/DecoratorPlugin/index.scss +13 -0
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +20 -7
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.scss +54 -0
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -0
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +7 -3
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.js +50 -16
- package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.scss +68 -0
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +20 -7
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +35 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +32 -11
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.scss +80 -0
- package/dist/lexical/theme/EditorTheme.scss +357 -0
- package/dist/lexical/ui/ContentEditable.js +14 -5
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/lexical/ui/ContentEditable.scss +105 -0
- package/dist/lexical/ui/icons/AI/index.js +37 -13
- package/dist/lexical/ui/icons/AI/index.js.map +1 -1
- package/dist/lexical/ui/icons/Add/index.js +19 -7
- package/dist/lexical/ui/icons/Add/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignCenter/index.js +25 -9
- package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignJustify/index.js +25 -9
- package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignLeft/index.js +25 -9
- package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignRight/index.js +25 -9
- package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
- package/dist/lexical/ui/icons/Block/index.js +25 -9
- package/dist/lexical/ui/icons/Block/index.js.map +1 -1
- package/dist/lexical/ui/icons/Blockquote/index.js +13 -5
- package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
- package/dist/lexical/ui/icons/Bold/index.js +13 -5
- package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
- package/dist/lexical/ui/icons/Checklist/index.js +19 -7
- package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
- package/dist/lexical/ui/icons/Code/index.js +19 -7
- package/dist/lexical/ui/icons/Code/index.js.map +1 -1
- package/dist/lexical/ui/icons/CodeBlock/index.js +13 -5
- package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
- package/dist/lexical/ui/icons/Collapse/index.js +13 -5
- package/dist/lexical/ui/icons/Collapse/index.js.map +1 -1
- package/dist/lexical/ui/icons/H1/index.js +13 -5
- package/dist/lexical/ui/icons/H1/index.js.map +1 -1
- package/dist/lexical/ui/icons/H2/index.js +13 -5
- package/dist/lexical/ui/icons/H2/index.js.map +1 -1
- package/dist/lexical/ui/icons/H3/index.js +13 -5
- package/dist/lexical/ui/icons/H3/index.js.map +1 -1
- package/dist/lexical/ui/icons/H4/index.js +13 -5
- package/dist/lexical/ui/icons/H4/index.js.map +1 -1
- package/dist/lexical/ui/icons/H5/index.js +13 -5
- package/dist/lexical/ui/icons/H5/index.js.map +1 -1
- package/dist/lexical/ui/icons/H6/index.js +13 -5
- package/dist/lexical/ui/icons/H6/index.js.map +1 -1
- package/dist/lexical/ui/icons/HorizontalRule/index.js +13 -5
- package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
- package/dist/lexical/ui/icons/IndentDecrease/index.js +31 -11
- package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
- package/dist/lexical/ui/icons/IndentIncrease/index.js +31 -11
- package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
- package/dist/lexical/ui/icons/InlineBlocks/index.js +13 -5
- package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
- package/dist/lexical/ui/icons/Italic/index.js +13 -5
- package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
- package/dist/lexical/ui/icons/Link/index.js +13 -5
- package/dist/lexical/ui/icons/Link/index.js.map +1 -1
- package/dist/lexical/ui/icons/Meatballs/index.js +25 -9
- package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
- package/dist/lexical/ui/icons/OrderedList/index.js +37 -13
- package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
- package/dist/lexical/ui/icons/Relationship/index.js +37 -13
- package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
- package/dist/lexical/ui/icons/Strikethrough/index.js +19 -7
- package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
- package/dist/lexical/ui/icons/Subscript/index.js +13 -5
- package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
- package/dist/lexical/ui/icons/Superscript/index.js +13 -5
- package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
- package/dist/lexical/ui/icons/Table/index.js +13 -5
- package/dist/lexical/ui/icons/Table/index.js.map +1 -1
- package/dist/lexical/ui/icons/Text/index.js +13 -5
- package/dist/lexical/ui/icons/Text/index.js.map +1 -1
- package/dist/lexical/ui/icons/TextState/index.js +7 -3
- package/dist/lexical/ui/icons/TextState/index.js.map +1 -1
- package/dist/lexical/ui/icons/Underline/index.js +19 -7
- package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
- package/dist/lexical/ui/icons/UnorderedList/index.js +43 -15
- package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
- package/dist/lexical/ui/icons/Upload/index.js +25 -9
- package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
- package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +2 -0
- package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +1 -1
- package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +2 -0
- package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +1 -1
- package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +2 -0
- package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.js +19 -7
- package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.js +19 -7
- package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +7 -3
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js +7 -3
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +2 -0
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +2 -0
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
- package/package.json +8 -7
package/dist/cell/rscEntry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { getTranslation } from '@payloadcms/translations';
|
|
3
3
|
import { Link } from '@payloadcms/ui';
|
|
4
4
|
import { formatAdminURL } from 'payload/shared';
|
|
@@ -10,13 +10,17 @@ function recurseEditorState(editorState, textContent, i = 0) {
|
|
|
10
10
|
textContent.push(node.text);
|
|
11
11
|
} else {
|
|
12
12
|
if (!('children' in node)) {
|
|
13
|
-
textContent.push(/*#__PURE__*/
|
|
13
|
+
textContent.push(/*#__PURE__*/ _jsxDEV("code", {
|
|
14
14
|
children: [
|
|
15
15
|
" [",
|
|
16
16
|
node.type,
|
|
17
17
|
"]"
|
|
18
18
|
]
|
|
19
|
-
}, i
|
|
19
|
+
}, i, true, {
|
|
20
|
+
fileName: "src/cell/rscEntry.tsx",
|
|
21
|
+
lineNumber: 21,
|
|
22
|
+
columnNumber: 26
|
|
23
|
+
}, this));
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
if ('children' in node && node.children) {
|
|
@@ -65,10 +69,14 @@ export const RscEntryLexicalCell = (props)=>{
|
|
|
65
69
|
})
|
|
66
70
|
];
|
|
67
71
|
}
|
|
68
|
-
return /*#__PURE__*/
|
|
72
|
+
return /*#__PURE__*/ _jsxDEV(WrapElement, {
|
|
69
73
|
...wrapElementProps,
|
|
70
74
|
children: textContent
|
|
71
|
-
}
|
|
75
|
+
}, void 0, false, {
|
|
76
|
+
fileName: "src/cell/rscEntry.tsx",
|
|
77
|
+
lineNumber: 104,
|
|
78
|
+
columnNumber: 10
|
|
79
|
+
}, this);
|
|
72
80
|
};
|
|
73
81
|
|
|
74
82
|
//# sourceMappingURL=rscEntry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cell/rscEntry.tsx"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { Link } from '@payloadcms/ui'\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\nimport type { LexicalRichTextCellProps } from '../types.js'\n\nfunction recurseEditorState(\n editorState: SerializedLexicalNode[],\n textContent: React.ReactNode[],\n i: number = 0,\n): React.ReactNode[] {\n for (const node of editorState) {\n i++\n if ('text' in node && node.text) {\n textContent.push(node.text as string)\n } else {\n if (!('children' in node)) {\n textContent.push(<code key={i}> [{node.type}]</code>)\n }\n }\n if ('children' in node && node.children) {\n textContent = recurseEditorState(node.children as SerializedLexicalNode[], textContent, i)\n }\n }\n return textContent\n}\n\nexport const RscEntryLexicalCell: React.FC<LexicalRichTextCellProps> = (props) => {\n const {\n cellData,\n className: classNameFromProps,\n collectionConfig,\n field: { admin },\n field,\n i18n,\n link,\n onClick: onClickFromProps,\n payload,\n rowData,\n } = props\n\n const classNameFromConfigContext = admin && 'className' in admin ? admin.className : undefined\n\n const className =\n classNameFromProps ||\n (field.admin && 'className' in field.admin ? field.admin.className : null) ||\n classNameFromConfigContext\n const adminRoute = payload.config.routes.admin\n\n const onClick = onClickFromProps\n\n let WrapElement: React.ComponentType<any> | string = 'span'\n\n const wrapElementProps: {\n className?: string\n href?: string\n onClick?: () => void\n prefetch?: false\n type?: 'button'\n } = {\n className,\n }\n\n if (link) {\n wrapElementProps.prefetch = false\n WrapElement = Link\n wrapElementProps.href = collectionConfig?.slug\n ? formatAdminURL({\n adminRoute,\n path: `/collections/${collectionConfig?.slug}/${rowData.id}`,\n })\n : ''\n }\n\n if (typeof onClick === 'function') {\n WrapElement = 'button'\n wrapElementProps.type = 'button'\n wrapElementProps.onClick = () => {\n onClick({\n cellData,\n collectionSlug: collectionConfig?.slug,\n rowData,\n })\n }\n }\n\n let textContent: React.ReactNode[] = []\n\n if (cellData?.root?.children) {\n textContent = recurseEditorState(cellData?.root?.children, textContent)\n }\n\n if (!textContent?.length) {\n textContent = [\n i18n.t('general:noLabel', {\n label: getTranslation(('label' in field ? field.label : null) || 'data', i18n),\n }),\n ]\n }\n\n return <WrapElement {...wrapElementProps}>{textContent}</WrapElement>\n}\n"],"names":["getTranslation","Link","formatAdminURL","React","recurseEditorState","editorState","textContent","i","node","text","push","code","type","children","RscEntryLexicalCell","props","cellData","className","classNameFromProps","collectionConfig","field","admin","i18n","link","onClick","onClickFromProps","payload","rowData","classNameFromConfigContext","undefined","adminRoute","config","routes","WrapElement","wrapElementProps","prefetch","href","slug","path","id","collectionSlug","root","length","t","label"],"mappings":";AAEA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,SAASC,IAAI,QAAQ,iBAAgB;AACrC,SAASC,cAAc,QAAQ,iBAAgB;AAC/C,OAAOC,WAAW,QAAO;AAIzB,SAASC,mBACPC,WAAoC,EACpCC,WAA8B,EAC9BC,IAAY,CAAC;IAEb,KAAK,MAAMC,QAAQH,YAAa;QAC9BE;QACA,IAAI,UAAUC,QAAQA,KAAKC,IAAI,EAAE;YAC/BH,YAAYI,IAAI,CAACF,KAAKC,IAAI;QAC5B,OAAO;YACL,IAAI,CAAE,CAAA,cAAcD,IAAG,GAAI;gBACzBF,YAAYI,IAAI,eAAC,
|
|
1
|
+
{"version":3,"sources":["../../src/cell/rscEntry.tsx"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { Link } from '@payloadcms/ui'\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\nimport type { LexicalRichTextCellProps } from '../types.js'\n\nfunction recurseEditorState(\n editorState: SerializedLexicalNode[],\n textContent: React.ReactNode[],\n i: number = 0,\n): React.ReactNode[] {\n for (const node of editorState) {\n i++\n if ('text' in node && node.text) {\n textContent.push(node.text as string)\n } else {\n if (!('children' in node)) {\n textContent.push(<code key={i}> [{node.type}]</code>)\n }\n }\n if ('children' in node && node.children) {\n textContent = recurseEditorState(node.children as SerializedLexicalNode[], textContent, i)\n }\n }\n return textContent\n}\n\nexport const RscEntryLexicalCell: React.FC<LexicalRichTextCellProps> = (props) => {\n const {\n cellData,\n className: classNameFromProps,\n collectionConfig,\n field: { admin },\n field,\n i18n,\n link,\n onClick: onClickFromProps,\n payload,\n rowData,\n } = props\n\n const classNameFromConfigContext = admin && 'className' in admin ? admin.className : undefined\n\n const className =\n classNameFromProps ||\n (field.admin && 'className' in field.admin ? field.admin.className : null) ||\n classNameFromConfigContext\n const adminRoute = payload.config.routes.admin\n\n const onClick = onClickFromProps\n\n let WrapElement: React.ComponentType<any> | string = 'span'\n\n const wrapElementProps: {\n className?: string\n href?: string\n onClick?: () => void\n prefetch?: false\n type?: 'button'\n } = {\n className,\n }\n\n if (link) {\n wrapElementProps.prefetch = false\n WrapElement = Link\n wrapElementProps.href = collectionConfig?.slug\n ? formatAdminURL({\n adminRoute,\n path: `/collections/${collectionConfig?.slug}/${rowData.id}`,\n })\n : ''\n }\n\n if (typeof onClick === 'function') {\n WrapElement = 'button'\n wrapElementProps.type = 'button'\n wrapElementProps.onClick = () => {\n onClick({\n cellData,\n collectionSlug: collectionConfig?.slug,\n rowData,\n })\n }\n }\n\n let textContent: React.ReactNode[] = []\n\n if (cellData?.root?.children) {\n textContent = recurseEditorState(cellData?.root?.children, textContent)\n }\n\n if (!textContent?.length) {\n textContent = [\n i18n.t('general:noLabel', {\n label: getTranslation(('label' in field ? field.label : null) || 'data', i18n),\n }),\n ]\n }\n\n return <WrapElement {...wrapElementProps}>{textContent}</WrapElement>\n}\n"],"names":["getTranslation","Link","formatAdminURL","React","recurseEditorState","editorState","textContent","i","node","text","push","code","type","children","RscEntryLexicalCell","props","cellData","className","classNameFromProps","collectionConfig","field","admin","i18n","link","onClick","onClickFromProps","payload","rowData","classNameFromConfigContext","undefined","adminRoute","config","routes","WrapElement","wrapElementProps","prefetch","href","slug","path","id","collectionSlug","root","length","t","label"],"mappings":";AAEA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,SAASC,IAAI,QAAQ,iBAAgB;AACrC,SAASC,cAAc,QAAQ,iBAAgB;AAC/C,OAAOC,WAAW,QAAO;AAIzB,SAASC,mBACPC,WAAoC,EACpCC,WAA8B,EAC9BC,IAAY,CAAC;IAEb,KAAK,MAAMC,QAAQH,YAAa;QAC9BE;QACA,IAAI,UAAUC,QAAQA,KAAKC,IAAI,EAAE;YAC/BH,YAAYI,IAAI,CAACF,KAAKC,IAAI;QAC5B,OAAO;YACL,IAAI,CAAE,CAAA,cAAcD,IAAG,GAAI;gBACzBF,YAAYI,IAAI,eAAC,QAACC;;wBAAa;wBAAOH,KAAKI,IAAI;wBAAC;;mBAApBL;;;;;YAC9B;QACF;QACA,IAAI,cAAcC,QAAQA,KAAKK,QAAQ,EAAE;YACvCP,cAAcF,mBAAmBI,KAAKK,QAAQ,EAA6BP,aAAaC;QAC1F;IACF;IACA,OAAOD;AACT;AAEA,OAAO,MAAMQ,sBAA0D,CAACC;IACtE,MAAM,EACJC,QAAQ,EACRC,WAAWC,kBAAkB,EAC7BC,gBAAgB,EAChBC,OAAO,EAAEC,KAAK,EAAE,EAChBD,KAAK,EACLE,IAAI,EACJC,IAAI,EACJC,SAASC,gBAAgB,EACzBC,OAAO,EACPC,OAAO,EACR,GAAGZ;IAEJ,MAAMa,6BAA6BP,SAAS,eAAeA,QAAQA,MAAMJ,SAAS,GAAGY;IAErF,MAAMZ,YACJC,sBACCE,CAAAA,MAAMC,KAAK,IAAI,eAAeD,MAAMC,KAAK,GAAGD,MAAMC,KAAK,CAACJ,SAAS,GAAG,IAAG,KACxEW;IACF,MAAME,aAAaJ,QAAQK,MAAM,CAACC,MAAM,CAACX,KAAK;IAE9C,MAAMG,UAAUC;IAEhB,IAAIQ,cAAiD;IAErD,MAAMC,mBAMF;QACFjB;IACF;IAEA,IAAIM,MAAM;QACRW,iBAAiBC,QAAQ,GAAG;QAC5BF,cAAchC;QACdiC,iBAAiBE,IAAI,GAAGjB,kBAAkBkB,OACtCnC,eAAe;YACb4B;YACAQ,MAAM,CAAC,aAAa,EAAEnB,kBAAkBkB,KAAK,CAAC,EAAEV,QAAQY,EAAE,EAAE;QAC9D,KACA;IACN;IAEA,IAAI,OAAOf,YAAY,YAAY;QACjCS,cAAc;QACdC,iBAAiBtB,IAAI,GAAG;QACxBsB,iBAAiBV,OAAO,GAAG;YACzBA,QAAQ;gBACNR;gBACAwB,gBAAgBrB,kBAAkBkB;gBAClCV;YACF;QACF;IACF;IAEA,IAAIrB,cAAiC,EAAE;IAEvC,IAAIU,UAAUyB,MAAM5B,UAAU;QAC5BP,cAAcF,mBAAmBY,UAAUyB,MAAM5B,UAAUP;IAC7D;IAEA,IAAI,CAACA,aAAaoC,QAAQ;QACxBpC,cAAc;YACZgB,KAAKqB,CAAC,CAAC,mBAAmB;gBACxBC,OAAO5C,eAAe,AAAC,CAAA,WAAWoB,QAAQA,MAAMwB,KAAK,GAAG,IAAG,KAAM,QAAQtB;YAC3E;SACD;IACH;IAEA,qBAAO,QAACW;QAAa,GAAGC,gBAAgB;kBAAG5B;;;;;;AAC7C,EAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
3
3
|
import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
|
|
4
4
|
import { RenderFields, useFormSubmitted } from '@payloadcms/ui';
|
|
5
5
|
import React, { createContext, useMemo } from 'react';
|
|
@@ -51,28 +51,40 @@ export const useBlockComponentContext = ()=>React.use(BlockComponentContext);
|
|
|
51
51
|
const isEditable = useLexicalEditable();
|
|
52
52
|
const CollapsibleWithErrorProps = useMemo(()=>(props)=>{
|
|
53
53
|
const { children, ...rest } = props;
|
|
54
|
-
return /*#__PURE__*/
|
|
54
|
+
return /*#__PURE__*/ _jsxDEV(Collapsible, {
|
|
55
55
|
errorCount: errorCount,
|
|
56
56
|
fieldHasErrors: fieldHasErrors,
|
|
57
57
|
...rest,
|
|
58
58
|
children: children
|
|
59
|
-
}
|
|
59
|
+
}, void 0, false, {
|
|
60
|
+
fileName: "src/features/blocks/client/component/BlockContent.tsx",
|
|
61
|
+
lineNumber: 109,
|
|
62
|
+
columnNumber: 9
|
|
63
|
+
}, this);
|
|
60
64
|
}, [
|
|
61
65
|
Collapsible,
|
|
62
66
|
fieldHasErrors,
|
|
63
67
|
errorCount
|
|
64
68
|
]);
|
|
65
|
-
return CustomBlock ? /*#__PURE__*/
|
|
69
|
+
return CustomBlock ? /*#__PURE__*/ _jsxDEV(BlockComponentContext, {
|
|
66
70
|
value: {
|
|
67
71
|
...contextProps,
|
|
68
72
|
BlockCollapsible: CollapsibleWithErrorProps
|
|
69
73
|
},
|
|
70
74
|
children: [
|
|
71
75
|
CustomBlock,
|
|
72
|
-
/*#__PURE__*/
|
|
76
|
+
/*#__PURE__*/ _jsxDEV(BlockDrawer, {}, void 0, false, {
|
|
77
|
+
fileName: "src/features/blocks/client/component/BlockContent.tsx",
|
|
78
|
+
lineNumber: 125,
|
|
79
|
+
columnNumber: 7
|
|
80
|
+
}, this)
|
|
73
81
|
]
|
|
74
|
-
}
|
|
75
|
-
|
|
82
|
+
}, void 0, true, {
|
|
83
|
+
fileName: "src/features/blocks/client/component/BlockContent.tsx",
|
|
84
|
+
lineNumber: 118,
|
|
85
|
+
columnNumber: 5
|
|
86
|
+
}, this) : /*#__PURE__*/ _jsxDEV(CollapsibleWithErrorProps, {
|
|
87
|
+
children: /*#__PURE__*/ _jsxDEV(RenderFields, {
|
|
76
88
|
fields: formSchema,
|
|
77
89
|
forceRender: true,
|
|
78
90
|
parentIndexPath: "",
|
|
@@ -80,8 +92,16 @@ export const useBlockComponentContext = ()=>React.use(BlockComponentContext);
|
|
|
80
92
|
parentSchemaPath: "",
|
|
81
93
|
permissions: true,
|
|
82
94
|
readOnly: !isEditable
|
|
83
|
-
}
|
|
84
|
-
|
|
95
|
+
}, void 0, false, {
|
|
96
|
+
fileName: "src/features/blocks/client/component/BlockContent.tsx",
|
|
97
|
+
lineNumber: 129,
|
|
98
|
+
columnNumber: 7
|
|
99
|
+
}, this)
|
|
100
|
+
}, void 0, false, {
|
|
101
|
+
fileName: "src/features/blocks/client/component/BlockContent.tsx",
|
|
102
|
+
lineNumber: 128,
|
|
103
|
+
columnNumber: 5
|
|
104
|
+
}, this);
|
|
85
105
|
};
|
|
86
106
|
|
|
87
107
|
//# sourceMappingURL=BlockContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/features/blocks/client/component/BlockContent.tsx"],"sourcesContent":["'use client'\nimport type { CollapsibleProps } from '@payloadcms/ui/elements/Collapsible'\nimport type { ClientField, FormState } from 'payload'\n\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { RenderFields, useFormSubmitted } from '@payloadcms/ui'\nimport React, { createContext, useMemo } from 'react'\n\nexport type BlockCollapsibleProps = {\n /**\n * Replace the top-right portion of the header that renders the Edit and Remove buttons with custom content.\n * If this property is provided, the `removeButton` and `editButton` properties are ignored.\n */\n Actions?: React.ReactNode\n children?: React.ReactNode\n /**\n * Additional className to the collapsible wrapper\n */\n className?: string\n /**\n * Props to pass to the underlying Collapsible component. You could use this to override the `Header` entirely, for example.\n */\n collapsibleProps?: Partial<CollapsibleProps>\n /**\n * Whether to disable rendering the block name field in the header Label\n * @default false\n */\n disableBlockName?: boolean\n /**\n * Whether to show the Edit button\n * If `Actions` is provided, this property is ignored.\n * @default true\n */\n editButton?: boolean\n /**\n * Replace the default Label component with a custom Label\n */\n Label?: React.ReactNode\n /**\n * Replace the default Pill component component that's rendered within the default Label component with a custom Pill.\n * This property has no effect if you provide a custom Label component via the `Label` property.\n */\n Pill?: React.ReactNode\n /**\n * Whether to show the Remove button\n * If `Actions` is provided, this property is ignored.\n * @default true\n */\n removeButton?: boolean\n}\n\nexport type BlockCollapsibleWithErrorProps = {\n errorCount?: number\n fieldHasErrors?: boolean\n} & BlockCollapsibleProps\n\nexport type BlockContentProps = {\n baseClass: string\n BlockDrawer: React.FC\n Collapsible: React.FC<BlockCollapsibleWithErrorProps>\n CustomBlock: React.ReactNode\n EditButton: React.FC\n errorCount: number\n formSchema: ClientField[]\n initialState: false | FormState | undefined\n\n nodeKey: string\n RemoveButton: React.FC\n}\n\ntype BlockComponentContextType = {\n BlockCollapsible: React.FC<BlockCollapsibleProps>\n} & Omit<BlockContentProps, 'Collapsible'>\n\nconst BlockComponentContext = createContext<BlockComponentContextType>({\n baseClass: 'LexicalEditorTheme__block',\n BlockCollapsible: () => null,\n BlockDrawer: () => null,\n CustomBlock: null,\n EditButton: () => null,\n errorCount: 0,\n formSchema: [],\n initialState: false,\n nodeKey: '',\n RemoveButton: () => null,\n})\n\nexport const useBlockComponentContext = () => React.use(BlockComponentContext)\n\n/**\n * The actual content of the Block. This should be INSIDE a Form component,\n * scoped to the block. All format operations in here are thus scoped to the block's form, and\n * not the whole document.\n */\nexport const BlockContent: React.FC<BlockContentProps> = (props) => {\n const { Collapsible, ...contextProps } = props\n\n const { BlockDrawer, CustomBlock, errorCount, formSchema } = contextProps\n\n const hasSubmitted = useFormSubmitted()\n\n const fieldHasErrors = hasSubmitted && errorCount > 0\n const isEditable = useLexicalEditable()\n\n const CollapsibleWithErrorProps = useMemo(\n () => (props: BlockCollapsibleProps) => {\n const { children, ...rest } = props\n return (\n <Collapsible errorCount={errorCount} fieldHasErrors={fieldHasErrors} {...rest}>\n {children}\n </Collapsible>\n )\n },\n [Collapsible, fieldHasErrors, errorCount],\n )\n\n return CustomBlock ? (\n <BlockComponentContext\n value={{\n ...contextProps,\n BlockCollapsible: CollapsibleWithErrorProps,\n }}\n >\n {CustomBlock}\n <BlockDrawer />\n </BlockComponentContext>\n ) : (\n <CollapsibleWithErrorProps>\n <RenderFields\n fields={formSchema}\n forceRender={true}\n parentIndexPath=\"\"\n parentPath={''}\n parentSchemaPath=\"\"\n permissions={true}\n readOnly={!isEditable}\n />\n </CollapsibleWithErrorProps>\n )\n}\n"],"names":["useLexicalEditable","RenderFields","useFormSubmitted","React","createContext","useMemo","BlockComponentContext","baseClass","BlockCollapsible","BlockDrawer","CustomBlock","EditButton","errorCount","formSchema","initialState","nodeKey","RemoveButton","useBlockComponentContext","use","BlockContent","props","Collapsible","contextProps","hasSubmitted","fieldHasErrors","isEditable","CollapsibleWithErrorProps","children","rest","value","fields","forceRender","parentIndexPath","parentPath","parentSchemaPath","permissions","readOnly"],"mappings":"AAAA;;AAIA,SAASA,kBAAkB,QAAQ,oCAAmC;AACtE,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,iBAAgB;AAC/D,OAAOC,SAASC,aAAa,EAAEC,OAAO,QAAQ,QAAO;AAGnD;;;GAGC,GAGD;;GAEC,GAED;;GAEC,GAED;;;GAGC,GAED;;;;GAIC,GAED;;GAEC,GAED;;;GAGC,GAED;;;;GAIC,GA2BH,MAAMC,sCAAwBF,cAAyC;IACrEG,WAAW;IACXC,kBAAkB,IAAM;IACxBC,aAAa,IAAM;IACnBC,aAAa;IACbC,YAAY,IAAM;IAClBC,YAAY;IACZC,YAAY,EAAE;IACdC,cAAc;IACdC,SAAS;IACTC,cAAc,IAAM;AACtB;AAEA,OAAO,MAAMC,2BAA2B,IAAMd,MAAMe,GAAG,CAACZ,uBAAsB;AAE9E;;;;CAIC,GACD,OAAO,MAAMa,eAA4C,CAACC;IACxD,MAAM,EAAEC,WAAW,EAAE,GAAGC,cAAc,GAAGF;IAEzC,MAAM,EAAEX,WAAW,EAAEC,WAAW,EAAEE,UAAU,EAAEC,UAAU,EAAE,GAAGS;IAE7D,MAAMC,eAAerB;IAErB,MAAMsB,iBAAiBD,gBAAgBX,aAAa;IACpD,MAAMa,aAAazB;IAEnB,MAAM0B,4BAA4BrB,QAChC,IAAM,CAACe;YACL,MAAM,EAAEO,QAAQ,EAAE,GAAGC,MAAM,GAAGR;YAC9B,qBACE,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/features/blocks/client/component/BlockContent.tsx"],"sourcesContent":["'use client'\nimport type { CollapsibleProps } from '@payloadcms/ui/elements/Collapsible'\nimport type { ClientField, FormState } from 'payload'\n\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { RenderFields, useFormSubmitted } from '@payloadcms/ui'\nimport React, { createContext, useMemo } from 'react'\n\nexport type BlockCollapsibleProps = {\n /**\n * Replace the top-right portion of the header that renders the Edit and Remove buttons with custom content.\n * If this property is provided, the `removeButton` and `editButton` properties are ignored.\n */\n Actions?: React.ReactNode\n children?: React.ReactNode\n /**\n * Additional className to the collapsible wrapper\n */\n className?: string\n /**\n * Props to pass to the underlying Collapsible component. You could use this to override the `Header` entirely, for example.\n */\n collapsibleProps?: Partial<CollapsibleProps>\n /**\n * Whether to disable rendering the block name field in the header Label\n * @default false\n */\n disableBlockName?: boolean\n /**\n * Whether to show the Edit button\n * If `Actions` is provided, this property is ignored.\n * @default true\n */\n editButton?: boolean\n /**\n * Replace the default Label component with a custom Label\n */\n Label?: React.ReactNode\n /**\n * Replace the default Pill component component that's rendered within the default Label component with a custom Pill.\n * This property has no effect if you provide a custom Label component via the `Label` property.\n */\n Pill?: React.ReactNode\n /**\n * Whether to show the Remove button\n * If `Actions` is provided, this property is ignored.\n * @default true\n */\n removeButton?: boolean\n}\n\nexport type BlockCollapsibleWithErrorProps = {\n errorCount?: number\n fieldHasErrors?: boolean\n} & BlockCollapsibleProps\n\nexport type BlockContentProps = {\n baseClass: string\n BlockDrawer: React.FC\n Collapsible: React.FC<BlockCollapsibleWithErrorProps>\n CustomBlock: React.ReactNode\n EditButton: React.FC\n errorCount: number\n formSchema: ClientField[]\n initialState: false | FormState | undefined\n\n nodeKey: string\n RemoveButton: React.FC\n}\n\ntype BlockComponentContextType = {\n BlockCollapsible: React.FC<BlockCollapsibleProps>\n} & Omit<BlockContentProps, 'Collapsible'>\n\nconst BlockComponentContext = createContext<BlockComponentContextType>({\n baseClass: 'LexicalEditorTheme__block',\n BlockCollapsible: () => null,\n BlockDrawer: () => null,\n CustomBlock: null,\n EditButton: () => null,\n errorCount: 0,\n formSchema: [],\n initialState: false,\n nodeKey: '',\n RemoveButton: () => null,\n})\n\nexport const useBlockComponentContext = () => React.use(BlockComponentContext)\n\n/**\n * The actual content of the Block. This should be INSIDE a Form component,\n * scoped to the block. All format operations in here are thus scoped to the block's form, and\n * not the whole document.\n */\nexport const BlockContent: React.FC<BlockContentProps> = (props) => {\n const { Collapsible, ...contextProps } = props\n\n const { BlockDrawer, CustomBlock, errorCount, formSchema } = contextProps\n\n const hasSubmitted = useFormSubmitted()\n\n const fieldHasErrors = hasSubmitted && errorCount > 0\n const isEditable = useLexicalEditable()\n\n const CollapsibleWithErrorProps = useMemo(\n () => (props: BlockCollapsibleProps) => {\n const { children, ...rest } = props\n return (\n <Collapsible errorCount={errorCount} fieldHasErrors={fieldHasErrors} {...rest}>\n {children}\n </Collapsible>\n )\n },\n [Collapsible, fieldHasErrors, errorCount],\n )\n\n return CustomBlock ? (\n <BlockComponentContext\n value={{\n ...contextProps,\n BlockCollapsible: CollapsibleWithErrorProps,\n }}\n >\n {CustomBlock}\n <BlockDrawer />\n </BlockComponentContext>\n ) : (\n <CollapsibleWithErrorProps>\n <RenderFields\n fields={formSchema}\n forceRender={true}\n parentIndexPath=\"\"\n parentPath={''}\n parentSchemaPath=\"\"\n permissions={true}\n readOnly={!isEditable}\n />\n </CollapsibleWithErrorProps>\n )\n}\n"],"names":["useLexicalEditable","RenderFields","useFormSubmitted","React","createContext","useMemo","BlockComponentContext","baseClass","BlockCollapsible","BlockDrawer","CustomBlock","EditButton","errorCount","formSchema","initialState","nodeKey","RemoveButton","useBlockComponentContext","use","BlockContent","props","Collapsible","contextProps","hasSubmitted","fieldHasErrors","isEditable","CollapsibleWithErrorProps","children","rest","value","fields","forceRender","parentIndexPath","parentPath","parentSchemaPath","permissions","readOnly"],"mappings":"AAAA;;AAIA,SAASA,kBAAkB,QAAQ,oCAAmC;AACtE,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,iBAAgB;AAC/D,OAAOC,SAASC,aAAa,EAAEC,OAAO,QAAQ,QAAO;AAGnD;;;GAGC,GAGD;;GAEC,GAED;;GAEC,GAED;;;GAGC,GAED;;;;GAIC,GAED;;GAEC,GAED;;;GAGC,GAED;;;;GAIC,GA2BH,MAAMC,sCAAwBF,cAAyC;IACrEG,WAAW;IACXC,kBAAkB,IAAM;IACxBC,aAAa,IAAM;IACnBC,aAAa;IACbC,YAAY,IAAM;IAClBC,YAAY;IACZC,YAAY,EAAE;IACdC,cAAc;IACdC,SAAS;IACTC,cAAc,IAAM;AACtB;AAEA,OAAO,MAAMC,2BAA2B,IAAMd,MAAMe,GAAG,CAACZ,uBAAsB;AAE9E;;;;CAIC,GACD,OAAO,MAAMa,eAA4C,CAACC;IACxD,MAAM,EAAEC,WAAW,EAAE,GAAGC,cAAc,GAAGF;IAEzC,MAAM,EAAEX,WAAW,EAAEC,WAAW,EAAEE,UAAU,EAAEC,UAAU,EAAE,GAAGS;IAE7D,MAAMC,eAAerB;IAErB,MAAMsB,iBAAiBD,gBAAgBX,aAAa;IACpD,MAAMa,aAAazB;IAEnB,MAAM0B,4BAA4BrB,QAChC,IAAM,CAACe;YACL,MAAM,EAAEO,QAAQ,EAAE,GAAGC,MAAM,GAAGR;YAC9B,qBACE,QAACC;gBAAYT,YAAYA;gBAAYY,gBAAgBA;gBAAiB,GAAGI,IAAI;0BAC1ED;;;;;;QAGP,GACA;QAACN;QAAaG;QAAgBZ;KAAW;IAG3C,OAAOF,4BACL,QAACJ;QACCuB,OAAO;YACL,GAAGP,YAAY;YACfd,kBAAkBkB;QACpB;;YAEChB;0BACD,QAACD;;;;;;;;;;6BAGH,QAACiB;kBACC,cAAA,QAACzB;YACC6B,QAAQjB;YACRkB,aAAa;YACbC,iBAAgB;YAChBC,YAAY;YACZC,kBAAiB;YACjBC,aAAa;YACbC,UAAU,CAACX;;;;;;;;;;;AAInB,EAAC"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useBlockComponentContext } from '../BlockContent.js';
|
|
5
5
|
export const BlockCollapsible = (props)=>{
|
|
6
6
|
const { children, ...rest } = props;
|
|
7
7
|
const { BlockCollapsible } = useBlockComponentContext();
|
|
8
|
-
return BlockCollapsible ? /*#__PURE__*/
|
|
8
|
+
return BlockCollapsible ? /*#__PURE__*/ _jsxDEV(BlockCollapsible, {
|
|
9
9
|
...rest,
|
|
10
10
|
children: children
|
|
11
|
-
}
|
|
11
|
+
}, void 0, false, {
|
|
12
|
+
fileName: "src/features/blocks/client/component/components/BlockCollapsible.tsx",
|
|
13
|
+
lineNumber: 10,
|
|
14
|
+
columnNumber: 29
|
|
15
|
+
}, this) : null;
|
|
12
16
|
};
|
|
13
17
|
|
|
14
18
|
//# sourceMappingURL=BlockCollapsible.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/features/blocks/client/component/components/BlockCollapsible.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { type BlockCollapsibleProps, useBlockComponentContext } from '../BlockContent.js'\n\nexport const BlockCollapsible: React.FC<BlockCollapsibleProps> = (props) => {\n const { children, ...rest } = props\n const { BlockCollapsible } = useBlockComponentContext()\n\n return BlockCollapsible ? <BlockCollapsible {...rest}>{children}</BlockCollapsible> : null\n}\n"],"names":["React","useBlockComponentContext","BlockCollapsible","props","children","rest"],"mappings":"AAAA;;AACA,OAAOA,WAAW,QAAO;AAEzB,SAAqCC,wBAAwB,QAAQ,qBAAoB;AAEzF,OAAO,MAAMC,mBAAoD,CAACC;IAChE,MAAM,EAAEC,QAAQ,EAAE,GAAGC,MAAM,GAAGF;IAC9B,MAAM,EAAED,gBAAgB,EAAE,GAAGD;IAE7B,OAAOC,iCAAmB,
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/features/blocks/client/component/components/BlockCollapsible.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { type BlockCollapsibleProps, useBlockComponentContext } from '../BlockContent.js'\n\nexport const BlockCollapsible: React.FC<BlockCollapsibleProps> = (props) => {\n const { children, ...rest } = props\n const { BlockCollapsible } = useBlockComponentContext()\n\n return BlockCollapsible ? <BlockCollapsible {...rest}>{children}</BlockCollapsible> : null\n}\n"],"names":["React","useBlockComponentContext","BlockCollapsible","props","children","rest"],"mappings":"AAAA;;AACA,OAAOA,WAAW,QAAO;AAEzB,SAAqCC,wBAAwB,QAAQ,qBAAoB;AAEzF,OAAO,MAAMC,mBAAoD,CAACC;IAChE,MAAM,EAAEC,QAAQ,EAAE,GAAGC,MAAM,GAAGF;IAC9B,MAAM,EAAED,gBAAgB,EAAE,GAAGD;IAE7B,OAAOC,iCAAmB,QAACA;QAAkB,GAAGG,IAAI;kBAAGD;;;;;eAA+B;AACxF,EAAC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useBlockComponentContext } from '../BlockContent.js';
|
|
5
5
|
export const BlockEditButton = ()=>{
|
|
6
6
|
const { EditButton } = useBlockComponentContext();
|
|
7
|
-
return EditButton ? /*#__PURE__*/
|
|
7
|
+
return EditButton ? /*#__PURE__*/ _jsxDEV(EditButton, {}, void 0, false, {
|
|
8
|
+
fileName: "src/features/blocks/client/component/components/BlockEditButton.tsx",
|
|
9
|
+
lineNumber: 9,
|
|
10
|
+
columnNumber: 23
|
|
11
|
+
}, this) : null;
|
|
8
12
|
};
|
|
9
13
|
|
|
10
14
|
//# sourceMappingURL=BlockEditButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/features/blocks/client/component/components/BlockEditButton.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useBlockComponentContext } from '../BlockContent.js'\n\nexport const BlockEditButton = () => {\n const { EditButton } = useBlockComponentContext()\n\n return EditButton ? <EditButton /> : null\n}\n"],"names":["React","useBlockComponentContext","BlockEditButton","EditButton"],"mappings":"AAAA;;AACA,OAAOA,WAAW,QAAO;AAEzB,SAASC,wBAAwB,QAAQ,qBAAoB;AAE7D,OAAO,MAAMC,kBAAkB;IAC7B,MAAM,EAAEC,UAAU,EAAE,GAAGF;IAEvB,OAAOE,2BAAa,
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/features/blocks/client/component/components/BlockEditButton.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useBlockComponentContext } from '../BlockContent.js'\n\nexport const BlockEditButton = () => {\n const { EditButton } = useBlockComponentContext()\n\n return EditButton ? <EditButton /> : null\n}\n"],"names":["React","useBlockComponentContext","BlockEditButton","EditButton"],"mappings":"AAAA;;AACA,OAAOA,WAAW,QAAO;AAEzB,SAASC,wBAAwB,QAAQ,qBAAoB;AAE7D,OAAO,MAAMC,kBAAkB;IAC7B,MAAM,EAAEC,UAAU,EAAE,GAAGF;IAEvB,OAAOE,2BAAa,QAACA;;;;eAAgB;AACvC,EAAC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useBlockComponentContext } from '../BlockContent.js';
|
|
5
5
|
export const BlockRemoveButton = ()=>{
|
|
6
6
|
const { RemoveButton } = useBlockComponentContext();
|
|
7
|
-
return RemoveButton ? /*#__PURE__*/
|
|
7
|
+
return RemoveButton ? /*#__PURE__*/ _jsxDEV(RemoveButton, {}, void 0, false, {
|
|
8
|
+
fileName: "src/features/blocks/client/component/components/BlockRemoveButton.tsx",
|
|
9
|
+
lineNumber: 9,
|
|
10
|
+
columnNumber: 25
|
|
11
|
+
}, this) : null;
|
|
8
12
|
};
|
|
9
13
|
|
|
10
14
|
//# sourceMappingURL=BlockRemoveButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/features/blocks/client/component/components/BlockRemoveButton.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useBlockComponentContext } from '../BlockContent.js'\n\nexport const BlockRemoveButton = () => {\n const { RemoveButton } = useBlockComponentContext()\n\n return RemoveButton ? <RemoveButton /> : null\n}\n"],"names":["React","useBlockComponentContext","BlockRemoveButton","RemoveButton"],"mappings":"AAAA;;AACA,OAAOA,WAAW,QAAO;AAEzB,SAASC,wBAAwB,QAAQ,qBAAoB;AAE7D,OAAO,MAAMC,oBAAoB;IAC/B,MAAM,EAAEC,YAAY,EAAE,GAAGF;IAEzB,OAAOE,6BAAe,
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/features/blocks/client/component/components/BlockRemoveButton.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useBlockComponentContext } from '../BlockContent.js'\n\nexport const BlockRemoveButton = () => {\n const { RemoveButton } = useBlockComponentContext()\n\n return RemoveButton ? <RemoveButton /> : null\n}\n"],"names":["React","useBlockComponentContext","BlockRemoveButton","RemoveButton"],"mappings":"AAAA;;AACA,OAAOA,WAAW,QAAO;AAEzB,SAASC,wBAAwB,QAAQ,qBAAoB;AAE7D,OAAO,MAAMC,oBAAoB;IAC/B,MAAM,EAAEC,YAAY,EAAE,GAAGF;IAEzB,OAAOE,6BAAe,QAACA;;;;eAAkB;AAC3C,EAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { jsxDEV as _jsxDEV, Fragment as _Fragment } from "react/jsx-dev-runtime";
|
|
3
3
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
4
4
|
import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
|
|
5
5
|
import { getTranslation } from '@payloadcms/translations';
|
|
@@ -10,6 +10,7 @@ import { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from
|
|
|
10
10
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
11
11
|
import { v4 as uuid } from 'uuid';
|
|
12
12
|
import { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js';
|
|
13
|
+
import './index.scss';
|
|
13
14
|
import { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js';
|
|
14
15
|
import { $isBlockNode } from '../nodes/BlocksNode.js';
|
|
15
16
|
import { BlockContent } from './BlockContent.js';
|
|
@@ -263,7 +264,7 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
263
264
|
setDocFieldPreferences,
|
|
264
265
|
formData.id
|
|
265
266
|
]);
|
|
266
|
-
const EditButton = useMemo(()=>()=>/*#__PURE__*/
|
|
267
|
+
const EditButton = useMemo(()=>()=>/*#__PURE__*/ _jsxDEV(Button, {
|
|
267
268
|
buttonStyle: "icon-label",
|
|
268
269
|
className: `${baseClass}__editButton`,
|
|
269
270
|
disabled: !isEditable,
|
|
@@ -285,14 +286,18 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
285
286
|
tooltip: t('lexical:blocks:inlineBlocks:edit', {
|
|
286
287
|
label: blockDisplayName
|
|
287
288
|
})
|
|
288
|
-
}
|
|
289
|
+
}, void 0, false, {
|
|
290
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
291
|
+
lineNumber: 383,
|
|
292
|
+
columnNumber: 7
|
|
293
|
+
}, this), [
|
|
289
294
|
baseClass,
|
|
290
295
|
isEditable,
|
|
291
296
|
t,
|
|
292
297
|
blockDisplayName,
|
|
293
298
|
toggleDrawer
|
|
294
299
|
]);
|
|
295
|
-
const RemoveButton = useMemo(()=>()=>/*#__PURE__*/
|
|
300
|
+
const RemoveButton = useMemo(()=>()=>/*#__PURE__*/ _jsxDEV(Button, {
|
|
296
301
|
buttonStyle: "icon-label",
|
|
297
302
|
className: `${baseClass}__removeButton`,
|
|
298
303
|
disabled: !isEditable,
|
|
@@ -303,55 +308,91 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
303
308
|
},
|
|
304
309
|
round: true,
|
|
305
310
|
tooltip: "Remove Block"
|
|
306
|
-
}
|
|
311
|
+
}, void 0, false, {
|
|
312
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
313
|
+
lineNumber: 410,
|
|
314
|
+
columnNumber: 7
|
|
315
|
+
}, this), [
|
|
307
316
|
baseClass,
|
|
308
317
|
isEditable,
|
|
309
318
|
removeBlock
|
|
310
319
|
]);
|
|
311
320
|
const BlockCollapsible = useMemo(()=>({ Actions, children, className, collapsibleProps, disableBlockName, editButton, errorCount, fieldHasErrors, Label, Pill: CustomPill, removeButton })=>{
|
|
312
|
-
return /*#__PURE__*/
|
|
321
|
+
return /*#__PURE__*/ _jsxDEV("div", {
|
|
313
322
|
className: `${baseClass}__container ${baseClass}-${blockType}`,
|
|
314
|
-
children: /*#__PURE__*/
|
|
323
|
+
children: /*#__PURE__*/ _jsxDEV(Collapsible, {
|
|
315
324
|
className: [
|
|
316
325
|
`${baseClass}__row`,
|
|
317
326
|
fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,
|
|
318
327
|
className
|
|
319
328
|
].filter(Boolean).join(' '),
|
|
320
329
|
collapsibleStyle: fieldHasErrors ? 'error' : 'default',
|
|
321
|
-
header: /*#__PURE__*/
|
|
330
|
+
header: /*#__PURE__*/ _jsxDEV("div", {
|
|
322
331
|
className: `${baseClass}__block-header`,
|
|
323
332
|
children: [
|
|
324
|
-
typeof Label !== 'undefined' ? Label : typeof CustomLabel !== 'undefined' ? CustomLabel : /*#__PURE__*/
|
|
333
|
+
typeof Label !== 'undefined' ? Label : typeof CustomLabel !== 'undefined' ? CustomLabel : /*#__PURE__*/ _jsxDEV("div", {
|
|
325
334
|
className: `${baseClass}__block-label`,
|
|
326
335
|
children: [
|
|
327
|
-
typeof CustomPill !== 'undefined' ? CustomPill : /*#__PURE__*/
|
|
336
|
+
typeof CustomPill !== 'undefined' ? CustomPill : /*#__PURE__*/ _jsxDEV(Pill, {
|
|
328
337
|
className: `${baseClass}__block-pill ${baseClass}__block-pill-${blockType}`,
|
|
329
338
|
pillStyle: "white",
|
|
330
339
|
size: "small",
|
|
331
340
|
children: blockDisplayName ?? blockType
|
|
332
|
-
}
|
|
333
|
-
|
|
341
|
+
}, void 0, false, {
|
|
342
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
343
|
+
lineNumber: 463,
|
|
344
|
+
columnNumber: 25
|
|
345
|
+
}, void 0),
|
|
346
|
+
!disableBlockName && !clientBlock?.admin?.disableBlockName && /*#__PURE__*/ _jsxDEV(SectionTitle, {
|
|
334
347
|
path: "blockName",
|
|
335
348
|
readOnly: !isEditable
|
|
336
|
-
}
|
|
337
|
-
|
|
349
|
+
}, void 0, false, {
|
|
350
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
351
|
+
lineNumber: 472,
|
|
352
|
+
columnNumber: 25
|
|
353
|
+
}, void 0),
|
|
354
|
+
fieldHasErrors && /*#__PURE__*/ _jsxDEV(ErrorPill, {
|
|
338
355
|
count: errorCount ?? 0,
|
|
339
356
|
i18n: i18n,
|
|
340
357
|
withMessage: true
|
|
341
|
-
}
|
|
358
|
+
}, void 0, false, {
|
|
359
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
360
|
+
lineNumber: 476,
|
|
361
|
+
columnNumber: 25
|
|
362
|
+
}, void 0)
|
|
342
363
|
]
|
|
343
|
-
}
|
|
344
|
-
|
|
364
|
+
}, void 0, true, {
|
|
365
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
366
|
+
lineNumber: 459,
|
|
367
|
+
columnNumber: 21
|
|
368
|
+
}, void 0),
|
|
369
|
+
/*#__PURE__*/ _jsxDEV("div", {
|
|
345
370
|
className: `${baseClass}__block-actions`,
|
|
346
|
-
children: typeof Actions !== 'undefined' ? Actions : /*#__PURE__*/
|
|
371
|
+
children: typeof Actions !== 'undefined' ? Actions : /*#__PURE__*/ _jsxDEV(_Fragment, {
|
|
347
372
|
children: [
|
|
348
|
-
CustomBlock && editButton !== false || !CustomBlock && editButton ? /*#__PURE__*/
|
|
349
|
-
|
|
373
|
+
CustomBlock && editButton !== false || !CustomBlock && editButton ? /*#__PURE__*/ _jsxDEV(EditButton, {}, void 0, false, {
|
|
374
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
375
|
+
lineNumber: 487,
|
|
376
|
+
columnNumber: 27
|
|
377
|
+
}, void 0) : null,
|
|
378
|
+
removeButton !== false && isEditable ? /*#__PURE__*/ _jsxDEV(RemoveButton, {}, void 0, false, {
|
|
379
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
380
|
+
lineNumber: 489,
|
|
381
|
+
columnNumber: 65
|
|
382
|
+
}, void 0) : null
|
|
350
383
|
]
|
|
351
|
-
})
|
|
352
|
-
}
|
|
384
|
+
}, void 0, true)
|
|
385
|
+
}, void 0, false, {
|
|
386
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
387
|
+
lineNumber: 481,
|
|
388
|
+
columnNumber: 19
|
|
389
|
+
}, void 0)
|
|
353
390
|
]
|
|
354
|
-
}
|
|
391
|
+
}, void 0, true, {
|
|
392
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
393
|
+
lineNumber: 453,
|
|
394
|
+
columnNumber: 17
|
|
395
|
+
}, void 0),
|
|
355
396
|
isCollapsed: isCollapsed,
|
|
356
397
|
onToggle: (incomingCollapsedState)=>{
|
|
357
398
|
onCollapsedChange(incomingCollapsedState);
|
|
@@ -359,8 +400,16 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
359
400
|
},
|
|
360
401
|
...collapsibleProps || {},
|
|
361
402
|
children: children
|
|
362
|
-
}, 0
|
|
363
|
-
|
|
403
|
+
}, 0, false, {
|
|
404
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
405
|
+
lineNumber: 443,
|
|
406
|
+
columnNumber: 13
|
|
407
|
+
}, this)
|
|
408
|
+
}, void 0, false, {
|
|
409
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
410
|
+
lineNumber: 442,
|
|
411
|
+
columnNumber: 11
|
|
412
|
+
}, this);
|
|
364
413
|
}, [
|
|
365
414
|
CustomBlock,
|
|
366
415
|
CustomLabel,
|
|
@@ -376,16 +425,16 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
376
425
|
isEditable
|
|
377
426
|
]);
|
|
378
427
|
const blockID = formData?.id;
|
|
379
|
-
const BlockDrawer = useMemo(()=>()=>/*#__PURE__*/
|
|
380
|
-
children: /*#__PURE__*/
|
|
428
|
+
const BlockDrawer = useMemo(()=>()=>/*#__PURE__*/ _jsxDEV(EditDepthProvider, {
|
|
429
|
+
children: /*#__PURE__*/ _jsxDEV(Drawer, {
|
|
381
430
|
className: '',
|
|
382
431
|
slug: drawerSlug,
|
|
383
432
|
title: t(`lexical:blocks:inlineBlocks:${blockID ? 'edit' : 'create'}`, {
|
|
384
433
|
label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label')
|
|
385
434
|
}),
|
|
386
|
-
children: initialState ? /*#__PURE__*/
|
|
435
|
+
children: initialState ? /*#__PURE__*/ _jsxDEV(_Fragment, {
|
|
387
436
|
children: [
|
|
388
|
-
/*#__PURE__*/
|
|
437
|
+
/*#__PURE__*/ _jsxDEV(RenderFields, {
|
|
389
438
|
fields: clientBlock?.fields ?? [],
|
|
390
439
|
forceRender: true,
|
|
391
440
|
parentIndexPath: "",
|
|
@@ -394,15 +443,31 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
394
443
|
parentSchemaPath: schemaFieldsPath,
|
|
395
444
|
permissions: true,
|
|
396
445
|
readOnly: !isEditable
|
|
397
|
-
}
|
|
398
|
-
|
|
446
|
+
}, void 0, false, {
|
|
447
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
448
|
+
lineNumber: 538,
|
|
449
|
+
columnNumber: 15
|
|
450
|
+
}, this),
|
|
451
|
+
/*#__PURE__*/ _jsxDEV(FormSubmit, {
|
|
399
452
|
programmaticSubmit: true,
|
|
400
453
|
children: t('fields:saveChanges')
|
|
401
|
-
}
|
|
454
|
+
}, void 0, false, {
|
|
455
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
456
|
+
lineNumber: 547,
|
|
457
|
+
columnNumber: 15
|
|
458
|
+
}, this)
|
|
402
459
|
]
|
|
403
|
-
}) : null
|
|
404
|
-
}
|
|
405
|
-
|
|
460
|
+
}, void 0, true) : null
|
|
461
|
+
}, void 0, false, {
|
|
462
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
463
|
+
lineNumber: 529,
|
|
464
|
+
columnNumber: 9
|
|
465
|
+
}, this)
|
|
466
|
+
}, void 0, false, {
|
|
467
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
468
|
+
lineNumber: 528,
|
|
469
|
+
columnNumber: 7
|
|
470
|
+
}, this), [
|
|
406
471
|
initialState,
|
|
407
472
|
drawerSlug,
|
|
408
473
|
blockID,
|
|
@@ -418,7 +483,7 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
418
483
|
if (!initialState) {
|
|
419
484
|
return null;
|
|
420
485
|
}
|
|
421
|
-
return /*#__PURE__*/
|
|
486
|
+
return /*#__PURE__*/ _jsxDEV(Form, {
|
|
422
487
|
beforeSubmit: [
|
|
423
488
|
async ({ formState })=>{
|
|
424
489
|
// This is only called when form is submitted from drawer - usually only the case if the block has a custom Block component
|
|
@@ -447,7 +512,7 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
447
512
|
},
|
|
448
513
|
submitted: submitted,
|
|
449
514
|
uuid: uuid(),
|
|
450
|
-
children: /*#__PURE__*/
|
|
515
|
+
children: /*#__PURE__*/ _jsxDEV(BlockContent, {
|
|
451
516
|
baseClass: baseClass,
|
|
452
517
|
BlockDrawer: BlockDrawer,
|
|
453
518
|
Collapsible: BlockCollapsible,
|
|
@@ -458,8 +523,16 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
458
523
|
initialState: initialState,
|
|
459
524
|
nodeKey: nodeKey,
|
|
460
525
|
RemoveButton: RemoveButton
|
|
461
|
-
}
|
|
462
|
-
|
|
526
|
+
}, void 0, false, {
|
|
527
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
528
|
+
lineNumber: 597,
|
|
529
|
+
columnNumber: 9
|
|
530
|
+
}, this)
|
|
531
|
+
}, void 0, false, {
|
|
532
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
533
|
+
lineNumber: 572,
|
|
534
|
+
columnNumber: 7
|
|
535
|
+
}, this);
|
|
463
536
|
}, [
|
|
464
537
|
BlockCollapsible,
|
|
465
538
|
BlockDrawer,
|
|
@@ -479,18 +552,26 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
479
552
|
submitted
|
|
480
553
|
]);
|
|
481
554
|
if (!clientBlock) {
|
|
482
|
-
return /*#__PURE__*/
|
|
555
|
+
return /*#__PURE__*/ _jsxDEV(BlockCollapsible, {
|
|
483
556
|
disableBlockName: true,
|
|
484
557
|
fieldHasErrors: true,
|
|
485
|
-
children: /*#__PURE__*/
|
|
558
|
+
children: /*#__PURE__*/ _jsxDEV("div", {
|
|
486
559
|
className: `${baseClass}-not-found`,
|
|
487
560
|
children: [
|
|
488
561
|
"Error: Block '",
|
|
489
562
|
blockType,
|
|
490
563
|
"' not found in the config but exists in the lexical data"
|
|
491
564
|
]
|
|
492
|
-
}
|
|
493
|
-
|
|
565
|
+
}, void 0, true, {
|
|
566
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
567
|
+
lineNumber: 633,
|
|
568
|
+
columnNumber: 9
|
|
569
|
+
}, this)
|
|
570
|
+
}, void 0, false, {
|
|
571
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
572
|
+
lineNumber: 632,
|
|
573
|
+
columnNumber: 7
|
|
574
|
+
}, this);
|
|
494
575
|
}
|
|
495
576
|
return Block;
|
|
496
577
|
};
|