@payloadcms/richtext-lexical 3.0.0-beta.4 → 3.0.0-beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cell/index.d.ts +5 -2
- package/dist/cell/index.d.ts.map +1 -1
- package/dist/cell/index.js +44 -29
- package/dist/cell/index.js.map +1 -1
- package/dist/exports/components.d.ts +7 -2
- package/dist/exports/components.d.ts.map +1 -1
- package/dist/exports/components.js +7 -2
- package/dist/exports/components.js.map +1 -1
- package/dist/field/Field.d.ts +0 -2
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +66 -47
- package/dist/field/Field.js.map +1 -1
- package/dist/field/features/align/feature.client.d.ts +4 -1
- package/dist/field/features/align/feature.client.d.ts.map +1 -1
- package/dist/field/features/align/feature.client.js +135 -54
- package/dist/field/features/align/feature.client.js.map +1 -1
- package/dist/field/features/align/feature.server.d.ts.map +1 -1
- package/dist/field/features/align/feature.server.js +2 -0
- package/dist/field/features/align/feature.server.js.map +1 -1
- package/dist/field/features/align/i18n.d.ts +3 -0
- package/dist/field/features/align/i18n.d.ts.map +1 -0
- package/dist/field/features/align/i18n.js +196 -0
- package/dist/field/features/align/i18n.js.map +1 -0
- package/dist/field/features/align/toolbarAlignGroup.d.ts +3 -0
- package/dist/field/features/align/toolbarAlignGroup.d.ts.map +1 -0
- package/dist/field/features/align/toolbarAlignGroup.js +12 -0
- package/dist/field/features/align/toolbarAlignGroup.js.map +1 -0
- package/dist/field/features/blockquote/feature.client.d.ts +4 -1
- package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
- package/dist/field/features/blockquote/feature.client.js +60 -46
- package/dist/field/features/blockquote/feature.client.js.map +1 -1
- package/dist/field/features/blockquote/feature.server.d.ts +1 -1
- package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
- package/dist/field/features/blockquote/feature.server.js +9 -7
- package/dist/field/features/blockquote/feature.server.js.map +1 -1
- package/dist/field/features/blockquote/i18n.d.ts +3 -0
- package/dist/field/features/blockquote/i18n.d.ts.map +1 -0
- package/dist/field/features/blockquote/i18n.js +100 -0
- package/dist/field/features/blockquote/i18n.js.map +1 -0
- package/dist/field/features/blockquote/markdownTransformer.d.ts.map +1 -1
- package/dist/field/features/blockquote/markdownTransformer.js +2 -4
- package/dist/field/features/blockquote/markdownTransformer.js.map +1 -1
- package/dist/field/features/blocks/component/BlockContent.d.ts.map +1 -1
- package/dist/field/features/blocks/component/BlockContent.js +65 -50
- package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
- package/dist/field/features/blocks/component/index.d.ts.map +1 -1
- package/dist/field/features/blocks/component/index.js +60 -17
- package/dist/field/features/blocks/component/index.js.map +1 -1
- package/dist/field/features/blocks/component/index.scss +0 -4
- package/dist/field/features/blocks/drawer/index.d.ts.map +1 -1
- package/dist/field/features/blocks/drawer/index.js +4 -5
- package/dist/field/features/blocks/drawer/index.js.map +1 -1
- package/dist/field/features/blocks/feature.client.d.ts +4 -1
- package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
- package/dist/field/features/blocks/feature.client.js +58 -27
- package/dist/field/features/blocks/feature.client.js.map +1 -1
- package/dist/field/features/blocks/feature.server.d.ts +2 -5
- package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
- package/dist/field/features/blocks/feature.server.js +111 -77
- package/dist/field/features/blocks/feature.server.js.map +1 -1
- package/dist/field/features/blocks/i18n.d.ts +3 -0
- package/dist/field/features/blocks/i18n.d.ts.map +1 -0
- package/dist/field/features/blocks/i18n.js +100 -0
- package/dist/field/features/blocks/i18n.js.map +1 -0
- package/dist/field/features/blocks/nodes/BlocksNode.d.ts +2 -4
- package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/field/features/blocks/nodes/BlocksNode.js +3 -3
- package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
- package/dist/field/features/blocks/plugin/commands.d.ts.map +1 -1
- package/dist/field/features/blocks/plugin/commands.js +1 -2
- package/dist/field/features/blocks/plugin/commands.js.map +1 -1
- package/dist/field/features/blocks/plugin/index.d.ts +3 -2
- package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
- package/dist/field/features/blocks/plugin/index.js +10 -11
- package/dist/field/features/blocks/plugin/index.js.map +1 -1
- package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
- package/dist/field/features/blocks/populationPromise.js +5 -19
- package/dist/field/features/blocks/populationPromise.js.map +1 -1
- package/dist/field/features/blocks/validate.d.ts.map +1 -1
- package/dist/field/features/blocks/validate.js +22 -36
- package/dist/field/features/blocks/validate.js.map +1 -1
- package/dist/field/features/converters/html/field/index.d.ts +8 -2
- package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
- package/dist/field/features/converters/html/field/index.js +36 -5
- package/dist/field/features/converters/html/field/index.js.map +1 -1
- package/dist/field/features/createFeaturePropComponent.d.ts.map +1 -1
- package/dist/field/features/createFeaturePropComponent.js +6 -1
- package/dist/field/features/createFeaturePropComponent.js.map +1 -1
- package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts +4 -1
- package/dist/field/features/debug/testRecorder/feature.client.d.ts.map +1 -0
- package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js.map +1 -1
- package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts.map +1 -1
- package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js +1 -1
- package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js.map +1 -1
- package/dist/field/features/debug/testRecorder/plugin/index.d.ts +5 -0
- package/dist/field/features/debug/testRecorder/plugin/index.d.ts.map +1 -0
- package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.js +68 -44
- package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -0
- package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts +4 -1
- package/dist/field/features/debug/treeView/feature.client.d.ts.map +1 -0
- package/dist/field/features/debug/{treeview → treeView}/feature.client.js.map +1 -1
- package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts.map +1 -1
- package/dist/field/features/debug/{treeview → treeView}/feature.server.js +1 -1
- package/dist/field/features/debug/{treeview → treeView}/feature.server.js.map +1 -1
- package/dist/field/features/debug/treeView/plugin/index.d.ts +4 -0
- package/dist/field/features/debug/treeView/plugin/index.d.ts.map +1 -0
- package/dist/field/features/debug/{treeview → treeView}/plugin/index.js +6 -7
- package/dist/field/features/debug/treeView/plugin/index.js.map +1 -0
- package/dist/field/features/format/bold/feature.client.d.ts +4 -1
- package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/bold/feature.client.js +26 -23
- package/dist/field/features/format/bold/feature.client.js.map +1 -1
- package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.d.ts +4 -1
- package/dist/field/features/format/inlineCode/feature.client.d.ts.map +1 -0
- package/dist/field/features/format/inlineCode/feature.client.js +46 -0
- package/dist/field/features/format/inlineCode/feature.client.js.map +1 -0
- package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts.map +1 -1
- package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js +1 -1
- package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js.map +1 -1
- package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts.map +1 -1
- package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js.map +1 -1
- package/dist/field/features/format/italic/feature.client.d.ts +4 -1
- package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/italic/feature.client.js +27 -24
- package/dist/field/features/format/italic/feature.client.js.map +1 -1
- package/dist/field/features/format/shared/toolbarFormatGroup.d.ts +3 -0
- package/dist/field/features/format/shared/toolbarFormatGroup.d.ts.map +1 -0
- package/dist/field/features/format/shared/toolbarFormatGroup.js +10 -0
- package/dist/field/features/format/shared/toolbarFormatGroup.js.map +1 -0
- package/dist/field/features/format/strikethrough/feature.client.d.ts +4 -1
- package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/strikethrough/feature.client.js +27 -24
- package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
- package/dist/field/features/format/subscript/feature.client.d.ts +4 -1
- package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/subscript/feature.client.js +25 -22
- package/dist/field/features/format/subscript/feature.client.js.map +1 -1
- package/dist/field/features/format/superscript/feature.client.d.ts +4 -1
- package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/superscript/feature.client.js +25 -22
- package/dist/field/features/format/superscript/feature.client.js.map +1 -1
- package/dist/field/features/format/underline/feature.client.d.ts +4 -1
- package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/underline/feature.client.js +25 -22
- package/dist/field/features/format/underline/feature.client.js.map +1 -1
- package/dist/field/features/heading/feature.client.d.ts +4 -1
- package/dist/field/features/heading/feature.client.d.ts.map +1 -1
- package/dist/field/features/heading/feature.client.js +76 -54
- package/dist/field/features/heading/feature.client.js.map +1 -1
- package/dist/field/features/heading/feature.server.d.ts.map +1 -1
- package/dist/field/features/heading/feature.server.js +7 -5
- package/dist/field/features/heading/feature.server.js.map +1 -1
- package/dist/field/features/heading/i18n.d.ts +3 -0
- package/dist/field/features/heading/i18n.d.ts.map +1 -0
- package/dist/field/features/heading/i18n.js +100 -0
- package/dist/field/features/heading/i18n.js.map +1 -0
- package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
- package/dist/field/features/heading/markdownTransformer.js +1 -2
- package/dist/field/features/heading/markdownTransformer.js.map +1 -1
- package/dist/field/features/horizontalRule/component/index.d.ts +10 -0
- package/dist/field/features/horizontalRule/component/index.d.ts.map +1 -0
- package/dist/field/features/horizontalRule/component/index.js +67 -0
- package/dist/field/features/horizontalRule/component/index.js.map +1 -0
- package/dist/field/features/horizontalRule/feature.client.d.ts +6 -0
- package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -0
- package/dist/field/features/horizontalRule/feature.client.js +77 -0
- package/dist/field/features/horizontalRule/feature.client.js.map +1 -0
- package/dist/field/features/horizontalRule/feature.server.d.ts +3 -0
- package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -0
- package/dist/field/features/horizontalRule/feature.server.js +38 -0
- package/dist/field/features/horizontalRule/feature.server.js.map +1 -0
- package/dist/field/features/horizontalRule/i18n.d.ts +3 -0
- package/dist/field/features/horizontalRule/i18n.d.ts.map +1 -0
- package/dist/field/features/horizontalRule/i18n.js +100 -0
- package/dist/field/features/horizontalRule/i18n.js.map +1 -0
- package/dist/field/features/horizontalRule/markdownTransformer.d.ts +3 -0
- package/dist/field/features/horizontalRule/markdownTransformer.d.ts.map +1 -0
- package/dist/field/features/horizontalRule/markdownTransformer.js +23 -0
- package/dist/field/features/horizontalRule/markdownTransformer.js.map +1 -0
- package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts +53 -0
- package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts.map +1 -0
- package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js +92 -0
- package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -0
- package/dist/field/features/horizontalRule/plugin/index.d.ts +7 -0
- package/dist/field/features/horizontalRule/plugin/index.d.ts.map +1 -0
- package/dist/field/features/horizontalRule/plugin/index.js +31 -0
- package/dist/field/features/horizontalRule/plugin/index.js.map +1 -0
- package/dist/field/features/horizontalRule/plugin/index.scss +20 -0
- package/dist/field/features/indent/feature.client.d.ts +4 -1
- package/dist/field/features/indent/feature.client.d.ts.map +1 -1
- package/dist/field/features/indent/feature.client.js +47 -42
- package/dist/field/features/indent/feature.client.js.map +1 -1
- package/dist/field/features/indent/feature.server.d.ts.map +1 -1
- package/dist/field/features/indent/feature.server.js +2 -0
- package/dist/field/features/indent/feature.server.js.map +1 -1
- package/dist/field/features/indent/i18n.d.ts +3 -0
- package/dist/field/features/indent/i18n.d.ts.map +1 -0
- package/dist/field/features/indent/i18n.js +132 -0
- package/dist/field/features/indent/i18n.js.map +1 -0
- package/dist/field/features/indent/toolbarIndentGroup.d.ts +3 -0
- package/dist/field/features/indent/toolbarIndentGroup.d.ts.map +1 -0
- package/dist/field/features/indent/toolbarIndentGroup.js +10 -0
- package/dist/field/features/indent/toolbarIndentGroup.js.map +1 -0
- package/dist/field/features/link/drawer/baseFields.d.ts +2 -2
- package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
- package/dist/field/features/link/drawer/baseFields.js +30 -43
- package/dist/field/features/link/drawer/baseFields.js.map +1 -1
- package/dist/field/features/link/drawer/index.js +30 -21
- package/dist/field/features/link/drawer/index.js.map +1 -1
- package/dist/field/features/link/drawer/types.d.ts +4 -2
- package/dist/field/features/link/drawer/types.d.ts.map +1 -1
- package/dist/field/features/link/drawer/types.js.map +1 -1
- package/dist/field/features/link/feature.client.d.ts +13 -1
- package/dist/field/features/link/feature.client.d.ts.map +1 -1
- package/dist/field/features/link/feature.client.js +65 -47
- package/dist/field/features/link/feature.client.js.map +1 -1
- package/dist/field/features/link/feature.server.d.ts +10 -5
- package/dist/field/features/link/feature.server.d.ts.map +1 -1
- package/dist/field/features/link/feature.server.js +58 -11
- package/dist/field/features/link/feature.server.js.map +1 -1
- package/dist/field/features/link/i18n.d.ts +3 -0
- package/dist/field/features/link/i18n.d.ts.map +1 -0
- package/dist/field/features/link/i18n.js +100 -0
- package/dist/field/features/link/i18n.js.map +1 -0
- package/dist/field/features/link/markdownTransformer.d.ts +6 -0
- package/dist/field/features/link/markdownTransformer.d.ts.map +1 -0
- package/dist/field/features/link/markdownTransformer.js +50 -0
- package/dist/field/features/link/markdownTransformer.js.map +1 -0
- package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
- package/dist/field/features/link/nodes/AutoLinkNode.js +1 -2
- package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
- package/dist/field/features/link/nodes/LinkNode.d.ts +4 -4
- package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
- package/dist/field/features/link/nodes/LinkNode.js +6 -7
- package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/field/features/link/plugins/autoLink/index.d.ts +3 -2
- package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
- package/dist/field/features/link/plugins/autoLink/index.js +11 -12
- package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
- package/dist/field/features/link/plugins/clickableLink/index.d.ts +3 -2
- package/dist/field/features/link/plugins/clickableLink/index.d.ts.map +1 -1
- package/dist/field/features/link/plugins/clickableLink/index.js +5 -6
- package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +177 -135
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts +3 -4
- package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/index.js +2 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +11 -3
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +1 -3
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +12 -30
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
- package/dist/field/features/link/plugins/link/index.d.ts +3 -1
- package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
- package/dist/field/features/link/plugins/link/index.js +5 -14
- package/dist/field/features/link/plugins/link/index.js.map +1 -1
- package/dist/field/features/link/populationPromise.d.ts.map +1 -1
- package/dist/field/features/link/populationPromise.js +11 -26
- package/dist/field/features/link/populationPromise.js.map +1 -1
- package/dist/field/features/link/validate.d.ts +5 -0
- package/dist/field/features/link/validate.d.ts.map +1 -0
- package/dist/field/features/link/validate.js +32 -0
- package/dist/field/features/link/validate.js.map +1 -0
- package/dist/field/features/lists/checklist/feature.client.d.ts +4 -1
- package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
- package/dist/field/features/lists/checklist/feature.client.js +69 -44
- package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
- package/dist/field/features/lists/checklist/feature.server.d.ts +1 -1
- package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
- package/dist/field/features/lists/checklist/feature.server.js +12 -10
- package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
- package/dist/field/features/lists/checklist/i18n.d.ts +3 -0
- package/dist/field/features/lists/checklist/i18n.d.ts.map +1 -0
- package/dist/field/features/lists/checklist/i18n.js +100 -0
- package/dist/field/features/lists/checklist/i18n.js.map +1 -0
- package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
- package/dist/field/features/lists/checklist/markdownTransformers.js +2 -3
- package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
- package/dist/field/features/lists/checklist/plugin/index.d.ts +2 -2
- package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
- package/dist/field/features/lists/checklist/plugin/index.js +5 -5
- package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
- package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
- package/dist/field/features/lists/htmlConverter.js +13 -6
- package/dist/field/features/lists/htmlConverter.js.map +1 -1
- package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts +4 -1
- package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -0
- package/dist/field/features/lists/orderedList/feature.client.js +97 -0
- package/dist/field/features/lists/orderedList/feature.client.js.map +1 -0
- package/dist/field/features/lists/orderedList/feature.server.d.ts.map +1 -0
- package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.js +10 -8
- package/dist/field/features/lists/orderedList/feature.server.js.map +1 -0
- package/dist/field/features/lists/orderedList/i18n.d.ts +3 -0
- package/dist/field/features/lists/orderedList/i18n.d.ts.map +1 -0
- package/dist/field/features/lists/orderedList/i18n.js +100 -0
- package/dist/field/features/lists/orderedList/i18n.js.map +1 -0
- package/dist/field/features/lists/orderedList/markdownTransformer.d.ts.map +1 -0
- package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.js +2 -3
- package/dist/field/features/lists/orderedList/markdownTransformer.js.map +1 -0
- package/dist/field/features/lists/plugin/index.d.ts +2 -2
- package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
- package/dist/field/features/lists/plugin/index.js +5 -5
- package/dist/field/features/lists/plugin/index.js.map +1 -1
- package/dist/field/features/lists/{common → shared}/markdown.d.ts.map +1 -1
- package/dist/field/features/lists/{common → shared}/markdown.js +1 -2
- package/dist/field/features/lists/shared/markdown.js.map +1 -0
- package/dist/field/features/lists/shared/slashMenuListGroup.d.ts +3 -0
- package/dist/field/features/lists/shared/slashMenuListGroup.d.ts.map +1 -0
- package/dist/field/features/lists/shared/slashMenuListGroup.js +11 -0
- package/dist/field/features/lists/shared/slashMenuListGroup.js.map +1 -0
- package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.client.d.ts +4 -1
- package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -0
- package/dist/field/features/lists/unorderedList/feature.client.js +97 -0
- package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -0
- package/dist/field/features/lists/unorderedList/feature.server.d.ts.map +1 -0
- package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.js +9 -7
- package/dist/field/features/lists/unorderedList/feature.server.js.map +1 -0
- package/dist/field/features/lists/unorderedList/i18n.d.ts +3 -0
- package/dist/field/features/lists/unorderedList/i18n.d.ts.map +1 -0
- package/dist/field/features/lists/unorderedList/i18n.js +100 -0
- package/dist/field/features/lists/unorderedList/i18n.js.map +1 -0
- package/dist/field/features/lists/unorderedList/markdownTransformer.d.ts.map +1 -0
- package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.js +2 -3
- package/dist/field/features/lists/unorderedList/markdownTransformer.js.map +1 -0
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/feature.client.d.ts +4 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +9 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +2 -4
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +4 -5
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js +2 -2
- package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
- package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
- package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
- package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/feature.client.d.ts +4 -1
- package/dist/field/features/migrations/slateToLexical/feature.client.d.ts.map +1 -1
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +9 -1
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +2 -4
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +4 -5
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/field/features/paragraph/feature.client.d.ts +4 -1
- package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
- package/dist/field/features/paragraph/feature.client.js +54 -41
- package/dist/field/features/paragraph/feature.client.js.map +1 -1
- package/dist/field/features/paragraph/feature.server.d.ts.map +1 -1
- package/dist/field/features/paragraph/feature.server.js +2 -0
- package/dist/field/features/paragraph/feature.server.js.map +1 -1
- package/dist/field/features/paragraph/i18n.d.ts +3 -0
- package/dist/field/features/paragraph/i18n.d.ts.map +1 -0
- package/dist/field/features/paragraph/i18n.js +132 -0
- package/dist/field/features/paragraph/i18n.js.map +1 -0
- package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
- package/dist/field/features/relationship/drawer/commands.js +1 -2
- package/dist/field/features/relationship/drawer/commands.js.map +1 -1
- package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
- package/dist/field/features/relationship/drawer/index.js +17 -15
- package/dist/field/features/relationship/drawer/index.js.map +1 -1
- package/dist/field/features/relationship/feature.client.d.ts +17 -2
- package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
- package/dist/field/features/relationship/feature.client.js +51 -28
- package/dist/field/features/relationship/feature.client.js.map +1 -1
- package/dist/field/features/relationship/feature.server.d.ts +10 -1
- package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
- package/dist/field/features/relationship/feature.server.js +7 -4
- package/dist/field/features/relationship/feature.server.js.map +1 -1
- package/dist/field/features/relationship/i18n.d.ts +3 -0
- package/dist/field/features/relationship/i18n.d.ts.map +1 -0
- package/dist/field/features/relationship/i18n.js +100 -0
- package/dist/field/features/relationship/i18n.js.map +1 -0
- package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +4 -9
- package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/field/features/relationship/nodes/RelationshipNode.js +12 -11
- package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
- package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
- package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +119 -50
- package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
- package/dist/field/features/relationship/plugins/index.d.ts +2 -2
- package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
- package/dist/field/features/relationship/plugins/index.js +14 -15
- package/dist/field/features/relationship/plugins/index.js.map +1 -1
- package/dist/field/features/relationship/populationPromise.d.ts +2 -1
- package/dist/field/features/relationship/populationPromise.d.ts.map +1 -1
- package/dist/field/features/relationship/populationPromise.js +25 -19
- package/dist/field/features/relationship/populationPromise.js.map +1 -1
- package/dist/field/features/shared/slashMenu/basicGroup.d.ts +3 -0
- package/dist/field/features/shared/slashMenu/basicGroup.d.ts.map +1 -0
- package/dist/field/features/shared/slashMenu/basicGroup.js +11 -0
- package/dist/field/features/shared/slashMenu/basicGroup.js.map +1 -0
- package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts +3 -0
- package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -0
- package/dist/field/features/shared/toolbar/addDropdownGroup.js +12 -0
- package/dist/field/features/shared/toolbar/addDropdownGroup.js.map +1 -0
- package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts +3 -0
- package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -0
- package/dist/field/features/shared/toolbar/featureButtonsGroup.js +10 -0
- package/dist/field/features/shared/toolbar/featureButtonsGroup.js.map +1 -0
- package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts +3 -0
- package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -0
- package/dist/field/features/shared/toolbar/textDropdownGroup.js +12 -0
- package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +5 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.js +211 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.scss +119 -0
- package/dist/field/features/toolbars/fixed/feature.client.d.ts +7 -0
- package/dist/field/features/toolbars/fixed/feature.client.d.ts.map +1 -0
- package/dist/field/features/toolbars/fixed/feature.client.js +20 -0
- package/dist/field/features/toolbars/fixed/feature.client.js.map +1 -0
- package/dist/field/features/toolbars/fixed/feature.server.d.ts +19 -0
- package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
- package/dist/field/features/toolbars/fixed/feature.server.js +20 -0
- package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -0
- package/dist/field/features/toolbars/inline/Toolbar/index.d.ts +4 -0
- package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
- package/dist/field/features/toolbars/inline/Toolbar/index.js +320 -0
- package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
- package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/inline/Toolbar}/index.scss +7 -11
- package/dist/field/features/toolbars/inline/feature.client.d.ts +6 -0
- package/dist/field/features/toolbars/inline/feature.client.d.ts.map +1 -0
- package/dist/field/features/toolbars/inline/feature.client.js +20 -0
- package/dist/field/features/toolbars/inline/feature.client.js.map +1 -0
- package/dist/field/features/toolbars/inline/feature.server.d.ts +3 -0
- package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -0
- package/dist/field/features/toolbars/inline/feature.server.js +15 -0
- package/dist/field/features/toolbars/inline/feature.server.js.map +1 -0
- package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +10 -0
- package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -0
- package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.js +34 -22
- package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
- package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.scss +3 -1
- package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +23 -0
- package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -0
- package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/DropDown.js +74 -100
- package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -0
- package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +23 -0
- package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -0
- package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +142 -0
- package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -0
- package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/index.scss +25 -13
- package/dist/field/features/toolbars/types.d.ts +48 -0
- package/dist/field/features/toolbars/types.d.ts.map +1 -0
- package/dist/field/features/toolbars/types.js.map +1 -0
- package/dist/field/features/typeUtilities.d.ts +8 -0
- package/dist/field/features/typeUtilities.d.ts.map +1 -0
- package/dist/field/features/typeUtilities.js +8 -0
- package/dist/field/features/typeUtilities.js.map +1 -0
- package/dist/field/features/types.d.ts +172 -63
- package/dist/field/features/types.d.ts.map +1 -1
- package/dist/field/features/types.js.map +1 -1
- package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
- package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +32 -25
- package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
- package/dist/field/features/upload/component/index.d.ts.map +1 -1
- package/dist/field/features/upload/component/index.js +159 -76
- package/dist/field/features/upload/component/index.js.map +1 -1
- package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
- package/dist/field/features/upload/drawer/commands.js +1 -2
- package/dist/field/features/upload/drawer/commands.js.map +1 -1
- package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
- package/dist/field/features/upload/drawer/index.js +16 -16
- package/dist/field/features/upload/drawer/index.js.map +1 -1
- package/dist/field/features/upload/feature.client.d.ts +4 -1
- package/dist/field/features/upload/feature.client.d.ts.map +1 -1
- package/dist/field/features/upload/feature.client.js +52 -26
- package/dist/field/features/upload/feature.client.js.map +1 -1
- package/dist/field/features/upload/feature.server.d.ts +10 -3
- package/dist/field/features/upload/feature.server.d.ts.map +1 -1
- package/dist/field/features/upload/feature.server.js +41 -11
- package/dist/field/features/upload/feature.server.js.map +1 -1
- package/dist/field/features/upload/i18n.d.ts +3 -0
- package/dist/field/features/upload/i18n.d.ts.map +1 -0
- package/dist/field/features/upload/i18n.js +100 -0
- package/dist/field/features/upload/i18n.js.map +1 -0
- package/dist/field/features/upload/nodes/UploadNode.d.ts +3 -15
- package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
- package/dist/field/features/upload/nodes/UploadNode.js +35 -14
- package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
- package/dist/field/features/upload/plugin/index.d.ts +5 -4
- package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
- package/dist/field/features/upload/plugin/index.js +16 -19
- package/dist/field/features/upload/plugin/index.js.map +1 -1
- package/dist/field/features/upload/populationPromise.d.ts.map +1 -1
- package/dist/field/features/upload/populationPromise.js +16 -10
- package/dist/field/features/upload/populationPromise.js.map +1 -1
- package/dist/field/features/upload/validate.d.ts +2 -1
- package/dist/field/features/upload/validate.d.ts.map +1 -1
- package/dist/field/features/upload/validate.js +36 -9
- package/dist/field/features/upload/validate.js.map +1 -1
- package/dist/field/index.d.ts +3 -1
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js +39 -26
- package/dist/field/index.js.map +1 -1
- package/dist/field/index.scss +1 -22
- package/dist/field/lexical/EditorPlugin.d.ts +1 -0
- package/dist/field/lexical/EditorPlugin.d.ts.map +1 -1
- package/dist/field/lexical/EditorPlugin.js +8 -4
- package/dist/field/lexical/EditorPlugin.js.map +1 -1
- package/dist/field/lexical/LexicalEditor.d.ts +3 -1
- package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/field/lexical/LexicalEditor.js +157 -76
- package/dist/field/lexical/LexicalEditor.js.map +1 -1
- package/dist/field/lexical/LexicalEditor.scss +13 -20
- package/dist/field/lexical/LexicalProvider.d.ts +1 -1
- package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/field/lexical/LexicalProvider.js +52 -41
- package/dist/field/lexical/LexicalProvider.js.map +1 -1
- package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +15 -4
- package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
- package/dist/field/lexical/config/client/EditorConfigProvider.js +61 -11
- package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
- package/dist/field/lexical/config/client/default.d.ts +1 -1
- package/dist/field/lexical/config/client/default.d.ts.map +1 -1
- package/dist/field/lexical/config/client/default.js.map +1 -1
- package/dist/field/lexical/config/client/sanitize.d.ts +3 -2
- package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
- package/dist/field/lexical/config/client/sanitize.js +83 -33
- package/dist/field/lexical/config/client/sanitize.js.map +1 -1
- package/dist/field/lexical/config/server/default.d.ts +2 -3
- package/dist/field/lexical/config/server/default.d.ts.map +1 -1
- package/dist/field/lexical/config/server/default.js +12 -10
- package/dist/field/lexical/config/server/default.js.map +1 -1
- package/dist/field/lexical/config/server/loader.d.ts +5 -2
- package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
- package/dist/field/lexical/config/server/loader.js +4 -2
- package/dist/field/lexical/config/server/loader.js.map +1 -1
- package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
- package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/field/lexical/config/server/sanitize.js +32 -6
- package/dist/field/lexical/config/server/sanitize.js.map +1 -1
- package/dist/field/lexical/config/types.d.ts +3 -1
- package/dist/field/lexical/config/types.d.ts.map +1 -1
- package/dist/field/lexical/config/types.js.map +1 -1
- package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/MarkdownShortcut/index.js +3 -3
- package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +10 -10
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +74 -77
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +5 -5
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +8 -10
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +19 -27
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -37
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/index.d.ts +2 -2
- package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/index.js +108 -92
- package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +2 -2
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +47 -125
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +2 -2
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +2 -2
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +116 -66
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +20 -3
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts +8 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +83 -16
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
- package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts +5 -0
- package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +21 -0
- package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -0
- package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts +9 -0
- package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +35 -0
- package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -0
- package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.d.ts +5 -1
- package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.js +5 -18
- package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -0
- package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
- package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts +1 -1
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +19 -7
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
- package/dist/field/lexical/theme/EditorTheme.d.ts.map +1 -1
- package/dist/field/lexical/theme/EditorTheme.js +1 -0
- package/dist/field/lexical/theme/EditorTheme.js.map +1 -1
- package/dist/field/lexical/theme/EditorTheme.scss +18 -14
- package/dist/field/lexical/ui/ContentEditable.d.ts +1 -1
- package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
- package/dist/field/lexical/ui/ContentEditable.js +3 -3
- package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/field/lexical/ui/ContentEditable.scss +55 -4
- package/dist/field/lexical/ui/icons/AI/index.js +26 -17
- package/dist/field/lexical/ui/icons/AI/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Add/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Add/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Add/index.js +21 -0
- package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
- package/dist/field/lexical/ui/icons/Add/light.svg +4 -0
- package/dist/field/lexical/ui/icons/AlignCenter/index.js +21 -15
- package/dist/field/lexical/ui/icons/AlignCenter/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/AlignJustify/index.js +21 -15
- package/dist/field/lexical/ui/icons/AlignJustify/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/AlignLeft/index.js +21 -15
- package/dist/field/lexical/ui/icons/AlignLeft/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/AlignRight/index.js +21 -15
- package/dist/field/lexical/ui/icons/AlignRight/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Block/index.js +30 -24
- package/dist/field/lexical/ui/icons/Block/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Blockquote/index.js +8 -6
- package/dist/field/lexical/ui/icons/Blockquote/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Bold/index.js +8 -6
- package/dist/field/lexical/ui/icons/Bold/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Checklist/index.js +19 -14
- package/dist/field/lexical/ui/icons/Checklist/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Code/index.js +14 -9
- package/dist/field/lexical/ui/icons/Code/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/CodeBlock/index.js +14 -9
- package/dist/field/lexical/ui/icons/CodeBlock/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/DraggableBlock/light.svg +9 -0
- package/dist/field/lexical/ui/icons/H1/index.js +8 -6
- package/dist/field/lexical/ui/icons/H1/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/H2/index.js +8 -6
- package/dist/field/lexical/ui/icons/H2/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/H3/index.js +8 -6
- package/dist/field/lexical/ui/icons/H3/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/H4/index.js +8 -6
- package/dist/field/lexical/ui/icons/H4/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/H5/index.js +8 -6
- package/dist/field/lexical/ui/icons/H5/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/H6/index.js +8 -6
- package/dist/field/lexical/ui/icons/H6/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/HorizontalRule/index.js +21 -0
- package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -0
- package/dist/field/lexical/ui/icons/IndentDecrease/index.js +25 -18
- package/dist/field/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/IndentIncrease/index.js +25 -18
- package/dist/field/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Italic/index.js +8 -6
- package/dist/field/lexical/ui/icons/Italic/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Link/index.d.ts.map +1 -1
- package/dist/field/lexical/ui/icons/Link/index.js +10 -18
- package/dist/field/lexical/ui/icons/Link/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/OrderedList/index.js +29 -21
- package/dist/field/lexical/ui/icons/OrderedList/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Relationship/index.js +26 -17
- package/dist/field/lexical/ui/icons/Relationship/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Strikethrough/index.js +14 -9
- package/dist/field/lexical/ui/icons/Strikethrough/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Subscript/index.js +8 -6
- package/dist/field/lexical/ui/icons/Subscript/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Superscript/index.js +8 -6
- package/dist/field/lexical/ui/icons/Superscript/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Text/index.js +8 -6
- package/dist/field/lexical/ui/icons/Text/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Underline/index.js +14 -9
- package/dist/field/lexical/ui/icons/Underline/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/UnorderedList/index.js +45 -36
- package/dist/field/lexical/ui/icons/UnorderedList/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Upload/index.js +24 -18
- package/dist/field/lexical/ui/icons/Upload/index.js.map +1 -1
- package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
- package/dist/field/lexical/utils/getSelectedNode.js +1 -2
- package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
- package/dist/field/lexical/utils/nodeFormat.d.ts +2 -1
- package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
- package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
- package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +11 -1
- package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
- package/dist/field/lexical/utils/setFloatingElemPosition.js +16 -13
- package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
- package/dist/field/lexical/utils/url.d.ts.map +1 -1
- package/dist/field/lexical/utils/url.js +13 -2
- package/dist/field/lexical/utils/url.js.map +1 -1
- package/dist/forEachNodeRecursively.d.ts +10 -0
- package/dist/forEachNodeRecursively.d.ts.map +1 -0
- package/dist/forEachNodeRecursively.js +24 -0
- package/dist/forEachNodeRecursively.js.map +1 -0
- package/dist/generateComponentMap.d.ts.map +1 -1
- package/dist/generateComponentMap.js +21 -29
- package/dist/generateComponentMap.js.map +1 -1
- package/dist/generateSchemaMap.d.ts.map +1 -1
- package/dist/generateSchemaMap.js +4 -12
- package/dist/generateSchemaMap.js.map +1 -1
- package/dist/i18n.d.ts +3 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +164 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +25 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +296 -183
- package/dist/index.js.map +1 -1
- package/dist/populate/defaultValue.d.ts +0 -1
- package/dist/populate/defaultValue.d.ts.map +1 -1
- package/dist/populate/defaultValue.js +1 -19
- package/dist/populate/defaultValue.js.map +1 -1
- package/dist/populate/populate.d.ts +5 -4
- package/dist/populate/populate.d.ts.map +1 -1
- package/dist/populate/populate.js +13 -11
- package/dist/populate/populate.js.map +1 -1
- package/dist/populate/populateLexicalPopulationPromises.d.ts +12 -0
- package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -0
- package/dist/populate/populateLexicalPopulationPromises.js +36 -0
- package/dist/populate/populateLexicalPopulationPromises.js.map +1 -0
- package/dist/populate/recurseNestedFields.d.ts +8 -4
- package/dist/populate/recurseNestedFields.d.ts.map +1 -1
- package/dist/populate/recurseNestedFields.js +4 -5
- package/dist/populate/recurseNestedFields.js.map +1 -1
- package/dist/scss/app.scss +2 -3
- package/dist/scss/vars.scss +0 -7
- package/dist/types.d.ts +45 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/useLexicalFeature.d.ts.map +1 -1
- package/dist/useLexicalFeature.js +6 -1
- package/dist/useLexicalFeature.js.map +1 -1
- package/dist/validate/index.d.ts +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +3 -2
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/validateNodes.js +1 -1
- package/dist/validate/validateNodes.js.map +1 -1
- package/package.json +71 -51
- package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts +0 -3
- package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts.map +0 -1
- package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js +0 -12
- package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js.map +0 -1
- package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts +0 -3
- package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts.map +0 -1
- package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js +0 -10
- package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js.map +0 -1
- package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts +0 -3
- package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts.map +0 -1
- package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js +0 -12
- package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js.map +0 -1
- package/dist/field/features/debug/testrecorder/feature.client.d.ts.map +0 -1
- package/dist/field/features/debug/testrecorder/plugin/index.d.ts +0 -5
- package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +0 -1
- package/dist/field/features/debug/testrecorder/plugin/index.js.map +0 -1
- package/dist/field/features/debug/treeview/feature.client.d.ts.map +0 -1
- package/dist/field/features/debug/treeview/plugin/index.d.ts +0 -4
- package/dist/field/features/debug/treeview/plugin/index.d.ts.map +0 -1
- package/dist/field/features/debug/treeview/plugin/index.js.map +0 -1
- package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts +0 -3
- package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts.map +0 -1
- package/dist/field/features/format/common/floatingSelectToolbarSection.js +0 -10
- package/dist/field/features/format/common/floatingSelectToolbarSection.js.map +0 -1
- package/dist/field/features/format/inlinecode/feature.client.d.ts.map +0 -1
- package/dist/field/features/format/inlinecode/feature.client.js +0 -43
- package/dist/field/features/format/inlinecode/feature.client.js.map +0 -1
- package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts +0 -3
- package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts.map +0 -1
- package/dist/field/features/indent/floatingSelectToolbarIndentSection.js +0 -10
- package/dist/field/features/indent/floatingSelectToolbarIndentSection.js.map +0 -1
- package/dist/field/features/indent/index.scss +0 -4
- package/dist/field/features/lists/common/markdown.js.map +0 -1
- package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +0 -1
- package/dist/field/features/lists/orderedlist/feature.client.js +0 -72
- package/dist/field/features/lists/orderedlist/feature.client.js.map +0 -1
- package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +0 -1
- package/dist/field/features/lists/orderedlist/feature.server.js.map +0 -1
- package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +0 -1
- package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +0 -1
- package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +0 -1
- package/dist/field/features/lists/unorderedlist/feature.client.js +0 -72
- package/dist/field/features/lists/unorderedlist/feature.client.js.map +0 -1
- package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +0 -1
- package/dist/field/features/lists/unorderedlist/feature.server.js.map +0 -1
- package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +0 -1
- package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts +0 -8
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts +0 -17
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts +0 -18
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js +0 -42
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts +0 -6
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +0 -270
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts +0 -40
- package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts.map +0 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js.map +0 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +0 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +0 -1
- package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
- package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
- package/dist/populate/richTextRelationshipPromise.js +0 -68
- package/dist/populate/richTextRelationshipPromise.js.map +0 -1
- package/dist/scss/fonts.scss +0 -75
- package/src/index.ts +0 -423
- /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js +0 -0
- /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts +0 -0
- /package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.scss +0 -0
- /package/dist/field/features/debug/{treeview → treeView}/feature.client.js +0 -0
- /package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts +0 -0
- /package/dist/field/features/debug/{treeview → treeView}/plugin/index.scss +0 -0
- /package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts +0 -0
- /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts +0 -0
- /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js +0 -0
- /package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.d.ts +0 -0
- /package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.d.ts +0 -0
- /package/dist/field/features/lists/{common → shared}/markdown.d.ts +0 -0
- /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.d.ts +0 -0
- /package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.d.ts +0 -0
- /package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars}/types.js +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
|
|
2
4
|
import * as React from 'react';
|
|
3
|
-
import { createContext, useContext,
|
|
5
|
+
import { createContext, useContext, useMemo, useRef, useState } from 'react';
|
|
4
6
|
// Should always produce a 20 character pseudo-random string
|
|
5
7
|
function generateQuickGuid() {
|
|
6
8
|
return Math.random().toString(36).substring(2, 12) + Math.random().toString(36).substring(2, 12);
|
|
@@ -8,27 +10,75 @@ function generateQuickGuid() {
|
|
|
8
10
|
const Context = /*#__PURE__*/ createContext({
|
|
9
11
|
editorConfig: null,
|
|
10
12
|
field: null,
|
|
11
|
-
uuid:
|
|
13
|
+
uuid: null
|
|
12
14
|
});
|
|
13
|
-
export const EditorConfigProvider = ({ children, editorConfig, fieldProps })=>{
|
|
15
|
+
export const EditorConfigProvider = ({ children, editorConfig, editorContainerRef, fieldProps, parentContext })=>{
|
|
16
|
+
const [editor] = useLexicalComposerContext();
|
|
14
17
|
// State to store the UUID
|
|
15
|
-
const [uuid
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}, []);
|
|
18
|
+
const [uuid] = useState(generateQuickGuid());
|
|
19
|
+
const childrenEditors = useRef(new Map());
|
|
20
|
+
const [focusedEditor, setFocusedEditor] = useState(null);
|
|
21
|
+
const focusHistory = useRef(new Set());
|
|
20
22
|
const editorContext = useMemo(()=>({
|
|
23
|
+
blurEditor: (editorContext)=>{
|
|
24
|
+
//setFocusedEditor(null) // Clear focused editor
|
|
25
|
+
focusHistory.current.clear() // Reset focus history when focus is lost
|
|
26
|
+
;
|
|
27
|
+
},
|
|
28
|
+
childrenEditors,
|
|
29
|
+
editor,
|
|
21
30
|
editorConfig,
|
|
31
|
+
editorContainerRef,
|
|
22
32
|
field: fieldProps,
|
|
33
|
+
focusEditor: (editorContext)=>{
|
|
34
|
+
const editorUUID = editorContext.uuid;
|
|
35
|
+
// Avoid recursion by checking if this editor is already focused in this cycle
|
|
36
|
+
if (focusHistory.current.has(editorUUID)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
// Add this editor to the history to prevent future recursions in this cycle
|
|
40
|
+
focusHistory.current.add(editorUUID);
|
|
41
|
+
setFocusedEditor(editorContext);
|
|
42
|
+
// Propagate focus event to parent and children, ensuring they do not refocus this editor
|
|
43
|
+
if (parentContext?.uuid) {
|
|
44
|
+
parentContext.focusEditor(editorContext);
|
|
45
|
+
}
|
|
46
|
+
childrenEditors.current.forEach((childEditor, childUUID)=>{
|
|
47
|
+
childEditor.focusEditor(editorContext);
|
|
48
|
+
});
|
|
49
|
+
focusHistory.current.clear();
|
|
50
|
+
},
|
|
51
|
+
focusedEditor,
|
|
52
|
+
parentEditor: parentContext,
|
|
53
|
+
registerChild: (childUUID, childEditorContext)=>{
|
|
54
|
+
if (!childrenEditors.current.has(childUUID)) {
|
|
55
|
+
const newMap = new Map(childrenEditors.current);
|
|
56
|
+
newMap.set(childUUID, childEditorContext);
|
|
57
|
+
childrenEditors.current = newMap;
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
unregisterChild: (childUUID)=>{
|
|
61
|
+
if (childrenEditors.current.has(childUUID)) {
|
|
62
|
+
const newMap = new Map(childrenEditors.current);
|
|
63
|
+
newMap.delete(childUUID);
|
|
64
|
+
childrenEditors.current = newMap;
|
|
65
|
+
}
|
|
66
|
+
},
|
|
23
67
|
uuid
|
|
24
68
|
}), [
|
|
69
|
+
editor,
|
|
70
|
+
childrenEditors,
|
|
25
71
|
editorConfig,
|
|
72
|
+
editorContainerRef,
|
|
26
73
|
fieldProps,
|
|
74
|
+
focusedEditor,
|
|
75
|
+
parentContext,
|
|
27
76
|
uuid
|
|
28
77
|
]);
|
|
29
|
-
return /*#__PURE__*/
|
|
30
|
-
value: editorContext
|
|
31
|
-
|
|
78
|
+
return /*#__PURE__*/ _jsx(Context.Provider, {
|
|
79
|
+
value: editorContext,
|
|
80
|
+
children: children
|
|
81
|
+
});
|
|
32
82
|
};
|
|
33
83
|
export const useEditorConfigContext = ()=>{
|
|
34
84
|
const context = useContext(Context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/lexical/config/client/EditorConfigProvider.tsx"],"sourcesContent":["'use client'\n\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\n\nimport * as React from 'react'\nimport { createContext, useContext,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/lexical/config/client/EditorConfigProvider.tsx"],"sourcesContent":["'use client'\n\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport * as React from 'react'\nimport { createContext, useContext, useMemo, useRef, useState } from 'react'\n\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\n// Should always produce a 20 character pseudo-random string\nfunction generateQuickGuid(): string {\n return Math.random().toString(36).substring(2, 12) + Math.random().toString(36).substring(2, 12)\n}\n\nexport interface EditorConfigContextType {\n // Editor focus handling\n blurEditor: (editorContext: EditorConfigContextType) => void\n childrenEditors: React.RefObject<Map<string, EditorConfigContextType>>\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n field: FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n // Editor focus handling\n focusEditor: (editorContext: EditorConfigContextType) => void\n focusedEditor: EditorConfigContextType | null\n parentEditor: EditorConfigContextType\n registerChild: (uuid: string, editorContext: EditorConfigContextType) => void\n unregisterChild?: (uuid: string) => void\n uuid: string\n}\n\nconst Context: React.Context<EditorConfigContextType> = createContext({\n editorConfig: null,\n field: null,\n uuid: null,\n})\n\nexport const EditorConfigProvider = ({\n children,\n editorConfig,\n editorContainerRef,\n fieldProps,\n parentContext,\n}: {\n children: React.ReactNode\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n fieldProps: FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n parentContext?: EditorConfigContextType\n}): React.ReactNode => {\n const [editor] = useLexicalComposerContext()\n // State to store the UUID\n const [uuid] = useState(generateQuickGuid())\n\n const childrenEditors = useRef<Map<string, EditorConfigContextType>>(new Map())\n const [focusedEditor, setFocusedEditor] = useState<EditorConfigContextType | null>(null)\n const focusHistory = useRef<Set<string>>(new Set())\n\n const editorContext = useMemo(\n () =>\n ({\n blurEditor: (editorContext: EditorConfigContextType) => {\n //setFocusedEditor(null) // Clear focused editor\n focusHistory.current.clear() // Reset focus history when focus is lost\n },\n childrenEditors,\n editor,\n editorConfig,\n editorContainerRef,\n field: fieldProps,\n focusEditor: (editorContext: EditorConfigContextType) => {\n const editorUUID = editorContext.uuid\n\n // Avoid recursion by checking if this editor is already focused in this cycle\n if (focusHistory.current.has(editorUUID)) {\n return\n }\n\n // Add this editor to the history to prevent future recursions in this cycle\n focusHistory.current.add(editorUUID)\n setFocusedEditor(editorContext)\n\n // Propagate focus event to parent and children, ensuring they do not refocus this editor\n if (parentContext?.uuid) {\n parentContext.focusEditor(editorContext)\n }\n childrenEditors.current.forEach((childEditor, childUUID) => {\n childEditor.focusEditor(editorContext)\n })\n\n focusHistory.current.clear()\n },\n focusedEditor,\n parentEditor: parentContext,\n registerChild: (childUUID, childEditorContext) => {\n if (!childrenEditors.current.has(childUUID)) {\n const newMap = new Map(childrenEditors.current)\n newMap.set(childUUID, childEditorContext)\n childrenEditors.current = newMap\n }\n },\n unregisterChild: (childUUID) => {\n if (childrenEditors.current.has(childUUID)) {\n const newMap = new Map(childrenEditors.current)\n newMap.delete(childUUID)\n childrenEditors.current = newMap\n }\n },\n\n uuid,\n }) as EditorConfigContextType,\n [\n editor,\n childrenEditors,\n editorConfig,\n editorContainerRef,\n fieldProps,\n focusedEditor,\n parentContext,\n uuid,\n ],\n )\n\n return <Context.Provider value={editorContext}>{children}</Context.Provider>\n}\n\nexport const useEditorConfigContext = (): EditorConfigContextType => {\n const context = useContext(Context)\n if (context === undefined) {\n throw new Error('useEditorConfigContext must be used within an EditorConfigProvider')\n }\n return context\n}\n"],"names":["useLexicalComposerContext","React","createContext","useContext","useMemo","useRef","useState","generateQuickGuid","Math","random","toString","substring","Context","editorConfig","field","uuid","EditorConfigProvider","children","editorContainerRef","fieldProps","parentContext","editor","childrenEditors","Map","focusedEditor","setFocusedEditor","focusHistory","Set","editorContext","blurEditor","current","clear","focusEditor","editorUUID","has","add","forEach","childEditor","childUUID","parentEditor","registerChild","childEditorContext","newMap","set","unregisterChild","delete","Provider","value","useEditorConfigContext","context","undefined","Error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAK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D,YAAYL,WAAW,CAACJ;gBAC1B;gBAEAF,aAAaI,OAAO,CAACC,KAAK;YAC5B;YACAP;YACAe,cAAcnB;YACdoB,eAAe,CAACF,WAAWG;gBACzB,IAAI,CAACnB,gBAAgBQ,OAAO,CAACI,GAAG,CAACI,YAAY;oBAC3C,MAAMI,SAAS,IAAInB,IAAID,gBAAgBQ,OAAO;oBAC9CY,OAAOC,GAAG,CAACL,WAAWG;oBACtBnB,gBAAgBQ,OAAO,GAAGY;gBAC5B;YACF;YACAE,iBAAiB,CAACN;gBAChB,IAAIhB,gBAAgBQ,OAAO,CAACI,GAAG,CAACI,YAAY;oBAC1C,MAAMI,SAAS,IAAInB,IAAID,gBAAgBQ,OAAO;oBAC9CY,OAAOG,MAAM,CAACP;oBACdhB,gBAAgBQ,OAAO,GAAGY;gBAC5B;YACF;YAEA3B;QACF,CAAA,GACF;QACEM;QACAC;QACAT;QACAK;QACAC;QACAK;QACAJ;QACAL;KACD;IAGH,qBAAO,KAACH,QAAQkC,QAAQ;QAACC,OAAOnB;kBAAgBX;;AAClD,EAAC;AAED,OAAO,MAAM+B,yBAAyB;IACpC,MAAMC,UAAU9C,WAAWS;IAC3B,IAAIqC,YAAYC,WAAW;QACzB,MAAM,IAAIC,MAAM;IAClB;IACA,OAAOF;AACT,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/client/default.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/client/default.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAIlE,eAAO,MAAM,0BAA0B,EAAE,mBAGxC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/lexical/config/client/default.ts"],"sourcesContent":["'use client'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/lexical/config/client/default.ts"],"sourcesContent":["'use client'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport { LexicalEditorTheme } from '../../theme/EditorTheme.js'\n\nexport const defaultEditorLexicalConfig: LexicalEditorConfig = {\n namespace: 'lexical',\n theme: LexicalEditorTheme,\n}\n"],"names":["LexicalEditorTheme","defaultEditorLexicalConfig","namespace","theme"],"rangeMappings":";;;;;","mappings":"AAAA;AAGA,SAASA,kBAAkB,QAAQ,6BAA4B;AAE/D,OAAO,MAAMC,6BAAkD;IAC7DC,WAAW;IACXC,OAAOH;AACT,EAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { EditorConfig as LexicalEditorConfig } from 'lexical
|
|
1
|
+
import type { EditorConfig as LexicalEditorConfig } from 'lexical';
|
|
2
|
+
import type { LexicalFieldAdminProps } from '../../../../types.js';
|
|
2
3
|
import type { ResolvedClientFeatureMap, SanitizedClientFeatures } from '../../../features/types.js';
|
|
3
4
|
import type { SanitizedClientEditorConfig } from '../types.js';
|
|
4
5
|
export declare const sanitizeClientFeatures: (features: ResolvedClientFeatureMap) => SanitizedClientFeatures;
|
|
5
|
-
export declare function sanitizeClientEditorConfig(lexical: LexicalEditorConfig, resolvedClientFeatureMap: ResolvedClientFeatureMap): SanitizedClientEditorConfig;
|
|
6
|
+
export declare function sanitizeClientEditorConfig(lexical: LexicalEditorConfig, resolvedClientFeatureMap: ResolvedClientFeatureMap, admin?: LexicalFieldAdminProps): SanitizedClientEditorConfig;
|
|
6
7
|
//# sourceMappingURL=sanitize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/client/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/client/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACnG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE9D,eAAO,MAAM,sBAAsB,0CAEhC,uBAiMF,CAAA;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,mBAAmB,EAC5B,wBAAwB,EAAE,wBAAwB,EAClD,KAAK,CAAC,EAAE,sBAAsB,GAC7B,2BAA2B,CAO7B"}
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
export const sanitizeClientFeatures = (features)=>{
|
|
3
3
|
const sanitized = {
|
|
4
4
|
enabledFeatures: [],
|
|
5
|
-
floatingSelectToolbar: {
|
|
6
|
-
sections: []
|
|
7
|
-
},
|
|
8
5
|
hooks: {
|
|
9
6
|
load: [],
|
|
10
7
|
save: []
|
|
@@ -13,8 +10,14 @@ export const sanitizeClientFeatures = (features)=>{
|
|
|
13
10
|
nodes: [],
|
|
14
11
|
plugins: [],
|
|
15
12
|
slashMenu: {
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
dynamicGroups: [],
|
|
14
|
+
groups: []
|
|
15
|
+
},
|
|
16
|
+
toolbarFixed: {
|
|
17
|
+
groups: []
|
|
18
|
+
},
|
|
19
|
+
toolbarInline: {
|
|
20
|
+
groups: []
|
|
18
21
|
}
|
|
19
22
|
};
|
|
20
23
|
if (!features?.size) {
|
|
@@ -36,50 +39,70 @@ export const sanitizeClientFeatures = (features)=>{
|
|
|
36
39
|
feature.plugins.forEach((plugin, i)=>{
|
|
37
40
|
sanitized.plugins.push({
|
|
38
41
|
Component: plugin.Component,
|
|
42
|
+
clientProps: feature.clientFeatureProps,
|
|
39
43
|
key: feature.key + i,
|
|
40
44
|
position: plugin.position
|
|
41
45
|
});
|
|
42
46
|
});
|
|
43
47
|
}
|
|
44
|
-
if (feature.
|
|
45
|
-
for (const
|
|
46
|
-
// 1. find the
|
|
47
|
-
let
|
|
48
|
-
if (!
|
|
49
|
-
|
|
50
|
-
...
|
|
51
|
-
|
|
48
|
+
if (feature.toolbarInline?.groups?.length) {
|
|
49
|
+
for (const group of feature.toolbarInline.groups){
|
|
50
|
+
// 1. find the group with the same key or create new one
|
|
51
|
+
let foundGroup = sanitized.toolbarInline.groups.find((sanitizedGroup)=>sanitizedGroup.key === group.key);
|
|
52
|
+
if (!foundGroup) {
|
|
53
|
+
foundGroup = {
|
|
54
|
+
...group,
|
|
55
|
+
items: []
|
|
56
|
+
};
|
|
57
|
+
} else {
|
|
58
|
+
sanitized.toolbarInline.groups = sanitized.toolbarInline.groups.filter((sanitizedGroup)=>sanitizedGroup.key !== group.key);
|
|
59
|
+
}
|
|
60
|
+
// 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions
|
|
61
|
+
if (group?.items?.length) {
|
|
62
|
+
foundGroup.items = foundGroup.items.concat(group.items);
|
|
63
|
+
}
|
|
64
|
+
sanitized.toolbarInline?.groups.push(foundGroup);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (feature.toolbarFixed?.groups?.length) {
|
|
68
|
+
for (const group of feature.toolbarFixed.groups){
|
|
69
|
+
// 1. find the group with the same key or create new one
|
|
70
|
+
let foundGroup = sanitized.toolbarFixed.groups.find((sanitizedGroup)=>sanitizedGroup.key === group.key);
|
|
71
|
+
if (!foundGroup) {
|
|
72
|
+
foundGroup = {
|
|
73
|
+
...group,
|
|
74
|
+
items: []
|
|
52
75
|
};
|
|
53
76
|
} else {
|
|
54
|
-
sanitized.
|
|
77
|
+
sanitized.toolbarFixed.groups = sanitized.toolbarFixed.groups.filter((sanitizedGroup)=>sanitizedGroup.key !== group.key);
|
|
55
78
|
}
|
|
56
79
|
// 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions
|
|
57
|
-
if (
|
|
58
|
-
|
|
80
|
+
if (group?.items?.length) {
|
|
81
|
+
foundGroup.items = foundGroup.items.concat(group.items);
|
|
59
82
|
}
|
|
60
|
-
sanitized.
|
|
83
|
+
sanitized.toolbarFixed?.groups.push(foundGroup);
|
|
61
84
|
}
|
|
62
85
|
}
|
|
63
|
-
if (feature.slashMenu?.
|
|
64
|
-
if (feature.slashMenu.
|
|
65
|
-
sanitized.slashMenu.
|
|
86
|
+
if (feature.slashMenu?.groups) {
|
|
87
|
+
if (feature.slashMenu.dynamicGroups?.length) {
|
|
88
|
+
sanitized.slashMenu.dynamicGroups = sanitized.slashMenu.dynamicGroups.concat(feature.slashMenu.dynamicGroups);
|
|
66
89
|
}
|
|
67
|
-
for (const optionGroup of feature.slashMenu.
|
|
90
|
+
for (const optionGroup of feature.slashMenu.groups){
|
|
68
91
|
// 1. find the group with the same name or create new one
|
|
69
|
-
let group = sanitized.slashMenu.
|
|
92
|
+
let group = sanitized.slashMenu.groups.find((group)=>group.key === optionGroup.key);
|
|
70
93
|
if (!group) {
|
|
71
94
|
group = {
|
|
72
95
|
...optionGroup,
|
|
73
|
-
|
|
96
|
+
items: []
|
|
74
97
|
};
|
|
75
98
|
} else {
|
|
76
|
-
sanitized.slashMenu.
|
|
99
|
+
sanitized.slashMenu.groups = sanitized.slashMenu.groups.filter((group)=>group.key !== optionGroup.key);
|
|
77
100
|
}
|
|
78
101
|
// 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions
|
|
79
|
-
if (optionGroup?.
|
|
80
|
-
group.
|
|
102
|
+
if (optionGroup?.items?.length) {
|
|
103
|
+
group.items = group.items.concat(optionGroup.items);
|
|
81
104
|
}
|
|
82
|
-
sanitized.slashMenu.
|
|
105
|
+
sanitized.slashMenu.groups.push(group);
|
|
83
106
|
}
|
|
84
107
|
}
|
|
85
108
|
if (feature.markdownTransformers?.length) {
|
|
@@ -87,8 +110,8 @@ export const sanitizeClientFeatures = (features)=>{
|
|
|
87
110
|
}
|
|
88
111
|
sanitized.enabledFeatures.push(feature.key);
|
|
89
112
|
});
|
|
90
|
-
// Sort sanitized.
|
|
91
|
-
sanitized.
|
|
113
|
+
// Sort sanitized.toolbarInline.groups by order property
|
|
114
|
+
sanitized.toolbarInline.groups.sort((a, b)=>{
|
|
92
115
|
if (a.order && b.order) {
|
|
93
116
|
return a.order - b.order;
|
|
94
117
|
} else if (a.order) {
|
|
@@ -99,9 +122,35 @@ export const sanitizeClientFeatures = (features)=>{
|
|
|
99
122
|
return 0;
|
|
100
123
|
}
|
|
101
124
|
});
|
|
102
|
-
// Sort sanitized.
|
|
103
|
-
|
|
104
|
-
|
|
125
|
+
// Sort sanitized.toolbarFixed.groups by order property
|
|
126
|
+
sanitized.toolbarFixed.groups.sort((a, b)=>{
|
|
127
|
+
if (a.order && b.order) {
|
|
128
|
+
return a.order - b.order;
|
|
129
|
+
} else if (a.order) {
|
|
130
|
+
return -1;
|
|
131
|
+
} else if (b.order) {
|
|
132
|
+
return 1;
|
|
133
|
+
} else {
|
|
134
|
+
return 0;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
// Sort sanitized.toolbarInline.groups.[group].entries by order property
|
|
138
|
+
for (const group of sanitized.toolbarInline.groups){
|
|
139
|
+
group.items.sort((a, b)=>{
|
|
140
|
+
if (a.order && b.order) {
|
|
141
|
+
return a.order - b.order;
|
|
142
|
+
} else if (a.order) {
|
|
143
|
+
return -1;
|
|
144
|
+
} else if (b.order) {
|
|
145
|
+
return 1;
|
|
146
|
+
} else {
|
|
147
|
+
return 0;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
// Sort sanitized.toolbarFixed.groups.[group].entries by order property
|
|
152
|
+
for (const group of sanitized.toolbarFixed.groups){
|
|
153
|
+
group.items.sort((a, b)=>{
|
|
105
154
|
if (a.order && b.order) {
|
|
106
155
|
return a.order - b.order;
|
|
107
156
|
} else if (a.order) {
|
|
@@ -115,8 +164,9 @@ export const sanitizeClientFeatures = (features)=>{
|
|
|
115
164
|
}
|
|
116
165
|
return sanitized;
|
|
117
166
|
};
|
|
118
|
-
export function sanitizeClientEditorConfig(lexical, resolvedClientFeatureMap) {
|
|
167
|
+
export function sanitizeClientEditorConfig(lexical, resolvedClientFeatureMap, admin) {
|
|
119
168
|
return {
|
|
169
|
+
admin,
|
|
120
170
|
features: sanitizeClientFeatures(resolvedClientFeatureMap),
|
|
121
171
|
lexical,
|
|
122
172
|
resolvedFeatureMap: resolvedClientFeatureMap
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/lexical/config/client/sanitize.ts"],"sourcesContent":["'use client'\n\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js'\n\nimport type { ResolvedClientFeatureMap, SanitizedClientFeatures } from '../../../features/types.js'\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\nexport const sanitizeClientFeatures = (\n features: ResolvedClientFeatureMap,\n): SanitizedClientFeatures => {\n const sanitized: SanitizedClientFeatures = {\n enabledFeatures: [],\n floatingSelectToolbar: {\n sections: [],\n },\n hooks: {\n load: [],\n save: [],\n },\n markdownTransformers: [],\n nodes: [],\n plugins: [],\n slashMenu: {\n dynamicOptions: [],\n groupsWithOptions: [],\n },\n }\n\n if (!features?.size) {\n return sanitized\n }\n\n features.forEach((feature) => {\n if (feature.hooks) {\n if (feature.hooks?.load?.length) {\n sanitized.hooks.load = sanitized.hooks.load.concat(feature.hooks.load)\n }\n if (feature.hooks?.save?.length) {\n sanitized.hooks.save = sanitized.hooks.save.concat(feature.hooks.save)\n }\n }\n\n if (feature.nodes?.length) {\n sanitized.nodes = sanitized.nodes.concat(feature.nodes)\n }\n if (feature.plugins?.length) {\n feature.plugins.forEach((plugin, i) => {\n sanitized.plugins.push({\n Component: plugin.Component,\n key: feature.key + i,\n position: plugin.position,\n })\n })\n }\n\n if (feature.floatingSelectToolbar?.sections?.length) {\n for (const section of feature.floatingSelectToolbar.sections) {\n // 1. find the section with the same key or create new one\n let foundSection = sanitized.floatingSelectToolbar.sections.find(\n (sanitizedSection) => sanitizedSection.key === section.key,\n )\n if (!foundSection) {\n foundSection = {\n ...section,\n entries: [],\n }\n } else {\n sanitized.floatingSelectToolbar.sections =\n sanitized.floatingSelectToolbar.sections.filter(\n (sanitizedSection) => sanitizedSection.key !== section.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (section?.entries?.length) {\n foundSection.entries = foundSection.entries.concat(section.entries)\n }\n sanitized.floatingSelectToolbar?.sections.push(foundSection)\n }\n }\n\n if (feature.slashMenu?.options) {\n if (feature.slashMenu.dynamicOptions?.length) {\n sanitized.slashMenu.dynamicOptions = sanitized.slashMenu.dynamicOptions.concat(\n feature.slashMenu.dynamicOptions,\n )\n }\n\n for (const optionGroup of feature.slashMenu.options) {\n // 1. find the group with the same name or create new one\n let group = sanitized.slashMenu.groupsWithOptions.find(\n (group) => group.key === optionGroup.key,\n )\n if (!group) {\n group = {\n ...optionGroup,\n options: [],\n }\n } else {\n sanitized.slashMenu.groupsWithOptions = sanitized.slashMenu.groupsWithOptions.filter(\n (group) => group.key !== optionGroup.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (optionGroup?.options?.length) {\n group.options = group.options.concat(optionGroup.options)\n }\n sanitized.slashMenu.groupsWithOptions.push(group)\n }\n }\n\n if (feature.markdownTransformers?.length) {\n sanitized.markdownTransformers = sanitized.markdownTransformers.concat(\n feature.markdownTransformers,\n )\n }\n sanitized.enabledFeatures.push(feature.key)\n })\n\n // Sort sanitized.floatingSelectToolbar.sections by order property\n sanitized.floatingSelectToolbar.sections.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n\n // Sort sanitized.floatingSelectToolbar.sections.[section].entries by order property\n for (const section of sanitized.floatingSelectToolbar.sections) {\n section.entries.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n }\n\n return sanitized\n}\n\nexport function sanitizeClientEditorConfig(\n lexical: LexicalEditorConfig,\n resolvedClientFeatureMap: ResolvedClientFeatureMap,\n): SanitizedClientEditorConfig {\n return {\n features: sanitizeClientFeatures(resolvedClientFeatureMap),\n lexical,\n resolvedFeatureMap: resolvedClientFeatureMap,\n }\n}\n"],"names":["sanitizeClientFeatures","features","sanitized","enabledFeatures","floatingSelectToolbar","sections","hooks","load","save","markdownTransformers","nodes","plugins","slashMenu","dynamicOptions","groupsWithOptions","size","forEach","feature","length","concat","plugin","i","push","Component","key","position","section","foundSection","find","sanitizedSection","entries","filter","options","optionGroup","group","sort","a","b","order","sanitizeClientEditorConfig","lexical","resolvedClientFeatureMap","resolvedFeatureMap"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAOA,OAAO,MAAMA,yBAAyB,CACpCC;IAEA,MAAMC,YAAqC;QACzCC,iBAAiB,EAAE;QACnBC,uBAAuB;YACrBC,UAAU,EAAE;QACd;QACAC,OAAO;YACLC,MAAM,EAAE;YACRC,MAAM,EAAE;QACV;QACAC,sBAAsB,EAAE;QACxBC,OAAO,EAAE;QACTC,SAAS,EAAE;QACXC,WAAW;YACTC,gBAAgB,EAAE;YAClBC,mBAAmB,EAAE;QACvB;IACF;IAEA,IAAI,CAACb,UAAUc,MAAM;QACnB,OAAOb;IACT;IAEAD,SAASe,OAAO,CAAC,CAACC;QAChB,IA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;IAC5C;IAEA,kEAAkE;IAClEtB,UAAUE,qBAAqB,CAACC,QAAQ,CAAC8B,IAAI,CAAC,CAACC,GAAGC;QAChD,IAAID,EAAEE,KAAK,IAAID,EAAEC,KAAK,EAAE;YACtB,OAAOF,EAAEE,KAAK,GAAGD,EAAEC,KAAK;QAC1B,OAAO,IAAIF,EAAEE,KAAK,EAAE;YAClB,OAAO,CAAC;QACV,OAAO,IAAID,EAAEC,KAAK,EAAE;YAClB,OAAO;QACT,OAAO;YACL,OAAO;QACT;IACF;IAEA,oFAAoF;IACpF,KAAK,MAAMZ,WAAWxB,UAAUE,qBAAqB,CAACC,QAAQ,CAAE;QAC9DqB,QAAQI,OAAO,CAACK,IAAI,CAAC,CAACC,GAAGC;YACvB,IAAID,EAAEE,KAAK,IAAID,EAAEC,KAAK,EAAE;gBACtB,OAAOF,EAAEE,KAAK,GAAGD,EAAEC,KAAK;YAC1B,OAAO,IAAIF,EAAEE,KAAK,EAAE;gBAClB,OAAO,CAAC;YACV,OAAO,IAAID,EAAEC,KAAK,EAAE;gBAClB,OAAO;YACT,OAAO;gBACL,OAAO;YACT;QACF;IACF;IAEA,OAAOpC;AACT,EAAC;AAED,OAAO,SAASqC,2BACdC,OAA4B,EAC5BC,wBAAkD;IAElD,OAAO;QACLxC,UAAUD,uBAAuByC;QACjCD;QACAE,oBAAoBD;IACtB;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/lexical/config/client/sanitize.ts"],"sourcesContent":["'use client'\n\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport type { LexicalFieldAdminProps } from '../../../../types.js'\nimport type { ResolvedClientFeatureMap, SanitizedClientFeatures } from '../../../features/types.js'\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\nexport const sanitizeClientFeatures = (\n features: ResolvedClientFeatureMap,\n): SanitizedClientFeatures => {\n const sanitized: SanitizedClientFeatures = {\n enabledFeatures: [],\n hooks: {\n load: [],\n save: [],\n },\n markdownTransformers: [],\n nodes: [],\n plugins: [],\n slashMenu: {\n dynamicGroups: [],\n groups: [],\n },\n toolbarFixed: {\n groups: [],\n },\n toolbarInline: {\n groups: [],\n },\n }\n\n if (!features?.size) {\n return sanitized\n }\n\n features.forEach((feature) => {\n if (feature.hooks) {\n if (feature.hooks?.load?.length) {\n sanitized.hooks.load = sanitized.hooks.load.concat(feature.hooks.load)\n }\n if (feature.hooks?.save?.length) {\n sanitized.hooks.save = sanitized.hooks.save.concat(feature.hooks.save)\n }\n }\n\n if (feature.nodes?.length) {\n sanitized.nodes = sanitized.nodes.concat(feature.nodes)\n }\n if (feature.plugins?.length) {\n feature.plugins.forEach((plugin, i) => {\n sanitized.plugins.push({\n Component: plugin.Component,\n clientProps: feature.clientFeatureProps,\n key: feature.key + i,\n position: plugin.position,\n })\n })\n }\n\n if (feature.toolbarInline?.groups?.length) {\n for (const group of feature.toolbarInline.groups) {\n // 1. find the group with the same key or create new one\n let foundGroup = sanitized.toolbarInline.groups.find(\n (sanitizedGroup) => sanitizedGroup.key === group.key,\n )\n if (!foundGroup) {\n foundGroup = {\n ...group,\n items: [],\n }\n } else {\n sanitized.toolbarInline.groups = sanitized.toolbarInline.groups.filter(\n (sanitizedGroup) => sanitizedGroup.key !== group.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (group?.items?.length) {\n foundGroup.items = foundGroup.items.concat(group.items)\n }\n sanitized.toolbarInline?.groups.push(foundGroup)\n }\n }\n\n if (feature.toolbarFixed?.groups?.length) {\n for (const group of feature.toolbarFixed.groups) {\n // 1. find the group with the same key or create new one\n let foundGroup = sanitized.toolbarFixed.groups.find(\n (sanitizedGroup) => sanitizedGroup.key === group.key,\n )\n if (!foundGroup) {\n foundGroup = {\n ...group,\n items: [],\n }\n } else {\n sanitized.toolbarFixed.groups = sanitized.toolbarFixed.groups.filter(\n (sanitizedGroup) => sanitizedGroup.key !== group.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (group?.items?.length) {\n foundGroup.items = foundGroup.items.concat(group.items)\n }\n sanitized.toolbarFixed?.groups.push(foundGroup)\n }\n }\n\n if (feature.slashMenu?.groups) {\n if (feature.slashMenu.dynamicGroups?.length) {\n sanitized.slashMenu.dynamicGroups = sanitized.slashMenu.dynamicGroups.concat(\n feature.slashMenu.dynamicGroups,\n )\n }\n\n for (const optionGroup of feature.slashMenu.groups) {\n // 1. find the group with the same name or create new one\n let group = sanitized.slashMenu.groups.find((group) => group.key === optionGroup.key)\n if (!group) {\n group = {\n ...optionGroup,\n items: [],\n }\n } else {\n sanitized.slashMenu.groups = sanitized.slashMenu.groups.filter(\n (group) => group.key !== optionGroup.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (optionGroup?.items?.length) {\n group.items = group.items.concat(optionGroup.items)\n }\n sanitized.slashMenu.groups.push(group)\n }\n }\n\n if (feature.markdownTransformers?.length) {\n sanitized.markdownTransformers = sanitized.markdownTransformers.concat(\n feature.markdownTransformers,\n )\n }\n sanitized.enabledFeatures.push(feature.key)\n })\n\n // Sort sanitized.toolbarInline.groups by order property\n sanitized.toolbarInline.groups.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n // Sort sanitized.toolbarFixed.groups by order property\n sanitized.toolbarFixed.groups.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n\n // Sort sanitized.toolbarInline.groups.[group].entries by order property\n for (const group of sanitized.toolbarInline.groups) {\n group.items.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n }\n\n // Sort sanitized.toolbarFixed.groups.[group].entries by order property\n for (const group of sanitized.toolbarFixed.groups) {\n group.items.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n }\n\n return sanitized\n}\n\nexport function sanitizeClientEditorConfig(\n lexical: LexicalEditorConfig,\n resolvedClientFeatureMap: ResolvedClientFeatureMap,\n admin?: LexicalFieldAdminProps,\n): SanitizedClientEditorConfig {\n return {\n admin,\n features: sanitizeClientFeatures(resolvedClientFeatureMap),\n lexical,\n resolvedFeatureMap: resolvedClientFeatureMap,\n }\n}\n"],"names":["sanitizeClientFeatures","features","sanitized","enabledFeatures","hooks","load","save","markdownTransformers","nodes","plugins","slashMenu","dynamicGroups","groups","toolbarFixed","toolbarInline","size","forEach","feature","length","concat","plugin","i","push","Component","clientProps","clientFeatureProps","key","position","group","foundGroup","find","sanitizedGroup","items","filter","optionGroup","sort","a","b","order","sanitizeClientEditorConfig","lexical","resolvedClientFeatureMap","admin","resolvedFeatureMap"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAQA,OAAO,MAAMA,yBAAyB,CACpCC;IAEA,MAAMC,YAAqC;QACzCC,iBAAiB,EAAE;QACnBC,OAAO;YACLC,MAAM,EAAE;YACRC,MAAM,EAAE;QACV;QACAC,sBAAsB,EAAE;QACxBC,OAAO,EAAE;QACTC,SAAS,EAAE;QACXC,WAAW;YACTC,eAAe,EAAE;YACjBC,QAAQ,EAAE;QACZ;QACAC,cAAc;YACZD,QAAQ,EAAE;QACZ;QACAE,eAAe;YACbF,QAAQ,EAAE;QACZ;IACF;IAEA,IAAI,CAACX,UAAUc,MAAM;QACnB,OAAOb;IACT;IAEAD,SAASe,OAAO,CAAC,CAACC;QAChB,IAAIA,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ID,EAAEC,KAAK,EAAE;YAClB,OAAO;QACT,OAAO;YACL,OAAO;QACT;IACF;IAEA,wEAAwE;IACxE,KAAK,MAAMV,SAAS1B,UAAUY,aAAa,CAACF,MAAM,CAAE;QAClDgB,MAAMI,KAAK,CAACG,IAAI,CAAC,CAACC,GAAGC;YACnB,IAAID,EAAEE,KAAK,IAAID,EAAEC,KAAK,EAAE;gBACtB,OAAOF,EAAEE,KAAK,GAAGD,EAAEC,KAAK;YAC1B,OAAO,IAAIF,EAAEE,KAAK,EAAE;gBAClB,OAAO,CAAC;YACV,OAAO,IAAID,EAAEC,KAAK,EAAE;gBAClB,OAAO;YACT,OAAO;gBACL,OAAO;YACT;QACF;IACF;IAEA,uEAAuE;IACvE,KAAK,MAAMV,SAAS1B,UAAUW,YAAY,CAACD,MAAM,CAAE;QACjDgB,MAAMI,KAAK,CAACG,IAAI,CAAC,CAACC,GAAGC;YACnB,IAAID,EAAEE,KAAK,IAAID,EAAEC,KAAK,EAAE;gBACtB,OAAOF,EAAEE,KAAK,GAAGD,EAAEC,KAAK;YAC1B,OAAO,IAAIF,EAAEE,KAAK,EAAE;gBAClB,OAAO,CAAC;YACV,OAAO,IAAID,EAAEC,KAAK,EAAE;gBAClB,OAAO;YACT,OAAO;gBACL,OAAO;YACT;QACF;IACF;IAEA,OAAOpC;AACT,EAAC;AAED,OAAO,SAASqC,2BACdC,OAA4B,EAC5BC,wBAAkD,EAClDC,KAA8B;IAE9B,OAAO;QACLA;QACAzC,UAAUD,uBAAuByC;QACjCD;QACAG,oBAAoBF;IACtB;AACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { EditorConfig as LexicalEditorConfig } from 'lexical
|
|
1
|
+
import type { EditorConfig as LexicalEditorConfig } from 'lexical';
|
|
2
2
|
import type { FeatureProviderServer } from '../../../features/types.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ServerEditorConfig } from '../types.js';
|
|
4
4
|
export declare const defaultEditorLexicalConfig: LexicalEditorConfig;
|
|
5
5
|
export declare const defaultEditorFeatures: FeatureProviderServer<unknown, unknown>[];
|
|
6
6
|
export declare const defaultEditorConfig: ServerEditorConfig;
|
|
7
|
-
export declare const defaultSanitizedServerEditorConfig: SanitizedServerEditorConfig;
|
|
8
7
|
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/default.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/default.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAwBrD,eAAO,MAAM,0BAA0B,EAAE,mBAGxC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAqB1E,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,kBAGjC,CAAA"}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { AlignFeature } from '../../../features/align/feature.server.js';
|
|
2
|
-
import {
|
|
2
|
+
import { BlockquoteFeature } from '../../../features/blockquote/feature.server.js';
|
|
3
3
|
import { BoldFeature } from '../../../features/format/bold/feature.server.js';
|
|
4
|
-
import { InlineCodeFeature } from '../../../features/format/
|
|
4
|
+
import { InlineCodeFeature } from '../../../features/format/inlineCode/feature.server.js';
|
|
5
5
|
import { ItalicFeature } from '../../../features/format/italic/feature.server.js';
|
|
6
6
|
import { StrikethroughFeature } from '../../../features/format/strikethrough/feature.server.js';
|
|
7
7
|
import { SubscriptFeature } from '../../../features/format/subscript/feature.server.js';
|
|
8
8
|
import { SuperscriptFeature } from '../../../features/format/superscript/feature.server.js';
|
|
9
9
|
import { UnderlineFeature } from '../../../features/format/underline/feature.server.js';
|
|
10
10
|
import { HeadingFeature } from '../../../features/heading/feature.server.js';
|
|
11
|
+
import { HorizontalRuleFeature } from '../../../features/horizontalRule/feature.server.js';
|
|
11
12
|
import { IndentFeature } from '../../../features/indent/feature.server.js';
|
|
12
13
|
import { LinkFeature } from '../../../features/link/feature.server.js';
|
|
13
|
-
import {
|
|
14
|
-
import { OrderedListFeature } from '../../../features/lists/
|
|
15
|
-
import { UnorderedListFeature } from '../../../features/lists/
|
|
14
|
+
import { ChecklistFeature } from '../../../features/lists/checklist/feature.server.js';
|
|
15
|
+
import { OrderedListFeature } from '../../../features/lists/orderedList/feature.server.js';
|
|
16
|
+
import { UnorderedListFeature } from '../../../features/lists/unorderedList/feature.server.js';
|
|
16
17
|
import { ParagraphFeature } from '../../../features/paragraph/feature.server.js';
|
|
17
18
|
import { RelationshipFeature } from '../../../features/relationship/feature.server.js';
|
|
19
|
+
import { InlineToolbarFeature } from '../../../features/toolbars/inline/feature.server.js';
|
|
18
20
|
import { UploadFeature } from '../../../features/upload/feature.server.js';
|
|
19
21
|
import { LexicalEditorTheme } from '../../theme/EditorTheme.js';
|
|
20
|
-
import { sanitizeServerEditorConfig } from './sanitize.js';
|
|
21
22
|
export const defaultEditorLexicalConfig = {
|
|
22
23
|
namespace: 'lexical',
|
|
23
24
|
theme: LexicalEditorTheme
|
|
@@ -36,16 +37,17 @@ export const defaultEditorFeatures = [
|
|
|
36
37
|
IndentFeature(),
|
|
37
38
|
UnorderedListFeature(),
|
|
38
39
|
OrderedListFeature(),
|
|
39
|
-
|
|
40
|
+
ChecklistFeature(),
|
|
40
41
|
LinkFeature(),
|
|
41
42
|
RelationshipFeature(),
|
|
42
|
-
|
|
43
|
-
UploadFeature()
|
|
43
|
+
BlockquoteFeature(),
|
|
44
|
+
UploadFeature(),
|
|
45
|
+
HorizontalRuleFeature(),
|
|
46
|
+
InlineToolbarFeature()
|
|
44
47
|
];
|
|
45
48
|
export const defaultEditorConfig = {
|
|
46
49
|
features: defaultEditorFeatures,
|
|
47
50
|
lexical: defaultEditorLexicalConfig
|
|
48
51
|
};
|
|
49
|
-
export const defaultSanitizedServerEditorConfig = sanitizeServerEditorConfig(defaultEditorConfig);
|
|
50
52
|
|
|
51
53
|
//# sourceMappingURL=default.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/lexical/config/server/default.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/lexical/config/server/default.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport type { FeatureProviderServer } from '../../../features/types.js'\nimport type { ServerEditorConfig } from '../types.js'\n\nimport { AlignFeature } from '../../../features/align/feature.server.js'\nimport { BlockquoteFeature } from '../../../features/blockquote/feature.server.js'\nimport { BoldFeature } from '../../../features/format/bold/feature.server.js'\nimport { InlineCodeFeature } from '../../../features/format/inlineCode/feature.server.js'\nimport { ItalicFeature } from '../../../features/format/italic/feature.server.js'\nimport { StrikethroughFeature } from '../../../features/format/strikethrough/feature.server.js'\nimport { SubscriptFeature } from '../../../features/format/subscript/feature.server.js'\nimport { SuperscriptFeature } from '../../../features/format/superscript/feature.server.js'\nimport { UnderlineFeature } from '../../../features/format/underline/feature.server.js'\nimport { HeadingFeature } from '../../../features/heading/feature.server.js'\nimport { HorizontalRuleFeature } from '../../../features/horizontalRule/feature.server.js'\nimport { IndentFeature } from '../../../features/indent/feature.server.js'\nimport { LinkFeature } from '../../../features/link/feature.server.js'\nimport { ChecklistFeature } from '../../../features/lists/checklist/feature.server.js'\nimport { OrderedListFeature } from '../../../features/lists/orderedList/feature.server.js'\nimport { UnorderedListFeature } from '../../../features/lists/unorderedList/feature.server.js'\nimport { ParagraphFeature } from '../../../features/paragraph/feature.server.js'\nimport { RelationshipFeature } from '../../../features/relationship/feature.server.js'\nimport { InlineToolbarFeature } from '../../../features/toolbars/inline/feature.server.js'\nimport { UploadFeature } from '../../../features/upload/feature.server.js'\nimport { LexicalEditorTheme } from '../../theme/EditorTheme.js'\n\nexport const defaultEditorLexicalConfig: LexicalEditorConfig = {\n namespace: 'lexical',\n theme: LexicalEditorTheme,\n}\n\nexport const defaultEditorFeatures: FeatureProviderServer<unknown, unknown>[] = [\n BoldFeature(),\n ItalicFeature(),\n UnderlineFeature(),\n StrikethroughFeature(),\n SubscriptFeature(),\n SuperscriptFeature(),\n InlineCodeFeature(),\n ParagraphFeature(),\n HeadingFeature(),\n AlignFeature(),\n IndentFeature(),\n UnorderedListFeature(),\n OrderedListFeature(),\n ChecklistFeature(),\n LinkFeature(),\n RelationshipFeature(),\n BlockquoteFeature(),\n UploadFeature(),\n HorizontalRuleFeature(),\n InlineToolbarFeature(),\n]\n\nexport const defaultEditorConfig: ServerEditorConfig = {\n features: defaultEditorFeatures,\n lexical: defaultEditorLexicalConfig,\n}\n"],"names":["AlignFeature","BlockquoteFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","InlineToolbarFeature","UploadFeature","LexicalEditorTheme","defaultEditorLexicalConfig","namespace","theme","defaultEditorFeatures","defaultEditorConfig","features","lexical"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,SAASA,YAAY,QAAQ,4CAA2C;AACxE,SAASC,iBAAiB,QAAQ,iDAAgD;AAClF,SAASC,WAAW,QAAQ,kDAAiD;AAC7E,SAASC,iBAAiB,QAAQ,wDAAuD;AACzF,SAASC,aAAa,QAAQ,oDAAmD;AACjF,SAASC,oBAAoB,QAAQ,2DAA0D;AAC/F,SAASC,gBAAgB,QAAQ,uDAAsD;AACvF,SAASC,kBAAkB,QAAQ,yDAAwD;AAC3F,SAASC,gBAAgB,QAAQ,uDAAsD;AACvF,SAASC,cAAc,QAAQ,8CAA6C;AAC5E,SAASC,qBAAqB,QAAQ,qDAAoD;AAC1F,SAASC,aAAa,QAAQ,6CAA4C;AAC1E,SAASC,WAAW,QAAQ,2CAA0C;AACtE,SAASC,gBAAgB,QAAQ,sDAAqD;AACtF,SAASC,kBAAkB,QAAQ,wDAAuD;AAC1F,SAASC,oBAAoB,QAAQ,0DAAyD;AAC9F,SAASC,gBAAgB,QAAQ,gDAA+C;AAChF,SAASC,mBAAmB,QAAQ,mDAAkD;AACtF,SAASC,oBAAoB,QAAQ,sDAAqD;AAC1F,SAASC,aAAa,QAAQ,6CAA4C;AAC1E,SAASC,kBAAkB,QAAQ,6BAA4B;AAE/D,OAAO,MAAMC,6BAAkD;IAC7DC,WAAW;IACXC,OAAOH;AACT,EAAC;AAED,OAAO,MAAMI,wBAAmE;IAC9EtB;IACAE;IACAI;IACAH;IACAC;IACAC;IACAJ;IACAa;IACAP;IACAT;IACAW;IACAI;IACAD;IACAD;IACAD;IACAK;IACAhB;IACAkB;IACAT;IACAQ;CACD,CAAA;AAED,OAAO,MAAMO,sBAA0C;IACrDC,UAAUF;IACVG,SAASN;AACX,EAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type { SanitizedConfig } from 'payload/config';
|
|
1
2
|
import type { FeatureProviderServer, ResolvedServerFeatureMap } from '../../../features/types.js';
|
|
2
3
|
import type { ServerEditorConfig } from '../types.js';
|
|
3
4
|
export declare function sortFeaturesForOptimalLoading(featureProviders: FeatureProviderServer<unknown, unknown>[]): FeatureProviderServer<unknown, unknown>[];
|
|
4
|
-
export declare function loadFeatures({ unSanitizedEditorConfig, }: {
|
|
5
|
+
export declare function loadFeatures({ config, isRoot, unSanitizedEditorConfig, }: {
|
|
6
|
+
config: SanitizedConfig;
|
|
7
|
+
isRoot?: boolean;
|
|
5
8
|
unSanitizedEditorConfig: ServerEditorConfig;
|
|
6
|
-
}): ResolvedServerFeatureMap
|
|
9
|
+
}): Promise<ResolvedServerFeatureMap>;
|
|
7
10
|
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EAEzB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AA8FrD,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,GAC1D,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAE3C;AAED,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EAEzB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AA8FrD,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,GAC1D,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAE3C;AAED,wBAAsB,YAAY,CAAC,EACjC,MAAM,EACN,MAAM,EACN,uBAAuB,GACxB,EAAE;IACD,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,uBAAuB,EAAE,kBAAkB,CAAA;CAC5C,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAgFpC"}
|
|
@@ -57,7 +57,7 @@ function visit(graph, key, visited, stack, currentPath = []) {
|
|
|
57
57
|
export function sortFeaturesForOptimalLoading(featureProviders) {
|
|
58
58
|
return topologicallySortFeatures(featureProviders);
|
|
59
59
|
}
|
|
60
|
-
export function loadFeatures({ unSanitizedEditorConfig }) {
|
|
60
|
+
export async function loadFeatures({ config, isRoot, unSanitizedEditorConfig }) {
|
|
61
61
|
// First remove all duplicate features. The LAST feature with a given key wins.
|
|
62
62
|
unSanitizedEditorConfig.features = unSanitizedEditorConfig.features.reverse().filter((f, i, arr)=>{
|
|
63
63
|
const firstIndex = arr.findIndex((f2)=>f2.key === f.key);
|
|
@@ -97,8 +97,10 @@ export function loadFeatures({ unSanitizedEditorConfig }) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
const feature = featureProvider.feature({
|
|
100
|
+
const feature = await featureProvider.feature({
|
|
101
|
+
config,
|
|
101
102
|
featureProviderMap,
|
|
103
|
+
isRoot,
|
|
102
104
|
resolvedFeatures,
|
|
103
105
|
unSanitizedEditorConfig
|
|
104
106
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/lexical/config/server/loader.ts"],"sourcesContent":["import type {\n FeatureProviderServer,\n ResolvedServerFeatureMap,\n ServerFeatureProviderMap,\n} from '../../../features/types.js'\nimport type { ServerEditorConfig } from '../types.js'\n\ntype DependencyGraph = {\n [key: string]: {\n dependencies: string[]\n dependenciesPriority: string[]\n dependenciesSoft: string[]\n featureProvider: FeatureProviderServer<unknown, unknown>\n }\n}\n\nfunction createDependencyGraph(\n featureProviders: FeatureProviderServer<unknown, unknown>[],\n): DependencyGraph {\n const graph: DependencyGraph = {}\n for (const fp of featureProviders) {\n graph[fp.key] = {\n dependencies: fp.dependencies || [],\n dependenciesPriority: fp.dependenciesPriority || [],\n dependenciesSoft: fp.dependenciesSoft || [],\n featureProvider: fp,\n }\n }\n return graph\n}\n\nfunction topologicallySortFeatures(\n featureProviders: FeatureProviderServer<unknown, unknown>[],\n): FeatureProviderServer<unknown, unknown>[] {\n const graph = createDependencyGraph(featureProviders)\n const visited: { [key: string]: boolean } = {}\n const stack: FeatureProviderServer<unknown, unknown>[] = []\n\n for (const key in graph) {\n if (!visited[key]) {\n visit(graph, key, visited, stack)\n }\n }\n\n return stack.reverse()\n}\n\nfunction visit(\n graph: DependencyGraph,\n key: string,\n visited: { [key: string]: boolean },\n stack: FeatureProviderServer<unknown, unknown>[],\n currentPath: string[] = [],\n) {\n if (!graph[key]) {\n throw new Error(`Feature key ${key} is not present in the dependency graph.`)\n }\n\n if (currentPath.includes(key)) {\n throw new Error(`Circular dependency detected: ${currentPath.join(' -> ')} -> ${key}`)\n }\n\n if (visited[key]) {\n return\n }\n\n visited[key] = true\n currentPath.push(key)\n\n // First process the hard priority dependencies\n for (const dep of graph[key].dependenciesPriority) {\n if (!visited[dep]) {\n visit(graph, dep, visited, stack, currentPath)\n }\n }\n\n // Then process the normal dependencies, but make sure to not violate hard dependencies\n for (const dep of graph[key].dependencies) {\n if (!visited[dep] && !graph[key].dependenciesPriority.includes(dep)) {\n visit(graph, dep, visited, stack, currentPath)\n }\n }\n\n // Then process the soft dependencies. Make sure to not violate hard and normal dependencies.\n for (const dep of graph[key].dependenciesSoft) {\n if (\n graph[dep] &&\n !visited[dep] &&\n !graph[key].dependenciesPriority.includes(dep) &&\n !graph[key].dependencies.includes(dep)\n ) {\n visit(graph, dep, visited, stack, currentPath)\n }\n }\n\n stack.push(graph[key].featureProvider)\n currentPath.pop()\n}\n\nexport function sortFeaturesForOptimalLoading(\n featureProviders: FeatureProviderServer<unknown, unknown>[],\n): FeatureProviderServer<unknown, unknown>[] {\n return topologicallySortFeatures(featureProviders)\n}\n\nexport function loadFeatures({\n unSanitizedEditorConfig,\n}: {\n unSanitizedEditorConfig: ServerEditorConfig\n}): ResolvedServerFeatureMap {\n // First remove all duplicate features. The LAST feature with a given key wins.\n unSanitizedEditorConfig.features = unSanitizedEditorConfig.features\n .reverse()\n .filter((f, i, arr) => {\n const firstIndex = arr.findIndex((f2) => f2.key === f.key)\n return firstIndex === i\n })\n .reverse()\n\n unSanitizedEditorConfig.features = sortFeaturesForOptimalLoading(unSanitizedEditorConfig.features)\n\n const featureProviderMap: ServerFeatureProviderMap = new Map(\n unSanitizedEditorConfig.features.map(\n (f) => [f.key, f] as [string, FeatureProviderServer<unknown, unknown>],\n ),\n )\n\n const resolvedFeatures: ResolvedServerFeatureMap = new Map()\n\n // Make sure all dependencies declared in the respective features exist\n let loaded = 0\n for (const featureProvider of unSanitizedEditorConfig.features) {\n if (!featureProvider.key) {\n throw new Error(\n `A Feature you've added does not have a key. Please add a key to the feature. This is used to uniquely identify the feature.`,\n )\n }\n if (featureProvider.dependencies?.length) {\n for (const dependencyKey of featureProvider.dependencies) {\n const found = unSanitizedEditorConfig.features.find((f) => f.key === dependencyKey)\n if (!found) {\n throw new Error(\n `Feature ${featureProvider.key} has a dependency ${dependencyKey} which does not exist.`,\n )\n }\n }\n }\n\n if (featureProvider.dependenciesPriority?.length) {\n for (const priorityDependencyKey of featureProvider.dependenciesPriority) {\n // look in the resolved features instead of the editorConfig.features, as a dependency requires the feature to be loaded before it, contrary to a soft-dependency\n const found = resolvedFeatures.get(priorityDependencyKey)\n if (!found) {\n const existsInEditorConfig = unSanitizedEditorConfig.features.find(\n (f) => f.key === priorityDependencyKey,\n )\n if (!existsInEditorConfig) {\n throw new Error(\n `Feature ${featureProvider.key} has a priority dependency ${priorityDependencyKey} which does not exist.`,\n )\n } else {\n throw new Error(\n `Feature ${featureProvider.key} has a priority dependency ${priorityDependencyKey} which is not loaded before it.`,\n )\n }\n }\n }\n }\n\n const feature = featureProvider.feature({\n featureProviderMap,\n resolvedFeatures,\n unSanitizedEditorConfig,\n })\n resolvedFeatures.set(featureProvider.key, {\n ...feature,\n dependencies: featureProvider.dependencies,\n dependenciesPriority: featureProvider.dependenciesPriority,\n dependenciesSoft: featureProvider.dependenciesSoft,\n key: featureProvider.key,\n order: loaded,\n })\n\n loaded++\n }\n\n return resolvedFeatures\n}\n"],"names":["createDependencyGraph","featureProviders","graph","fp","key","dependencies","dependenciesPriority","dependenciesSoft","featureProvider","topologicallySortFeatures","visited","stack","visit","reverse","currentPath","Error","includes","join","push","dep","pop","sortFeaturesForOptimalLoading","loadFeatures","unSanitizedEditorConfig","features","filter","f","i","arr","firstIndex","findIndex","f2","featureProviderMap","Map","map","resolvedFeatures","loaded","length","dependencyKey","found","find","priorityDependencyKey","get","existsInEditorConfig","feature","set","order"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAgBA,SAASA,sBACPC,gBAA2D;IAE3D,MAAMC,QAAyB,CAAC;IAChC,KAAK,MAAMC,MAAMF,iBAAkB;QACjCC,KAAK,CAACC,GAAGC,GAAG,CAAC,GAAG;YACdC,cAAcF,GAAGE,YAAY,IAAI,EAAE;YACnCC,sBAAsBH,GAAGG,oBAAoB,IAAI,EAAE;YACnDC,kBAAkBJ,GAAGI,gBAAgB,IAAI,EAAE;YAC3CC,iBAAiBL;QACnB;IACF;IACA,OAAOD;AACT;AAEA,SAASO,0BACPR,gBAA2D;IAE3D,MAAMC,QAAQF,sBAAsBC;IACpC,MAAMS,UAAsC,CAAC;IAC7C,MAAMC,QAAmD,EAAE;IAE3D,IAAK,MAAMP,OAAOF,MAAO;QACvB,IAAI,CAACQ,OAAO,CAACN,IAAI,EAAE;YACjBQ,MAAMV,OAAOE,KAAKM,SAASC;QAC7B;IACF;IAEA,OAAOA,MAAME,OAAO;AACtB;AAEA,SAASD,MACPV,KAAsB,EACtBE,GAAW,EACXM,OAAmC,EACnCC,KAAgD,EAChDG,cAAwB,EAAE;IAE1B,IAAI,CAACZ,KAAK,CAACE,IAAI,EAAE;QACf,MAAM,IAAIW,M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I,CAChE,CAACd,IAAMA,EAAEtB,GAAG,KAAKqC;oBAEnB,IAAI,CAACE,sBAAsB;wBACzB,MAAM,IAAI5B,MACR,CAAC,QAAQ,EAAEP,gBAAgBJ,GAAG,CAAC,2BAA2B,EAAEqC,sBAAsB,sBAAsB,CAAC;oBAE7G,OAAO;wBACL,MAAM,IAAI1B,MACR,CAAC,QAAQ,EAAEP,gBAAgBJ,GAAG,CAAC,2BAA2B,EAAEqC,sBAAsB,+BAA+B,CAAC;oBAEtH;gBACF;YACF;QACF;QAEA,MAAMG,UAAUpC,gBAAgBoC,OAAO,CAAC;YACtCZ;YACAG;YACAZ;QACF;QACAY,iBAAiBU,GAAG,CAACrC,gBAAgBJ,GAAG,EAAE;YACxC,GAAGwC,OAAO;YACVvC,cAAcG,gBAAgBH,YAAY;YAC1CC,sBAAsBE,gBAAgBF,oBAAoB;YAC1DC,kBAAkBC,gBAAgBD,gBAAgB;YAClDH,KAAKI,gBAAgBJ,GAAG;YACxB0C,OAAOV;QACT;QAEAA;IACF;IAEA,OAAOD;AACT"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/lexical/config/server/loader.ts"],"sourcesContent":["import type { Config, SanitizedConfig } from 'payload/config'\n\nimport type {\n FeatureProviderServer,\n ResolvedServerFeatureMap,\n ServerFeatureProviderMap,\n} from '../../../features/types.js'\nimport type { ServerEditorConfig } from '../types.js'\n\ntype DependencyGraph = {\n [key: string]: {\n dependencies: string[]\n dependenciesPriority: string[]\n dependenciesSoft: string[]\n featureProvider: FeatureProviderServer<unknown, unknown>\n }\n}\n\nfunction createDependencyGraph(\n featureProviders: FeatureProviderServer<unknown, unknown>[],\n): DependencyGraph {\n const graph: DependencyGraph = {}\n for (const fp of featureProviders) {\n graph[fp.key] = {\n dependencies: fp.dependencies || [],\n dependenciesPriority: fp.dependenciesPriority || [],\n dependenciesSoft: fp.dependenciesSoft || [],\n featureProvider: fp,\n }\n }\n return graph\n}\n\nfunction topologicallySortFeatures(\n featureProviders: FeatureProviderServer<unknown, unknown>[],\n): FeatureProviderServer<unknown, unknown>[] {\n const graph = createDependencyGraph(featureProviders)\n const visited: { [key: string]: boolean } = {}\n const stack: FeatureProviderServer<unknown, unknown>[] = []\n\n for (const key in graph) {\n if (!visited[key]) {\n visit(graph, key, visited, stack)\n }\n }\n\n return stack.reverse()\n}\n\nfunction visit(\n graph: DependencyGraph,\n key: string,\n visited: { [key: string]: boolean },\n stack: FeatureProviderServer<unknown, unknown>[],\n currentPath: string[] = [],\n) {\n if (!graph[key]) {\n throw new Error(`Feature key ${key} is not present in the dependency graph.`)\n }\n\n if (currentPath.includes(key)) {\n throw new Error(`Circular dependency detected: ${currentPath.join(' -> ')} -> ${key}`)\n }\n\n if (visited[key]) {\n return\n }\n\n visited[key] = true\n currentPath.push(key)\n\n // First process the hard priority dependencies\n for (const dep of graph[key].dependenciesPriority) {\n if (!visited[dep]) {\n visit(graph, dep, visited, stack, currentPath)\n }\n }\n\n // Then process the normal dependencies, but make sure to not violate hard dependencies\n for (const dep of graph[key].dependencies) {\n if (!visited[dep] && !graph[key].dependenciesPriority.includes(dep)) {\n visit(graph, dep, visited, stack, currentPath)\n }\n }\n\n // Then process the soft dependencies. Make sure to not violate hard and normal dependencies.\n for (const dep of graph[key].dependenciesSoft) {\n if (\n graph[dep] &&\n !visited[dep] &&\n !graph[key].dependenciesPriority.includes(dep) &&\n !graph[key].dependencies.includes(dep)\n ) {\n visit(graph, dep, visited, stack, currentPath)\n }\n }\n\n stack.push(graph[key].featureProvider)\n currentPath.pop()\n}\n\nexport function sortFeaturesForOptimalLoading(\n featureProviders: FeatureProviderServer<unknown, unknown>[],\n): FeatureProviderServer<unknown, unknown>[] {\n return topologicallySortFeatures(featureProviders)\n}\n\nexport async function loadFeatures({\n config,\n isRoot,\n unSanitizedEditorConfig,\n}: {\n config: SanitizedConfig\n isRoot?: boolean\n unSanitizedEditorConfig: ServerEditorConfig\n}): Promise<ResolvedServerFeatureMap> {\n // First remove all duplicate features. The LAST feature with a given key wins.\n unSanitizedEditorConfig.features = unSanitizedEditorConfig.features\n .reverse()\n .filter((f, i, arr) => {\n const firstIndex = arr.findIndex((f2) => f2.key === f.key)\n return firstIndex === i\n })\n .reverse()\n\n unSanitizedEditorConfig.features = sortFeaturesForOptimalLoading(unSanitizedEditorConfig.features)\n\n const featureProviderMap: ServerFeatureProviderMap = new Map(\n unSanitizedEditorConfig.features.map(\n (f) => [f.key, f] as [string, FeatureProviderServer<unknown, unknown>],\n ),\n )\n\n const resolvedFeatures: ResolvedServerFeatureMap = new Map()\n\n // Make sure all dependencies declared in the respective features exist\n let loaded = 0\n for (const featureProvider of unSanitizedEditorConfig.features) {\n if (!featureProvider.key) {\n throw new Error(\n `A Feature you've added does not have a key. Please add a key to the feature. This is used to uniquely identify the feature.`,\n )\n }\n if (featureProvider.dependencies?.length) {\n for (const dependencyKey of featureProvider.dependencies) {\n const found = unSanitizedEditorConfig.features.find((f) => f.key === dependencyKey)\n if (!found) {\n throw new Error(\n `Feature ${featureProvider.key} has a dependency ${dependencyKey} which does not exist.`,\n )\n }\n }\n }\n\n if (featureProvider.dependenciesPriority?.length) {\n for (const priorityDependencyKey of featureProvider.dependenciesPriority) {\n // look in the resolved features instead of the editorConfig.features, as a dependency requires the feature to be loaded before it, contrary to a soft-dependency\n const found = resolvedFeatures.get(priorityDependencyKey)\n if (!found) {\n const existsInEditorConfig = unSanitizedEditorConfig.features.find(\n (f) => f.key === priorityDependencyKey,\n )\n if (!existsInEditorConfig) {\n throw new Error(\n `Feature ${featureProvider.key} has a priority dependency ${priorityDependencyKey} which does not exist.`,\n )\n } else {\n throw new Error(\n `Feature ${featureProvider.key} has a priority dependency ${priorityDependencyKey} which is not loaded before it.`,\n )\n }\n }\n }\n }\n\n const feature = await featureProvider.feature({\n config,\n featureProviderMap,\n isRoot,\n resolvedFeatures,\n unSanitizedEditorConfig,\n })\n resolvedFeatures.set(featureProvider.key, {\n ...feature,\n dependencies: featureProvider.dependencies,\n dependenciesPriority: featureProvider.dependenciesPriority,\n dependenciesSoft: featureProvider.dependenciesSoft,\n key: featureProvider.key,\n order: loaded,\n })\n\n loaded++\n }\n\n return resolvedFeatures\n}\n"],"names":["createDependencyGraph","featureProviders","graph","fp","key","dependencies","dependenciesPriority","dependenciesSoft","featureProvider","topologicallySortFeatures","visited","stack","visit","reverse","currentPath","Error","includes","join","push","dep","pop","sortFeaturesForOptimalLoading","loadFeatures","config","isRoot","unSanitizedEditorConfig","features","filter","f","i","arr","firstIndex","findIndex","f2","featureProviderMap","Map","map","resolvedFeatures","loaded","length","dependencyKey","found","find","priorityDependencyKey","get","existsInEditorConfig","feature","set","order"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAkBA,SAASA,sBACPC,gBAA2D;IAE3D,MAAMC,QAAyB,CAAC;IAChC,KAAK,MAAMC,MAAMF,iBAAkB;QACjCC,KAAK,CAACC,GAAGC,GAAG,CAAC,GAAG;YACdC,cAAcF,GAAGE,YAAY,IAAI,EAAE;YACnCC,sBAAsBH,GAAGG,oBAAoB,IAAI,EAAE;YACnDC,kBAAkBJ,GAAGI,gBAAgB,IAAI,EAAE;YAC3CC,iBAAiBL;QACnB;IACF;IACA,OAAOD;AACT;AAEA,SAASO,0BACPR,gBAA2D;IAE3D,MAAMC,QAAQF,sBAAsBC;IACpC,MAAMS,UAAsC,CAAC;IAC7C,MAAMC,QAAmD,EAAE;IAE3D,IAAK,MAAMP,OAAOF,MAAO;QACvB,IAAI,CAACQ,OAAO,CAACN,IAAI,EAAE;YACjBQ,MAAMV,OAAOE,KAAKM,SAASC;QAC7B;IACF;IAEA,OAAOA,MAAME,OAAO;AACtB;AAEA,SAASD,MACPV,KAAsB,EACtBE,GAAW,EACXM,OAAmC,EACnCC,KAAgD,EAChDG,cAAwB,EAAE;IAE1B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D;gBACnC,IAAI,CAACF,OAAO;oBACV,MAAMI,uBAAuBpB,wBAAwBC,QAAQ,CAACgB,IAAI,CAChE,CAACd,IAAMA,EAAExB,GAAG,KAAKuC;oBAEnB,IAAI,CAACE,sBAAsB;wBACzB,MAAM,IAAI9B,MACR,CAAC,QAAQ,EAAEP,gBAAgBJ,GAAG,CAAC,2BAA2B,EAAEuC,sBAAsB,sBAAsB,CAAC;oBAE7G,OAAO;wBACL,MAAM,IAAI5B,MACR,CAAC,QAAQ,EAAEP,gBAAgBJ,GAAG,CAAC,2BAA2B,EAAEuC,sBAAsB,+BAA+B,CAAC;oBAEtH;gBACF;YACF;QACF;QAEA,MAAMG,UAAU,MAAMtC,gBAAgBsC,OAAO,CAAC;YAC5CvB;YACAW;YACAV;YACAa;YACAZ;QACF;QACAY,iBAAiBU,GAAG,CAACvC,gBAAgBJ,GAAG,EAAE;YACxC,GAAG0C,OAAO;YACVzC,cAAcG,gBAAgBH,YAAY;YAC1CC,sBAAsBE,gBAAgBF,oBAAoB;YAC1DC,kBAAkBC,gBAAgBD,gBAAgB;YAClDH,KAAKI,gBAAgBJ,GAAG;YACxB4C,OAAOV;QACT;QAEAA;IACF;IAEA,OAAOD;AACT"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { SanitizedConfig } from 'payload/config';
|
|
1
2
|
import type { ResolvedServerFeatureMap, SanitizedServerFeatures } from '../../../features/types.js';
|
|
2
3
|
import type { SanitizedServerEditorConfig, ServerEditorConfig } from '../types.js';
|
|
3
4
|
export declare const sanitizeServerFeatures: (features: ResolvedServerFeatureMap) => SanitizedServerFeatures;
|
|
4
|
-
export declare function sanitizeServerEditorConfig(editorConfig: ServerEditorConfig): SanitizedServerEditorConfig
|
|
5
|
+
export declare function sanitizeServerEditorConfig(editorConfig: ServerEditorConfig, config: SanitizedConfig): Promise<SanitizedServerEditorConfig>;
|
|
5
6
|
//# sourceMappingURL=sanitize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACnG,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIlF,eAAO,MAAM,sBAAsB,0CAEhC,
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACnG,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIlF,eAAO,MAAM,sBAAsB,0CAEhC,uBAsFF,CAAA;AAED,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,kBAAkB,EAChC,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,2BAA2B,CAAC,CAWtC"}
|