@payloadcms/richtext-lexical 3.0.0-beta.2 → 3.0.0-beta.21
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/field/features/align/feature.client.d.ts.map +1 -1
- package/dist/field/features/align/feature.client.js +1 -2
- package/dist/field/features/align/feature.client.js.map +1 -1
- package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
- package/dist/field/features/blockquote/feature.client.js +3 -6
- package/dist/field/features/blockquote/feature.client.js.map +1 -1
- package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
- package/dist/field/features/blockquote/feature.server.js +4 -4
- 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 +36 -3
- 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.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.map +1 -1
- package/dist/field/features/blocks/plugin/index.js +3 -6
- 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 +3 -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/plugin/index.d.ts.map +1 -1
- package/dist/field/features/debug/testrecorder/plugin/index.js +2 -4
- package/dist/field/features/debug/testrecorder/plugin/index.js.map +1 -1
- package/dist/field/features/debug/treeview/plugin/index.d.ts.map +1 -1
- package/dist/field/features/debug/treeview/plugin/index.js +2 -4
- package/dist/field/features/debug/treeview/plugin/index.js.map +1 -1
- package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/bold/feature.client.js +1 -2
- package/dist/field/features/format/bold/feature.client.js.map +1 -1
- package/dist/field/features/format/inlinecode/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/inlinecode/feature.client.js +1 -2
- package/dist/field/features/format/inlinecode/feature.client.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 +1 -2
- package/dist/field/features/format/italic/feature.client.js.map +1 -1
- package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
- package/dist/field/features/format/strikethrough/feature.client.js +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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 +3 -6
- 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 +10 -0
- package/dist/field/features/horizontalrule/component/index.d.ts.map +1 -0
- package/dist/field/features/horizontalrule/component/index.js +62 -0
- package/dist/field/features/horizontalrule/component/index.js.map +1 -0
- package/dist/field/features/horizontalrule/feature.client.d.ts +3 -0
- package/dist/field/features/horizontalrule/feature.client.d.ts.map +1 -0
- package/dist/field/features/horizontalrule/feature.client.js +53 -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 +37 -0
- package/dist/field/features/horizontalrule/feature.server.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 +88 -0
- package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js.map +1 -0
- package/dist/field/features/horizontalrule/plugin/index.d.ts +6 -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.map +1 -1
- package/dist/field/features/indent/feature.client.js +1 -2
- package/dist/field/features/indent/feature.client.js.map +1 -1
- package/dist/field/features/link/drawer/baseFields.d.ts +3 -3
- package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
- package/dist/field/features/link/drawer/baseFields.js +28 -42
- 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 +2 -4
- package/dist/field/features/link/feature.client.js.map +1 -1
- package/dist/field/features/link/feature.server.d.ts +0 -2
- 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.map +1 -1
- package/dist/field/features/link/plugins/autoLink/index.js +3 -6
- package/dist/field/features/link/plugins/autoLink/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 +56 -39
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +9 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +3 -5
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +11 -29
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
- package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
- package/dist/field/features/link/plugins/link/index.js +3 -12
- 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 +9 -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.map +1 -1
- package/dist/field/features/lists/checklist/feature.client.js +1 -2
- package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
- package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
- package/dist/field/features/lists/checklist/feature.server.js +6 -6
- 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 +1 -2
- package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
- package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
- package/dist/field/features/lists/checklist/plugin/index.js +1 -2
- package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
- package/dist/field/features/lists/common/markdown.d.ts.map +1 -1
- package/dist/field/features/lists/common/markdown.js +1 -2
- package/dist/field/features/lists/common/markdown.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 -1
- package/dist/field/features/lists/orderedlist/feature.client.js +1 -2
- package/dist/field/features/lists/orderedlist/feature.client.js.map +1 -1
- package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +1 -1
- package/dist/field/features/lists/orderedlist/feature.server.js +6 -6
- package/dist/field/features/lists/orderedlist/feature.server.js.map +1 -1
- package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +1 -1
- package/dist/field/features/lists/orderedlist/markdownTransformer.js +1 -2
- package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +1 -1
- package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
- package/dist/field/features/lists/plugin/index.js +1 -2
- package/dist/field/features/lists/plugin/index.js.map +1 -1
- package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +1 -1
- package/dist/field/features/lists/unorderedlist/feature.client.js +1 -2
- package/dist/field/features/lists/unorderedlist/feature.client.js.map +1 -1
- package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +1 -1
- package/dist/field/features/lists/unorderedlist/feature.server.js +6 -6
- package/dist/field/features/lists/unorderedlist/feature.server.js.map +1 -1
- package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +1 -1
- package/dist/field/features/lists/unorderedlist/markdownTransformer.js +1 -2
- package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +1 -1
- 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/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 +2 -4
- 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.server.d.ts.map +1 -1
- package/dist/field/features/relationship/feature.server.js +3 -2
- 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 +54 -7
- package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
- package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
- package/dist/field/features/relationship/plugins/index.js +3 -6
- package/dist/field/features/relationship/plugins/index.js.map +1 -1
- package/dist/field/features/relationship/populationPromise.js +7 -6
- package/dist/field/features/relationship/populationPromise.js.map +1 -1
- 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 +57 -33
- 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 +55 -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.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 +6 -9
- package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
- package/dist/field/features/upload/plugin/index.d.ts +2 -2
- package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
- package/dist/field/features/upload/plugin/index.js +4 -9
- package/dist/field/features/upload/plugin/index.js.map +1 -1
- package/dist/field/features/upload/populationPromise.js +11 -8
- 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 +34 -12
- 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/LexicalEditor.d.ts.map +1 -1
- package/dist/field/lexical/LexicalEditor.js +6 -11
- package/dist/field/lexical/LexicalEditor.js.map +1 -1
- 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 +1 -2
- package/dist/field/lexical/LexicalProvider.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.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 +3 -3
- package/dist/field/lexical/config/server/default.js.map +1 -1
- package/dist/field/lexical/config/server/loader.d.ts +4 -2
- package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
- package/dist/field/lexical/config/server/loader.js +3 -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/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js +3 -6
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +1 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +1 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js +3 -6
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +27 -29
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.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.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +3 -6
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +3 -6
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/index.js +1 -2
- 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 +13 -10
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +1 -2
- 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 +10 -7
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- 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/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 +17 -7
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
- package/dist/field/lexical/theme/EditorTheme.scss +11 -8
- 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/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 +19 -0
- package/dist/field/lexical/ui/icons/HorizontalRule/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 +1 -1
- package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
- package/dist/field/lexical/utils/setFloatingElemPosition.js +15 -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 +16 -22
- 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 +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +260 -173
- 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 +3 -3
- package/dist/populate/populate.d.ts.map +1 -1
- 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 +35 -0
- package/dist/populate/populateLexicalPopulationPromises.js.map +1 -0
- package/dist/populate/recurseNestedFields.d.ts +7 -4
- package/dist/populate/recurseNestedFields.d.ts.map +1 -1
- package/dist/populate/recurseNestedFields.js +3 -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 +11 -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/components.d.ts +0 -6
- package/components.js +0 -7
- 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
|
@@ -1,36 +1,18 @@
|
|
|
1
1
|
import { getBaseFields } from '../../drawer/baseFields.js';
|
|
2
2
|
/**
|
|
3
3
|
* This function is run to enrich the basefields which every link has with potential, custom user-added fields.
|
|
4
|
-
*/
|
|
5
|
-
export function transformExtraFields(customFieldSchema, config, i18n, enabledCollections, disabledCollections) {
|
|
4
|
+
*/ export function transformExtraFields(customFieldSchema, config, enabledCollections, disabledCollections) {
|
|
6
5
|
const baseFields = getBaseFields(config, enabledCollections, disabledCollections);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (!baseFields.find((baseField)=>!('name' in baseField) || baseField.name === field.name)) {
|
|
18
|
-
if (field.name !== 'fields' && field.type !== 'group') {
|
|
19
|
-
extraFields.push(field);
|
|
20
|
-
// Remove from fields from now, as they need to be part of the fields group below
|
|
21
|
-
fields.splice(fields.indexOf(field), 1);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (Array.isArray(customFieldSchema) || fields.length > 0) {
|
|
27
|
-
// find field with name 'fields' and add the extra fields to it
|
|
28
|
-
const fieldsField = fields.find((field)=>field.type === 'group' && field.name === 'fields');
|
|
29
|
-
if (!fieldsField) {
|
|
30
|
-
throw new Error('Could not find field with name "fields". This is required to add fields to the link field.');
|
|
31
|
-
}
|
|
32
|
-
fieldsField.fields = Array.isArray(fieldsField.fields) ? fieldsField.fields : [];
|
|
33
|
-
fieldsField.fields.push(...Array.isArray(customFieldSchema) ? customFieldSchema.concat(extraFields) : extraFields);
|
|
6
|
+
let fields;
|
|
7
|
+
if (typeof customFieldSchema === 'function') {
|
|
8
|
+
fields = customFieldSchema({
|
|
9
|
+
config,
|
|
10
|
+
defaultFields: baseFields
|
|
11
|
+
});
|
|
12
|
+
} else if (Array.isArray(customFieldSchema)) {
|
|
13
|
+
fields = customFieldSchema;
|
|
14
|
+
} else {
|
|
15
|
+
fields = baseFields;
|
|
34
16
|
}
|
|
35
17
|
return fields;
|
|
36
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/field/features/link/plugins/floatingLinkEditor/utilities.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/field/features/link/plugins/floatingLinkEditor/utilities.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload/config'\nimport type { FieldWithRichTextRequiredEditor } from 'payload/types'\n\nimport { getBaseFields } from '../../drawer/baseFields.js'\n\n/**\n * This function is run to enrich the basefields which every link has with potential, custom user-added fields.\n */\nexport function transformExtraFields(\n customFieldSchema:\n | ((args: {\n config: SanitizedConfig\n defaultFields: FieldWithRichTextRequiredEditor[]\n }) => FieldWithRichTextRequiredEditor[])\n | FieldWithRichTextRequiredEditor[],\n config: SanitizedConfig,\n enabledCollections?: false | string[],\n disabledCollections?: false | string[],\n): FieldWithRichTextRequiredEditor[] {\n const baseFields: FieldWithRichTextRequiredEditor[] = getBaseFields(\n config,\n enabledCollections,\n disabledCollections,\n )\n\n let fields: FieldWithRichTextRequiredEditor[]\n\n if (typeof customFieldSchema === 'function') {\n fields = customFieldSchema({ config, defaultFields: baseFields })\n } else if (Array.isArray(customFieldSchema)) {\n fields = customFieldSchema\n } else {\n fields = baseFields\n }\n\n return fields\n}\n"],"names":["getBaseFields","transformExtraFields","customFieldSchema","config","enabledCollections","disabledCollections","baseFields","fields","defaultFields","Array","isArray"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,aAAa,QAAQ,6BAA4B;AAE1D;;CAEC,GACD,OAAO,SAASC,qBACdC,iBAKqC,EACrCC,MAAuB,EACvBC,kBAAqC,EACrCC,mBAAsC;IAEtC,MAAMC,aAAgDN,cACpDG,QACAC,oBACAC;IAGF,IAAIE;IAEJ,IAAI,OAAOL,sBAAsB,YAAY;QAC3CK,SAASL,kBAAkB;YAAEC;YAAQK,eAAeF;QAAW;IACjE,OAAO,IAAIG,MAAMC,OAAO,CAACR,oBAAoB;QAC3CK,SAASL;IACX,OAAO;QACLK,SAASD;IACX;IAEA,OAAOC;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/link/plugins/link/index.tsx"],"names":[],"mappings":"AAkBA,wBAAgB,UAAU,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/link/plugins/link/index.tsx"],"names":[],"mappings":"AAkBA,wBAAgB,UAAU,IAAI,IAAI,CA2DjC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
const { mergeRegister } = lexicalUtilsImport;
|
|
6
|
-
import lexicalImport from 'lexical';
|
|
7
|
-
const { $getSelection, $isElementNode, $isRangeSelection, COMMAND_PRIORITY_LOW, PASTE_COMMAND } = lexicalImport;
|
|
2
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
|
|
3
|
+
import { mergeRegister } from '@lexical/utils';
|
|
4
|
+
import { $getSelection, $isElementNode, $isRangeSelection, COMMAND_PRIORITY_LOW, PASTE_COMMAND } from 'lexical';
|
|
8
5
|
import { useEffect } from 'react';
|
|
9
6
|
import { validateUrl } from '../../../../lexical/utils/url.js';
|
|
10
7
|
import { LinkNode, TOGGLE_LINK_COMMAND, toggleLink } from '../../nodes/LinkNode.js';
|
|
@@ -17,12 +14,6 @@ export function LinkPlugin() {
|
|
|
17
14
|
throw new Error('LinkPlugin: LinkNode not registered on editor');
|
|
18
15
|
}
|
|
19
16
|
return mergeRegister(editor.registerCommand(TOGGLE_LINK_COMMAND, (payload)=>{
|
|
20
|
-
// validate
|
|
21
|
-
if (payload?.fields.linkType === 'custom') {
|
|
22
|
-
if (!(validateUrl === undefined || validateUrl(payload?.fields.url))) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
17
|
toggleLink(payload);
|
|
27
18
|
return true;
|
|
28
19
|
}, COMMAND_PRIORITY_LOW), validateUrl !== undefined ? editor.registerCommand(PASTE_COMMAND, (event)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/field/features/link/plugins/link/index.tsx"],"sourcesContent":["'use client'\nimport
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/field/features/link/plugins/link/index.tsx"],"sourcesContent":["'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { mergeRegister } from '@lexical/utils'\nimport {\n $getSelection,\n $isElementNode,\n $isRangeSelection,\n COMMAND_PRIORITY_LOW,\n PASTE_COMMAND,\n} from 'lexical'\nimport { useEffect } from 'react'\n\nimport type { LinkFields } from '../../nodes/types.js'\nimport type { LinkPayload } from '../floatingLinkEditor/types.js'\n\nimport { validateUrl } from '../../../../lexical/utils/url.js'\nimport { LinkNode, TOGGLE_LINK_COMMAND, toggleLink } from '../../nodes/LinkNode.js'\n\nexport function LinkPlugin(): null {\n const [editor] = useLexicalComposerContext()\n\n useEffect(() => {\n if (!editor.hasNodes([LinkNode])) {\n throw new Error('LinkPlugin: LinkNode not registered on editor')\n }\n return mergeRegister(\n editor.registerCommand(\n TOGGLE_LINK_COMMAND,\n (payload: LinkPayload) => {\n toggleLink(payload)\n return true\n },\n COMMAND_PRIORITY_LOW,\n ),\n validateUrl !== undefined\n ? editor.registerCommand(\n PASTE_COMMAND,\n (event) => {\n const selection = $getSelection()\n if (\n !$isRangeSelection(selection) ||\n selection.isCollapsed() ||\n !(event instanceof ClipboardEvent) ||\n event.clipboardData == null\n ) {\n return false\n }\n const clipboardText = event.clipboardData.getData('text')\n if (!validateUrl(clipboardText)) {\n return false\n }\n // If we select nodes that are elements then avoid applying the link.\n if (!selection.getNodes().some((node) => $isElementNode(node))) {\n const linkFields: LinkFields = {\n doc: null,\n linkType: 'custom',\n newTab: false,\n url: clipboardText,\n }\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, {\n fields: linkFields,\n text: null,\n })\n event.preventDefault()\n return true\n }\n return false\n },\n COMMAND_PRIORITY_LOW,\n )\n : () => {\n // Don't paste arbitrary text as a link when there's no validate function\n },\n )\n }, [editor])\n\n return null\n}\n"],"names":["useLexicalComposerContext","mergeRegister","$getSelection","$isElementNode","$isRangeSelection","COMMAND_PRIORITY_LOW","PASTE_COMMAND","useEffect","validateUrl","LinkNode","TOGGLE_LINK_COMMAND","toggleLink","LinkPlugin","editor","hasNodes","Error","registerCommand","payload","undefined","event","selection","isCollapsed","ClipboardEvent","clipboardData","clipboardText","getData","getNodes","some","node","linkFields","doc","linkType","newTab","url","dispatchCommand","fields","text","preventDefault"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,aAAa,QAAQ,iBAAgB;AAC9C,SACEC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,oBAAoB,EACpBC,aAAa,QACR,UAAS;AAChB,SAASC,SAAS,QAAQ,QAAO;AAKjC,SAASC,WAAW,QAAQ,mCAAkC;AAC9D,SAASC,QAAQ,EAAEC,mBAAmB,EAAEC,UAAU,QAAQ,0BAAyB;AAEnF,OAAO,SAASC;IACd,MAAM,CAACC,OAAO,GAAGb;IAEjBO,UAAU;QACR,IAAI,CAACM,OAAOC,QAAQ,CAAC;YAACL;SAAS,GAAG;YAChC,MAAM,IAAIM,MAAM;QAClB;QACA,OAAOd,cACLY,OAAOG,eAAe,CACpBN,qBACA,CAACO;YACCN,WAAWM;YACX,OAAO;QACT,GACAZ,uBAEFG,gBAAgBU,YACZL,OAAOG,eAAe,CACpBV,eACA,CAACa;YACC,MAAMC,YAAYlB;YAClB,IACE,CAACE,kBAAkBgB,cACnBA,UAAUC,WAAW,MACrB,CAAEF,CAAAA,iBAAiBG,cAAa,KAChCH,MAAMI,aAAa,IAAI,MACvB;gBACA,OAAO;YACT;YACA,MAAMC,gBAAgBL,MAAMI,aAAa,CAACE,OAAO,CAAC;YAClD,IAAI,CAACjB,YAAYgB,gBAAgB;gBAC/B,OAAO;YACT;YACA,qEAAqE;YACrE,IAAI,CAACJ,UAAUM,QAAQ,GAAGC,IAAI,CAAC,CAACC,OAASzB,eAAeyB,QAAQ;gBAC9D,MAAMC,aAAyB;oBAC7BC,KAAK;oBACLC,UAAU;oBACVC,QAAQ;oBACRC,KAAKT;gBACP;gBACAX,OAAOqB,eAAe,CAACxB,qBAAqB;oBAC1CyB,QAAQN;oBACRO,MAAM;gBACR;gBACAjB,MAAMkB,cAAc;gBACpB,OAAO;YACT;YACA,OAAO;QACT,GACAhC,wBAEF;QACE,yEAAyE;QAC3E;IAER,GAAG;QAACQ;KAAO;IAEX,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"populationPromise.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/populationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"populationPromise.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/populationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAI1D,eAAO,MAAM,wBAAwB,UAC5B,sBAAsB,KAC5B,kBAAkB,kBAAkB,CAyCtC,CAAA"}
|
|
@@ -1,46 +1,30 @@
|
|
|
1
|
-
import { populate } from '../../../populate/populate.js';
|
|
2
1
|
import { recurseNestedFields } from '../../../populate/recurseNestedFields.js';
|
|
3
2
|
export const linkPopulationPromiseHOC = (props)=>{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const collection = req.payload.collections[node?.fields?.doc?.relationTo];
|
|
8
|
-
if (collection) {
|
|
9
|
-
promises.push(populate({
|
|
10
|
-
id: typeof node?.fields?.doc?.value === 'object' ? node?.fields?.doc?.value?.id : node?.fields?.doc?.value,
|
|
11
|
-
collection,
|
|
12
|
-
currentDepth,
|
|
13
|
-
data: node?.fields?.doc,
|
|
14
|
-
depth,
|
|
15
|
-
field,
|
|
16
|
-
key: 'value',
|
|
17
|
-
overrideAccess,
|
|
18
|
-
req,
|
|
19
|
-
showHiddenFields
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
3
|
+
return ({ context, currentDepth, depth, editorPopulationPromises, fieldPromises, findMany, flattenLocales, node, overrideAccess, populationPromises, req, showHiddenFields })=>{
|
|
4
|
+
if (!props.fields?.length) {
|
|
5
|
+
return;
|
|
22
6
|
}
|
|
23
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Should populate all fields, including the doc field (for internal links), as it's treated like a normal field
|
|
9
|
+
*/ if (Array.isArray(props.fields)) {
|
|
24
10
|
recurseNestedFields({
|
|
25
11
|
context,
|
|
26
12
|
currentDepth,
|
|
27
|
-
data: node.fields
|
|
13
|
+
data: node.fields,
|
|
28
14
|
depth,
|
|
29
15
|
editorPopulationPromises,
|
|
16
|
+
fieldPromises,
|
|
30
17
|
fields: props.fields,
|
|
31
18
|
findMany,
|
|
32
19
|
flattenLocales,
|
|
33
20
|
overrideAccess,
|
|
34
21
|
populationPromises,
|
|
35
|
-
promises,
|
|
36
22
|
req,
|
|
37
23
|
showHiddenFields,
|
|
38
|
-
siblingDoc: node.fields
|
|
24
|
+
siblingDoc: node.fields
|
|
39
25
|
});
|
|
40
26
|
}
|
|
41
|
-
return promises;
|
|
42
27
|
};
|
|
43
|
-
return linkPopulationPromise;
|
|
44
28
|
};
|
|
45
29
|
|
|
46
30
|
//# sourceMappingURL=populationPromise.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/link/populationPromise.ts"],"sourcesContent":["import type { PopulationPromise } from '../types.js'\nimport type { LinkFeatureServerProps } from './feature.server.js'\nimport type { SerializedLinkNode } from './nodes/types.js'\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/link/populationPromise.ts"],"sourcesContent":["import type { PopulationPromise } from '../types.js'\nimport type { LinkFeatureServerProps } from './feature.server.js'\nimport type { SerializedLinkNode } from './nodes/types.js'\n\nimport { recurseNestedFields } from '../../../populate/recurseNestedFields.js'\n\nexport const linkPopulationPromiseHOC = (\n props: LinkFeatureServerProps,\n): PopulationPromise<SerializedLinkNode> => {\n return ({\n context,\n currentDepth,\n depth,\n editorPopulationPromises,\n fieldPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (!props.fields?.length) {\n return\n }\n\n /**\n * Should populate all fields, including the doc field (for internal links), as it's treated like a normal field\n */\n if (Array.isArray(props.fields)) {\n recurseNestedFields({\n context,\n currentDepth,\n data: node.fields,\n depth,\n editorPopulationPromises,\n fieldPromises,\n fields: props.fields,\n findMany,\n flattenLocales,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc: node.fields,\n })\n }\n }\n}\n"],"names":["recurseNestedFields","linkPopulationPromiseHOC","props","context","currentDepth","depth","editorPopulationPromises","fieldPromises","findMany","flattenLocales","node","overrideAccess","populationPromises","req","showHiddenFields","fields","length","Array","isArray","data","siblingDoc"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,mBAAmB,QAAQ,2CAA0C;AAE9E,OAAO,MAAMC,2BAA2B,CACtCC;IAEA,OAAO,CAAC,EACNC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,wBAAwB,EACxBC,aAAa,EACbC,QAAQ,EACRC,cAAc,EACdC,IAAI,EACJC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EACjB;QACC,IAAI,CAACZ,MAAMa,MAAM,EAAEC,QAAQ;YACzB;QACF;QAEA;;KAEC,GACD,IAAIC,MAAMC,OAAO,CAAChB,MAAMa,MAAM,GAAG;YAC/Bf,oBAAoB;gBAClBG;gBACAC;gBACAe,MAAMT,KAAKK,MAAM;gBACjBV;gBACAC;gBACAC;gBACAQ,QAAQb,MAAMa,MAAM;gBACpBP;gBACAC;gBACAE;gBACAC;gBACAC;gBACAC;gBACAM,YAAYV,KAAKK,MAAM;YACzB;QACF;IACF;AACF,EAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { NodeValidation } from '../types.js';
|
|
2
|
+
import type { LinkFeatureServerProps } from './feature.server.js';
|
|
3
|
+
import type { SerializedAutoLinkNode, SerializedLinkNode } from './nodes/types.js';
|
|
4
|
+
export declare const linkValidation: (props: LinkFeatureServerProps) => NodeValidation<SerializedAutoLinkNode | SerializedLinkNode>;
|
|
5
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/validate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAElF,eAAO,MAAM,cAAc,UAClB,sBAAsB,KAE5B,eAAe,sBAAsB,GAAG,kBAAkB,CAuC5D,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { buildStateFromSchema } from '@payloadcms/ui/forms/buildStateFromSchema';
|
|
2
|
+
export const linkValidation = (props)=>{
|
|
3
|
+
return async ({ node, validation: { options: { id, operation, preferences, req } } })=>{
|
|
4
|
+
/**
|
|
5
|
+
* Run buildStateFromSchema as that properly validates link fields and link sub-fields
|
|
6
|
+
*/ const data = {
|
|
7
|
+
...node.fields,
|
|
8
|
+
text: 'ignored'
|
|
9
|
+
};
|
|
10
|
+
const result = await buildStateFromSchema({
|
|
11
|
+
id,
|
|
12
|
+
data,
|
|
13
|
+
fieldSchema: props.fields,
|
|
14
|
+
operation: operation === 'create' || operation === 'update' ? operation : 'update',
|
|
15
|
+
preferences,
|
|
16
|
+
req,
|
|
17
|
+
siblingData: data
|
|
18
|
+
});
|
|
19
|
+
let errorPaths = [];
|
|
20
|
+
for(const fieldKey in result){
|
|
21
|
+
if (result[fieldKey].errorPaths) {
|
|
22
|
+
errorPaths = errorPaths.concat(result[fieldKey].errorPaths);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (errorPaths.length) {
|
|
26
|
+
return 'Link fields validation failed: ' + errorPaths.join(', ');
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/link/validate.ts"],"sourcesContent":["import type { FieldWithRichTextRequiredEditor } from 'payload/types'\n\nimport { buildStateFromSchema } from '@payloadcms/ui/forms/buildStateFromSchema'\n\nimport type { NodeValidation } from '../types.js'\nimport type { LinkFeatureServerProps } from './feature.server.js'\nimport type { SerializedAutoLinkNode, SerializedLinkNode } from './nodes/types.js'\n\nexport const linkValidation = (\n props: LinkFeatureServerProps,\n // eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents\n): NodeValidation<SerializedAutoLinkNode | SerializedLinkNode> => {\n return async ({\n node,\n validation: {\n options: { id, operation, preferences, req },\n },\n }) => {\n /**\n * Run buildStateFromSchema as that properly validates link fields and link sub-fields\n */\n\n const data = {\n ...node.fields,\n text: 'ignored',\n }\n\n const result = await buildStateFromSchema({\n id,\n data,\n fieldSchema: props.fields as FieldWithRichTextRequiredEditor[], // Sanitized in feature.server.ts\n operation: operation === 'create' || operation === 'update' ? operation : 'update',\n preferences,\n req,\n siblingData: data,\n })\n\n let errorPaths = []\n for (const fieldKey in result) {\n if (result[fieldKey].errorPaths) {\n errorPaths = errorPaths.concat(result[fieldKey].errorPaths)\n }\n }\n\n if (errorPaths.length) {\n return 'Link fields validation failed: ' + errorPaths.join(', ')\n }\n\n return true\n }\n}\n"],"names":["buildStateFromSchema","linkValidation","props","node","validation","options","id","operation","preferences","req","data","fields","text","result","fieldSchema","siblingData","errorPaths","fieldKey","concat","length","join"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,oBAAoB,QAAQ,4CAA2C;AAMhF,OAAO,MAAMC,iBAAiB,CAC5BC;IAGA,OAAO,OAAO,EACZC,IAAI,EACJC,YAAY,EACVC,SAAS,EAAEC,EAAE,EAAEC,SAAS,EAAEC,WAAW,EAAEC,GAAG,EAAE,EAC7C,EACF;QACC;;KAEC,GAED,MAAMC,OAAO;YACX,GAAGP,KAAKQ,MAAM;YACdC,MAAM;QACR;QAEA,MAAMC,SAAS,MAAMb,qBAAqB;YACxCM;YACAI;YACAI,aAAaZ,MAAMS,MAAM;YACzBJ,WAAWA,cAAc,YAAYA,cAAc,WAAWA,YAAY;YAC1EC;YACAC;YACAM,aAAaL;QACf;QAEA,IAAIM,aAAa,EAAE;QACnB,IAAK,MAAMC,YAAYJ,OAAQ;YAC7B,IAAIA,MAAM,CAACI,SAAS,CAACD,UAAU,EAAE;gBAC/BA,aAAaA,WAAWE,MAAM,CAACL,MAAM,CAACI,SAAS,CAACD,UAAU;YAC5D;QACF;QAEA,IAAIA,WAAWG,MAAM,EAAE;YACrB,OAAO,oCAAoCH,WAAWI,IAAI,CAAC;QAC7D;QAEA,OAAO;IACT;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/lists/checklist/feature.client.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/lists/checklist/feature.client.tsx"],"names":[],"mappings":";AA8EA,eAAO,MAAM,+BAA+B,+BAAgD,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
const { INSERT_CHECK_LIST_COMMAND, ListItemNode, ListNode } = lexicalListImport;
|
|
2
|
+
import { INSERT_CHECK_LIST_COMMAND, ListItemNode, ListNode } from '@lexical/list';
|
|
4
3
|
import { SlashMenuOption } from '../../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
|
|
5
4
|
import { ChecklistIcon } from '../../../lexical/ui/icons/Checklist/index.js';
|
|
6
5
|
import { TextDropdownSectionWithEntries } from '../../common/floatingSelectToolbarTextDropdownSection/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/lists/checklist/feature.client.tsx"],"sourcesContent":["'use client'\nimport
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/lists/checklist/feature.client.tsx"],"sourcesContent":["'use client'\nimport { INSERT_CHECK_LIST_COMMAND, ListItemNode, ListNode } from '@lexical/list'\n\nimport type { ClientFeature, FeatureProviderProviderClient } from '../../types.js'\n\nimport { SlashMenuOption } from '../../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport { ChecklistIcon } from '../../../lexical/ui/icons/Checklist/index.js'\nimport { TextDropdownSectionWithEntries } from '../../common/floatingSelectToolbarTextDropdownSection/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { LexicalListPlugin } from '../plugin/index.js'\nimport { CHECK_LIST } from './markdownTransformers.js'\nimport { LexicalCheckListPlugin } from './plugin/index.js'\n\nconst CheckListFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: ({ featureProviderMap }) => {\n const plugins: ClientFeature<undefined>['plugins'] = [\n {\n Component: LexicalCheckListPlugin,\n position: 'normal',\n },\n ]\n\n if (!featureProviderMap.has('unorderedlist') && !featureProviderMap.has('orderedlist')) {\n plugins.push({\n Component: LexicalListPlugin,\n position: 'normal',\n })\n }\n\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n TextDropdownSectionWithEntries([\n {\n ChildComponent: ChecklistIcon,\n isActive: () => false,\n key: 'checkList',\n label: `Check List`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(INSERT_CHECK_LIST_COMMAND, undefined)\n },\n order: 12,\n },\n ]),\n ],\n },\n markdownTransformers: [CHECK_LIST],\n nodes:\n featureProviderMap.has('unorderedlist') || featureProviderMap.has('orderedlist')\n ? []\n : [ListNode, ListItemNode],\n plugins,\n slashMenu: {\n options: [\n {\n displayName: 'Lists',\n key: 'lists',\n options: [\n new SlashMenuOption('checklist', {\n Icon: ChecklistIcon,\n displayName: 'Check List',\n keywords: ['check list', 'check', 'checklist', 'cl'],\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_CHECK_LIST_COMMAND, undefined)\n },\n }),\n ],\n },\n ],\n },\n }\n },\n }\n}\n\nexport const CheckListFeatureClientComponent = createClientComponent(CheckListFeatureClient)\n"],"names":["INSERT_CHECK_LIST_COMMAND","ListItemNode","ListNode","SlashMenuOption","ChecklistIcon","TextDropdownSectionWithEntries","createClientComponent","LexicalListPlugin","CHECK_LIST","LexicalCheckListPlugin","CheckListFeatureClient","props","clientFeatureProps","feature","featureProviderMap","plugins","Component","position","has","push","floatingSelectToolbar","sections","ChildComponent","isActive","key","label","onClick","editor","dispatchCommand","undefined","order","markdownTransformers","nodes","slashMenu","options","displayName","Icon","keywords","onSelect","CheckListFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,yBAAyB,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,gBAAe;AAIjF,SAASC,eAAe,QAAQ,yEAAwE;AACxG,SAASC,aAAa,QAAQ,+CAA8C;AAC5E,SAASC,8BAA8B,QAAQ,iEAAgE;AAC/G,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,iBAAiB,QAAQ,qBAAoB;AACtD,SAASC,UAAU,QAAQ,4BAA2B;AACtD,SAASC,sBAAsB,QAAQ,oBAAmB;AAE1D,MAAMC,yBAAmE,CAACC;IACxE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,CAAC,EAAEC,kBAAkB,EAAE;YAC9B,MAAMC,UAA+C;gBACnD;oBACEC,WAAWP;oBACXQ,UAAU;gBACZ;aACD;YAED,IAAI,CAACH,mBAAmBI,GAAG,CAAC,oBAAoB,CAACJ,mBAAmBI,GAAG,CAAC,gBAAgB;gBACtFH,QAAQI,IAAI,CAAC;oBACXH,WAAWT;oBACXU,UAAU;gBACZ;YACF;YAEA,OAAO;gBACLL,oBAAoBD;gBACpBS,uBAAuB;oBACrBC,UAAU;wBACRhB,+BAA+B;4BAC7B;gCACEiB,gBAAgBlB;gCAChBmB,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,UAAU,CAAC;gCACnBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAAC5B,2BAA2B6B;gCACpD;gCACAC,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAC,sBAAsB;oBAACvB;iBAAW;gBAClCwB,OACElB,mBAAmBI,GAAG,CAAC,oBAAoBJ,mBAAmBI,GAAG,CAAC,iBAC9D,EAAE,GACF;oBAAChB;oBAAUD;iBAAa;gBAC9Bc;gBACAkB,WAAW;oBACTC,SAAS;wBACP;4BACEC,aAAa;4BACbX,KAAK;4BACLU,SAAS;gCACP,IAAI/B,gBAAgB,aAAa;oCAC/BiC,MAAMhC;oCACN+B,aAAa;oCACbE,UAAU;wCAAC;wCAAc;wCAAS;wCAAa;qCAAK;oCACpDC,UAAU,CAAC,EAAEX,MAAM,EAAE;wCACnBA,OAAOC,eAAe,CAAC5B,2BAA2B6B;oCACpD;gCACF;6BACD;wBACH;qBACD;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMU,kCAAkCjC,sBAAsBI,wBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/lists/checklist/feature.server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/lists/checklist/feature.server.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAA;AAOnE,eAAO,MAAM,gBAAgB,EAAE,6BAA6B,CAAC,SAAS,EAAE,SAAS,CA6BhF,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { ListItemNode, ListNode } from '@lexical/list';
|
|
2
|
+
import { createNode } from '../../typeUtilities.js';
|
|
3
3
|
import { ListHTMLConverter, ListItemHTMLConverter } from '../htmlConverter.js';
|
|
4
4
|
import { CheckListFeatureClientComponent } from './feature.client.js';
|
|
5
5
|
import { CHECK_LIST } from './markdownTransformers.js';
|
|
@@ -12,18 +12,18 @@ export const CheckListFeature = (props)=>{
|
|
|
12
12
|
CHECK_LIST
|
|
13
13
|
],
|
|
14
14
|
nodes: featureProviderMap.has('unorderedlist') || featureProviderMap.has('orderedlist') ? [] : [
|
|
15
|
-
{
|
|
15
|
+
createNode({
|
|
16
16
|
converters: {
|
|
17
17
|
html: ListHTMLConverter
|
|
18
18
|
},
|
|
19
19
|
node: ListNode
|
|
20
|
-
},
|
|
21
|
-
{
|
|
20
|
+
}),
|
|
21
|
+
createNode({
|
|
22
22
|
converters: {
|
|
23
23
|
html: ListItemHTMLConverter
|
|
24
24
|
},
|
|
25
25
|
node: ListItemNode
|
|
26
|
-
}
|
|
26
|
+
})
|
|
27
27
|
],
|
|
28
28
|
serverFeatureProps: props
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/lists/checklist/feature.server.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/lists/checklist/feature.server.ts"],"sourcesContent":["import { ListItemNode, ListNode } from '@lexical/list'\n\nimport type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { createNode } from '../../typeUtilities.js'\nimport { ListHTMLConverter, ListItemHTMLConverter } from '../htmlConverter.js'\nimport { CheckListFeatureClientComponent } from './feature.client.js'\nimport { CHECK_LIST } from './markdownTransformers.js'\n\nexport const CheckListFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: ({ featureProviderMap }) => {\n return {\n ClientComponent: CheckListFeatureClientComponent,\n markdownTransformers: [CHECK_LIST],\n nodes:\n featureProviderMap.has('unorderedlist') || featureProviderMap.has('orderedlist')\n ? []\n : [\n createNode({\n converters: {\n html: ListHTMLConverter,\n },\n node: ListNode,\n }),\n createNode({\n converters: {\n html: ListItemHTMLConverter,\n },\n node: ListItemNode,\n }),\n ],\n serverFeatureProps: props,\n }\n },\n key: 'checklist',\n serverFeatureProps: props,\n }\n}\n"],"names":["ListItemNode","ListNode","createNode","ListHTMLConverter","ListItemHTMLConverter","CheckListFeatureClientComponent","CHECK_LIST","CheckListFeature","props","feature","featureProviderMap","ClientComponent","markdownTransformers","nodes","has","converters","html","node","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,YAAY,EAAEC,QAAQ,QAAQ,gBAAe;AAItD,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,iBAAiB,EAAEC,qBAAqB,QAAQ,sBAAqB;AAC9E,SAASC,+BAA+B,QAAQ,sBAAqB;AACrE,SAASC,UAAU,QAAQ,4BAA2B;AAEtD,OAAO,MAAMC,mBAAwE,CAACC;IACpF,OAAO;QACLC,SAAS,CAAC,EAAEC,kBAAkB,EAAE;YAC9B,OAAO;gBACLC,iBAAiBN;gBACjBO,sBAAsB;oBAACN;iBAAW;gBAClCO,OACEH,mBAAmBI,GAAG,CAAC,oBAAoBJ,mBAAmBI,GAAG,CAAC,iBAC9D,EAAE,GACF;oBACEZ,WAAW;wBACTa,YAAY;4BACVC,MAAMb;wBACR;wBACAc,MAAMhB;oBACR;oBACAC,WAAW;wBACTa,YAAY;4BACVC,MAAMZ;wBACR;wBACAa,MAAMjB;oBACR;iBACD;gBACPkB,oBAAoBV;YACtB;QACF;QACAW,KAAK;QACLD,oBAAoBV;IACtB;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdownTransformers.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/lists/checklist/markdownTransformers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"markdownTransformers.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/lists/checklist/markdownTransformers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAM3D,eAAO,MAAM,UAAU,EAAE,kBAQxB,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
const { $isListNode, ListItemNode, ListNode } = lexicalListImport;
|
|
1
|
+
import { $isListNode, ListItemNode, ListNode } from '@lexical/list';
|
|
3
2
|
import { listExport, listReplace } from '../common/markdown.js';
|
|
4
3
|
export const CHECK_LIST = {
|
|
5
4
|
type: 'element',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/lists/checklist/markdownTransformers.ts"],"sourcesContent":["import type { ElementTransformer } from '@lexical/markdown'\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/lists/checklist/markdownTransformers.ts"],"sourcesContent":["import type { ElementTransformer } from '@lexical/markdown'\n\nimport { $isListNode, ListItemNode, ListNode } from '@lexical/list'\n\nimport { listExport, listReplace } from '../common/markdown.js'\n\nexport const CHECK_LIST: ElementTransformer = {\n type: 'element',\n dependencies: [ListNode, ListItemNode],\n export: (node, exportChildren) => {\n return $isListNode(node) ? listExport(node, exportChildren, 0) : null\n },\n regExp: /^(\\s*)(?:-\\s)?\\s?(\\[(\\s|x)?\\])\\s/i,\n replace: listReplace('check'),\n}\n"],"names":["$isListNode","ListItemNode","ListNode","listExport","listReplace","CHECK_LIST","type","dependencies","export","node","exportChildren","regExp","replace"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAEA,SAASA,WAAW,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,gBAAe;AAEnE,SAASC,UAAU,EAAEC,WAAW,QAAQ,wBAAuB;AAE/D,OAAO,MAAMC,aAAiC;IAC5CC,MAAM;IACNC,cAAc;QAACL;QAAUD;KAAa;IACtCO,QAAQ,CAACC,MAAMC;QACb,OAAOV,YAAYS,QAAQN,WAAWM,MAAMC,gBAAgB,KAAK;IACnE;IACAC,QAAQ;IACRC,SAASR,YAAY;AACvB,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/lists/checklist/plugin/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/lists/checklist/plugin/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,wBAAgB,sBAAsB,sBAErC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
const { CheckListPlugin } = lexicalCheckListPluginImport;
|
|
2
|
+
import { CheckListPlugin } from '@lexical/react/LexicalCheckListPlugin.js';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
export function LexicalCheckListPlugin() {
|
|
6
5
|
return /*#__PURE__*/ React.createElement(CheckListPlugin, null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/field/features/lists/checklist/plugin/index.tsx"],"sourcesContent":["'use client'\nimport
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/field/features/lists/checklist/plugin/index.tsx"],"sourcesContent":["'use client'\nimport { CheckListPlugin } from '@lexical/react/LexicalCheckListPlugin.js'\nimport React from 'react'\n\nexport function LexicalCheckListPlugin() {\n return <CheckListPlugin />\n}\n"],"names":["CheckListPlugin","React","LexicalCheckListPlugin"],"rangeMappings":";;;;;","mappings":"AAAA;AACA,SAASA,eAAe,QAAQ,2CAA0C;AAC1E,OAAOC,WAAW,QAAO;AAEzB,OAAO,SAASC;IACd,qBAAO,oBAACF;AACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/lists/common/markdown.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/lists/common/markdown.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAO1C,eAAO,MAAM,WAAW,aAAc,QAAQ,KAAG,kBAAkB,CAAC,SAAS,CA6B5E,CAAA;AAED,eAAO,MAAM,UAAU,aACX,QAAQ,kBACF,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,SACtC,MAAM,KACZ,MA2BF,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Copied from https://github.com/facebook/lexical/blob/176b8cf16ecb332ee5efe2c75219e223b7b019f2/packages/lexical-markdown/src/MarkdownTransformers.ts#L97C1-L172C1
|
|
2
|
-
import
|
|
3
|
-
const { $createListItemNode, $createListNode, $isListItemNode, $isListNode } = lexicalListImport;
|
|
2
|
+
import { $createListItemNode, $createListNode, $isListItemNode, $isListNode } from '@lexical/list';
|
|
4
3
|
// Amount of spaces that define indentation level
|
|
5
4
|
const LIST_INDENT_SIZE = 4;
|
|
6
5
|
export const listReplace = (listType)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/lists/common/markdown.ts"],"sourcesContent":["// Copied from https://github.com/facebook/lexical/blob/176b8cf16ecb332ee5efe2c75219e223b7b019f2/packages/lexical-markdown/src/MarkdownTransformers.ts#L97C1-L172C1\n\nimport type { ListNode, ListType } from '@lexical/list'\nimport type { ElementTransformer } from '@lexical/markdown'\nimport type { ElementNode } from 'lexical'\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/lists/common/markdown.ts"],"sourcesContent":["// Copied from https://github.com/facebook/lexical/blob/176b8cf16ecb332ee5efe2c75219e223b7b019f2/packages/lexical-markdown/src/MarkdownTransformers.ts#L97C1-L172C1\n\nimport type { ListNode, ListType } from '@lexical/list'\nimport type { ElementTransformer } from '@lexical/markdown'\nimport type { ElementNode } from 'lexical'\n\nimport { $createListItemNode, $createListNode, $isListItemNode, $isListNode } from '@lexical/list'\n\n// Amount of spaces that define indentation level\nconst LIST_INDENT_SIZE = 4\n\nexport const listReplace = (listType: ListType): ElementTransformer['replace'] => {\n return (parentNode, children, match) => {\n const previousNode = parentNode.getPreviousSibling()\n const nextNode = parentNode.getNextSibling()\n const listItem = $createListItemNode(listType === 'check' ? match[3] === 'x' : undefined)\n if ($isListNode(nextNode) && nextNode.getListType() === listType) {\n const firstChild = nextNode.getFirstChild()\n if (firstChild !== null) {\n firstChild.insertBefore(listItem)\n } else {\n // should never happen, but let's handle gracefully, just in case.\n nextNode.append(listItem)\n }\n parentNode.remove()\n } else if ($isListNode(previousNode) && previousNode.getListType() === listType) {\n previousNode.append(listItem)\n parentNode.remove()\n } else {\n const list = $createListNode(listType, listType === 'number' ? Number(match[2]) : undefined)\n list.append(listItem)\n parentNode.replace(list)\n }\n listItem.append(...children)\n listItem.select(0, 0)\n const indent = Math.floor(match[1].length / LIST_INDENT_SIZE)\n if (indent) {\n listItem.setIndent(indent)\n }\n }\n}\n\nexport const listExport = (\n listNode: ListNode,\n exportChildren: (node: ElementNode) => string,\n depth: number,\n): string => {\n const output = []\n const children = listNode.getChildren()\n let index = 0\n for (const listItemNode of children) {\n if ($isListItemNode(listItemNode)) {\n if (listItemNode.getChildrenSize() === 1) {\n const firstChild = listItemNode.getFirstChild()\n if ($isListNode(firstChild)) {\n output.push(listExport(firstChild, exportChildren, depth + 1))\n continue\n }\n }\n const indent = ' '.repeat(depth * LIST_INDENT_SIZE)\n const listType = listNode.getListType()\n const prefix =\n listType === 'number'\n ? `${listNode.getStart() + index}. `\n : listType === 'check'\n ? `- [${listItemNode.getChecked() ? 'x' : ' '}] `\n : '- '\n output.push(indent + prefix + exportChildren(listItemNode))\n index++\n }\n }\n\n return output.join('\\n')\n}\n"],"names":["$createListItemNode","$createListNode","$isListItemNode","$isListNode","LIST_INDENT_SIZE","listReplace","listType","parentNode","children","match","previousNode","getPreviousSibling","nextNode","getNextSibling","listItem","undefined","getListType","firstChild","getFirstChild","insertBefore","append","remove","list","Number","replace","select","indent","Math","floor","length","setIndent","listExport","listNode","exportChildren","depth","output","getChildren","index","listItemNode","getChildrenSize","push","repeat","prefix","getStart","getChecked","join"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,mKAAmK;AAMnK,SAASA,mBAAmB,EAAEC,eAAe,EAAEC,eAAe,EAAEC,WAAW,QAAQ,gBAAe;AAElG,iDAAiD;AACjD,MAAMC,mBAAmB;AAEzB,OAAO,MAAMC,cAAc,CAACC;IAC1B,OAAO,CAACC,YAAYC,UAAUC;QAC5B,MAAMC,eAAeH,WAAWI,kBAAkB;QAClD,MAAMC,WAAWL,WAAWM,cAAc;QAC1C,MAAMC,WAAWd,oBAAoBM,aAAa,UAAUG,KAAK,CAAC,EAAE,KAAK,MAAMM;QAC/E,IAAIZ,YAAYS,aAAaA,SAASI,WAAW,OAAOV,UAAU;YAChE,MAAMW,aAAaL,SAASM,aAAa;YACzC,IAAID,eAAe,MAAM;gBACvBA,WAAWE,YAAY,CAACL;YAC1B,OAAO;gBACL,kEAAkE;gBAClEF,SAASQ,MAAM,CAACN;YAClB;YACAP,WAAWc,MAAM;QACnB,OAAO,IAAIlB,YAAYO,iBAAiBA,aAAaM,WAAW,OAAOV,UAAU;YAC/EI,aAAaU,MAAM,CAACN;YACpBP,WAAWc,MAAM;QACnB,OAAO;YACL,MAAMC,OAAOrB,gBAAgBK,UAAUA,aAAa,WAAWiB,OAAOd,KAAK,CAAC,EAAE,IAAIM;YAClFO,KAAKF,MAAM,CAACN;YACZP,WAAWiB,OAAO,CAACF;QACrB;QACAR,SAASM,MAAM,IAAIZ;QACnBM,SAASW,MAAM,CAAC,GAAG;QACnB,MAAMC,SAASC,KAAKC,KAAK,CAACnB,KAAK,CAAC,EAAE,CAACoB,MAAM,GAAGzB;QAC5C,IAAIsB,QAAQ;YACVZ,SAASgB,SAAS,CAACJ;QACrB;IACF;AACF,EAAC;AAED,OAAO,MAAMK,aAAa,CACxBC,UACAC,gBACAC;IAEA,MAAMC,SAAS,EAAE;IACjB,MAAM3B,WAAWwB,SAASI,WAAW;IACrC,IAAIC,QAAQ;IACZ,KAAK,MAAMC,gBAAgB9B,SAAU;QACnC,IAAIN,gBAAgBoC,eAAe;YACjC,IAAIA,aAAaC,eAAe,OAAO,GAAG;gBACxC,MAAMtB,aAAaqB,aAAapB,aAAa;gBAC7C,IAAIf,YAAYc,aAAa;oBAC3BkB,OAAOK,IAAI,CAACT,WAAWd,YAAYgB,gBAAgBC,QAAQ;oBAC3D;gBACF;YACF;YACA,MAAMR,SAAS,IAAIe,MAAM,CAACP,QAAQ9B;YAClC,MAAME,WAAW0B,SAAShB,WAAW;YACrC,MAAM0B,SACJpC,aAAa,WACT,CAAC,EAAE0B,SAASW,QAAQ,KAAKN,MAAM,EAAE,CAAC,GAClC/B,aAAa,UACX,CAAC,GAAG,EAAEgC,aAAaM,UAAU,KAAK,MAAM,IAAI,EAAE,CAAC,GAC/C;YACRT,OAAOK,IAAI,CAACd,SAASgB,SAAST,eAAeK;YAC7CD;QACF;IACF;IAEA,OAAOF,OAAOU,IAAI,CAAC;AACrB,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlConverter.d.ts","sourceRoot":"","sources":["../../../../src/field/features/lists/htmlConverter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAK/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAI1E,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,kBAAkB,CAe/D,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"htmlConverter.d.ts","sourceRoot":"","sources":["../../../../src/field/features/lists/htmlConverter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAK/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAI1E,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,kBAAkB,CAe/D,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,sBAAsB,CA0CvE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { ListItemNode, ListNode } from '@lexical/list';
|
|
2
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
3
3
|
import { convertLexicalNodesToHTML } from '../converters/html/converter/index.js';
|
|
4
4
|
export const ListHTMLConverter = {
|
|
5
5
|
converter: async ({ converters, node, parent, payload })=>{
|
|
@@ -12,7 +12,7 @@ export const ListHTMLConverter = {
|
|
|
12
12
|
},
|
|
13
13
|
payload
|
|
14
14
|
});
|
|
15
|
-
return `<${node?.tag} class="
|
|
15
|
+
return `<${node?.tag} class="list-${node?.listType}">${childrenText}</${node?.tag}>`;
|
|
16
16
|
},
|
|
17
17
|
nodeTypes: [
|
|
18
18
|
ListNode.getType()
|
|
@@ -20,6 +20,7 @@ export const ListHTMLConverter = {
|
|
|
20
20
|
};
|
|
21
21
|
export const ListItemHTMLConverter = {
|
|
22
22
|
converter: async ({ converters, node, parent, payload })=>{
|
|
23
|
+
const hasSubLists = node.children.some((child)=>child.type === 'list');
|
|
23
24
|
const childrenText = await convertLexicalNodesToHTML({
|
|
24
25
|
converters,
|
|
25
26
|
lexicalNodes: node.children,
|
|
@@ -30,15 +31,21 @@ export const ListItemHTMLConverter = {
|
|
|
30
31
|
payload
|
|
31
32
|
});
|
|
32
33
|
if ('listType' in parent && parent?.listType === 'check') {
|
|
33
|
-
|
|
34
|
+
const uuid = uuidv4();
|
|
35
|
+
return `<li aria-checked=${node.checked ? 'true' : 'false'} class="${'list-item-checkbox' + (node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked') + (hasSubLists ? ' nestedListItem' : '')}"
|
|
34
36
|
role="checkbox"
|
|
35
37
|
tabIndex=${-1}
|
|
36
38
|
value=${node?.value}
|
|
37
39
|
>
|
|
38
|
-
|
|
40
|
+
${hasSubLists ? childrenText : `
|
|
41
|
+
<input type="checkbox" id="${uuid}"${node.checked ? ' checked' : ''}>
|
|
42
|
+
<label for="${uuid}">${childrenText}</label><br>
|
|
43
|
+
`}
|
|
44
|
+
|
|
45
|
+
|
|
39
46
|
</li>`;
|
|
40
47
|
} else {
|
|
41
|
-
return `<li value=${node?.value}>${childrenText}</li>`;
|
|
48
|
+
return `<li ${hasSubLists ? `class="nestedListItem" ` : ''}value=${node?.value}>${childrenText}</li>`;
|
|
42
49
|
}
|
|
43
50
|
},
|
|
44
51
|
nodeTypes: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/lists/htmlConverter.ts"],"sourcesContent":["import type { SerializedListItemNode, SerializedListNode } from '@lexical/list'\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/lists/htmlConverter.ts"],"sourcesContent":["import type { SerializedListItemNode, SerializedListNode } from '@lexical/list'\n\nimport { ListItemNode, ListNode } from '@lexical/list'\nimport { v4 as uuidv4 } from 'uuid'\n\nimport type { HTMLConverter } from '../converters/html/converter/types.js'\n\nimport { convertLexicalNodesToHTML } from '../converters/html/converter/index.js'\n\nexport const ListHTMLConverter: HTMLConverter<SerializedListNode> = {\n converter: async ({ converters, node, parent, payload }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n payload,\n })\n\n return `<${node?.tag} class=\"list-${node?.listType}\">${childrenText}</${node?.tag}>`\n },\n nodeTypes: [ListNode.getType()],\n}\n\nexport const ListItemHTMLConverter: HTMLConverter<SerializedListItemNode> = {\n converter: async ({ converters, node, parent, payload }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n payload,\n })\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n\n return `<li aria-checked=${node.checked ? 'true' : 'false'} class=\"${\n 'list-item-checkbox' +\n (node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked') +\n (hasSubLists ? ' nestedListItem' : '')\n }\"\n role=\"checkbox\"\n tabIndex=${-1}\n value=${node?.value}\n >\n ${\n hasSubLists\n ? childrenText\n : `\n <input type=\"checkbox\" id=\"${uuid}\"${node.checked ? ' checked' : ''}>\n <label for=\"${uuid}\">${childrenText}</label><br>\n `\n }\n\n\n </li>`\n } else {\n return `<li ${hasSubLists ? `class=\"nestedListItem\" ` : ''}value=${node?.value}>${childrenText}</li>`\n }\n },\n nodeTypes: [ListItemNode.getType()],\n}\n"],"names":["ListItemNode","ListNode","v4","uuidv4","convertLexicalNodesToHTML","ListHTMLConverter","converter","converters","node","parent","payload","childrenText","lexicalNodes","children","tag","listType","nodeTypes","getType","ListItemHTMLConverter","hasSubLists","some","child","type","uuid","checked","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,YAAY,EAAEC,QAAQ,QAAQ,gBAAe;AACtD,SAASC,MAAMC,MAAM,QAAQ,OAAM;AAInC,SAASC,yBAAyB,QAAQ,wCAAuC;AAEjF,OAAO,MAAMC,oBAAuD;IAClEC,WAAW,OAAO,EAAEC,UAAU,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAE;QACrD,MAAMC,eAAe,MAAMP,0BAA0B;YACnDG;YACAK,cAAcJ,KAAKK,QAAQ;YAC3BJ,QAAQ;gBACN,GAAGD,IAAI;gBACPC;YACF;YACAC;QACF;QAEA,OAAO,CAAC,CAAC,EAAEF,MAAMM,IAAI,aAAa,EAAEN,MAAMO,SAAS,EAAE,EAAEJ,aAAa,EAAE,EAAEH,MAAMM,IAAI,CAAC,CAAC;IACtF;IACAE,WAAW;QAACf,SAASgB,OAAO;KAAG;AACjC,EAAC;AAED,OAAO,MAAMC,wBAA+D;IAC1EZ,WAAW,OAAO,EAAEC,UAAU,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAE;QACrD,MAAMS,cAAcX,KAAKK,QAAQ,CAACO,IAAI,CAAC,CAACC,QAAUA,MAAMC,IAAI,KAAK;QAEjE,MAAMX,eAAe,MAAMP,0BAA0B;YACnDG;YACAK,cAAcJ,KAAKK,QAAQ;YAC3BJ,QAAQ;gBACN,GAAGD,IAAI;gBACPC;YACF;YACAC;QACF;QAEA,IAAI,cAAcD,UAAUA,QAAQM,aAAa,SAAS;YACxD,MAAMQ,OAAOpB;YAEb,OAAO,CAAC,iBAAiB,EAAEK,KAAKgB,OAAO,GAAG,SAAS,QAAQ,QAAQ,EACjE,uBACChB,CAAAA,KAAKgB,OAAO,GAAG,gCAAgC,+BAA8B,IAC7EL,CAAAA,cAAc,oBAAoB,EAAC,EACrC;;mBAEY,EAAE,CAAC,EAAE;gBACR,EAAEX,MAAMiB,MAAM;;MAExB,EACEN,cACIR,eACA,CAAC;mCACsB,EAAEY,KAAK,CAAC,EAAEf,KAAKgB,OAAO,GAAG,aAAa,GAAG;oBACxD,EAAED,KAAK,EAAE,EAAEZ,aAAa;MACtC,CAAC,CACA;;;eAGQ,CAAC;QACZ,OAAO;YACL,OAAO,CAAC,IAAI,EAAEQ,cAAc,CAAC,uBAAuB,CAAC,GAAG,GAAG,MAAM,EAAEX,MAAMiB,MAAM,CAAC,EAAEd,aAAa,KAAK,CAAC;QACvG;IACF;IACAK,WAAW;QAAChB,aAAaiB,OAAO;KAAG;AACrC,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/lists/orderedlist/feature.client.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/lists/orderedlist/feature.client.tsx"],"names":[],"mappings":";AAmEA,eAAO,MAAM,iCAAiC,+BAAkD,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
const { INSERT_ORDERED_LIST_COMMAND, ListItemNode, ListNode } = lexicalListImport;
|
|
2
|
+
import { INSERT_ORDERED_LIST_COMMAND, ListItemNode, ListNode } from '@lexical/list';
|
|
4
3
|
import { SlashMenuOption } from '../../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
|
|
5
4
|
import { OrderedListIcon } from '../../../lexical/ui/icons/OrderedList/index.js';
|
|
6
5
|
import { TextDropdownSectionWithEntries } from '../../common/floatingSelectToolbarTextDropdownSection/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/lists/orderedlist/feature.client.tsx"],"sourcesContent":["'use client'\nimport
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/lists/orderedlist/feature.client.tsx"],"sourcesContent":["'use client'\nimport { INSERT_ORDERED_LIST_COMMAND, ListItemNode, ListNode } from '@lexical/list'\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { SlashMenuOption } from '../../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport { OrderedListIcon } from '../../../lexical/ui/icons/OrderedList/index.js'\nimport { TextDropdownSectionWithEntries } from '../../common/floatingSelectToolbarTextDropdownSection/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { LexicalListPlugin } from '../plugin/index.js'\nimport { ORDERED_LIST } from './markdownTransformer.js'\n\nconst OrderedListFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: ({ featureProviderMap }) => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n TextDropdownSectionWithEntries([\n {\n ChildComponent: OrderedListIcon,\n isActive: () => false,\n key: 'orderedList',\n label: `Ordered List`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined)\n },\n order: 10,\n },\n ]),\n ],\n },\n markdownTransformers: [ORDERED_LIST],\n nodes: featureProviderMap.has('unorderedlist') ? [] : [ListNode, ListItemNode],\n plugins: featureProviderMap.has('unorderedlist')\n ? []\n : [\n {\n Component: LexicalListPlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n options: [\n {\n displayName: 'Lists',\n key: 'lists',\n options: [\n new SlashMenuOption('orderedlist', {\n Icon: OrderedListIcon,\n displayName: 'Ordered List',\n keywords: ['ordered list', 'ol'],\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined)\n },\n }),\n ],\n },\n ],\n },\n }\n },\n }\n}\n\nexport const OrderedListFeatureClientComponent = createClientComponent(OrderedListFeatureClient)\n"],"names":["INSERT_ORDERED_LIST_COMMAND","ListItemNode","ListNode","SlashMenuOption","OrderedListIcon","TextDropdownSectionWithEntries","createClientComponent","LexicalListPlugin","ORDERED_LIST","OrderedListFeatureClient","props","clientFeatureProps","feature","featureProviderMap","floatingSelectToolbar","sections","ChildComponent","isActive","key","label","onClick","editor","dispatchCommand","undefined","order","markdownTransformers","nodes","has","plugins","Component","position","slashMenu","options","displayName","Icon","keywords","onSelect","OrderedListFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,2BAA2B,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,gBAAe;AAInF,SAASC,eAAe,QAAQ,yEAAwE;AACxG,SAASC,eAAe,QAAQ,iDAAgD;AAChF,SAASC,8BAA8B,QAAQ,iEAAgE;AAC/G,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,iBAAiB,QAAQ,qBAAoB;AACtD,SAASC,YAAY,QAAQ,2BAA0B;AAEvD,MAAMC,2BAAqE,CAACC;IAC1E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,CAAC,EAAEC,kBAAkB,EAAE;YAC9B,OAAO;gBACLF,oBAAoBD;gBACpBI,uBAAuB;oBACrBC,UAAU;wBACRV,+BAA+B;4BAC7B;gCACEW,gBAAgBZ;gCAChBa,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,YAAY,CAAC;gCACrBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACtB,6BAA6BuB;gCACtD;gCACAC,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAC,sBAAsB;oBAACjB;iBAAa;gBACpCkB,OAAOb,mBAAmBc,GAAG,CAAC,mBAAmB,EAAE,GAAG;oBAACzB;oBAAUD;iBAAa;gBAC9E2B,SAASf,mBAAmBc,GAAG,CAAC,mBAC5B,EAAE,GACF;oBACE;wBACEE,WAAWtB;wBACXuB,UAAU;oBACZ;iBACD;gBACLC,WAAW;oBACTC,SAAS;wBACP;4BACEC,aAAa;4BACbf,KAAK;4BACLc,SAAS;gCACP,IAAI7B,gBAAgB,eAAe;oCACjC+B,MAAM9B;oCACN6B,aAAa;oCACbE,UAAU;wCAAC;wCAAgB;qCAAK;oCAChCC,UAAU,CAAC,EAAEf,MAAM,EAAE;wCACnBA,OAAOC,eAAe,CAACtB,6BAA6BuB;oCACtD;gCACF;6BACD;wBACH;qBACD;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMc,oCAAoC/B,sBAAsBG,0BAAyB"}
|