@payloadcms/richtext-lexical 3.0.0-alpha.59 → 3.0.0-alpha.61
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.js.map +1 -1
- package/dist/exports/components.js.map +1 -1
- package/dist/field/Field.js.map +1 -1
- package/dist/field/features/align/feature.client.js.map +1 -1
- package/dist/field/features/align/feature.server.js.map +1 -1
- package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js.map +1 -1
- package/dist/field/features/blockquote/feature.client.js.map +1 -1
- package/dist/field/features/blockquote/feature.server.js.map +1 -1
- package/dist/field/features/blockquote/markdownTransformer.js.map +1 -1
- package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
- package/dist/field/features/blocks/component/FormSavePlugin.js.map +1 -1
- package/dist/field/features/blocks/component/index.js.map +1 -1
- package/dist/field/features/blocks/component/removeEmptyArrayValues.js.map +1 -1
- package/dist/field/features/blocks/drawer/index.js.map +1 -1
- package/dist/field/features/blocks/feature.client.js.map +1 -1
- package/dist/field/features/blocks/feature.server.js.map +1 -1
- package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
- package/dist/field/features/blocks/plugin/commands.js.map +1 -1
- package/dist/field/features/blocks/plugin/index.js.map +1 -1
- package/dist/field/features/blocks/populationPromise.js.map +1 -1
- package/dist/field/features/blocks/validate.js.map +1 -1
- package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js.map +1 -1
- package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js.map +1 -1
- package/dist/field/features/converters/html/converter/converters/linebreak.js.map +1 -1
- package/dist/field/features/converters/html/converter/converters/paragraph.js.map +1 -1
- package/dist/field/features/converters/html/converter/converters/text.js.map +1 -1
- package/dist/field/features/converters/html/converter/defaultConverters.js.map +1 -1
- package/dist/field/features/converters/html/converter/index.js.map +1 -1
- package/dist/field/features/converters/html/converter/types.js.map +1 -1
- package/dist/field/features/converters/html/feature.server.js.map +1 -1
- package/dist/field/features/converters/html/field/index.js.map +1 -1
- package/dist/field/features/createClientComponent.js.map +1 -1
- package/dist/field/features/createFeaturePropComponent.js.map +1 -1
- package/dist/field/features/debug/testrecorder/feature.client.js.map +1 -1
- package/dist/field/features/debug/testrecorder/feature.server.js.map +1 -1
- package/dist/field/features/debug/testrecorder/plugin/index.js.map +1 -1
- package/dist/field/features/debug/treeview/feature.client.js.map +1 -1
- package/dist/field/features/debug/treeview/feature.server.js.map +1 -1
- package/dist/field/features/debug/treeview/plugin/index.js.map +1 -1
- package/dist/field/features/format/bold/feature.client.js.map +1 -1
- package/dist/field/features/format/bold/feature.server.js.map +1 -1
- package/dist/field/features/format/bold/markdownTransformers.js.map +1 -1
- package/dist/field/features/format/common/floatingSelectToolbarSection.js.map +1 -1
- package/dist/field/features/format/inlinecode/feature.client.js.map +1 -1
- package/dist/field/features/format/inlinecode/feature.server.js.map +1 -1
- package/dist/field/features/format/inlinecode/markdownTransformers.js.map +1 -1
- package/dist/field/features/format/italic/feature.client.js.map +1 -1
- package/dist/field/features/format/italic/feature.server.js.map +1 -1
- package/dist/field/features/format/italic/markdownTransformers.js.map +1 -1
- package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
- package/dist/field/features/format/strikethrough/feature.server.js.map +1 -1
- package/dist/field/features/format/strikethrough/markdownTransformers.js.map +1 -1
- package/dist/field/features/format/subscript/feature.client.js.map +1 -1
- package/dist/field/features/format/subscript/feature.server.js.map +1 -1
- package/dist/field/features/format/superscript/feature.client.js.map +1 -1
- package/dist/field/features/format/superscript/feature.server.js.map +1 -1
- package/dist/field/features/format/underline/feature.client.js.map +1 -1
- package/dist/field/features/format/underline/feature.server.js.map +1 -1
- package/dist/field/features/heading/feature.client.js.map +1 -1
- package/dist/field/features/heading/feature.server.js.map +1 -1
- package/dist/field/features/heading/markdownTransformer.js.map +1 -1
- package/dist/field/features/indent/feature.client.js.map +1 -1
- package/dist/field/features/indent/feature.server.js.map +1 -1
- package/dist/field/features/indent/floatingSelectToolbarIndentSection.js.map +1 -1
- package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
- package/dist/field/features/link/drawer/baseFields.js +8 -19
- package/dist/field/features/link/drawer/baseFields.js.map +1 -1
- package/dist/field/features/link/drawer/index.js.map +1 -1
- package/dist/field/features/link/drawer/types.js.map +1 -1
- package/dist/field/features/link/feature.client.js.map +1 -1
- package/dist/field/features/link/feature.server.d.ts.map +1 -1
- package/dist/field/features/link/feature.server.js +1 -8
- package/dist/field/features/link/feature.server.js.map +1 -1
- package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
- package/dist/field/features/link/nodes/LinkNode.js +2 -2
- package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/field/features/link/nodes/types.js.map +1 -1
- package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
- package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
- 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 +15 -6
- package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/types.d.ts +2 -0
- package/dist/field/features/link/plugins/floatingLinkEditor/types.d.ts.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/types.js.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +2 -1
- package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
- package/dist/field/features/link/plugins/link/index.js.map +1 -1
- package/dist/field/features/link/populationPromise.js.map +1 -1
- package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
- package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
- package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
- package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
- package/dist/field/features/lists/common/markdown.js.map +1 -1
- package/dist/field/features/lists/htmlConverter.js.map +1 -1
- package/dist/field/features/lists/orderedlist/feature.client.js.map +1 -1
- package/dist/field/features/lists/orderedlist/feature.server.js.map +1 -1
- package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +1 -1
- package/dist/field/features/lists/plugin/index.js.map +1 -1
- package/dist/field/features/lists/unorderedlist/feature.client.js.map +1 -1
- package/dist/field/features/lists/unorderedlist/feature.server.js.map +1 -1
- package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/heading/client.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/heading/index.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/link/client.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/link/index.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/list/client.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/list/index.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/listItem/client.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/listItem/index.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/quote/client.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/quote/index.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/unknown/client.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/unknown/index.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/client.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/index.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/converter/types.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/feature.client.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/feature.server.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
- package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +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/converter.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/heading/client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/heading/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/indent/client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/indent/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/link/client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/link/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/listItem/client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/listItem/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/orderedList/client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/orderedList/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/unknown/client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/unknown/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/unorderedList/client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/unorderedList/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/upload/client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/converters/upload/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/defaultConverters.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/converter/types.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/feature.client.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/feature.server.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
- package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
- package/dist/field/features/paragraph/feature.client.js.map +1 -1
- package/dist/field/features/paragraph/feature.server.js.map +1 -1
- package/dist/field/features/relationship/drawer/commands.js.map +1 -1
- package/dist/field/features/relationship/drawer/index.js.map +1 -1
- package/dist/field/features/relationship/feature.client.js.map +1 -1
- package/dist/field/features/relationship/feature.server.js.map +1 -1
- package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
- package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
- package/dist/field/features/relationship/plugins/index.js.map +1 -1
- package/dist/field/features/relationship/populationPromise.js.map +1 -1
- package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.js +1 -1
- package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.js.map +1 -1
- package/dist/field/features/types.d.ts +6 -1
- 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.js.map +1 -1
- package/dist/field/features/upload/component/index.js.map +1 -1
- package/dist/field/features/upload/drawer/commands.js.map +1 -1
- package/dist/field/features/upload/drawer/index.js.map +1 -1
- package/dist/field/features/upload/feature.client.js.map +1 -1
- package/dist/field/features/upload/feature.server.js.map +1 -1
- package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
- package/dist/field/features/upload/plugin/index.js.map +1 -1
- package/dist/field/features/upload/populationPromise.js.map +1 -1
- package/dist/field/features/upload/validate.js.map +1 -1
- package/dist/field/index.js.map +1 -1
- package/dist/field/lexical/EditorPlugin.js.map +1 -1
- package/dist/field/lexical/LexicalEditor.js.map +1 -1
- package/dist/field/lexical/LexicalProvider.js.map +1 -1
- package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
- package/dist/field/lexical/config/client/default.js.map +1 -1
- package/dist/field/lexical/config/client/loader.js.map +1 -1
- package/dist/field/lexical/config/client/sanitize.js.map +1 -1
- package/dist/field/lexical/config/server/default.js.map +1 -1
- package/dist/field/lexical/config/server/loader.js.map +1 -1
- package/dist/field/lexical/config/server/sanitize.js.map +1 -1
- package/dist/field/lexical/config/types.js.map +1 -1
- package/dist/field/lexical/nodes/index.js.map +1 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +1 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js.map +1 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +1 -1
- package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js.map +1 -1
- package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
- package/dist/field/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/debounce.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
- package/dist/field/lexical/plugins/handles/utils/getCollapsedMargins.js.map +1 -1
- package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
- package/dist/field/lexical/plugins/handles/utils/isOnHandleElement.js.map +1 -1
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
- package/dist/field/lexical/theme/EditorTheme.js.map +1 -1
- package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/field/lexical/ui/icons/AI/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/AlignCenter/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/AlignJustify/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/AlignLeft/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/AlignRight/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Block/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Blockquote/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Bold/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Checklist/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Code/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/CodeBlock/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/H1/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/H2/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/H3/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/H4/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/H5/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/H6/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Italic/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Link/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/OrderedList/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Relationship/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Strikethrough/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Subscript/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Superscript/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Text/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Underline/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/UnorderedList/index.js.map +1 -1
- package/dist/field/lexical/ui/icons/Upload/index.js.map +1 -1
- package/dist/field/lexical/utils/canUseDOM.js.map +1 -1
- package/dist/field/lexical/utils/cloneDeep.js.map +1 -1
- package/dist/field/lexical/utils/environment.js.map +1 -1
- package/dist/field/lexical/utils/getDOMRangeRect.js.map +1 -1
- package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
- package/dist/field/lexical/utils/guard.js.map +1 -1
- package/dist/field/lexical/utils/invariant.js.map +1 -1
- package/dist/field/lexical/utils/joinClasses.js.map +1 -1
- package/dist/field/lexical/utils/markdown/createBlockNode.js.map +1 -1
- package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
- package/dist/field/lexical/utils/point.js.map +1 -1
- package/dist/field/lexical/utils/rect.js.map +1 -1
- package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
- package/dist/field/lexical/utils/setFloatingElemPositionForLinkEditor.js.map +1 -1
- package/dist/field/lexical/utils/swipe.js.map +1 -1
- package/dist/field/lexical/utils/url.js.map +1 -1
- package/dist/generateComponentMap.d.ts.map +1 -1
- package/dist/generateComponentMap.js +4 -1
- package/dist/generateComponentMap.js.map +1 -1
- package/dist/generateSchemaMap.d.ts.map +1 -1
- package/dist/generateSchemaMap.js +2 -1
- package/dist/generateSchemaMap.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/populate/defaultValue.js.map +1 -1
- package/dist/populate/populate.js.map +1 -1
- package/dist/populate/recurseNestedFields.js.map +1 -1
- package/dist/populate/richTextRelationshipPromise.js.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/useLexicalFeature.js.map +1 -1
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/validateNodes.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/format/subscript/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { SubscriptIcon } from '../../../lexical/ui/icons/Subscript/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { SectionWithEntries } from '../common/floatingSelectToolbarSection.js'\n\nconst SubscriptFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n SectionWithEntries([\n {\n ChildComponent: SubscriptIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('subscript')\n }\n return false\n },\n key: 'subscript',\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'subscript')\n },\n order: 5,\n },\n ]),\n ],\n },\n }\n },\n }\n}\n\nexport const SubscriptFeatureClientComponent = createClientComponent(SubscriptFeatureClient)\n"],"names":["lexicalImport","$isRangeSelection","FORMAT_TEXT_COMMAND","SubscriptIcon","createClientComponent","SectionWithEntries","SubscriptFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","hasFormat","key","onClick","editor","dispatchCommand","order","SubscriptFeatureClientComponent"],"mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAE,GAAGF;AAInD,SAASG,aAAa,QAAQ,+CAA8C;AAC5E,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,4CAA2C;AAE9E,MAAMC,yBAAmE,CAACC;IACxE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRN,mBAAmB;4BACjB;gCACEO,gBAAgBT;gCAChBU,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIb,kBAAkBa,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACjB,qBAAqB;gCAC9C;gCACAkB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMC,kCAAkCjB,sBAAsBE,wBAAuB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/format/subscript/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { SubscriptIcon } from '../../../lexical/ui/icons/Subscript/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { SectionWithEntries } from '../common/floatingSelectToolbarSection.js'\n\nconst SubscriptFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n SectionWithEntries([\n {\n ChildComponent: SubscriptIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('subscript')\n }\n return false\n },\n key: 'subscript',\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'subscript')\n },\n order: 5,\n },\n ]),\n ],\n },\n }\n },\n }\n}\n\nexport const SubscriptFeatureClientComponent = createClientComponent(SubscriptFeatureClient)\n"],"names":["lexicalImport","$isRangeSelection","FORMAT_TEXT_COMMAND","SubscriptIcon","createClientComponent","SectionWithEntries","SubscriptFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","hasFormat","key","onClick","editor","dispatchCommand","order","SubscriptFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAE,GAAGF;AAInD,SAASG,aAAa,QAAQ,+CAA8C;AAC5E,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,4CAA2C;AAE9E,MAAMC,yBAAmE,CAACC;IACxE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRN,mBAAmB;4BACjB;gCACEO,gBAAgBT;gCAChBU,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIb,kBAAkBa,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACjB,qBAAqB;gCAC9C;gCACAkB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMC,kCAAkCjB,sBAAsBE,wBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/format/subscript/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { SubscriptFeatureClientComponent } from './feature.client.js'\n\nexport const SubscriptFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: SubscriptFeatureClientComponent,\n serverFeatureProps: props,\n }\n },\n key: 'subscript',\n serverFeatureProps: props,\n }\n}\n"],"names":["SubscriptFeatureClientComponent","SubscriptFeature","props","feature","ClientComponent","serverFeatureProps","key"],"mappings":"AAEA,SAASA,+BAA+B,QAAQ,sBAAqB;AAErE,OAAO,MAAMC,mBAAwE,CAACC;IACpF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/format/subscript/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { SubscriptFeatureClientComponent } from './feature.client.js'\n\nexport const SubscriptFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: SubscriptFeatureClientComponent,\n serverFeatureProps: props,\n }\n },\n key: 'subscript',\n serverFeatureProps: props,\n }\n}\n"],"names":["SubscriptFeatureClientComponent","SubscriptFeature","props","feature","ClientComponent","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAEA,SAASA,+BAA+B,QAAQ,sBAAqB;AAErE,OAAO,MAAMC,mBAAwE,CAACC;IACpF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/format/superscript/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { SuperscriptIcon } from '../../../lexical/ui/icons/Superscript/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { SectionWithEntries } from '../common/floatingSelectToolbarSection.js'\n\nconst SuperscriptFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n SectionWithEntries([\n {\n ChildComponent: SuperscriptIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('superscript')\n }\n return false\n },\n key: 'superscript',\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'superscript')\n },\n order: 6,\n },\n ]),\n ],\n },\n }\n },\n }\n}\n\nexport const SuperscriptFeatureClientComponent = createClientComponent(SuperscriptFeatureClient)\n"],"names":["lexicalImport","$isRangeSelection","FORMAT_TEXT_COMMAND","SuperscriptIcon","createClientComponent","SectionWithEntries","SuperscriptFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","hasFormat","key","onClick","editor","dispatchCommand","order","SuperscriptFeatureClientComponent"],"mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAE,GAAGF;AAInD,SAASG,eAAe,QAAQ,iDAAgD;AAChF,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,4CAA2C;AAE9E,MAAMC,2BAAqE,CAACC;IAC1E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRN,mBAAmB;4BACjB;gCACEO,gBAAgBT;gCAChBU,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIb,kBAAkBa,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACjB,qBAAqB;gCAC9C;gCACAkB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMC,oCAAoCjB,sBAAsBE,0BAAyB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/format/superscript/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { SuperscriptIcon } from '../../../lexical/ui/icons/Superscript/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { SectionWithEntries } from '../common/floatingSelectToolbarSection.js'\n\nconst SuperscriptFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n SectionWithEntries([\n {\n ChildComponent: SuperscriptIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('superscript')\n }\n return false\n },\n key: 'superscript',\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'superscript')\n },\n order: 6,\n },\n ]),\n ],\n },\n }\n },\n }\n}\n\nexport const SuperscriptFeatureClientComponent = createClientComponent(SuperscriptFeatureClient)\n"],"names":["lexicalImport","$isRangeSelection","FORMAT_TEXT_COMMAND","SuperscriptIcon","createClientComponent","SectionWithEntries","SuperscriptFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","hasFormat","key","onClick","editor","dispatchCommand","order","SuperscriptFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAE,GAAGF;AAInD,SAASG,eAAe,QAAQ,iDAAgD;AAChF,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,4CAA2C;AAE9E,MAAMC,2BAAqE,CAACC;IAC1E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRN,mBAAmB;4BACjB;gCACEO,gBAAgBT;gCAChBU,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIb,kBAAkBa,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACjB,qBAAqB;gCAC9C;gCACAkB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMC,oCAAoCjB,sBAAsBE,0BAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/format/superscript/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { SuperscriptFeatureClientComponent } from './feature.client.js'\n\nexport const SuperscriptFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: SuperscriptFeatureClientComponent,\n serverFeatureProps: props,\n }\n },\n key: 'superscript',\n serverFeatureProps: props,\n }\n}\n"],"names":["SuperscriptFeatureClientComponent","SuperscriptFeature","props","feature","ClientComponent","serverFeatureProps","key"],"mappings":"AAEA,SAASA,iCAAiC,QAAQ,sBAAqB;AAEvE,OAAO,MAAMC,qBAA0E,CAACC;IACtF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/format/superscript/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { SuperscriptFeatureClientComponent } from './feature.client.js'\n\nexport const SuperscriptFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: SuperscriptFeatureClientComponent,\n serverFeatureProps: props,\n }\n },\n key: 'superscript',\n serverFeatureProps: props,\n }\n}\n"],"names":["SuperscriptFeatureClientComponent","SuperscriptFeature","props","feature","ClientComponent","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAEA,SAASA,iCAAiC,QAAQ,sBAAqB;AAEvE,OAAO,MAAMC,qBAA0E,CAACC;IACtF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/format/underline/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { UnderlineIcon } from '../../../lexical/ui/icons/Underline/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { SectionWithEntries } from '../common/floatingSelectToolbarSection.js'\n\nconst UnderlineFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n SectionWithEntries([\n {\n ChildComponent: UnderlineIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('underline')\n }\n return false\n },\n key: 'underline',\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline')\n },\n order: 3,\n },\n ]),\n ],\n },\n }\n },\n }\n}\n\nexport const UnderlineFeatureClientComponent = createClientComponent(UnderlineFeatureClient)\n"],"names":["lexicalImport","$isRangeSelection","FORMAT_TEXT_COMMAND","UnderlineIcon","createClientComponent","SectionWithEntries","UnderlineFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","hasFormat","key","onClick","editor","dispatchCommand","order","UnderlineFeatureClientComponent"],"mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAE,GAAGF;AAInD,SAASG,aAAa,QAAQ,+CAA8C;AAC5E,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,4CAA2C;AAE9E,MAAMC,yBAAmE,CAACC;IACxE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRN,mBAAmB;4BACjB;gCACEO,gBAAgBT;gCAChBU,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIb,kBAAkBa,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACjB,qBAAqB;gCAC9C;gCACAkB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMC,kCAAkCjB,sBAAsBE,wBAAuB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/format/underline/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { UnderlineIcon } from '../../../lexical/ui/icons/Underline/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { SectionWithEntries } from '../common/floatingSelectToolbarSection.js'\n\nconst UnderlineFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n SectionWithEntries([\n {\n ChildComponent: UnderlineIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('underline')\n }\n return false\n },\n key: 'underline',\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline')\n },\n order: 3,\n },\n ]),\n ],\n },\n }\n },\n }\n}\n\nexport const UnderlineFeatureClientComponent = createClientComponent(UnderlineFeatureClient)\n"],"names":["lexicalImport","$isRangeSelection","FORMAT_TEXT_COMMAND","UnderlineIcon","createClientComponent","SectionWithEntries","UnderlineFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","hasFormat","key","onClick","editor","dispatchCommand","order","UnderlineFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAE,GAAGF;AAInD,SAASG,aAAa,QAAQ,+CAA8C;AAC5E,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,4CAA2C;AAE9E,MAAMC,yBAAmE,CAACC;IACxE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRN,mBAAmB;4BACjB;gCACEO,gBAAgBT;gCAChBU,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIb,kBAAkBa,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACjB,qBAAqB;gCAC9C;gCACAkB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMC,kCAAkCjB,sBAAsBE,wBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/format/underline/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { UnderlineFeatureClientComponent } from './feature.client.js'\n\nexport const UnderlineFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: UnderlineFeatureClientComponent,\n serverFeatureProps: props,\n }\n },\n key: 'underline',\n serverFeatureProps: props,\n }\n}\n"],"names":["UnderlineFeatureClientComponent","UnderlineFeature","props","feature","ClientComponent","serverFeatureProps","key"],"mappings":"AAEA,SAASA,+BAA+B,QAAQ,sBAAqB;AAErE,OAAO,MAAMC,mBAAwE,CAACC;IACpF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/format/underline/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { UnderlineFeatureClientComponent } from './feature.client.js'\n\nexport const UnderlineFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: UnderlineFeatureClientComponent,\n serverFeatureProps: props,\n }\n },\n key: 'underline',\n serverFeatureProps: props,\n }\n}\n"],"names":["UnderlineFeatureClientComponent","UnderlineFeature","props","feature","ClientComponent","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAEA,SAASA,+BAA+B,QAAQ,sBAAqB;AAErE,OAAO,MAAMC,mBAAwE,CAACC;IACpF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/heading/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { HeadingTagType } from '@lexical/rich-text'\n\nimport lexicalRichTextImport from '@lexical/rich-text'\nconst { $createHeadingNode, HeadingNode } = lexicalRichTextImport\n\nimport lexicalSelectionImport from '@lexical/selection'\nconst { $setBlocksType } = lexicalSelectionImport\n\nimport lexicalImport from 'lexical'\nconst { $getSelection } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { HeadingFeatureProps } from './feature.server.js'\n\nimport { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport { H1Icon } from '../../lexical/ui/icons/H1/index.js'\nimport { H2Icon } from '../../lexical/ui/icons/H2/index.js'\nimport { H3Icon } from '../../lexical/ui/icons/H3/index.js'\nimport { H4Icon } from '../../lexical/ui/icons/H4/index.js'\nimport { H5Icon } from '../../lexical/ui/icons/H5/index.js'\nimport { H6Icon } from '../../lexical/ui/icons/H6/index.js'\nimport { TextDropdownSectionWithEntries } from '../common/floatingSelectToolbarTextDropdownSection/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nconst setHeading = (headingSize: HeadingTagType) => {\n const selection = $getSelection()\n $setBlocksType(selection, () => $createHeadingNode(headingSize))\n}\n\nconst iconImports = {\n h1: H1Icon,\n h2: H2Icon,\n h3: H3Icon,\n h4: H4Icon,\n h5: H5Icon,\n h6: H6Icon,\n}\n\nconst HeadingFeatureClient: FeatureProviderProviderClient<HeadingFeatureProps> = (props) => {\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n ...enabledHeadingSizes.map((headingSize, i) =>\n TextDropdownSectionWithEntries([\n {\n ChildComponent: iconImports[headingSize],\n isActive: () => false,\n key: headingSize,\n label: `Heading ${headingSize.charAt(1)}`,\n onClick: ({ editor }) => {\n editor.update(() => {\n setHeading(headingSize)\n })\n },\n order: i + 2,\n },\n ]),\n ),\n ],\n },\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [HeadingNode],\n slashMenu: {\n options: [\n ...enabledHeadingSizes.map((headingSize) => {\n return {\n displayName: 'Basic',\n key: 'basic',\n options: [\n new SlashMenuOption(`heading-${headingSize.charAt(1)}`, {\n Icon: iconImports[headingSize],\n displayName: `Heading ${headingSize.charAt(1)}`,\n keywords: ['heading', headingSize],\n onSelect: () => {\n setHeading(headingSize)\n },\n }),\n ],\n }\n }),\n ],\n },\n }\n },\n }\n}\n\nexport const HeadingFeatureClientComponent = createClientComponent(HeadingFeatureClient)\n"],"names":["lexicalRichTextImport","$createHeadingNode","HeadingNode","lexicalSelectionImport","$setBlocksType","lexicalImport","$getSelection","SlashMenuOption","H1Icon","H2Icon","H3Icon","H4Icon","H5Icon","H6Icon","TextDropdownSectionWithEntries","createClientComponent","MarkdownTransformer","setHeading","headingSize","selection","iconImports","h1","h2","h3","h4","h5","h6","HeadingFeatureClient","props","enabledHeadingSizes","clientFeatureProps","feature","floatingSelectToolbar","sections","map","i","ChildComponent","isActive","key","label","charAt","onClick","editor","update","order","markdownTransformers","nodes","slashMenu","options","displayName","Icon","keywords","onSelect","HeadingFeatureClientComponent"],"mappings":"AAAA;AAIA,OAAOA,2BAA2B,qBAAoB;AACtD,MAAM,EAAEC,kBAAkB,EAAEC,WAAW,EAAE,GAAGF;AAE5C,OAAOG,4BAA4B,qBAAoB;AACvD,MAAM,EAAEC,cAAc,EAAE,GAAGD;AAE3B,OAAOE,mBAAmB,UAAS;AACnC,MAAM,EAAEC,aAAa,EAAE,GAAGD;AAK1B,SAASE,eAAe,QAAQ,sEAAqE;AACrG,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,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AC,GAAG,CAAC;wCAC/CW,UAAU;4CAAC;4CAAWjC;yCAAY;wCAClCkC,UAAU;4CACRnC,WAAWC;wCACb;oCACF;iCACD;4BACH;wBACF;qBACD;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMmC,gCAAgCtC,sBAAsBY,sBAAqB"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/heading/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { HeadingTagType } from '@lexical/rich-text'\n\nimport lexicalRichTextImport from '@lexical/rich-text'\nconst { $createHeadingNode, HeadingNode } = lexicalRichTextImport\n\nimport lexicalSelectionImport from '@lexical/selection'\nconst { $setBlocksType } = lexicalSelectionImport\n\nimport lexicalImport from 'lexical'\nconst { $getSelection } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { HeadingFeatureProps } from './feature.server.js'\n\nimport { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport { H1Icon } from '../../lexical/ui/icons/H1/index.js'\nimport { H2Icon } from '../../lexical/ui/icons/H2/index.js'\nimport { H3Icon } from '../../lexical/ui/icons/H3/index.js'\nimport { H4Icon } from '../../lexical/ui/icons/H4/index.js'\nimport { H5Icon } from '../../lexical/ui/icons/H5/index.js'\nimport { H6Icon } from '../../lexical/ui/icons/H6/index.js'\nimport { TextDropdownSectionWithEntries } from '../common/floatingSelectToolbarTextDropdownSection/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nconst setHeading = (headingSize: HeadingTagType) => {\n const selection = $getSelection()\n $setBlocksType(selection, () => $createHeadingNode(headingSize))\n}\n\nconst iconImports = {\n h1: H1Icon,\n h2: H2Icon,\n h3: H3Icon,\n h4: H4Icon,\n h5: H5Icon,\n h6: H6Icon,\n}\n\nconst HeadingFeatureClient: FeatureProviderProviderClient<HeadingFeatureProps> = (props) => {\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n ...enabledHeadingSizes.map((headingSize, i) =>\n TextDropdownSectionWithEntries([\n {\n ChildComponent: iconImports[headingSize],\n isActive: () => false,\n key: headingSize,\n label: `Heading ${headingSize.charAt(1)}`,\n onClick: ({ editor }) => {\n editor.update(() => {\n setHeading(headingSize)\n })\n },\n order: i + 2,\n },\n ]),\n ),\n ],\n },\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [HeadingNode],\n slashMenu: {\n options: [\n ...enabledHeadingSizes.map((headingSize) => {\n return {\n displayName: 'Basic',\n key: 'basic',\n options: [\n new SlashMenuOption(`heading-${headingSize.charAt(1)}`, {\n Icon: iconImports[headingSize],\n displayName: `Heading ${headingSize.charAt(1)}`,\n keywords: ['heading', headingSize],\n onSelect: () => {\n setHeading(headingSize)\n },\n }),\n ],\n }\n }),\n ],\n },\n }\n },\n }\n}\n\nexport const HeadingFeatureClientComponent = createClientComponent(HeadingFeatureClient)\n"],"names":["lexicalRichTextImport","$createHeadingNode","HeadingNode","lexicalSelectionImport","$setBlocksType","lexicalImport","$getSelection","SlashMenuOption","H1Icon","H2Icon","H3Icon","H4Icon","H5Icon","H6Icon","TextDropdownSectionWithEntries","createClientComponent","MarkdownTransformer","setHeading","headingSize","selection","iconImports","h1","h2","h3","h4","h5","h6","HeadingFeatureClient","props","enabledHeadingSizes","clientFeatureProps","feature","floatingSelectToolbar","sections","map","i","ChildComponent","isActive","key","label","charAt","onClick","editor","update","order","markdownTransformers","nodes","slashMenu","options","displayName","Icon","keywords","onSelect","HeadingFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,OAAOA,2BAA2B,qBAAoB;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;4CACZ1B,WAAWC;wCACb;oCACF;oCACA0B,OAAOT,IAAI;gCACb;6BACD;qBAEJ;gBACH;gBACAU,sBAAsB;oBAAC7B,oBAAoBa;iBAAqB;gBAChEiB,OAAO;oBAAC5C;iBAAY;gBACpB6C,WAAW;oBACTC,SAAS;2BACJnB,oBAAoBK,GAAG,CAAC,CAAChB;4BAC1B,OAAO;gCACL+B,aAAa;gCACbX,KAAK;gCACLU,SAAS;oCACP,IAAIzC,gBAAgB,CAAC,QAAQ,EAAEW,YAAYsB,MAAM,CAAC,GAAG,CAAC,EAAE;wCACtDU,MAAM9B,WAAW,CAACF,YAAY;wCAC9B+B,aAAa,CAAC,QAAQ,EAAE/B,YAAYsB,MAAM,CAAC,GAAG,CAAC;wCAC/CW,UAAU;4CAAC;4CAAWjC;yCAAY;wCAClCkC,UAAU;4CACRnC,WAAWC;wCACb;oCACF;iCACD;4BACH;wBACF;qBACD;gBACH;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMmC,gCAAgCtC,sBAAsBY,sBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/heading/feature.server.ts"],"sourcesContent":["import type { HeadingTagType, SerializedHeadingNode } from '@lexical/rich-text'\n\nimport lexicalRichTextImport from '@lexical/rich-text'\nconst { HeadingNode } = lexicalRichTextImport\n\nimport type { HTMLConverter } from '../converters/html/converter/types.js'\nimport type { FeatureProviderProviderServer } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../converters/html/converter/index.js'\nimport { HeadingFeatureClientComponent } from './feature.client.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nexport type HeadingFeatureProps = {\n enabledHeadingSizes?: HeadingTagType[]\n}\n\nexport const HeadingFeature: FeatureProviderProviderServer<\n HeadingFeatureProps,\n HeadingFeatureProps\n> = (props) => {\n if (!props) {\n props = {}\n }\n\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n return {\n feature: () => {\n return {\n ClientComponent: HeadingFeatureClientComponent,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [\n {\n type: HeadingNode.getType(),\n converters: {\n html: {\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 + '>' + childrenText + '</' + node?.tag + '>'\n },\n nodeTypes: [HeadingNode.getType()],\n } as HTMLConverter<SerializedHeadingNode>,\n },\n node: HeadingNode,\n },\n ],\n serverFeatureProps: props,\n }\n },\n key: 'heading',\n serverFeatureProps: props,\n }\n}\n"],"names":["lexicalRichTextImport","HeadingNode","convertLexicalNodesToHTML","HeadingFeatureClientComponent","MarkdownTransformer","HeadingFeature","props","enabledHeadingSizes","feature","ClientComponent","markdownTransformers","nodes","type","getType","converters","html","converter","node","parent","payload","childrenText","lexicalNodes","children","tag","nodeTypes","serverFeatureProps","key"],"mappings":"AAEA,OAAOA,2BAA2B,qBAAoB;AACtD,MAAM,EAAEC,WAAW,EAAE,GAAGD;AAKxB,SAASE,yBAAyB,QAAQ,wCAAuC;AACjF,SAASC,6BAA6B,QAAQ,sBAAqB;AACnE,SAASC,mBAAmB,QAAQ,2BAA0B;AAM9D,OAAO,MAAMC,iBAGT,CAACC;IACH,IAAI,CAACA,OAAO;QACVA,QAAQ,CAAC;IACX;IAEA,MAAM,EAAEC,sBAAsB;QAAC;QAAM;QAAM;QAAM;QAAM;QAAM;KAAK,EAAE,GAAGD;IAEvE,OAAO;QACLE,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,sBAAsB;oBAACN,oBAAoBG;iBAAqB;gBAChEI,OAAO;oBACL;wBACEC,MAAMX,YAAYY,OAAO;wBACzBC,YAAY;4BACVC,MAAM;gCACJC,WAAW,OAAO,EAAEF,UAAU,EAAEG,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAE;oCACrD,MAAMC,eAAe,MAAMlB,0BAA0B;wCACnDY;wCACAO,cAAcJ,KAAKK,QAAQ;wCAC3BJ,QAAQ;4CACN,GAAGD,IAAI;4CACPC;wCACF;wCACAC;oCACF;oCAEA,OAAO,MAAMF,MAAMM,MAAM,MAAMH,eAAe,OAAOH,MAAMM,MAAM;gCACnE;gCACAC,WAAW;oCAACvB,YAAYY,OAAO;iCAAG;4BACpC;wBACF;wBACAI,MAAMhB;oBACR;iBACD;gBACDwB,oBAAoBnB;YACtB;QACF;QACAoB,KAAK;QACLD,oBAAoBnB;IACtB;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/heading/feature.server.ts"],"sourcesContent":["import type { HeadingTagType, SerializedHeadingNode } from '@lexical/rich-text'\n\nimport lexicalRichTextImport from '@lexical/rich-text'\nconst { HeadingNode } = lexicalRichTextImport\n\nimport type { HTMLConverter } from '../converters/html/converter/types.js'\nimport type { FeatureProviderProviderServer } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../converters/html/converter/index.js'\nimport { HeadingFeatureClientComponent } from './feature.client.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nexport type HeadingFeatureProps = {\n enabledHeadingSizes?: HeadingTagType[]\n}\n\nexport const HeadingFeature: FeatureProviderProviderServer<\n HeadingFeatureProps,\n HeadingFeatureProps\n> = (props) => {\n if (!props) {\n props = {}\n }\n\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n return {\n feature: () => {\n return {\n ClientComponent: HeadingFeatureClientComponent,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [\n {\n type: HeadingNode.getType(),\n converters: {\n html: {\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 + '>' + childrenText + '</' + node?.tag + '>'\n },\n nodeTypes: [HeadingNode.getType()],\n } as HTMLConverter<SerializedHeadingNode>,\n },\n node: HeadingNode,\n },\n ],\n serverFeatureProps: props,\n }\n },\n key: 'heading',\n serverFeatureProps: props,\n }\n}\n"],"names":["lexicalRichTextImport","HeadingNode","convertLexicalNodesToHTML","HeadingFeatureClientComponent","MarkdownTransformer","HeadingFeature","props","enabledHeadingSizes","feature","ClientComponent","markdownTransformers","nodes","type","getType","converters","html","converter","node","parent","payload","childrenText","lexicalNodes","children","tag","nodeTypes","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAOA,2BAA2B,qBAAoB;AACtD,MAAM,EAAEC,WAAW,EAAE,GAAGD;AAKxB,SAASE,yBAAyB,QAAQ,wCAAuC;AACjF,SAASC,6BAA6B,QAAQ,sBAAqB;AACnE,SAASC,mBAAmB,QAAQ,2BAA0B;AAM9D,OAAO,MAAMC,iBAGT,CAACC;IACH,IAAI,CAACA,OAAO;QACVA,QAAQ,CAAC;IACX;IAEA,MAAM,EAAEC,sBAAsB;QAAC;QAAM;QAAM;QAAM;QAAM;QAAM;KAAK,EAAE,GAAGD;IAEvE,OAAO;QACLE,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,sBAAsB;oBAACN,oBAAoBG;iBAAqB;gBAChEI,OAAO;oBACL;wBACEC,MAAMX,YAAYY,OAAO;wBACzBC,YAAY;4BACVC,MAAM;gCACJC,WAAW,OAAO,EAAEF,UAAU,EAAEG,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAE;oCACrD,MAAMC,eAAe,MAAMlB,0BAA0B;wCACnDY;wCACAO,cAAcJ,KAAKK,QAAQ;wCAC3BJ,QAAQ;4CACN,GAAGD,IAAI;4CACPC;wCACF;wCACAC;oCACF;oCAEA,OAAO,MAAMF,MAAMM,MAAM,MAAMH,eAAe,OAAOH,MAAMM,MAAM;gCACnE;gCACAC,WAAW;oCAACvB,YAAYY,OAAO;iCAAG;4BACpC;wBACF;wBACAI,MAAMhB;oBACR;iBACD;gBACDwB,oBAAoBnB;YACtB;QACF;QACAoB,KAAK;QACLD,oBAAoBnB;IACtB;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/heading/markdownTransformer.ts"],"sourcesContent":["import type { ElementTransformer } from '@lexical/markdown'\nimport type { HeadingTagType } from '@lexical/rich-text'\n\nimport lexicalRichTextImport from '@lexical/rich-text'\nconst { $createHeadingNode, $isHeadingNode, HeadingNode } = lexicalRichTextImport\n\nimport { createBlockNode } from '../../lexical/utils/markdown/createBlockNode.js'\n\nexport const MarkdownTransformer: (enabledHeadingSizes: HeadingTagType[]) => ElementTransformer = (\n enabledHeadingSizes,\n) => {\n // Convert enabledHeadingSizes to a list of numbers (1 for h1, 2 for h2, etc.)\n const enabledSizes = enabledHeadingSizes.map((tag) => Number(tag.slice(1)))\n\n // Create a regex pattern that matches any of the enabled sizes\n const pattern = `^(${enabledSizes.map((size) => `#{${size}}`).join('|')})\\\\s`\n const regExp = new RegExp(pattern)\n\n return {\n type: 'element',\n dependencies: [HeadingNode],\n export: (node, exportChildren) => {\n if (!$isHeadingNode(node)) {\n return null\n }\n const level = Number(node.getTag().slice(1))\n return '#'.repeat(level) + ' ' + exportChildren(node)\n },\n regExp,\n replace: createBlockNode((match) => {\n const tag = ('h' + match[1].length) as HeadingTagType\n return $createHeadingNode(tag)\n }),\n }\n}\n"],"names":["lexicalRichTextImport","$createHeadingNode","$isHeadingNode","HeadingNode","createBlockNode","MarkdownTransformer","enabledHeadingSizes","enabledSizes","map","tag","Number","slice","pattern","size","join","regExp","RegExp","type","dependencies","export","node","exportChildren","level","getTag","repeat","replace","match","length"],"mappings":"AAGA,OAAOA,2BAA2B,qBAAoB;AACtD,MAAM,EAAEC,kBAAkB,EAAEC,cAAc,EAAEC,WAAW,EAAE,GAAGH;AAE5D,SAASI,eAAe,QAAQ,kDAAiD;AAEjF,OAAO,MAAMC,sBAAqF,CAChGC;IAEA,8EAA8E;IAC9E,MAAMC,eAAeD,oBAAoBE,GAAG,CAAC,CAACC,MAAQC,OAAOD,IAAIE,KAAK,CAAC;IAEvE,+DAA+D;IAC/D,MAAMC,UAAU,CAAC,EAAE,EAAEL,aAAaC,GAAG,CAAC,CAACK,OAAS,CAAC,EAAE,EAAEA,KAAK,CAAC,CAAC,EAAEC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC7E,MAAMC,SAAS,IAAIC,OAAOJ;IAE1B,OAAO;QACLK,MAAM;QACNC,cAAc;YAACf;SAAY;QAC3BgB,QAAQ,CAACC,MAAMC;YACb,IAAI,CAACnB,eAAekB,OAAO;gBACzB,OAAO;YACT;YACA,MAAME,QAAQZ,OAAOU,KAAKG,MAAM,GAAGZ,KAAK,CAAC;YACzC,OAAO,IAAIa,MAAM,CAACF,SAAS,MAAMD,eAAeD;QAClD;QACAL;QACAU,SAASrB,gBAAgB,CAACsB;YACxB,MAAMjB,MAAO,MAAMiB,KAAK,CAAC,EAAE,CAACC,MAAM;YAClC,OAAO1B,mBAAmBQ;QAC5B;IACF;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/heading/markdownTransformer.ts"],"sourcesContent":["import type { ElementTransformer } from '@lexical/markdown'\nimport type { HeadingTagType } from '@lexical/rich-text'\n\nimport lexicalRichTextImport from '@lexical/rich-text'\nconst { $createHeadingNode, $isHeadingNode, HeadingNode } = lexicalRichTextImport\n\nimport { createBlockNode } from '../../lexical/utils/markdown/createBlockNode.js'\n\nexport const MarkdownTransformer: (enabledHeadingSizes: HeadingTagType[]) => ElementTransformer = (\n enabledHeadingSizes,\n) => {\n // Convert enabledHeadingSizes to a list of numbers (1 for h1, 2 for h2, etc.)\n const enabledSizes = enabledHeadingSizes.map((tag) => Number(tag.slice(1)))\n\n // Create a regex pattern that matches any of the enabled sizes\n const pattern = `^(${enabledSizes.map((size) => `#{${size}}`).join('|')})\\\\s`\n const regExp = new RegExp(pattern)\n\n return {\n type: 'element',\n dependencies: [HeadingNode],\n export: (node, exportChildren) => {\n if (!$isHeadingNode(node)) {\n return null\n }\n const level = Number(node.getTag().slice(1))\n return '#'.repeat(level) + ' ' + exportChildren(node)\n },\n regExp,\n replace: createBlockNode((match) => {\n const tag = ('h' + match[1].length) as HeadingTagType\n return $createHeadingNode(tag)\n }),\n }\n}\n"],"names":["lexicalRichTextImport","$createHeadingNode","$isHeadingNode","HeadingNode","createBlockNode","MarkdownTransformer","enabledHeadingSizes","enabledSizes","map","tag","Number","slice","pattern","size","join","regExp","RegExp","type","dependencies","export","node","exportChildren","level","getTag","repeat","replace","match","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,OAAOA,2BAA2B,qBAAoB;AACtD,MAAM,EAAEC,kBAAkB,EAAEC,cAAc,EAAEC,WAAW,EAAE,GAAGH;AAE5D,SAASI,eAAe,QAAQ,kDAAiD;AAEjF,OAAO,MAAMC,sBAAqF,CAChGC;IAEA,8EAA8E;IAC9E,MAAMC,eAAeD,oBAAoBE,GAAG,CAAC,CAACC,MAAQC,OAAOD,IAAIE,KAAK,CAAC;IAEvE,+DAA+D;IAC/D,MAAMC,UAAU,CAAC,EAAE,EAAEL,aAAaC,GAAG,CAAC,CAACK,OAAS,CAAC,EAAE,EAAEA,KAAK,CAAC,CAAC,EAAEC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC7E,MAAMC,SAAS,IAAIC,OAAOJ;IAE1B,OAAO;QACLK,MAAM;QACNC,cAAc;YAACf;SAAY;QAC3BgB,QAAQ,CAACC,MAAMC;YACb,IAAI,CAACnB,eAAekB,OAAO;gBACzB,OAAO;YACT;YACA,MAAME,QAAQZ,OAAOU,KAAKG,MAAM,GAAGZ,KAAK,CAAC;YACzC,OAAO,IAAIa,MAAM,CAACF,SAAS,MAAMD,eAAeD;QAClD;QACAL;QACAU,SAASrB,gBAAgB,CAACsB;YACxB,MAAMjB,MAAO,MAAMiB,KAAK,CAAC,EAAE,CAACC,MAAM;YAClC,OAAO1B,mBAAmBQ;QAC5B;IACF;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/indent/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { IndentDecreaseIcon } from '../../lexical/ui/icons/IndentDecrease/index.js'\nimport { IndentIncreaseIcon } from '../../lexical/ui/icons/IndentIncrease/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { IndentSectionWithEntries } from './floatingSelectToolbarIndentSection.js'\n\nconst IndentFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n IndentSectionWithEntries([\n {\n ChildComponent: IndentDecreaseIcon,\n isActive: () => false,\n isEnabled: ({ selection }) => {\n if (!selection || !selection?.getNodes()?.length) {\n return false\n }\n for (const node of selection.getNodes()) {\n // If at least one node is indented, this should be active\n if (\n ('__indent' in node && (node.__indent as number) > 0) ||\n (node.getParent() &&\n '__indent' in node.getParent() &&\n node.getParent().__indent > 0)\n ) {\n return true\n }\n }\n return false\n },\n key: 'indent-decrease',\n label: `Decrease Indent`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined)\n },\n order: 1,\n },\n ]),\n IndentSectionWithEntries([\n {\n ChildComponent: IndentIncreaseIcon,\n isActive: () => false,\n key: 'indent-increase',\n label: `Increase Indent`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined)\n },\n order: 2,\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const IndentFeatureClientComponent = createClientComponent(IndentFeatureClient)\n"],"names":["lexicalImport","INDENT_CONTENT_COMMAND","OUTDENT_CONTENT_COMMAND","IndentDecreaseIcon","IndentIncreaseIcon","createClientComponent","IndentSectionWithEntries","IndentFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","isEnabled","selection","getNodes","length","node","__indent","getParent","key","label","onClick","editor","dispatchCommand","undefined","order","IndentFeatureClientComponent"],"mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,sBAAsB,EAAEC,uBAAuB,EAAE,GAAGF;AAI5D,SAASG,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,wBAAwB,QAAQ,0CAAyC;AAElF,MAAMC,sBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRN,yBAAyB;4BACvB;gCACEO,gBAAgBV;gCAChBW,UAAU,IAAM;gCAChBC,WAAW,CAAC,EAAEC,SAAS,EAAE;oCACvB,IAAI,CAACA,aAAa,CAACA,WAAWC,YAAYC,QAAQ;wCAChD,OAAO;oCACT;oCACA,KAAK,MAAMC,QAAQH,UAAUC,QAAQ,GAAI;wCACvC,0DAA0D;wCAC1D,IACE,AAAC,cAAcE,QAAQ,AAACA,KAAKC,QAAQ,GAAc,KAClDD,KAAKE,SAAS,MACb,cAAcF,KAAKE,SAAS,MAC5BF,KAAKE,SAAS,GAAGD,QAAQ,GAAG,GAC9B;4CACA,OAAO;wCACT;oCACF;oCACA,OAAO;gCACT;gCACAE,KAAK;gCACLC,OAAO,CAAC,eAAe,CAAC;gCACxBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACxB,yBAAyByB;gCAClD;gCACAC,OAAO;4BACT;yBACD;wBACDtB,yBAAyB;4BACvB;gCACEO,gBAAgBT;gCAChBU,UAAU,IAAM;gCAChBQ,KAAK;gCACLC,OAAO,CAAC,eAAe,CAAC;gCACxBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACzB,wBAAwB0B;gCACjD;gCACAC,OAAO;4BACT;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,+BAA+BxB,sBAAsBE,qBAAoB"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/indent/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { IndentDecreaseIcon } from '../../lexical/ui/icons/IndentDecrease/index.js'\nimport { IndentIncreaseIcon } from '../../lexical/ui/icons/IndentIncrease/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { IndentSectionWithEntries } from './floatingSelectToolbarIndentSection.js'\n\nconst IndentFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n IndentSectionWithEntries([\n {\n ChildComponent: IndentDecreaseIcon,\n isActive: () => false,\n isEnabled: ({ selection }) => {\n if (!selection || !selection?.getNodes()?.length) {\n return false\n }\n for (const node of selection.getNodes()) {\n // If at least one node is indented, this should be active\n if (\n ('__indent' in node && (node.__indent as number) > 0) ||\n (node.getParent() &&\n '__indent' in node.getParent() &&\n node.getParent().__indent > 0)\n ) {\n return true\n }\n }\n return false\n },\n key: 'indent-decrease',\n label: `Decrease Indent`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined)\n },\n order: 1,\n },\n ]),\n IndentSectionWithEntries([\n {\n ChildComponent: IndentIncreaseIcon,\n isActive: () => false,\n key: 'indent-increase',\n label: `Increase Indent`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined)\n },\n order: 2,\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const IndentFeatureClientComponent = createClientComponent(IndentFeatureClient)\n"],"names":["lexicalImport","INDENT_CONTENT_COMMAND","OUTDENT_CONTENT_COMMAND","IndentDecreaseIcon","IndentIncreaseIcon","createClientComponent","IndentSectionWithEntries","IndentFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","isEnabled","selection","getNodes","length","node","__indent","getParent","key","label","onClick","editor","dispatchCommand","undefined","order","IndentFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,sBAAsB,EAAEC,uBAAuB,EAAE,GAAGF;AAI5D,SAASG,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,wBAAwB,QAAQ,0CAAyC;AAElF,MAAMC,sBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRN,yBAAyB;4BACvB;gCACEO,gBAAgBV;gCAChBW,UAAU,IAAM;gCAChBC,WAAW,CAAC,EAAEC,SAAS,EAAE;oCACvB,IAAI,CAACA,aAAa,CAACA,WAAWC,YAAYC,QAAQ;wCAChD,OAAO;oCACT;oCACA,KAAK,MAAMC,QAAQH,UAAUC,QAAQ,GAAI;wCACvC,0DAA0D;wCAC1D,IACE,AAAC,cAAcE,QAAQ,AAACA,KAAKC,QAAQ,GAAc,KAClDD,KAAKE,SAAS,MACb,cAAcF,KAAKE,SAAS,MAC5BF,KAAKE,SAAS,GAAGD,QAAQ,GAAG,GAC9B;4CACA,OAAO;wCACT;oCACF;oCACA,OAAO;gCACT;gCACAE,KAAK;gCACLC,OAAO,CAAC,eAAe,CAAC;gCACxBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACxB,yBAAyByB;gCAClD;gCACAC,OAAO;4BACT;yBACD;wBACDtB,yBAAyB;4BACvB;gCACEO,gBAAgBT;gCAChBU,UAAU,IAAM;gCAChBQ,KAAK;gCACLC,OAAO,CAAC,eAAe,CAAC;gCACxBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACzB,wBAAwB0B;gCACjD;gCACAC,OAAO;4BACT;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,+BAA+BxB,sBAAsBE,qBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/indent/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../types.js'\n\nimport { IndentFeatureClientComponent } from './feature.client.js'\n\nexport const IndentFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: IndentFeatureClientComponent,\n clientFeatureProps: null,\n serverFeatureProps: props,\n }\n },\n key: 'indent',\n serverFeatureProps: props,\n }\n}\n"],"names":["IndentFeatureClientComponent","IndentFeature","props","feature","ClientComponent","clientFeatureProps","serverFeatureProps","key"],"mappings":"AAEA,SAASA,4BAA4B,QAAQ,sBAAqB;AAElE,OAAO,MAAMC,gBAAqE,CAACC;IACjF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoB;gBACpBC,oBAAoBJ;YACtB;QACF;QACAK,KAAK;QACLD,oBAAoBJ;IACtB;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/indent/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../types.js'\n\nimport { IndentFeatureClientComponent } from './feature.client.js'\n\nexport const IndentFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: IndentFeatureClientComponent,\n clientFeatureProps: null,\n serverFeatureProps: props,\n }\n },\n key: 'indent',\n serverFeatureProps: props,\n }\n}\n"],"names":["IndentFeatureClientComponent","IndentFeature","props","feature","ClientComponent","clientFeatureProps","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAEA,SAASA,4BAA4B,QAAQ,sBAAqB;AAElE,OAAO,MAAMC,gBAAqE,CAACC;IACjF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoB;gBACpBC,oBAAoBJ;YACtB;QACF;QACAK,KAAK;QACLD,oBAAoBJ;IACtB;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/indent/floatingSelectToolbarIndentSection.ts"],"sourcesContent":["import type {\n FloatingToolbarSection,\n FloatingToolbarSectionEntry,\n} from '../../lexical/plugins/FloatingSelectToolbar/types.js'\n\nexport const IndentSectionWithEntries = (\n entries: FloatingToolbarSectionEntry[],\n): FloatingToolbarSection => {\n return {\n type: 'buttons',\n entries,\n key: 'indent',\n order: 3,\n }\n}\n"],"names":["IndentSectionWithEntries","entries","type","key","order"],"mappings":"AAKA,OAAO,MAAMA,2BAA2B,CACtCC;IAEA,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/indent/floatingSelectToolbarIndentSection.ts"],"sourcesContent":["import type {\n FloatingToolbarSection,\n FloatingToolbarSectionEntry,\n} from '../../lexical/plugins/FloatingSelectToolbar/types.js'\n\nexport const IndentSectionWithEntries = (\n entries: FloatingToolbarSectionEntry[],\n): FloatingToolbarSection => {\n return {\n type: 'buttons',\n entries,\n key: 'indent',\n order: 3,\n }\n}\n"],"names":["IndentSectionWithEntries","entries","type","key","order"],"rangeMappings":";;;;;;;","mappings":"AAKA,OAAO,MAAMA,2BAA2B,CACtCC;IAEA,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseFields.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/link/drawer/baseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAyB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"baseFields.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/link/drawer/baseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAyB,MAAM,eAAe,CAAA;AAIjE,eAAO,MAAM,aAAa,WAChB,MAAM,sBACM,KAAK,GAAG,MAAM,EAAE,uBACf,KAAK,GAAG,MAAM,EAAE,KACpC,KAAK,EAmHP,CAAA"}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import { extractTranslations } from 'payload/utilities';
|
|
2
1
|
import { validateUrl } from '../../../lexical/utils/url.js';
|
|
3
|
-
const translations = extractTranslations([
|
|
4
|
-
'fields:textToDisplay',
|
|
5
|
-
'fields:linkType',
|
|
6
|
-
'fields:chooseBetweenCustomTextOrDocument',
|
|
7
|
-
'fields:customURL',
|
|
8
|
-
'fields:internalLink',
|
|
9
|
-
'fields:enterURL',
|
|
10
|
-
'fields:chooseDocumentToLink',
|
|
11
|
-
'fields:openInNewTab'
|
|
12
|
-
]);
|
|
13
2
|
export const getBaseFields = (config, enabledCollections, disabledCollections)=>{
|
|
14
3
|
let enabledRelations;
|
|
15
4
|
/**
|
|
@@ -31,7 +20,7 @@ export const getBaseFields = (config, enabledCollections, disabledCollections)=>
|
|
|
31
20
|
{
|
|
32
21
|
name: 'text',
|
|
33
22
|
type: 'text',
|
|
34
|
-
label:
|
|
23
|
+
label: ({ t })=>t('fields:textToDisplay'),
|
|
35
24
|
required: true
|
|
36
25
|
},
|
|
37
26
|
{
|
|
@@ -50,13 +39,13 @@ export const getBaseFields = (config, enabledCollections, disabledCollections)=>
|
|
|
50
39
|
name: 'linkType',
|
|
51
40
|
type: 'radio',
|
|
52
41
|
admin: {
|
|
53
|
-
description:
|
|
42
|
+
description: ({ t })=>t('fields:chooseBetweenCustomTextOrDocument')
|
|
54
43
|
},
|
|
55
44
|
defaultValue: 'custom',
|
|
56
|
-
label:
|
|
45
|
+
label: ({ t })=>t('fields:linkType'),
|
|
57
46
|
options: [
|
|
58
47
|
{
|
|
59
|
-
label:
|
|
48
|
+
label: ({ t })=>t('fields:customURL'),
|
|
60
49
|
value: 'custom'
|
|
61
50
|
}
|
|
62
51
|
],
|
|
@@ -65,7 +54,7 @@ export const getBaseFields = (config, enabledCollections, disabledCollections)=>
|
|
|
65
54
|
{
|
|
66
55
|
name: 'url',
|
|
67
56
|
type: 'text',
|
|
68
|
-
label:
|
|
57
|
+
label: ({ t })=>t('fields:enterURL'),
|
|
69
58
|
required: true,
|
|
70
59
|
validate: (value)=>{
|
|
71
60
|
if (value && !validateUrl(value)) {
|
|
@@ -79,7 +68,7 @@ export const getBaseFields = (config, enabledCollections, disabledCollections)=>
|
|
|
79
68
|
// Only display internal link-specific fields / options / conditions if there are enabled relations
|
|
80
69
|
if (enabledRelations?.length) {
|
|
81
70
|
baseFields[1].fields[0].options.push({
|
|
82
|
-
label:
|
|
71
|
+
label: ({ t })=>t('fields:internalLink'),
|
|
83
72
|
value: 'internal'
|
|
84
73
|
});
|
|
85
74
|
baseFields[1].fields[1].admin = {
|
|
@@ -102,7 +91,7 @@ export const getBaseFields = (config, enabledCollections, disabledCollections)=>
|
|
|
102
91
|
return false;
|
|
103
92
|
}
|
|
104
93
|
} : null,
|
|
105
|
-
label:
|
|
94
|
+
label: ({ t })=>t('fields:chooseDocumentToLink'),
|
|
106
95
|
relationTo: enabledRelations,
|
|
107
96
|
required: true
|
|
108
97
|
});
|
|
@@ -110,7 +99,7 @@ export const getBaseFields = (config, enabledCollections, disabledCollections)=>
|
|
|
110
99
|
baseFields[1].fields.push({
|
|
111
100
|
name: 'newTab',
|
|
112
101
|
type: 'checkbox',
|
|
113
|
-
label:
|
|
102
|
+
label: ({ t })=>t('fields:openInNewTab')
|
|
114
103
|
});
|
|
115
104
|
return baseFields;
|
|
116
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/link/drawer/baseFields.ts"],"sourcesContent":["import type { User } from 'payload/auth'\nimport type { Config } from 'payload/config'\nimport type { Field, RadioField, TextField } from 'payload/types'\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/link/drawer/baseFields.ts"],"sourcesContent":["import type { User } from 'payload/auth'\nimport type { Config } from 'payload/config'\nimport type { Field, RadioField, TextField } from 'payload/types'\n\nimport { validateUrl } from '../../../lexical/utils/url.js'\n\nexport const getBaseFields = (\n config: Config,\n enabledCollections: false | string[],\n disabledCollections: false | string[],\n): Field[] => {\n let enabledRelations: string[]\n\n /**\n * Figure out which relations should be enabled (enabledRelations) based on a collection's admin.enableRichTextLink property,\n * or the Link Feature's enabledCollections and disabledCollections properties which override it.\n */\n if (enabledCollections) {\n enabledRelations = enabledCollections\n } else if (disabledCollections) {\n enabledRelations = config.collections\n .filter(({ slug }) => !disabledCollections.includes(slug))\n .map(({ slug }) => slug)\n } else {\n enabledRelations = config.collections\n .filter(({ admin: { enableRichTextLink, hidden } }) => {\n if (typeof hidden !== 'function' && hidden) {\n return false\n }\n return enableRichTextLink\n })\n .map(({ slug }) => slug)\n }\n\n const baseFields = [\n {\n name: 'text',\n type: 'text',\n label: ({ t }) => t('fields:textToDisplay'),\n required: true,\n },\n {\n name: 'fields',\n type: 'group',\n admin: {\n style: {\n borderBottom: 0,\n borderTop: 0,\n margin: 0,\n padding: 0,\n },\n },\n fields: [\n {\n name: 'linkType',\n type: 'radio',\n admin: {\n description: ({ t }) => t('fields:chooseBetweenCustomTextOrDocument'),\n },\n defaultValue: 'custom',\n label: ({ t }) => t('fields:linkType'),\n options: [\n {\n label: ({ t }) => t('fields:customURL'),\n value: 'custom',\n },\n ],\n required: true,\n },\n {\n name: 'url',\n type: 'text',\n label: ({ t }) => t('fields:enterURL'),\n required: true,\n validate: (value: string) => {\n if (value && !validateUrl(value)) {\n return 'Invalid URL'\n }\n },\n },\n ] as Field[],\n },\n ]\n\n // Only display internal link-specific fields / options / conditions if there are enabled relations\n if (enabledRelations?.length) {\n ;(baseFields[1].fields[0] as RadioField).options.push({\n label: ({ t }) => t('fields:internalLink'),\n value: 'internal',\n })\n ;(baseFields[1].fields[1] as TextField).admin = {\n condition: ({ fields }) => fields?.linkType !== 'internal',\n }\n\n baseFields[1].fields.push({\n name: 'doc',\n admin: {\n condition: ({ fields }) => {\n return fields?.linkType === 'internal'\n },\n },\n // when admin.hidden is a function we need to dynamically call hidden with the user to know if the collection should be shown\n type: 'relationship',\n filterOptions:\n !enabledCollections && !disabledCollections\n ? ({ relationTo, user }) => {\n const hidden = config.collections.find(({ slug }) => slug === relationTo).admin.hidden\n if (typeof hidden === 'function' && hidden({ user } as { user: User })) {\n return false\n }\n }\n : null,\n label: ({ t }) => t('fields:chooseDocumentToLink'),\n relationTo: enabledRelations,\n required: true,\n })\n }\n\n baseFields[1].fields.push({\n name: 'newTab',\n type: 'checkbox',\n label: ({ t }) => t('fields:openInNewTab'),\n })\n\n return baseFields as Field[]\n}\n"],"names":["validateUrl","getBaseFields","config","enabledCollections","disabledCollections","enabledRelations","collections","filter","slug","includes","map","admin","enableRichTextLink","hidden","baseFields","name","type","label","t","required","style","borderBottom","borderTop","margin","padding","fields","description","defaultValue","options","value","validate","length","push","condition","linkType","filterOptions","relationTo","user","find"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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J;AACT,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/link/drawer/index.tsx"],"sourcesContent":["import type { FormProps } from '@payloadcms/ui/forms/Form'\nimport type { FormState } from 'payload/types'\n\nimport { Drawer } from '@payloadcms/ui/elements/Drawer'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { Form } from '@payloadcms/ui/forms/Form'\nimport { RenderFields } from '@payloadcms/ui/forms/RenderFields'\nimport { FormSubmit } from '@payloadcms/ui/forms/Submit'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport { getFormState } from '@payloadcms/ui/utilities/getFormState'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js'\nimport './index.scss'\nimport { type Props } from './types.js'\n\nconst baseClass = 'lexical-link-edit-drawer'\n\nexport const LinkDrawer: React.FC<Props> = ({ drawerSlug, handleModalSubmit, stateData }) => {\n const { t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const config = useConfig()\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `feature.link.fields.fields`\n const schemaFieldsPath = `${schemaPath}.feature.link.fields`\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: stateData,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n if (stateData) {\n void awaitInitialState()\n }\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id, stateData])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n return await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id],\n )\n\n return (\n <Drawer className={baseClass} slug={drawerSlug} title={t('fields:editLink') ?? ''}>\n {initialState !== false && (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n fields={Array.isArray(fieldMap) ? fieldMap : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleModalSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fieldMap={Array.isArray(fieldMap) ? fieldMap : []}\n forceRender\n path=\"\"\n readOnly={false}\n schemaPath=\"\"\n />\n\n <FormSubmit>{t('general:submit')}</FormSubmit>\n </Form>\n )}\n </Drawer>\n )\n}\n"],"names":["Drawer","useFieldProps","Form","RenderFields","FormSubmit","useConfig","useDocumentInfo","useTranslation","getFormState","React","useCallback","useEffect","useState","v4","uuid","useEditorConfigContext","baseClass","LinkDrawer","drawerSlug","handleModalSubmit","stateData","t","id","schemaPath","config","initialState","setInitialState","field","richTextComponentMap","componentMapRenderedFieldsPath","schemaFieldsPath","fieldMap","get","awaitInitialState","state","apiRoute","routes","api","body","data","operation","serverURL","onChange","formState","prevFormState","className","slug","title","beforeSubmit","disableValidationOnSubmit","fields","Array","isArray","onSubmit","forceRender","path","readOnly"],"mappings":"AAGA,SAASA,MAAM,QAAQ,iCAAgC;AACvD,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,IAAI,QAAQ,4BAA2B;AAChD,SAASC,YAAY,QAAQ,oCAAmC;AAChE,SAASC,UAAU,QAAQ,8BAA6B;AACxD,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,YAAY,QAAQ,wCAAu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WC;gBACXJ,WAAW;gBACXjB,YAAYO;YACd;YACAW,WAAWjB,OAAOiB,SAAS;QAC7B;IACF,GAEA;QAACjB,OAAOY,MAAM,CAACC,GAAG;QAAEb,OAAOiB,SAAS;QAAEX;QAAkBR;KAAG;IAG7D,qBACE,oBAACtB;QAAO6C,WAAW7B;QAAW8B,MAAM5B;QAAY6B,OAAO1B,EAAE,sBAAsB;OAC5EI,iBAAiB,uBAChB,oBAACvB;QACC8C,cAAc;YAACN;SAAS;QACxBO,2BAAAA;QACAC,QAAQC,MAAMC,OAAO,CAACrB,YAAYA,WAAW,EAAE;QAC/CN,cAAcA;QACdiB,UAAU;YAACA;SAAS;QACpBW,UAAUlC;QACVL,MAAMA;qBAEN,oBAACX;QACC4B,UAAUoB,MAAMC,OAAO,CAACrB,YAAYA,WAAW,EAAE;QACjDuB,aAAAA;QACAC,MAAK;QACLC,UAAU;QACVjC,YAAW;sBAGb,oBAACnB,kBAAYiB,EAAE;AAKzB,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/link/drawer/index.tsx"],"sourcesContent":["import type { FormProps } from '@payloadcms/ui/forms/Form'\nimport type { FormState } from 'payload/types'\n\nimport { Drawer } from '@payloadcms/ui/elements/Drawer'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { Form } from '@payloadcms/ui/forms/Form'\nimport { RenderFields } from '@payloadcms/ui/forms/RenderFields'\nimport { FormSubmit } from '@payloadcms/ui/forms/Submit'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport { getFormState } from '@payloadcms/ui/utilities/getFormState'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js'\nimport './index.scss'\nimport { type Props } from './types.js'\n\nconst baseClass = 'lexical-link-edit-drawer'\n\nexport const LinkDrawer: React.FC<Props> = ({ drawerSlug, handleModalSubmit, stateData }) => {\n const { t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const config = useConfig()\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `feature.link.fields.fields`\n const schemaFieldsPath = `${schemaPath}.feature.link.fields`\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: stateData,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n if (stateData) {\n void awaitInitialState()\n }\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id, stateData])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n return await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id],\n )\n\n return (\n <Drawer className={baseClass} slug={drawerSlug} title={t('fields:editLink') ?? ''}>\n {initialState !== false && (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n fields={Array.isArray(fieldMap) ? fieldMap : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleModalSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fieldMap={Array.isArray(fieldMap) ? fieldMap : []}\n forceRender\n path=\"\"\n readOnly={false}\n schemaPath=\"\"\n />\n\n <FormSubmit>{t('general:submit')}</FormSubmit>\n </Form>\n )}\n </Drawer>\n )\n}\n"],"names":["Drawer","useFieldProps","Form","RenderFields","FormSubmit","useConfig","useDocumentInfo","useTranslation","getFormState","React","useCallback","useEffect","useState","v4","uuid","useEditorConfigContext","baseClass","LinkDrawer","drawerSlug","handleModalSubmit","stateData","t","id","schemaPath","config","initialState","setInitialState","field","richTextComponentMap","componentMapRenderedFieldsPath","schemaFieldsPath","fieldMap","get","awaitInitialState","state","apiRoute","routes","api","body","data","operation","serverURL","onChange","formState","prevFormState","className","slug","title","beforeSubmit","disableValidationOnSubmit","fields","Array","isArray","onSubmit","forceRender","path","readOnly"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,MAAM,QAAQ,iCAAgC;AACvD,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,IAAI,QAAQ,4BAA2B;AAChD,SAASC,YAAY,QAAQ,oCAAmC;AAChE,SAASC,UAAU,QAAQ,8BAA6B;AACxD,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,YAAY,QAAQ,wCAAuC;AACpE,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAC/D,SAASC,MAAMC,IAAI,QAAQ,OAAM;AAEjC,SAASC,sBAAsB,QAAQ,yDAAwD;AAC/F,OAAO,eAAc;AAGrB,MAAMC,YAAY;AAElB,OAAO,MAAMC,aAA8B,CAAC,EAAEC,UAAU,EAAEC,iBAAiB,EAAEC,SAAS,EAAE;IACtF,MAAM,EAAEC,CAAC,EAAE,GAAGd;IACd,MAAM,EAAEe,EAAE,EAAE,GAAGhB;IACf,MAAM,EAAEiB,UAAU,EAAE,GAAGtB;IACvB,MAAMuB,SAASnB;IACf,MAAM,CAACoB,cAAcC,gBAAgB,GAAGd,SAA4B;IACpE,MAAM,EACJe,OAAO,EAAEC,oBAAoB,EAAE,EAChC,GAAGb;IAEJ,MAAMc,iCAAiC,CAAC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K;QACLC,UAAU;QACVjC,YAAW;sBAGb,oBAACnB,kBAAYiB,EAAE;AAKzB,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/link/drawer/types.ts"],"sourcesContent":["import type { FormState } from 'payload/types'\n\nimport type { LinkPayload } from '../plugins/floatingLinkEditor/types.js'\n\nexport interface Props {\n drawerSlug: string\n handleModalSubmit: (fields: FormState, data: Record<string, unknown>) => void\n stateData?: LinkPayload\n}\n"],"names":[],"mappings":"AAIA,WAIC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/link/drawer/types.ts"],"sourcesContent":["import type { FormState } from 'payload/types'\n\nimport type { LinkPayload } from '../plugins/floatingLinkEditor/types.js'\n\nexport interface Props {\n drawerSlug: string\n handleModalSubmit: (fields: FormState, data: Record<string, unknown>) => void\n stateData?: LinkPayload\n}\n"],"names":[],"rangeMappings":"","mappings":"AAIA,WAIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/link/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalUtilsImport from '@lexical/utils'\nconst { $findMatchingParent } = lexicalUtilsImport\n\nimport lexicalImport from 'lexical'\nconst { $getSelection, $isRangeSelection } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { ExclusiveLinkCollectionsProps } from './feature.server.js'\nimport type { LinkFields } from './nodes/types.js'\n\nimport { LinkIcon } from '../../lexical/ui/icons/Link/index.js'\nimport { getSelectedNode } from '../../lexical/utils/getSelectedNode.js'\nimport { FeaturesSectionWithEntries } from '../common/floatingSelectToolbarFeaturesButtonsSection/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { AutoLinkNode } from './nodes/AutoLinkNode.js'\nimport { $isLinkNode, LinkNode, TOGGLE_LINK_COMMAND } from './nodes/LinkNode.js'\nimport { AutoLinkPlugin } from './plugins/autoLink/index.js'\nimport { ClickableLinkPlugin } from './plugins/clickableLink/index.js'\nimport { TOGGLE_LINK_WITH_MODAL_COMMAND } from './plugins/floatingLinkEditor/LinkEditor/commands.js'\nimport { FloatingLinkEditorPlugin } from './plugins/floatingLinkEditor/index.js'\nimport { LinkPlugin } from './plugins/link/index.js'\n\nexport type ClientProps = ExclusiveLinkCollectionsProps\n\nconst LinkFeatureClient: FeatureProviderProviderClient<ClientProps> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n FeaturesSectionWithEntries([\n {\n ChildComponent: LinkIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n const selectedNode = getSelectedNode(selection)\n const linkParent = $findMatchingParent(selectedNode, $isLinkNode)\n return linkParent != null\n }\n return false\n },\n key: 'link',\n label: `Link`,\n onClick: ({ editor, isActive }) => {\n if (!isActive) {\n let selectedText = null\n editor.getEditorState().read(() => {\n selectedText = $getSelection().getTextContent()\n })\n const linkFields: LinkFields = {\n doc: null,\n linkType: 'custom',\n newTab: false,\n url: 'https://',\n }\n editor.dispatchCommand(TOGGLE_LINK_WITH_MODAL_COMMAND, {\n fields: linkFields,\n text: selectedText,\n })\n } else {\n // remove link\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, null)\n }\n },\n order: 1,\n },\n ]),\n ],\n },\n nodes: [LinkNode, AutoLinkNode],\n plugins: [\n {\n Component: LinkPlugin,\n position: 'normal',\n },\n {\n Component: AutoLinkPlugin,\n position: 'normal',\n },\n {\n Component: ClickableLinkPlugin,\n position: 'normal',\n },\n {\n Component: FloatingLinkEditorPlugin,\n position: 'floatingAnchorElem',\n },\n ],\n }),\n }\n}\n\nexport const LinkFeatureClientComponent = createClientComponent(LinkFeatureClient)\n"],"names":["lexicalUtilsImport","$findMatchingParent","lexicalImport","$getSelection","$isRangeSelection","LinkIcon","getSelectedNode","FeaturesSectionWithEntries","createClientComponent","AutoLinkNode","$isLinkNode","LinkNode","TOGGLE_LINK_COMMAND","AutoLinkPlugin","ClickableLinkPlugin","TOGGLE_LINK_WITH_MODAL_COMMAND","FloatingLinkEditorPlugin","LinkPlugin","LinkFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","selectedNode","linkParent","key","label","onClick","editor","selectedText","getEditorState","read","getTextContent","linkFields","doc","linkType","newTab","url","dispatchCommand","fields","text","order","nodes","plugins","Component","position","LinkFeatureClientComponent"],"mappings":"AAAA;AAEA,OAAOA,wBAAwB,iBAAgB;AAC/C,MAAM,EAAEC,mBAAmB,EAAE,GAAGD;AAEhC,OAAOE,mBAAmB,UAAS;AACnC,MAAM,EAAEC,aAAa,EAAEC,iBAAiB,EAAE,GAAGF;AAM7C,SAASG,QAAQ,QAAQ,uCAAsC;AAC/D,SAASC,eAAe,QAAQ,yCAAwC;AACxE,SAASC,0BAA0B,QAAQ,iEAAgE;AAC3G,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,YAAY,QAAQ,0BAAyB;AACtD,SAASC,WAAW,EAAEC,QAAQ,EAAEC,mBAAmB,QAAQ,sBAAqB;AAChF,SAASC,cAAc,QAAQ,8BAA6B;AAC5D,SAASC,mBAAmB,QAAQ,mCAAkC;AACtE,SAASC,8BAA8B,QAAQ,sDAAqD;AACpG,SAASC,wBAAwB,QAAQ,wCAAuC;AAChF,SAASC,UAAU,QAAQ,0BAAyB;AAIpD,MAAMC,oBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRhB,2BAA2B;4BACzB;gCACEiB,gBAAgBnB;gCAChBoB,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAItB,kBAAkBsB,YAAY;wCAChC,MAAMC,eAAerB,gBAAgBoB;wCACrC,MAAME,aAAa3B,oBAAoB0B,cAAcjB;wCACrD,OAAOkB,cAAc;oCACvB;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,OAAO,CAAC,IAAI,CAAC;gCACbC,SAAS,CAAC,EAAEC,MAAM,EAAEP,QAAQ,EAAE;oCAC5B,IAAI,CAACA,UAAU;wCACb,IAAIQ,eAAe;wCACnBD,OAAOE,cAAc,GAAGC,IAAI,CAAC;4CAC3BF,eAAe9B,gBAAgBiC,cAAc;wCAC/C;wCACA,MAAMC,aAAyB;4CAC7BC,KAAK;4CACLC,UAAU;4CACVC,QAAQ;4CACRC,KAAK;wCACP;wCACAT,OAAOU,eAAe,CAAC3B,gCAAgC;4CACrD4B,QAAQN;4CACRO,MAAMX;wCACR;oCACF,OAAO;wCACL,cAAc;wCACdD,OAAOU,eAAe,CAAC9B,qBAAqB;oCAC9C;gCACF;gCACAiC,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAC,OAAO;oBAACnC;oBAAUF;iBAAa;gBAC/BsC,SAAS;oBACP;wBACEC,WAAW/B;wBACXgC,UAAU;oBACZ;oBACA;wBACED,WAAWnC;wBACXoC,UAAU;oBACZ;oBACA;wBACED,WAAWlC;wBACXmC,UAAU;oBACZ;oBACA;wBACED,WAAWhC;wBACXiC,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,6BAA6B1C,sBAAsBU,mBAAkB"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/link/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalUtilsImport from '@lexical/utils'\nconst { $findMatchingParent } = lexicalUtilsImport\n\nimport lexicalImport from 'lexical'\nconst { $getSelection, $isRangeSelection } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { ExclusiveLinkCollectionsProps } from './feature.server.js'\nimport type { LinkFields } from './nodes/types.js'\n\nimport { LinkIcon } from '../../lexical/ui/icons/Link/index.js'\nimport { getSelectedNode } from '../../lexical/utils/getSelectedNode.js'\nimport { FeaturesSectionWithEntries } from '../common/floatingSelectToolbarFeaturesButtonsSection/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { AutoLinkNode } from './nodes/AutoLinkNode.js'\nimport { $isLinkNode, LinkNode, TOGGLE_LINK_COMMAND } from './nodes/LinkNode.js'\nimport { AutoLinkPlugin } from './plugins/autoLink/index.js'\nimport { ClickableLinkPlugin } from './plugins/clickableLink/index.js'\nimport { TOGGLE_LINK_WITH_MODAL_COMMAND } from './plugins/floatingLinkEditor/LinkEditor/commands.js'\nimport { FloatingLinkEditorPlugin } from './plugins/floatingLinkEditor/index.js'\nimport { LinkPlugin } from './plugins/link/index.js'\n\nexport type ClientProps = ExclusiveLinkCollectionsProps\n\nconst LinkFeatureClient: FeatureProviderProviderClient<ClientProps> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n FeaturesSectionWithEntries([\n {\n ChildComponent: LinkIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n const selectedNode = getSelectedNode(selection)\n const linkParent = $findMatchingParent(selectedNode, $isLinkNode)\n return linkParent != null\n }\n return false\n },\n key: 'link',\n label: `Link`,\n onClick: ({ editor, isActive }) => {\n if (!isActive) {\n let selectedText = null\n editor.getEditorState().read(() => {\n selectedText = $getSelection().getTextContent()\n })\n const linkFields: LinkFields = {\n doc: null,\n linkType: 'custom',\n newTab: false,\n url: 'https://',\n }\n editor.dispatchCommand(TOGGLE_LINK_WITH_MODAL_COMMAND, {\n fields: linkFields,\n text: selectedText,\n })\n } else {\n // remove link\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, null)\n }\n },\n order: 1,\n },\n ]),\n ],\n },\n nodes: [LinkNode, AutoLinkNode],\n plugins: [\n {\n Component: LinkPlugin,\n position: 'normal',\n },\n {\n Component: AutoLinkPlugin,\n position: 'normal',\n },\n {\n Component: ClickableLinkPlugin,\n position: 'normal',\n },\n {\n Component: FloatingLinkEditorPlugin,\n position: 'floatingAnchorElem',\n },\n ],\n }),\n }\n}\n\nexport const LinkFeatureClientComponent = createClientComponent(LinkFeatureClient)\n"],"names":["lexicalUtilsImport","$findMatchingParent","lexicalImport","$getSelection","$isRangeSelection","LinkIcon","getSelectedNode","FeaturesSectionWithEntries","createClientComponent","AutoLinkNode","$isLinkNode","LinkNode","TOGGLE_LINK_COMMAND","AutoLinkPlugin","ClickableLinkPlugin","TOGGLE_LINK_WITH_MODAL_COMMAND","FloatingLinkEditorPlugin","LinkPlugin","LinkFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","selectedNode","linkParent","key","label","onClick","editor","selectedText","getEditorState","read","getTextContent","linkFields","doc","linkType","newTab","url","dispatchCommand","fields","text","order","nodes","plugins","Component","position","LinkFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,wBAAwB,iBAAgB;AAC/C,MAAM,EAAEC,mBAAmB,EAAE,GAAGD;AAEhC,OAAOE,mBAAmB,UAAS;AACnC,MAAM,EAAEC,aAAa,EAAEC,iBAAiB,EAAE,GAAGF;AAM7C,SAASG,QAAQ,QAAQ,uCAAsC;AAC/D,SAASC,eAAe,QAAQ,yCAAwC;AACxE,SAASC,0BAA0B,QAAQ,iEAAgE;AAC3G,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,YAAY,QAAQ,0BAAyB;AACtD,SAASC,WAAW,EAAEC,QAAQ,EAAEC,mBAAmB,QAAQ,sBAAqB;AAChF,SAASC,cAAc,QAAQ,8BAA6B;AAC5D,SAASC,mBAAmB,QAAQ,mCAAkC;AACtE,SAASC,8BAA8B,QAAQ,sDAAqD;AACpG,SAASC,wBAAwB,QAAQ,wCAAuC;AAChF,SAASC,UAAU,QAAQ,0BAAyB;AAIpD,MAAMC,oBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRhB,2BAA2B;4BACzB;gCACEiB,gBAAgBnB;gCAChBoB,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAItB,kBAAkBsB,YAAY;wCAChC,MAAMC,eAAerB,gBAAgBoB;wCACrC,MAAME,aAAa3B,oBAAoB0B,cAAcjB;wCACrD,OAAOkB,cAAc;oCACvB;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,OAAO,CAAC,IAAI,CAAC;gCACbC,SAAS,CAAC,EAAEC,MAAM,EAAEP,QAAQ,EAAE;oCAC5B,IAAI,CAACA,UAAU;wCACb,IAAIQ,eAAe;wCACnBD,OAAOE,cAAc,GAAGC,IAAI,CAAC;4CAC3BF,eAAe9B,gBAAgBiC,cAAc;wCAC/C;wCACA,MAAMC,aAAyB;4CAC7BC,KAAK;4CACLC,UAAU;4CACVC,QAAQ;4CACRC,KAAK;wCACP;wCACAT,OAAOU,eAAe,CAAC3B,gCAAgC;4CACrD4B,QAAQN;4CACRO,MAAMX;wCACR;oCACF,OAAO;wCACL,cAAc;wCACdD,OAAOU,eAAe,CAAC9B,qBAAqB;oCAC9C;gCACF;gCACAiC,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAC,OAAO;oBAACnC;oBAAUF;iBAAa;gBAC/BsC,SAAS;oBACP;wBACEC,WAAW/B;wBACXgC,UAAU;oBACZ;oBACA;wBACED,WAAWnC;wBACXoC,UAAU;oBACZ;oBACA;wBACED,WAAWlC;wBACXmC,UAAU;oBACZ;oBACA;wBACED,WAAWhC;wBACXiC,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,6BAA6B1C,sBAAsBU,mBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAA;AAGpE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAUtD,MAAM,MAAM,6BAA6B,GACrC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAG9B,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B,CAAA;AAEL,MAAM,MAAM,sBAAsB,GAAG,6BAA6B,GAAG;IACnE;;;OAGG;IACH,MAAM,CAAC,EACH,CAAC,CAAC,IAAI,EAAE;QACN,MAAM,EAAE,eAAe,CAAA;QACvB,aAAa,EAAE,+BAA+B,EAAE,CAAA;QAChD,IAAI,EAAE,IAAI,CAAA;KACX,KAAK,+BAA+B,EAAE,CAAC,GACxC,+BAA+B,EAAE,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,6BAA6B,CAAC,sBAAsB,EAAE,WAAW,CA8F1F,CAAA"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { initI18n } from '@payloadcms/translations';
|
|
2
|
-
import { translations } from '@payloadcms/translations/client';
|
|
3
1
|
import { convertLexicalNodesToHTML } from '../converters/html/converter/index.js';
|
|
4
2
|
import { LinkFeatureClientComponent } from './feature.client.js';
|
|
5
3
|
import { AutoLinkNode } from './nodes/AutoLinkNode.js';
|
|
@@ -18,12 +16,7 @@ export const LinkFeature = (props)=>{
|
|
|
18
16
|
disabledCollections: props.disabledCollections,
|
|
19
17
|
enabledCollections: props.enabledCollections
|
|
20
18
|
},
|
|
21
|
-
generateSchemaMap: ({ config, props })=>{
|
|
22
|
-
const i18n = initI18n({
|
|
23
|
-
config: config.i18n,
|
|
24
|
-
context: 'client',
|
|
25
|
-
translations
|
|
26
|
-
});
|
|
19
|
+
generateSchemaMap: ({ config, i18n, props })=>{
|
|
27
20
|
return {
|
|
28
21
|
fields: transformExtraFields(props.fields, config, i18n, props.enabledCollections, props.disabledCollections)
|
|
29
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/field/features/link/feature.server.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { SanitizedConfig } from 'payload/config'\nimport type { FieldWithRichTextRequiredEditor } from 'payload/types'\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../../src/field/features/link/feature.server.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { SanitizedConfig } from 'payload/config'\nimport type { FieldWithRichTextRequiredEditor } from 'payload/types'\n\nimport type { HTMLConverter } from '../converters/html/converter/types.js'\nimport type { FeatureProviderProviderServer } from '../types.js'\nimport type { ClientProps } from './feature.client.js'\nimport type { SerializedAutoLinkNode, SerializedLinkNode } from './nodes/types.js'\n\nimport { convertLexicalNodesToHTML } from '../converters/html/converter/index.js'\nimport { LinkFeatureClientComponent } from './feature.client.js'\nimport { AutoLinkNode } from './nodes/AutoLinkNode.js'\nimport { LinkNode } from './nodes/LinkNode.js'\nimport { transformExtraFields } from './plugins/floatingLinkEditor/utilities.js'\nimport { linkPopulationPromiseHOC } from './populationPromise.js'\n\nexport type ExclusiveLinkCollectionsProps =\n | {\n /**\n * The collections that should be disabled for internal linking. Overrides the `enableRichTextLink` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: string[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled for internal linking. Overrides the `enableRichTextLink` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: string[]\n }\n\nexport type LinkFeatureServerProps = ExclusiveLinkCollectionsProps & {\n /**\n * A function or array defining additional fields for the link feature. These will be\n * displayed in the link editor drawer.\n */\n fields?:\n | ((args: {\n config: SanitizedConfig\n defaultFields: FieldWithRichTextRequiredEditor[]\n i18n: I18n\n }) => FieldWithRichTextRequiredEditor[])\n | FieldWithRichTextRequiredEditor[]\n}\n\nexport const LinkFeature: FeatureProviderProviderServer<LinkFeatureServerProps, ClientProps> = (\n props,\n) => {\n if (!props) {\n props = {}\n }\n return {\n feature: () => {\n return {\n ClientComponent: LinkFeatureClientComponent,\n clientFeatureProps: {\n disabledCollections: props.disabledCollections,\n enabledCollections: props.enabledCollections,\n } as ExclusiveLinkCollectionsProps,\n generateSchemaMap: ({ config, i18n, props }) => {\n return {\n fields: transformExtraFields(\n props.fields,\n config,\n i18n,\n props.enabledCollections,\n props.disabledCollections,\n ),\n }\n },\n nodes: [\n {\n converters: {\n html: {\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 const rel: string = node.fields.newTab ? ' rel=\"noopener noreferrer\"' : ''\n\n let href: string = node.fields.url\n if (node.fields.linkType === 'internal') {\n href =\n typeof node.fields.doc?.value === 'string'\n ? node.fields.doc?.value\n : node.fields.doc?.value?.id\n }\n\n return `<a href=\"${href}\"${rel}>${childrenText}</a>`\n },\n nodeTypes: [AutoLinkNode.getType()],\n } as HTMLConverter<SerializedAutoLinkNode>,\n },\n node: AutoLinkNode,\n populationPromises: [linkPopulationPromiseHOC(props)],\n },\n {\n converters: {\n html: {\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 const rel: string = node.fields.newTab ? ' rel=\"noopener noreferrer\"' : ''\n\n const href: string =\n node.fields.linkType === 'custom'\n ? node.fields.url\n : (node.fields.doc?.value as string)\n\n return `<a href=\"${href}\"${rel}>${childrenText}</a>`\n },\n nodeTypes: [LinkNode.getType()],\n } as HTMLConverter<SerializedLinkNode>,\n },\n node: LinkNode,\n populationPromises: [linkPopulationPromiseHOC(props)],\n },\n ],\n serverFeatureProps: props,\n }\n },\n key: 'link',\n serverFeatureProps: props,\n }\n}\n"],"names":["convertLexicalNodesToHTML","LinkFeatureClientComponent","AutoLinkNode","LinkNode","transformExtraFields","linkPopulationPromiseHOC","LinkFeature","props","feature","ClientComponent","clientFeatureProps","disabledCollections","enabledCollections","generateSchemaMap","config","i18n","fields","nodes","converters","html","converter","node","parent","payload","childrenText","lexicalNodes","children","rel","newTab","href","url","linkType","doc","value","id","nodeTypes","getType","populationPromises","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AASA,SAASA,yBAAyB,QAAQ,wCAAuC;AACjF,SAASC,0BAA0B,QAAQ,sBAAqB;AAChE,SAASC,YAAY,QAAQ,0BAAyB;AACtD,SAASC,QAAQ,QAAQ,sBAAqB;AAC9C,SAASC,oBAAoB,QAAQ,4CAA2C;AAChF,SAASC,wBAAwB,QAAQ,yBAAwB;AAsCjE,OAAO,MAAMC,cAAkF,CAC7FC;IAEA,IAAI,CAACA,OAAO;QACVA,QAAQ,CAAC;IACX;IACA,OAAO;QACLC,SAAS;YACP,OAAO;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MAAMxB,0BAA0B;wCACnDkB;wCACAO,cAAcJ,KAAKK,QAAQ;wCAC3BJ,QAAQ;4CACN,GAAGD,IAAI;4CACPC;wCACF;wCACAC;oCACF;oCAEA,MAAMI,MAAcN,KAAKL,MAAM,CAACY,MAAM,GAAG,+BAA+B;oCAExE,MAAMC,OACJR,KAAKL,MAAM,CAACe,QAAQ,KAAK,WACrBV,KAAKL,MAAM,CAACc,GAAG,GACdT,KAAKL,MAAM,CAACgB,GAAG,EAAEC;oCAExB,OAAO,CAAC,SAAS,EAAEJ,KAAK,CAAC,EAAEF,IAAI,CAAC,EAAEH,aAAa,IAAI,CAAC;gCACtD;gCACAW,WAAW;oCAAChC,SAASiC,OAAO;iCAAG;4BACjC;wBACF;wBACAf,MAAMlB;wBACNkC,oBAAoB;4BAAChC,yBAAyBE;yBAAO;oBACvD;iBACD;gBACD+B,oBAAoB/B;YACtB;QACF;QACAgC,KAAK;QACLD,oBAAoB/B;IACtB;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/field/features/link/nodes/AutoLinkNode.ts"],"sourcesContent":["import type { ElementNode, LexicalNode, RangeSelection } from 'lexical'\n\nimport lexicalImport from 'lexical'\nconst { $applyNodeReplacement, $isElementNode } = lexicalImport\n\nimport type { LinkFields, SerializedAutoLinkNode } from './types.js'\n\nimport { LinkNode } from './LinkNode.js'\n\n// Custom node type to override `canInsertTextAfter` that will\n// allow typing within the link\n\nexport class AutoLinkNode extends LinkNode {\n static clone(node: AutoLinkNode): AutoLinkNode {\n return new AutoLinkNode({ fields: node.__fields, key: node.__key })\n }\n\n static getType(): string {\n return 'autolink'\n }\n\n static importDOM(): null {\n // TODO: Should link node should handle the import over autolink?\n return null\n }\n\n static importJSON(serializedNode: SerializedAutoLinkNode): AutoLinkNode {\n if (\n serializedNode.version === 1 &&\n typeof serializedNode.fields?.doc?.value === 'object' &&\n serializedNode.fields?.doc?.value?.id\n ) {\n serializedNode.fields.doc.value = serializedNode.fields.doc.value.id\n serializedNode.version = 2\n }\n\n const node = $createAutoLinkNode({ fields: serializedNode.fields })\n\n node.setFormat(serializedNode.format)\n node.setIndent(serializedNode.indent)\n node.setDirection(serializedNode.direction)\n return node\n }\n\n exportJSON(): SerializedAutoLinkNode {\n return {\n ...super.exportJSON(),\n type: 'autolink',\n version: 2,\n }\n }\n\n insertNewAfter(selection: RangeSelection, restoreSelection = true): ElementNode | null {\n const element = this.getParentOrThrow().insertNewAfter(selection, restoreSelection)\n if ($isElementNode(element)) {\n const linkNode = $createAutoLinkNode({ fields: this.__fields })\n element.append(linkNode)\n return linkNode\n }\n return null\n }\n}\n\nexport function $createAutoLinkNode({ fields }: { fields: LinkFields }): AutoLinkNode {\n return $applyNodeReplacement(new AutoLinkNode({ fields }))\n}\nexport function $isAutoLinkNode(node: LexicalNode | null | undefined): node is AutoLinkNode {\n return node instanceof AutoLinkNode\n}\n"],"names":["lexicalImport","$applyNodeReplacement","$isElementNode","LinkNode","AutoLinkNode","clone","node","fields","__fields","key","__key","getType","importDOM","importJSON","serializedNode","version","doc","value","id","$createAutoLinkNode","setFormat","format","setIndent","indent","setDirection","direction","exportJSON","type","insertNewAfter","selection","restoreSelection","element","getParentOrThrow","linkNode","append","$isAutoLinkNode"],"mappings":"AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,qBAAqB,EAAEC,cAAc,EAAE,GAAGF;AAIlD,SAASG,QAAQ,QAAQ,gBAAe;AAExC,8DAA8D;AAC9D,+BAA+B;AAE/B,OAAO,MAAMC,qBAAqBD;IAChC,OAAOE,MAAMC,IAAkB,EAAgB;QAC7C,OAAO,IAAIF,aAAa;YAAEG,QAAQD,KAAKE,QAAQ;YAAEC,KAAKH,KAAKI,KAAK;QAAC;IACnE;IAEA,OAAOC,UAAkB;QACvB,OAAO;IACT;IAEA,OAAOC,YAAkB;QACvB,iEAAiE;QACjE,OAAO;IACT;IAEA,OAAOC,WAAWC,cAAsC,EAAgB;QACtE,IACEA,eAAeC,OAAO,KAAK,KAC3B,OAAOD,eAAeP,MAAM,EAAES,KAAKC,UAAU,YAC7CH,eAAeP,MAAM,EAAES,KAAKC,OAAOC,IACnC;YACAJ,eAAeP,MAAM,CAACS,GAAG,CAACC,KAAK,GAAGH,eAAeP,MAAM,CAACS,GAAG,CAACC,KAAK,CAACC,EAAE;YACpEJ,eAAeC,OAAO,GAAG;QAC3B;QAEA,MAAMT,OAAOa,oBAAoB;YAAEZ,QAAQO,eAAeP,MAAM;QAAC;QAEjED,KAAKc,SAAS,CAACN,eAAeO,MAAM;QACpCf,KAAKgB,SAAS,CAACR,eAAeS,MAAM;QACpCjB,KAAKkB,YAAY,CAACV,eAAeW,SAAS;QAC1C,OAAOnB;IACT;IAEAoB,aAAqC;QACnC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBC,MAAM;YACNZ,SAAS;QACX;IACF;IAEAa,eAAeC,SAAyB,EAAEC,mBAAmB,IAAI,EAAsB;QACrF,MAAMC,UAAU,IAAI,CAACC,gBAAgB,GAAGJ,cAAc,CAACC,WAAWC;QAClE,IAAI5B,eAAe6B,UAAU;YAC3B,MAAME,WAAWd,oBAAoB;gBAAEZ,QAAQ,IAAI,CAACC,QAAQ;YAAC;YAC7DuB,QAAQG,MAAM,CAACD;YACf,OAAOA;QACT;QACA,OAAO;IACT;AACF;AAEA,OAAO,SAASd,oBAAoB,EAAEZ,MAAM,EAA0B;IACpE,OAAON,sBAAsB,IAAIG,aAAa;QAAEG;IAAO;AACzD;AACA,OAAO,SAAS4B,gBAAgB7B,IAAoC;IAClE,OAAOA,gBAAgBF;AACzB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/field/features/link/nodes/AutoLinkNode.ts"],"sourcesContent":["import type { ElementNode, LexicalNode, RangeSelection } from 'lexical'\n\nimport lexicalImport from 'lexical'\nconst { $applyNodeReplacement, $isElementNode } = lexicalImport\n\nimport type { LinkFields, SerializedAutoLinkNode } from './types.js'\n\nimport { LinkNode } from './LinkNode.js'\n\n// Custom node type to override `canInsertTextAfter` that will\n// allow typing within the link\n\nexport class AutoLinkNode extends LinkNode {\n static clone(node: AutoLinkNode): AutoLinkNode {\n return new AutoLinkNode({ fields: node.__fields, key: node.__key })\n }\n\n static getType(): string {\n return 'autolink'\n }\n\n static importDOM(): null {\n // TODO: Should link node should handle the import over autolink?\n return null\n }\n\n static importJSON(serializedNode: SerializedAutoLinkNode): AutoLinkNode {\n if (\n serializedNode.version === 1 &&\n typeof serializedNode.fields?.doc?.value === 'object' &&\n serializedNode.fields?.doc?.value?.id\n ) {\n serializedNode.fields.doc.value = serializedNode.fields.doc.value.id\n serializedNode.version = 2\n }\n\n const node = $createAutoLinkNode({ fields: serializedNode.fields })\n\n node.setFormat(serializedNode.format)\n node.setIndent(serializedNode.indent)\n node.setDirection(serializedNode.direction)\n return node\n }\n\n exportJSON(): SerializedAutoLinkNode {\n return {\n ...super.exportJSON(),\n type: 'autolink',\n version: 2,\n }\n }\n\n insertNewAfter(selection: RangeSelection, restoreSelection = true): ElementNode | null {\n const element = this.getParentOrThrow().insertNewAfter(selection, restoreSelection)\n if ($isElementNode(element)) {\n const linkNode = $createAutoLinkNode({ fields: this.__fields })\n element.append(linkNode)\n return linkNode\n }\n return null\n }\n}\n\nexport function $createAutoLinkNode({ fields }: { fields: LinkFields }): AutoLinkNode {\n return $applyNodeReplacement(new AutoLinkNode({ fields }))\n}\nexport function $isAutoLinkNode(node: LexicalNode | null | undefined): node is AutoLinkNode {\n return node instanceof AutoLinkNode\n}\n"],"names":["lexicalImport","$applyNodeReplacement","$isElementNode","LinkNode","AutoLinkNode","clone","node","fields","__fields","key","__key","getType","importDOM","importJSON","serializedNode","version","doc","value","id","$createAutoLinkNode","setFormat","format","setIndent","indent","setDirection","direction","exportJSON","type","insertNewAfter","selection","restoreSelection","element","getParentOrThrow","linkNode","append","$isAutoLinkNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;YAC7DuB,QAAQG,MAAM,CAACD;YACf,OAAOA;QACT;QACA,OAAO;IACT;AACF;AAEA,OAAO,SAASd,oBAAoB,EAAEZ,MAAM,EAA0B;IACpE,OAAON,sBAAsB,IAAIG,aAAa;QAAEG;IAAO;AACzD;AACA,OAAO,SAAS4B,gBAAgB7B,IAAoC;IAClE,OAAOA,gBAAgBF;AACzB"}
|
|
@@ -180,10 +180,10 @@ export function $isLinkNode(node) {
|
|
|
180
180
|
export const TOGGLE_LINK_COMMAND = createCommand('TOGGLE_LINK_COMMAND');
|
|
181
181
|
export function toggleLink(payload) {
|
|
182
182
|
const selection = $getSelection();
|
|
183
|
-
if (!$isRangeSelection(selection)) {
|
|
183
|
+
if (!$isRangeSelection(selection) && !payload.selectedNodes.length) {
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
|
-
const nodes = selection.extract();
|
|
186
|
+
const nodes = $isRangeSelection(selection) ? selection.extract() : payload.selectedNodes;
|
|
187
187
|
if (payload === null) {
|
|
188
188
|
// Remove LinkNodes
|
|
189
189
|
nodes.forEach((node)=>{
|