@payloadcms/richtext-lexical 3.84.1 → 4.0.0-internal.d28e9fb
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-4UEGQMIN.js → Field-NXLXFFLW.js} +2 -2
- package/dist/exports/client/Field-NXLXFFLW.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-DZDHVMML.js +2 -0
- package/dist/exports/client/chunk-DZDHVMML.js.map +7 -0
- package/dist/exports/client/componentInline-LCHKRXOV.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 +32 -32
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +17 -2
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +13 -3
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +1 -1
- package/dist/field/Field.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.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/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/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/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/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.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/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/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-LCHKRXOV.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/migrateSlateToLexical/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAyC,OAAO,EAAE,MAAM,SAAS,CAAA;AAI7E;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,iBAoC5E"}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */import { migrateDocumentFieldsRecursively } from './migrateDocumentFieldsRecursively.js';
|
|
2
|
-
/**
|
|
3
|
-
* This goes through every single collection and field in the payload config, and migrates its data from Slate to Lexical. This does not support sub-fields within slate.
|
|
4
|
-
*
|
|
5
|
-
* It will only translate fields fulfilling all these requirements:
|
|
6
|
-
* - field schema uses lexical editor
|
|
7
|
-
* - lexical editor has SlateToLexicalFeature added
|
|
8
|
-
* - saved field data is in Slate format
|
|
9
|
-
*
|
|
10
|
-
* @param payload
|
|
11
|
-
*/
|
|
12
|
-
export async function migrateSlateToLexical({
|
|
13
|
-
payload
|
|
14
|
-
}) {
|
|
15
|
-
const collections = payload.config.collections;
|
|
16
|
-
const errors = [];
|
|
17
|
-
const allLocales = payload.config.localization ? payload.config.localization.localeCodes : [null];
|
|
18
|
-
const totalCollections = collections.length;
|
|
19
|
-
for (const locale of allLocales) {
|
|
20
|
-
let curCollection = 0;
|
|
21
|
-
for (const collection of collections) {
|
|
22
|
-
curCollection++;
|
|
23
|
-
await migrateCollection({
|
|
24
|
-
collection,
|
|
25
|
-
cur: curCollection,
|
|
26
|
-
errors,
|
|
27
|
-
locale,
|
|
28
|
-
max: totalCollections,
|
|
29
|
-
payload
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
for (const global of payload.config.globals) {
|
|
33
|
-
await migrateGlobal({
|
|
34
|
-
errors,
|
|
35
|
-
global,
|
|
36
|
-
locale,
|
|
37
|
-
payload
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (errors.length) {
|
|
42
|
-
console.error(`Found ${errors.length} errors::`, JSON.stringify(errors, null, 2));
|
|
43
|
-
} else {
|
|
44
|
-
console.log('Migration successful - no errors');
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
async function migrateGlobal({
|
|
48
|
-
errors,
|
|
49
|
-
global,
|
|
50
|
-
locale,
|
|
51
|
-
payload
|
|
52
|
-
}) {
|
|
53
|
-
console.log(`SlateToLexical: ${locale}: Migrating global:`, global.slug);
|
|
54
|
-
const document = await payload.findGlobal({
|
|
55
|
-
slug: global.slug,
|
|
56
|
-
depth: 0,
|
|
57
|
-
draft: true,
|
|
58
|
-
locale: locale || undefined,
|
|
59
|
-
overrideAccess: true
|
|
60
|
-
});
|
|
61
|
-
const found = migrateDocument({
|
|
62
|
-
document,
|
|
63
|
-
fields: global.fields,
|
|
64
|
-
payload
|
|
65
|
-
});
|
|
66
|
-
if (found) {
|
|
67
|
-
try {
|
|
68
|
-
await payload.updateGlobal({
|
|
69
|
-
slug: global.slug,
|
|
70
|
-
data: document,
|
|
71
|
-
depth: 0,
|
|
72
|
-
draft: document?._status === 'draft',
|
|
73
|
-
locale: locale || undefined
|
|
74
|
-
});
|
|
75
|
-
// Catch it, because some errors were caused by the user previously (e.g. invalid relationships) and will throw an error now, even though they are not related to the migration
|
|
76
|
-
} catch (e) {
|
|
77
|
-
console.log('Error updating global', e, {
|
|
78
|
-
slug: global.slug
|
|
79
|
-
});
|
|
80
|
-
errors.push(e);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
async function migrateCollection({
|
|
85
|
-
collection,
|
|
86
|
-
cur,
|
|
87
|
-
errors,
|
|
88
|
-
locale,
|
|
89
|
-
max,
|
|
90
|
-
payload
|
|
91
|
-
}) {
|
|
92
|
-
console.log(`SlateToLexical: ${locale}: Migrating collection:`, collection.slug, '(' + cur + '/' + max + ')');
|
|
93
|
-
const documentCount = (await payload.count({
|
|
94
|
-
collection: collection.slug,
|
|
95
|
-
locale: locale || undefined
|
|
96
|
-
})).totalDocs;
|
|
97
|
-
let page = 1;
|
|
98
|
-
let migrated = 0;
|
|
99
|
-
while (migrated < documentCount) {
|
|
100
|
-
const documents = await payload.find({
|
|
101
|
-
collection: collection.slug,
|
|
102
|
-
depth: 0,
|
|
103
|
-
draft: true,
|
|
104
|
-
locale: locale || undefined,
|
|
105
|
-
overrideAccess: true,
|
|
106
|
-
page,
|
|
107
|
-
pagination: true
|
|
108
|
-
});
|
|
109
|
-
for (const document of documents.docs) {
|
|
110
|
-
migrated++;
|
|
111
|
-
console.log(`SlateToLexical: ${locale}: Migrating collection:`, collection.slug, '(' + cur + '/' + max + ') - Migrating Document: ' + document.id + ' (' + migrated + '/' + documentCount + ')');
|
|
112
|
-
const found = migrateDocument({
|
|
113
|
-
document,
|
|
114
|
-
fields: collection.fields,
|
|
115
|
-
payload
|
|
116
|
-
});
|
|
117
|
-
if (found) {
|
|
118
|
-
try {
|
|
119
|
-
await payload.update({
|
|
120
|
-
id: document.id,
|
|
121
|
-
collection: collection.slug,
|
|
122
|
-
data: document,
|
|
123
|
-
depth: 0,
|
|
124
|
-
draft: document?._status === 'draft',
|
|
125
|
-
locale: locale || undefined
|
|
126
|
-
});
|
|
127
|
-
// Catch it, because some errors were caused by the user previously (e.g. invalid relationships) and will throw an error now, even though they are not related to the migration
|
|
128
|
-
} catch (e) {
|
|
129
|
-
errors.push(e);
|
|
130
|
-
console.log('Error updating collection', e, {
|
|
131
|
-
id: document.id,
|
|
132
|
-
slug: collection.slug
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
page++;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function migrateDocument({
|
|
141
|
-
document,
|
|
142
|
-
fields,
|
|
143
|
-
payload
|
|
144
|
-
}) {
|
|
145
|
-
return !!migrateDocumentFieldsRecursively({
|
|
146
|
-
data: document,
|
|
147
|
-
fields,
|
|
148
|
-
found: 0,
|
|
149
|
-
payload
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["migrateDocumentFieldsRecursively","migrateSlateToLexical","payload","collections","config","errors","allLocales","localization","localeCodes","totalCollections","length","locale","curCollection","collection","migrateCollection","cur","max","global","globals","migrateGlobal","console","error","JSON","stringify","log","slug","document","findGlobal","depth","draft","undefined","overrideAccess","found","migrateDocument","fields","updateGlobal","data","_status","e","push","documentCount","count","totalDocs","page","migrated","documents","find","pagination","docs","id","update"],"sources":["../../../src/utilities/migrateSlateToLexical/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport type { CollectionConfig, Field, GlobalConfig, Payload } from 'payload'\n\nimport { migrateDocumentFieldsRecursively } from './migrateDocumentFieldsRecursively.js'\n\n/**\n * This goes through every single collection and field in the payload config, and migrates its data from Slate to Lexical. This does not support sub-fields within slate.\n *\n * It will only translate fields fulfilling all these requirements:\n * - field schema uses lexical editor\n * - lexical editor has SlateToLexicalFeature added\n * - saved field data is in Slate format\n *\n * @param payload\n */\nexport async function migrateSlateToLexical({ payload }: { payload: Payload }) {\n const collections = payload.config.collections\n\n const errors: unknown[] = []\n\n const allLocales = payload.config.localization ? payload.config.localization.localeCodes : [null]\n\n const totalCollections = collections.length\n for (const locale of allLocales) {\n let curCollection = 0\n for (const collection of collections) {\n curCollection++\n await migrateCollection({\n collection,\n cur: curCollection,\n errors,\n locale,\n max: totalCollections,\n payload,\n })\n }\n for (const global of payload.config.globals) {\n await migrateGlobal({\n errors,\n global,\n locale,\n payload,\n })\n }\n }\n\n if (errors.length) {\n console.error(`Found ${errors.length} errors::`, JSON.stringify(errors, null, 2))\n } else {\n console.log('Migration successful - no errors')\n }\n}\n\nasync function migrateGlobal({\n errors,\n global,\n locale,\n payload,\n}: {\n errors: unknown[]\n global: GlobalConfig\n locale: null | string\n payload: Payload\n}) {\n console.log(`SlateToLexical: ${locale}: Migrating global:`, global.slug)\n\n const document = await payload.findGlobal({\n slug: global.slug,\n depth: 0,\n draft: true,\n locale: locale || undefined,\n overrideAccess: true,\n })\n\n const found = migrateDocument({\n document,\n fields: global.fields,\n payload,\n })\n\n if (found) {\n try {\n await payload.updateGlobal({\n slug: global.slug,\n data: document,\n depth: 0,\n draft: document?._status === 'draft',\n locale: locale || undefined,\n })\n // Catch it, because some errors were caused by the user previously (e.g. invalid relationships) and will throw an error now, even though they are not related to the migration\n } catch (e) {\n console.log('Error updating global', e, {\n slug: global.slug,\n })\n errors.push(e)\n }\n }\n}\n\nasync function migrateCollection({\n collection,\n cur,\n errors,\n locale,\n max,\n payload,\n}: {\n collection: CollectionConfig\n cur: number\n errors: unknown[]\n locale: null | string\n max: number\n payload: Payload\n}) {\n console.log(\n `SlateToLexical: ${locale}: Migrating collection:`,\n collection.slug,\n '(' + cur + '/' + max + ')',\n )\n\n const documentCount = (\n await payload.count({\n collection: collection.slug,\n locale: locale || undefined,\n })\n ).totalDocs\n\n let page = 1\n let migrated = 0\n\n while (migrated < documentCount) {\n const documents = await payload.find({\n collection: collection.slug,\n depth: 0,\n draft: true,\n locale: locale || undefined,\n overrideAccess: true,\n page,\n pagination: true,\n })\n\n for (const document of documents.docs) {\n migrated++\n console.log(\n `SlateToLexical: ${locale}: Migrating collection:`,\n collection.slug,\n '(' +\n cur +\n '/' +\n max +\n ') - Migrating Document: ' +\n document.id +\n ' (' +\n migrated +\n '/' +\n documentCount +\n ')',\n )\n const found = migrateDocument({\n document,\n fields: collection.fields,\n payload,\n })\n\n if (found) {\n try {\n await payload.update({\n id: document.id,\n collection: collection.slug,\n data: document,\n depth: 0,\n draft: document?._status === 'draft',\n locale: locale || undefined,\n })\n // Catch it, because some errors were caused by the user previously (e.g. invalid relationships) and will throw an error now, even though they are not related to the migration\n } catch (e) {\n errors.push(e)\n\n console.log('Error updating collection', e, {\n id: document.id,\n slug: collection.slug,\n })\n }\n }\n }\n page++\n }\n}\n\nfunction migrateDocument({\n document,\n fields,\n payload,\n}: {\n document: Record<string, unknown>\n fields: Field[]\n payload: Payload\n}): boolean {\n return !!migrateDocumentFieldsRecursively({\n data: document,\n fields,\n found: 0,\n payload,\n })\n}\n"],"mappings":"AAAA,+BAGA,SAASA,gCAAgC,QAAQ;AAEjD;;;;;;;;;;AAUA,OAAO,eAAeC,sBAAsB;EAAEC;AAAO,CAAwB;EAC3E,MAAMC,WAAA,GAAcD,OAAA,CAAQE,MAAM,CAACD,WAAW;EAE9C,MAAME,MAAA,GAAoB,EAAE;EAE5B,MAAMC,UAAA,GAAaJ,OAAA,CAAQE,MAAM,CAACG,YAAY,GAAGL,OAAA,CAAQE,MAAM,CAACG,YAAY,CAACC,WAAW,GAAG,CAAC,KAAK;EAEjG,MAAMC,gBAAA,GAAmBN,WAAA,CAAYO,MAAM;EAC3C,KAAK,MAAMC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GACX,OACAL,QAAA,GACA,MACAJ,aAAA,GACA;MAEJ,MAAMR,KAAA,GAAQC,eAAA,CAAgB;QAC5BP,QAAA;QACAQ,MAAA,EAAQrB,UAAA,CAAWqB,MAAM;QACzBhC;MACF;MAEA,IAAI8B,KAAA,EAAO;QACT,IAAI;UACF,MAAM9B,OAAA,CAAQgD,MAAM,CAAC;YACnBD,EAAA,EAAIvB,QAAA,CAASuB,EAAE;YACfpC,UAAA,EAAYA,UAAA,CAAWY,IAAI;YAC3BW,IAAA,EAAMV,QAAA;YACNE,KAAA,EAAO;YACPC,KAAA,EAAOH,QAAA,EAAUW,OAAA,KAAY;YAC7B1B,MAAA,EAAQA,MAAA,IAAUmB;UACpB;UACA;QACF,EAAE,OAAOQ,CAAA,EAAG;UACVjC,MAAA,CAAOkC,IAAI,CAACD,CAAA;UAEZlB,OAAA,CAAQI,GAAG,CAAC,6BAA6Bc,CAAA,EAAG;YAC1CW,EAAA,EAAIvB,QAAA,CAASuB,EAAE;YACfxB,IAAA,EAAMZ,UAAA,CAAWY;UACnB;QACF;MACF;IACF;IACAkB,IAAA;EACF;AACF;AAEA,SAASV,gBAAgB;EACvBP,QAAQ;EACRQ,MAAM;EACNhC;AAAO,CAKR;EACC,OAAO,CAAC,CAACF,gCAAA,CAAiC;IACxCoC,IAAA,EAAMV,QAAA;IACNQ,MAAA;IACAF,KAAA,EAAO;IACP9B;EACF;AACF","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Field, Payload } from 'payload';
|
|
2
|
-
type NestedRichTextFieldsArgs = {
|
|
3
|
-
data: Record<string, unknown>;
|
|
4
|
-
fields: Field[];
|
|
5
|
-
found: number;
|
|
6
|
-
payload: Payload;
|
|
7
|
-
};
|
|
8
|
-
export declare const migrateDocumentFieldsRecursively: ({ data, fields, found, payload, }: NestedRichTextFieldsArgs) => number;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=migrateDocumentFieldsRecursively.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrateDocumentFieldsRecursively.d.ts","sourceRoot":"","sources":["../../../src/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAkB,OAAO,EAAE,MAAM,SAAS,CAAA;AAY7D,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAE7B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,gCAAgC,sCAK1C,wBAAwB,KAAG,MAuF7B,CAAA"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { fieldAffectsData, fieldHasSubFields, fieldIsArrayType, tabHasName } from 'payload/shared';
|
|
2
|
-
import { convertSlateToLexical } from '../../features/migrations/slateToLexical/converter/index.js';
|
|
3
|
-
export const migrateDocumentFieldsRecursively = ({
|
|
4
|
-
data,
|
|
5
|
-
fields,
|
|
6
|
-
found,
|
|
7
|
-
payload
|
|
8
|
-
}) => {
|
|
9
|
-
for (const field of fields) {
|
|
10
|
-
if (fieldHasSubFields(field) && !fieldIsArrayType(field)) {
|
|
11
|
-
if (fieldAffectsData(field) && typeof data[field.name] === 'object') {
|
|
12
|
-
found += migrateDocumentFieldsRecursively({
|
|
13
|
-
data: data[field.name],
|
|
14
|
-
fields: field.fields,
|
|
15
|
-
found,
|
|
16
|
-
payload
|
|
17
|
-
});
|
|
18
|
-
} else {
|
|
19
|
-
found += migrateDocumentFieldsRecursively({
|
|
20
|
-
data,
|
|
21
|
-
fields: field.fields,
|
|
22
|
-
found,
|
|
23
|
-
payload
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
} else if (field.type === 'tabs') {
|
|
27
|
-
field.tabs.forEach(tab => {
|
|
28
|
-
found += migrateDocumentFieldsRecursively({
|
|
29
|
-
data: tabHasName(tab) ? data[tab.name] : data,
|
|
30
|
-
fields: tab.fields,
|
|
31
|
-
found,
|
|
32
|
-
payload
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
} else if (Array.isArray(data[field.name])) {
|
|
36
|
-
if (field.type === 'blocks') {
|
|
37
|
-
data[field.name].forEach(row => {
|
|
38
|
-
const blockTypeToMatch = row?.blockType;
|
|
39
|
-
const block = payload?.blocks[blockTypeToMatch] ?? (field.blockReferences ?? field.blocks).find(block => typeof block !== 'string' && block.slug === blockTypeToMatch);
|
|
40
|
-
if (block) {
|
|
41
|
-
found += migrateDocumentFieldsRecursively({
|
|
42
|
-
data: row,
|
|
43
|
-
fields: block.fields,
|
|
44
|
-
found,
|
|
45
|
-
payload
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
if (field.type === 'array') {
|
|
51
|
-
data[field.name].forEach(row => {
|
|
52
|
-
found += migrateDocumentFieldsRecursively({
|
|
53
|
-
data: row,
|
|
54
|
-
fields: field.fields,
|
|
55
|
-
found,
|
|
56
|
-
payload
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (field.type === 'richText' && Array.isArray(data[field.name])) {
|
|
62
|
-
// Slate richText
|
|
63
|
-
const editor = field.editor;
|
|
64
|
-
if (editor && typeof editor === 'object') {
|
|
65
|
-
if ('features' in editor && editor.features?.length) {
|
|
66
|
-
// find slatetolexical feature
|
|
67
|
-
const slateToLexicalFeature = editor.editorConfig.resolvedFeatureMap.get('slateToLexical');
|
|
68
|
-
if (slateToLexicalFeature) {
|
|
69
|
-
// DO CONVERSION
|
|
70
|
-
const {
|
|
71
|
-
converters
|
|
72
|
-
} = slateToLexicalFeature.sanitizedServerFeatureProps;
|
|
73
|
-
data[field.name] = convertSlateToLexical({
|
|
74
|
-
converters: converters,
|
|
75
|
-
slateData: data[field.name]
|
|
76
|
-
});
|
|
77
|
-
found++;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return found;
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=migrateDocumentFieldsRecursively.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrateDocumentFieldsRecursively.js","names":["fieldAffectsData","fieldHasSubFields","fieldIsArrayType","tabHasName","convertSlateToLexical","migrateDocumentFieldsRecursively","data","fields","found","payload","field","name","type","tabs","forEach","tab","Array","isArray","row","blockTypeToMatch","blockType","block","blocks","blockReferences","find","slug","editor","features","length","slateToLexicalFeature","editorConfig","resolvedFeatureMap","get","converters","sanitizedServerFeatureProps","slateData"],"sources":["../../../src/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.ts"],"sourcesContent":["import type { Field, FlattenedBlock, Payload } from 'payload'\n\nimport { fieldAffectsData, fieldHasSubFields, fieldIsArrayType, tabHasName } from 'payload/shared'\n\nimport type {\n SlateNode,\n SlateNodeConverter,\n} from '../../features/migrations/slateToLexical/converter/types.js'\nimport type { LexicalRichTextAdapter } from '../../types.js'\n\nimport { convertSlateToLexical } from '../../features/migrations/slateToLexical/converter/index.js'\n\ntype NestedRichTextFieldsArgs = {\n data: Record<string, unknown>\n\n fields: Field[]\n found: number\n payload: Payload\n}\n\nexport const migrateDocumentFieldsRecursively = ({\n data,\n fields,\n found,\n payload,\n}: NestedRichTextFieldsArgs): number => {\n for (const field of fields) {\n if (fieldHasSubFields(field) && !fieldIsArrayType(field)) {\n if (fieldAffectsData(field) && typeof data[field.name] === 'object') {\n found += migrateDocumentFieldsRecursively({\n data: data[field.name] as Record<string, unknown>,\n fields: field.fields,\n found,\n payload,\n })\n } else {\n found += migrateDocumentFieldsRecursively({\n data,\n fields: field.fields,\n found,\n payload,\n })\n }\n } else if (field.type === 'tabs') {\n field.tabs.forEach((tab) => {\n found += migrateDocumentFieldsRecursively({\n data: (tabHasName(tab) ? data[tab.name] : data) as Record<string, unknown>,\n fields: tab.fields,\n found,\n payload,\n })\n })\n } else if (Array.isArray(data[field.name])) {\n if (field.type === 'blocks') {\n ;(data[field.name] as Array<Record<string, unknown>>).forEach((row) => {\n const blockTypeToMatch: string = row?.blockType as string\n const block =\n payload?.blocks[blockTypeToMatch] ??\n ((field.blockReferences ?? field.blocks).find(\n (block) => typeof block !== 'string' && block.slug === blockTypeToMatch,\n ) as FlattenedBlock | undefined)\n\n if (block) {\n found += migrateDocumentFieldsRecursively({\n data: row,\n fields: block.fields,\n found,\n payload,\n })\n }\n })\n }\n\n if (field.type === 'array') {\n ;(data[field.name] as Array<Record<string, unknown>>).forEach((row) => {\n found += migrateDocumentFieldsRecursively({\n data: row,\n fields: field.fields,\n found,\n payload,\n })\n })\n }\n }\n\n if (field.type === 'richText' && Array.isArray(data[field.name])) {\n // Slate richText\n const editor: LexicalRichTextAdapter = field.editor as LexicalRichTextAdapter\n if (editor && typeof editor === 'object') {\n if ('features' in editor && editor.features?.length) {\n // find slatetolexical feature\n const slateToLexicalFeature = editor.editorConfig.resolvedFeatureMap.get('slateToLexical')\n if (slateToLexicalFeature) {\n // DO CONVERSION\n\n const { converters } = slateToLexicalFeature.sanitizedServerFeatureProps as {\n converters?: SlateNodeConverter[]\n }\n\n data[field.name] = convertSlateToLexical({\n converters: converters!,\n slateData: data[field.name] as SlateNode[],\n })\n\n found++\n }\n }\n }\n }\n }\n\n return found\n}\n"],"mappings":"AAEA,SAASA,gBAAgB,EAAEC,iBAAiB,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ;AAQlF,SAASC,qBAAqB,QAAQ;AAUtC,OAAO,MAAMC,gCAAA,GAAmCA,CAAC;EAC/CC,IAAI;EACJC,MAAM;EACNC,KAAK;EACLC;AAAO,CACkB;EACzB,KAAK,MAAMC,KAAA,IAASH,MAAA,EAAQ;IAC1B,IAAIN,iBAAA,CAAkBS,KAAA,KAAU,CAACR,gBAAA,CAAiBQ,KA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A,EAAMY,GAAA;cACNX,MAAA,EAAQc,KAAA,CAAMd,MAAM;cACpBC,KAAA;cACAC;YACF;UACF;QACF;MACF;MAEA,IAAIC,KAAA,CAAME,IAAI,KAAK,SAAS;QACxBN,IAAI,CAACI,KAAA,CAAMC,IAAI,CAAC,CAAoCG,OAAO,CAAEI,GAAA;UAC7DV,KAAA,IAASH,gCAAA,CAAiC;YACxCC,IAAA,EAAMY,GAAA;YACNX,MAAA,EAAQG,KAAA,CAAMH,MAAM;YACpBC,KAAA;YACAC;UACF;QACF;MACF;IACF;IAEA,IAAIC,KAAA,CAAME,IAAI,KAAK,cAAcI,KAAA,CAAMC,OAAO,CAACX,IAAI,CAACI,KAAA,CAAMC,IAAI,CAAC,GAAG;MAChE;MACA,MAAMe,MAAA,GAAiChB,KAAA,CAAMgB,MAAM;MACnD,IAAIA,MAAA,IAAU,OAAOA,MAAA,KAAW,UAAU;QACxC,IAAI,cAAcA,MAAA,IAAUA,MAAA,CAAOC,QAAQ,EAAEC,MAAA,EAAQ;UACnD;UACA,MAAMC,qBAAA,GAAwBH,MAAA,CAAOI,YAAY,CAACC,kBAAkB,CAACC,GAAG,CAAC;UACzE,IAAIH,qBAAA,EAAuB;YACzB;YAEA,MAAM;cAAEI;YAAU,CAAE,GAAGJ,qBAAA,CAAsBK,2BAA2B;YAIxE5B,IAAI,CAACI,KAAA,CAAMC,IAAI,CAAC,GAAGP,qBAAA,CAAsB;cACvC6B,UAAA,EAAYA,UAAA;cACZE,SAAA,EAAW7B,IAAI,CAACI,KAAA,CAAMC,IAAI;YAC5B;YAEAH,KAAA;UACF;QACF;MACF;IACF;EACF;EAEA,OAAOA,KAAA;AACT","ignoreList":[]}
|
/package/dist/exports/client/{componentInline-CBBUBQ7P.js.map → componentInline-LCHKRXOV.js.map}
RENAMED
|
File without changes
|