@lobehub/editor 4.22.0 → 4.23.0
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/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
|
@@ -3,7 +3,14 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __esmMin = (fn, res) => () =>
|
|
6
|
+
var __esmMin = (fn, res, err) => () => {
|
|
7
|
+
if (err) throw err[0];
|
|
8
|
+
try {
|
|
9
|
+
return fn && (res = fn(fn = 0)), res;
|
|
10
|
+
} catch (e) {
|
|
11
|
+
throw err = [e], e;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
7
14
|
var __exportAll = (all, no_symbols) => {
|
|
8
15
|
let target = {};
|
|
9
16
|
for (var name in all) __defProp(target, name, {
|
package/es/codemirror/types.d.ts
CHANGED
package/es/common/sys.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LexicalEditor } from "lexical";
|
|
2
|
-
|
|
3
2
|
//#region src/editor-kernel/data-source.d.ts
|
|
4
3
|
interface IWriteOptions {
|
|
5
4
|
selection?: boolean;
|
|
@@ -12,4 +11,4 @@ declare class DataSource {
|
|
|
12
11
|
write(editor: LexicalEditor, options?: IWriteOptions): any;
|
|
13
12
|
}
|
|
14
13
|
//#endregion
|
|
15
|
-
export {
|
|
14
|
+
export { IWriteOptions, DataSource as default };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as _$lexical from "lexical";
|
|
2
1
|
import { LexicalEditor } from "lexical";
|
|
3
|
-
|
|
4
2
|
//#region src/editor-kernel/event.d.ts
|
|
5
|
-
declare const HOVER_COMMAND:
|
|
3
|
+
declare const HOVER_COMMAND: import("lexical").LexicalCommand<MouseEvent>;
|
|
6
4
|
//#endregion
|
|
7
5
|
export { HOVER_COMMAND };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import DataSource from "./data-source.js";
|
|
2
|
+
import "../types/index.js";
|
|
2
3
|
import { $closest, $closestNodeType, $getNearestNodeFromDOMNode as $getNearestNodeFromDOMNode$1, $getNodeFromDOMNode, DOM_DOCUMENT_FRAGMENT_TYPE, DOM_DOCUMENT_TYPE, DOM_ELEMENT_TYPE, DOM_TEXT_TYPE, EDITOR_THEME_KEY, assert, compareNodeOrder, createEmptyEditorState, genServiceId, generateEditorId, getKernelFromEditor, getKernelFromEditorConfig, getNodeKeyFromDOMNode, getParentElement, isDOMNode, isDocumentFragment, moment, noop, reconcileDecorator, registerEditorKernel, unregisterEditorKernel } from "./utils.js";
|
|
3
4
|
import { HOVER_COMMAND } from "./event.js";
|
|
4
5
|
import { resetRandomKey as resetRandomKey$1 } from "lexical";
|
|
5
|
-
export { resetRandomKey$1 as resetRandomKey };
|
|
6
|
+
export { $closest, $closestNodeType, $getNearestNodeFromDOMNode$1 as $getNearestNodeFromDOMNode, $getNodeFromDOMNode, DOM_DOCUMENT_FRAGMENT_TYPE, DOM_DOCUMENT_TYPE, DOM_ELEMENT_TYPE, DOM_TEXT_TYPE, DataSource, EDITOR_THEME_KEY, HOVER_COMMAND, assert, compareNodeOrder, createEmptyEditorState, genServiceId, generateEditorId, getKernelFromEditor, getKernelFromEditorConfig, getNodeKeyFromDOMNode, getParentElement, isDOMNode, isDocumentFragment, moment, noop, reconcileDecorator, registerEditorKernel, resetRandomKey$1 as resetRandomKey, unregisterEditorKernel };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { init_event } from "./event.js";
|
|
2
|
-
import { init_utils } from "./utils.js";
|
|
1
|
+
import { HOVER_COMMAND, init_event } from "./event.js";
|
|
2
|
+
import { $closest, $closestNodeType, $getNearestNodeFromDOMNode as $getNearestNodeFromDOMNode$1, $getNodeFromDOMNode, DOM_DOCUMENT_FRAGMENT_TYPE, DOM_DOCUMENT_TYPE, DOM_ELEMENT_TYPE, DOM_TEXT_TYPE, EDITOR_THEME_KEY, assert, compareNodeOrder, createEmptyEditorState, genServiceId, generateEditorId, getKernelFromEditor, getKernelFromEditorConfig, getNodeKeyFromDOMNode, getParentElement, init_utils, isDOMNode, isDocumentFragment, moment, noop, reconcileDecorator, registerEditorKernel, unregisterEditorKernel } from "./utils.js";
|
|
3
3
|
import { Kernel, init_kernel } from "./kernel.js";
|
|
4
|
-
import "./data-source.js";
|
|
4
|
+
import DataSource from "./data-source.js";
|
|
5
5
|
import { resetRandomKey as resetRandomKey$1 } from "lexical";
|
|
6
6
|
//#region src/editor-kernel/index.ts
|
|
7
7
|
init_kernel();
|
|
@@ -14,4 +14,4 @@ const Editor = { createEditor() {
|
|
|
14
14
|
return new Kernel();
|
|
15
15
|
} };
|
|
16
16
|
//#endregion
|
|
17
|
-
export { Editor as default, resetRandomKey$1 as resetRandomKey };
|
|
17
|
+
export { $closest, $closestNodeType, $getNearestNodeFromDOMNode$1 as $getNearestNodeFromDOMNode, $getNodeFromDOMNode, DOM_DOCUMENT_FRAGMENT_TYPE, DOM_DOCUMENT_TYPE, DOM_ELEMENT_TYPE, DOM_TEXT_TYPE, DataSource, EDITOR_THEME_KEY, HOVER_COMMAND, assert, compareNodeOrder, createEmptyEditorState, Editor as default, genServiceId, generateEditorId, getKernelFromEditor, getKernelFromEditorConfig, getNodeKeyFromDOMNode, getParentElement, isDOMNode, isDocumentFragment, moment, noop, reconcileDecorator, registerEditorKernel, resetRandomKey$1 as resetRandomKey, unregisterEditorKernel };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { IElementNode } from "./i-element-node.js";
|
|
2
2
|
import { INode } from "./i-node.js";
|
|
3
|
+
import "./paragraph-node.js";
|
|
3
4
|
import { IRootNode } from "./root-node.js";
|
|
4
|
-
import { ITextNode } from "./text-node.js";
|
|
5
|
+
import { ITextNode } from "./text-node.js";
|
|
6
|
+
export { IElementNode, INode, IRootNode, ITextNode };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import "./i-element-node.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import DataSource from "./data-source.js";
|
|
2
2
|
import { HotkeyId } from "../types/hotkey.js";
|
|
3
3
|
import { HotkeyOptions, HotkeysEvent } from "../utils/hotkey/registerHotkey.js";
|
|
4
4
|
import { ILocaleKeys } from "../types/locale.js";
|
|
@@ -6,7 +6,6 @@ import { IBeforeEditorInitLifecycle, IDecorator, IDocumentOptions, IEditor, IEdi
|
|
|
6
6
|
import { HistoryState } from "@lexical/history";
|
|
7
7
|
import EventEmitter from "eventemitter3";
|
|
8
8
|
import { CommandListener, CommandListenerPriority, CommandPayloadType, LexicalCommand, LexicalEditor, LexicalNodeConfig } from "lexical";
|
|
9
|
-
|
|
10
9
|
//#region src/editor-kernel/kernel.d.ts
|
|
11
10
|
declare class Kernel extends EventEmitter implements IEditorKernel {
|
|
12
11
|
private static globalHotReloadMode;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { JSX } from "react";
|
|
2
|
-
|
|
3
2
|
//#region src/editor-kernel/react/LexicalErrorBoundary.d.ts
|
|
4
3
|
type LexicalErrorBoundaryProps = {
|
|
5
4
|
children: JSX.Element;
|
|
6
5
|
onError: (error: unknown) => void;
|
|
7
6
|
};
|
|
8
|
-
declare function LexicalErrorBoundary({
|
|
9
|
-
children,
|
|
10
|
-
onError
|
|
11
|
-
}: LexicalErrorBoundaryProps): JSX.Element;
|
|
7
|
+
declare function LexicalErrorBoundary({ children, onError }: LexicalErrorBoundaryProps): JSX.Element;
|
|
12
8
|
//#endregion
|
|
13
|
-
export { LexicalErrorBoundary };
|
|
9
|
+
export { LexicalErrorBoundary, LexicalErrorBoundaryProps };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { LexicalEditor, LexicalNode } from "lexical";
|
|
3
|
-
|
|
4
3
|
//#region src/editor-kernel/react/PortalContainer.d.ts
|
|
5
4
|
interface PortalContainerProps {
|
|
6
5
|
children: React.ReactNode;
|
|
@@ -9,6 +8,11 @@ interface PortalContainerProps {
|
|
|
9
8
|
node: LexicalNode;
|
|
10
9
|
style?: React.CSSProperties;
|
|
11
10
|
}
|
|
12
|
-
declare const LexicalPortalContainer:
|
|
11
|
+
declare const LexicalPortalContainer: {
|
|
12
|
+
({ ref, editor, node, children }: PortalContainerProps & {
|
|
13
|
+
ref?: React.RefObject<HTMLDivElement | null | null>;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
13
17
|
//#endregion
|
|
14
|
-
export { LexicalPortalContainer };
|
|
18
|
+
export { LexicalPortalContainer, LexicalPortalContainer as default, PortalContainerProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useImperativeHandle, useRef } from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/editor-kernel/react/PortalContainer.tsx
|
|
4
|
-
const LexicalPortalContainer =
|
|
4
|
+
const LexicalPortalContainer = ({ ref, editor, node, children }) => {
|
|
5
5
|
const divRef = useRef(null);
|
|
6
6
|
useImperativeHandle(ref, () => divRef.current, []);
|
|
7
7
|
useEffect(() => {
|
|
@@ -19,7 +19,7 @@ const LexicalPortalContainer = forwardRef(({ editor, node, children }, ref) => {
|
|
|
19
19
|
},
|
|
20
20
|
children
|
|
21
21
|
});
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
LexicalPortalContainer.displayName = "LexicalPortalContainer";
|
|
24
24
|
//#endregion
|
|
25
|
-
export { LexicalPortalContainer as default };
|
|
25
|
+
export { LexicalPortalContainer, LexicalPortalContainer as default };
|
|
@@ -2,4 +2,5 @@ import { LexicalErrorBoundary } from "./LexicalErrorBoundary.js";
|
|
|
2
2
|
import { LexicalPortalContainer } from "./PortalContainer.js";
|
|
3
3
|
import { useLexicalComposerContext } from "./react-context.js";
|
|
4
4
|
import { ReactEditor } from "./react-editor.js";
|
|
5
|
-
import { useLexicalEditor } from "./useLexicalEditor.js";
|
|
5
|
+
import { useLexicalEditor } from "./useLexicalEditor.js";
|
|
6
|
+
export { LexicalErrorBoundary, LexicalPortalContainer, ReactEditor, useLexicalComposerContext, useLexicalEditor };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IEditor } from "../../types/kernel.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import "react";
|
|
2
4
|
import { EditorThemeClasses } from "lexical";
|
|
3
|
-
|
|
4
5
|
//#region src/editor-kernel/react/react-context.d.ts
|
|
5
6
|
type LexicalComposerContextType = {
|
|
6
7
|
getTheme: () => EditorThemeClasses | null | undefined;
|
|
@@ -8,4 +9,4 @@ type LexicalComposerContextType = {
|
|
|
8
9
|
type LexicalComposerContextWithEditor = [IEditor, LexicalComposerContextType];
|
|
9
10
|
declare function useLexicalComposerContext(): LexicalComposerContextWithEditor;
|
|
10
11
|
//#endregion
|
|
11
|
-
export { useLexicalComposerContext };
|
|
12
|
+
export { LexicalComposerContextType, LexicalComposerContextWithEditor, useLexicalComposerContext };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IEditor } from "../../types/kernel.js";
|
|
2
|
+
import "../../types/index.js";
|
|
2
3
|
import { FC, ReactNode } from "react";
|
|
3
|
-
|
|
4
4
|
//#region src/editor-kernel/react/react-editor.d.ts
|
|
5
5
|
interface IReactEditorProps {
|
|
6
6
|
children?: ReactNode | undefined;
|
|
@@ -13,4 +13,4 @@ interface IReactEditorProps {
|
|
|
13
13
|
}
|
|
14
14
|
declare const ReactEditor: FC<IReactEditorProps>;
|
|
15
15
|
//#endregion
|
|
16
|
-
export { ReactEditor };
|
|
16
|
+
export { IReactEditorProps, ReactEditor };
|
|
@@ -7,9 +7,10 @@ const useLayoutEffectImpl = CAN_USE_DOM ? useLayoutEffect : useEffect;
|
|
|
7
7
|
function useDecorators(editor, ErrorBoundary) {
|
|
8
8
|
const [decorators, setDecorators] = useState(() => editor.getLexicalEditor()?.getDecorators() || {});
|
|
9
9
|
useLayoutEffectImpl(() => {
|
|
10
|
-
|
|
10
|
+
const clears = [];
|
|
11
11
|
const handleInit = (editor) => {
|
|
12
|
-
|
|
12
|
+
const initialDecorators = editor.getDecorators();
|
|
13
|
+
setDecorators(initialDecorators);
|
|
13
14
|
clears.push(editor.registerDecoratorListener((nextDecorators) => {
|
|
14
15
|
flushSync(() => {
|
|
15
16
|
setDecorators(nextDecorators);
|
|
@@ -4,7 +4,7 @@ import { useEffect } from "react";
|
|
|
4
4
|
function useLexicalEditor(handleEditor, deps = []) {
|
|
5
5
|
const [editor] = useLexicalComposerContext();
|
|
6
6
|
useEffect(() => {
|
|
7
|
-
|
|
7
|
+
const lexicalEditor = editor.getLexicalEditor();
|
|
8
8
|
if (lexicalEditor) return handleEditor(lexicalEditor);
|
|
9
9
|
else {
|
|
10
10
|
let remove = void 0;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IEditorKernel, IServiceID } from "../types/kernel.js";
|
|
2
|
-
import
|
|
2
|
+
import "../types/index.js";
|
|
3
3
|
import { EditorConfig, ElementNode, LexicalEditor, LexicalNode, NodeKey } from "lexical";
|
|
4
|
-
|
|
5
4
|
//#region src/editor-kernel/utils.d.ts
|
|
6
5
|
declare const DOM_ELEMENT_TYPE = 1;
|
|
7
6
|
declare const DOM_TEXT_TYPE = 3;
|
|
@@ -9,7 +8,7 @@ declare const DOM_DOCUMENT_TYPE = 9;
|
|
|
9
8
|
declare const DOM_DOCUMENT_FRAGMENT_TYPE = 11;
|
|
10
9
|
declare function genServiceId<T>(name: string): IServiceID<T>;
|
|
11
10
|
declare const noop: () => void;
|
|
12
|
-
declare function createEmptyEditorState():
|
|
11
|
+
declare function createEmptyEditorState(): import("lexical").EditorState;
|
|
13
12
|
declare function assert(cond?: boolean, message?: string): asserts cond;
|
|
14
13
|
declare function getNodeKeyFromDOMNode(dom: Node, editor: LexicalEditor): NodeKey | undefined;
|
|
15
14
|
declare function $getNodeFromDOMNode(dom: Node, editor: LexicalEditor, editorState?: ReturnType<LexicalEditor['getEditorState']>): LexicalNode | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/headless/extract-media-from-editor-state.ts
|
|
2
|
-
const IMAGE_TYPES = new Set(["image", "block-image"]);
|
|
2
|
+
const IMAGE_TYPES = /* @__PURE__ */ new Set(["image", "block-image"]);
|
|
3
3
|
const FILE_TYPE = "file";
|
|
4
4
|
const generateId = () => {
|
|
5
5
|
if (typeof globalThis.crypto?.randomUUID === "function") return globalThis.crypto.randomUUID();
|
package/es/headless/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IDocumentOptions, IEditor, IPlugin } from "../types/kernel.js";
|
|
2
|
+
import "../types/index.js";
|
|
2
3
|
import { LITEXML_MODIFY_COMMAND } from "../plugins/litexml/command/symbols.js";
|
|
4
|
+
import "../plugins/litexml/command/index.js";
|
|
3
5
|
import { FileListItem, ImageListItem, MediaLists, extractMediaFromEditorState } from "./extract-media-from-editor-state.js";
|
|
4
6
|
import { CommandPayloadType, SerializedEditorState, SerializedLexicalNode } from "lexical";
|
|
5
|
-
|
|
6
7
|
//#region src/headless/index.d.ts
|
|
7
8
|
type HeadlessDocumentType = 'json' | 'litexml' | 'markdown' | (string & object);
|
|
8
9
|
interface HeadlessEditorHydrationInput {
|
|
@@ -66,4 +67,4 @@ declare class HeadlessEditor {
|
|
|
66
67
|
}
|
|
67
68
|
declare function createHeadlessEditor(options?: HeadlessEditorOptions): HeadlessEditor;
|
|
68
69
|
//#endregion
|
|
69
|
-
export { DEFAULT_HEADLESS_EDITOR_PLUGINS, HeadlessDocumentType, HeadlessEditor, HeadlessEditorExport, HeadlessEditorExportOptions, HeadlessEditorHydrationInput, HeadlessEditorOptions, HeadlessLiteXMLBatchOperation, HeadlessLiteXMLInsertOperation, HeadlessLiteXMLOperation, HeadlessLiteXMLRemoveOperation, HeadlessLiteXMLReplaceOperation, createHeadlessEditor };
|
|
70
|
+
export { DEFAULT_HEADLESS_EDITOR_PLUGINS, type FileListItem, HeadlessDocumentType, HeadlessEditor, HeadlessEditorExport, HeadlessEditorExportOptions, HeadlessEditorHydrationInput, HeadlessEditorOptions, HeadlessLiteXMLBatchOperation, HeadlessLiteXMLInsertOperation, HeadlessLiteXMLOperation, HeadlessLiteXMLRemoveOperation, HeadlessLiteXMLReplaceOperation, type ImageListItem, type MediaLists, createHeadlessEditor, extractMediaFromEditorState };
|
package/es/headless/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { moment } from "../editor-kernel/utils.js";
|
|
1
|
+
import { init_utils, moment } from "../editor-kernel/utils.js";
|
|
2
2
|
import Editor from "../editor-kernel/index.js";
|
|
3
3
|
import { LITEXML_APPLY_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND } from "../plugins/litexml/command/symbols.js";
|
|
4
4
|
import { INodePlugin } from "../plugins/inode/plugin/index.js";
|
|
@@ -15,8 +15,9 @@ import { ListPlugin } from "../plugins/list/plugin/index.js";
|
|
|
15
15
|
import { MathPlugin } from "../plugins/math/plugin/index.js";
|
|
16
16
|
import { MentionPlugin } from "../plugins/mention/plugin/index.js";
|
|
17
17
|
import { TablePlugin } from "../plugins/table/plugin/index.js";
|
|
18
|
-
import "./extract-media-from-editor-state.js";
|
|
18
|
+
import { extractMediaFromEditorState } from "./extract-media-from-editor-state.js";
|
|
19
19
|
//#region src/headless/index.ts
|
|
20
|
+
init_utils();
|
|
20
21
|
const getNumericId = (id) => {
|
|
21
22
|
if (typeof id !== "number" && typeof id !== "string") return null;
|
|
22
23
|
const numericId = Number(id);
|
|
@@ -196,4 +197,4 @@ function createHeadlessEditor(options) {
|
|
|
196
197
|
return new HeadlessEditor(options);
|
|
197
198
|
}
|
|
198
199
|
//#endregion
|
|
199
|
-
export { DEFAULT_HEADLESS_EDITOR_PLUGINS, HeadlessEditor, createHeadlessEditor };
|
|
200
|
+
export { DEFAULT_HEADLESS_EDITOR_PLUGINS, HeadlessEditor, createHeadlessEditor, extractMediaFromEditorState };
|
package/es/headless.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { o as LITEXML_MODIFY_COMMAND } from "./symbols-
|
|
1
|
+
import { o as LITEXML_MODIFY_COMMAND } from "./symbols-Do7jD4Tt.js";
|
|
2
2
|
import { HistoryState, HistoryStateEntry } from "@lexical/history";
|
|
3
3
|
import { CommandListener, CommandListenerPriority, CommandPayloadType, EditorState, ElementNode, LexicalCommand, LexicalEditor, LexicalNode, LexicalNodeConfig, SerializedEditorState, SerializedLexicalNode } from "lexical";
|
|
4
|
-
|
|
5
4
|
//#region src/editor-kernel/data-source.d.ts
|
|
6
5
|
interface IWriteOptions {
|
|
7
6
|
selection?: boolean;
|
|
@@ -120,7 +119,7 @@ declare const _default: {
|
|
|
120
119
|
* Internationalization key type declaration, plugins can extend through declaration merging
|
|
121
120
|
*/
|
|
122
121
|
type LocaleType = typeof _default;
|
|
123
|
-
type FlattenKeys<T, Prefix extends string = ''> = { [K in keyof T & string]: T[K] extends string ? Prefix extends '' ? K : `${Prefix}.${K}` : T[K] extends Record<string, any> ? FlattenKeys<T[K], Prefix extends '' ? K : `${Prefix}.${K}`> : never }[keyof T & string];
|
|
122
|
+
type FlattenKeys<T, Prefix extends string = ''> = { [K in keyof T & string]: T[K] extends string ? Prefix extends '' ? K : `${Prefix}.${K}` : T[K] extends Record<string, any> ? FlattenKeys<T[K], Prefix extends '' ? K : `${Prefix}.${K}`> : never; }[keyof T & string];
|
|
124
123
|
type ILocaleKeys = Record<FlattenKeys<LocaleType>, string>;
|
|
125
124
|
//#endregion
|
|
126
125
|
//#region src/types/kernel.d.ts
|
package/es/headless.js
CHANGED
|
@@ -524,24 +524,8 @@ const HOTKEYS_REGISTRATION = [
|
|
|
524
524
|
}
|
|
525
525
|
];
|
|
526
526
|
//#endregion
|
|
527
|
-
//#region src/common/sys.ts
|
|
528
|
-
const nodeDetect = () => {
|
|
529
|
-
return typeof process !== "undefined" && process.versions && !!process.versions.node;
|
|
530
|
-
};
|
|
531
|
-
const browserDetect = () => {
|
|
532
|
-
return typeof window !== "undefined" && window.document !== void 0;
|
|
533
|
-
};
|
|
534
|
-
const isNode = nodeDetect();
|
|
535
|
-
const isBrowser = browserDetect();
|
|
536
|
-
const macOSDetect = () => {
|
|
537
|
-
if (isNode) return process.platform === "darwin";
|
|
538
|
-
if (isBrowser) return window.navigator.platform.includes("Mac");
|
|
539
|
-
return false;
|
|
540
|
-
};
|
|
541
|
-
macOSDetect();
|
|
542
|
-
//#endregion
|
|
543
527
|
//#region src/utils/hotkey/parseHotkeys.ts
|
|
544
|
-
const reservedModifierKeywords = new Set([
|
|
528
|
+
const reservedModifierKeywords = /* @__PURE__ */ new Set([
|
|
545
529
|
"shift",
|
|
546
530
|
"alt",
|
|
547
531
|
"meta",
|
|
@@ -2398,12 +2382,14 @@ var LitexmlDataSource = class extends DataSource {
|
|
|
2398
2382
|
}
|
|
2399
2383
|
case "ul":
|
|
2400
2384
|
case "ol":
|
|
2401
|
-
xmlElement.
|
|
2385
|
+
Array.from(xmlElement.childNodes).forEach((child) => {
|
|
2386
|
+
if (child.nodeType !== 1) return;
|
|
2387
|
+
if (String(child.tagName).toLowerCase() !== "li") return;
|
|
2402
2388
|
const listItem = INodeHelper.createElementNode("listitem", {
|
|
2403
2389
|
children: [],
|
|
2404
2390
|
value: 1
|
|
2405
2391
|
});
|
|
2406
|
-
this.processXMLChildren(
|
|
2392
|
+
this.processXMLChildren(child, listItem);
|
|
2407
2393
|
INodeHelper.appendChild(parentNode, listItem);
|
|
2408
2394
|
});
|
|
2409
2395
|
break;
|
|
@@ -2517,7 +2503,7 @@ var LitexmlDataSource = class extends DataSource {
|
|
|
2517
2503
|
const logger$5 = createDebugLogger("plugin", "markdown");
|
|
2518
2504
|
//#endregion
|
|
2519
2505
|
//#region src/plugins/markdown/data-source/markdown/parse.ts
|
|
2520
|
-
const selfClosingHtmlTags = new Set([
|
|
2506
|
+
const selfClosingHtmlTags = /* @__PURE__ */ new Set([
|
|
2521
2507
|
"area",
|
|
2522
2508
|
"base",
|
|
2523
2509
|
"br",
|
|
@@ -2575,7 +2561,7 @@ function convertMdastToLexical(node, index, ctx, markdownReaders = {}, parentTyp
|
|
|
2575
2561
|
if (!markdownReaders[node.type]) return createFallbackRawNode(node, ctx, parentType);
|
|
2576
2562
|
let children = [];
|
|
2577
2563
|
if ("children" in node && Array.isArray(node.children)) {
|
|
2578
|
-
|
|
2564
|
+
const htmlStack = [];
|
|
2579
2565
|
children = node.children.reduce((ret, child, index) => {
|
|
2580
2566
|
if (child.type === "html") {
|
|
2581
2567
|
if (!markdownReaders["html"]) {
|
|
@@ -2992,7 +2978,7 @@ var MarkdownDataSource = class extends DataSource {
|
|
|
2992
2978
|
const firstNode = selectedNodes[0];
|
|
2993
2979
|
const lastNode = selectedNodes[lastIndex];
|
|
2994
2980
|
const [anchorOffset, focusOffset] = $getCharacterOffsets(selection);
|
|
2995
|
-
|
|
2981
|
+
const lastElement = [];
|
|
2996
2982
|
const rootNodes = [];
|
|
2997
2983
|
for (let i = 0; i < selectedNodes.length; i++) {
|
|
2998
2984
|
const node = selectedNodes[i];
|
|
@@ -3967,7 +3953,7 @@ var JSONDataSource = class extends DataSource {
|
|
|
3967
3953
|
const firstNode = selectedNodes[0];
|
|
3968
3954
|
const lastNode = selectedNodes[lastIndex];
|
|
3969
3955
|
const [anchorOffset, focusOffset] = $getCharacterOffsets(selection);
|
|
3970
|
-
|
|
3956
|
+
const lastElement = [];
|
|
3971
3957
|
const rootNodes = [];
|
|
3972
3958
|
for (let i = 0; i < selectedNodes.length; i++) {
|
|
3973
3959
|
const node = selectedNodes[i];
|
|
@@ -4671,7 +4657,7 @@ function registerRichKeydown(editor, kernel, options) {
|
|
|
4671
4657
|
return false;
|
|
4672
4658
|
}, COMMAND_PRIORITY_EDITOR));
|
|
4673
4659
|
}
|
|
4674
|
-
const NEEDS_FOLLOWING_PARAGRAPH_TYPES = new Set([
|
|
4660
|
+
const NEEDS_FOLLOWING_PARAGRAPH_TYPES = /* @__PURE__ */ new Set([
|
|
4675
4661
|
"code",
|
|
4676
4662
|
"table",
|
|
4677
4663
|
"block-image"
|
|
@@ -6757,7 +6743,7 @@ const ImagePlugin = class extends KernelPlugin {
|
|
|
6757
6743
|
//#endregion
|
|
6758
6744
|
//#region src/plugins/link/node/LinkNode.ts
|
|
6759
6745
|
const logger = createDebugLogger("plugin", "link");
|
|
6760
|
-
const SUPPORTED_URL_PROTOCOLS$1 = new Set([
|
|
6746
|
+
const SUPPORTED_URL_PROTOCOLS$1 = /* @__PURE__ */ new Set([
|
|
6761
6747
|
"http:",
|
|
6762
6748
|
"https:",
|
|
6763
6749
|
"mailto:",
|
|
@@ -7242,7 +7228,7 @@ var LinkService = class extends EventEmitter {
|
|
|
7242
7228
|
};
|
|
7243
7229
|
//#endregion
|
|
7244
7230
|
//#region src/plugins/link/utils/index.ts
|
|
7245
|
-
const SUPPORTED_URL_PROTOCOLS = new Set([
|
|
7231
|
+
const SUPPORTED_URL_PROTOCOLS = /* @__PURE__ */ new Set([
|
|
7246
7232
|
"http:",
|
|
7247
7233
|
"https:",
|
|
7248
7234
|
"mailto:",
|
|
@@ -7290,7 +7276,8 @@ function registerLinkCommands(editor, kernel, options) {
|
|
|
7290
7276
|
if (!selection) return;
|
|
7291
7277
|
if ($isRangeSelection(selection)) editor.getEditorState().read(() => {
|
|
7292
7278
|
const node = getSelectedNode(selection);
|
|
7293
|
-
|
|
7279
|
+
const isLink = $isLinkNode(node.getParent()) || $isLinkNode(node);
|
|
7280
|
+
state.isLink = isLink;
|
|
7294
7281
|
});
|
|
7295
7282
|
else state.isLink = false;
|
|
7296
7283
|
}), editor.registerCommand(TOGGLE_LINK_COMMAND, (payload) => {
|
|
@@ -7508,13 +7495,6 @@ function $indentOverTab(selection) {
|
|
|
7508
7495
|
}
|
|
7509
7496
|
//#endregion
|
|
7510
7497
|
//#region src/plugins/list/plugin/checkList.ts
|
|
7511
|
-
/**
|
|
7512
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7513
|
-
*
|
|
7514
|
-
* This source code is licensed under the MIT license found in the
|
|
7515
|
-
* LICENSE file in the root directory of this source tree.
|
|
7516
|
-
*
|
|
7517
|
-
*/
|
|
7518
7498
|
const INSERT_CHECK_LIST_COMMAND = createCommand("INSERT_CHECK_LIST_COMMAND");
|
|
7519
7499
|
function isHeadlessEditor$1(editor) {
|
|
7520
7500
|
return editor._headless === true;
|
|
@@ -8552,7 +8532,7 @@ const $selectTableRows = (tableNode, from, to) => {
|
|
|
8552
8532
|
const firstRow = tableMap[from];
|
|
8553
8533
|
const lastRow = tableMap[to];
|
|
8554
8534
|
const firstCell = firstRow?.[0]?.cell;
|
|
8555
|
-
const lastCell = lastRow?.
|
|
8535
|
+
const lastCell = lastRow?.at(-1)?.cell;
|
|
8556
8536
|
if (!firstCell || !lastCell) return false;
|
|
8557
8537
|
const tableSelection = $createTableSelection();
|
|
8558
8538
|
tableSelection.set(tableNode.getKey(), firstCell.getKey(), lastCell.getKey());
|
|
@@ -8624,7 +8604,7 @@ function registerTableCommand(editor) {
|
|
|
8624
8604
|
const [tableMap] = $computeTableMapSkipCellCheck(tableNode, null, null);
|
|
8625
8605
|
const row = tableMap[rowIndex];
|
|
8626
8606
|
const firstCell = row?.[0]?.cell;
|
|
8627
|
-
const lastCell = row?.
|
|
8607
|
+
const lastCell = row?.at(-1)?.cell;
|
|
8628
8608
|
if (!firstCell || !lastCell) return false;
|
|
8629
8609
|
const tableSelection = $createTableSelection();
|
|
8630
8610
|
tableSelection.set(table, firstCell.getKey(), lastCell.getKey());
|
|
@@ -8714,7 +8694,7 @@ function registerTableCommand(editor) {
|
|
|
8714
8694
|
const firstRow = tableMap[from];
|
|
8715
8695
|
const lastRow = tableMap[to];
|
|
8716
8696
|
const firstCell = firstRow?.[0]?.cell;
|
|
8717
|
-
const lastCell = lastRow?.
|
|
8697
|
+
const lastCell = lastRow?.at(-1)?.cell;
|
|
8718
8698
|
if (!firstCell || !lastCell) return false;
|
|
8719
8699
|
tableSelection.set(table, firstCell.getKey(), lastCell.getKey());
|
|
8720
8700
|
$setSelection(tableSelection);
|
|
@@ -8735,7 +8715,7 @@ function registerTableCommand(editor) {
|
|
|
8735
8715
|
const firstRow = tableMap[0];
|
|
8736
8716
|
const lastRow = tableMap.at(-1);
|
|
8737
8717
|
const firstCell = firstRow?.[0]?.cell;
|
|
8738
|
-
const lastCell = lastRow?.
|
|
8718
|
+
const lastCell = lastRow?.at(-1)?.cell;
|
|
8739
8719
|
if (!firstCell || !lastCell) return false;
|
|
8740
8720
|
tableSelection.set(table, firstCell.getKey(), lastCell.getKey());
|
|
8741
8721
|
$setSelection(tableSelection);
|
|
@@ -8988,8 +8968,7 @@ const TablePlugin = class extends KernelPlugin {
|
|
|
8988
8968
|
if (!$isTableNode(node)) return false;
|
|
8989
8969
|
const [tableMap] = $computeTableMapSkipCellCheck(node, null, null);
|
|
8990
8970
|
const firstCell = tableMap[0]?.[0]?.cell;
|
|
8991
|
-
const
|
|
8992
|
-
const lastCell = lastRow?.[lastRow.length - 1]?.cell;
|
|
8971
|
+
const lastCell = [...tableMap].reverse().find((row) => row.length > 0)?.at(-1)?.cell;
|
|
8993
8972
|
if (!firstCell || !lastCell) return false;
|
|
8994
8973
|
const tableSelection = $createTableSelection();
|
|
8995
8974
|
tableSelection.set(node.getKey(), firstCell.getKey(), lastCell.getKey());
|
|
@@ -9263,7 +9242,7 @@ const TablePlugin = class extends KernelPlugin {
|
|
|
9263
9242
|
};
|
|
9264
9243
|
//#endregion
|
|
9265
9244
|
//#region src/headless/extract-media-from-editor-state.ts
|
|
9266
|
-
const IMAGE_TYPES = new Set(["image", "block-image"]);
|
|
9245
|
+
const IMAGE_TYPES = /* @__PURE__ */ new Set(["image", "block-image"]);
|
|
9267
9246
|
const FILE_TYPE = "file";
|
|
9268
9247
|
const generateId = () => {
|
|
9269
9248
|
if (typeof globalThis.crypto?.randomUUID === "function") return globalThis.crypto.randomUUID();
|