@payloadcms/richtext-lexical 3.68.0-internal-debug.185cc5f → 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 +123 -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 +117 -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/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 +87 -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 +12 -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 +18 -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/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 +13 -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 +61 -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 +7 -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 +224 -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 +31 -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 +25 -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.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/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 +7 -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/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 +13 -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 +13 -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 +55 -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 +71 -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 +71 -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 +7 -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 +36 -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 +91 -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 +13 -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 +36 -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 +36 -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 +30 -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 +59 -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 +7 -3
- package/dist/field/Diff/index.js.map +1 -1
- package/dist/field/Diff/index.scss +102 -0
- package/dist/field/Field.js +79 -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/lexical/EditorPlugin.js +13 -5
- package/dist/lexical/EditorPlugin.js.map +1 -1
- package/dist/lexical/LexicalEditor.js +162 -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.scss +13 -0
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +19 -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/index.js +7 -3
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.js +48 -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 +19 -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 +31 -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 +13 -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/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/package.json +9 -8
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';
|
|
@@ -264,7 +264,7 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
264
264
|
setDocFieldPreferences,
|
|
265
265
|
formData.id
|
|
266
266
|
]);
|
|
267
|
-
const EditButton = useMemo(()=>()=>/*#__PURE__*/
|
|
267
|
+
const EditButton = useMemo(()=>()=>/*#__PURE__*/ _jsxDEV(Button, {
|
|
268
268
|
buttonStyle: "icon-label",
|
|
269
269
|
className: `${baseClass}__editButton`,
|
|
270
270
|
disabled: !isEditable,
|
|
@@ -286,14 +286,18 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
286
286
|
tooltip: t('lexical:blocks:inlineBlocks:edit', {
|
|
287
287
|
label: blockDisplayName
|
|
288
288
|
})
|
|
289
|
-
}
|
|
289
|
+
}, void 0, false, {
|
|
290
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
291
|
+
lineNumber: 383,
|
|
292
|
+
columnNumber: 7
|
|
293
|
+
}, this), [
|
|
290
294
|
baseClass,
|
|
291
295
|
isEditable,
|
|
292
296
|
t,
|
|
293
297
|
blockDisplayName,
|
|
294
298
|
toggleDrawer
|
|
295
299
|
]);
|
|
296
|
-
const RemoveButton = useMemo(()=>()=>/*#__PURE__*/
|
|
300
|
+
const RemoveButton = useMemo(()=>()=>/*#__PURE__*/ _jsxDEV(Button, {
|
|
297
301
|
buttonStyle: "icon-label",
|
|
298
302
|
className: `${baseClass}__removeButton`,
|
|
299
303
|
disabled: !isEditable,
|
|
@@ -304,55 +308,91 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
304
308
|
},
|
|
305
309
|
round: true,
|
|
306
310
|
tooltip: "Remove Block"
|
|
307
|
-
}
|
|
311
|
+
}, void 0, false, {
|
|
312
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
313
|
+
lineNumber: 410,
|
|
314
|
+
columnNumber: 7
|
|
315
|
+
}, this), [
|
|
308
316
|
baseClass,
|
|
309
317
|
isEditable,
|
|
310
318
|
removeBlock
|
|
311
319
|
]);
|
|
312
320
|
const BlockCollapsible = useMemo(()=>({ Actions, children, className, collapsibleProps, disableBlockName, editButton, errorCount, fieldHasErrors, Label, Pill: CustomPill, removeButton })=>{
|
|
313
|
-
return /*#__PURE__*/
|
|
321
|
+
return /*#__PURE__*/ _jsxDEV("div", {
|
|
314
322
|
className: `${baseClass}__container ${baseClass}-${blockType}`,
|
|
315
|
-
children: /*#__PURE__*/
|
|
323
|
+
children: /*#__PURE__*/ _jsxDEV(Collapsible, {
|
|
316
324
|
className: [
|
|
317
325
|
`${baseClass}__row`,
|
|
318
326
|
fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,
|
|
319
327
|
className
|
|
320
328
|
].filter(Boolean).join(' '),
|
|
321
329
|
collapsibleStyle: fieldHasErrors ? 'error' : 'default',
|
|
322
|
-
header: /*#__PURE__*/
|
|
330
|
+
header: /*#__PURE__*/ _jsxDEV("div", {
|
|
323
331
|
className: `${baseClass}__block-header`,
|
|
324
332
|
children: [
|
|
325
|
-
typeof Label !== 'undefined' ? Label : typeof CustomLabel !== 'undefined' ? CustomLabel : /*#__PURE__*/
|
|
333
|
+
typeof Label !== 'undefined' ? Label : typeof CustomLabel !== 'undefined' ? CustomLabel : /*#__PURE__*/ _jsxDEV("div", {
|
|
326
334
|
className: `${baseClass}__block-label`,
|
|
327
335
|
children: [
|
|
328
|
-
typeof CustomPill !== 'undefined' ? CustomPill : /*#__PURE__*/
|
|
336
|
+
typeof CustomPill !== 'undefined' ? CustomPill : /*#__PURE__*/ _jsxDEV(Pill, {
|
|
329
337
|
className: `${baseClass}__block-pill ${baseClass}__block-pill-${blockType}`,
|
|
330
338
|
pillStyle: "white",
|
|
331
339
|
size: "small",
|
|
332
340
|
children: blockDisplayName ?? blockType
|
|
333
|
-
}
|
|
334
|
-
|
|
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, {
|
|
335
347
|
path: "blockName",
|
|
336
348
|
readOnly: !isEditable
|
|
337
|
-
}
|
|
338
|
-
|
|
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, {
|
|
339
355
|
count: errorCount ?? 0,
|
|
340
356
|
i18n: i18n,
|
|
341
357
|
withMessage: true
|
|
342
|
-
}
|
|
358
|
+
}, void 0, false, {
|
|
359
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
360
|
+
lineNumber: 476,
|
|
361
|
+
columnNumber: 25
|
|
362
|
+
}, void 0)
|
|
343
363
|
]
|
|
344
|
-
}
|
|
345
|
-
|
|
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", {
|
|
346
370
|
className: `${baseClass}__block-actions`,
|
|
347
|
-
children: typeof Actions !== 'undefined' ? Actions : /*#__PURE__*/
|
|
371
|
+
children: typeof Actions !== 'undefined' ? Actions : /*#__PURE__*/ _jsxDEV(_Fragment, {
|
|
348
372
|
children: [
|
|
349
|
-
CustomBlock && editButton !== false || !CustomBlock && editButton ? /*#__PURE__*/
|
|
350
|
-
|
|
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
|
|
351
383
|
]
|
|
352
|
-
})
|
|
353
|
-
}
|
|
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)
|
|
354
390
|
]
|
|
355
|
-
}
|
|
391
|
+
}, void 0, true, {
|
|
392
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
393
|
+
lineNumber: 453,
|
|
394
|
+
columnNumber: 17
|
|
395
|
+
}, void 0),
|
|
356
396
|
isCollapsed: isCollapsed,
|
|
357
397
|
onToggle: (incomingCollapsedState)=>{
|
|
358
398
|
onCollapsedChange(incomingCollapsedState);
|
|
@@ -360,8 +400,16 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
360
400
|
},
|
|
361
401
|
...collapsibleProps || {},
|
|
362
402
|
children: children
|
|
363
|
-
}, 0
|
|
364
|
-
|
|
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);
|
|
365
413
|
}, [
|
|
366
414
|
CustomBlock,
|
|
367
415
|
CustomLabel,
|
|
@@ -377,16 +425,16 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
377
425
|
isEditable
|
|
378
426
|
]);
|
|
379
427
|
const blockID = formData?.id;
|
|
380
|
-
const BlockDrawer = useMemo(()=>()=>/*#__PURE__*/
|
|
381
|
-
children: /*#__PURE__*/
|
|
428
|
+
const BlockDrawer = useMemo(()=>()=>/*#__PURE__*/ _jsxDEV(EditDepthProvider, {
|
|
429
|
+
children: /*#__PURE__*/ _jsxDEV(Drawer, {
|
|
382
430
|
className: '',
|
|
383
431
|
slug: drawerSlug,
|
|
384
432
|
title: t(`lexical:blocks:inlineBlocks:${blockID ? 'edit' : 'create'}`, {
|
|
385
433
|
label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label')
|
|
386
434
|
}),
|
|
387
|
-
children: initialState ? /*#__PURE__*/
|
|
435
|
+
children: initialState ? /*#__PURE__*/ _jsxDEV(_Fragment, {
|
|
388
436
|
children: [
|
|
389
|
-
/*#__PURE__*/
|
|
437
|
+
/*#__PURE__*/ _jsxDEV(RenderFields, {
|
|
390
438
|
fields: clientBlock?.fields ?? [],
|
|
391
439
|
forceRender: true,
|
|
392
440
|
parentIndexPath: "",
|
|
@@ -395,15 +443,31 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
395
443
|
parentSchemaPath: schemaFieldsPath,
|
|
396
444
|
permissions: true,
|
|
397
445
|
readOnly: !isEditable
|
|
398
|
-
}
|
|
399
|
-
|
|
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, {
|
|
400
452
|
programmaticSubmit: true,
|
|
401
453
|
children: t('fields:saveChanges')
|
|
402
|
-
}
|
|
454
|
+
}, void 0, false, {
|
|
455
|
+
fileName: "src/features/blocks/client/component/index.tsx",
|
|
456
|
+
lineNumber: 547,
|
|
457
|
+
columnNumber: 15
|
|
458
|
+
}, this)
|
|
403
459
|
]
|
|
404
|
-
}) : null
|
|
405
|
-
}
|
|
406
|
-
|
|
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), [
|
|
407
471
|
initialState,
|
|
408
472
|
drawerSlug,
|
|
409
473
|
blockID,
|
|
@@ -419,7 +483,7 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
419
483
|
if (!initialState) {
|
|
420
484
|
return null;
|
|
421
485
|
}
|
|
422
|
-
return /*#__PURE__*/
|
|
486
|
+
return /*#__PURE__*/ _jsxDEV(Form, {
|
|
423
487
|
beforeSubmit: [
|
|
424
488
|
async ({ formState })=>{
|
|
425
489
|
// This is only called when form is submitted from drawer - usually only the case if the block has a custom Block component
|
|
@@ -448,7 +512,7 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
448
512
|
},
|
|
449
513
|
submitted: submitted,
|
|
450
514
|
uuid: uuid(),
|
|
451
|
-
children: /*#__PURE__*/
|
|
515
|
+
children: /*#__PURE__*/ _jsxDEV(BlockContent, {
|
|
452
516
|
baseClass: baseClass,
|
|
453
517
|
BlockDrawer: BlockDrawer,
|
|
454
518
|
Collapsible: BlockCollapsible,
|
|
@@ -459,8 +523,16 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
459
523
|
initialState: initialState,
|
|
460
524
|
nodeKey: nodeKey,
|
|
461
525
|
RemoveButton: RemoveButton
|
|
462
|
-
}
|
|
463
|
-
|
|
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);
|
|
464
536
|
}, [
|
|
465
537
|
BlockCollapsible,
|
|
466
538
|
BlockDrawer,
|
|
@@ -480,18 +552,26 @@ import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
|
|
|
480
552
|
submitted
|
|
481
553
|
]);
|
|
482
554
|
if (!clientBlock) {
|
|
483
|
-
return /*#__PURE__*/
|
|
555
|
+
return /*#__PURE__*/ _jsxDEV(BlockCollapsible, {
|
|
484
556
|
disableBlockName: true,
|
|
485
557
|
fieldHasErrors: true,
|
|
486
|
-
children: /*#__PURE__*/
|
|
558
|
+
children: /*#__PURE__*/ _jsxDEV("div", {
|
|
487
559
|
className: `${baseClass}-not-found`,
|
|
488
560
|
children: [
|
|
489
561
|
"Error: Block '",
|
|
490
562
|
blockType,
|
|
491
563
|
"' not found in the config but exists in the lexical data"
|
|
492
564
|
]
|
|
493
|
-
}
|
|
494
|
-
|
|
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);
|
|
495
575
|
}
|
|
496
576
|
return Block;
|
|
497
577
|
};
|