@lobehub/editor 3.3.2 → 3.4.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.
Files changed (55) hide show
  1. package/es/editor-kernel/index.d.ts +1 -0
  2. package/es/editor-kernel/index.js +3 -1
  3. package/es/editor-kernel/kernel.js +1 -0
  4. package/es/editor-kernel/lexical/Lexical.dev.js +3052 -0
  5. package/es/editor-kernel/lexical/Lexical.dev.mjs +15365 -0
  6. package/es/editor-kernel/lexical/Lexical.js +7634 -0
  7. package/es/editor-kernel/lexical/Lexical.mjs +7258 -0
  8. package/es/editor-kernel/lexical/LexicalCommands.d.ts +175 -0
  9. package/es/editor-kernel/lexical/LexicalConstants.d.ts +54 -0
  10. package/es/editor-kernel/lexical/LexicalEditor.d.ts +672 -0
  11. package/es/editor-kernel/lexical/LexicalEditorState.d.ts +39 -0
  12. package/es/editor-kernel/lexical/LexicalEvents.d.ts +22 -0
  13. package/es/editor-kernel/lexical/LexicalGC.d.ts +23 -0
  14. package/es/editor-kernel/lexical/LexicalMutations.d.ts +12 -0
  15. package/es/editor-kernel/lexical/LexicalNode.d.ts +689 -0
  16. package/es/editor-kernel/lexical/LexicalNodeState.d.ts +569 -0
  17. package/es/editor-kernel/lexical/LexicalNormalization.d.ts +11 -0
  18. package/es/editor-kernel/lexical/LexicalReconciler.d.ts +28 -0
  19. package/es/editor-kernel/lexical/LexicalSelection.d.ts +368 -0
  20. package/es/editor-kernel/lexical/LexicalUpdateTags.d.ts +67 -0
  21. package/es/editor-kernel/lexical/LexicalUpdates.d.ts +72 -0
  22. package/es/editor-kernel/lexical/LexicalUtils.d.ts +492 -0
  23. package/es/editor-kernel/lexical/caret/LexicalCaret.d.ts +635 -0
  24. package/es/editor-kernel/lexical/caret/LexicalCaretUtils.d.ts +224 -0
  25. package/es/editor-kernel/lexical/extension-core/defineExtension.d.ts +126 -0
  26. package/es/editor-kernel/lexical/extension-core/index.d.ts +38 -0
  27. package/es/editor-kernel/lexical/extension-core/internal.d.ts +32 -0
  28. package/es/editor-kernel/lexical/extension-core/safeCast.d.ts +15 -0
  29. package/es/editor-kernel/lexical/extension-core/shallowMergeConfig.d.ts +20 -0
  30. package/es/editor-kernel/lexical/extension-core/types.d.ts +371 -0
  31. package/es/editor-kernel/lexical/index.d.ts +368 -0
  32. package/es/editor-kernel/lexical/nodes/ArtificialNode.d.ts +16 -0
  33. package/es/editor-kernel/lexical/nodes/LexicalDecoratorNode.d.ts +32 -0
  34. package/es/editor-kernel/lexical/nodes/LexicalElementNode.d.ts +235 -0
  35. package/es/editor-kernel/lexical/nodes/LexicalLineBreakNode.d.ts +30 -0
  36. package/es/editor-kernel/lexical/nodes/LexicalParagraphNode.d.ts +39 -0
  37. package/es/editor-kernel/lexical/nodes/LexicalRootNode.d.ts +35 -0
  38. package/es/editor-kernel/lexical/nodes/LexicalTabNode.d.ts +30 -0
  39. package/es/editor-kernel/lexical/nodes/LexicalTextNode.d.ts +311 -0
  40. package/es/plugins/common/data-source/json-data-source.js +29 -3
  41. package/es/plugins/common/react/ReactPlainText.js +9 -0
  42. package/es/plugins/common/utils/index.d.ts +2 -1
  43. package/es/plugins/common/utils/index.js +33 -0
  44. package/es/plugins/litexml/command/index.js +9 -1
  45. package/es/plugins/litexml/data-source/litexml-data-source.js +12 -2
  46. package/es/plugins/litexml/plugin/index.js +41 -3
  47. package/es/plugins/litexml/utils/index.d.ts +2 -1
  48. package/es/plugins/litexml/utils/index.js +7 -1
  49. package/es/plugins/markdown/data-source/markdown-data-source.js +6 -25
  50. package/es/plugins/markdown/data-source/markdown-writer-context.d.ts +5 -1
  51. package/es/plugins/markdown/data-source/markdown-writer-context.js +27 -2
  52. package/es/plugins/markdown/service/shortcut.d.ts +7 -0
  53. package/es/types/kernel.d.ts +4 -0
  54. package/package.json +8 -2
  55. package/scripts/patch-lexical.js +39 -0
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import type { LexicalEditor } from './LexicalEditor';
9
+ import type { NodeMap, SerializedLexicalNode } from './LexicalNode';
10
+ import type { BaseSelection } from './LexicalSelection';
11
+ import type { SerializedRootNode } from './nodes/LexicalRootNode';
12
+
13
+ export interface SerializedEditorState<T extends SerializedLexicalNode = SerializedLexicalNode> {
14
+ root: SerializedRootNode<T>;
15
+ }
16
+ export declare function editorStateHasDirtySelection(
17
+ editorState: EditorState,
18
+ editor: LexicalEditor,
19
+ ): boolean;
20
+ export declare function cloneEditorState(current: EditorState): EditorState;
21
+ export declare function createEmptyEditorState(): EditorState;
22
+ export interface EditorStateReadOptions {
23
+ editor?: LexicalEditor | null;
24
+ }
25
+ /**
26
+ * Type guard that returns true if the argument is an EditorState
27
+ */
28
+ export declare function $isEditorState(x: unknown): x is EditorState;
29
+ export declare class EditorState {
30
+ _nodeMap: NodeMap;
31
+ _selection: null | BaseSelection;
32
+ _flushSync: boolean;
33
+ _readOnly: boolean;
34
+ constructor(nodeMap: NodeMap, selection?: null | BaseSelection);
35
+ isEmpty(): boolean;
36
+ read<V>(callbackFn: () => V, options?: EditorStateReadOptions): V;
37
+ clone(selection?: null | BaseSelection): EditorState;
38
+ toJSON(): SerializedEditorState;
39
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import type { LexicalEditor } from './LexicalEditor';
9
+ import type { NodeKey } from './LexicalNode';
10
+
11
+ export declare function registerDefaultCommandHandlers(editor: LexicalEditor): void;
12
+ export type EventHandler = (event: Event, editor: LexicalEditor) => void;
13
+ export declare function addRootElementEvents(rootElement: HTMLElement, editor: LexicalEditor): void;
14
+ export declare function removeRootElementEvents(rootElement: HTMLElement): void;
15
+ export declare function markSelectionChangeFromDOMUpdate(): void;
16
+ export declare function markCollapsedSelectionFormat(
17
+ format: number,
18
+ style: string,
19
+ offset: number,
20
+ key: NodeKey,
21
+ timeStamp: number,
22
+ ): void;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import type { LexicalEditor } from './LexicalEditor';
9
+ import type { EditorState } from './LexicalEditorState';
10
+ import type { NodeKey } from './LexicalNode';
11
+
12
+ export declare function $garbageCollectDetachedDecorators(
13
+ editor: LexicalEditor,
14
+ pendingEditorState: EditorState,
15
+ ): void;
16
+ type IntentionallyMarkedAsDirtyElement = boolean;
17
+ export declare function $garbageCollectDetachedNodes(
18
+ prevEditorState: EditorState,
19
+ editorState: EditorState,
20
+ dirtyLeaves: Set<NodeKey>,
21
+ dirtyElements: Map<NodeKey, IntentionallyMarkedAsDirtyElement>,
22
+ ): void;
23
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import type { LexicalEditor } from './LexicalEditor';
9
+
10
+ export declare function getIsProcessingMutations(): boolean;
11
+ export declare function flushRootMutations(editor: LexicalEditor): void;
12
+ export declare function initMutationObserver(editor: LexicalEditor): void;