@payloadcms/richtext-lexical 3.0.0-beta.9 → 3.0.0-canary.f6e77b8
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 +1 -1
- package/dist/cell/index.d.ts.map +1 -1
- package/dist/cell/index.js +2 -4
- package/dist/cell/index.js.map +1 -1
- package/dist/exports/components.d.ts +8 -2
- package/dist/exports/components.d.ts.map +1 -1
- package/dist/exports/components.js +8 -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.map +1 -1
- package/dist/field/features/align/feature.client.d.ts.map +1 -1
- package/dist/field/features/align/feature.client.js +127 -54
- package/dist/field/features/align/feature.client.js.map +1 -1
- 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 +1 -1
- package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
- package/dist/field/features/blockquote/feature.client.js +53 -40
- 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 +7 -7
- package/dist/field/features/blockquote/feature.server.js.map +1 -1
- 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 +3 -5
- 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 +37 -4
- package/dist/field/features/blocks/component/index.js.map +1 -1
- package/dist/field/features/blocks/drawer/index.d.ts.map +1 -1
- package/dist/field/features/blocks/drawer/index.js +2 -4
- package/dist/field/features/blocks/drawer/index.js.map +1 -1
- package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
- package/dist/field/features/blocks/feature.client.js +56 -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 +109 -77
- package/dist/field/features/blocks/feature.server.js.map +1 -1
- package/dist/field/features/blocks/nodes/BlocksNode.d.ts +1 -3
- package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/field/features/blocks/nodes/BlocksNode.js +1 -2
- 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 +5 -8
- 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 +4 -18
- 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 +6 -3
- package/dist/field/features/converters/html/field/index.js.map +1 -1
- package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts.map +1 -1
- 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 +2 -4
- package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -0
- package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts.map +1 -1
- 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 +4 -6
- package/dist/field/features/debug/treeView/plugin/index.js.map +1 -0
- 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/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.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.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.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.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.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.map +1 -1
- package/dist/field/features/heading/feature.client.js +71 -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 +5 -5
- package/dist/field/features/heading/feature.server.js.map +1 -1
- 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.map +1 -0
- package/dist/field/features/{horizontalrule → horizontalRule}/component/index.js +2 -4
- package/dist/field/features/horizontalRule/component/index.js.map +1 -0
- package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -0
- package/dist/field/features/horizontalRule/feature.client.js +76 -0
- package/dist/field/features/horizontalRule/feature.client.js.map +1 -0
- package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -0
- package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.js +4 -3
- package/dist/field/features/horizontalRule/feature.server.js.map +1 -0
- package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.d.ts.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.js.map +1 -1
- package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.d.ts +1 -3
- package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts.map +1 -0
- package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.js +1 -2
- 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 → horizontalRule}/plugin/index.js +5 -8
- package/dist/field/features/horizontalRule/plugin/index.js.map +1 -0
- package/dist/field/features/indent/feature.client.d.ts.map +1 -1
- package/dist/field/features/indent/feature.client.js +43 -42
- package/dist/field/features/indent/feature.client.js.map +1 -1
- 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 +3 -2
- 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.map +1 -1
- package/dist/field/features/link/feature.client.js +59 -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 +48 -9
- package/dist/field/features/link/feature.server.js.map +1 -1
- 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 +1 -3
- package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
- package/dist/field/features/link/nodes/LinkNode.js +2 -4
- 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 +5 -8
- 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 +2 -2
- 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 +93 -69
- 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.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 +10 -25
- 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 +1 -1
- package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
- package/dist/field/features/lists/checklist/feature.client.js +56 -32
- 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 +10 -10
- package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
- 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 +3 -4
- 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/feature.client.d.ts.map +1 -0
- package/dist/field/features/lists/orderedList/feature.client.js +96 -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 +7 -7
- package/dist/field/features/lists/orderedList/feature.server.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 +3 -4
- 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/unorderedList/feature.client.d.ts.map +1 -0
- package/dist/field/features/lists/unorderedList/feature.client.js +96 -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 +7 -7
- package/dist/field/features/lists/unorderedList/feature.server.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/nodes/unknownConvertedNode/index.d.ts +1 -3
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -4
- 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/nodes/unknownConvertedNode/index.d.ts +1 -3
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -4
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
- package/dist/field/features/paragraph/feature.client.js +45 -33
- package/dist/field/features/paragraph/feature.client.js.map +1 -1
- 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 +7 -13
- package/dist/field/features/relationship/drawer/index.js.map +1 -1
- package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
- package/dist/field/features/relationship/feature.client.js +37 -15
- 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 +5 -4
- package/dist/field/features/relationship/feature.server.js.map +1 -1
- package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +3 -8
- package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/field/features/relationship/nodes/RelationshipNode.js +8 -8
- 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 +56 -7
- 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 +9 -12
- 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/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 +4 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.js +152 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
- package/dist/field/features/toolbars/fixed/Toolbar/index.scss +81 -0
- package/dist/field/features/toolbars/fixed/feature.client.d.ts +3 -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 +3 -0
- package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
- package/dist/field/features/toolbars/fixed/feature.server.js +16 -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/{lexical/plugins/FloatingSelectToolbar → features/toolbars/inline/Toolbar}/index.js +112 -70
- 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 +3 -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 +16 -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 +29 -19
- 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 +27 -72
- 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 +139 -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 +128 -57
- 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 +5 -6
- 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 +59 -9
- 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 +8 -12
- package/dist/field/features/upload/drawer/index.js.map +1 -1
- package/dist/field/features/upload/feature.client.d.ts.map +1 -1
- package/dist/field/features/upload/feature.client.js +35 -10
- 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 +39 -11
- package/dist/field/features/upload/feature.server.js.map +1 -1
- package/dist/field/features/upload/nodes/UploadNode.d.ts +2 -14
- package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
- package/dist/field/features/upload/nodes/UploadNode.js +24 -11
- 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 +6 -11
- 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 +15 -9
- 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 +1 -1
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js.map +1 -1
- package/dist/field/lexical/EditorFocusProvider.d.ts +20 -0
- package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -0
- package/dist/field/lexical/EditorFocusProvider.js +78 -0
- package/dist/field/lexical/EditorFocusProvider.js.map +1 -0
- 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 +6 -3
- package/dist/field/lexical/EditorPlugin.js.map +1 -1
- package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/field/lexical/LexicalEditor.js +31 -15
- package/dist/field/lexical/LexicalEditor.js.map +1 -1
- package/dist/field/lexical/LexicalEditor.scss +3 -19
- 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 +4 -4
- package/dist/field/lexical/LexicalProvider.js.map +1 -1
- package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +2 -3
- package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
- 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 +1 -1
- package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
- package/dist/field/lexical/config/client/sanitize.js +81 -32
- 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 +11 -11
- 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 +23 -8
- package/dist/field/lexical/config/server/sanitize.js.map +1 -1
- package/dist/field/lexical/config/types.d.ts +1 -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 +1 -2
- package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +9 -9
- 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 +4 -4
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +6 -9
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +17 -25
- 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 +72 -67
- package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -4
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +3 -4
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +8 -7
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +8 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +25 -6
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
- 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/theme/EditorTheme.scss +13 -14
- package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
- package/dist/field/lexical/ui/ContentEditable.js +1 -2
- package/dist/field/lexical/ui/ContentEditable.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 +16 -0
- package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
- 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 +3 -0
- 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 +13 -21
- 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/index.d.ts +24 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +275 -184
- package/dist/index.js.map +1 -1
- package/dist/populate/defaultValue.d.ts.map +1 -1
- package/dist/populate/defaultValue.js +1 -0
- 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/types.d.ts +12 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/validate/index.d.ts +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/package.json +47 -46
- 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/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/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/horizontalrule/component/index.d.ts.map +0 -1
- package/dist/field/features/horizontalrule/component/index.js.map +0 -1
- package/dist/field/features/horizontalrule/feature.client.d.ts.map +0 -1
- package/dist/field/features/horizontalrule/feature.client.js +0 -53
- package/dist/field/features/horizontalrule/feature.client.js.map +0 -1
- package/dist/field/features/horizontalrule/feature.server.d.ts.map +0 -1
- package/dist/field/features/horizontalrule/feature.server.js.map +0 -1
- package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts.map +0 -1
- package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js.map +0 -1
- package/dist/field/features/horizontalrule/plugin/index.d.ts +0 -6
- package/dist/field/features/horizontalrule/plugin/index.d.ts.map +0 -1
- package/dist/field/features/horizontalrule/plugin/index.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.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/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/src/index.ts +0 -423
- /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts +0 -0
- /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.d.ts +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.client.d.ts +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/{horizontalrule → horizontalRule}/component/index.d.ts +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/feature.client.d.ts +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.d.ts +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.d.ts +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.js +0 -0
- /package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.scss +0 -0
- /package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts +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.client.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
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { useCallback, useEffect } from 'react';
|
|
3
|
+
const baseClass = 'toolbar-popup__dropdown';
|
|
4
|
+
import { mergeRegister } from '@lexical/utils';
|
|
5
|
+
import { useTranslation } from '@payloadcms/ui/providers/Translation';
|
|
6
|
+
import { $getSelection } from 'lexical';
|
|
7
|
+
import { useEditorFocus } from '../../../../lexical/EditorFocusProvider.js';
|
|
8
|
+
import { DropDown, DropDownItem } from './DropDown.js';
|
|
9
|
+
import './index.scss';
|
|
10
|
+
const ToolbarItem = ({ active, anchorElem, editor, enabled, item })=>{
|
|
11
|
+
const { i18n } = useTranslation();
|
|
12
|
+
if (item.Component) {
|
|
13
|
+
return item?.Component && /*#__PURE__*/ React.createElement(item.Component, {
|
|
14
|
+
active: active,
|
|
15
|
+
anchorElem: anchorElem,
|
|
16
|
+
editor: editor,
|
|
17
|
+
enabled: enabled,
|
|
18
|
+
item: item,
|
|
19
|
+
key: item.key
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
let title = item.key;
|
|
23
|
+
if (item.label) {
|
|
24
|
+
title = typeof item.label === 'function' ? item.label({
|
|
25
|
+
i18n
|
|
26
|
+
}) : item.label;
|
|
27
|
+
}
|
|
28
|
+
// Crop title to max. 25 characters
|
|
29
|
+
if (title.length > 25) {
|
|
30
|
+
title = title.substring(0, 25) + '...';
|
|
31
|
+
}
|
|
32
|
+
return /*#__PURE__*/ React.createElement(DropDownItem, {
|
|
33
|
+
active: active,
|
|
34
|
+
editor: editor,
|
|
35
|
+
enabled: enabled,
|
|
36
|
+
item: item,
|
|
37
|
+
key: item.key
|
|
38
|
+
}, item?.ChildComponent && /*#__PURE__*/ React.createElement(item.ChildComponent, null), /*#__PURE__*/ React.createElement("span", {
|
|
39
|
+
className: "text"
|
|
40
|
+
}, title));
|
|
41
|
+
};
|
|
42
|
+
export const ToolbarDropdown = ({ Icon, anchorElem, classNames, editor, groupKey, items, itemsContainerClassNames, label, maxActiveItems, onActiveChange })=>{
|
|
43
|
+
const [activeItemKeys, setActiveItemKeys] = React.useState([]);
|
|
44
|
+
const [enabledItemKeys, setEnabledItemKeys] = React.useState([]);
|
|
45
|
+
const editorFocusContext = useEditorFocus();
|
|
46
|
+
const updateStates = useCallback(()=>{
|
|
47
|
+
editor.getEditorState().read(()=>{
|
|
48
|
+
const selection = $getSelection();
|
|
49
|
+
const _activeItemKeys = [];
|
|
50
|
+
const _activeItems = [];
|
|
51
|
+
const _enabledItemKeys = [];
|
|
52
|
+
for (const item of items){
|
|
53
|
+
if (item.isActive && (!maxActiveItems || _activeItemKeys.length < maxActiveItems)) {
|
|
54
|
+
const isActive = item.isActive({
|
|
55
|
+
editor,
|
|
56
|
+
editorFocusContext,
|
|
57
|
+
selection
|
|
58
|
+
});
|
|
59
|
+
if (isActive) {
|
|
60
|
+
_activeItemKeys.push(item.key);
|
|
61
|
+
_activeItems.push(item);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (item.isEnabled) {
|
|
65
|
+
const isEnabled = item.isEnabled({
|
|
66
|
+
editor,
|
|
67
|
+
editorFocusContext,
|
|
68
|
+
selection
|
|
69
|
+
});
|
|
70
|
+
if (isEnabled) {
|
|
71
|
+
_enabledItemKeys.push(item.key);
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
_enabledItemKeys.push(item.key);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
setActiveItemKeys(_activeItemKeys);
|
|
78
|
+
setEnabledItemKeys(_enabledItemKeys);
|
|
79
|
+
if (onActiveChange) {
|
|
80
|
+
onActiveChange({
|
|
81
|
+
activeItems: _activeItems
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}, [
|
|
86
|
+
editor,
|
|
87
|
+
editorFocusContext,
|
|
88
|
+
items,
|
|
89
|
+
maxActiveItems,
|
|
90
|
+
onActiveChange
|
|
91
|
+
]);
|
|
92
|
+
useEffect(()=>{
|
|
93
|
+
updateStates();
|
|
94
|
+
}, [
|
|
95
|
+
updateStates
|
|
96
|
+
]);
|
|
97
|
+
useEffect(()=>{
|
|
98
|
+
document.addEventListener('mouseup', updateStates);
|
|
99
|
+
return ()=>{
|
|
100
|
+
document.removeEventListener('mouseup', updateStates);
|
|
101
|
+
};
|
|
102
|
+
}, [
|
|
103
|
+
updateStates
|
|
104
|
+
]);
|
|
105
|
+
useEffect(()=>{
|
|
106
|
+
return mergeRegister(editor.registerUpdateListener(()=>{
|
|
107
|
+
updateStates();
|
|
108
|
+
}));
|
|
109
|
+
}, [
|
|
110
|
+
editor,
|
|
111
|
+
updateStates
|
|
112
|
+
]);
|
|
113
|
+
return /*#__PURE__*/ React.createElement(DropDown, {
|
|
114
|
+
Icon: Icon,
|
|
115
|
+
buttonAriaLabel: `${groupKey} dropdown`,
|
|
116
|
+
buttonClassName: [
|
|
117
|
+
baseClass,
|
|
118
|
+
`${baseClass}-${groupKey}`,
|
|
119
|
+
...classNames || []
|
|
120
|
+
].filter(Boolean).join(' '),
|
|
121
|
+
itemsContainerClassNames: [
|
|
122
|
+
`${baseClass}-items`,
|
|
123
|
+
...itemsContainerClassNames || []
|
|
124
|
+
],
|
|
125
|
+
key: groupKey,
|
|
126
|
+
label: label
|
|
127
|
+
}, items.length && items.map((item)=>{
|
|
128
|
+
return /*#__PURE__*/ React.createElement(ToolbarItem, {
|
|
129
|
+
active: activeItemKeys.includes(item.key),
|
|
130
|
+
anchorElem: anchorElem,
|
|
131
|
+
editor: editor,
|
|
132
|
+
enabled: enabledItemKeys.includes(item.key),
|
|
133
|
+
item: item,
|
|
134
|
+
key: item.key
|
|
135
|
+
});
|
|
136
|
+
}));
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/field/features/toolbars/shared/ToolbarDropdown/index.tsx"],"sourcesContent":["'use client'\nimport React, { useCallback, useEffect } from 'react'\n\nconst baseClass = 'toolbar-popup__dropdown'\n\nimport type { LexicalEditor } from 'lexical'\n\nimport { mergeRegister } from '@lexical/utils'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport { $getSelection } from 'lexical'\n\nimport type { ToolbarGroupItem } from '../../types.js'\n\nimport { useEditorFocus } from '../../../../lexical/EditorFocusProvider.js'\nimport { DropDown, DropDownItem } from './DropDown.js'\nimport './index.scss'\n\nconst ToolbarItem = ({\n active,\n anchorElem,\n editor,\n enabled,\n item,\n}: {\n active?: boolean\n anchorElem: HTMLElement\n editor: LexicalEditor\n enabled?: boolean\n item: ToolbarGroupItem\n}) => {\n const { i18n } = useTranslation()\n\n if (item.Component) {\n return (\n item?.Component && (\n <item.Component\n active={active}\n anchorElem={anchorElem}\n editor={editor}\n enabled={enabled}\n item={item}\n key={item.key}\n />\n )\n )\n }\n\n let title = item.key\n if (item.label) {\n title = typeof item.label === 'function' ? item.label({ i18n }) : item.label\n }\n // Crop title to max. 25 characters\n if (title.length > 25) {\n title = title.substring(0, 25) + '...'\n }\n\n return (\n <DropDownItem active={active} editor={editor} enabled={enabled} item={item} key={item.key}>\n {item?.ChildComponent && <item.ChildComponent />}\n <span className=\"text\">{title}</span>\n </DropDownItem>\n )\n}\n\nexport const ToolbarDropdown = ({\n Icon,\n anchorElem,\n classNames,\n editor,\n groupKey,\n items,\n itemsContainerClassNames,\n label,\n maxActiveItems,\n onActiveChange,\n}: {\n Icon?: React.FC\n anchorElem: HTMLElement\n classNames?: string[]\n editor: LexicalEditor\n groupKey: string\n items: ToolbarGroupItem[]\n itemsContainerClassNames?: string[]\n label?: string\n /**\n * Maximum number of active items allowed. This is a performance optimization to prevent\n * unnecessary item active checks when the maximum number of active items is reached.\n */\n maxActiveItems?: number\n onActiveChange?: ({ activeItems }: { activeItems: ToolbarGroupItem[] }) => void\n}) => {\n const [activeItemKeys, setActiveItemKeys] = React.useState<string[]>([])\n const [enabledItemKeys, setEnabledItemKeys] = React.useState<string[]>([])\n const editorFocusContext = useEditorFocus()\n\n const updateStates = useCallback(() => {\n editor.getEditorState().read(() => {\n const selection = $getSelection()\n\n const _activeItemKeys: string[] = []\n const _activeItems: ToolbarGroupItem[] = []\n const _enabledItemKeys: string[] = []\n\n for (const item of items) {\n if (item.isActive && (!maxActiveItems || _activeItemKeys.length < maxActiveItems)) {\n const isActive = item.isActive({ editor, editorFocusContext, selection })\n if (isActive) {\n _activeItemKeys.push(item.key)\n _activeItems.push(item)\n }\n }\n if (item.isEnabled) {\n const isEnabled = item.isEnabled({ editor, editorFocusContext, selection })\n if (isEnabled) {\n _enabledItemKeys.push(item.key)\n }\n } else {\n _enabledItemKeys.push(item.key)\n }\n }\n setActiveItemKeys(_activeItemKeys)\n setEnabledItemKeys(_enabledItemKeys)\n\n if (onActiveChange) {\n onActiveChange({ activeItems: _activeItems })\n }\n })\n }, [editor, editorFocusContext, items, maxActiveItems, onActiveChange])\n\n useEffect(() => {\n updateStates()\n }, [updateStates])\n\n useEffect(() => {\n document.addEventListener('mouseup', updateStates)\n return () => {\n document.removeEventListener('mouseup', updateStates)\n }\n }, [updateStates])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerUpdateListener(() => {\n updateStates()\n }),\n )\n }, [editor, updateStates])\n\n return (\n <DropDown\n Icon={Icon}\n buttonAriaLabel={`${groupKey} dropdown`}\n buttonClassName={[baseClass, `${baseClass}-${groupKey}`, ...(classNames || [])]\n .filter(Boolean)\n .join(' ')}\n itemsContainerClassNames={[`${baseClass}-items`, ...(itemsContainerClassNames || [])]}\n key={groupKey}\n label={label}\n >\n {items.length &&\n items.map((item) => {\n return (\n <ToolbarItem\n active={activeItemKeys.includes(item.key)}\n anchorElem={anchorElem}\n editor={editor}\n enabled={enabledItemKeys.includes(item.key)}\n item={item}\n key={item.key}\n />\n )\n })}\n </DropDown>\n )\n}\n"],"names":["React","useCallback","useEffect","baseClass","mergeRegister","useTranslation","$getSelection","useEditorFocus","DropDown","DropDownItem","ToolbarItem","active","anchorElem","editor","enabled","item","i18n","Component","key","title","label","length","substring","ChildComponent","span","className","ToolbarDropdown","Icon","classNames","groupKey","items","itemsContainerClassNames","maxActiveItems","onActiveChange","activeItemKeys","setActiveItemKeys","useState","enabledItemKeys","setEnabledItemKeys","editorFocusContext","updateStates","getEditorState","read","selection","_activeItemKeys","_activeItems","_enabledItemKeys","isActive","push","isEnabled","activeItems","document","addEventListener","removeEventListener","registerUpdateListener","buttonAriaLabel","buttonClassName","filter","Boolean","join","map","includes"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,OAAOA,SAASC,WAAW,EAAEC,SAAS,QAAQ,QAAO;AAErD,MAAMC,YAAY;AAIlB,SAASC,aAAa,QAAQ,iBAAgB;AAC9C,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,aAAa,QAAQ,UAAS;AAIvC,SAASC,cAAc,QAAQ,6CAA4C;AAC3E,SAASC,QAAQ,EAAEC,YAAY,QAAQ,gBAAe;AACtD,OAAO,eAAc;AAErB,MAAMC,cAAc,CAAC,EACnBC,MAAM,EACNC,UAAU,EACVC,MAAM,EACNC,OAAO,EACPC,IAAI,EAOL;IACC,MAAM,EAAEC,IAAI,EAAE,GAAGX;IAEjB,IAAIU,KAAKE,SAAS,EAAE;QAClB,OACEF,MAAME,2BACJ,oBAACF,KAAKE,SAAS;YACbN,QAAQA;YACRC,YAAYA;YACZC,QAAQA;YACRC,SAASA;YACTC,MAAMA;YACNG,KAAKH,KAAKG,GAAG;;IAIrB;IAEA,IAAIC,QAAQJ,KAAKG,GAAG;IACpB,IAAIH,KAAKK,KAAK,EAAE;QACdD,QAAQ,OAAOJ,KAAKK,KAAK,KAAK,aAAaL,KAAKK,KAAK,CAAC;YAAEJ;QAAK,KAAKD,KAAKK,KAAK;IAC9E;IACA,mCAAmC;IACnC,IAAID,MAAME,MAAM,GAAG,IAAI;QACrBF,QAAQA,MAAMG,SAAS,CAAC,GAAG,MAAM;IACnC;IAEA,qBACE,oBAACb;QAAaE,QAAQA;QAAQE,QAAQA;QAAQC,SAASA;QAASC,MAAMA;QAAMG,KAAKH,KAAKG,GAAG;OACtFH,MAAMQ,gCAAkB,oBAACR,KAAKQ,cAAc,uBAC7C,oBAACC;QAAKC,WAAU;OAAQN;AAG9B;AAEA,OAAO,MAAMO,kBAAkB,CAAC,EAC9BC,IAAI,EACJf,UAAU,EACVgB,UAAU,EACVf,MAAM,EACNgB,QAAQ,EACRC,KAAK,EACLC,wBAAwB,EACxBX,KAAK,EACLY,cAAc,EACdC,cAAc,EAgBf;IACC,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGnC,MAAMoC,QAAQ,CAAW,EAAE;IACvE,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGtC,MAAMoC,QAAQ,CAAW,EAAE;IACzE,MAAMG,qBAAqBhC;IAE3B,MAAMiC,eAAevC,YAAY;QAC/BY,OAAO4B,cAAc,GAAGC,IAAI,CAAC;YAC3B,MAAMC,YAAYrC;YAElB,MAAMsC,kBAA4B,EAAE;YACpC,MAAMC,eAAmC,EAAE;YAC3C,MAAMC,mBAA6B,EAAE;YAErC,KAAK,MAAM/B,QAAQe,MAAO;gBACxB,IAAIf,KAAKgC,QAAQ,IAAK,CAAA,CAACf,kBAAkBY,gBAAgBvB,MAAM,GAAGW,cAAa,GAAI;oBACjF,MAAMe,WAAWhC,KAAKgC,QAAQ,CAAC;wBAAElC;wBAAQ0B;wBAAoBI;oBAAU;oBACvE,IAAII,UAAU;wBACZH,gBAAgBI,IAAI,CAACjC,KAAKG,GAAG;wBAC7B2B,aAAaG,IAAI,CAACjC;oBACpB;gBACF;gBACA,IAAIA,KAAKkC,SAAS,EAAE;oBAClB,MAAMA,YAAYlC,KAAKkC,SAAS,CAAC;wBAAEpC;wBAAQ0B;wBAAoBI;oBAAU;oBACzE,IAAIM,WAAW;wBACbH,iBAAiBE,IAAI,CAACjC,KAAKG,GAAG;oBAChC;gBACF,OAAO;oBACL4B,iBAAiBE,IAAI,CAACjC,KAAKG,GAAG;gBAChC;YACF;YACAiB,kBAAkBS;YAClBN,mBAAmBQ;YAEnB,IAAIb,gBAAgB;gBAClBA,eAAe;oBAAEiB,aAAaL;gBAAa;YAC7C;QACF;IACF,GAAG;QAAChC;QAAQ0B;QAAoBT;QAAOE;QAAgBC;KAAe;IAEtE/B,UAAU;QACRsC;IACF,GAAG;QAACA;KAAa;IAEjBtC,UAAU;QACRiD,SAASC,gBAAgB,CAAC,WAAWZ;QACrC,OAAO;YACLW,SAASE,mBAAmB,CAAC,WAAWb;QAC1C;IACF,GAAG;QAACA;KAAa;IAEjBtC,UAAU;QACR,OAAOE,cACLS,OAAOyC,sBAAsB,CAAC;YAC5Bd;QACF;IAEJ,GAAG;QAAC3B;QAAQ2B;KAAa;IAEzB,qBACE,oBAAChC;QACCmB,MAAMA;QACN4B,iBAAiB,CAAC,EAAE1B,SAAS,SAAS,CAAC;QACvC2B,iBAAiB;YAACrD;YAAW,CAAC,EAAEA,UAAU,CAAC,EAAE0B,SAAS,CAAC;eAAMD,cAAc,EAAE;SAAE,CAC5E6B,MAAM,CAACC,SACPC,IAAI,CAAC;QACR5B,0BAA0B;YAAC,CAAC,EAAE5B,UAAU,MAAM,CAAC;eAAM4B,4BAA4B,EAAE;SAAE;QACrFb,KAAKW;QACLT,OAAOA;OAENU,MAAMT,MAAM,IACXS,MAAM8B,GAAG,CAAC,CAAC7C;QACT,qBACE,oBAACL;YACCC,QAAQuB,eAAe2B,QAAQ,CAAC9C,KAAKG,GAAG;YACxCN,YAAYA;YACZC,QAAQA;YACRC,SAASuB,gBAAgBwB,QAAQ,CAAC9C,KAAKG,GAAG;YAC1CH,MAAMA;YACNG,KAAKH,KAAKG,GAAG;;IAGnB;AAGR,EAAC"}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
@import '../../../../../scss/styles
|
|
1
|
+
@import '../../../../../scss/styles';
|
|
2
2
|
|
|
3
|
-
.
|
|
3
|
+
.toolbar-popup__dropdown {
|
|
4
4
|
display: flex;
|
|
5
5
|
align-items: center;
|
|
6
6
|
vertical-align: middle;
|
|
7
7
|
justify-content: center;
|
|
8
8
|
height: 30px;
|
|
9
|
-
width: 40px;
|
|
10
9
|
border: 0;
|
|
11
10
|
background: none;
|
|
12
11
|
border-radius: 4px;
|
|
13
12
|
cursor: pointer;
|
|
14
13
|
position: relative;
|
|
15
|
-
padding: 0;
|
|
14
|
+
padding: 0 10px;
|
|
15
|
+
|
|
16
|
+
&-label {
|
|
17
|
+
color: var(--color-base-600);
|
|
18
|
+
padding: 0 10px;
|
|
19
|
+
}
|
|
16
20
|
|
|
17
21
|
&:disabled {
|
|
18
22
|
cursor: not-allowed;
|
|
@@ -26,10 +30,10 @@
|
|
|
26
30
|
background-color: var(--color-base-100);
|
|
27
31
|
}
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
.active {
|
|
30
34
|
background-color: var(--color-base-100);
|
|
31
35
|
|
|
32
|
-
.
|
|
36
|
+
.toolbar-popup__dropdown-caret {
|
|
33
37
|
&:after {
|
|
34
38
|
transform: rotate(0deg);
|
|
35
39
|
}
|
|
@@ -50,9 +54,9 @@
|
|
|
50
54
|
height: 4px;
|
|
51
55
|
|
|
52
56
|
opacity: 0.3;
|
|
53
|
-
background-image: url(
|
|
54
|
-
background-position-y:
|
|
55
|
-
background-position-x:
|
|
57
|
+
background-image: url(../../../../lexical/ui/icons/Caret/index.svg);
|
|
58
|
+
background-position-y: 0;
|
|
59
|
+
background-position-x: 0;
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
62
|
|
|
@@ -60,17 +64,25 @@
|
|
|
60
64
|
position: absolute;
|
|
61
65
|
background: var(--color-base-0);
|
|
62
66
|
border-radius: 4px;
|
|
63
|
-
width: 132.5px;
|
|
67
|
+
min-width: 132.5px;
|
|
68
|
+
max-width: 200px;
|
|
64
69
|
z-index: 100;
|
|
65
70
|
|
|
66
|
-
.
|
|
71
|
+
.toolbar-popup__dropdown-item {
|
|
67
72
|
all: unset; // reset all default button styles
|
|
68
73
|
cursor: pointer;
|
|
69
74
|
color: var(--color-base-900);
|
|
70
75
|
|
|
71
|
-
|
|
76
|
+
.text {
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:hover:not([disabled]), &.active {
|
|
72
83
|
background-color: var(--color-base-100);
|
|
73
84
|
}
|
|
85
|
+
|
|
74
86
|
padding-left: 6.25px;
|
|
75
87
|
padding-right: 6.25px;
|
|
76
88
|
width: 100%;
|
|
@@ -91,7 +103,7 @@
|
|
|
91
103
|
}
|
|
92
104
|
|
|
93
105
|
html[data-theme='light'] {
|
|
94
|
-
.
|
|
106
|
+
.toolbar-popup__dropdown {
|
|
95
107
|
&-items {
|
|
96
108
|
position: absolute;
|
|
97
109
|
@include shadow-m;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { I18n } from '@payloadcms/translations';
|
|
2
|
+
import type { BaseSelection, LexicalEditor } from 'lexical';
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
import type { EditorFocusContextType } from '../../lexical/EditorFocusProvider.js';
|
|
5
|
+
export type ToolbarGroup = {
|
|
6
|
+
ChildComponent?: React.FC;
|
|
7
|
+
items: Array<ToolbarGroupItem>;
|
|
8
|
+
key: string;
|
|
9
|
+
order?: number;
|
|
10
|
+
type: 'dropdown';
|
|
11
|
+
} | {
|
|
12
|
+
items: Array<ToolbarGroupItem>;
|
|
13
|
+
key: string;
|
|
14
|
+
order?: number;
|
|
15
|
+
type: 'buttons';
|
|
16
|
+
};
|
|
17
|
+
export type ToolbarGroupItem = {
|
|
18
|
+
ChildComponent?: React.FC;
|
|
19
|
+
/** Use component to ignore the children and onClick properties. It does not use the default, pre-defined format Button component */
|
|
20
|
+
Component?: React.FC<{
|
|
21
|
+
active?: boolean;
|
|
22
|
+
anchorElem: HTMLElement;
|
|
23
|
+
editor: LexicalEditor;
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
item: ToolbarGroupItem;
|
|
26
|
+
}>;
|
|
27
|
+
isActive?: ({ editor, editorFocusContext, selection, }: {
|
|
28
|
+
editor: LexicalEditor;
|
|
29
|
+
editorFocusContext: EditorFocusContextType;
|
|
30
|
+
selection: BaseSelection;
|
|
31
|
+
}) => boolean;
|
|
32
|
+
isEnabled?: ({ editor, editorFocusContext, selection, }: {
|
|
33
|
+
editor: LexicalEditor;
|
|
34
|
+
editorFocusContext: EditorFocusContextType;
|
|
35
|
+
selection: BaseSelection;
|
|
36
|
+
}) => boolean;
|
|
37
|
+
key: string;
|
|
38
|
+
/** The label is displayed as text if the item is part of a dropdown group */
|
|
39
|
+
label?: (({ i18n }: {
|
|
40
|
+
i18n: I18n;
|
|
41
|
+
}) => string) | string;
|
|
42
|
+
onSelect?: ({ editor, isActive }: {
|
|
43
|
+
editor: LexicalEditor;
|
|
44
|
+
isActive: boolean;
|
|
45
|
+
}) => void;
|
|
46
|
+
order?: number;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/field/features/toolbars/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAElF,MAAM,MAAM,YAAY,GACpB;IACE,cAAc,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACzB,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAA;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,UAAU,CAAA;CACjB,GACD;IACE,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAA;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,SAAS,CAAA;CAChB,CAAA;AAEL,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACzB,oIAAoI;IACpI,SAAS,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QACnB,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,UAAU,EAAE,WAAW,CAAA;QACvB,MAAM,EAAE,aAAa,CAAA;QACrB,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,IAAI,EAAE,gBAAgB,CAAA;KACvB,CAAC,CAAA;IACF,QAAQ,CAAC,EAAE,CAAC,EACV,MAAM,EACN,kBAAkB,EAClB,SAAS,GACV,EAAE;QACD,MAAM,EAAE,aAAa,CAAA;QACrB,kBAAkB,EAAE,sBAAsB,CAAA;QAC1C,SAAS,EAAE,aAAa,CAAA;KACzB,KAAK,OAAO,CAAA;IACb,SAAS,CAAC,EAAE,CAAC,EACX,MAAM,EACN,kBAAkB,EAClB,SAAS,GACV,EAAE;QACD,MAAM,EAAE,aAAa,CAAA;QACrB,kBAAkB,EAAE,sBAAsB,CAAA;QAC1C,SAAS,EAAE,aAAa,CAAA;KACzB,KAAK,OAAO,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,6EAA6E;IAC7E,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,KAAK,MAAM,CAAC,GAAG,MAAM,CAAA;IACvD,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;QAAE,MAAM,EAAE,aAAa,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAA;IACvF,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/toolbars/types.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { BaseSelection, LexicalEditor } from 'lexical'\nimport type React from 'react'\n\nimport type { EditorFocusContextType } from '../../lexical/EditorFocusProvider.js'\n\nexport type ToolbarGroup =\n | {\n ChildComponent?: React.FC\n items: Array<ToolbarGroupItem>\n key: string\n order?: number\n type: 'dropdown'\n }\n | {\n items: Array<ToolbarGroupItem>\n key: string\n order?: number\n type: 'buttons'\n }\n\nexport type ToolbarGroupItem = {\n ChildComponent?: React.FC\n /** Use component to ignore the children and onClick properties. It does not use the default, pre-defined format Button component */\n Component?: React.FC<{\n active?: boolean\n anchorElem: HTMLElement\n editor: LexicalEditor\n enabled?: boolean\n item: ToolbarGroupItem\n }>\n isActive?: ({\n editor,\n editorFocusContext,\n selection,\n }: {\n editor: LexicalEditor\n editorFocusContext: EditorFocusContextType\n selection: BaseSelection\n }) => boolean\n isEnabled?: ({\n editor,\n editorFocusContext,\n selection,\n }: {\n editor: LexicalEditor\n editorFocusContext: EditorFocusContextType\n selection: BaseSelection\n }) => boolean\n key: string\n /** The label is displayed as text if the item is part of a dropdown group */\n label?: (({ i18n }: { i18n: I18n }) => string) | string\n onSelect?: ({ editor, isActive }: { editor: LexicalEditor; isActive: boolean }) => void\n order?: number\n}\n"],"names":[],"rangeMappings":"","mappings":"AAqBA,WAiCC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LexicalNode } from 'lexical';
|
|
2
|
+
import type { NodeWithHooks } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Utility function to create a node with hooks. You don't have to use this utility, but it improves type inference
|
|
5
|
+
* @param node the node
|
|
6
|
+
*/
|
|
7
|
+
export declare function createNode<Node extends LexicalNode>(node: NodeWithHooks<Node>): NodeWithHooks<Node>;
|
|
8
|
+
//# sourceMappingURL=typeUtilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeUtilities.d.ts","sourceRoot":"","sources":["../../../src/field/features/typeUtilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,SAAS,WAAW,EACjD,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,GACxB,aAAa,CAAC,IAAI,CAAC,CAErB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/field/features/typeUtilities.ts"],"sourcesContent":["import type { LexicalNode } from 'lexical'\n\nimport type { NodeWithHooks } from './types.js'\n\n/**\n * Utility function to create a node with hooks. You don't have to use this utility, but it improves type inference\n * @param node the node\n */\nexport function createNode<Node extends LexicalNode>(\n node: NodeWithHooks<Node>,\n): NodeWithHooks<Node> {\n return node\n}\n"],"names":["createNode","node"],"rangeMappings":";;;;;","mappings":"AAIA;;;CAGC,GACD,OAAO,SAASA,WACdC,IAAyB;IAEzB,OAAOA;AACT"}
|
|
@@ -6,31 +6,36 @@ import type { SerializedLexicalNode } from 'lexical';
|
|
|
6
6
|
import type { LexicalNodeReplacement } from 'lexical';
|
|
7
7
|
import type { RequestContext } from 'payload';
|
|
8
8
|
import type { SanitizedConfig } from 'payload/config';
|
|
9
|
-
import type { Field,
|
|
9
|
+
import type { Field, PayloadRequestWithData, ReplaceAny, RichTextField, ValidateOptions } from 'payload/types';
|
|
10
10
|
import type React from 'react';
|
|
11
11
|
import type { AdapterProps } from '../../types.js';
|
|
12
12
|
import type { ClientEditorConfig, ServerEditorConfig } from '../lexical/config/types.js';
|
|
13
|
-
import type { FloatingToolbarSection } from '../lexical/plugins/FloatingSelectToolbar/types.js';
|
|
14
13
|
import type { SlashMenuGroup } from '../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
|
|
15
14
|
import type { HTMLConverter } from './converters/html/converter/types.js';
|
|
16
|
-
|
|
15
|
+
import type { ToolbarGroup } from './toolbars/types.js';
|
|
16
|
+
export type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = ({ context, currentDepth, depth, editorPopulationPromises, field, fieldPromises, findMany, flattenLocales, node, overrideAccess, populationPromises, req, showHiddenFields, siblingDoc, }: {
|
|
17
17
|
context: RequestContext;
|
|
18
18
|
currentDepth: number;
|
|
19
19
|
depth: number;
|
|
20
|
+
draft: boolean;
|
|
20
21
|
/**
|
|
21
22
|
* This maps all population promises to the node type
|
|
22
23
|
*/
|
|
23
24
|
editorPopulationPromises: Map<string, Array<PopulationPromise>>;
|
|
24
25
|
field: RichTextField<SerializedEditorState, AdapterProps>;
|
|
26
|
+
/**
|
|
27
|
+
* fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises
|
|
28
|
+
*/
|
|
29
|
+
fieldPromises: Promise<void>[];
|
|
25
30
|
findMany: boolean;
|
|
26
31
|
flattenLocales: boolean;
|
|
27
32
|
node: T;
|
|
28
33
|
overrideAccess: boolean;
|
|
29
34
|
populationPromises: Promise<void>[];
|
|
30
|
-
req:
|
|
35
|
+
req: PayloadRequestWithData;
|
|
31
36
|
showHiddenFields: boolean;
|
|
32
37
|
siblingDoc: Record<string, unknown>;
|
|
33
|
-
}) =>
|
|
38
|
+
}) => void;
|
|
34
39
|
export type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({ node, nodeValidations, validation, }: {
|
|
35
40
|
node: T;
|
|
36
41
|
nodeValidations: Map<string, Array<NodeValidation>>;
|
|
@@ -47,12 +52,17 @@ export type FeatureProviderServer<ServerFeatureProps, ClientFeatureProps> = {
|
|
|
47
52
|
dependenciesPriority?: string[];
|
|
48
53
|
/** Keys of soft-dependencies needed for this feature. The FeatureProviders dependencies are optional, but are considered as last-priority in the loading process */
|
|
49
54
|
dependenciesSoft?: string[];
|
|
55
|
+
/**
|
|
56
|
+
* This is being called during the payload sanitization process
|
|
57
|
+
*/
|
|
50
58
|
feature: (props: {
|
|
59
|
+
config: SanitizedConfig;
|
|
51
60
|
/** unSanitizedEditorConfig.features, but mapped */
|
|
52
61
|
featureProviderMap: ServerFeatureProviderMap;
|
|
62
|
+
isRoot?: boolean;
|
|
53
63
|
resolvedFeatures: ResolvedServerFeatureMap;
|
|
54
64
|
unSanitizedEditorConfig: ServerEditorConfig;
|
|
55
|
-
}) => ServerFeature<ServerFeatureProps, ClientFeatureProps>;
|
|
65
|
+
}) => Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>> | ServerFeature<ServerFeatureProps, ClientFeatureProps>;
|
|
56
66
|
key: string;
|
|
57
67
|
/** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */
|
|
58
68
|
serverFeatureProps: ServerFeatureProps;
|
|
@@ -74,14 +84,18 @@ export type FeatureProviderClient<ClientFeatureProps> = {
|
|
|
74
84
|
unSanitizedEditorConfig: ClientEditorConfig;
|
|
75
85
|
}) => ClientFeature<ClientFeatureProps>;
|
|
76
86
|
};
|
|
87
|
+
export type PluginComponent<ClientFeatureProps = any> = React.FC<{
|
|
88
|
+
clientProps: ClientFeatureProps;
|
|
89
|
+
}>;
|
|
90
|
+
export type PluginComponentWithAnchor<ClientFeatureProps = any> = React.FC<{
|
|
91
|
+
anchorElem: HTMLElement;
|
|
92
|
+
clientProps: ClientFeatureProps;
|
|
93
|
+
}>;
|
|
77
94
|
export type ClientFeature<ClientFeatureProps> = {
|
|
78
95
|
/**
|
|
79
96
|
* Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to
|
|
80
97
|
*/
|
|
81
98
|
clientFeatureProps: ClientComponentProps<ClientFeatureProps>;
|
|
82
|
-
floatingSelectToolbar?: {
|
|
83
|
-
sections: FloatingToolbarSection[];
|
|
84
|
-
};
|
|
85
99
|
hooks?: {
|
|
86
100
|
load?: ({ incomingEditorState, }: {
|
|
87
101
|
incomingEditorState: SerializedEditorState;
|
|
@@ -92,33 +106,90 @@ export type ClientFeature<ClientFeatureProps> = {
|
|
|
92
106
|
};
|
|
93
107
|
markdownTransformers?: Transformer[];
|
|
94
108
|
nodes?: Array<Klass<LexicalNode> | LexicalNodeReplacement>;
|
|
109
|
+
/**
|
|
110
|
+
* Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more "outside" functionality
|
|
111
|
+
*/
|
|
95
112
|
plugins?: Array<{
|
|
96
|
-
Component:
|
|
113
|
+
Component: PluginComponent<ClientFeatureProps>;
|
|
97
114
|
position: 'bottom';
|
|
98
115
|
} | {
|
|
99
|
-
Component:
|
|
116
|
+
Component: PluginComponent<ClientFeatureProps>;
|
|
100
117
|
position: 'normal';
|
|
101
118
|
} | {
|
|
102
|
-
Component:
|
|
119
|
+
Component: PluginComponent<ClientFeatureProps>;
|
|
103
120
|
position: 'top';
|
|
104
121
|
} | {
|
|
105
|
-
Component:
|
|
106
|
-
anchorElem: HTMLElement;
|
|
107
|
-
}>;
|
|
122
|
+
Component: PluginComponentWithAnchor<ClientFeatureProps>;
|
|
108
123
|
position: 'floatingAnchorElem';
|
|
109
124
|
}>;
|
|
110
125
|
slashMenu?: {
|
|
111
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Dynamic groups allow you to add different groups depending on the query string (so, the text after the slash).
|
|
128
|
+
* Thus, to re-calculate the available groups, this function will be called every time you type after the /.
|
|
129
|
+
*
|
|
130
|
+
* The groups provided by dynamicGroups will be merged with the static groups provided by the groups property.
|
|
131
|
+
*/
|
|
132
|
+
dynamicGroups?: ({ editor, queryString, }: {
|
|
112
133
|
editor: LexicalEditor;
|
|
113
134
|
queryString: string;
|
|
114
135
|
}) => SlashMenuGroup[];
|
|
115
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Static array of groups together with the items in them. These will always be present.
|
|
138
|
+
* While typing after the /, they will be filtered by the query string and the keywords, key and display name of the items.
|
|
139
|
+
*/
|
|
140
|
+
groups?: SlashMenuGroup[];
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* An opt-in, classic fixed toolbar which stays at the top of the editor
|
|
144
|
+
*/
|
|
145
|
+
toolbarFixed?: {
|
|
146
|
+
groups: ToolbarGroup[];
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* The default, floating toolbar which appears when you select text.
|
|
150
|
+
*/
|
|
151
|
+
toolbarInline?: {
|
|
152
|
+
/**
|
|
153
|
+
* Array of toolbar groups / sections. Each section can contain multiple toolbar items.
|
|
154
|
+
*/
|
|
155
|
+
groups: ToolbarGroup[];
|
|
116
156
|
};
|
|
117
157
|
};
|
|
118
158
|
export type ClientComponentProps<ClientFeatureProps> = ClientFeatureProps & {
|
|
119
159
|
featureKey: string;
|
|
120
160
|
order: number;
|
|
121
161
|
};
|
|
162
|
+
export type FieldNodeHookArgs<T extends SerializedLexicalNode> = {
|
|
163
|
+
context: RequestContext;
|
|
164
|
+
/** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */
|
|
165
|
+
findMany?: boolean;
|
|
166
|
+
/** The value of the field. */
|
|
167
|
+
node?: T;
|
|
168
|
+
/** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */
|
|
169
|
+
operation?: 'create' | 'delete' | 'read' | 'update';
|
|
170
|
+
overrideAccess?: boolean;
|
|
171
|
+
/** The Express request object. It is mocked for Local API operations. */
|
|
172
|
+
req: PayloadRequestWithData;
|
|
173
|
+
};
|
|
174
|
+
export type FieldNodeHook<T extends SerializedLexicalNode> = (args: FieldNodeHookArgs<T>) => Promise<T> | T;
|
|
175
|
+
export type NodeWithHooks<T extends LexicalNode = any> = {
|
|
176
|
+
converters?: {
|
|
177
|
+
html?: HTMLConverter<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>;
|
|
178
|
+
};
|
|
179
|
+
hooks?: {
|
|
180
|
+
afterChange?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
|
|
181
|
+
afterRead?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
|
|
182
|
+
beforeChange?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
|
|
183
|
+
/**
|
|
184
|
+
* Runs before a document is duplicated to prevent errors in unique fields or return null to use defaultValue.
|
|
185
|
+
*/
|
|
186
|
+
beforeDuplicate?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
|
|
187
|
+
beforeValidate?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
|
|
188
|
+
};
|
|
189
|
+
node: Klass<T> | LexicalNodeReplacement;
|
|
190
|
+
populationPromises?: Array<PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
|
|
191
|
+
validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
|
|
192
|
+
};
|
|
122
193
|
export type ServerFeature<ServerProps, ClientFeatureProps> = {
|
|
123
194
|
ClientComponent?: React.FC<ClientComponentProps<ClientFeatureProps>>;
|
|
124
195
|
/**
|
|
@@ -142,11 +213,7 @@ export type ServerFeature<ServerProps, ClientFeatureProps> = {
|
|
|
142
213
|
props: ServerProps;
|
|
143
214
|
schemaMap: Map<string, Field[]>;
|
|
144
215
|
schemaPath: string;
|
|
145
|
-
}) =>
|
|
146
|
-
[key: string]: Field[];
|
|
147
|
-
} | Promise<{
|
|
148
|
-
[key: string]: Field[];
|
|
149
|
-
}>;
|
|
216
|
+
}) => Map<string, Field[]> | null;
|
|
150
217
|
generatedTypes?: {
|
|
151
218
|
modifyOutputSchema: ({ collectionIDFieldTypes, config, currentSchema, field, interfaceNameDefinitions, isRequired, }: {
|
|
152
219
|
collectionIDFieldTypes: {
|
|
@@ -165,22 +232,8 @@ export type ServerFeature<ServerProps, ClientFeatureProps> = {
|
|
|
165
232
|
isRequired: boolean;
|
|
166
233
|
}) => JSONSchema4;
|
|
167
234
|
};
|
|
168
|
-
hooks?: {
|
|
169
|
-
afterReadPromise?: ({ field, incomingEditorState, siblingDoc, }: {
|
|
170
|
-
field: RichTextField<SerializedEditorState, AdapterProps>;
|
|
171
|
-
incomingEditorState: SerializedEditorState;
|
|
172
|
-
siblingDoc: Record<string, unknown>;
|
|
173
|
-
}) => Promise<void> | null;
|
|
174
|
-
};
|
|
175
235
|
markdownTransformers?: Transformer[];
|
|
176
|
-
nodes?: Array<
|
|
177
|
-
converters?: {
|
|
178
|
-
html?: HTMLConverter;
|
|
179
|
-
};
|
|
180
|
-
node: Klass<LexicalNode> | LexicalNodeReplacement;
|
|
181
|
-
populationPromises?: Array<PopulationPromise>;
|
|
182
|
-
validations?: Array<NodeValidation>;
|
|
183
|
-
}>;
|
|
236
|
+
nodes?: Array<NodeWithHooks>;
|
|
184
237
|
/** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */
|
|
185
238
|
serverFeatureProps: ServerProps;
|
|
186
239
|
};
|
|
@@ -195,22 +248,27 @@ export type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<unknown
|
|
|
195
248
|
export type ResolvedClientFeatureMap = Map<string, ResolvedClientFeature<unknown>>;
|
|
196
249
|
export type ServerFeatureProviderMap = Map<string, FeatureProviderServer<unknown, unknown>>;
|
|
197
250
|
export type ClientFeatureProviderMap = Map<string, FeatureProviderClient<unknown>>;
|
|
251
|
+
/**
|
|
252
|
+
* Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more "outside" functionality
|
|
253
|
+
*/
|
|
198
254
|
export type SanitizedPlugin = {
|
|
199
|
-
Component:
|
|
255
|
+
Component: PluginComponent;
|
|
256
|
+
clientProps: any;
|
|
200
257
|
key: string;
|
|
201
258
|
position: 'bottom';
|
|
202
259
|
} | {
|
|
203
|
-
Component:
|
|
260
|
+
Component: PluginComponent;
|
|
261
|
+
clientProps: any;
|
|
204
262
|
key: string;
|
|
205
263
|
position: 'normal';
|
|
206
264
|
} | {
|
|
207
|
-
Component:
|
|
265
|
+
Component: PluginComponent;
|
|
266
|
+
clientProps: any;
|
|
208
267
|
key: string;
|
|
209
268
|
position: 'top';
|
|
210
269
|
} | {
|
|
211
|
-
Component:
|
|
212
|
-
|
|
213
|
-
}>;
|
|
270
|
+
Component: PluginComponentWithAnchor;
|
|
271
|
+
clientProps: any;
|
|
214
272
|
desktopOnly?: boolean;
|
|
215
273
|
key: string;
|
|
216
274
|
position: 'floatingAnchorElem';
|
|
@@ -240,24 +298,24 @@ export type SanitizedServerFeatures = Required<Pick<ResolvedServerFeature<unknow
|
|
|
240
298
|
isRequired: boolean;
|
|
241
299
|
}) => JSONSchema4>;
|
|
242
300
|
};
|
|
243
|
-
hooks
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
301
|
+
/** The node types mapped to their hooks */
|
|
302
|
+
hooks?: {
|
|
303
|
+
afterChange?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>;
|
|
304
|
+
afterRead?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>;
|
|
305
|
+
beforeChange?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>;
|
|
306
|
+
/**
|
|
307
|
+
* Runs before a document is duplicated to prevent errors in unique fields or return null to use defaultValue.
|
|
308
|
+
*/
|
|
309
|
+
beforeDuplicate?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>;
|
|
310
|
+
beforeValidate?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>;
|
|
311
|
+
}; /** The node types mapped to their populationPromises */
|
|
251
312
|
populationPromises: Map<string, Array<PopulationPromise>>;
|
|
252
313
|
/** The node types mapped to their validations */
|
|
253
314
|
validations: Map<string, Array<NodeValidation>>;
|
|
254
315
|
};
|
|
255
|
-
export type SanitizedClientFeatures = Required<Pick<ResolvedClientFeature<unknown>, 'markdownTransformers' | 'nodes'>> & {
|
|
316
|
+
export type SanitizedClientFeatures = Required<Pick<ResolvedClientFeature<unknown>, 'markdownTransformers' | 'nodes' | 'toolbarFixed' | 'toolbarInline'>> & {
|
|
256
317
|
/** The keys of all enabled features */
|
|
257
318
|
enabledFeatures: string[];
|
|
258
|
-
floatingSelectToolbar: {
|
|
259
|
-
sections: FloatingToolbarSection[];
|
|
260
|
-
};
|
|
261
319
|
hooks: {
|
|
262
320
|
load: Array<({ incomingEditorState, }: {
|
|
263
321
|
incomingEditorState: SerializedEditorState;
|
|
@@ -266,13 +324,26 @@ export type SanitizedClientFeatures = Required<Pick<ResolvedClientFeature<unknow
|
|
|
266
324
|
incomingEditorState: SerializedEditorState;
|
|
267
325
|
}) => SerializedEditorState>;
|
|
268
326
|
};
|
|
327
|
+
/**
|
|
328
|
+
* Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more "outside" functionality
|
|
329
|
+
*/
|
|
269
330
|
plugins?: Array<SanitizedPlugin>;
|
|
270
331
|
slashMenu: {
|
|
271
|
-
|
|
332
|
+
/**
|
|
333
|
+
* Dynamic groups allow you to add different groups depending on the query string (so, the text after the slash).
|
|
334
|
+
* Thus, to re-calculate the available groups, this function will be called every time you type after the /.
|
|
335
|
+
*
|
|
336
|
+
* The groups provided by dynamicGroups will be merged with the static groups provided by the groups property.
|
|
337
|
+
*/
|
|
338
|
+
dynamicGroups: Array<({ editor, queryString }: {
|
|
272
339
|
editor: LexicalEditor;
|
|
273
340
|
queryString: string;
|
|
274
341
|
}) => SlashMenuGroup[]>;
|
|
275
|
-
|
|
342
|
+
/**
|
|
343
|
+
* Static array of groups together with the items in them. These will always be present.
|
|
344
|
+
* While typing after the /, they will be filtered by the query string and the keywords, key and display name of the items.
|
|
345
|
+
*/
|
|
346
|
+
groups: SlashMenuGroup[];
|
|
276
347
|
};
|
|
277
348
|
};
|
|
278
349
|
//# sourceMappingURL=types.d.ts.map
|