@payloadcms/richtext-lexical 3.84.1 → 4.0.0-internal.38b7f1d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/exports/client/Field-PJW7KUJG.js +2 -0
- package/dist/exports/client/Field-PJW7KUJG.js.map +7 -0
- package/dist/exports/client/RelationshipComponent-5RONAYJM.js +2 -0
- package/dist/exports/client/RelationshipComponent-5RONAYJM.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-44G3K3W7.js +2 -0
- package/dist/exports/client/chunk-44G3K3W7.js.map +7 -0
- package/dist/exports/client/chunk-WSAPGI3Z.js +2 -0
- package/dist/exports/client/chunk-WSAPGI3Z.js.map +7 -0
- package/dist/exports/client/component-53Y3RYR5.js +2 -0
- package/dist/exports/client/component-53Y3RYR5.js.map +7 -0
- package/dist/exports/client/componentInline-PM4PLNUK.js +2 -0
- package/dist/exports/client/index.d.ts +0 -2
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +30 -30
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
- package/dist/features/align/client/toolbarAlignGroup.js +1 -0
- package/dist/features/align/client/toolbarAlignGroup.js.map +1 -1
- package/dist/features/blockquote/server/index.d.ts.map +1 -1
- package/dist/features/blockquote/server/index.js +0 -39
- package/dist/features/blockquote/server/index.js.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.d.ts +10 -0
- package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/blocks/client/component/index.css +178 -0
- package/dist/features/blocks/client/component/index.d.ts +1 -1
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +88 -16
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.css +85 -0
- package/dist/features/blocks/client/componentInline/index.d.ts +1 -1
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +29 -6
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/index.d.ts.map +1 -1
- package/dist/features/blocks/client/index.js +0 -2
- package/dist/features/blocks/client/index.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js +3 -0
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.css +26 -0
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js +4 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +40 -0
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js +7 -8
- package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/index.css +171 -0
- package/dist/features/debug/jsxConverter/client/plugin/index.d.ts +1 -1
- package/dist/features/debug/jsxConverter/client/plugin/index.d.ts.map +1 -1
- package/dist/features/debug/jsxConverter/client/plugin/index.js +1 -0
- package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
- package/dist/features/debug/jsxConverter/client/plugin/style.css +9 -0
- package/dist/features/debug/testRecorder/client/plugin/index.css +51 -0
- package/dist/features/debug/testRecorder/client/plugin/index.d.ts +1 -1
- package/dist/features/debug/testRecorder/client/plugin/index.d.ts.map +1 -1
- package/dist/features/debug/testRecorder/client/plugin/index.js +1 -0
- package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
- package/dist/features/debug/treeView/client/plugin/index.css +81 -0
- package/dist/features/debug/treeView/client/plugin/index.d.ts +1 -1
- package/dist/features/debug/treeView/client/plugin/index.d.ts.map +1 -1
- package/dist/features/debug/treeView/client/plugin/index.js +1 -0
- package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.css +91 -0
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +3 -2
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.css +11 -0
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +1 -0
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.css +166 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts +17 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js +219 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.css +235 -0
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +95 -104
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
- package/dist/features/experimental_table/server/index.d.ts.map +1 -1
- package/dist/features/experimental_table/server/index.js +0 -102
- package/dist/features/experimental_table/server/index.js.map +1 -1
- package/dist/features/heading/server/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.js +0 -39
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/horizontalRule/client/plugin/index.css +25 -0
- package/dist/features/horizontalRule/client/plugin/index.d.ts +1 -1
- package/dist/features/horizontalRule/client/plugin/index.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/plugin/index.js +73 -4
- package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
- package/dist/features/horizontalRule/server/index.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/index.js +0 -8
- package/dist/features/horizontalRule/server/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +28 -8
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.css +112 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js +1 -0
- package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
- package/dist/features/link/server/index.d.ts.map +1 -1
- package/dist/features/link/server/index.js +0 -71
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
- package/dist/features/lists/checklist/server/index.js +0 -7
- package/dist/features/lists/checklist/server/index.js.map +1 -1
- package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/orderedList/server/index.js +0 -7
- package/dist/features/lists/orderedList/server/index.js.map +1 -1
- package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/unorderedList/server/index.js +0 -7
- package/dist/features/lists/unorderedList/server/index.js.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.d.ts +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
- package/dist/features/relationship/client/components/RelationshipComponent.js +27 -2
- package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
- package/dist/features/relationship/client/components/index.css +112 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.css +87 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.css +43 -0
- package/dist/features/toolbars/inline/client/Toolbar/index.d.ts +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.js +1 -0
- package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.css +57 -0
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +80 -74
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +4 -0
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.css +214 -0
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +11 -7
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/features/toolbars/types.d.ts +4 -0
- package/dist/features/toolbars/types.d.ts.map +1 -1
- package/dist/features/toolbars/types.js.map +1 -1
- package/dist/features/typesServer.d.ts +0 -17
- package/dist/features/typesServer.d.ts.map +1 -1
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/component/index.css +218 -0
- package/dist/features/upload/client/component/index.d.ts +1 -1
- package/dist/features/upload/client/component/index.d.ts.map +1 -1
- package/dist/features/upload/client/component/index.js +86 -63
- package/dist/features/upload/client/component/index.js.map +1 -1
- package/dist/features/upload/client/component/pending/index.d.ts +0 -1
- package/dist/features/upload/client/component/pending/index.d.ts.map +1 -1
- package/dist/features/upload/client/component/pending/index.js.map +1 -1
- package/dist/features/upload/server/index.d.ts.map +1 -1
- package/dist/features/upload/server/index.js +0 -78
- package/dist/features/upload/server/index.js.map +1 -1
- package/dist/field/Diff/converters/listitem/index.css +44 -0
- package/dist/field/Diff/converters/listitem/index.d.ts +1 -1
- package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/listitem/index.js +1 -0
- package/dist/field/Diff/converters/listitem/index.js.map +1 -1
- package/dist/field/Diff/converters/relationship/index.css +68 -0
- package/dist/field/Diff/converters/relationship/index.d.ts +1 -1
- package/dist/field/Diff/converters/relationship/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/relationship/index.js +1 -0
- package/dist/field/Diff/converters/relationship/index.js.map +1 -1
- package/dist/field/Diff/converters/unknown/index.css +37 -0
- package/dist/field/Diff/converters/unknown/index.d.ts +1 -1
- package/dist/field/Diff/converters/unknown/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/unknown/index.js +1 -0
- package/dist/field/Diff/converters/unknown/index.js.map +1 -1
- package/dist/field/Diff/converters/upload/index.css +112 -0
- package/dist/field/Diff/converters/upload/index.d.ts +1 -1
- package/dist/field/Diff/converters/upload/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/upload/index.js +1 -0
- package/dist/field/Diff/converters/upload/index.js.map +1 -1
- package/dist/field/Diff/index.css +101 -0
- package/dist/field/Diff/index.d.ts +1 -1
- package/dist/field/Diff/index.d.ts.map +1 -1
- package/dist/field/Diff/index.js +1 -0
- package/dist/field/Diff/index.js.map +1 -1
- package/dist/field/Field.d.ts +2 -2
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +11 -9
- package/dist/field/Field.js.map +1 -1
- package/dist/field/ViewSelector.css +32 -0
- package/dist/field/ViewSelector.d.ts +1 -1
- package/dist/field/ViewSelector.d.ts.map +1 -1
- package/dist/field/ViewSelector.js +1 -0
- package/dist/field/ViewSelector.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.css +60 -0
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.css +50 -0
- package/dist/lexical/LexicalEditor.d.ts +1 -1
- package/dist/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/lexical/LexicalEditor.js +1 -0
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/config/server/loader.d.ts.map +1 -1
- package/dist/lexical/config/server/loader.js +12 -9
- package/dist/lexical/config/server/loader.js.map +1 -1
- package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/server/sanitize.js +0 -6
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.css +11 -0
- package/dist/lexical/plugins/DecoratorPlugin/index.d.ts +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.js +1 -0
- package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +52 -0
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +1 -0
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.css +65 -0
- package/dist/lexical/plugins/SlashMenu/index.d.ts +1 -1
- package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.js +2 -0
- package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +40 -0
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +1 -0
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +84 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +15 -8
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
- package/dist/lexical/theme/EditorTheme.css +359 -0
- package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
- package/dist/lexical/theme/EditorTheme.js +1 -0
- package/dist/lexical/theme/EditorTheme.js.map +1 -1
- package/dist/lexical/ui/ContentEditable.css +95 -0
- package/dist/lexical/ui/ContentEditable.d.ts +1 -1
- package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +1 -0
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/lexical/ui/icons/Add/index.d.ts +4 -1
- package/dist/lexical/ui/icons/Add/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Add/index.js +19 -12
- package/dist/lexical/ui/icons/Add/index.js.map +1 -1
- package/dist/lexical/ui/icons/Add/index.svg +2 -3
- package/dist/lexical/ui/icons/Add/light.svg +2 -3
- package/dist/lexical/ui/icons/AlignCenter/index.d.ts +3 -1
- package/dist/lexical/ui/icons/AlignCenter/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignCenter/index.js +15 -19
- package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignJustify/index.d.ts +3 -1
- package/dist/lexical/ui/icons/AlignJustify/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignJustify/index.js +15 -19
- package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignLeft/index.d.ts +3 -1
- package/dist/lexical/ui/icons/AlignLeft/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignLeft/index.js +15 -19
- package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
- package/dist/lexical/ui/icons/AlignRight/index.d.ts +3 -1
- package/dist/lexical/ui/icons/AlignRight/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/AlignRight/index.js +15 -19
- package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
- package/dist/lexical/ui/icons/Block/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Block/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Block/index.js +13 -28
- package/dist/lexical/ui/icons/Block/index.js.map +1 -1
- package/dist/lexical/ui/icons/Blockquote/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Blockquote/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Blockquote/index.js +9 -6
- package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
- package/dist/lexical/ui/icons/Bold/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Bold/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Bold/index.js +13 -8
- package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
- package/dist/lexical/ui/icons/Checklist/index.d.ts +4 -1
- package/dist/lexical/ui/icons/Checklist/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Checklist/index.js +17 -18
- package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
- package/dist/lexical/ui/icons/Code/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Code/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Code/index.js +15 -13
- package/dist/lexical/ui/icons/Code/index.js.map +1 -1
- package/dist/lexical/ui/icons/CodeBlock/index.d.ts +4 -1
- package/dist/lexical/ui/icons/CodeBlock/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/CodeBlock/index.js +18 -7
- package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
- package/dist/lexical/ui/icons/Collapse/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Collapse/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Collapse/index.js +10 -8
- package/dist/lexical/ui/icons/Collapse/index.js.map +1 -1
- package/dist/lexical/ui/icons/DraggableBlock/index.svg +7 -7
- package/dist/lexical/ui/icons/DraggableBlock/light.svg +7 -7
- package/dist/lexical/ui/icons/Expand/index.d.ts +5 -0
- package/dist/lexical/ui/icons/Expand/index.d.ts.map +1 -0
- package/dist/lexical/ui/icons/Expand/index.js +22 -0
- package/dist/lexical/ui/icons/Expand/index.js.map +1 -0
- package/dist/lexical/ui/icons/H1/index.d.ts +3 -1
- package/dist/lexical/ui/icons/H1/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H1/index.js +9 -6
- package/dist/lexical/ui/icons/H1/index.js.map +1 -1
- package/dist/lexical/ui/icons/H2/index.d.ts +3 -1
- package/dist/lexical/ui/icons/H2/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H2/index.js +9 -6
- package/dist/lexical/ui/icons/H2/index.js.map +1 -1
- package/dist/lexical/ui/icons/H3/index.d.ts +3 -1
- package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H3/index.js +9 -6
- package/dist/lexical/ui/icons/H3/index.js.map +1 -1
- package/dist/lexical/ui/icons/H4/index.d.ts +3 -1
- package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H4/index.js +9 -6
- package/dist/lexical/ui/icons/H4/index.js.map +1 -1
- package/dist/lexical/ui/icons/H5/index.d.ts +3 -1
- package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H5/index.js +9 -6
- package/dist/lexical/ui/icons/H5/index.js.map +1 -1
- package/dist/lexical/ui/icons/H6/index.d.ts +3 -1
- package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H6/index.js +9 -6
- package/dist/lexical/ui/icons/H6/index.js.map +1 -1
- package/dist/lexical/ui/icons/HorizontalRule/index.d.ts +3 -1
- package/dist/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/HorizontalRule/index.js +11 -11
- package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
- package/dist/lexical/ui/icons/IndentDecrease/index.d.ts +3 -1
- package/dist/lexical/ui/icons/IndentDecrease/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/IndentDecrease/index.js +18 -22
- package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
- package/dist/lexical/ui/icons/IndentIncrease/index.d.ts +3 -1
- package/dist/lexical/ui/icons/IndentIncrease/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/IndentIncrease/index.js +15 -22
- package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
- package/dist/lexical/ui/icons/InlineBlocks/index.d.ts +3 -1
- package/dist/lexical/ui/icons/InlineBlocks/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/InlineBlocks/index.js +9 -6
- package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
- package/dist/lexical/ui/icons/Italic/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Italic/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Italic/index.js +13 -8
- package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
- package/dist/lexical/ui/icons/Link/index.d.ts +4 -1
- package/dist/lexical/ui/icons/Link/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Link/index.js +14 -9
- package/dist/lexical/ui/icons/Link/index.js.map +1 -1
- package/dist/lexical/ui/icons/Meatballs/index.d.ts +4 -1
- package/dist/lexical/ui/icons/Meatballs/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Meatballs/index.js +19 -15
- package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
- package/dist/lexical/ui/icons/OrderedList/index.d.ts +4 -1
- package/dist/lexical/ui/icons/OrderedList/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/OrderedList/index.js +19 -25
- package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
- package/dist/lexical/ui/icons/Page/index.d.ts +5 -0
- package/dist/lexical/ui/icons/Page/index.d.ts.map +1 -0
- package/dist/lexical/ui/icons/Page/index.js +21 -0
- package/dist/lexical/ui/icons/Page/index.js.map +1 -0
- package/dist/lexical/ui/icons/Relationship/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Relationship/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Relationship/index.js +13 -25
- package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
- package/dist/lexical/ui/icons/Strikethrough/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Strikethrough/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Strikethrough/index.js +13 -13
- package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
- package/dist/lexical/ui/icons/Subscript/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Subscript/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Subscript/index.js +10 -7
- package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
- package/dist/lexical/ui/icons/Superscript/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Superscript/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Superscript/index.js +10 -7
- package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
- package/dist/lexical/ui/icons/Table/index.d.ts +4 -1
- package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Table/index.js +20 -15
- package/dist/lexical/ui/icons/Table/index.js.map +1 -1
- package/dist/lexical/ui/icons/Text/index.d.ts +4 -1
- package/dist/lexical/ui/icons/Text/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Text/index.js +17 -8
- package/dist/lexical/ui/icons/Text/index.js.map +1 -1
- package/dist/lexical/ui/icons/Trash/index.d.ts +10 -0
- package/dist/lexical/ui/icons/Trash/index.d.ts.map +1 -0
- package/dist/lexical/ui/icons/Trash/index.js +29 -0
- package/dist/lexical/ui/icons/Trash/index.js.map +1 -0
- package/dist/lexical/ui/icons/Underline/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Underline/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Underline/index.js +16 -14
- package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
- package/dist/lexical/ui/icons/UnorderedList/index.d.ts +3 -1
- package/dist/lexical/ui/icons/UnorderedList/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/UnorderedList/index.js +13 -40
- package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
- package/dist/lexical/ui/icons/Upload/index.d.ts +3 -1
- package/dist/lexical/ui/icons/Upload/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/Upload/index.js +15 -22
- package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
- package/dist/utilities/buildEditorState.d.ts.map +1 -1
- package/dist/utilities/buildEditorState.js +13 -0
- package/dist/utilities/buildEditorState.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts +1 -0
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +34 -18
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
- package/package.json +10 -15
- package/dist/exports/client/Component-DOSSWC76.js +0 -2
- package/dist/exports/client/Component-DOSSWC76.js.map +0 -7
- package/dist/exports/client/Component-MBLHTKDK.js +0 -2
- package/dist/exports/client/Component-MBLHTKDK.js.map +0 -7
- package/dist/exports/client/Field-4UEGQMIN.js +0 -2
- package/dist/exports/client/Field-4UEGQMIN.js.map +0 -7
- package/dist/exports/client/RelationshipComponent-BG3DPV3T.js +0 -2
- package/dist/exports/client/RelationshipComponent-BG3DPV3T.js.map +0 -7
- package/dist/exports/client/chunk-F26IQ5RE.js +0 -2
- package/dist/exports/client/chunk-F26IQ5RE.js.map +0 -7
- package/dist/exports/client/chunk-YWIZCGSY.js +0 -2
- package/dist/exports/client/chunk-YWIZCGSY.js.map +0 -7
- package/dist/exports/client/component-XIHC3W6W.js +0 -2
- package/dist/exports/client/component-XIHC3W6W.js.map +0 -7
- package/dist/exports/client/componentInline-CBBUBQ7P.js +0 -2
- package/dist/exports/server/migrate.d.ts +0 -16
- package/dist/exports/server/migrate.d.ts.map +0 -1
- package/dist/exports/server/migrate.js +0 -16
- package/dist/exports/server/migrate.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts +0 -4
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js +0 -7
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts +0 -4
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js +0 -38
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts +0 -4
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js +0 -9
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts +0 -4
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js +0 -33
- package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts +0 -6
- package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js +0 -9
- package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts +0 -70
- package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js +0 -104
- package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts +0 -27
- package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js +0 -2
- package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts +0 -39
- package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/field/index.js +0 -122
- package/dist/features/converters/lexicalToHtml_deprecated/field/index.js.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts +0 -12
- package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts.map +0 -1
- package/dist/features/converters/lexicalToHtml_deprecated/index.js +0 -11
- package/dist/features/converters/lexicalToHtml_deprecated/index.js.map +0 -1
- package/dist/features/lists/htmlConverter.d.ts +0 -5
- package/dist/features/lists/htmlConverter.d.ts.map +0 -1
- package/dist/features/lists/htmlConverter.js +0 -81
- package/dist/features/lists/htmlConverter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js +0 -22
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js +0 -33
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js +0 -24
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js +0 -25
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js +0 -22
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js +0 -28
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +0 -22
- package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.d.ts +0 -3
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js +0 -9
- package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts +0 -19
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +0 -78
- package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts +0 -23
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.js +0 -2
- package/dist/features/migrations/lexicalPluginToLexical/converter/types.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts +0 -2
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.js +0 -10
- package/dist/features/migrations/lexicalPluginToLexical/feature.client.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts +0 -10
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.js +0 -49
- package/dist/features/migrations/lexicalPluginToLexical/feature.server.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts +0 -9
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +0 -15
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +0 -33
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +0 -1
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +0 -74
- package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js +0 -23
- package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js +0 -24
- package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js +0 -33
- package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js +0 -30
- package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js +0 -26
- package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js +0 -26
- package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js +0 -15
- package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js +0 -27
- package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js +0 -26
- package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js +0 -18
- package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.d.ts +0 -3
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.js +0 -12
- package/dist/features/migrations/slateToLexical/converter/defaultConverters.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/index.d.ts +0 -19
- package/dist/features/migrations/slateToLexical/converter/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/index.js +0 -130
- package/dist/features/migrations/slateToLexical/converter/index.js.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/types.d.ts +0 -16
- package/dist/features/migrations/slateToLexical/converter/types.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/converter/types.js +0 -2
- package/dist/features/migrations/slateToLexical/converter/types.js.map +0 -1
- package/dist/features/migrations/slateToLexical/feature.client.d.ts +0 -2
- package/dist/features/migrations/slateToLexical/feature.client.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/feature.client.js +0 -10
- package/dist/features/migrations/slateToLexical/feature.client.js.map +0 -1
- package/dist/features/migrations/slateToLexical/feature.server.d.ts +0 -40
- package/dist/features/migrations/slateToLexical/feature.server.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/feature.server.js +0 -68
- package/dist/features/migrations/slateToLexical/feature.server.js.map +0 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts +0 -9
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +0 -15
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +0 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +0 -33
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +0 -1
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +0 -74
- package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +0 -1
- package/dist/lexical/ui/icons/AI/index.d.ts +0 -3
- package/dist/lexical/ui/icons/AI/index.d.ts.map +0 -1
- package/dist/lexical/ui/icons/AI/index.js +0 -34
- package/dist/lexical/ui/icons/AI/index.js.map +0 -1
- package/dist/lexical/ui/icons/Caret/index.svg +0 -3
- package/dist/lexical/ui/icons/Edit/index.svg +0 -10
- package/dist/lexical/ui/icons/Remove/index.svg +0 -4
- package/dist/utilities/migrateSlateToLexical/index.d.ts +0 -15
- package/dist/utilities/migrateSlateToLexical/index.d.ts.map +0 -1
- package/dist/utilities/migrateSlateToLexical/index.js +0 -152
- package/dist/utilities/migrateSlateToLexical/index.js.map +0 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts +0 -10
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +0 -1
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +0 -85
- package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +0 -1
- /package/dist/exports/client/{componentInline-CBBUBQ7P.js.map → componentInline-PM4PLNUK.js.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as ue}from"./chunk-INBEEENE.js";import{b as ae}from"./chunk-BZZVLW4U.js";import{jsx as s,jsxs as _,Fragment as Re}from"react/jsx-runtime";import{useLexicalComposerContext as je}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as Me}from"@lexical/react/useLexicalEditable";import{getTranslation as me}from"@payloadcms/translations";import{Button as de,Drawer as Ke,EditDepthProvider as Ae,Form as Je,formatDrawerSlug as ze,FormSubmit as Ve,RenderFields as He,ShimmerEffect as We,useConfig as Xe,useDocumentForm as Ge,useDocumentInfo as Ue,useEditDepth as qe,useServerFunctions as Qe,useTranslation as Ye}from"@payloadcms/ui";import{abortAndIgnore as J}from"@payloadcms/ui/shared";import{$getNodeByKey as z,SKIP_DOM_SELECTION_TAG as fe}from"lexical";import{deepCopyObjectSimpleWithoutReactComponents as V,reduceFieldsToValues as Ze}from"payload/shared";import F,{createContext as et,useCallback as H,useEffect as E,useMemo as B,useRef as y}from"react";import{v4 as tt}from"uuid";import{jsx as Oe}from"react/jsx-runtime";import Te from"bson-objectid";import{$applyNodeReplacement as Ee}from"lexical";import $e from"react";import{addClassNamesToElement as De}from"@lexical/utils";import Ie from"bson-objectid";import{$applyNodeReplacement as ve,DecoratorNode as we}from"lexical";var S=class extends we{__cacheBuster;__fields;constructor({cacheBuster:t,fields:e,key:i}){super(i),this.__fields=e,this.__cacheBuster=t||0}static clone(t){return new this({cacheBuster:t.__cacheBuster,fields:t.__fields,key:t.__key})}static getType(){return"inlineBlock"}static importDOM(){return{}}static importJSON(t){return Ne(t.fields)}static isInline(){return!1}canIndent(){return!0}createDOM(t){let e=document.createElement("span");return De(e,t?.theme?.inlineBlock),e}decorate(t,e){return null}exportDOM(){let t=document.createElement("span");t.classList.add("inline-block-container");let e=document.createTextNode(this.getTextContent());return t.append(e),{element:t}}exportJSON(){return{type:"inlineBlock",fields:this.getFields(),version:1}}getCacheBuster(){return this.getLatest().__cacheBuster}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}isInline(){return!0}setFields(t,e){let i=this.getWritable();i.__fields=t,e||i.__cacheBuster++}updateDOM(){return!1}};function Ne(c){return ve(new S({fields:{...c,id:c?.id||new Ie.default().toHexString()}}))}var Le=$e.lazy(()=>import("./componentInline-PM4PLNUK.js").then(c=>({default:c.InlineBlockComponent}))),T=class extends S{static clone(t){return super.clone(t)}static getType(){return super.getType()}static importJSON(t){return Pe(t.fields)}decorate(...[t,e,i,f]){return Oe(Le,{cacheBuster:this.getCacheBuster(),className:e.theme.inlineBlock??"LexicalEditorTheme__inlineBlock",CustomBlock:i,CustomLabel:f,formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Pe(c){return Ee(new T({fields:{...c,id:c?.id||new Te.default().toHexString()}}))}function A(c){return c instanceof T}var be=et({initialState:!1}),pe=()=>F.use(be),Dt=c=>{let{cacheBuster:t,className:e,CustomBlock:i,CustomLabel:f,formData:n,nodeKey:a}=c,[h]=je(),u=Me(),{i18n:$,t:k}=Ye(),{createdInlineBlock:W,fieldProps:{featureClientSchemaMap:ke,initialLexicalFormState:he,schemaPath:X},setCreatedInlineBlock:G,uuid:Be}=ae(),{fields:D}=Ge(),{getFormState:I}=Qe(),Ce=qe(),U=y(!1),[m,L]=F.useState(()=>{let r=he?.[n.id]?.formState;return r?Object.fromEntries(Object.entries(r).map(([l,o])=>[l,l in n?{...o,initialValue:n[l],value:n[l]}:o])):!1}),q=y(!1),Q=y(t);E(()=>{q.current?(Q.current!==t&&L(!1),Q.current=t):q.current=!0},[t]);let[ge]=F.useState(()=>tt()),[Y,Z]=F.useState(()=>{if(!f)return m?._components?.customComponents?.BlockLabel??void 0}),[ee,te]=F.useState(()=>{if(!i)return m?._components?.customComponents?.Block??void 0}),ne=B(()=>i?s(i,{className:e,formData:n,isEditor:!0,isJSXConverter:!1,nodeKey:a,useInlineBlockComponentContext:pe}):ee,[i,e,n,a,ee]),P=B(()=>f?s(f,{className:e,formData:n,isEditor:!0,isJSXConverter:!1,nodeKey:a,useInlineBlockComponentContext:pe}):Y,[f,e,n,a,Y]),oe=ze({slug:`lexical-inlineBlocks-create-${Be}-${n.id}`,depth:Ce}),{toggleDrawer:b}=ue(oe,!0),xe=y(null),{id:v,collectionSlug:w,getDocPreferences:N,globalSlug:O}=Ue(),{config:Se}=Xe(),_e=`${X}.lexical_internal_feature.blocks.lexical_inline_blocks.${n.blockType}`,C=ke.blocks?.[_e]?.[0],d=C.blockReferences?typeof C?.blockReferences?.[0]=="string"?Se.blocksMap[C?.blockReferences?.[0]]:C?.blockReferences?.[0]:C?.blocks?.[0],re=d?.fields??[];E(()=>{!U.current&&W?.getKey()===a&&(re.length>2&&b(),G?.(void 0),U.current=!0)},[re.length,W,a,G,b]);let le=H(()=>{h.update(()=>{z(a)?.remove()})},[h,a]),g=d?.labels?.singular?me(d?.labels.singular,$):d?.slug,R=y(new AbortController),x=`${X}.lexical_internal_feature.blocks.lexical_inline_blocks.${d?.slug}.fields`;E(()=>{let r=new AbortController;return n&&!m&&(async()=>{let{state:o}=await I({id:v,collectionSlug:w,data:n,docPermissions:{fields:!0},docPreferences:await N(),documentFormState:V(D,{excludeFiles:!0}),globalSlug:O,initialBlockData:n,initialBlockFormState:n,operation:"update",readOnly:!u,renderAllFields:!0,schemaPath:x,signal:r.signal});if(o){let p=Ze(V(o,{excludeFiles:!0}),!0);h.update(()=>{let K=z(a);if(K&&A(K)){let ce=p;ce.blockType=n.blockType,K.setFields(ce,!0)}},{tag:fe}),L(o),f||Z(o._components?.customComponents?.BlockLabel),i||te(o._components?.customComponents?.Block)}})(),()=>{J(r)}},[I,h,a,u,f,i,x,v,n,m,w,O,N,D]);let se=H(async({formState:r,submit:l})=>{J(R.current);let o=new AbortController;R.current=o;let{state:p}=await I({id:v,collectionSlug:w,docPermissions:{fields:!0},docPreferences:await N(),documentFormState:V(D,{excludeFiles:!0}),formState:r,globalSlug:O,initialBlockFormState:r,operation:"update",readOnly:!u,renderAllFields:!!l,schemaPath:x,signal:o.signal});return p?(l&&(f||Z(p._components?.customComponents?.BlockLabel),i||te(p._components?.customComponents?.Block)),p):r},[I,v,w,N,D,O,u,x,i,f]);E(()=>{let r=(l,o)=>Object.keys(o).some(p=>o[p]&&l[p]!==o[p].value);return()=>{m&&r(n,m)&&L(!1),J(R.current)}},[n,m]);let ye=H((r,l)=>{l.blockType=n.blockType,h.update(()=>{let o=z(a);o&&A(o)&&o.setFields(l,!0)},{tag:fe})},[h,a,n]),j=B(()=>()=>s(de,{buttonStyle:"icon-label",className:`${e}__removeButton`,disabled:!u,icon:"x",onClick:r=>{r.preventDefault(),r.stopPropagation(),le()},round:!0,size:"medium",tooltip:k("lexical:blocks:inlineBlocks:remove",{label:g})}),[e,g,u,le,k]),Fe=B(()=>()=>s(de,{buttonStyle:"icon-label",className:`${e}__editButton`,disabled:!u,el:"button",icon:"edit",onClick:()=>{b()},round:!0,size:"medium",tooltip:k("lexical:blocks:inlineBlocks:edit",{label:g})}),[e,g,u,k,b]),M=B(()=>({children:r,className:l})=>s("div",{className:[`${e}__container`,e+"-"+n.blockType,l].filter(Boolean).join(" "),...u?{onClick:()=>b(),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),b())},role:"button",tabIndex:0}:{},ref:xe,children:r}),[e,n.blockType,u,b]),ie=B(()=>P?()=>P:()=>s("div",{children:d?.labels?me(d?.labels.singular,$):""}),[P,d?.labels,$]);return d?_(Je,{beforeSubmit:[async({formState:r})=>await se({formState:r,submit:!0})],disableValidationOnSubmit:!0,el:"div",fields:d?.fields,initialState:m||{},onChange:[se],onSubmit:(r,l)=>{ye(r,l),b()},uuid:ge,children:[s(Ae,{children:s(Ke,{className:"",slug:oe,title:k(`lexical:blocks:inlineBlocks:${n?.id?"edit":"create"}`,{label:g??k("lexical:blocks:inlineBlocks:label")}),children:m?_(Re,{children:[s(He,{fields:d?.fields,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:x,permissions:!0,readOnly:!u}),s(Ve,{programmaticSubmit:!0,children:k("fields:saveChanges")})]}):null})}),ne?s(be,{value:{EditButton:Fe,initialState:m,InlineBlockContainer:M,Label:ie,nodeKey:a,RemoveButton:j},children:ne}):_(M,{children:[m?s(ie,{}):s(We,{height:"15px",width:"40px"}),u?s("div",{className:`${e}__actions`,children:s(j,{})}):null]})]}):_(M,{className:`${e}-not-found`,children:[_("span",{children:["Error: Block '",n.blockType,"' not found"]}),u?s("div",{className:`${e}__actions`,children:s(j,{})}):null]})};export{pe as a,Dt as b,T as c,Pe as d,A as e};
|
|
2
|
+
//# sourceMappingURL=chunk-44G3K3W7.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/blocks/client/componentInline/index.tsx", "../../../src/features/blocks/client/nodes/InlineBlocksNode.tsx", "../../../src/features/blocks/server/nodes/InlineBlocksNode.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport type { BlocksFieldClient, ClientBlock, Data, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Drawer,\n EditDepthProvider,\n Form,\n formatDrawerSlug,\n FormSubmit,\n RenderFields,\n ShimmerEffect,\n useConfig,\n useDocumentForm,\n useDocumentInfo,\n useEditDepth,\n useServerFunctions,\n useTranslation,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { $getNodeByKey, SKIP_DOM_SELECTION_TAG } from 'lexical'\n\nimport './index.css'\n\nimport { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from 'payload/shared'\nimport React, { createContext, useCallback, useEffect, useMemo, useRef } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { ViewMapInlineBlockComponentProps } from '../../../../types.js'\nimport type { InlineBlockFields } from '../../server/nodes/InlineBlocksNode.js'\nimport type { BlockComponentProps } from '../component/index.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js'\n\nexport type InlineBlockComponentProps<\n TFormData extends Record<string, unknown> = InlineBlockFields,\n> = {\n readonly CustomBlock?: React.FC<ViewMapInlineBlockComponentProps>\n readonly CustomLabel?: React.FC<ViewMapInlineBlockComponentProps>\n} & Pick<BlockComponentProps<TFormData>, 'cacheBuster' | 'className' | 'formData' | 'nodeKey'>\n\nexport type InlineBlockComponentContextType = {\n EditButton?: React.FC\n initialState: false | FormState | undefined\n InlineBlockContainer?: React.FC<{ children: React.ReactNode }>\n Label?: React.FC\n nodeKey?: string\n RemoveButton?: React.FC\n}\n\nconst InlineBlockComponentContext = createContext<InlineBlockComponentContextType>({\n initialState: false,\n})\n\nexport const useInlineBlockComponentContext = () => React.use(InlineBlockComponentContext)\n\nexport const InlineBlockComponent: React.FC<InlineBlockComponentProps<InlineBlockFields>> = (\n props,\n) => {\n const {\n cacheBuster,\n className: baseClass,\n CustomBlock: CustomBlockFromProps,\n CustomLabel: CustomLabelFromProps,\n formData,\n nodeKey,\n } = props\n\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n const { i18n, t } = useTranslation<object, string>()\n const {\n createdInlineBlock,\n fieldProps: { featureClientSchemaMap, initialLexicalFormState, schemaPath },\n setCreatedInlineBlock,\n uuid: uuidFromContext,\n } = useEditorConfigContext()\n const { fields: parentDocumentFields } = useDocumentForm()\n\n const { getFormState } = useServerFunctions()\n const editDepth = useEditDepth()\n const firstTimeDrawer = useRef(false)\n\n const [initialState, setInitialState] = React.useState<false | FormState | undefined>(() => {\n // Initial form state that was calculated server-side. May have stale values\n const cachedFormState = initialLexicalFormState?.[formData.id]?.formState\n if (!cachedFormState) {\n return false\n }\n\n // Merge current formData values into the cached form state\n // This ensures that when the component remounts (e.g., due to view changes), we don't lose user edits\n return Object.fromEntries(\n Object.entries(cachedFormState).map(([fieldName, fieldState]) => [\n fieldName,\n fieldName in formData\n ? {\n ...fieldState,\n initialValue: formData[fieldName],\n value: formData[fieldName],\n }\n : fieldState,\n ]),\n )\n })\n\n const hasMounted = useRef(false)\n const prevCacheBuster = useRef(cacheBuster)\n useEffect(() => {\n if (hasMounted.current) {\n if (prevCacheBuster.current !== cacheBuster) {\n setInitialState(false)\n }\n prevCacheBuster.current = cacheBuster\n } else {\n hasMounted.current = true\n }\n }, [cacheBuster])\n\n const [formUuid] = React.useState(() => uuid())\n\n // Server-rendered custom components (from admin.components, NOT viewMap).\n // When viewMap components exist, we render them directly with formData instead.\n const [CustomLabel, setCustomLabel] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomLabelFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.BlockLabel ?? undefined\n })\n\n const [CustomBlock, setCustomBlock] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomBlockFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.Block ?? undefined\n })\n\n const resolvedCustomBlock = useMemo(() => {\n if (CustomBlockFromProps) {\n return (\n <CustomBlockFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomBlock\n }, [CustomBlockFromProps, baseClass, formData, nodeKey, CustomBlock])\n\n const resolvedCustomLabel = useMemo(() => {\n if (CustomLabelFromProps) {\n return (\n <CustomLabelFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomLabel\n }, [CustomLabelFromProps, baseClass, formData, nodeKey, CustomLabel])\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-inlineBlocks-create-${uuidFromContext}-${formData.id}`,\n depth: editDepth,\n })\n const { toggleDrawer } = useLexicalDrawer(drawerSlug, true)\n\n const inlineBlockElemElemRef = useRef<HTMLDivElement | null>(null)\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n const { config } = useConfig()\n\n const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${formData.blockType}`\n\n const clientSchemaMap = featureClientSchemaMap['blocks']\n\n const blocksField: BlocksFieldClient = clientSchemaMap?.[\n componentMapRenderedBlockPath\n ]?.[0] as BlocksFieldClient\n\n const clientBlock: ClientBlock | undefined = blocksField.blockReferences\n ? typeof blocksField?.blockReferences?.[0] === 'string'\n ? config.blocksMap[blocksField?.blockReferences?.[0]]\n : blocksField?.blockReferences?.[0]\n : blocksField?.blocks?.[0]\n\n const clientBlockFields = clientBlock?.fields ?? []\n\n // Open drawer on \"mount\"\n useEffect(() => {\n if (!firstTimeDrawer.current && createdInlineBlock?.getKey() === nodeKey) {\n // > 2 because they always have \"id\" and \"blockName\" fields\n if (clientBlockFields.length > 2) {\n toggleDrawer()\n }\n setCreatedInlineBlock?.(undefined)\n firstTimeDrawer.current = true\n }\n }, [clientBlockFields.length, createdInlineBlock, nodeKey, setCreatedInlineBlock, toggleDrawer])\n\n const removeInlineBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const blockDisplayName = clientBlock?.labels?.singular\n ? getTranslation(clientBlock?.labels.singular, i18n)\n : clientBlock?.slug\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${clientBlock?.slug}.fields`\n\n // Initial state for newly created blocks\n useEffect(() => {\n const abortController = new AbortController()\n\n const awaitInitialState = async () => {\n /*\n * This will only run if a new block is created. For all existing blocks that are loaded when the document is loaded, or when the form is saved,\n * this is not run, as the lexical field RSC will fetch the state server-side and pass it to the client. That way, we avoid unnecessary client-side\n * requests. Though for newly created blocks, we need to fetch the state client-side, as the server doesn't know about the block yet.\n */\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: formData,\n docPermissions: { fields: true },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n globalSlug,\n initialBlockData: formData,\n initialBlockFormState: formData,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: abortController.signal,\n })\n\n if (state) {\n const newFormStateData: InlineBlockFields = reduceFieldsToValues(\n deepCopyObjectSimpleWithoutReactComponents(state, { excludeFiles: true }),\n true,\n ) as InlineBlockFields\n\n // Things like default values may come back from the server => update the node with the new data\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n const newData = newFormStateData\n newData.blockType = formData.blockType\n\n node.setFields(newData, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n\n setInitialState(state)\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n }\n\n if (formData && !initialState) {\n void awaitInitialState()\n }\n\n return () => {\n abortAndIgnore(abortController)\n }\n }, [\n getFormState,\n editor,\n nodeKey,\n isEditable,\n CustomLabelFromProps,\n CustomBlockFromProps,\n schemaFieldsPath,\n id,\n formData,\n initialState,\n collectionSlug,\n globalSlug,\n getDocPreferences,\n parentDocumentFields,\n ])\n\n /**\n * HANDLE ONCHANGE\n */\n const onChange = useCallback(\n async ({ formState: prevFormState, submit }: { formState: FormState; submit?: boolean }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n formState: prevFormState,\n globalSlug,\n initialBlockFormState: prevFormState,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: submit ? true : false,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n if (submit) {\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n\n return state\n },\n [\n getFormState,\n id,\n collectionSlug,\n getDocPreferences,\n parentDocumentFields,\n globalSlug,\n isEditable,\n schemaFieldsPath,\n CustomBlockFromProps,\n CustomLabelFromProps,\n ],\n )\n // cleanup effect\n useEffect(() => {\n const isStateOutOfSync = (formData: InlineBlockFields, initialState: FormState) => {\n return Object.keys(initialState).some(\n (key) => initialState[key] && formData[key] !== initialState[key].value,\n )\n }\n\n return () => {\n // If the component is unmounted (either via removeInlineBlock or via lexical itself) and the form state got changed before,\n // we need to reset the initial state to force a re-fetch of the initial state when it gets mounted again (e.g. via lexical history undo).\n // Otherwise it would use an outdated initial state.\n if (initialState && isStateOutOfSync(formData, initialState)) {\n setInitialState(false)\n }\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [formData, initialState])\n\n /**\n * HANDLE FORM SUBMIT\n */\n const onFormSubmit = useCallback(\n (formState: FormState, newData: Data) => {\n newData.blockType = formData.blockType\n\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n node.setFields(newData as InlineBlockFields, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n },\n [editor, nodeKey, formData],\n )\n\n const RemoveButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n removeInlineBlock()\n }}\n round\n size=\"medium\"\n tooltip={t('lexical:blocks:inlineBlocks:remove', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, removeInlineBlock, t],\n )\n\n const EditButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__editButton`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"edit\"\n onClick={() => {\n toggleDrawer()\n }}\n round\n size=\"medium\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, t, toggleDrawer],\n )\n\n const InlineBlockContainer = useMemo(\n () =>\n ({ children, className }: { children: React.ReactNode; className?: string }) => (\n <div\n className={[`${baseClass}__container`, baseClass + '-' + formData.blockType, className]\n .filter(Boolean)\n .join(' ')}\n {...(isEditable\n ? {\n onClick: () => toggleDrawer(),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n toggleDrawer()\n }\n },\n role: 'button',\n tabIndex: 0,\n }\n : {})}\n ref={inlineBlockElemElemRef}\n >\n {children}\n </div>\n ),\n [baseClass, formData.blockType, isEditable, toggleDrawer],\n )\n\n const Label = useMemo(() => {\n if (resolvedCustomLabel) {\n return () => resolvedCustomLabel\n } else {\n return () => (\n <div>{clientBlock?.labels ? getTranslation(clientBlock?.labels.singular, i18n) : ''}</div>\n )\n }\n }, [resolvedCustomLabel, clientBlock?.labels, i18n])\n\n if (!clientBlock) {\n return (\n <InlineBlockContainer className={`${baseClass}-not-found`}>\n <span>Error: Block '{formData.blockType}' not found</span>\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )\n }\n\n return (\n <Form\n beforeSubmit={[\n async ({ formState }) => {\n // This is only called when form is submitted from drawer\n return await onChange({ formState, submit: true })\n },\n ]}\n disableValidationOnSubmit\n el=\"div\"\n fields={clientBlock?.fields}\n initialState={initialState || {}}\n onChange={[onChange]}\n onSubmit={(formState, data) => {\n onFormSubmit(formState, data)\n toggleDrawer()\n }}\n uuid={formUuid}\n >\n <EditDepthProvider>\n <Drawer\n className={''}\n slug={drawerSlug}\n title={t(`lexical:blocks:inlineBlocks:${formData?.id ? 'edit' : 'create'}`, {\n label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label'),\n })}\n >\n {initialState ? (\n <>\n <RenderFields\n fields={clientBlock?.fields}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={true}\n readOnly={!isEditable}\n />\n <FormSubmit programmaticSubmit={true}>{t('fields:saveChanges')}</FormSubmit>\n </>\n ) : null}\n </Drawer>\n </EditDepthProvider>\n {resolvedCustomBlock ? (\n <InlineBlockComponentContext\n value={{\n EditButton,\n initialState,\n InlineBlockContainer,\n Label,\n nodeKey,\n RemoveButton,\n }}\n >\n {resolvedCustomBlock}\n </InlineBlockComponentContext>\n ) : (\n <InlineBlockContainer>\n {initialState ? <Label /> : <ShimmerEffect height=\"15px\" width=\"40px\" />}\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )}\n </Form>\n )\n}\n", "'use client'\nimport ObjectID from 'bson-objectid'\nimport {\n $applyNodeReplacement,\n type EditorConfig,\n type LexicalEditor,\n type LexicalNode,\n} from 'lexical'\nimport React, { type JSX } from 'react'\n\nimport type { ViewMapInlineBlockComponentProps } from '../../../../types.js'\nimport type {\n InlineBlockFields,\n SerializedInlineBlockNode,\n} from '../../server/nodes/InlineBlocksNode.js'\n\nimport { ServerInlineBlockNode } from '../../server/nodes/InlineBlocksNode.js'\n\nconst InlineBlockComponent = React.lazy(() =>\n import('../componentInline/index.js').then((module) => ({\n default: module.InlineBlockComponent,\n })),\n)\n\nexport type InlineBlockDecorateFunction = (\n editor: LexicalEditor,\n config: EditorConfig,\n CustomBlock?: React.FC<ViewMapInlineBlockComponentProps>,\n CustomLabel?: React.FC<ViewMapInlineBlockComponentProps>,\n) => JSX.Element\n\nexport class InlineBlockNode extends ServerInlineBlockNode {\n static override clone(node: ServerInlineBlockNode): ServerInlineBlockNode {\n return super.clone(node)\n }\n\n static override getType(): string {\n return super.getType()\n }\n\n static override importJSON(serializedNode: SerializedInlineBlockNode): InlineBlockNode {\n const node = $createInlineBlockNode(serializedNode.fields)\n return node\n }\n\n override decorate(\n ...[_editor, config, CustomBlock, CustomLabel]: Parameters<InlineBlockDecorateFunction>\n ): ReturnType<InlineBlockDecorateFunction> {\n return (\n <InlineBlockComponent\n cacheBuster={this.getCacheBuster()}\n className={config.theme.inlineBlock ?? 'LexicalEditorTheme__inlineBlock'}\n CustomBlock={CustomBlock}\n CustomLabel={CustomLabel}\n formData={this.getFields()}\n nodeKey={this.getKey()}\n />\n )\n }\n\n override exportJSON(): SerializedInlineBlockNode {\n return super.exportJSON()\n }\n}\n\nexport function $createInlineBlockNode(fields: Exclude<InlineBlockFields, 'id'>): InlineBlockNode {\n return $applyNodeReplacement(\n new InlineBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\n },\n }),\n )\n}\n\nexport function $isInlineBlockNode(\n node: InlineBlockNode | LexicalNode | null | undefined,\n): node is InlineBlockNode {\n return node instanceof InlineBlockNode\n}\n", "import type {\n DOMConversionMap,\n DOMExportOutput,\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n SerializedLexicalNode,\n} from 'lexical'\nimport type { JsonObject } from 'payload'\nimport type React from 'react'\nimport type { JSX } from 'react'\n\nimport { addClassNamesToElement } from '@lexical/utils'\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement, DecoratorNode } from 'lexical'\n\nimport type { StronglyTypedLeafNode } from '../../../../nodeTypes.js'\n\nexport type InlineBlockFields<TInlineBlockFields extends JsonObject = JsonObject> = {\n blockType: string\n id: string\n} & TInlineBlockFields\n\nexport type SerializedInlineBlockNode<TBlockFields extends JsonObject = JsonObject> = {\n fields: InlineBlockFields<TBlockFields>\n} & StronglyTypedLeafNode<SerializedLexicalNode, 'inlineBlock'>\n\nexport class ServerInlineBlockNode extends DecoratorNode<null | React.ReactElement> {\n __cacheBuster: number\n __fields: InlineBlockFields\n\n constructor({\n cacheBuster,\n fields,\n key,\n }: {\n cacheBuster?: number\n fields: InlineBlockFields\n key?: NodeKey\n }) {\n super(key)\n this.__fields = fields\n this.__cacheBuster = cacheBuster || 0\n }\n\n static override clone(node: ServerInlineBlockNode): ServerInlineBlockNode {\n return new this({\n cacheBuster: node.__cacheBuster,\n fields: node.__fields,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'inlineBlock'\n }\n\n static override importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {}\n }\n\n static override importJSON(serializedNode: SerializedInlineBlockNode): ServerInlineBlockNode {\n const node = $createServerInlineBlockNode(serializedNode.fields)\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n canIndent() {\n return true\n }\n\n override createDOM(config?: EditorConfig): HTMLElement {\n const element = document.createElement('span')\n addClassNamesToElement(element, config?.theme?.inlineBlock)\n return element\n }\n\n override decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element | null {\n return null\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('span')\n element.classList.add('inline-block-container')\n\n const text = document.createTextNode(this.getTextContent())\n element.append(text)\n return { element }\n }\n\n override exportJSON(): SerializedInlineBlockNode {\n return {\n type: 'inlineBlock',\n fields: this.getFields(),\n version: 1,\n }\n }\n\n getCacheBuster(): number {\n return this.getLatest().__cacheBuster\n }\n\n getFields(): InlineBlockFields {\n return this.getLatest().__fields\n }\n\n override getTextContent(): string {\n return `Block Field`\n }\n\n override isInline() {\n return true\n }\n\n setFields(fields: InlineBlockFields, preventFormStateUpdate?: boolean): void {\n const writable = this.getWritable()\n writable.__fields = fields\n if (!preventFormStateUpdate) {\n writable.__cacheBuster++\n }\n }\n\n override updateDOM(): boolean {\n return false\n }\n}\n\nexport function $createServerInlineBlockNode(\n fields: Exclude<InlineBlockFields, 'id'>,\n): ServerInlineBlockNode {\n return $applyNodeReplacement(\n new ServerInlineBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\n },\n }),\n )\n}\n\nexport function $isServerInlineBlockNode(\n node: LexicalNode | null | ServerInlineBlockNode | undefined,\n): node is ServerInlineBlockNode {\n return node instanceof ServerInlineBlockNode\n}\n"],
|
|
5
|
+
"mappings": "mJAIA,OAASA,6BAAAA,OAAiC,wCAC1C,OAASC,sBAAAA,OAA0B,oCACnC,OAASC,kBAAAA,OAAsB,2BAC/B,OACEC,UAAAA,GACAC,UAAAA,GACAC,qBAAAA,GACAC,QAAAA,GACAC,oBAAAA,GACAC,cAAAA,GACAC,gBAAAA,GACAC,iBAAAA,GACAC,aAAAA,GACAC,mBAAAA,GACAC,mBAAAA,GACAC,gBAAAA,GACAC,sBAAAA,GACAC,kBAAAA,OACK,iBACP,OAASC,kBAAAA,MAAsB,wBAC/B,OAASC,iBAAAA,EAAeC,0BAAAA,OAA8B,UAEtD,OAAO,8CAAAC,EAAA,wBAAAC,OAAA,iBAEP,OAAAC,GAASF,iBAAAA,GAAAA,eAAAA,EAAAA,aAAAA,EAA4CC,WAAAA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B,GAAA,CAAA,CAAA,EAAApB,EAAAwC,GAAA,eAC4CC,MAAA,SAAcC,EAAM1C,EAAA,MAAA,WAC9D1G,GAAAT,CAAA,YACMC,SAAckH,EAAAE,EAAoB,CAAA,CAAA,eAzE/BmB,EAAAkB,EAAA,CAChB,UAAA,GAAA1J,CACE,aAAsBC,SAAA,CAAcuI,EAAA,OAAqB,4BACtDnI,EAAA,UAAA,aAAA,MAAK8G,EAAe9G,MAAS6F,WAC7BzF,GAAAT,CAAA,YACMC,SAAckH,EAAAE,EAAoB,CAAA,CAAA",
|
|
6
|
+
"names": ["useLexicalComposerContext", "useLexicalEditable", "getTranslation", "Button", "Drawer", "EditDepthProvider", "Form", "formatDrawerSlug", "FormSubmit", "RenderFields", "ShimmerEffect", "useConfig", "useDocumentForm", "useDocumentInfo", "useEditDepth", "useServerFunctions", "useTranslation", "abortAndIgnore", "$getNodeByKey", "SKIP_DOM_SELECTION_TAG", "deepCopyObjectSimpleWithoutReactComponents", "reduceFieldsToValues", "React", "uuid", "createContext", "ObjectID", "$applyNodeReplacement", "React", "addClassNamesToElement", "ObjectID", "$applyNodeReplacement", "DecoratorNode", "ServerInlineBlockNode", "__cacheBuster", "__fields", "constructor", "cacheBuster", "fields", "key", "clone", "node", "__key", "getType", "importDOM", "importJSON", "serializedNode", "$createServerInlineBlockNode", "isInline", "canIndent", "createDOM", "config", "element", "document", "createElement", "theme", "inlineBlock", "decorate", "editor", "exportDOM", "classList", "add", "text", "createTextNode", "getTextContent", "append", "exportJSON", "type", "getFields", "version", "getCacheBuster", "getLatest", "setFields", "preventFormStateUpdate", "writable", "getWritable", "updateDOM", "id", "default", "toHexString", "InlineBlockComponent", "React", "lazy", "then", "module", "default", "InlineBlockNode", "ServerInlineBlockNode", "clone", "node", "getType", "importJSON", "serializedNode", "$createInlineBlockNode", "fields", "decorate", "_editor", "config", "CustomBlock", "CustomLabel", "_jsx", "cacheBuster", "getCacheBuster", "className", "theme", "inlineBlock", "formData", "getFields", "nodeKey", "getKey", "exportJSON", "$applyNodeReplacement", "id", "ObjectID", "toHexString", "$isInlineBlockNode", "InlineBlockComponentContext", "createContext", "useInlineBlockComponentContext", "React", "cacheBuster", "baseClass", "className", "CustomBlock", "CustomBlockFromProps", "CustomLabel", "formData", "nodeKey", "props", "useLexicalComposerContext", "isEditable", "i18n", "t", "useTranslation", "createdInlineBlock", "fieldProps", "featureClientSchemaMap", "initialLexicalFormState", "setCreatedInlineBlock", "uuid", "uuidFromContext", "useEditorConfigContext", "parentDocumentFields", "fields", "useDocumentForm", "getFormState", "useServerFunctions", "editDepth", "useEditDepth", "firstTimeDrawer", "setInitialState", "cachedFormState", "fieldName", "fieldState", "initialValue", "value", "hasMounted", "useRef", "useEffect", "prevCacheBuster", "current", "setCustomLabel", "CustomLabelFromProps", "initialState", "setCustomBlock", "resolvedCustomBlock", "useMemo", "isEditor", "isJSXConverter", "resolvedCustomLabel", "drawerSlug", "slug", "toggleDrawer", "useLexicalDrawer", "inlineBlockElemElemRef", "id", "collectionSlug", "getDocPreferences", "globalSlug", "useDocumentInfo", "config", "useConfig", "schemaPath", "clientSchemaMap", "componentMapRenderedBlockPath", "blocksField", "clientBlock", "blockReferences", "clientBlockFields", "undefined", "length", "editor", "removeInlineBlock", "getTranslation", "blockDisplayName", "labels", "singular", "onChangeAbortControllerRef", "AbortController", "state", "data", "docPermissions", "docPreferences", "deepCopyObjectSimpleWithoutReactComponents", "documentFormState", "initialBlockData", "initialBlockFormState", "operation", "readOnly", "renderAllFields", "schemaFieldsPath", "reduceFieldsToValues", "newFormStateData", "excludeFiles", "update", "$getNodeByKey", "node", "$isInlineBlockNode", "newData", "blockType", "SKIP_DOM_SELECTION_TAG", "abortAndIgnore", "abortController", "onChange", "formState", "submit", "state_0", "prevFormState", "formData_0", "initialState_0", "isStateOutOfSync", "key", "newData_0", "onFormSubmit", "useCallback", "node_0", "_jsx", "Button", "RemoveButton", "buttonStyle", "disabled", "icon", "e", "onClick", "preventDefault", "round", "size", "tooltip", "EditButton", "el", "children", "e_0", "onKeyDown", "role", "tabIndex", "ref", "Label", "_jsxs", "Form", "beforeSubmit", "formState_0", "disableValidationOnSubmit", "onSubmit", "formUuid", "EditDepthProvider", "title", "_Fragment", "RenderFields", "forceRender", "parentIndexPath", "parentPath", "parentSchemaPath", "permissions", "FormSubmit", "programmaticSubmit", "InlineBlockContainer", "ShimmerEffect", "height", "width"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as _}from"react/compiler-runtime";import{jsx as b}from"react/jsx-runtime";import{useLexicalComposerContext as h}from"@lexical/react/LexicalComposerContext";import{useDocumentDrawer as v,useModal as E}from"@payloadcms/ui";import{$getPreviousSelection as P,$getSelection as W,$setSelection as q}from"lexical";import{useEffect as y,useState as O}from"react";var J=j=>{let e=_(25),[o]=h(),[n,L]=O(null),[c,k]=O(!1),[d,g,M]=v(j),{closeDrawer:x,drawerSlug:t,openDrawer:C}=M,{modalState:i}=E(),a;e[0]!==o?(a=()=>{o.read(()=>{let l=W()??P();L(l)}),k(!0)},e[0]=o,e[1]=a):a=e[1];let s=a,u;e[2]!==o||e[3]!==n?(u=()=>{n&&o.update(()=>{q(n.clone())},{discrete:!0,skipTransforms:!0})},e[2]=o,e[3]=n,e[4]=u):u=e[4];let m=u,f;e[5]!==x?(f=()=>{x()},e[5]=x,e[6]=f):f=e[6];let T=f,D,p;e[7]!==t||e[8]!==i||e[9]!==m||e[10]!==c?(D=()=>{if(!c)return;let l=i[t];l&&!l?.isOpen&&(k(!1),setTimeout(()=>{m()},1))},p=[i,t,m,c],e[7]=t,e[8]=i,e[9]=m,e[10]=c,e[11]=D,e[12]=p):(D=e[11],p=e[12]),y(D,p);let S;e[13]!==C||e[14]!==s?(S=()=>{s(),C()},e[13]=C,e[14]=s,e[15]=S):S=e[15];let $=S,r;e[16]!==g||e[17]!==s?(r=l=>b(g,{...l,onClick:s}),e[16]=g,e[17]=s,e[18]=r):r=e[18];let w;return e[19]!==d||e[20]!==T||e[21]!==t||e[22]!==$||e[23]!==r?(w={closeDocumentDrawer:T,DocumentDrawer:d,documentDrawerSlug:t,DocumentDrawerToggler:r,openDocumentDrawer:$},e[19]=d,e[20]=T,e[21]=t,e[22]=$,e[23]=r,e[24]=w):w=e[24],w};export{J as a};
|
|
2
|
+
//# sourceMappingURL=chunk-WSAPGI3Z.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/utilities/fieldsDrawer/useLexicalDocumentDrawer.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport type { UseDocumentDrawer } from '@payloadcms/ui'\nimport type { BaseSelection } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useDocumentDrawer, useModal } from '@payloadcms/ui'\nimport { $getPreviousSelection, $getSelection, $setSelection } from 'lexical'\nimport { useCallback, useEffect, useState } from 'react'\n\n/**\n *\n * Wrapper around useDocumentDrawer that restores and saves selection state (cursor position) when opening and closing the drawer.\n * By default, the lexical cursor position may be lost when opening a drawer and clicking somewhere on that drawer.\n */\nexport const useLexicalDocumentDrawer = (\n args: Parameters<UseDocumentDrawer>[0],\n): {\n closeDocumentDrawer: () => void\n DocumentDrawer: ReturnType<UseDocumentDrawer>[0]\n documentDrawerSlug: string\n DocumentDrawerToggler: ReturnType<UseDocumentDrawer>[1]\n openDocumentDrawer: () => void\n} => {\n const [editor] = useLexicalComposerContext()\n const [selectionState, setSelectionState] = useState<BaseSelection | null>(null)\n const [wasOpen, setWasOpen] = useState<boolean>(false)\n\n const [\n DocumentDrawer,\n DocumentDrawerToggler,\n { closeDrawer: closeDrawer, drawerSlug: documentDrawerSlug, openDrawer },\n ] = useDocumentDrawer(args)\n const { modalState } = useModal()\n\n const storeSelection = useCallback(() => {\n editor.read(() => {\n const selection = $getSelection() ?? $getPreviousSelection()\n setSelectionState(selection)\n })\n setWasOpen(true)\n }, [editor])\n\n const restoreSelection = useCallback(() => {\n if (selectionState) {\n editor.update(\n () => {\n $setSelection(selectionState.clone())\n },\n { discrete: true, skipTransforms: true },\n )\n }\n }, [editor, selectionState])\n\n const closeDocumentDrawer = () => {\n //restoreSelection() // Should already be stored by the useEffect below\n closeDrawer()\n }\n\n // We need to handle drawer closing via a useEffect, as toggleDrawer / closeDrawer will not be triggered if the drawer\n // is closed by clicking outside of the drawer. This useEffect will handle everything.\n useEffect(() => {\n if (!wasOpen) {\n return\n }\n\n const thisModalState = modalState[documentDrawerSlug]\n // Exists in modalState (thus has opened at least once before) and is closed\n if (thisModalState && !thisModalState?.isOpen) {\n setWasOpen(false)\n setTimeout(() => {\n restoreSelection()\n }, 1)\n }\n }, [modalState, documentDrawerSlug, restoreSelection, wasOpen])\n\n const openDocumentDrawer = useCallback(() => {\n storeSelection()\n openDrawer()\n }, [storeSelection, openDrawer])\n\n return {\n closeDocumentDrawer,\n DocumentDrawer,\n documentDrawerSlug,\n DocumentDrawerToggler: (props) => <DocumentDrawerToggler {...props} onClick={storeSelection} />,\n openDocumentDrawer,\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAAA,KAAAC,MAAA,iEAIA,OAASC,6BAAAA,MAAiC,wCAC1C,OAASC,qBAAAA,EAAmBC,YAAAA,MAAgB,iBAC5C,OAASC,yBAAAA,EAAuBC,iBAAAA,EAAeC,iBAAAA,MAAqB,UACpE,OAAsBC,aAAAA,EAAWC,YAAAA,MAAgB,QAO1C,IAAMC,EAA2BC,GAAA,CAAA,IAAAC,EAAAX,EAAA,EAAA,EAStC,CAAAY,CAAA,EAAiBX,EAAA,EACjB,CAAAY,EAAAC,CAAA,EAA4CN,EAAA,IAA+B,EAC3E,CAAAO,EAAAC,CAAA,EAA8BR,EAAA,EAAkB,EAEhD,CAAAS,EAAAC,EAAAC,CAAA,EAIIjB,EAAkBQ,CAAA,EADpB,CAAAU,YAAAA,EAAAC,WAAAC,EAAAC,WAAAA,CAAA,EAAAJ,EAEF,CAAAK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AX,EAAA,CAAA,EAAAa,EAAAb,EAAA,CAAA,EAAAuB,EAAAvB,EAAA,EAAA,EAAAI,EAAAJ,EAAA,EAAA,EAAA0B,EAAA1B,EAAA,EAAA,EAAA2B,IAAAD,EAAA1B,EAAA,EAAA,EAAA2B,EAAA3B,EAAA,EAAA,GAb9DJ,EAAU8B,EAaPC,CAA2D,EAAA,IAAAI,EAAA/B,EAAA,EAAA,IAAAY,GAAAZ,EAAA,EAAA,IAAAiB,GAEvBc,EAAAA,IAAA,CACrCd,EAAA,EACAL,EAAA,CAAA,EACFZ,EAAA,EAAA,EAAAY,EAAAZ,EAAA,EAAA,EAAAiB,EAAAjB,EAAA,EAAA,EAAA+B,GAAAA,EAAA/B,EAAA,EAAA,EAHA,IAAAgC,EAA2BD,EAGIE,EAAAjC,EAAA,EAAA,IAAAO,GAAAP,EAAA,EAAA,IAAAiB,GAMNgB,EAAAC,GAAWC,EAAC5B,EAAA,CAAA,GAA0B2B,EAAKE,QAAWnB,CAAA,CAAA,uGAJxEoB,EAAA,CAAAZ,oBAAAA,EAAAnB,eAAAA,EAAAK,mBAAAA,EAAAJ,sBAIkB0B,wBAEzBjC,EAAA,EAAA,EAAAM,EAAAN,EAAA,EAAA,EAAAyB,EAAAzB,EAAA,EAAA,EAAAW,EAAAX,EAAA,EAAA,EAAAgC,EAAAhC,EAAA,EAAA,EAAAiC,EAAAjC,EAAA,EAAA,EAAAqC,GAAAA,EAAArC,EAAA,EAAA,EANOqC,CAMP",
|
|
6
|
+
"names": ["c", "_c", "useLexicalComposerContext", "useDocumentDrawer", "useModal", "$getPreviousSelection", "$getSelection", "$setSelection", "useEffect", "useState", "useLexicalDocumentDrawer", "args", "$", "editor", "selectionState", "setSelectionState", "wasOpen", "setWasOpen", "DocumentDrawer", "DocumentDrawerToggler", "t0", "closeDrawer", "drawerSlug", "documentDrawerSlug", "openDrawer", "modalState", "t1", "read", "selection", "storeSelection", "t2", "update", "clone", "discrete", "skipTransforms", "restoreSelection", "t3", "closeDocumentDrawer", "t4", "t5", "thisModalState", "isOpen", "setTimeout", "t6", "openDocumentDrawer", "t7", "props", "_jsx", "onClick", "t8"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{a as E,b as U}from"./chunk-QJ5EETIB.js";import{a as y}from"./chunk-INBEEENE.js";import{a as L}from"./chunk-WSAPGI3Z.js";import{b as f}from"./chunk-BZZVLW4U.js";import{jsx as a,jsxs as g}from"react/jsx-runtime";import{useLexicalComposerContext as ae}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as oe}from"@lexical/react/useLexicalEditable";import{getTranslation as P}from"@payloadcms/translations";import{Button as h,formatDrawerSlug as le,Pill as se,Thumbnail as ie,useConfig as re,useEditDepth as ne,usePayloadAPI as de,useTranslation as ce}from"@payloadcms/ui";import{$getNodeByKey as T,$getSelection as ue,$isNodeSelection as me,$isRangeSelection as pe}from"lexical";import{formatAdminURL as fe,isImage as ge}from"payload/shared";import{useCallback as _,useEffect as F,useId as he,useReducer as _e,useRef as be,useState as I}from"react";var j={depth:0},Te=k=>{let{className:e,data:{fields:z,relationTo:b,value:c},format:A,nodeKey:l}=k;if(typeof c=="object")throw new Error("Upload value should be a string or number. The Lexical Upload component should not receive the populated value object.");let{config:{routes:{api:B},serverURL:K},getEntityConfig:M}=re(),w=be(null),{uuid:O}=f(),W=ne(),[s]=ae(),{editorConfig:H,fieldProps:{schemaPath:q}}=f(),u=oe(),{i18n:D,t:n}=ce(),[S,m]=I(!1),[$,G]=_e(o=>o+1,0),[i]=I(()=>M({collectionSlug:b})),J=he(),x=le({slug:"lexical-upload-drawer-"+O+J,depth:W}),{toggleDrawer:Q}=y(x,!0),{closeDocumentDrawer:C,DocumentDrawer:V,DocumentDrawerToggler:X}=L({id:c,collectionSlug:i.slug}),[{data:t},{setParams:v}]=de(fe({apiRoute:B,path:`/${i.slug}/${c}`,serverURL:K}),{initialParams:j}),N=t?.thumbnailURL||t?.url;F(()=>s.registerUpdateListener(({editorState:o})=>{o.read(()=>{let r=ue();if(me(r))m(r.has(l));else if(pe(r)){let d=r.getNodes();m(d.some(p=>p.getKey()===l))}else m(!1)})}),[s,l]),F(()=>{let o=w.current?.closest(`.${e}`);o&&o.classList.toggle(`${e}--selected`,S)},[S,e]);let Y=_(()=>{s.update(()=>{T(l)?.remove()})},[s,l]),Z=_(o=>{v({...j,cacheBust:$}),G(),C()},[v,$,C]),R=H?.resolvedFeatureMap?.get("upload")?.sanitizedClientFeatureProps.collections?.[i.slug]?.hasExtraFields,ee=_((o,r)=>{s.update(()=>{let d=T(l);if(d){let p={...d.getData(),fields:r};d.setData(p)}})},[s,l]),te=N&&t?.width&&t?.height?t.width>t.height?"landscape":"portrait":"landscape";return g("div",{className:`${e}__contents ${e}__contents--${te}`,"data-align":A||void 0,"data-filename":t?.filename,ref:w,children:[a("div",{className:`${e}__card`,children:g("div",{className:`${e}__media`,children:[a(ie,{collectionSlug:b,fileSrc:ge(t?.mimeType)?N:null,height:t?.height,size:"none",width:t?.width}),u&&g("div",{className:`${e}__floater`,"data-theme":"dark",children:[a(se,{className:`${e}__collectionLabel`,pillStyle:"dark",size:"small",children:P(i.labels.singular,D)}),a(X,{className:`${e}__doc-drawer-toggler`,children:a("span",{className:`${e}__filename`,children:t?.filename||n("general:untitled")})}),R?a(h,{buttonStyle:"icon-label",className:`${e}__upload-drawer-toggler`,disabled:!u,el:"button",icon:"edit",onClick:Q,round:!0,size:"medium",tooltip:n("fields:editRelationship")}):null,a("div",{className:`${e}__divider`}),a(h,{buttonStyle:"icon-label",className:`${e}__swap-drawer-toggler`,disabled:!u,el:"button",icon:"swap",onClick:()=>{s.dispatchCommand(U,{replace:{nodeKey:l}})},round:!0,size:"medium",tooltip:n("fields:swapUpload")}),a(h,{buttonStyle:"icon-label",className:`${e}__removeButton`,disabled:!u,icon:"x",onClick:o=>{o.preventDefault(),Y()},round:!0,size:"medium",tooltip:n("fields:removeUpload")})]})]})}),c?a(V,{onSave:Z}):null,R?a(E,{data:z,drawerSlug:x,drawerTitle:n("general:editLabel",{label:P(i.labels.singular,D)}),featureKey:"upload",handleDrawerSubmit:ee,schemaPath:q,schemaPathSuffix:i.slug}):null]})};export{Te as UploadComponent};
|
|
2
|
+
//# sourceMappingURL=component-53Y3RYR5.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/upload/client/component/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport type { ClientCollectionConfig, Data, FormState, JsonObject } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n formatDrawerSlug,\n Pill,\n Thumbnail,\n useConfig,\n useEditDepth,\n usePayloadAPI,\n useTranslation,\n} from '@payloadcms/ui'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n $isRangeSelection,\n type ElementFormatType,\n} from 'lexical'\nimport { formatAdminURL, isImage } from 'payload/shared'\nimport React, { useCallback, useEffect, useId, useReducer, useRef, useState } from 'react'\n\nimport type { BaseClientFeatureProps } from '../../../typesClient.js'\nimport type { UploadData } from '../../server/nodes/UploadNode.js'\nimport type { UploadFeaturePropsClient } from '../index.js'\nimport type { UploadNode } from '../nodes/UploadNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { FieldsDrawer } from '../../../../utilities/fieldsDrawer/Drawer.js'\nimport { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport './index.css'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n className: string\n data: UploadData\n format?: ElementFormatType\n nodeKey: string\n}\n\nexport const UploadComponent: React.FC<ElementProps> = (props) => {\n const {\n className: baseClass,\n data: { fields, relationTo, value },\n format,\n nodeKey,\n } = props\n\n if (typeof value === 'object') {\n throw new Error(\n 'Upload value should be a string or number. The Lexical Upload component should not receive the populated value object.',\n )\n }\n\n const {\n config: {\n routes: { api },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n const uploadRef = useRef<HTMLDivElement | null>(null)\n const { uuid } = useEditorConfigContext()\n const editDepth = useEditDepth()\n const [editor] = useLexicalComposerContext()\n\n const {\n editorConfig,\n fieldProps: { schemaPath },\n } = useEditorConfigContext()\n const isEditable = useLexicalEditable()\n const { i18n, t } = useTranslation()\n const [isSelected, setIsSelected] = useState(false)\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection] = useState<ClientCollectionConfig>(() =>\n getEntityConfig({ collectionSlug: relationTo }),\n )\n\n const componentID = useId()\n\n const extraFieldsDrawerSlug = formatDrawerSlug({\n slug: `lexical-upload-drawer-` + uuid + componentID, // There can be multiple upload components, each with their own drawer, in one single editor => separate them by componentID\n depth: editDepth,\n })\n\n // Need to use hook to initialize useEffect that restores cursor position\n const { toggleDrawer } = useLexicalDrawer(extraFieldsDrawerSlug, true)\n\n const { closeDocumentDrawer, DocumentDrawer, DocumentDrawerToggler } = useLexicalDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n // Get the referenced document\n const [{ data }, { setParams }] = usePayloadAPI(\n formatAdminURL({ apiRoute: api, path: `/${relatedCollection.slug}/${value}`, serverURL }),\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n useEffect(() => {\n return editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n const selection = $getSelection()\n\n if ($isNodeSelection(selection)) {\n setIsSelected(selection.has(nodeKey))\n } else if ($isRangeSelection(selection)) {\n const nodes = selection.getNodes()\n setIsSelected(nodes.some((node) => node.getKey() === nodeKey))\n } else {\n setIsSelected(false)\n }\n })\n })\n }, [editor, nodeKey])\n\n useEffect(() => {\n const outerEl = uploadRef.current?.closest(`.${baseClass}`)\n\n if (outerEl) {\n outerEl.classList.toggle(`${baseClass}--selected`, isSelected)\n }\n }, [isSelected, baseClass])\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (_data: Data) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n dispatchCacheBust()\n closeDocumentDrawer()\n },\n [setParams, cacheBust, closeDocumentDrawer],\n )\n\n const hasExtraFields = (\n editorConfig?.resolvedFeatureMap?.get('upload')\n ?.sanitizedClientFeatureProps as BaseClientFeatureProps<UploadFeaturePropsClient>\n ).collections?.[relatedCollection.slug]?.hasExtraFields\n\n const onExtraFieldsDrawerSubmit = useCallback(\n (_: FormState, data: JsonObject) => {\n // Update lexical node (with key nodeKey) with new data\n editor.update(() => {\n const uploadNode: null | UploadNode = $getNodeByKey(nodeKey)\n if (uploadNode) {\n const newData: UploadData = {\n ...uploadNode.getData(),\n fields: data,\n }\n uploadNode.setData(newData)\n }\n })\n },\n [editor, nodeKey],\n )\n\n const aspectRatio =\n thumbnailSRC && data?.width && data?.height\n ? data.width > data.height\n ? 'landscape'\n : 'portrait'\n : 'landscape'\n\n return (\n <div\n className={`${baseClass}__contents ${baseClass}__contents--${aspectRatio}`}\n data-align={format || undefined}\n data-filename={data?.filename}\n ref={uploadRef}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__media`}>\n <Thumbnail\n collectionSlug={relationTo}\n fileSrc={isImage(data?.mimeType) ? thumbnailSRC : null}\n height={data?.height}\n size=\"none\"\n width={data?.width}\n />\n\n {isEditable && (\n <div className={`${baseClass}__floater`} data-theme=\"dark\">\n <Pill className={`${baseClass}__collectionLabel`} pillStyle=\"dark\" size=\"small\">\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </Pill>\n\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <span className={`${baseClass}__filename`}>\n {data?.filename || t('general:untitled')}\n </span>\n </DocumentDrawerToggler>\n\n {hasExtraFields ? (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"edit\"\n onClick={toggleDrawer}\n round\n size=\"medium\"\n tooltip={t('fields:editRelationship')}\n />\n ) : null}\n\n <div className={`${baseClass}__divider`} />\n\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__swap-drawer-toggler`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n size=\"medium\"\n tooltip={t('fields:swapUpload')}\n />\n\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeUpload()\n }}\n round\n size=\"medium\"\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n\n {value ? <DocumentDrawer onSave={updateUpload} /> : null}\n {hasExtraFields ? (\n <FieldsDrawer\n data={fields}\n drawerSlug={extraFieldsDrawerSlug}\n drawerTitle={t('general:editLabel', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n featureKey=\"upload\"\n handleDrawerSubmit={onExtraFieldsDrawerSubmit}\n schemaPath={schemaPath}\n schemaPathSuffix={relatedCollection.slug}\n />\n ) : null}\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "sOAGA,OAASA,6BAAAA,OAAiC,2CAC1C,OAASC,sBAAAA,OAA0B,oCACnC,OAASC,kBAAAA,MAAsB,2BAC/B,OACEC,UAAAA,EACAC,oBAAAA,GACAC,QAAAA,GACAC,aAAAA,GACAC,aAAAA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ACXmE,GAAAA,SACAC,KAAG,OACHC,QAAK,IAAA,CACLC,EAASA,gBAAAG,EAAA,CACPzC,QAAO0C,CACLC,QAAAA,MAEJ,MAAA,GACAJ,KAAK,SACLX,QAAK1D,EAAA,mBAAA,IACMoD,EAAAsB,EAAA,0BAIXV,UAAA,GAAYvF,CAAA,iBACZC,SAAA,CAAWoB,EACXmE,KAAAA,IACAE,QAAKQ,GAAA,CACLP,EAAAA,eAAU,EACRO,EAAEC,GAEJ,MAAA,GACAP,KAAK,SACLX,QAAK1D,EAAA,qBAAA,GACLsE,uBAOT3B,IAAwBkC,KAAQlC,EAAAA,EAAAA,EAAAA,MAAmB/D,EAGhDD,WAAMmC,EACNgE,YAAYhE,EAAAA,oBAAA,CACZiE,MAAAA,EAAetE,EAAqB,OAAA,SAAAV,CAAA,IAEpC,WAAA,SACAiF,mBAAWC,GACXC,WAAAA,EACAC,iBAAYA,EAAA,OACZC,IAAAA",
|
|
6
|
+
"names": ["useLexicalComposerContext", "useLexicalEditable", "getTranslation", "Button", "formatDrawerSlug", "Pill", "Thumbnail", "useConfig", "useEditDepth", "usePayloadAPI", "useTranslation", "$getNodeByKey", "$getSelection", "$isNodeSelection", "$isRangeSelection", "formatAdminURL", "isImage", "useCallback", "useEffect", "useId", "useReducer", "useRef", "useState", "initialParams", "UploadComponent", "props", "baseClass", "className", "data", "fields", "relationTo", "format", "nodeKey", "value", "config", "routes", "serverURL", "getEntityConfig", "useConfig", "useRef", "uploadRef", "uuid", "useEditorConfigContext", "editDepth", "useLexicalComposerContext", "editorConfig", "fieldProps", "isEditable", "i18n", "t", "useTranslation", "setIsSelected", "useState", "isSelected", "dispatchCacheBust", "state", "cacheBust", "useReducer", "relatedCollection", "collectionSlug", "componentID", "useId", "formatDrawerSlug", "extraFieldsDrawerSlug", "slug", "toggleDrawer", "useLexicalDrawer", "closeDocumentDrawer", "DocumentDrawer", "DocumentDrawerToggler", "useLexicalDocumentDrawer", "id", "setParams", "usePayloadAPI", "apiRoute", "api", "path", "thumbnailSRC", "useEffect", "editor", "editorState", "$getSelection", "$isNodeSelection", "selection", "nodes", "$isRangeSelection", "getNodes", "node", "outerEl", "removeUpload", "useCallback", "_data", "updateUpload", "hasExtraFields", "resolvedFeatureMap", "update", "$getNodeByKey", "uploadNode", "newData", "aspectRatio", "ref", "_jsx", "_jsxs", "Thumbnail", "fileSrc", "isImage", "height", "size", "width", "Pill", "pillStyle", "getTranslation", "labels", "buttonStyle", "disabled", "el", "icon", "onClick", "round", "tooltip", "INSERT_UPLOAD_WITH_DRAWER_COMMAND", "dispatchCommand", "replace", "Button", "e", "preventDefault", "onSave", "drawerSlug", "drawerTitle", "featureKey", "onExtraFieldsDrawerSubmit", "handleDrawerSubmit", "schemaPath", "schemaPathSuffix"]
|
|
7
|
+
}
|
|
@@ -20,8 +20,6 @@ export { LinkFeatureClient } from '../../features/link/client/index.js';
|
|
|
20
20
|
export { ChecklistFeatureClient } from '../../features/lists/checklist/client/index.js';
|
|
21
21
|
export { OrderedListFeatureClient } from '../../features/lists/orderedList/client/index.js';
|
|
22
22
|
export { UnorderedListFeatureClient } from '../../features/lists/unorderedList/client/index.js';
|
|
23
|
-
export { LexicalPluginToLexicalFeatureClient } from '../../features/migrations/lexicalPluginToLexical/feature.client.js';
|
|
24
|
-
export { SlateToLexicalFeatureClient } from '../../features/migrations/slateToLexical/feature.client.js';
|
|
25
23
|
export { ParagraphFeatureClient } from '../../features/paragraph/client/index.js';
|
|
26
24
|
export { DebugJsxConverterFeatureClient } from '../../features/debug/jsxConverter/client/index.js';
|
|
27
25
|
export { defaultColors } from '../../features/textState/defaultColors.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAA;AAE5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAA;AACzE,OAAO,EAAE,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