@lobehub/editor 4.29.0 → 4.29.2

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 (48) hide show
  1. package/README.md +86 -0
  2. package/es/editor-kernel/index.d.ts +2 -2
  3. package/es/editor-kernel/index.js +2 -2
  4. package/es/headless/index.d.ts +5 -2
  5. package/es/headless/index.js +20 -22
  6. package/es/headless.d.ts +6 -507
  7. package/es/headless.js +906 -411
  8. package/es/i-node-identity-service-BBC_bg97.d.ts +522 -0
  9. package/es/index.d.ts +4 -2
  10. package/es/index.js +5 -2
  11. package/es/plugins/block/react/ReactBlockPlugin.js +0 -3
  12. package/es/plugins/common/data-source/json-data-source.js +33 -25
  13. package/es/plugins/common/data-source/text-data-source.js +6 -1
  14. package/es/plugins/common/index.d.ts +3 -1
  15. package/es/plugins/common/node/node-id.d.ts +7 -0
  16. package/es/plugins/common/node/node-id.js +484 -0
  17. package/es/plugins/common/node/node-identity-policy.d.ts +26 -0
  18. package/es/plugins/common/node/node-identity-policy.js +68 -0
  19. package/es/plugins/common/plugin/index.js +28 -2
  20. package/es/plugins/common/service/i-node-identity-service.d.ts +19 -0
  21. package/es/plugins/common/service/i-node-identity-service.js +4 -0
  22. package/es/plugins/common/service/node-identity-service.js +87 -0
  23. package/es/plugins/common/utils/index.js +3 -1
  24. package/es/plugins/list/plugin/index.js +7 -1
  25. package/es/plugins/litexml/command/index.d.ts +2 -2
  26. package/es/plugins/litexml/command/index.js +464 -292
  27. package/es/plugins/litexml/command/symbols.d.ts +18 -7
  28. package/es/plugins/litexml/command/symbols.js +2 -1
  29. package/es/plugins/litexml/data-source/litexml-data-source.js +35 -32
  30. package/es/plugins/litexml/diff-validation.js +68 -14
  31. package/es/plugins/litexml/index.d.ts +2 -2
  32. package/es/plugins/litexml/node/identity-policy.js +91 -0
  33. package/es/plugins/litexml/plugin/index.js +6 -0
  34. package/es/plugins/litexml/table-cell-diff.js +4 -0
  35. package/es/plugins/litexml/table-row-diff.js +4 -0
  36. package/es/plugins/litexml/utils/index.js +10 -23
  37. package/es/plugins/markdown/command/index.js +77 -4
  38. package/es/plugins/markdown/data-source/markdown-data-source.js +6 -1
  39. package/es/plugins/math/plugin/index.js +2 -2
  40. package/es/plugins/slash/service/i-slash-service.d.ts +2 -2
  41. package/es/plugins/yjs/plugin/index.js +5 -3
  42. package/es/plugins/yjs/plugin/utils/editor-state.js +8 -1
  43. package/es/plugins/yjs/plugin/utils/node-identity.js +106 -0
  44. package/es/plugins/yjs/service/index.js +38 -4
  45. package/es/{symbols-Do7jD4Tt.d.ts → symbols-Dyr9yyS0.d.ts} +18 -7
  46. package/package.json +4 -4
  47. package/scripts/postinstall-lexical-patch.cjs +0 -21
  48. package/patches/lexical@0.42.0.patch +0 -82
@@ -0,0 +1,522 @@
1
+ import { HistoryState, HistoryStateEntry } from "@lexical/history";
2
+ import { CommandListener, CommandListenerPriority, CommandPayloadType, EditorState, LexicalCommand, LexicalEditor, LexicalNode, LexicalNodeConfig } from "lexical";
3
+ //#region src/editor-kernel/data-source.d.ts
4
+ interface IWriteOptions {
5
+ selection?: boolean;
6
+ }
7
+ declare class DataSource {
8
+ protected dataType: string;
9
+ constructor(dataType: string);
10
+ get type(): string;
11
+ read(editor: LexicalEditor, data: any, options?: Record<string, unknown>): void;
12
+ write(editor: LexicalEditor, options?: IWriteOptions): any;
13
+ }
14
+ //#endregion
15
+ //#region src/types/hotkey.d.ts
16
+ declare const HotkeyEnum: {
17
+ readonly Bold: "bold";
18
+ readonly BulletList: "bulletList";
19
+ readonly CodeInline: "codeInline";
20
+ readonly Italic: "italic";
21
+ readonly Link: "link";
22
+ readonly Mention: "mention";
23
+ readonly NumberList: "numberList";
24
+ readonly PasteAsPlainText: "pasteAsPlainText";
25
+ readonly Redo: "redo";
26
+ readonly Slash: "slash";
27
+ readonly Strikethrough: "strikethrough";
28
+ readonly Underline: "underline";
29
+ readonly Undo: "undo";
30
+ };
31
+ type HotkeyId = (typeof HotkeyEnum)[keyof typeof HotkeyEnum];
32
+ type ModifierCombination = {
33
+ altKey?: boolean;
34
+ ctrlKey?: boolean;
35
+ metaKey?: boolean;
36
+ shiftKey?: boolean;
37
+ } | Record<string, never>;
38
+ //#endregion
39
+ //#region src/utils/hotkey/registerHotkey.d.ts
40
+ type HotkeysEvent = {
41
+ key?: string;
42
+ keys: string;
43
+ modifiers: ModifierCombination;
44
+ scopes?: string[];
45
+ };
46
+ type HotkeyOptions = {
47
+ enabled?: boolean;
48
+ preventDefault?: boolean;
49
+ stopImmediatePropagation?: boolean;
50
+ stopPropagation?: boolean;
51
+ };
52
+ //#endregion
53
+ //#region src/locale/index.d.ts
54
+ declare const _default: {
55
+ block: {
56
+ copy: string;
57
+ delete: string;
58
+ select: string;
59
+ };
60
+ cancel: string;
61
+ codemirror: {
62
+ copySuccess: string;
63
+ preview: string;
64
+ selectLanguage: string;
65
+ selectTheme: string;
66
+ showLineNumbers: string;
67
+ tabSize: string;
68
+ theme: string;
69
+ useTabs: string;
70
+ };
71
+ confirm: string;
72
+ file: {
73
+ error: string;
74
+ uploading: string;
75
+ };
76
+ image: {
77
+ broken: string;
78
+ preview: string;
79
+ replace: string;
80
+ };
81
+ link: {
82
+ copy: string;
83
+ copySuccess: string;
84
+ convertToCard: string;
85
+ convertToIframe: string;
86
+ convertToLink: string;
87
+ convertToSchema: string;
88
+ edit: string;
89
+ editLinkTitle: string;
90
+ editTextTitle: string;
91
+ open: string;
92
+ placeholder: string;
93
+ unlink: string;
94
+ };
95
+ markdown: {
96
+ autoFormatMessage: string;
97
+ autoFormatTitle: string;
98
+ cancel: string;
99
+ confirm: string;
100
+ parseMessage: string;
101
+ parseTitle: string;
102
+ };
103
+ math: {
104
+ placeholder: string;
105
+ };
106
+ modifier: {
107
+ accept: string;
108
+ acceptAll: string;
109
+ reject: string;
110
+ rejectedAll: string;
111
+ };
112
+ table: {
113
+ delete: string;
114
+ deleteColumn: string;
115
+ deleteRow: string;
116
+ insertColumnLeft: string;
117
+ insertColumnRight: string;
118
+ insertRowAbove: string;
119
+ insertRowBelow: string;
120
+ };
121
+ toc: {
122
+ ariaLabel: string;
123
+ empty: string;
124
+ expand: string;
125
+ pin: string;
126
+ title: string;
127
+ unpin: string;
128
+ };
129
+ };
130
+ //#endregion
131
+ //#region src/types/locale.d.ts
132
+ /**
133
+ * Internationalization key type declaration, plugins can extend through declaration merging
134
+ */
135
+ type LocaleType = typeof _default;
136
+ 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];
137
+ type ILocaleKeys = Record<FlattenKeys<LocaleType>, string>;
138
+ //#endregion
139
+ //#region src/types/kernel.d.ts
140
+ type IDecoratorFunc = (_node: LexicalNode, _editor: LexicalEditor) => any;
141
+ type INodeRegistrationTransform = (node: LexicalNodeConfig, index: number) => LexicalNodeConfig | null | undefined;
142
+ type IBeforeEditorInitLifecycle = () => void;
143
+ type IDecorator = {
144
+ queryDOM: (_element: HTMLElement) => HTMLElement;
145
+ render: IDecoratorFunc;
146
+ } | IDecoratorFunc;
147
+ /**
148
+ * Service ID type
149
+ */
150
+ type IServiceID<Service> = {
151
+ readonly __serviceId: string;
152
+ __serviceType?: Service;
153
+ };
154
+ interface ISelectionObject {
155
+ endNodeId: string;
156
+ endOffset: number;
157
+ startNodeId: string;
158
+ startOffset: number;
159
+ type: 'range' | 'node' | 'table';
160
+ }
161
+ interface IDocumentOptions {
162
+ [key: string]: unknown;
163
+ keepHistory?: boolean;
164
+ /** only work for json datasource */
165
+ keepId?: boolean;
166
+ }
167
+ interface IKernelEventMap {
168
+ /**
169
+ * Document change event
170
+ */
171
+ documentChange: (type: string, content: any) => void;
172
+ /**
173
+ * Editor editable state change event
174
+ */
175
+ editableChange: (editable: boolean) => void;
176
+ /**
177
+ * Editor error event
178
+ */
179
+ error: (error: Error) => void;
180
+ /**
181
+ * Initialization event
182
+ * @param editor Lexical editor instance
183
+ * @returns
184
+ */
185
+ initialized: (editor: LexicalEditor) => void;
186
+ /**
187
+ * handle markdown parse event
188
+ */
189
+ markdownParse: (params: {
190
+ cacheState: EditorState;
191
+ historyState: HistoryStateEntry | null;
192
+ markdown: string;
193
+ matchedPatterns: string[];
194
+ score: number;
195
+ }) => void;
196
+ /**
197
+ * handle paste event
198
+ */
199
+ onPaste: (event: ClipboardEvent) => void;
200
+ }
201
+ /**
202
+ * External API
203
+ */
204
+ interface IEditor {
205
+ /**
206
+ * Lose focus
207
+ */
208
+ blur(): void;
209
+ /**
210
+ * Clean editor content (clear all content)
211
+ */
212
+ cleanDocument(): void;
213
+ /**
214
+ * Destroy editor instance
215
+ */
216
+ destroy(): void;
217
+ /**
218
+ * Execute editor commands to manipulate editor content
219
+ * @param type
220
+ * @param payload
221
+ */
222
+ dispatchCommand<TCommand extends LexicalCommand<unknown>>(type: TCommand, payload: CommandPayloadType<TCommand>): boolean;
223
+ /**
224
+ * Focus editor
225
+ */
226
+ focus(): void;
227
+ /**
228
+ * Get editor content of specified type
229
+ */
230
+ getDocument(type: string): DataSource | undefined;
231
+ /**
232
+ * Lexical history state (undo stack metadata)
233
+ */
234
+ getHistoryState(): HistoryState;
235
+ /**
236
+ * Get Lexical editor instance
237
+ */
238
+ getLexicalEditor(): LexicalEditor | null;
239
+ /**
240
+ * Get document editor root node
241
+ */
242
+ getRootElement(): HTMLElement | null;
243
+ /**
244
+ * Get editor selection information
245
+ */
246
+ getSelection(): ISelectionObject | null;
247
+ /**
248
+ * Get document editor selection content of specified type
249
+ * @param type
250
+ */
251
+ getSelectionDocument(type: string): unknown | null;
252
+ /**
253
+ * Get editor theme
254
+ */
255
+ getTheme(): Record<string, string | Record<string, string>>;
256
+ /**
257
+ * Get headless editor instance
258
+ */
259
+ initHeadlessEditor(): LexicalEditor | null;
260
+ /**
261
+ * Get node editor instance
262
+ */
263
+ initNodeEditor(): LexicalEditor | null;
264
+ /**
265
+ * Check if editor is editable
266
+ */
267
+ isEditable(): boolean;
268
+ /**
269
+ * Check if editor content is empty
270
+ * @returns true if editor content is empty, false otherwise
271
+ */
272
+ get isEmpty(): boolean;
273
+ /**
274
+ * Check if editor has active selection
275
+ * @returns true if editor has selection, false otherwise
276
+ */
277
+ get isSelected(): boolean;
278
+ /**
279
+ * Remove editor event listener
280
+ * @param event
281
+ * @param listener
282
+ */
283
+ off<T extends keyof IKernelEventMap>(event: T, listener: IKernelEventMap[T]): this;
284
+ /**
285
+ * Add editor event listener
286
+ * @param event
287
+ * @param listener
288
+ */
289
+ on<T extends keyof IKernelEventMap>(event: T, listener: IKernelEventMap[T]): this;
290
+ /**
291
+ * Listen to event once, automatically remove listener after trigger
292
+ * @param event
293
+ * @param listener
294
+ */
295
+ once<T extends keyof IKernelEventMap>(event: T, listener: IKernelEventMap[T]): this;
296
+ /**
297
+ * Extends the priority level of Lexical commands.
298
+ * Registers a listener that triggers when the provided command is dispatched
299
+ * via {@link LexicalEditor.dispatch}. The listener is triggered based on its priority.
300
+ * Listeners with higher priority can "intercept" commands and prevent them
301
+ * from propagating to other handlers by returning true.
302
+ *
303
+ * Listeners are always invoked within {@link LexicalEditor.update} and can call dollar functions.
304
+ *
305
+ * Listeners registered at the same priority level will deterministically run
306
+ * in the order of registration.
307
+ *
308
+ * @param command - The command that triggers the callback.
309
+ * @param listener - The function executed when the command is dispatched.
310
+ * @param priority - The relative priority of the listener. 0 | 1 | 2 | 3 | 4
311
+ * (or {@link COMMAND_PRIORITY_EDITOR} |
312
+ * {@link COMMAND_PRIORITY_LOW} |
313
+ * {@link COMMAND_PRIORITY_NORMAL} |
314
+ * {@link COMMAND_PRIORITY_HIGH} |
315
+ * {@link COMMAND_PRIORITY_CRITICAL})
316
+ * @returns A teardown function to clean up the listener.
317
+ */
318
+ registerHighCommand<P>(command: LexicalCommand<P>, listener: CommandListener<P>, priority: CommandListenerPriority): () => void;
319
+ /**
320
+ * Register keyboard shortcut
321
+ * @param hotkey
322
+ * @param callback
323
+ * @param options
324
+ */
325
+ registerHotkey(hotkey: HotkeyId, callback: (event: KeyboardEvent, handler: HotkeysEvent) => void, options?: HotkeyOptions): () => void;
326
+ /**
327
+ * Register internationalization text
328
+ * @param locale Internationalization text object
329
+ */
330
+ registerLocale(locale: Partial<Record<keyof ILocaleKeys, string>>): void;
331
+ /**
332
+ * Register editor plugin
333
+ */
334
+ registerPlugin<T>(plugin: IEditorPluginConstructor<T>, config?: T): IEditor;
335
+ /**
336
+ * Register multiple editor plugins
337
+ */
338
+ registerPlugins(plugins: Array<IPlugin>): IEditor;
339
+ /**
340
+ * Get editor Service, usually provided by plugins to extend certain functionalities
341
+ * @param serviceId
342
+ */
343
+ requireService<T>(serviceId: IServiceID<T>): T | null;
344
+ /**
345
+ * Set editor content, type is content type, content is content data
346
+ * @param type
347
+ * @param content
348
+ */
349
+ setDocument(type: string, content: any, options?: IDocumentOptions): void;
350
+ /**
351
+ * Enable or disable editor editing capability
352
+ * @param editable
353
+ */
354
+ setEditable(editable: boolean): void;
355
+ /**
356
+ * Set document editor root node
357
+ * @param dom
358
+ */
359
+ setRootElement(dom: HTMLElement, editable?: boolean): LexicalEditor;
360
+ setRootElement(dom: null, editable?: boolean): LexicalEditor | null;
361
+ /**
362
+ * set editor selection
363
+ * @param selection
364
+ */
365
+ setSelection(selection: ISelectionObject, opt?: {
366
+ collapseToEnd?: boolean;
367
+ collapseToStart?: boolean;
368
+ }): Promise<boolean>;
369
+ /**
370
+ * Get translation text
371
+ * @param key Translation key
372
+ * @param params Parameter replacement
373
+ */
374
+ t<K extends keyof ILocaleKeys>(key: K, params?: Record<string, any>): string;
375
+ /**
376
+ * Update editor theme
377
+ * @param key
378
+ * @param value
379
+ */
380
+ updateTheme(key: string, value: string | Record<string, string>): void;
381
+ }
382
+ /**
383
+ * API provided to plugins
384
+ */
385
+ interface IEditorKernel extends IEditor {
386
+ /**
387
+ * Clone the current editor kernel instance
388
+ */
389
+ cloneNodeEditor(): IEditorKernel;
390
+ emit<T extends keyof IKernelEventMap>(event: T, params: Parameters<IKernelEventMap[T]>[0]): void;
391
+ /**
392
+ * Get editor Node decorator for specific Node rendering
393
+ * @param name
394
+ */
395
+ getDecorator(name: string): IDecorator | undefined;
396
+ /**
397
+ * Get all registered decorator names
398
+ */
399
+ getRegisteredDecorators(): string[];
400
+ /**
401
+ * Check if hot reload mode is enabled
402
+ */
403
+ isHotReloadMode(): boolean;
404
+ /**
405
+ * Register a lifecycle hook that runs right before editor initialization.
406
+ * @param hook
407
+ * @returns unregister function
408
+ */
409
+ registerBeforeEditorInit(hook: IBeforeEditorInitLifecycle): () => void;
410
+ /**
411
+ * Register data source for multi-format data conversion
412
+ * @param dataSource
413
+ */
414
+ registerDataSource(dataSource: DataSource): void;
415
+ /**
416
+ * Register editor node decorator
417
+ * @param name
418
+ * @param decorator
419
+ */
420
+ registerDecorator(name: string, decorator: IDecorator): void;
421
+ /**
422
+ * Register a transform hook that runs before editor initialization
423
+ * to rewrite registered nodes before createEditor/createHeadlessEditor is called.
424
+ * @param transform
425
+ * @returns unregister function
426
+ */
427
+ registerNodeTransform(transform: INodeRegistrationTransform): () => void;
428
+ /**
429
+ * Register Lexical Node
430
+ * @param nodes
431
+ */
432
+ registerNodes(nodes: Array<LexicalNodeConfig>): void;
433
+ /**
434
+ * Register className(s) to the contenteditable root element.
435
+ * @param className One or more class names separated by spaces
436
+ * @returns unregister function
437
+ */
438
+ registerRootClassName(className: string): () => void;
439
+ /**
440
+ * Register a callback for root attach/detach events.
441
+ *
442
+ * Call this after the kernel's Lexical editor has been initialized (usually
443
+ * from plugin onInit). Lexical immediately invokes a newly registered root
444
+ * listener with the current root, so listeners registered after the initial
445
+ * setRootElement still receive the first root attach. Headless kernels
446
+ * return a no-op cleanup because headless Lexical editors do not support
447
+ * root listeners.
448
+ */
449
+ registerRootListener(listener: (rootElement: HTMLElement | null) => void): () => void;
450
+ /**
451
+ * Register service
452
+ * @param serviceId
453
+ * @param service
454
+ */
455
+ registerService<T>(serviceId: IServiceID<T>, service: T): void;
456
+ /**
457
+ * Register service with hot reload support - allows overriding existing services
458
+ * @param serviceId Service identifier
459
+ * @param service Service instance
460
+ */
461
+ registerServiceHotReload<T>(serviceId: IServiceID<T>, service: T): void;
462
+ /**
463
+ * Register theme
464
+ * @param themes
465
+ */
466
+ registerThemes(themes: Record<string, any>): void;
467
+ /**
468
+ * Enable or disable hot reload mode
469
+ * @param enabled Whether to enable hot reload mode
470
+ */
471
+ setHotReloadMode(enabled: boolean): void;
472
+ /**
473
+ * Unregister editor node decorator
474
+ * @param name Decorator name
475
+ */
476
+ unregisterDecorator(name: string): boolean;
477
+ }
478
+ /**
479
+ * Plugin interface
480
+ */
481
+ interface IEditorPlugin<IConfig> {
482
+ config?: IConfig;
483
+ /**
484
+ * Editor destruction
485
+ */
486
+ destroy(): void;
487
+ /**
488
+ * After editor document content is written by setDocument
489
+ */
490
+ onDocumentChange?(type: string, content: any, options?: IDocumentOptions): void;
491
+ /**
492
+ * After Lexical editor instantiation
493
+ * @param editor Lexical editor instance
494
+ */
495
+ onInit?(editor: LexicalEditor): void;
496
+ }
497
+ /**
498
+ * Plugin class interface
499
+ */
500
+ interface IEditorPluginConstructor<IConfig> {
501
+ readonly pluginName: string;
502
+ new (kernel: IEditorKernel, config?: IConfig): IEditorPlugin<IConfig>;
503
+ }
504
+ type IPlugin<T = any> = IEditorPluginConstructor<T> | [IEditorPluginConstructor<T>, T?];
505
+ //#endregion
506
+ //#region src/plugins/common/service/i-node-identity-service.d.ts
507
+ /** A detached, immutable description of the currently active logical node. */
508
+ interface NodeIdentitySnapshot {
509
+ readonly id: string;
510
+ /** Native Lexical text; a review container can include both pending sides. */
511
+ readonly textContent: string;
512
+ readonly type: string;
513
+ }
514
+ interface INodeIdentityService {
515
+ /** Read the last committed editor state without retaining a LexicalNode. */
516
+ getNodeById(nodeId: string): Readonly<NodeIdentitySnapshot> | null;
517
+ /** Subscribe to committed updates; query the service in the callback. */
518
+ subscribe(listener: () => void): () => void;
519
+ }
520
+ declare const INodeIdentityService: IServiceID<INodeIdentityService>;
521
+ //#endregion
522
+ export { IPlugin as a, IEditor as i, NodeIdentitySnapshot as n, IDocumentOptions as r, INodeIdentityService as t };
package/es/index.d.ts CHANGED
@@ -14,8 +14,10 @@ import { useLexicalEditor } from "./editor-kernel/react/useLexicalEditor.js";
14
14
  import "./editor-kernel/react/index.js";
15
15
  import { ILitexmlService, LitexmlService, XMLReaderFunc, XMLReaderRecord, XMLWriterFunc, XMLWriterRecord } from "./plugins/litexml/service/litexml-service.js";
16
16
  import LitexmlDataSource from "./plugins/litexml/data-source/litexml-data-source.js";
17
- import { DiffAction, LITEXML_APPLY_COMMAND, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND } from "./plugins/litexml/command/symbols.js";
17
+ import { DiffAction, LITEXML_APPLY_COMMAND, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_MODIFY_WITH_RESULTS_COMMAND, LITEXML_REMOVE_COMMAND, LiteXmlModifyOperation, LiteXmlOperationResult } from "./plugins/litexml/command/symbols.js";
18
18
  import { FileListItem, ImageListItem, MediaLists, extractMediaFromEditorState } from "./headless/extract-media-from-editor-state.js";
19
+ import { $getNodeById, $getNodeId } from "./plugins/common/node/node-id.js";
20
+ import { INodeIdentityService, NodeIdentitySnapshot } from "./plugins/common/service/i-node-identity-service.js";
19
21
  import { DEFAULT_HEADLESS_EDITOR_PLUGINS, HeadlessDocumentType, HeadlessEditor, HeadlessEditorExport, HeadlessEditorExportOptions, HeadlessEditorHydrationInput, HeadlessEditorOptions, HeadlessLiteXMLBatchOperation, HeadlessLiteXMLInsertOperation, HeadlessLiteXMLOperation, HeadlessLiteXMLRemoveOperation, HeadlessLiteXMLReplaceOperation, createHeadlessEditor } from "./headless/index.js";
20
22
  import { AutoCompletePlugin } from "./plugins/auto-complete/plugin/index.js";
21
23
  import ReactAutoCompletePlugin from "./plugins/auto-complete/react/ReactAutoCompletePlugin.js";
@@ -172,4 +174,4 @@ declare function enableHotReload(): void;
172
174
  */
173
175
  declare function disableHotReload(): void;
174
176
  //#endregion
175
- export { $closest, $closestNodeType, $createCollapsibleNode, $createCursorNode, $getNearestNodeFromDOMNode, $getNodeFromDOMNode, $isCardLikeElementNode, $isCollapsibleNode, $isCursorNode, ANCHOR_PADDING_CSS_VAR, AutoCompletePlugin, type BlockDragTarget, BlockMenuService, BlockMovePayload, BlockPlugin, BlockPluginOptions, CONTENT_BLOCKS_DATA_TYPE, CardLikeElementNode, CodePlugin, CodeblockPlugin, CodeblockPluginOptions, CodemirrorEditLock, CodemirrorEditLockOwner, CodemirrorEditLockProvider, CodemirrorEditLockService, CodemirrorPlugin, CodemirrorPluginOptions, type CollaborationProviderFactory, type CollaborationUser, CollapsibleNode, CollapsiblePlugin, CollapsiblePluginOptions, CommonPlugin, CommonPluginOptions, type ContentBlock, ContentBlocksDataSource, ContentBlocksPlugin, type ContentBlocksPluginOptions, CreateWebSocketYjsProviderOptions, DEFAULT_BLOCK_ANCHOR_PADDING, DEFAULT_HEADLESS_EDITOR_PLUGINS, DOM_DOCUMENT_FRAGMENT_TYPE, DOM_DOCUMENT_TYPE, DOM_ELEMENT_TYPE, DOM_TEXT_TYPE, DataSource, DiffAction, type Doc, EDITOR_THEME_KEY, type EditorCollaborationConfig, type ExtractContentBlocksOptions, type FileContentBlock, type FileListItem, FilePlugin, FilePluginOptions, GET_MARKDOWN_SELECTION_COMMAND, HIDE_TOOLBAR_COMMAND, HOVER_COMMAND, HRPlugin, HRPluginOptions, HeadlessDocumentType, HeadlessEditor, HeadlessEditorExport, HeadlessEditorExportOptions, HeadlessEditorHydrationInput, HeadlessEditorOptions, HeadlessLiteXMLBatchOperation, HeadlessLiteXMLInsertOperation, HeadlessLiteXMLOperation, HeadlessLiteXMLRemoveOperation, HeadlessLiteXMLReplaceOperation, HotkeyEnum, HotkeyId, HotkeyItem, HotkeyScopeEnum, HotkeyScopeId, IBlockActionButton, IBlockActionButtonIcon, IBlockMenuItem, IBlockMenuRenderContext, IBlockMenuService, IBlockSelectHandler, ICodemirrorEditLockService, type IEditor, ILinkService, ILitexmlService, IMarkdownShortCutService, INSERT_CHECK_LIST_COMMAND, INSERT_CODEINLINE_COMMAND, INSERT_CODEMIRROR_COMMAND, INSERT_COLLAPSIBLE_COMMAND, INSERT_FILE_COMMAND, INSERT_HEADING_COMMAND, INSERT_HORIZONTAL_RULE_COMMAND, INSERT_IMAGE_COMMAND, INSERT_LINK_COMMAND, INSERT_LINK_HIGHLIGHT_COMMAND, INSERT_MARKDOWN_COMMAND, INSERT_MATH_COMMAND, INSERT_MENTION_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_QUOTE_COMMAND, INSERT_TABLE_COLUMN_COMMAND, INSERT_TABLE_COMMAND, INSERT_TABLE_ROW_COMMAND, INSERT_UNORDERED_LIST_COMMAND, INodePlugin, INodePluginOptions, INodeService, type ISlashDividerOption, type ISlashMenuOption, type ISlashOption, type ISlashSectionOption, type ISlashService, ITableControllerMenuActionItem, ITableControllerMenuItem, ITableControllerMenuRenderContext, ITableControllerMenuSeparatorItem, ITableControllerMenuService, ITocService, ITriggerContext, IUploadService, IYjsService, type ImageContentBlock, type ImageListItem, ImagePlugin, ImagePluginOptions, Kernel, KeyEnum, LITEXML_APPLY_COMMAND, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND, LexicalErrorBoundary, LexicalPortalContainer, type LinkCardRenderer, type LinkCardRendererProps, type LinkEmbedRule, LinkHighlightPlugin, LinkHighlightPluginOptions, type LinkIframeRenderer, type LinkIframeRendererProps, type LinkLabels, LinkPlugin, LinkPluginOptions, type LinkToolbarAction, type LinkToolbarItem, type LinkToolbarItemIcon, type LinkToolbarRenderContext, ListPlugin, ListPluginOptions, LitexmlDataSource, LitexmlPlugin, type LitexmlPluginOptions, LitexmlService, type MARKDOWN_READER_LEVEL, MARKDOWN_READER_LEVEL_HIGH, MARKDOWN_READER_LEVEL_NORMAL, MARKDOWN_WRITER_LEVEL_MAX, MOVE_BLOCK_COMMAND, MarkdownPlugin, MathPlugin, type MediaLists, MentionPlugin, MentionPluginOptions, type MenuRenderProps, ModifierCombination, type ParsedSchemaUrl, REMOVE_LIST_COMMAND, ReactAutoCompletePlugin, ReactBlockPlugin, type ReactBlockPluginProps, ReactCodePlugin, ReactCodeblockPlugin, type ReactCodeblockPluginProps, ReactCodemirrorPlugin, ReactCollaborationPlugin, type ReactCollaborationPluginProps, ReactCollapsiblePlugin, type ReactCollapsiblePluginProps, ReactEditor, ReactEditorContent, ReactEditorContentProps, ReactFilePlugin, type ReactFilePluginProps, ReactHRPlugin, type ReactHRPluginProps, ReactImagePlugin, type ReactImagePluginProps, type ReactLinkDefaultToolbarItemKey, type ReactLinkDefaultToolbarItems, ReactLinkHighlightPlugin, ReactLinkPlugin, type ReactLinkPluginProps, ReactListPlugin, type ReactListPluginProps, ReactLiteXmlPlugin, ReactMarkdownPlugin, ReactMathPlugin, ReactMentionPlugin, type ReactMentionPluginProps, ReactNodePlugin, ReactPlainText, ReactPlainTextProps, type ReactSchemaRule, ReactSlashOption, type ReactSlashOptionProps, ReactSlashPlugin, type ReactSlashPluginProps, ReactTablePlugin, ReactTocPlugin, type ReactTocPluginProps, ReactToolbarPlugin, ReactVirtualBlockPlugin, ReactYjsPlugin, ReactYjsPluginProps, SELECT_AFTER_CODEMIRROR_COMMAND, SELECT_BEFORE_CODEMIRROR_COMMAND, SELECT_TABLE_COMMAND, SHOW_TOOLBAR_COMMAND, type SchemaLinkRenderer, type SchemaLinkRendererConfig, type SchemaLinkRendererProps, type SchemaRenderer, type SchemaRendererProps, type SchemaRule, SerializedCollapsibleNode, type SerializedMentionNode, SlashMenu, type SlashMenuProps, type SlashOptions, SlashPlugin, SlashPluginOptions, TableControllerMenuAxis, TableControllerMenuService, TablePlugin, TablePluginOptions, type TextContentBlock, TocHeadingTag, TocItem, TocJumpOptions, TocPlugin, TocPluginOptions, TocScrollBehavior, TocScrollLogicalPosition, TocService, ToolbarCommandOptions, UPDATE_CODEBLOCK_LANG, UPDATE_COLLAPSIBLE_COMMAND, UPDATE_LIST_START_COMMAND, UPLOAD_PRIORITY_HIGH, UPLOAD_PRIORITY_LOW, UPLOAD_PRIORITY_MEDIUM, UploadPlugin, UploadPluginOptions, type UseTocOptions, type UseTocResult, VirtualBlockPlugin, VirtualBlockPluginOptions, WebSocketYjsProvider, WebSocketYjsProviderStatus, type XMLReaderFunc, type XMLReaderRecord, type XMLWriterFunc, type XMLWriterRecord, YjsAwarenessUser, type YjsInitialEditorState, YjsPlugin, type YjsPluginOptions, YjsPluginState, type YjsProviderFactory, YjsService, assert, browserDebug, buildTocTree, bundledLanguagesInfo, compareNodeOrder, createDebugLogger, createEmptyEditorState, createHeadlessEditor, createWebSocketYjsProvider, cursorNodeSerialized, debugLogger, debugLoggers, detectCodeLanguage, detectLanguage, devConsole, disableHotReload, enableHotReload, extractContentBlocks, extractMediaFromEditorState, extractMediaLists, fetchWebSocketDemoDocument, flattenSlashOptions, flattenTocTree, genServiceId, generateEditorId, getHotkeyById, getKernelFromEditor, getKernelFromEditorConfig, getNodeKeyFromDOMNode, getNodeTitle, getNodeUrl, getParentElement, isDOMNode, isDocumentFragment, isPunctuationChar, isPureUrl, isSlashDividerOption, isSlashMenuOption, isSlashSectionOption, isValidUrl, moment, noop, normalizeProtocol, normalizeSchemaLinkNode, prodSafeLogger, reconcileDecorator, registerBlockMoveCommand, registerEditorKernel, registerLinkHighlightCommand, registerToolbarCommand, resetRandomKey, saveWebSocketDemoDocument, scrollIntoView, snapshotWebSocketDemoDocument, unregisterEditorKernel, useHasDiffNode, useLexicalComposerContext, useLexicalEditor, useToc };
177
+ export { $closest, $closestNodeType, $createCollapsibleNode, $createCursorNode, $getNearestNodeFromDOMNode, $getNodeById, $getNodeFromDOMNode, $getNodeId, $isCardLikeElementNode, $isCollapsibleNode, $isCursorNode, ANCHOR_PADDING_CSS_VAR, AutoCompletePlugin, type BlockDragTarget, BlockMenuService, BlockMovePayload, BlockPlugin, BlockPluginOptions, CONTENT_BLOCKS_DATA_TYPE, CardLikeElementNode, CodePlugin, CodeblockPlugin, CodeblockPluginOptions, CodemirrorEditLock, CodemirrorEditLockOwner, CodemirrorEditLockProvider, CodemirrorEditLockService, CodemirrorPlugin, CodemirrorPluginOptions, type CollaborationProviderFactory, type CollaborationUser, CollapsibleNode, CollapsiblePlugin, CollapsiblePluginOptions, CommonPlugin, CommonPluginOptions, type ContentBlock, ContentBlocksDataSource, ContentBlocksPlugin, type ContentBlocksPluginOptions, CreateWebSocketYjsProviderOptions, DEFAULT_BLOCK_ANCHOR_PADDING, DEFAULT_HEADLESS_EDITOR_PLUGINS, DOM_DOCUMENT_FRAGMENT_TYPE, DOM_DOCUMENT_TYPE, DOM_ELEMENT_TYPE, DOM_TEXT_TYPE, DataSource, DiffAction, type Doc, EDITOR_THEME_KEY, type EditorCollaborationConfig, type ExtractContentBlocksOptions, type FileContentBlock, type FileListItem, FilePlugin, FilePluginOptions, GET_MARKDOWN_SELECTION_COMMAND, HIDE_TOOLBAR_COMMAND, HOVER_COMMAND, HRPlugin, HRPluginOptions, HeadlessDocumentType, HeadlessEditor, HeadlessEditorExport, HeadlessEditorExportOptions, HeadlessEditorHydrationInput, HeadlessEditorOptions, HeadlessLiteXMLBatchOperation, HeadlessLiteXMLInsertOperation, HeadlessLiteXMLOperation, HeadlessLiteXMLRemoveOperation, HeadlessLiteXMLReplaceOperation, HotkeyEnum, HotkeyId, HotkeyItem, HotkeyScopeEnum, HotkeyScopeId, IBlockActionButton, IBlockActionButtonIcon, IBlockMenuItem, IBlockMenuRenderContext, IBlockMenuService, IBlockSelectHandler, ICodemirrorEditLockService, type IEditor, ILinkService, ILitexmlService, IMarkdownShortCutService, INSERT_CHECK_LIST_COMMAND, INSERT_CODEINLINE_COMMAND, INSERT_CODEMIRROR_COMMAND, INSERT_COLLAPSIBLE_COMMAND, INSERT_FILE_COMMAND, INSERT_HEADING_COMMAND, INSERT_HORIZONTAL_RULE_COMMAND, INSERT_IMAGE_COMMAND, INSERT_LINK_COMMAND, INSERT_LINK_HIGHLIGHT_COMMAND, INSERT_MARKDOWN_COMMAND, INSERT_MATH_COMMAND, INSERT_MENTION_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_QUOTE_COMMAND, INSERT_TABLE_COLUMN_COMMAND, INSERT_TABLE_COMMAND, INSERT_TABLE_ROW_COMMAND, INSERT_UNORDERED_LIST_COMMAND, INodeIdentityService, INodePlugin, INodePluginOptions, INodeService, type ISlashDividerOption, type ISlashMenuOption, type ISlashOption, type ISlashSectionOption, type ISlashService, ITableControllerMenuActionItem, ITableControllerMenuItem, ITableControllerMenuRenderContext, ITableControllerMenuSeparatorItem, ITableControllerMenuService, ITocService, ITriggerContext, IUploadService, IYjsService, type ImageContentBlock, type ImageListItem, ImagePlugin, ImagePluginOptions, Kernel, KeyEnum, LITEXML_APPLY_COMMAND, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_MODIFY_WITH_RESULTS_COMMAND, LITEXML_REMOVE_COMMAND, LexicalErrorBoundary, LexicalPortalContainer, type LinkCardRenderer, type LinkCardRendererProps, type LinkEmbedRule, LinkHighlightPlugin, LinkHighlightPluginOptions, type LinkIframeRenderer, type LinkIframeRendererProps, type LinkLabels, LinkPlugin, LinkPluginOptions, type LinkToolbarAction, type LinkToolbarItem, type LinkToolbarItemIcon, type LinkToolbarRenderContext, ListPlugin, ListPluginOptions, type LiteXmlModifyOperation, type LiteXmlOperationResult, LitexmlDataSource, LitexmlPlugin, type LitexmlPluginOptions, LitexmlService, type MARKDOWN_READER_LEVEL, MARKDOWN_READER_LEVEL_HIGH, MARKDOWN_READER_LEVEL_NORMAL, MARKDOWN_WRITER_LEVEL_MAX, MOVE_BLOCK_COMMAND, MarkdownPlugin, MathPlugin, type MediaLists, MentionPlugin, MentionPluginOptions, type MenuRenderProps, ModifierCombination, type NodeIdentitySnapshot, type ParsedSchemaUrl, REMOVE_LIST_COMMAND, ReactAutoCompletePlugin, ReactBlockPlugin, type ReactBlockPluginProps, ReactCodePlugin, ReactCodeblockPlugin, type ReactCodeblockPluginProps, ReactCodemirrorPlugin, ReactCollaborationPlugin, type ReactCollaborationPluginProps, ReactCollapsiblePlugin, type ReactCollapsiblePluginProps, ReactEditor, ReactEditorContent, ReactEditorContentProps, ReactFilePlugin, type ReactFilePluginProps, ReactHRPlugin, type ReactHRPluginProps, ReactImagePlugin, type ReactImagePluginProps, type ReactLinkDefaultToolbarItemKey, type ReactLinkDefaultToolbarItems, ReactLinkHighlightPlugin, ReactLinkPlugin, type ReactLinkPluginProps, ReactListPlugin, type ReactListPluginProps, ReactLiteXmlPlugin, ReactMarkdownPlugin, ReactMathPlugin, ReactMentionPlugin, type ReactMentionPluginProps, ReactNodePlugin, ReactPlainText, ReactPlainTextProps, type ReactSchemaRule, ReactSlashOption, type ReactSlashOptionProps, ReactSlashPlugin, type ReactSlashPluginProps, ReactTablePlugin, ReactTocPlugin, type ReactTocPluginProps, ReactToolbarPlugin, ReactVirtualBlockPlugin, ReactYjsPlugin, ReactYjsPluginProps, SELECT_AFTER_CODEMIRROR_COMMAND, SELECT_BEFORE_CODEMIRROR_COMMAND, SELECT_TABLE_COMMAND, SHOW_TOOLBAR_COMMAND, type SchemaLinkRenderer, type SchemaLinkRendererConfig, type SchemaLinkRendererProps, type SchemaRenderer, type SchemaRendererProps, type SchemaRule, SerializedCollapsibleNode, type SerializedMentionNode, SlashMenu, type SlashMenuProps, type SlashOptions, SlashPlugin, SlashPluginOptions, TableControllerMenuAxis, TableControllerMenuService, TablePlugin, TablePluginOptions, type TextContentBlock, TocHeadingTag, TocItem, TocJumpOptions, TocPlugin, TocPluginOptions, TocScrollBehavior, TocScrollLogicalPosition, TocService, ToolbarCommandOptions, UPDATE_CODEBLOCK_LANG, UPDATE_COLLAPSIBLE_COMMAND, UPDATE_LIST_START_COMMAND, UPLOAD_PRIORITY_HIGH, UPLOAD_PRIORITY_LOW, UPLOAD_PRIORITY_MEDIUM, UploadPlugin, UploadPluginOptions, type UseTocOptions, type UseTocResult, VirtualBlockPlugin, VirtualBlockPluginOptions, WebSocketYjsProvider, WebSocketYjsProviderStatus, type XMLReaderFunc, type XMLReaderRecord, type XMLWriterFunc, type XMLWriterRecord, YjsAwarenessUser, type YjsInitialEditorState, YjsPlugin, type YjsPluginOptions, YjsPluginState, type YjsProviderFactory, YjsService, assert, browserDebug, buildTocTree, bundledLanguagesInfo, compareNodeOrder, createDebugLogger, createEmptyEditorState, createHeadlessEditor, createWebSocketYjsProvider, cursorNodeSerialized, debugLogger, debugLoggers, detectCodeLanguage, detectLanguage, devConsole, disableHotReload, enableHotReload, extractContentBlocks, extractMediaFromEditorState, extractMediaLists, fetchWebSocketDemoDocument, flattenSlashOptions, flattenTocTree, genServiceId, generateEditorId, getHotkeyById, getKernelFromEditor, getKernelFromEditorConfig, getNodeKeyFromDOMNode, getNodeTitle, getNodeUrl, getParentElement, isDOMNode, isDocumentFragment, isPunctuationChar, isPureUrl, isSlashDividerOption, isSlashMenuOption, isSlashSectionOption, isValidUrl, moment, noop, normalizeProtocol, normalizeSchemaLinkNode, prodSafeLogger, reconcileDecorator, registerBlockMoveCommand, registerEditorKernel, registerLinkHighlightCommand, registerToolbarCommand, resetRandomKey, saveWebSocketDemoDocument, scrollIntoView, snapshotWebSocketDemoDocument, unregisterEditorKernel, useHasDiffNode, useLexicalComposerContext, useLexicalEditor, useToc };
package/es/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { __toCommonJS } from "./_virtual/_rolldown/runtime.js";
2
2
  import { browserDebug, createDebugLogger, debugLogger, debugLoggers, debug_exports, devConsole, init_debug, prodSafeLogger } from "./utils/debug.js";
3
+ import { $getNodeById, $getNodeId, init_node_id } from "./plugins/common/node/node-id.js";
3
4
  import { HotkeyEnum, HotkeyScopeEnum, KeyEnum, init_hotkey } from "./types/hotkey.js";
4
5
  import { getHotkeyById, init_registerHotkey } from "./utils/hotkey/registerHotkey.js";
5
6
  import { HOVER_COMMAND, init_event } from "./editor-kernel/event.js";
@@ -14,7 +15,8 @@ import { ReactEditor } from "./editor-kernel/react/react-editor.js";
14
15
  import { useLexicalEditor } from "./editor-kernel/react/useLexicalEditor.js";
15
16
  import { INSERT_HEADING_COMMAND, INSERT_QUOTE_COMMAND } from "./plugins/common/command/index.js";
16
17
  import { $createCursorNode, $isCardLikeElementNode, $isCursorNode, CardLikeElementNode, cursorNodeSerialized } from "./plugins/common/node/cursor.js";
17
- import { DiffAction, LITEXML_APPLY_COMMAND, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND } from "./plugins/litexml/command/symbols.js";
18
+ import { INodeIdentityService } from "./plugins/common/service/i-node-identity-service.js";
19
+ import { DiffAction, LITEXML_APPLY_COMMAND, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_MODIFY_WITH_RESULTS_COMMAND, LITEXML_REMOVE_COMMAND } from "./plugins/litexml/command/symbols.js";
18
20
  import { INodeService } from "./plugins/inode/service/index.js";
19
21
  import { INodePlugin } from "./plugins/inode/plugin/index.js";
20
22
  import { ReactNodePlugin } from "./plugins/inode/react/index.js";
@@ -116,6 +118,7 @@ import { ReactYjsPlugin } from "./plugins/yjs/react/index.js";
116
118
  import { WebSocketYjsProvider, createWebSocketYjsProvider, fetchWebSocketDemoDocument, saveWebSocketDemoDocument, snapshotWebSocketDemoDocument } from "./plugins/yjs/websocket-provider.js";
117
119
  import { scrollIntoView } from "./utils/scrollIntoView.js";
118
120
  //#region src/index.ts
121
+ init_node_id();
119
122
  init_hotkey();
120
123
  init_registerHotkey();
121
124
  init_debug();
@@ -147,4 +150,4 @@ function disableHotReload() {
147
150
  }
148
151
  }
149
152
  //#endregion
150
- export { $closest, $closestNodeType, $createCollapsibleNode, $createCursorNode, $getNearestNodeFromDOMNode, $getNodeFromDOMNode, $isCardLikeElementNode, $isCollapsibleNode, $isCursorNode, ANCHOR_PADDING_CSS_VAR, AutoCompletePlugin, BlockMenuService, BlockPlugin, CONTENT_BLOCKS_DATA_TYPE, CardLikeElementNode, CodePlugin, CodeblockPlugin, CodemirrorEditLockService, CodemirrorPlugin, CollapsibleNode, CollapsiblePlugin, CommonPlugin, ContentBlocksDataSource, ContentBlocksPlugin, DEFAULT_BLOCK_ANCHOR_PADDING, DEFAULT_HEADLESS_EDITOR_PLUGINS, DOM_DOCUMENT_FRAGMENT_TYPE, DOM_DOCUMENT_TYPE, DOM_ELEMENT_TYPE, DOM_TEXT_TYPE, DataSource, DiffAction, EDITOR_THEME_KEY, FilePlugin, GET_MARKDOWN_SELECTION_COMMAND, HIDE_TOOLBAR_COMMAND, HOVER_COMMAND, HRPlugin, HeadlessEditor, HotkeyEnum, HotkeyScopeEnum, IBlockMenuService, ICodemirrorEditLockService, ILinkService, ILitexmlService, IMarkdownShortCutService, INSERT_CHECK_LIST_COMMAND, INSERT_CODEINLINE_COMMAND, INSERT_CODEMIRROR_COMMAND, INSERT_COLLAPSIBLE_COMMAND, INSERT_FILE_COMMAND, INSERT_HEADING_COMMAND, INSERT_HORIZONTAL_RULE_COMMAND, INSERT_IMAGE_COMMAND, INSERT_LINK_COMMAND, INSERT_LINK_HIGHLIGHT_COMMAND, INSERT_MARKDOWN_COMMAND, INSERT_MATH_COMMAND, INSERT_MENTION_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_QUOTE_COMMAND, INSERT_TABLE_COLUMN_COMMAND, INSERT_TABLE_COMMAND, INSERT_TABLE_ROW_COMMAND, INSERT_UNORDERED_LIST_COMMAND, INodePlugin, INodeService, ITableControllerMenuService, ITocService, IUploadService, IYjsService, ImagePlugin, Kernel, KeyEnum, LITEXML_APPLY_COMMAND, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND, LexicalErrorBoundary, LexicalPortalContainer, LinkHighlightPlugin, LinkPlugin, ListPlugin, LitexmlDataSource, LitexmlPlugin, LitexmlService, MARKDOWN_READER_LEVEL_HIGH, MARKDOWN_READER_LEVEL_NORMAL, MARKDOWN_WRITER_LEVEL_MAX, MOVE_BLOCK_COMMAND, MarkdownPlugin, MathPlugin, MentionPlugin, REMOVE_LIST_COMMAND, ReactAutoCompletePlugin, ReactBlockPlugin, ReactCodePlugin, ReactCodeblockPlugin, ReactCodemirrorPlugin, ReactCollaborationPlugin, ReactCollapsiblePlugin, ReactEditor, ReactEditorContent, ReactFilePlugin, ReactHRPlugin, ReactImagePlugin, ReactLinkHighlightPlugin, ReactLinkPlugin, ReactListPlugin, ReactLiteXmlPlugin, ReactMarkdownPlugin, ReactMathPlugin, ReactMentionPlugin, ReactNodePlugin, ReactPlainText, ReactSlashOption, ReactSlashPlugin, ReactTablePlugin, ReactTocPlugin, ReactToolbarPlugin, ReactVirtualBlockPlugin, ReactYjsPlugin, SELECT_AFTER_CODEMIRROR_COMMAND, SELECT_BEFORE_CODEMIRROR_COMMAND, SELECT_TABLE_COMMAND, SHOW_TOOLBAR_COMMAND, SlashMenu, SlashPlugin, TableControllerMenuService, TablePlugin, TocPlugin, TocService, UPDATE_CODEBLOCK_LANG, UPDATE_COLLAPSIBLE_COMMAND, UPDATE_LIST_START_COMMAND, UPLOAD_PRIORITY_HIGH, UPLOAD_PRIORITY_LOW, UPLOAD_PRIORITY_MEDIUM, UploadPlugin, VirtualBlockPlugin, WebSocketYjsProvider, YjsPlugin, YjsService, assert, browserDebug, buildTocTree, bundledLanguagesInfo, compareNodeOrder, createDebugLogger, createEmptyEditorState, createHeadlessEditor, createWebSocketYjsProvider, cursorNodeSerialized, debugLogger, debugLoggers, detectCodeLanguage, detectLanguage, devConsole, disableHotReload, enableHotReload, extractContentBlocks, extractMediaFromEditorState, extractMediaLists, fetchWebSocketDemoDocument, flattenSlashOptions, flattenTocTree, genServiceId, generateEditorId, getHotkeyById, getKernelFromEditor, getKernelFromEditorConfig, getNodeKeyFromDOMNode, getNodeTitle, getNodeUrl, getParentElement, isDOMNode, isDocumentFragment, isPunctuationChar, isPureUrl, isSlashDividerOption, isSlashMenuOption, isSlashSectionOption, isValidUrl, moment, noop, normalizeProtocol, normalizeSchemaLinkNode, prodSafeLogger, reconcileDecorator, registerBlockMoveCommand, registerEditorKernel, registerLinkHighlightCommand, registerToolbarCommand, resetRandomKey, saveWebSocketDemoDocument, scrollIntoView, snapshotWebSocketDemoDocument, unregisterEditorKernel, useHasDiffNode, useLexicalComposerContext, useLexicalEditor, useToc };
153
+ export { $closest, $closestNodeType, $createCollapsibleNode, $createCursorNode, $getNearestNodeFromDOMNode, $getNodeById, $getNodeFromDOMNode, $getNodeId, $isCardLikeElementNode, $isCollapsibleNode, $isCursorNode, ANCHOR_PADDING_CSS_VAR, AutoCompletePlugin, BlockMenuService, BlockPlugin, CONTENT_BLOCKS_DATA_TYPE, CardLikeElementNode, CodePlugin, CodeblockPlugin, CodemirrorEditLockService, CodemirrorPlugin, CollapsibleNode, CollapsiblePlugin, CommonPlugin, ContentBlocksDataSource, ContentBlocksPlugin, DEFAULT_BLOCK_ANCHOR_PADDING, DEFAULT_HEADLESS_EDITOR_PLUGINS, DOM_DOCUMENT_FRAGMENT_TYPE, DOM_DOCUMENT_TYPE, DOM_ELEMENT_TYPE, DOM_TEXT_TYPE, DataSource, DiffAction, EDITOR_THEME_KEY, FilePlugin, GET_MARKDOWN_SELECTION_COMMAND, HIDE_TOOLBAR_COMMAND, HOVER_COMMAND, HRPlugin, HeadlessEditor, HotkeyEnum, HotkeyScopeEnum, IBlockMenuService, ICodemirrorEditLockService, ILinkService, ILitexmlService, IMarkdownShortCutService, INSERT_CHECK_LIST_COMMAND, INSERT_CODEINLINE_COMMAND, INSERT_CODEMIRROR_COMMAND, INSERT_COLLAPSIBLE_COMMAND, INSERT_FILE_COMMAND, INSERT_HEADING_COMMAND, INSERT_HORIZONTAL_RULE_COMMAND, INSERT_IMAGE_COMMAND, INSERT_LINK_COMMAND, INSERT_LINK_HIGHLIGHT_COMMAND, INSERT_MARKDOWN_COMMAND, INSERT_MATH_COMMAND, INSERT_MENTION_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_QUOTE_COMMAND, INSERT_TABLE_COLUMN_COMMAND, INSERT_TABLE_COMMAND, INSERT_TABLE_ROW_COMMAND, INSERT_UNORDERED_LIST_COMMAND, INodeIdentityService, INodePlugin, INodeService, ITableControllerMenuService, ITocService, IUploadService, IYjsService, ImagePlugin, Kernel, KeyEnum, LITEXML_APPLY_COMMAND, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_MODIFY_WITH_RESULTS_COMMAND, LITEXML_REMOVE_COMMAND, LexicalErrorBoundary, LexicalPortalContainer, LinkHighlightPlugin, LinkPlugin, ListPlugin, LitexmlDataSource, LitexmlPlugin, LitexmlService, MARKDOWN_READER_LEVEL_HIGH, MARKDOWN_READER_LEVEL_NORMAL, MARKDOWN_WRITER_LEVEL_MAX, MOVE_BLOCK_COMMAND, MarkdownPlugin, MathPlugin, MentionPlugin, REMOVE_LIST_COMMAND, ReactAutoCompletePlugin, ReactBlockPlugin, ReactCodePlugin, ReactCodeblockPlugin, ReactCodemirrorPlugin, ReactCollaborationPlugin, ReactCollapsiblePlugin, ReactEditor, ReactEditorContent, ReactFilePlugin, ReactHRPlugin, ReactImagePlugin, ReactLinkHighlightPlugin, ReactLinkPlugin, ReactListPlugin, ReactLiteXmlPlugin, ReactMarkdownPlugin, ReactMathPlugin, ReactMentionPlugin, ReactNodePlugin, ReactPlainText, ReactSlashOption, ReactSlashPlugin, ReactTablePlugin, ReactTocPlugin, ReactToolbarPlugin, ReactVirtualBlockPlugin, ReactYjsPlugin, SELECT_AFTER_CODEMIRROR_COMMAND, SELECT_BEFORE_CODEMIRROR_COMMAND, SELECT_TABLE_COMMAND, SHOW_TOOLBAR_COMMAND, SlashMenu, SlashPlugin, TableControllerMenuService, TablePlugin, TocPlugin, TocService, UPDATE_CODEBLOCK_LANG, UPDATE_COLLAPSIBLE_COMMAND, UPDATE_LIST_START_COMMAND, UPLOAD_PRIORITY_HIGH, UPLOAD_PRIORITY_LOW, UPLOAD_PRIORITY_MEDIUM, UploadPlugin, VirtualBlockPlugin, WebSocketYjsProvider, YjsPlugin, YjsService, assert, browserDebug, buildTocTree, bundledLanguagesInfo, compareNodeOrder, createDebugLogger, createEmptyEditorState, createHeadlessEditor, createWebSocketYjsProvider, cursorNodeSerialized, debugLogger, debugLoggers, detectCodeLanguage, detectLanguage, devConsole, disableHotReload, enableHotReload, extractContentBlocks, extractMediaFromEditorState, extractMediaLists, fetchWebSocketDemoDocument, flattenSlashOptions, flattenTocTree, genServiceId, generateEditorId, getHotkeyById, getKernelFromEditor, getKernelFromEditorConfig, getNodeKeyFromDOMNode, getNodeTitle, getNodeUrl, getParentElement, isDOMNode, isDocumentFragment, isPunctuationChar, isPureUrl, isSlashDividerOption, isSlashMenuOption, isSlashSectionOption, isValidUrl, moment, noop, normalizeProtocol, normalizeSchemaLinkNode, prodSafeLogger, reconcileDecorator, registerBlockMoveCommand, registerEditorKernel, registerLinkHighlightCommand, registerToolbarCommand, resetRandomKey, saveWebSocketDemoDocument, scrollIntoView, snapshotWebSocketDemoDocument, unregisterEditorKernel, useHasDiffNode, useLexicalComposerContext, useLexicalEditor, useToc };
@@ -19,7 +19,6 @@ import { cx } from "antd-style";
19
19
  import { $findTableNode, $isTableSelection } from "@lexical/table";
20
20
  import { $getNodeByKey, $getSelection, $isRangeSelection } from "lexical";
21
21
  import { createPortal } from "react-dom";
22
- import { theme } from "antd";
23
22
  //#region src/plugins/block/react/ReactBlockPlugin.tsx
24
23
  init_debug();
25
24
  const logger = createDebugLogger("plugin", "block-react");
@@ -46,7 +45,6 @@ const getElementDepth = (element, stopAt) => {
46
45
  return depth;
47
46
  };
48
47
  const ReactBlockPlugin = (props) => {
49
- const { token } = theme.useToken();
50
48
  const [editor] = useLexicalComposerContext();
51
49
  const appElement = useAppElement();
52
50
  const { rootClassName, className, attributeName, anchorPadding, locale, onHoverBlockChange, onDragTargetChange, onDragTargetResolve } = props;
@@ -668,7 +666,6 @@ const ReactBlockPlugin = (props) => {
668
666
  return /* @__PURE__ */ jsxs(Fragment, { children: [dragLayerContainer ? createPortal(dragLayerNode, dragLayerContainer) : dragLayerNode, shouldRenderPortal && createPortal(/* @__PURE__ */ jsxs(Fragment, { children: [menuNode, dragIndicator && /* @__PURE__ */ jsx("div", {
669
667
  className: styles.dragIndicator,
670
668
  style: {
671
- backgroundColor: token.colorPrimary,
672
669
  left: dragIndicator.left,
673
670
  top: dragIndicator.top,
674
671
  width: dragIndicator.width