@lobehub/editor 4.22.0 → 4.23.1
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/es/_virtual/_rolldown/runtime.js +8 -1
- package/es/codemirror/components/CopyButton.d.ts +0 -1
- package/es/codemirror/components/LanguageSelect.d.ts +0 -1
- package/es/codemirror/components/MoreOptions.d.ts +0 -1
- package/es/codemirror/components/Toolbar.d.ts +0 -1
- package/es/codemirror/constants.d.ts +0 -1
- package/es/codemirror/types.d.ts +0 -1
- package/es/common/sys.js +1 -1
- package/es/editor-kernel/data-source.d.ts +1 -2
- package/es/editor-kernel/event.d.ts +1 -3
- package/es/editor-kernel/index.d.ts +3 -2
- package/es/editor-kernel/index.js +4 -4
- package/es/editor-kernel/inode/i-element-node.d.ts +0 -1
- package/es/editor-kernel/inode/i-node.d.ts +0 -1
- package/es/editor-kernel/inode/index.d.ts +3 -1
- package/es/editor-kernel/inode/paragraph-node.d.ts +1 -1
- package/es/editor-kernel/inode/root-node.d.ts +0 -1
- package/es/editor-kernel/inode/text-node.d.ts +0 -1
- package/es/editor-kernel/kernel.d.ts +1 -2
- package/es/editor-kernel/react/LexicalErrorBoundary.d.ts +2 -6
- package/es/editor-kernel/react/PortalContainer.d.ts +7 -3
- package/es/editor-kernel/react/PortalContainer.js +4 -4
- package/es/editor-kernel/react/index.d.ts +2 -1
- package/es/editor-kernel/react/react-context.d.ts +3 -2
- package/es/editor-kernel/react/react-editor.d.ts +2 -2
- package/es/editor-kernel/react/useDecorators.js +3 -2
- package/es/editor-kernel/react/useLexicalEditor.d.ts +0 -1
- package/es/editor-kernel/react/useLexicalEditor.js +1 -1
- package/es/editor-kernel/utils.d.ts +2 -3
- package/es/headless/extract-media-from-editor-state.d.ts +0 -1
- package/es/headless/extract-media-from-editor-state.js +1 -1
- package/es/headless/index.d.ts +3 -2
- package/es/headless/index.js +4 -3
- package/es/headless.d.ts +2 -3
- package/es/headless.js +20 -41
- package/es/index.d.ts +45 -21
- package/es/index.js +6 -6
- package/es/locale/index.d.ts +1 -1
- package/es/node_modules/.pnpm/@types_mdast@4.0.4/node_modules/@types/mdast/index.d.ts +1 -2
- package/es/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts +1 -1
- package/es/plugins/auto-complete/index.d.ts +3 -1
- package/es/plugins/auto-complete/node/placeholderNode.js +1 -1
- package/es/plugins/auto-complete/plugin/index.d.ts +2 -1
- package/es/plugins/auto-complete/react/ReactAutoCompletePlugin.d.ts +1 -2
- package/es/plugins/auto-complete/react/index.d.ts +2 -1
- package/es/plugins/auto-complete/react/type.d.ts +1 -0
- package/es/plugins/block/command/index.d.ts +1 -3
- package/es/plugins/block/index.d.ts +5 -2
- package/es/plugins/block/plugin/index.d.ts +1 -0
- package/es/plugins/block/react/ReactBlockPlugin.d.ts +3 -2
- package/es/plugins/block/react/ReactBlockPlugin.js +5 -3
- package/es/plugins/block/react/core/types.d.ts +0 -1
- package/es/plugins/block/react/index.d.ts +3 -2
- package/es/plugins/block/service/i-block-menu-service.d.ts +1 -1
- package/es/plugins/block/service/i-block-menu-service.js +2 -1
- package/es/plugins/block/service/index.d.ts +2 -1
- package/es/plugins/code/command/index.d.ts +1 -3
- package/es/plugins/code/index.d.ts +3 -1
- package/es/plugins/code/plugin/index.d.ts +2 -1
- package/es/plugins/code/react/CodeReactPlugin.d.ts +1 -2
- package/es/plugins/code/react/index.d.ts +2 -1
- package/es/plugins/codeblock/command/index.d.ts +3 -1
- package/es/plugins/codeblock/command/index.js +1 -1
- package/es/plugins/codeblock/command/symbols.d.ts +1 -3
- package/es/plugins/codeblock/index.d.ts +3 -1
- package/es/plugins/codeblock/index.js +4 -4
- package/es/plugins/codeblock/plugin/index.d.ts +1 -0
- package/es/plugins/codeblock/react/ReactCodeblockPlugin.d.ts +1 -2
- package/es/plugins/codeblock/react/ReactCodeblockPlugin.js +1 -1
- package/es/plugins/codeblock/react/index.d.ts +2 -1
- package/es/plugins/codeblock/react/style.js +0 -1
- package/es/plugins/codeblock/react/type.d.ts +1 -0
- package/es/plugins/codemirror-block/command/index.d.ts +3 -5
- package/es/plugins/codemirror-block/index.d.ts +3 -1
- package/es/plugins/codemirror-block/node/CodeMirrorNode.d.ts +1 -2
- package/es/plugins/codemirror-block/plugin/index.d.ts +1 -1
- package/es/plugins/codemirror-block/react/ReactCodemirrorNode.d.ts +1 -2
- package/es/plugins/codemirror-block/react/index.d.ts +2 -1
- package/es/plugins/collaboration/index.d.ts +3 -1
- package/es/plugins/collaboration/react/ReactCollaborationPlugin.d.ts +1 -2
- package/es/plugins/collaboration/react/ReactCollaborationPlugin.js +1 -1
- package/es/plugins/collaboration/react/index.d.ts +2 -1
- package/es/plugins/collaboration/react/type.d.ts +0 -1
- package/es/plugins/collaboration/utils.d.ts +0 -1
- package/es/plugins/collaboration/utils.js +1 -1
- package/es/plugins/common/command/index.d.ts +2 -4
- package/es/plugins/common/data-source/json-data-source.js +1 -1
- package/es/plugins/common/index.d.ts +4 -2
- package/es/plugins/common/node/cursor.d.ts +1 -2
- package/es/plugins/common/plugin/index.d.ts +1 -1
- package/es/plugins/common/plugin/index.js +2 -1
- package/es/plugins/common/plugin/paste-handler.d.ts +0 -1
- package/es/plugins/common/plugin/register.js +4 -3
- package/es/plugins/common/react/Placeholder/index.js +2 -1
- package/es/plugins/common/react/ReactEditorContent.d.ts +1 -2
- package/es/plugins/common/react/ReactPlainText.d.ts +2 -4
- package/es/plugins/common/react/index.d.ts +3 -2
- package/es/plugins/common/react/type.d.ts +2 -1
- package/es/plugins/common/utils/index.js +1 -1
- package/es/plugins/content-blocks/data-source/content-blocks-data-source.d.ts +2 -2
- package/es/plugins/content-blocks/index.d.ts +2 -1
- package/es/plugins/content-blocks/plugin/index.d.ts +1 -1
- package/es/plugins/content-blocks/types.d.ts +1 -2
- package/es/plugins/content-blocks/utils/extract-media-lists.d.ts +0 -1
- package/es/plugins/content-blocks/utils/extract.d.ts +0 -1
- package/es/plugins/content-blocks/utils/extract.js +2 -2
- package/es/plugins/file/command/index.d.ts +1 -3
- package/es/plugins/file/index.d.ts +3 -1
- package/es/plugins/file/node/FileNode.d.ts +1 -2
- package/es/plugins/file/plugin/index.d.ts +1 -1
- package/es/plugins/file/react/ReactFilePlugin.d.ts +1 -2
- package/es/plugins/file/react/index.d.ts +2 -1
- package/es/plugins/file/react/type.d.ts +1 -1
- package/es/plugins/hr/command/index.d.ts +1 -3
- package/es/plugins/hr/index.d.ts +3 -1
- package/es/plugins/hr/node/HorizontalRuleNode.d.ts +1 -2
- package/es/plugins/hr/plugin/index.d.ts +1 -1
- package/es/plugins/hr/react/ReactHRPlugin.d.ts +1 -2
- package/es/plugins/hr/react/index.d.ts +2 -1
- package/es/plugins/image/command/index.d.ts +1 -3
- package/es/plugins/image/index.d.ts +3 -1
- package/es/plugins/image/node/basie-image-node.d.ts +0 -1
- package/es/plugins/image/node/block-image-node.d.ts +0 -1
- package/es/plugins/image/node/image-node.d.ts +0 -1
- package/es/plugins/image/plugin/index.d.ts +1 -1
- package/es/plugins/image/react/ReactImagePlugin.d.ts +1 -2
- package/es/plugins/image/react/components/Image.js +4 -2
- package/es/plugins/image/react/components/style.js +3 -3
- package/es/plugins/image/react/components/useSupenseImage.js +1 -1
- package/es/plugins/image/react/index.d.ts +2 -1
- package/es/plugins/inode/index.d.ts +2 -1
- package/es/plugins/inode/plugin/index.d.ts +1 -0
- package/es/plugins/inode/react/index.d.ts +1 -2
- package/es/plugins/inode/react/index.js +1 -1
- package/es/plugins/inode/service/index.d.ts +2 -0
- package/es/plugins/inode/service/index.js +2 -1
- package/es/plugins/link/command/index.d.ts +1 -3
- package/es/plugins/link/index.d.ts +3 -1
- package/es/plugins/link/node/LinkNode.d.ts +0 -1
- package/es/plugins/link/node/LinkNode.js +2 -2
- package/es/plugins/link/plugin/index.d.ts +1 -1
- package/es/plugins/link/plugin/registry.js +2 -1
- package/es/plugins/link/react/ReactLinkPlugin.d.ts +1 -2
- package/es/plugins/link/react/ReactLinkPlugin.js +1 -1
- package/es/plugins/link/react/index.d.ts +2 -1
- package/es/plugins/link/react/type.d.ts +0 -1
- package/es/plugins/link/service/i-link-service.d.ts +1 -1
- package/es/plugins/link/service/i-link-service.js +2 -1
- package/es/plugins/link/utils/index.js +1 -1
- package/es/plugins/link-highlight/command/index.d.ts +1 -3
- package/es/plugins/link-highlight/index.d.ts +3 -1
- package/es/plugins/link-highlight/plugin/index.d.ts +1 -0
- package/es/plugins/link-highlight/react/ReactLinkHighlightPlugin.d.ts +1 -2
- package/es/plugins/link-highlight/react/index.d.ts +2 -1
- package/es/plugins/list/command/index.d.ts +1 -1
- package/es/plugins/list/command/index.js +2 -2
- package/es/plugins/list/index.d.ts +3 -1
- package/es/plugins/list/plugin/checkList.d.ts +0 -1
- package/es/plugins/list/plugin/checkList.js +0 -7
- package/es/plugins/list/plugin/index.d.ts +1 -0
- package/es/plugins/list/react/ReactListPlugin.d.ts +1 -2
- package/es/plugins/list/react/index.d.ts +2 -1
- package/es/plugins/list/react/style.js +1 -1
- package/es/plugins/litexml/command/diffCommand.d.ts +2 -1
- package/es/plugins/litexml/command/diffCommand.js +2 -2
- package/es/plugins/litexml/command/index.d.ts +3 -1
- package/es/plugins/litexml/command/index.js +3 -2
- package/es/plugins/litexml/command/symbols.d.ts +6 -8
- package/es/plugins/litexml/data-source/litexml-data-source.d.ts +4 -3
- package/es/plugins/litexml/data-source/litexml-data-source.js +4 -2
- package/es/plugins/litexml/index.d.ts +5 -2
- package/es/plugins/litexml/node/DiffNode.d.ts +1 -2
- package/es/plugins/litexml/plugin/index.d.ts +1 -1
- package/es/plugins/litexml/react/DiffNodeToolbar/index.js +1 -1
- package/es/plugins/litexml/react/hooks/useHasDiffNode.d.ts +1 -0
- package/es/plugins/litexml/react/index.d.ts +1 -2
- package/es/plugins/litexml/react/index.js +1 -1
- package/es/plugins/litexml/service/litexml-service.d.ts +3 -3
- package/es/plugins/litexml/service/litexml-service.js +2 -1
- package/es/plugins/markdown/command/index.d.ts +4 -4
- package/es/plugins/markdown/data-source/markdown/parse.d.ts +3 -3
- package/es/plugins/markdown/data-source/markdown/parse.js +2 -2
- package/es/plugins/markdown/data-source/markdown-data-source.js +1 -1
- package/es/plugins/markdown/index.d.ts +3 -2
- package/es/plugins/markdown/plugin/index.d.ts +2 -1
- package/es/plugins/markdown/react/index.d.ts +1 -2
- package/es/plugins/markdown/service/shortcut.d.ts +2 -2
- package/es/plugins/markdown/service/shortcut.js +2 -1
- package/es/plugins/markdown/service/transformers.d.ts +1 -3
- package/es/plugins/markdown/utils/index.d.ts +1 -1
- package/es/plugins/markdown/utils/index.js +1 -1
- package/es/plugins/math/command/index.d.ts +1 -3
- package/es/plugins/math/index.d.ts +2 -1
- package/es/plugins/math/node/index.d.ts +1 -2
- package/es/plugins/math/node/index.js +3 -2
- package/es/plugins/math/plugin/index.d.ts +2 -2
- package/es/plugins/math/react/components/MathEditorContent.js +2 -1
- package/es/plugins/math/react/components/MathInline.js +2 -2
- package/es/plugins/math/react/index.d.ts +0 -1
- package/es/plugins/math/react/style.js +2 -2
- package/es/plugins/math/react/type.d.ts +0 -1
- package/es/plugins/mention/command/index.d.ts +1 -3
- package/es/plugins/mention/index.d.ts +3 -1
- package/es/plugins/mention/node/MentionNode.d.ts +0 -1
- package/es/plugins/mention/plugin/index.d.ts +2 -1
- package/es/plugins/mention/react/ReactMentionPlugin.d.ts +1 -2
- package/es/plugins/mention/react/index.d.ts +2 -1
- package/es/plugins/mention/react/type.d.ts +0 -1
- package/es/plugins/slash/index.d.ts +5 -3
- package/es/plugins/slash/plugin/index.d.ts +1 -1
- package/es/plugins/slash/react/ReactSlashOption.d.ts +1 -2
- package/es/plugins/slash/react/ReactSlashPlugin.d.ts +1 -2
- package/es/plugins/slash/react/ReactSlashPlugin.js +2 -1
- package/es/plugins/slash/react/components/SlashMenu.d.ts +1 -2
- package/es/plugins/slash/react/index.d.ts +4 -3
- package/es/plugins/slash/react/type.d.ts +2 -1
- package/es/plugins/slash/service/i-slash-service.d.ts +2 -1
- package/es/plugins/slash/service/i-slash-service.js +2 -1
- package/es/plugins/slash/utils/utils.js +1 -1
- package/es/plugins/table/command/index.d.ts +4 -6
- package/es/plugins/table/command/index.js +4 -4
- package/es/plugins/table/index.d.ts +3 -1
- package/es/plugins/table/node/index.js +2 -1
- package/es/plugins/table/plugin/index.d.ts +1 -1
- package/es/plugins/table/plugin/index.js +1 -2
- package/es/plugins/table/react/TableActionMenu/index.js +0 -7
- package/es/plugins/table/react/TableColController.js +2 -2
- package/es/plugins/table/react/TableController/hooks.js +3 -2
- package/es/plugins/table/react/TableHoverActions/utils.js +1 -1
- package/es/plugins/table/react/TableResize/index.js +1 -1
- package/es/plugins/table/react/TableRowController.js +1 -1
- package/es/plugins/table/react/hooks.js +0 -7
- package/es/plugins/table/react/index.d.ts +0 -1
- package/es/plugins/table/react/index.js +1 -1
- package/es/plugins/table/react/type.d.ts +2 -1
- package/es/plugins/table/service/i-table-controller-menu-service.d.ts +1 -1
- package/es/plugins/table/service/i-table-controller-menu-service.js +2 -1
- package/es/plugins/table/service/index.d.ts +2 -1
- package/es/plugins/table/utils/index.js +1 -1
- package/es/plugins/toolbar/command/index.d.ts +0 -1
- package/es/plugins/toolbar/index.d.ts +2 -1
- package/es/plugins/toolbar/react/index.d.ts +0 -1
- package/es/plugins/toolbar/react/type.d.ts +0 -1
- package/es/plugins/upload/index.d.ts +2 -1
- package/es/plugins/upload/plugin/index.d.ts +1 -0
- package/es/plugins/upload/service/i-upload-service.d.ts +2 -1
- package/es/plugins/upload/service/i-upload-service.js +2 -1
- package/es/plugins/virtual-block/index.d.ts +3 -1
- package/es/plugins/virtual-block/plugin/index.d.ts +1 -0
- package/es/plugins/virtual-block/plugin/register.js +3 -2
- package/es/plugins/virtual-block/react/ReactVirtualBlock.d.ts +1 -2
- package/es/plugins/virtual-block/react/index.d.ts +2 -1
- package/es/react/ChatInput/ChatInput.d.ts +1 -2
- package/es/react/ChatInput/ChatInput.js +2 -1
- package/es/react/ChatInput/index.d.ts +2 -1
- package/es/react/ChatInput/type.d.ts +0 -1
- package/es/react/ChatInputActionBar/ChatInputActionBar.d.ts +1 -2
- package/es/react/ChatInputActionBar/index.d.ts +2 -1
- package/es/react/ChatInputActionBar/type.d.ts +0 -1
- package/es/react/ChatInputActions/ChatInputActions.d.ts +2 -4
- package/es/react/ChatInputActions/index.d.ts +2 -1
- package/es/react/ChatInputActions/type.d.ts +0 -1
- package/es/react/CodeLanguageSelect/CodeLanguageSelect.d.ts +1 -2
- package/es/react/CodeLanguageSelect/index.d.ts +2 -1
- package/es/react/CodeLanguageSelect/type.d.ts +0 -1
- package/es/react/Editor/Editor.js +1 -1
- package/es/react/Editor/index.d.ts +1 -2
- package/es/react/Editor/index.js +1 -1
- package/es/react/Editor/type.d.ts +5 -1
- package/es/react/Editor/utils.d.ts +0 -1
- package/es/react/EditorProvider/index.d.ts +2 -7
- package/es/react/EditorProvider/index.js +1 -1
- package/es/react/FloatActions/FloatActions.d.ts +1 -2
- package/es/react/FloatActions/index.d.ts +2 -1
- package/es/react/FloatActions/type.d.ts +0 -1
- package/es/react/SendButton/SendButton.d.ts +1 -2
- package/es/react/SendButton/index.d.ts +2 -1
- package/es/react/SendButton/type.d.ts +0 -1
- package/es/react/hooks/useEditor.d.ts +1 -0
- package/es/react/hooks/useEditorState/index.d.ts +1 -0
- package/es/react/hooks/useEditorState/index.js +8 -4
- package/es/react.d.ts +14 -7
- package/es/renderer/LexicalDiff.d.ts +1 -16
- package/es/renderer/LexicalDiff.js +1 -1
- package/es/renderer/LexicalRenderer.d.ts +1 -11
- package/es/renderer/diff/style.js +1 -1
- package/es/renderer/diff/types.d.ts +0 -1
- package/es/renderer/engine/render-builtin-node.js +1 -1
- package/es/renderer/nodes/index.d.ts +0 -1
- package/es/renderer/renderers/index.d.ts +0 -1
- package/es/renderer/renderers/index.js +1 -1
- package/es/renderer/renderers/math.js +2 -2
- package/es/renderer/types.d.ts +0 -1
- package/es/{symbols-DEEvsKq4.d.ts → symbols-Do7jD4Tt.d.ts} +6 -8
- package/es/types/hotkey.d.ts +0 -1
- package/es/types/index.d.ts +2 -1
- package/es/types/kernel.d.ts +1 -2
- package/es/types/locale.d.ts +2 -3
- package/es/utils/debug.d.ts +1 -2
- package/es/utils/debug.js +1 -1
- package/es/utils/hotkey/parseHotkeys.js +1 -1
- package/es/utils/hotkey/registerHotkey.d.ts +0 -1
- package/package.json +13 -13
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { IServiceID } from "../../../types/kernel.js";
|
|
2
|
+
import "../../../types/index.js";
|
|
2
3
|
import { IRootNode } from "../../../editor-kernel/inode/root-node.js";
|
|
4
|
+
import "../../../editor-kernel/inode/index.js";
|
|
3
5
|
//#region src/plugins/inode/service/index.d.ts
|
|
4
6
|
interface INodeService {
|
|
5
7
|
processNodeTree(inode: {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import * as _$lexical from "lexical";
|
|
2
1
|
import { LexicalEditor, NodeKey } from "lexical";
|
|
3
|
-
|
|
4
2
|
//#region src/plugins/link/command/index.d.ts
|
|
5
|
-
declare const INSERT_LINK_COMMAND:
|
|
3
|
+
declare const INSERT_LINK_COMMAND: import("lexical").LexicalCommand<{
|
|
6
4
|
title?: string;
|
|
7
5
|
url?: string;
|
|
8
6
|
}>;
|
|
@@ -2,4 +2,6 @@ import { INSERT_LINK_COMMAND } from "./command/index.js";
|
|
|
2
2
|
import { LinkPlugin, LinkPluginOptions } from "./plugin/index.js";
|
|
3
3
|
import { ReactLinkPluginProps } from "./react/type.js";
|
|
4
4
|
import { ReactLinkPlugin } from "./react/ReactLinkPlugin.js";
|
|
5
|
-
import
|
|
5
|
+
import "./react/index.js";
|
|
6
|
+
import { ILinkService } from "./service/i-link-service.js";
|
|
7
|
+
export { ILinkService, INSERT_LINK_COMMAND, LinkPlugin, LinkPluginOptions, ReactLinkPlugin, type ReactLinkPluginProps };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BaseSelection, DOMConversionMap, EditorConfig, ElementNode, LexicalCommand, LexicalEditor, LexicalNode, LexicalUpdateJSON, NodeKey, RangeSelection, SerializedElementNode, Spread } from "lexical";
|
|
2
|
-
|
|
3
2
|
//#region src/plugins/link/node/LinkNode.d.ts
|
|
4
3
|
type LinkAttributes = {
|
|
5
4
|
rel?: null | string;
|
|
@@ -6,7 +6,7 @@ import { $findMatchingParent, addClassNamesToElement, isHTMLAnchorElement } from
|
|
|
6
6
|
init_utils();
|
|
7
7
|
init_debug();
|
|
8
8
|
const logger = createDebugLogger("plugin", "link");
|
|
9
|
-
const SUPPORTED_URL_PROTOCOLS = new Set([
|
|
9
|
+
const SUPPORTED_URL_PROTOCOLS = /* @__PURE__ */ new Set([
|
|
10
10
|
"http:",
|
|
11
11
|
"https:",
|
|
12
12
|
"mailto:",
|
|
@@ -445,4 +445,4 @@ function formatUrl(url) {
|
|
|
445
445
|
return url;
|
|
446
446
|
}
|
|
447
447
|
//#endregion
|
|
448
|
-
export { $createLinkNode, $isLinkNode, $toggleLink, AutoLinkNode, HOVER_LINK_COMMAND, HOVER_OUT_LINK_COMMAND, LinkNode, TOGGLE_LINK_COMMAND, formatUrl };
|
|
448
|
+
export { $createAutoLinkNode, $createLinkNode, $isAutoLinkNode, $isLinkNode, $toggleLink, AutoLinkNode, HOVER_LINK_COMMAND, HOVER_OUT_LINK_COMMAND, LinkNode, TOGGLE_LINK_COMMAND, formatUrl };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IEditorPluginConstructor } from "../../../types/kernel.js";
|
|
2
|
+
import "../../../types/index.js";
|
|
2
3
|
import { LinkAttributes } from "../node/LinkNode.js";
|
|
3
|
-
|
|
4
4
|
//#region src/plugins/link/plugin/index.d.ts
|
|
5
5
|
interface LinkPluginOptions {
|
|
6
6
|
attributes?: LinkAttributes;
|
|
@@ -13,7 +13,8 @@ function registerLinkCommands(editor, kernel, options) {
|
|
|
13
13
|
if (!selection) return;
|
|
14
14
|
if ($isRangeSelection(selection)) editor.getEditorState().read(() => {
|
|
15
15
|
const node = getSelectedNode(selection);
|
|
16
|
-
|
|
16
|
+
const isLink = $isLinkNode(node.getParent()) || $isLinkNode(node);
|
|
17
|
+
state.isLink = isLink;
|
|
17
18
|
});
|
|
18
19
|
else state.isLink = false;
|
|
19
20
|
}), editor.registerCommand(TOGGLE_LINK_COMMAND, (payload) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ReactLinkPluginProps } from "./type.js";
|
|
2
2
|
import { FC } from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/plugins/link/react/ReactLinkPlugin.d.ts
|
|
5
4
|
declare const ReactLinkPlugin: FC<ReactLinkPluginProps>;
|
|
6
5
|
//#endregion
|
|
7
|
-
export { ReactLinkPlugin };
|
|
6
|
+
export { ReactLinkPlugin, ReactLinkPlugin as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { genServiceId } from "../../../editor-kernel/utils.js";
|
|
1
|
+
import { genServiceId, init_utils } from "../../../editor-kernel/utils.js";
|
|
2
2
|
import EventEmitter from "eventemitter3";
|
|
3
3
|
//#region src/plugins/link/service/i-link-service.ts
|
|
4
|
+
init_utils();
|
|
4
5
|
const ILinkService = genServiceId("LinkService");
|
|
5
6
|
var LinkService = class extends EventEmitter {
|
|
6
7
|
constructor(..._args) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import * as _$lexical from "lexical";
|
|
2
1
|
import { LexicalEditor } from "lexical";
|
|
3
|
-
|
|
4
2
|
//#region src/plugins/link-highlight/command/index.d.ts
|
|
5
|
-
declare const INSERT_LINK_HIGHLIGHT_COMMAND:
|
|
3
|
+
declare const INSERT_LINK_HIGHLIGHT_COMMAND: import("lexical").LexicalCommand<undefined>;
|
|
6
4
|
declare function registerLinkHighlightCommand(editor: LexicalEditor): () => void;
|
|
7
5
|
//#endregion
|
|
8
6
|
export { INSERT_LINK_HIGHLIGHT_COMMAND, registerLinkHighlightCommand };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { INSERT_LINK_HIGHLIGHT_COMMAND, registerLinkHighlightCommand } from "./command/index.js";
|
|
2
2
|
import { LinkHighlightPlugin, LinkHighlightPluginOptions } from "./plugin/index.js";
|
|
3
|
-
import
|
|
3
|
+
import ReactLinkHighlightPlugin from "./react/ReactLinkHighlightPlugin.js";
|
|
4
|
+
import "./react/index.js";
|
|
5
|
+
export { INSERT_LINK_HIGHLIGHT_COMMAND, LinkHighlightPlugin, LinkHighlightPluginOptions, ReactLinkHighlightPlugin, registerLinkHighlightCommand };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ReactLinkHighlightPluginProps } from "./type.js";
|
|
2
2
|
import { FC } from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/plugins/link-highlight/react/ReactLinkHighlightPlugin.d.ts
|
|
5
4
|
declare const ReactLinkHighlightPlugin: FC<ReactLinkHighlightPluginProps>;
|
|
6
5
|
//#endregion
|
|
7
|
-
export { ReactLinkHighlightPlugin };
|
|
6
|
+
export { ReactLinkHighlightPlugin as default };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ReactLinkHighlightPlugin from "./ReactLinkHighlightPlugin.js";
|
|
2
|
+
export { ReactLinkHighlightPlugin };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { INSERT_CHECK_LIST_COMMAND } from "../plugin/checkList.js";
|
|
2
2
|
import { INSERT_ORDERED_LIST_COMMAND as INSERT_ORDERED_LIST_COMMAND$1, INSERT_UNORDERED_LIST_COMMAND as INSERT_UNORDERED_LIST_COMMAND$1, REMOVE_LIST_COMMAND, UPDATE_LIST_START_COMMAND } from "@lexical/list";
|
|
3
|
-
export { INSERT_ORDERED_LIST_COMMAND$1 as INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND$1 as INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND, UPDATE_LIST_START_COMMAND };
|
|
3
|
+
export { INSERT_CHECK_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND$1 as INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND$1 as INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND, UPDATE_LIST_START_COMMAND };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../plugin/checkList.js";
|
|
1
|
+
import { INSERT_CHECK_LIST_COMMAND } from "../plugin/checkList.js";
|
|
2
2
|
import { INSERT_ORDERED_LIST_COMMAND as INSERT_ORDERED_LIST_COMMAND$1, INSERT_UNORDERED_LIST_COMMAND as INSERT_UNORDERED_LIST_COMMAND$1, REMOVE_LIST_COMMAND, UPDATE_LIST_START_COMMAND } from "@lexical/list";
|
|
3
|
-
export { INSERT_ORDERED_LIST_COMMAND$1 as INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND$1 as INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND, UPDATE_LIST_START_COMMAND };
|
|
3
|
+
export { INSERT_CHECK_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND$1 as INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND$1 as INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND, UPDATE_LIST_START_COMMAND };
|
|
@@ -2,4 +2,6 @@ import { INSERT_CHECK_LIST_COMMAND } from "./plugin/checkList.js";
|
|
|
2
2
|
import { INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND, UPDATE_LIST_START_COMMAND } from "./command/index.js";
|
|
3
3
|
import { ListPlugin, ListPluginOptions } from "./plugin/index.js";
|
|
4
4
|
import { ReactListPluginProps } from "./react/type.js";
|
|
5
|
-
import
|
|
5
|
+
import ReactListPlugin from "./react/ReactListPlugin.js";
|
|
6
|
+
import "./react/index.js";
|
|
7
|
+
export { INSERT_CHECK_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, ListPlugin, ListPluginOptions, REMOVE_LIST_COMMAND, ReactListPlugin, type ReactListPluginProps, UPDATE_LIST_START_COMMAND };
|
|
@@ -2,13 +2,6 @@ import { $getNearestNodeFromDOMNode, $getSelection, $isElementNode, $isRangeSele
|
|
|
2
2
|
import { $findMatchingParent, calculateZoomLevel, isHTMLElement as isHTMLElement$1, mergeRegister } from "@lexical/utils";
|
|
3
3
|
import { $insertList, $isListItemNode, $isListNode } from "@lexical/list";
|
|
4
4
|
//#region src/plugins/list/plugin/checkList.ts
|
|
5
|
-
/**
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
5
|
const INSERT_CHECK_LIST_COMMAND = createCommand("INSERT_CHECK_LIST_COMMAND");
|
|
13
6
|
function isHeadlessEditor(editor) {
|
|
14
7
|
return editor._headless === true;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ReactListPluginProps } from "./type.js";
|
|
2
2
|
import { FC } from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/plugins/list/react/ReactListPlugin.d.ts
|
|
5
4
|
declare const ReactListPlugin: FC<ReactListPluginProps>;
|
|
6
5
|
//#endregion
|
|
7
|
-
export { ReactListPlugin };
|
|
6
|
+
export { ReactListPlugin as default };
|
|
@@ -25,7 +25,7 @@ const styles = createStaticStyles(({ css, cssVar }) => css`
|
|
|
25
25
|
.editor_listUnordered& {
|
|
26
26
|
list-style-type: none;
|
|
27
27
|
|
|
28
|
-
> .editor_listItem:not(:has(ul)
|
|
28
|
+
> .editor_listItem:not(:has(ul), [role='checkbox']) {
|
|
29
29
|
&::before {
|
|
30
30
|
content: '-';
|
|
31
31
|
display: inline-block;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DiffNode } from "../node/DiffNode.js";
|
|
2
|
-
import { LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND } from "./symbols.js";
|
|
2
|
+
import { DiffAction, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND } from "./symbols.js";
|
|
3
3
|
import { $getNodeByKey, $isElementNode, COMMAND_PRIORITY_EDITOR } from "lexical";
|
|
4
4
|
import { mergeRegister } from "@lexical/utils";
|
|
5
5
|
//#region src/plugins/litexml/command/diffCommand.ts
|
|
@@ -88,4 +88,4 @@ function registerLiteXMLDiffCommand(editor) {
|
|
|
88
88
|
}, COMMAND_PRIORITY_EDITOR));
|
|
89
89
|
}
|
|
90
90
|
//#endregion
|
|
91
|
-
export { registerLiteXMLDiffCommand };
|
|
91
|
+
export { DiffAction, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, registerLiteXMLDiffCommand };
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import "../data-source/litexml-data-source.js";
|
|
1
2
|
import { LITEXML_APPLY_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND } from "./symbols.js";
|
|
2
|
-
import { LexicalEditor } from "lexical";
|
|
3
|
+
import { LexicalEditor } from "lexical";
|
|
4
|
+
export { LITEXML_APPLY_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createDebugLogger, init_debug } from "../../../utils/debug.js";
|
|
2
|
-
import { $closest } from "../../../editor-kernel/utils.js";
|
|
2
|
+
import { $closest, init_utils } from "../../../editor-kernel/utils.js";
|
|
3
3
|
import { $createDiffNode, DiffNode } from "../node/DiffNode.js";
|
|
4
4
|
import { $cloneNode, $parseSerializedNodeImpl, charToId } from "../utils/index.js";
|
|
5
5
|
import { LITEXML_APPLY_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND } from "./symbols.js";
|
|
@@ -7,6 +7,7 @@ import { $createParagraphNode, $getNodeByKey, $getRoot, $insertNodes, $isElement
|
|
|
7
7
|
import { mergeRegister } from "@lexical/utils";
|
|
8
8
|
import { $isListItemNode } from "@lexical/list";
|
|
9
9
|
//#region src/plugins/litexml/command/index.ts
|
|
10
|
+
init_utils();
|
|
10
11
|
init_debug();
|
|
11
12
|
const logger = createDebugLogger("plugin", "litexml");
|
|
12
13
|
function toArrayXml(litexml) {
|
|
@@ -327,4 +328,4 @@ function handleInsert(editor, payload, dataSource) {
|
|
|
327
328
|
});
|
|
328
329
|
}
|
|
329
330
|
//#endregion
|
|
330
|
-
export { registerLiteXMLCommand };
|
|
331
|
+
export { LITEXML_APPLY_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND, registerLiteXMLCommand };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as _$lexical from "lexical";
|
|
2
|
-
|
|
3
1
|
//#region src/plugins/litexml/command/symbols.d.ts
|
|
4
2
|
/**
|
|
5
3
|
* LiteXML command identities.
|
|
@@ -24,7 +22,7 @@ declare enum DiffAction {
|
|
|
24
22
|
Reject = 0,
|
|
25
23
|
Accept = 1
|
|
26
24
|
}
|
|
27
|
-
declare const LITEXML_MODIFY_COMMAND:
|
|
25
|
+
declare const LITEXML_MODIFY_COMMAND: import("lexical").LexicalCommand<({
|
|
28
26
|
action: "insert";
|
|
29
27
|
beforeId: string;
|
|
30
28
|
litexml: string;
|
|
@@ -39,15 +37,15 @@ declare const LITEXML_MODIFY_COMMAND: _$lexical.LexicalCommand<({
|
|
|
39
37
|
action: "modify";
|
|
40
38
|
litexml: string | string[];
|
|
41
39
|
})[]>;
|
|
42
|
-
declare const LITEXML_APPLY_COMMAND:
|
|
40
|
+
declare const LITEXML_APPLY_COMMAND: import("lexical").LexicalCommand<{
|
|
43
41
|
delay?: boolean;
|
|
44
42
|
litexml: string | string[];
|
|
45
43
|
}>;
|
|
46
|
-
declare const LITEXML_REMOVE_COMMAND:
|
|
44
|
+
declare const LITEXML_REMOVE_COMMAND: import("lexical").LexicalCommand<{
|
|
47
45
|
delay?: boolean;
|
|
48
46
|
id: string;
|
|
49
47
|
}>;
|
|
50
|
-
declare const LITEXML_INSERT_COMMAND:
|
|
48
|
+
declare const LITEXML_INSERT_COMMAND: import("lexical").LexicalCommand<{
|
|
51
49
|
beforeId: string;
|
|
52
50
|
delay?: boolean;
|
|
53
51
|
litexml: string;
|
|
@@ -56,11 +54,11 @@ declare const LITEXML_INSERT_COMMAND: _$lexical.LexicalCommand<{
|
|
|
56
54
|
delay?: boolean;
|
|
57
55
|
litexml: string;
|
|
58
56
|
}>;
|
|
59
|
-
declare const LITEXML_DIFFNODE_COMMAND:
|
|
57
|
+
declare const LITEXML_DIFFNODE_COMMAND: import("lexical").LexicalCommand<{
|
|
60
58
|
action: DiffAction;
|
|
61
59
|
nodeKey: string;
|
|
62
60
|
}>;
|
|
63
|
-
declare const LITEXML_DIFFNODE_ALL_COMMAND:
|
|
61
|
+
declare const LITEXML_DIFFNODE_ALL_COMMAND: import("lexical").LexicalCommand<{
|
|
64
62
|
action: DiffAction;
|
|
65
63
|
}>;
|
|
66
64
|
//#endregion
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import DataSource, { IWriteOptions } from "../../../editor-kernel/data-source.js";
|
|
2
2
|
import { IServiceID } from "../../../types/kernel.js";
|
|
3
|
+
import "../../../types/index.js";
|
|
4
|
+
import "../../../editor-kernel/index.js";
|
|
3
5
|
import { ILitexmlService } from "../service/litexml-service.js";
|
|
4
6
|
import { LexicalEditor } from "lexical";
|
|
5
|
-
|
|
6
7
|
//#region src/plugins/litexml/data-source/litexml-data-source.d.ts
|
|
7
8
|
/**
|
|
8
9
|
* LitexmlDataSource - Handles conversion between Lexical editor state and XML format
|
|
@@ -62,4 +63,4 @@ declare class LitexmlDataSource extends DataSource {
|
|
|
62
63
|
private escapeXML;
|
|
63
64
|
}
|
|
64
65
|
//#endregion
|
|
65
|
-
export { LitexmlDataSource };
|
|
66
|
+
export { LitexmlDataSource as default };
|
|
@@ -168,12 +168,14 @@ var LitexmlDataSource = class extends DataSource {
|
|
|
168
168
|
}
|
|
169
169
|
case "ul":
|
|
170
170
|
case "ol":
|
|
171
|
-
xmlElement.
|
|
171
|
+
Array.from(xmlElement.childNodes).forEach((child) => {
|
|
172
|
+
if (child.nodeType !== 1) return;
|
|
173
|
+
if (String(child.tagName).toLowerCase() !== "li") return;
|
|
172
174
|
const listItem = INodeHelper.createElementNode("listitem", {
|
|
173
175
|
children: [],
|
|
174
176
|
value: 1
|
|
175
177
|
});
|
|
176
|
-
this.processXMLChildren(
|
|
178
|
+
this.processXMLChildren(child, listItem);
|
|
177
179
|
INodeHelper.appendChild(parentNode, listItem);
|
|
178
180
|
});
|
|
179
181
|
break;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ILitexmlService, LitexmlService, XMLReaderFunc, XMLReaderRecord, XMLWriterFunc, XMLWriterRecord } from "./service/litexml-service.js";
|
|
2
|
-
import
|
|
2
|
+
import LitexmlDataSource from "./data-source/litexml-data-source.js";
|
|
3
3
|
import { DiffAction, LITEXML_APPLY_COMMAND, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND } from "./command/symbols.js";
|
|
4
|
+
import "./command/index.js";
|
|
5
|
+
import "./command/diffCommand.js";
|
|
4
6
|
import { LitexmlPlugin, LitexmlPluginOptions } from "./plugin/index.js";
|
|
5
7
|
import { ReactLiteXmlPlugin } from "./react/index.js";
|
|
6
|
-
import { useHasDiffNode } from "./react/hooks/useHasDiffNode.js";
|
|
8
|
+
import { useHasDiffNode } from "./react/hooks/useHasDiffNode.js";
|
|
9
|
+
export { DiffAction, ILitexmlService, LITEXML_APPLY_COMMAND, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND, LitexmlDataSource, LitexmlPlugin, type LitexmlPluginOptions, LitexmlService, ReactLiteXmlPlugin, type XMLReaderFunc, type XMLReaderRecord, type XMLWriterFunc, type XMLWriterRecord, useHasDiffNode };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CardLikeElementNode } from "../../common/node/cursor.js";
|
|
2
2
|
import { DOMExportOutput, EditorConfig, ElementDOMSlot, LexicalEditor, LexicalUpdateJSON, SerializedElementNode, Spread } from "lexical";
|
|
3
|
-
|
|
4
3
|
//#region src/plugins/litexml/node/DiffNode.d.ts
|
|
5
4
|
type DiffType = 'add' | 'remove' | 'modify' | 'unchanged' | 'listItemModify' | 'listItemRemove' | 'listItemAdd';
|
|
6
5
|
type SerializedDiffNode = Spread<{
|
|
@@ -26,4 +25,4 @@ declare class DiffNode extends CardLikeElementNode {
|
|
|
26
25
|
isCardLike(): boolean;
|
|
27
26
|
}
|
|
28
27
|
//#endregion
|
|
29
|
-
export { DiffNode };
|
|
28
|
+
export { DiffNode, DiffType, SerializedDiffNode };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IEditorPluginConstructor } from "../../../types/kernel.js";
|
|
2
|
+
import "../../../types/index.js";
|
|
2
3
|
import { DiffNode } from "../node/DiffNode.js";
|
|
3
4
|
import { LexicalEditor } from "lexical";
|
|
4
|
-
|
|
5
5
|
//#region src/plugins/litexml/plugin/index.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* LitexmlPluginOptions - Configuration options for the Litexml plugin
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import LexicalPortalContainer from "../../../../editor-kernel/react/PortalContainer.js";
|
|
1
|
+
import { LexicalPortalContainer } from "../../../../editor-kernel/react/PortalContainer.js";
|
|
2
2
|
import { LITEXML_DIFFNODE_COMMAND } from "../../command/symbols.js";
|
|
3
3
|
import { useTranslation } from "../../../../editor-kernel/react/useTranslation.js";
|
|
4
4
|
import { styles } from "./style.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IServiceID } from "../../../types/kernel.js";
|
|
2
|
+
import "../../../types/index.js";
|
|
2
3
|
import { LexicalNode } from "lexical";
|
|
3
|
-
|
|
4
4
|
//#region src/plugins/litexml/service/litexml-service.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* XML Reader function type - converts XML element to Lexical node
|
|
7
7
|
*/
|
|
8
|
-
type XMLReaderFunc = (xmlElement:
|
|
8
|
+
type XMLReaderFunc = (xmlElement: any, children: any[]) => any | any[] | false;
|
|
9
9
|
/**
|
|
10
10
|
* XML Writer function type - converts Lexical node to XML string
|
|
11
11
|
*/
|
|
@@ -90,4 +90,4 @@ declare class LitexmlService implements ILitexmlService {
|
|
|
90
90
|
hasXMLWriter(nodeType: string): boolean;
|
|
91
91
|
}
|
|
92
92
|
//#endregion
|
|
93
|
-
export { ILitexmlService, LitexmlService, XMLReaderFunc, XMLReaderRecord, XMLWriterFunc, XMLWriterRecord };
|
|
93
|
+
export { HandleChildrenResult, ILitexmlService, IWriterContext, IXmlNode, LitexmlService, XMLReaderFunc, XMLReaderRecord, XMLWriterFunc, XMLWriterRecord };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import "../../../types/index.js";
|
|
2
|
+
import "../service/shortcut.js";
|
|
1
3
|
import { HistoryStateEntry } from "@lexical/history";
|
|
2
|
-
import * as _$lexical from "lexical";
|
|
3
4
|
import { LexicalEditor } from "lexical";
|
|
4
|
-
|
|
5
5
|
//#region src/plugins/markdown/command/index.d.ts
|
|
6
|
-
declare const INSERT_MARKDOWN_COMMAND:
|
|
6
|
+
declare const INSERT_MARKDOWN_COMMAND: import("lexical").LexicalCommand<{
|
|
7
7
|
historyState: HistoryStateEntry | null;
|
|
8
8
|
markdown: string;
|
|
9
9
|
}>;
|
|
10
|
-
declare const GET_MARKDOWN_SELECTION_COMMAND:
|
|
10
|
+
declare const GET_MARKDOWN_SELECTION_COMMAND: import("lexical").LexicalCommand<{
|
|
11
11
|
onResult: (startLine: number, endLine: number) => void;
|
|
12
12
|
}>;
|
|
13
13
|
//#endregion
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { IElementNode } from "../../../../editor-kernel/inode/i-element-node.js";
|
|
2
2
|
import { INode } from "../../../../editor-kernel/inode/i-node.js";
|
|
3
3
|
import { ITextNode } from "../../../../editor-kernel/inode/text-node.js";
|
|
4
|
+
import "../../../../editor-kernel/inode/index.js";
|
|
4
5
|
import { PhrasingContent, Root, RootContent } from "../../../../node_modules/.pnpm/@types_mdast@4.0.4/node_modules/@types/mdast/index.js";
|
|
5
|
-
|
|
6
6
|
//#region src/plugins/markdown/data-source/markdown/parse.d.ts
|
|
7
7
|
type MarkdownReadNode = INode | ITextNode | IElementNode;
|
|
8
8
|
type MarkdownNode = Root | RootContent | PhrasingContent;
|
|
9
9
|
type MarkdownReaderFunc<K> = (node: Extract<MarkdownNode, {
|
|
10
10
|
type: K;
|
|
11
11
|
}>, children: MarkdownReadNode[], index: number) => MarkdownReadNode | MarkdownReadNode[] | false;
|
|
12
|
-
type TransformerRecord = { [K in MarkdownNode['type']]?: MarkdownReaderFunc<K> | Array<MarkdownReaderFunc<K
|
|
12
|
+
type TransformerRecord = { [K in MarkdownNode['type']]?: MarkdownReaderFunc<K> | Array<MarkdownReaderFunc<K>>; };
|
|
13
13
|
//#endregion
|
|
14
|
-
export { MarkdownReaderFunc, TransformerRecord };
|
|
14
|
+
export { MarkdownNode, MarkdownReadNode, MarkdownReaderFunc, TransformerRecord };
|
|
@@ -6,7 +6,7 @@ import remarkGfm from "remark-gfm";
|
|
|
6
6
|
import remarkMath from "remark-math";
|
|
7
7
|
//#region src/plugins/markdown/data-source/markdown/parse.ts
|
|
8
8
|
init_helper();
|
|
9
|
-
const selfClosingHtmlTags = new Set([
|
|
9
|
+
const selfClosingHtmlTags = /* @__PURE__ */ new Set([
|
|
10
10
|
"area",
|
|
11
11
|
"base",
|
|
12
12
|
"br",
|
|
@@ -64,7 +64,7 @@ function convertMdastToLexical(node, index, ctx, markdownReaders = {}, parentTyp
|
|
|
64
64
|
if (!markdownReaders[node.type]) return createFallbackRawNode(node, ctx, parentType);
|
|
65
65
|
let children = [];
|
|
66
66
|
if ("children" in node && Array.isArray(node.children)) {
|
|
67
|
-
|
|
67
|
+
const htmlStack = [];
|
|
68
68
|
children = node.children.reduce((ret, child, index) => {
|
|
69
69
|
if (child.type === "html") {
|
|
70
70
|
if (!markdownReaders["html"]) {
|
|
@@ -52,7 +52,7 @@ var MarkdownDataSource = class extends DataSource {
|
|
|
52
52
|
const firstNode = selectedNodes[0];
|
|
53
53
|
const lastNode = selectedNodes[lastIndex];
|
|
54
54
|
const [anchorOffset, focusOffset] = $getCharacterOffsets(selection);
|
|
55
|
-
|
|
55
|
+
const lastElement = [];
|
|
56
56
|
const rootNodes = [];
|
|
57
57
|
for (let i = 0; i < selectedNodes.length; i++) {
|
|
58
58
|
const node = selectedNodes[i];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IMarkdownShortCutService, MARKDOWN_READER_LEVEL, MARKDOWN_READER_LEVEL_HIGH, MARKDOWN_READER_LEVEL_NORMAL, MARKDOWN_WRITER_LEVEL_MAX } from "./service/shortcut.js";
|
|
2
2
|
import { GET_MARKDOWN_SELECTION_COMMAND, INSERT_MARKDOWN_COMMAND } from "./command/index.js";
|
|
3
3
|
import { MarkdownPlugin } from "./plugin/index.js";
|
|
4
|
-
import
|
|
4
|
+
import ReactMarkdownPlugin from "./react/index.js";
|
|
5
5
|
import { isPunctuationChar } from "./utils/index.js";
|
|
6
6
|
import { detectCodeLanguage, detectLanguage } from "./utils/detectLanguage.js";
|
|
7
|
-
import { isPureUrl, isValidUrl } from "../../utils/url.js";
|
|
7
|
+
import { isPureUrl, isValidUrl } from "../../utils/url.js";
|
|
8
|
+
export { GET_MARKDOWN_SELECTION_COMMAND, IMarkdownShortCutService, INSERT_MARKDOWN_COMMAND, type MARKDOWN_READER_LEVEL, MARKDOWN_READER_LEVEL_HIGH, MARKDOWN_READER_LEVEL_NORMAL, MARKDOWN_WRITER_LEVEL_MAX, MarkdownPlugin, ReactMarkdownPlugin, detectCodeLanguage, detectLanguage, isPunctuationChar };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IEditorPluginConstructor } from "../../../types/kernel.js";
|
|
2
|
+
import "../../../types/index.js";
|
|
2
3
|
//#region src/plugins/markdown/plugin/index.d.ts
|
|
3
4
|
interface MarkdownPluginOptions {
|
|
4
5
|
/**
|
|
@@ -19,4 +20,4 @@ interface MarkdownPluginOptions {
|
|
|
19
20
|
}
|
|
20
21
|
declare const MarkdownPlugin: IEditorPluginConstructor<MarkdownPluginOptions>;
|
|
21
22
|
//#endregion
|
|
22
|
-
export { MarkdownPlugin };
|
|
23
|
+
export { MarkdownPlugin, MarkdownPluginOptions };
|