@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,38 +1,69 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary.js';
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
import lexicalTabIndentationPluginImport from '@lexical/react/LexicalTabIndentationPlugin.js';
|
|
12
|
-
const { TabIndentationPlugin } = lexicalTabIndentationPluginImport;
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
|
|
4
|
+
import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary.js';
|
|
5
|
+
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin.js';
|
|
6
|
+
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin.js';
|
|
7
|
+
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin.js';
|
|
8
|
+
import { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin.js';
|
|
9
|
+
import { useTranslation } from '@payloadcms/ui/providers/Translation';
|
|
10
|
+
import { BLUR_COMMAND, COMMAND_PRIORITY_LOW, FOCUS_COMMAND } from 'lexical';
|
|
13
11
|
import * as React from 'react';
|
|
14
12
|
import { useEffect, useState } from 'react';
|
|
15
13
|
import { EditorPlugin } from './EditorPlugin.js';
|
|
16
14
|
import './LexicalEditor.scss';
|
|
17
|
-
import {
|
|
15
|
+
import { useEditorConfigContext } from './config/client/EditorConfigProvider.js';
|
|
18
16
|
import { MarkdownShortcutPlugin } from './plugins/MarkdownShortcut/index.js';
|
|
19
17
|
import { SlashMenuPlugin } from './plugins/SlashMenu/index.js';
|
|
20
18
|
import { AddBlockHandlePlugin } from './plugins/handles/AddBlockHandlePlugin/index.js';
|
|
21
19
|
import { DraggableBlockPlugin } from './plugins/handles/DraggableBlockPlugin/index.js';
|
|
22
20
|
import { LexicalContentEditable } from './ui/ContentEditable.js';
|
|
23
21
|
export const LexicalEditor = (props)=>{
|
|
24
|
-
const { editorConfig, onChange } = props;
|
|
22
|
+
const { editorConfig, editorContainerRef, onChange } = props;
|
|
23
|
+
const editorConfigContext = useEditorConfigContext();
|
|
25
24
|
const [editor] = useLexicalComposerContext();
|
|
25
|
+
const { t } = useTranslation();
|
|
26
26
|
const [floatingAnchorElem, setFloatingAnchorElem] = useState(null);
|
|
27
27
|
const onRef = (_floatingAnchorElem)=>{
|
|
28
28
|
if (_floatingAnchorElem !== null) {
|
|
29
29
|
setFloatingAnchorElem(_floatingAnchorElem);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
+
useEffect(()=>{
|
|
33
|
+
if (!editorConfigContext?.uuid) {
|
|
34
|
+
console.error('Lexical Editor must be used within an EditorConfigProvider');
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (editorConfigContext?.parentEditor?.uuid) {
|
|
38
|
+
editorConfigContext.parentEditor?.registerChild(editorConfigContext.uuid, editorConfigContext);
|
|
39
|
+
}
|
|
40
|
+
const handleFocus = ()=>{
|
|
41
|
+
editorConfigContext.focusEditor(editorConfigContext);
|
|
42
|
+
};
|
|
43
|
+
const handleBlur = ()=>{
|
|
44
|
+
editorConfigContext.blurEditor(editorConfigContext);
|
|
45
|
+
};
|
|
46
|
+
const unregisterFocus = editor.registerCommand(FOCUS_COMMAND, ()=>{
|
|
47
|
+
handleFocus();
|
|
48
|
+
return true;
|
|
49
|
+
}, COMMAND_PRIORITY_LOW);
|
|
50
|
+
const unregisterBlur = editor.registerCommand(BLUR_COMMAND, ()=>{
|
|
51
|
+
handleBlur();
|
|
52
|
+
return true;
|
|
53
|
+
}, COMMAND_PRIORITY_LOW);
|
|
54
|
+
return ()=>{
|
|
55
|
+
unregisterFocus();
|
|
56
|
+
unregisterBlur();
|
|
57
|
+
editorConfigContext.parentEditor?.unregisterChild?.(editorConfigContext.uuid);
|
|
58
|
+
};
|
|
59
|
+
}, [
|
|
60
|
+
editor,
|
|
61
|
+
editorConfigContext
|
|
62
|
+
]);
|
|
32
63
|
const [isSmallWidthViewport, setIsSmallWidthViewport] = useState(false);
|
|
33
64
|
useEffect(()=>{
|
|
34
65
|
const updateViewPortWidth = ()=>{
|
|
35
|
-
const isNextSmallWidthViewport = window.matchMedia('(max-width:
|
|
66
|
+
const isNextSmallWidthViewport = window.matchMedia('(max-width: 768px)').matches;
|
|
36
67
|
if (isNextSmallWidthViewport !== isSmallWidthViewport) {
|
|
37
68
|
setIsSmallWidthViewport(isNextSmallWidthViewport);
|
|
38
69
|
}
|
|
@@ -45,68 +76,118 @@ export const LexicalEditor = (props)=>{
|
|
|
45
76
|
}, [
|
|
46
77
|
isSmallWidthViewport
|
|
47
78
|
]);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
79
|
+
return /*#__PURE__*/ _jsxs(React.Fragment, {
|
|
80
|
+
children: [
|
|
81
|
+
editorConfig.features.plugins.map((plugin)=>{
|
|
82
|
+
if (plugin.position === 'aboveContainer') {
|
|
83
|
+
return /*#__PURE__*/ _jsx(EditorPlugin, {
|
|
84
|
+
clientProps: plugin.clientProps,
|
|
85
|
+
plugin: plugin
|
|
86
|
+
}, plugin.key);
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
90
|
+
className: "editor-container",
|
|
91
|
+
ref: editorContainerRef,
|
|
92
|
+
children: [
|
|
93
|
+
editorConfig.features.plugins.map((plugin)=>{
|
|
94
|
+
if (plugin.position === 'top') {
|
|
95
|
+
return /*#__PURE__*/ _jsx(EditorPlugin, {
|
|
96
|
+
clientProps: plugin.clientProps,
|
|
97
|
+
plugin: plugin
|
|
98
|
+
}, plugin.key);
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
/*#__PURE__*/ _jsx(RichTextPlugin, {
|
|
102
|
+
ErrorBoundary: LexicalErrorBoundary,
|
|
103
|
+
contentEditable: /*#__PURE__*/ _jsx("div", {
|
|
104
|
+
className: "editor-scroller",
|
|
105
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
106
|
+
className: "editor",
|
|
107
|
+
ref: onRef,
|
|
108
|
+
children: /*#__PURE__*/ _jsx(LexicalContentEditable, {})
|
|
109
|
+
})
|
|
110
|
+
}),
|
|
111
|
+
placeholder: /*#__PURE__*/ _jsx("p", {
|
|
112
|
+
className: "editor-placeholder",
|
|
113
|
+
children: t('lexical:general:placeholder')
|
|
114
|
+
})
|
|
115
|
+
}),
|
|
116
|
+
/*#__PURE__*/ _jsx(OnChangePlugin, {
|
|
117
|
+
// Selection changes can be ignored here, reducing the
|
|
118
|
+
// frequency that the FieldComponent and Payload receive updates.
|
|
119
|
+
// Selection changes are only needed if you are saving selection state
|
|
120
|
+
ignoreSelectionChange: true,
|
|
121
|
+
onChange: (editorState, editor, tags)=>{
|
|
122
|
+
// Ignore any onChange event triggered by focus only
|
|
123
|
+
if (!tags.has('focus') || tags.size > 1) {
|
|
124
|
+
if (onChange != null) onChange(editorState, editor, tags);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}),
|
|
128
|
+
floatingAnchorElem && /*#__PURE__*/ _jsxs(React.Fragment, {
|
|
129
|
+
children: [
|
|
130
|
+
!isSmallWidthViewport && editor.isEditable() && /*#__PURE__*/ _jsxs(React.Fragment, {
|
|
131
|
+
children: [
|
|
132
|
+
/*#__PURE__*/ _jsx(DraggableBlockPlugin, {
|
|
133
|
+
anchorElem: floatingAnchorElem
|
|
134
|
+
}),
|
|
135
|
+
/*#__PURE__*/ _jsx(AddBlockHandlePlugin, {
|
|
136
|
+
anchorElem: floatingAnchorElem
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
}),
|
|
140
|
+
editorConfig.features.plugins.map((plugin)=>{
|
|
141
|
+
if (plugin.position === 'floatingAnchorElem' && !(plugin.desktopOnly === true && isSmallWidthViewport)) {
|
|
142
|
+
return /*#__PURE__*/ _jsx(EditorPlugin, {
|
|
143
|
+
anchorElem: floatingAnchorElem,
|
|
144
|
+
clientProps: plugin.clientProps,
|
|
145
|
+
plugin: plugin
|
|
146
|
+
}, plugin.key);
|
|
147
|
+
}
|
|
148
|
+
}),
|
|
149
|
+
editor.isEditable() && /*#__PURE__*/ _jsx(React.Fragment, {
|
|
150
|
+
children: /*#__PURE__*/ _jsx(SlashMenuPlugin, {
|
|
151
|
+
anchorElem: floatingAnchorElem
|
|
152
|
+
})
|
|
153
|
+
})
|
|
154
|
+
]
|
|
155
|
+
}),
|
|
156
|
+
editor.isEditable() && /*#__PURE__*/ _jsxs(React.Fragment, {
|
|
157
|
+
children: [
|
|
158
|
+
/*#__PURE__*/ _jsx(HistoryPlugin, {}),
|
|
159
|
+
editorConfig?.features?.markdownTransformers?.length > 0 && /*#__PURE__*/ _jsx(MarkdownShortcutPlugin, {})
|
|
160
|
+
]
|
|
161
|
+
}),
|
|
162
|
+
/*#__PURE__*/ _jsx(TabIndentationPlugin, {}),
|
|
163
|
+
editorConfig.features.plugins.map((plugin)=>{
|
|
164
|
+
if (plugin.position === 'normal') {
|
|
165
|
+
return /*#__PURE__*/ _jsx(EditorPlugin, {
|
|
166
|
+
clientProps: plugin.clientProps,
|
|
167
|
+
plugin: plugin
|
|
168
|
+
}, plugin.key);
|
|
169
|
+
}
|
|
170
|
+
}),
|
|
171
|
+
editorConfig.features.plugins.map((plugin)=>{
|
|
172
|
+
if (plugin.position === 'bottom') {
|
|
173
|
+
return /*#__PURE__*/ _jsx(EditorPlugin, {
|
|
174
|
+
clientProps: plugin.clientProps,
|
|
175
|
+
plugin: plugin
|
|
176
|
+
}, plugin.key);
|
|
177
|
+
}
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
}),
|
|
181
|
+
editorConfig.features.plugins.map((plugin)=>{
|
|
182
|
+
if (plugin.position === 'belowContainer') {
|
|
183
|
+
return /*#__PURE__*/ _jsx(EditorPlugin, {
|
|
184
|
+
clientProps: plugin.clientProps,
|
|
185
|
+
plugin: plugin
|
|
186
|
+
}, plugin.key);
|
|
187
|
+
}
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
});
|
|
110
191
|
};
|
|
111
192
|
|
|
112
193
|
//# sourceMappingURL=LexicalEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/field/lexical/LexicalEditor.tsx"],"sourcesContent":["'use client'\nimport lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'\nconst { useLexicalComposerContext } = lexicalComposerContextImport\n\nimport LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary.js'\nimport lexicalHistoryPluginImport from '@lexical/react/LexicalHistoryPlugin.js'\nconst { HistoryPlugin } = lexicalHistoryPluginImport\n\nimport lexicalOnChangePluginImport from '@lexical/react/LexicalOnChangePlugin.js'\nconst { OnChangePlugin } = lexicalOnChangePluginImport\n\nimport lexicalRichTextPluginImport from '@lexical/react/LexicalRichTextPlugin.js'\nconst { RichTextPlugin } = lexicalRichTextPluginImport\n\nimport lexicalTabIndentationPluginImport from '@lexical/react/LexicalTabIndentationPlugin.js'\nconst { TabIndentationPlugin } = lexicalTabIndentationPluginImport\n\nimport * as React from 'react'\nimport { useEffect, useState } from 'react'\n\nimport type { LexicalProviderProps } from './LexicalProvider.js'\n\nimport { EditorPlugin } from './EditorPlugin.js'\nimport './LexicalEditor.scss'\nimport { FloatingSelectToolbarPlugin } from './plugins/FloatingSelectToolbar/index.js'\nimport { MarkdownShortcutPlugin } from './plugins/MarkdownShortcut/index.js'\nimport { SlashMenuPlugin } from './plugins/SlashMenu/index.js'\nimport { AddBlockHandlePlugin } from './plugins/handles/AddBlockHandlePlugin/index.js'\nimport { DraggableBlockPlugin } from './plugins/handles/DraggableBlockPlugin/index.js'\nimport { LexicalContentEditable } from './ui/ContentEditable.js'\n\nexport const LexicalEditor: React.FC<Pick<LexicalProviderProps, 'editorConfig' | 'onChange'>> = (\n props,\n) => {\n const { editorConfig, onChange } = props\n const [editor] = useLexicalComposerContext()\n\n const [floatingAnchorElem, setFloatingAnchorElem] = useState<HTMLDivElement | null>(null)\n const onRef = (_floatingAnchorElem: HTMLDivElement) => {\n if (_floatingAnchorElem !== null) {\n setFloatingAnchorElem(_floatingAnchorElem)\n }\n }\n\n const [isSmallWidthViewport, setIsSmallWidthViewport] = useState<boolean>(false)\n\n useEffect(() => {\n const updateViewPortWidth = () => {\n const isNextSmallWidthViewport = window.matchMedia('(max-width: 1025px)').matches\n\n if (isNextSmallWidthViewport !== isSmallWidthViewport) {\n setIsSmallWidthViewport(isNextSmallWidthViewport)\n }\n }\n updateViewPortWidth()\n window.addEventListener('resize', updateViewPortWidth)\n\n return () => {\n window.removeEventListener('resize', updateViewPortWidth)\n }\n }, [isSmallWidthViewport])\n\n const ErrorBoundaryComponent = LexicalErrorBoundary.default || LexicalErrorBoundary\n\n return (\n <React.Fragment>\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'top') {\n return <EditorPlugin key={plugin.key} plugin={plugin} />\n }\n })}\n <RichTextPlugin\n //@ts-expect-error ts being dumb\n ErrorBoundary={ErrorBoundaryComponent}\n contentEditable={\n <div className=\"editor-scroller\">\n <div className=\"editor\" ref={onRef}>\n <LexicalContentEditable />\n </div>\n </div>\n }\n placeholder={\n <p className=\"editor-placeholder\">Start typing, or press '/' for commands...</p>\n }\n />\n <OnChangePlugin\n // Selection changes can be ignored here, reducing the\n // frequency that the FieldComponent and Payload receive updates.\n // Selection changes are only needed if you are saving selection state\n ignoreSelectionChange\n onChange={(editorState, editor, tags) => {\n // Ignore any onChange event triggered by focus only\n if (!tags.has('focus') || tags.size > 1) {\n if (onChange != null) onChange(editorState, editor, tags)\n }\n }}\n />\n {floatingAnchorElem && (\n <React.Fragment>\n {!isSmallWidthViewport && editor.isEditable() && (\n <React.Fragment>\n <DraggableBlockPlugin anchorElem={floatingAnchorElem} />\n <AddBlockHandlePlugin anchorElem={floatingAnchorElem} />\n </React.Fragment>\n )}\n {editorConfig.features.plugins.map((plugin) => {\n if (\n plugin.position === 'floatingAnchorElem' &&\n !(plugin.desktopOnly === true && isSmallWidthViewport)\n ) {\n return (\n <EditorPlugin anchorElem={floatingAnchorElem} key={plugin.key} plugin={plugin} />\n )\n }\n })}\n {editor.isEditable() && (\n <React.Fragment>\n <FloatingSelectToolbarPlugin anchorElem={floatingAnchorElem} />\n <SlashMenuPlugin anchorElem={floatingAnchorElem} />\n </React.Fragment>\n )}\n </React.Fragment>\n )}\n {editor.isEditable() && (\n <React.Fragment>\n <HistoryPlugin />\n {editorConfig?.features?.markdownTransformers?.length > 0 && <MarkdownShortcutPlugin />}\n </React.Fragment>\n )}\n\n <TabIndentationPlugin />\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'normal') {\n return <EditorPlugin key={plugin.key} plugin={plugin} />\n }\n })}\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'bottom') {\n return <EditorPlugin key={plugin.key} plugin={plugin} />\n }\n })}\n </React.Fragment>\n )\n}\n"],"names":["lexicalComposerContextImport","useLexicalComposerContext","LexicalErrorBoundary","lexicalHistoryPluginImport","HistoryPlugin","lexicalOnChangePluginImport","OnChangePlugin","lexicalRichTextPluginImport","RichTextPlugin","lexicalTabIndentationPluginImport","TabIndentationPlugin","React","useEffect","useState","EditorPlugin","FloatingSelectToolbarPlugin","MarkdownShortcutPlugin","SlashMenuPlugin","AddBlockHandlePlugin","DraggableBlockPlugin","LexicalContentEditable","LexicalEditor","props","editorConfig","onChange","editor","floatingAnchorElem","setFloatingAnchorElem","onRef","_floatingAnchorElem","isSmallWidthViewport","setIsSmallWidthViewport","updateViewPortWidth","isNextSmallWidthViewport","window","matchMedia","matches","addEventListener","removeEventListener","ErrorBoundaryComponent","default","Fragment","features","plugins","map","plugin","position","key","ErrorBoundary","contentEditable","div","className","ref","placeholder","p","ignoreSelectionChange","editorState","tags","has","size","isEditable","anchorElem","desktopOnly","markdownTransformers","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
|
|
1
|
+
{"version":3,"sources":["../../../src/field/lexical/LexicalEditor.tsx"],"sourcesContent":["'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary.js'\nimport { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin.js'\nimport { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin.js'\nimport { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin.js'\nimport { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin.js'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport { BLUR_COMMAND, COMMAND_PRIORITY_LOW, FOCUS_COMMAND } from 'lexical'\nimport * as React from 'react'\nimport { useEffect, useState } from 'react'\n\nimport type { LexicalProviderProps } from './LexicalProvider.js'\n\nimport { EditorPlugin } from './EditorPlugin.js'\nimport './LexicalEditor.scss'\nimport { useEditorConfigContext } from './config/client/EditorConfigProvider.js'\nimport { MarkdownShortcutPlugin } from './plugins/MarkdownShortcut/index.js'\nimport { SlashMenuPlugin } from './plugins/SlashMenu/index.js'\nimport { AddBlockHandlePlugin } from './plugins/handles/AddBlockHandlePlugin/index.js'\nimport { DraggableBlockPlugin } from './plugins/handles/DraggableBlockPlugin/index.js'\nimport { LexicalContentEditable } from './ui/ContentEditable.js'\n\nexport const LexicalEditor: React.FC<\n Pick<LexicalProviderProps, 'editorConfig' | 'onChange'> & {\n editorContainerRef: React.RefObject<HTMLDivElement>\n }\n> = (props) => {\n const { editorConfig, editorContainerRef, onChange } = props\n const editorConfigContext = useEditorConfigContext()\n const [editor] = useLexicalComposerContext()\n const { t } = useTranslation<{}, string>()\n\n const [floatingAnchorElem, setFloatingAnchorElem] = useState<HTMLDivElement | null>(null)\n const onRef = (_floatingAnchorElem: HTMLDivElement) => {\n if (_floatingAnchorElem !== null) {\n setFloatingAnchorElem(_floatingAnchorElem)\n }\n }\n\n useEffect(() => {\n if (!editorConfigContext?.uuid) {\n console.error('Lexical Editor must be used within an EditorConfigProvider')\n return\n }\n if (editorConfigContext?.parentEditor?.uuid) {\n editorConfigContext.parentEditor?.registerChild(editorConfigContext.uuid, editorConfigContext)\n }\n\n const handleFocus = () => {\n editorConfigContext.focusEditor(editorConfigContext)\n }\n\n const handleBlur = () => {\n editorConfigContext.blurEditor(editorConfigContext)\n }\n\n const unregisterFocus = editor.registerCommand<MouseEvent>(\n FOCUS_COMMAND,\n () => {\n handleFocus()\n return true\n },\n COMMAND_PRIORITY_LOW,\n )\n\n const unregisterBlur = editor.registerCommand<MouseEvent>(\n BLUR_COMMAND,\n () => {\n handleBlur()\n return true\n },\n COMMAND_PRIORITY_LOW,\n )\n\n return () => {\n unregisterFocus()\n unregisterBlur()\n editorConfigContext.parentEditor?.unregisterChild?.(editorConfigContext.uuid)\n }\n }, [editor, editorConfigContext])\n\n const [isSmallWidthViewport, setIsSmallWidthViewport] = useState<boolean>(false)\n\n useEffect(() => {\n const updateViewPortWidth = () => {\n const isNextSmallWidthViewport = window.matchMedia('(max-width: 768px)').matches\n\n if (isNextSmallWidthViewport !== isSmallWidthViewport) {\n setIsSmallWidthViewport(isNextSmallWidthViewport)\n }\n }\n updateViewPortWidth()\n window.addEventListener('resize', updateViewPortWidth)\n\n return () => {\n window.removeEventListener('resize', updateViewPortWidth)\n }\n }, [isSmallWidthViewport])\n\n return (\n <React.Fragment>\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'aboveContainer') {\n return <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n }\n })}\n <div className=\"editor-container\" ref={editorContainerRef}>\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'top') {\n return (\n <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n )\n }\n })}\n <RichTextPlugin\n ErrorBoundary={LexicalErrorBoundary}\n contentEditable={\n <div className=\"editor-scroller\">\n <div className=\"editor\" ref={onRef}>\n <LexicalContentEditable />\n </div>\n </div>\n }\n placeholder={<p className=\"editor-placeholder\">{t('lexical:general:placeholder')}</p>}\n />\n <OnChangePlugin\n // Selection changes can be ignored here, reducing the\n // frequency that the FieldComponent and Payload receive updates.\n // Selection changes are only needed if you are saving selection state\n ignoreSelectionChange\n onChange={(editorState, editor, tags) => {\n // Ignore any onChange event triggered by focus only\n if (!tags.has('focus') || tags.size > 1) {\n if (onChange != null) onChange(editorState, editor, tags)\n }\n }}\n />\n {floatingAnchorElem && (\n <React.Fragment>\n {!isSmallWidthViewport && editor.isEditable() && (\n <React.Fragment>\n <DraggableBlockPlugin anchorElem={floatingAnchorElem} />\n <AddBlockHandlePlugin anchorElem={floatingAnchorElem} />\n </React.Fragment>\n )}\n {editorConfig.features.plugins.map((plugin) => {\n if (\n plugin.position === 'floatingAnchorElem' &&\n !(plugin.desktopOnly === true && isSmallWidthViewport)\n ) {\n return (\n <EditorPlugin\n anchorElem={floatingAnchorElem}\n clientProps={plugin.clientProps}\n key={plugin.key}\n plugin={plugin}\n />\n )\n }\n })}\n {editor.isEditable() && (\n <React.Fragment>\n <SlashMenuPlugin anchorElem={floatingAnchorElem} />\n </React.Fragment>\n )}\n </React.Fragment>\n )}\n {editor.isEditable() && (\n <React.Fragment>\n <HistoryPlugin />\n {editorConfig?.features?.markdownTransformers?.length > 0 && <MarkdownShortcutPlugin />}\n </React.Fragment>\n )}\n\n <TabIndentationPlugin />\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'normal') {\n return (\n <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n )\n }\n })}\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'bottom') {\n return (\n <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n )\n }\n })}\n </div>\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'belowContainer') {\n return <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n }\n })}\n </React.Fragment>\n )\n}\n"],"names":["useLexicalComposerContext","LexicalErrorBoundary","HistoryPlugin","OnChangePlugin","RichTextPlugin","TabIndentationPlugin","useTranslation","BLUR_COMMAND","COMMAND_PRIORITY_LOW","FOCUS_COMMAND","React","useEffect","useState","EditorPlugin","useEditorConfigContext","MarkdownShortcutPlugin","SlashMenuPlugin","AddBlockHandlePlugin","DraggableBlockPlugin","LexicalContentEditable","LexicalEditor","props","editorConfig","editorContainerRef","onChange","editorConfigContext","editor","t","floatingAnchorElem","setFloatingAnchorElem","onRef","_floatingAnchorElem","uuid","console","error","parentEditor","registerChild","handleFocus","focusEditor","handleBlur","blurEditor","unregisterFocus","registerCommand","unregisterBlur","unregisterChild","isSmallWidthViewport","setIsSmallWidthViewport","updateViewPortWidth","isNextSmallWidthViewport","window","matchMedia","matches","addEventListener","removeEventListener","Fragment","features","plugins","map","plugin","position","clientProps","key","div","className","ref","ErrorBoundary","contentEditable","placeholder","p","ignoreSelectionChange","editorState","tags","has","size","isEditable","anchorElem","desktopOnly","markdownTransformers","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
@import '../../scss/styles';
|
|
2
|
+
|
|
1
3
|
.rich-text-lexical {
|
|
2
4
|
.editor {
|
|
3
5
|
position: relative;
|
|
4
6
|
}
|
|
5
7
|
|
|
6
|
-
.editor-
|
|
8
|
+
.editor-container {
|
|
7
9
|
position: relative;
|
|
8
10
|
|
|
9
11
|
font-family: var(--font-serif);
|
|
@@ -20,10 +22,19 @@
|
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
|
|
25
|
+
&--show-gutter {
|
|
26
|
+
> .rich-text-lexical__wrap > .editor-container > .editor-placeholder {
|
|
27
|
+
left: 3rem;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:not(&--show-gutter) > .rich-text-lexical__wrap > .editor-container > .editor-placeholder {
|
|
32
|
+
left: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
23
35
|
.editor-placeholder {
|
|
24
36
|
position: absolute;
|
|
25
37
|
top: 8px;
|
|
26
|
-
left: 0px;
|
|
27
38
|
font-size: 15px;
|
|
28
39
|
color: var(--theme-elevation-500);
|
|
29
40
|
/* Prevent text selection */
|
|
@@ -36,21 +47,3 @@
|
|
|
36
47
|
pointer-events: none;
|
|
37
48
|
}
|
|
38
49
|
}
|
|
39
|
-
|
|
40
|
-
.floating-select-toolbar-popup__section-dropdown-align {
|
|
41
|
-
display: flex;
|
|
42
|
-
gap: 2px;
|
|
43
|
-
}
|
|
44
|
-
.floating-select-toolbar-popup__section-features {
|
|
45
|
-
display: flex;
|
|
46
|
-
gap: 2px;
|
|
47
|
-
}
|
|
48
|
-
.floating-select-toolbar-popup__section-dropdown-text {
|
|
49
|
-
display: flex;
|
|
50
|
-
gap: 2px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.floating-select-toolbar-popup__section-format {
|
|
54
|
-
display: flex;
|
|
55
|
-
gap: 2px;
|
|
56
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { FormFieldBase } from '@payloadcms/ui/fields/shared';
|
|
1
2
|
import type { EditorState, SerializedEditorState } from 'lexical';
|
|
2
3
|
import type { LexicalEditor } from 'lexical';
|
|
3
|
-
import type { FormFieldBase } from '@payloadcms/ui/fields/shared';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import type { SanitizedClientEditorConfig } from './config/types.js';
|
|
6
6
|
export type LexicalProviderProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LexicalProvider.d.ts","sourceRoot":"","sources":["../../../src/field/lexical/LexicalProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LexicalProvider.d.ts","sourceRoot":"","sources":["../../../src/field/lexical/LexicalProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAA;AASpE,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,2BAA2B,CAAA;IACzC,UAAU,EAAE,aAAa,GAAG;QAC1B,YAAY,EAAE,2BAA2B,CAAA;QACzC,IAAI,EAAE,MAAM,CAAA;QACZ,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;KACnD,CAAA;IACD,QAAQ,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IACtF,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,qBAAqB,CAAA;CAC7B,CAAA;AACD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAuE1D,CAAA"}
|
|
@@ -1,19 +1,43 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { LexicalComposer } from '@lexical/react/LexicalComposer.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import { useMemo } from 'react';
|
|
5
6
|
import { LexicalEditor as LexicalEditorComponent } from './LexicalEditor.js';
|
|
6
|
-
import { EditorConfigProvider } from './config/client/EditorConfigProvider.js';
|
|
7
|
+
import { EditorConfigProvider, useEditorConfigContext } from './config/client/EditorConfigProvider.js';
|
|
7
8
|
import { getEnabledNodes } from './nodes/index.js';
|
|
8
9
|
export const LexicalProvider = (props)=>{
|
|
9
|
-
const { editorConfig, fieldProps, onChange, path, readOnly } = props;
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const { editorConfig, fieldProps, value, onChange, path, readOnly } = props;
|
|
11
|
+
const parentContext = useEditorConfigContext();
|
|
12
|
+
const editorContainerRef = React.useRef(null);
|
|
13
|
+
const processedValue = useMemo(()=>{
|
|
14
|
+
let processed = value;
|
|
15
|
+
if (editorConfig?.features?.hooks?.load?.length) {
|
|
16
|
+
editorConfig.features.hooks.load.forEach((hook)=>{
|
|
17
|
+
processed = hook({
|
|
18
|
+
incomingEditorState: processed
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return processed;
|
|
23
|
+
}, [
|
|
24
|
+
editorConfig,
|
|
25
|
+
value
|
|
26
|
+
]);
|
|
27
|
+
// useMemo for the initialConfig that depends on readOnly and processedValue
|
|
28
|
+
const initialConfig = useMemo(()=>{
|
|
29
|
+
if (processedValue && typeof processedValue !== 'object') {
|
|
30
|
+
throw new Error('The value passed to the Lexical editor is not an object. This is not supported. Please remove the data from the field and start again. This is the value that was passed in: ' + JSON.stringify(processedValue));
|
|
31
|
+
}
|
|
32
|
+
if (processedValue && Array.isArray(processedValue) && !('root' in processedValue)) {
|
|
33
|
+
throw new Error('You have tried to pass in data from the old, Slate editor, to the new, Lexical editor. This is not supported. There is no automatic conversion from Slate to Lexical data available yet (coming soon). Please remove the data from the field and start again.');
|
|
34
|
+
}
|
|
35
|
+
if (processedValue && 'jsonContent' in processedValue) {
|
|
36
|
+
throw new Error('You have tried to pass in data from payload-plugin-lexical. This is not supported. The data structure has changed in this editor, compared to the plugin, and there is no automatic conversion available yet (coming soon). Please remove the data from the field and start again.');
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
15
39
|
editable: readOnly !== true,
|
|
16
|
-
editorState:
|
|
40
|
+
editorState: processedValue != null ? JSON.stringify(processedValue) : undefined,
|
|
17
41
|
namespace: editorConfig.lexical.namespace,
|
|
18
42
|
nodes: [
|
|
19
43
|
...getEnabledNodes({
|
|
@@ -25,43 +49,30 @@ export const LexicalProvider = (props)=>{
|
|
|
25
49
|
},
|
|
26
50
|
theme: editorConfig.lexical.theme
|
|
27
51
|
};
|
|
28
|
-
setInitialConfig(newInitialConfig);
|
|
29
52
|
}, [
|
|
30
53
|
editorConfig,
|
|
31
|
-
|
|
32
|
-
|
|
54
|
+
processedValue,
|
|
55
|
+
readOnly
|
|
33
56
|
]);
|
|
34
|
-
if (editorConfig?.features?.hooks?.load?.length) {
|
|
35
|
-
editorConfig.features.hooks.load.forEach((hook)=>{
|
|
36
|
-
value = hook({
|
|
37
|
-
incomingEditorState: value
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
if (value && typeof value !== 'object') {
|
|
42
|
-
throw new Error('The value passed to the Lexical editor is not an object. This is not supported. Please remove the data from the field and start again. This is the value that was passed in: ' + JSON.stringify(value));
|
|
43
|
-
}
|
|
44
|
-
if (value && Array.isArray(value) && !('root' in value)) {
|
|
45
|
-
throw new Error('You have tried to pass in data from the old, Slate editor, to the new, Lexical editor. This is not supported. There is no automatic conversion from Slate to Lexical data available yet (coming soon). Please remove the data from the field and start again.');
|
|
46
|
-
}
|
|
47
|
-
if (value && 'jsonContent' in value) {
|
|
48
|
-
throw new Error('You have tried to pass in data from payload-plugin-lexical. This is not supported. The data structure has changed in this editor, compared to the plugin, and there is no automatic conversion available yet (coming soon). Please remove the data from the field and start again.');
|
|
49
|
-
}
|
|
50
57
|
if (!initialConfig) {
|
|
51
|
-
return /*#__PURE__*/
|
|
58
|
+
return /*#__PURE__*/ _jsx("p", {
|
|
59
|
+
children: "Loading..."
|
|
60
|
+
});
|
|
52
61
|
}
|
|
53
|
-
return /*#__PURE__*/
|
|
62
|
+
return /*#__PURE__*/ _jsx(LexicalComposer, {
|
|
54
63
|
initialConfig: initialConfig,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
children: /*#__PURE__*/ _jsx(EditorConfigProvider, {
|
|
65
|
+
editorConfig: editorConfig,
|
|
66
|
+
editorContainerRef: editorContainerRef,
|
|
67
|
+
fieldProps: fieldProps,
|
|
68
|
+
parentContext: parentContext,
|
|
69
|
+
children: /*#__PURE__*/ _jsx(LexicalEditorComponent, {
|
|
70
|
+
editorConfig: editorConfig,
|
|
71
|
+
editorContainerRef: editorContainerRef,
|
|
72
|
+
onChange: onChange
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
}, path);
|
|
65
76
|
};
|
|
66
77
|
|
|
67
78
|
//# sourceMappingURL=LexicalProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/field/lexical/LexicalProvider.tsx"],"sourcesContent":["'use client'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/field/lexical/LexicalProvider.tsx"],"sourcesContent":["'use client'\nimport type { InitialConfigType } from '@lexical/react/LexicalComposer.js'\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { EditorState, SerializedEditorState } from 'lexical'\nimport type { LexicalEditor } from 'lexical'\n\nimport { LexicalComposer } from '@lexical/react/LexicalComposer.js'\nimport * as React from 'react'\nimport { useMemo } from 'react'\n\nimport type { SanitizedClientEditorConfig } from './config/types.js'\n\nimport { LexicalEditor as LexicalEditorComponent } from './LexicalEditor.js'\nimport {\n EditorConfigProvider,\n useEditorConfigContext,\n} from './config/client/EditorConfigProvider.js'\nimport { getEnabledNodes } from './nodes/index.js'\n\nexport type LexicalProviderProps = {\n editorConfig: SanitizedClientEditorConfig\n fieldProps: FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n onChange: (editorState: EditorState, editor: LexicalEditor, tags: Set<string>) => void\n path: string\n readOnly: boolean\n value: SerializedEditorState\n}\nexport const LexicalProvider: React.FC<LexicalProviderProps> = (props) => {\n const { editorConfig, fieldProps, value, onChange, path, readOnly } = props\n\n const parentContext = useEditorConfigContext()\n\n const editorContainerRef = React.useRef<HTMLDivElement>(null)\n\n\n const processedValue = useMemo(() => {\n let processed = value\n if (editorConfig?.features?.hooks?.load?.length) {\n editorConfig.features.hooks.load.forEach((hook) => {\n processed = hook({ incomingEditorState: processed })\n })\n }\n return processed\n }, [editorConfig, value])\n\n // useMemo for the initialConfig that depends on readOnly and processedValue\n const initialConfig = useMemo<InitialConfigType>(() => {\n if (processedValue && typeof processedValue !== 'object') {\n throw new Error(\n 'The value passed to the Lexical editor is not an object. This is not supported. Please remove the data from the field and start again. This is the value that was passed in: ' +\n JSON.stringify(processedValue),\n )\n }\n\n if (processedValue && Array.isArray(processedValue) && !('root' in processedValue)) {\n throw new Error(\n 'You have tried to pass in data from the old, Slate editor, to the new, Lexical editor. This is not supported. There is no automatic conversion from Slate to Lexical data available yet (coming soon). Please remove the data from the field and start again.',\n )\n }\n\n if (processedValue && 'jsonContent' in processedValue) {\n throw new Error(\n 'You have tried to pass in data from payload-plugin-lexical. This is not supported. The data structure has changed in this editor, compared to the plugin, and there is no automatic conversion available yet (coming soon). Please remove the data from the field and start again.',\n )\n }\n\n return {\n editable: readOnly !== true,\n editorState: processedValue != null ? JSON.stringify(processedValue) : undefined,\n namespace: editorConfig.lexical.namespace,\n nodes: [...getEnabledNodes({ editorConfig })],\n onError: (error: Error) => {\n throw error\n },\n theme: editorConfig.lexical.theme,\n }\n }, [editorConfig, processedValue, readOnly])\n\n if (!initialConfig) {\n return <p>Loading...</p>\n }\n\n return (\n <LexicalComposer initialConfig={initialConfig} key={path}>\n <EditorConfigProvider\n editorConfig={editorConfig}\n editorContainerRef={editorContainerRef}\n fieldProps={fieldProps}\n parentContext={parentContext}\n >\n <LexicalEditorComponent\n editorConfig={editorConfig}\n editorContainerRef={editorContainerRef}\n onChange={onChange}\n />\n </EditorConfigProvider>\n </LexicalComposer>\n )\n}\n"],"names":["LexicalComposer","React","useMemo","LexicalEditor","LexicalEditorComponent","EditorConfigProvider","useEditorConfigContext","getEnabledNodes","LexicalProvider","props","editorConfig","fieldProps","value","onChange","path","readOnly","parentContext","editorContainerRef","useRef","processedValue","processed","features","hooks","load","length","forEach","hook","incomingEditorState","initialConfig","Error","JSON","stringify","Array","isArray","editable","editorState","undefined","namespace","lexical","nodes","onError","error","theme","p"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAMA,SAASA,eAAe,QAAQ,oCAAmC;AACnE,YAAYC,WAAW,QAAO;AAC9B,SAASC,OAAO,QAAQ,QAAO;AAI/B,SAASC,iBAAiBC,sBAAsB,QAAQ,qBAAoB;AAC5E,SACEC,oBAAoB,EACpBC,sBAAsB,QACjB,0CAAyC;AAChD,SAASC,eAAe,QAAQ,mBAAkB;AAclD,OAAO,MAAMC,kBAAkD,CAACC;IAC9D,MAAM,EAAEC,YAAY,EAAEC,UAAU,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGN;IAEtE,MAAMO,gBAAgBV;IAEtB,MAAMW,qBAAqBhB,MAAMiB,MAAM,CAAiB;IAGxD,MAAMC,iBAAiBjB,QAAQ;QAC7B,IAAIkB,YAAYR;QAChB,IAAIF,cAAcW,UAAUC,OAAOC,MAAMC,QAAQ;YAC/Cd,aAAaW,QAAQ,CAACC,KAAK,CAACC,IAAI,CAACE,OAAO,CAAC,CAACC;gBACxCN,YAAYM,KAAK;oBAAEC,qBAAqBP;gBAAU;YACpD;QACF;QACA,OAAOA;IACT,GAAG;QAACV;QAAcE;KAAM;IAExB,4EAA4E;IAC5E,MAAMgB,gBAAgB1B,QAA2B;QAC/C,IAAIiB,kBAAkB,OAAOA,mBAAmB,UAAU;YACxD,MAAM,IAAIU,MACR,kLACEC,KAAKC,SAAS,CAACZ;QAErB;QAEA,IAAIA,kBAAkBa,MAAMC,OAAO,CAACd,mBAAmB,CAAE,CAAA,UAAUA,cAAa,GAAI;YAClF,MAAM,IAAIU,MACR;QAEJ;QAEA,IAAIV,kBAAkB,iBAAiBA,gBAAgB;YACrD,MAAM,IAAIU,MACR;QAEJ;QAEA,OAAO;YACLK,UAAUnB,aAAa;YACvBoB,aAAahB,kBAAkB,OAAOW,KAAKC,SAAS,CAACZ,kBAAkBiB;YACvEC,WAAW3B,aAAa4B,OAAO,CAACD,SAAS;YACzCE,OAAO;mBAAIhC,gBAAgB;oBAAEG;gBAAa;aAAG;YAC7C8B,SAAS,CAACC;gBACR,MAAMA;YACR;YACAC,OAAOhC,aAAa4B,OAAO,CAACI,KAAK;QACnC;IACF,GAAG;QAAChC;QAAcS;QAAgBJ;KAAS;IAE3C,IAAI,CAACa,eAAe;QAClB,qBAAO,KAACe;sBAAE;;IACZ;IAEA,qBACE,KAAC3C;QAAgB4B,eAAeA;kBAC9B,cAAA,KAACvB;YACCK,cAAcA;YACdO,oBAAoBA;YACpBN,YAAYA;YACZK,eAAeA;sBAEf,cAAA,KAACZ;gBACCM,cAAcA;gBACdO,oBAAoBA;gBACpBJ,UAAUA;;;OAVoCC;AAexD,EAAC"}
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import type { FormFieldBase } from '@payloadcms/ui/fields/shared';
|
|
2
|
+
import type { LexicalEditor } from 'lexical';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import type { SanitizedClientEditorConfig } from '../types.js';
|
|
4
|
-
interface
|
|
5
|
+
export interface EditorConfigContextType {
|
|
6
|
+
blurEditor: (editorContext: EditorConfigContextType) => void;
|
|
7
|
+
childrenEditors: React.RefObject<Map<string, EditorConfigContextType>>;
|
|
8
|
+
editor: LexicalEditor;
|
|
5
9
|
editorConfig: SanitizedClientEditorConfig;
|
|
10
|
+
editorContainerRef: React.RefObject<HTMLDivElement>;
|
|
6
11
|
field: FormFieldBase & {
|
|
7
12
|
editorConfig: SanitizedClientEditorConfig;
|
|
8
13
|
name: string;
|
|
9
14
|
richTextComponentMap: Map<string, React.ReactNode>;
|
|
10
15
|
};
|
|
16
|
+
focusEditor: (editorContext: EditorConfigContextType) => void;
|
|
17
|
+
focusedEditor: EditorConfigContextType | null;
|
|
18
|
+
parentEditor: EditorConfigContextType;
|
|
19
|
+
registerChild: (uuid: string, editorContext: EditorConfigContextType) => void;
|
|
20
|
+
unregisterChild?: (uuid: string) => void;
|
|
11
21
|
uuid: string;
|
|
12
22
|
}
|
|
13
|
-
export declare const EditorConfigProvider: ({ children, editorConfig, fieldProps, }: {
|
|
23
|
+
export declare const EditorConfigProvider: ({ children, editorConfig, editorContainerRef, fieldProps, parentContext, }: {
|
|
14
24
|
children: React.ReactNode;
|
|
15
25
|
editorConfig: SanitizedClientEditorConfig;
|
|
26
|
+
editorContainerRef: React.RefObject<HTMLDivElement>;
|
|
16
27
|
fieldProps: FormFieldBase & {
|
|
17
28
|
editorConfig: SanitizedClientEditorConfig;
|
|
18
29
|
name: string;
|
|
19
30
|
richTextComponentMap: Map<string, React.ReactNode>;
|
|
20
31
|
};
|
|
32
|
+
parentContext?: EditorConfigContextType;
|
|
21
33
|
}) => React.ReactNode;
|
|
22
|
-
export declare const useEditorConfigContext: () =>
|
|
23
|
-
export {};
|
|
34
|
+
export declare const useEditorConfigContext: () => EditorConfigContextType;
|
|
24
35
|
//# sourceMappingURL=EditorConfigProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorConfigProvider.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/client/EditorConfigProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"EditorConfigProvider.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/client/EditorConfigProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAO9D,MAAM,WAAW,uBAAuB;IAEtC,UAAU,EAAE,CAAC,aAAa,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC5D,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAA;IACtE,MAAM,EAAE,aAAa,CAAA;IACrB,YAAY,EAAE,2BAA2B,CAAA;IACzC,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;IACnD,KAAK,EAAE,aAAa,GAAG;QACrB,YAAY,EAAE,2BAA2B,CAAA;QACzC,IAAI,EAAE,MAAM,CAAA;QACZ,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;KACnD,CAAA;IAED,WAAW,EAAE,CAAC,aAAa,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC7D,aAAa,EAAE,uBAAuB,GAAG,IAAI,CAAA;IAC7C,YAAY,EAAE,uBAAuB,CAAA;IACrC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC7E,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,IAAI,EAAE,MAAM,CAAA;CACb;AAQD,eAAO,MAAM,oBAAoB,+EAM9B;IACD,QAAQ,EAAE,MAAM,SAAS,CAAA;IACzB,YAAY,EAAE,2BAA2B,CAAA;IACzC,kBAAkB,EAAE,MAAM,SAAS,CAAC,cAAc,CAAC,CAAA;IACnD,UAAU,EAAE,aAAa,GAAG;QAC1B,YAAY,EAAE,2BAA2B,CAAA;QACzC,IAAI,EAAE,MAAM,CAAA;QACZ,oBAAoB,EAAE,IAAI,MAAM,EAAE,MAAM,SAAS,CAAC,CAAA;KACnD,CAAA;IACD,aAAa,CAAC,EAAE,uBAAuB,CAAA;CACxC,KAAG,MAAM,SA2ET,CAAA;AAED,eAAO,MAAM,sBAAsB,QAAO,uBAMzC,CAAA"}
|