@lobehub/editor 4.21.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.
Files changed (303) hide show
  1. package/README.md +16 -15
  2. package/es/_virtual/_rolldown/runtime.js +8 -1
  3. package/es/codemirror/components/CopyButton.d.ts +0 -1
  4. package/es/codemirror/components/LanguageSelect.d.ts +0 -1
  5. package/es/codemirror/components/MoreOptions.d.ts +0 -1
  6. package/es/codemirror/components/Toolbar.d.ts +0 -1
  7. package/es/codemirror/constants.d.ts +0 -1
  8. package/es/codemirror/types.d.ts +0 -1
  9. package/es/common/sys.js +1 -1
  10. package/es/editor-kernel/data-source.d.ts +1 -2
  11. package/es/editor-kernel/event.d.ts +1 -3
  12. package/es/editor-kernel/index.d.ts +3 -2
  13. package/es/editor-kernel/index.js +4 -4
  14. package/es/editor-kernel/inode/i-element-node.d.ts +0 -1
  15. package/es/editor-kernel/inode/i-node.d.ts +0 -1
  16. package/es/editor-kernel/inode/index.d.ts +3 -1
  17. package/es/editor-kernel/inode/paragraph-node.d.ts +1 -1
  18. package/es/editor-kernel/inode/root-node.d.ts +0 -1
  19. package/es/editor-kernel/inode/text-node.d.ts +0 -1
  20. package/es/editor-kernel/kernel.d.ts +1 -2
  21. package/es/editor-kernel/react/LexicalErrorBoundary.d.ts +2 -6
  22. package/es/editor-kernel/react/PortalContainer.d.ts +7 -3
  23. package/es/editor-kernel/react/PortalContainer.js +4 -4
  24. package/es/editor-kernel/react/index.d.ts +2 -1
  25. package/es/editor-kernel/react/react-context.d.ts +3 -2
  26. package/es/editor-kernel/react/react-editor.d.ts +2 -2
  27. package/es/editor-kernel/react/useDecorators.js +3 -2
  28. package/es/editor-kernel/react/useLexicalEditor.d.ts +0 -1
  29. package/es/editor-kernel/react/useLexicalEditor.js +1 -1
  30. package/es/editor-kernel/utils.d.ts +2 -3
  31. package/es/headless/extract-media-from-editor-state.d.ts +0 -1
  32. package/es/headless/extract-media-from-editor-state.js +1 -1
  33. package/es/headless/index.d.ts +3 -2
  34. package/es/headless/index.js +4 -3
  35. package/es/headless.d.ts +2 -3
  36. package/es/headless.js +20 -41
  37. package/es/index.d.ts +45 -21
  38. package/es/index.js +6 -6
  39. package/es/locale/index.d.ts +1 -1
  40. package/es/node_modules/.pnpm/@types_mdast@4.0.4/node_modules/@types/mdast/index.d.ts +1 -2
  41. package/es/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts +1 -1
  42. package/es/plugins/auto-complete/index.d.ts +3 -1
  43. package/es/plugins/auto-complete/node/placeholderNode.js +1 -1
  44. package/es/plugins/auto-complete/plugin/index.d.ts +2 -1
  45. package/es/plugins/auto-complete/react/ReactAutoCompletePlugin.d.ts +1 -2
  46. package/es/plugins/auto-complete/react/index.d.ts +2 -1
  47. package/es/plugins/auto-complete/react/type.d.ts +1 -0
  48. package/es/plugins/block/command/index.d.ts +1 -3
  49. package/es/plugins/block/index.d.ts +5 -2
  50. package/es/plugins/block/plugin/index.d.ts +1 -0
  51. package/es/plugins/block/react/ReactBlockPlugin.d.ts +3 -2
  52. package/es/plugins/block/react/ReactBlockPlugin.js +5 -3
  53. package/es/plugins/block/react/core/types.d.ts +0 -1
  54. package/es/plugins/block/react/index.d.ts +3 -2
  55. package/es/plugins/block/service/i-block-menu-service.d.ts +1 -1
  56. package/es/plugins/block/service/i-block-menu-service.js +2 -1
  57. package/es/plugins/block/service/index.d.ts +2 -1
  58. package/es/plugins/code/command/index.d.ts +1 -3
  59. package/es/plugins/code/index.d.ts +3 -1
  60. package/es/plugins/code/plugin/index.d.ts +2 -1
  61. package/es/plugins/code/react/CodeReactPlugin.d.ts +1 -2
  62. package/es/plugins/code/react/index.d.ts +2 -1
  63. package/es/plugins/codeblock/command/index.d.ts +3 -1
  64. package/es/plugins/codeblock/command/index.js +1 -1
  65. package/es/plugins/codeblock/command/symbols.d.ts +1 -3
  66. package/es/plugins/codeblock/index.d.ts +3 -1
  67. package/es/plugins/codeblock/index.js +4 -4
  68. package/es/plugins/codeblock/plugin/index.d.ts +1 -0
  69. package/es/plugins/codeblock/react/ReactCodeblockPlugin.d.ts +1 -2
  70. package/es/plugins/codeblock/react/ReactCodeblockPlugin.js +1 -1
  71. package/es/plugins/codeblock/react/index.d.ts +2 -1
  72. package/es/plugins/codeblock/react/style.js +0 -1
  73. package/es/plugins/codeblock/react/type.d.ts +1 -0
  74. package/es/plugins/codemirror-block/command/index.d.ts +3 -5
  75. package/es/plugins/codemirror-block/index.d.ts +3 -1
  76. package/es/plugins/codemirror-block/node/CodeMirrorNode.d.ts +1 -2
  77. package/es/plugins/codemirror-block/plugin/index.d.ts +1 -1
  78. package/es/plugins/codemirror-block/react/ReactCodemirrorNode.d.ts +1 -2
  79. package/es/plugins/codemirror-block/react/index.d.ts +2 -1
  80. package/es/plugins/collaboration/index.d.ts +3 -1
  81. package/es/plugins/collaboration/react/ReactCollaborationPlugin.d.ts +1 -2
  82. package/es/plugins/collaboration/react/ReactCollaborationPlugin.js +1 -1
  83. package/es/plugins/collaboration/react/index.d.ts +2 -1
  84. package/es/plugins/collaboration/react/type.d.ts +0 -1
  85. package/es/plugins/collaboration/utils.d.ts +0 -1
  86. package/es/plugins/collaboration/utils.js +1 -1
  87. package/es/plugins/common/command/index.d.ts +2 -4
  88. package/es/plugins/common/data-source/json-data-source.js +1 -1
  89. package/es/plugins/common/index.d.ts +4 -2
  90. package/es/plugins/common/node/cursor.d.ts +1 -2
  91. package/es/plugins/common/plugin/index.d.ts +1 -1
  92. package/es/plugins/common/plugin/index.js +2 -1
  93. package/es/plugins/common/plugin/paste-handler.d.ts +0 -1
  94. package/es/plugins/common/plugin/register.js +4 -3
  95. package/es/plugins/common/react/Placeholder/index.js +2 -1
  96. package/es/plugins/common/react/ReactEditorContent.d.ts +1 -2
  97. package/es/plugins/common/react/ReactPlainText.d.ts +2 -4
  98. package/es/plugins/common/react/index.d.ts +3 -2
  99. package/es/plugins/common/react/type.d.ts +2 -1
  100. package/es/plugins/common/utils/index.js +1 -1
  101. package/es/plugins/content-blocks/data-source/content-blocks-data-source.d.ts +2 -2
  102. package/es/plugins/content-blocks/index.d.ts +2 -1
  103. package/es/plugins/content-blocks/plugin/index.d.ts +1 -1
  104. package/es/plugins/content-blocks/types.d.ts +1 -2
  105. package/es/plugins/content-blocks/utils/extract-media-lists.d.ts +0 -1
  106. package/es/plugins/content-blocks/utils/extract.d.ts +0 -1
  107. package/es/plugins/content-blocks/utils/extract.js +2 -2
  108. package/es/plugins/file/command/index.d.ts +1 -3
  109. package/es/plugins/file/index.d.ts +3 -1
  110. package/es/plugins/file/node/FileNode.d.ts +1 -2
  111. package/es/plugins/file/plugin/index.d.ts +1 -1
  112. package/es/plugins/file/react/ReactFilePlugin.d.ts +1 -2
  113. package/es/plugins/file/react/index.d.ts +2 -1
  114. package/es/plugins/file/react/type.d.ts +1 -1
  115. package/es/plugins/hr/command/index.d.ts +1 -3
  116. package/es/plugins/hr/index.d.ts +3 -1
  117. package/es/plugins/hr/node/HorizontalRuleNode.d.ts +1 -2
  118. package/es/plugins/hr/plugin/index.d.ts +1 -1
  119. package/es/plugins/hr/react/ReactHRPlugin.d.ts +1 -2
  120. package/es/plugins/hr/react/index.d.ts +2 -1
  121. package/es/plugins/image/command/index.d.ts +1 -3
  122. package/es/plugins/image/index.d.ts +3 -1
  123. package/es/plugins/image/node/basie-image-node.d.ts +0 -1
  124. package/es/plugins/image/node/block-image-node.d.ts +0 -1
  125. package/es/plugins/image/node/image-node.d.ts +0 -1
  126. package/es/plugins/image/plugin/index.d.ts +1 -1
  127. package/es/plugins/image/react/ReactImagePlugin.d.ts +1 -2
  128. package/es/plugins/image/react/components/Image.js +4 -2
  129. package/es/plugins/image/react/components/style.js +3 -3
  130. package/es/plugins/image/react/components/useSupenseImage.js +1 -1
  131. package/es/plugins/image/react/index.d.ts +2 -1
  132. package/es/plugins/inode/index.d.ts +2 -1
  133. package/es/plugins/inode/plugin/index.d.ts +1 -0
  134. package/es/plugins/inode/react/index.d.ts +1 -2
  135. package/es/plugins/inode/react/index.js +1 -1
  136. package/es/plugins/inode/service/index.d.ts +2 -0
  137. package/es/plugins/inode/service/index.js +2 -1
  138. package/es/plugins/link/command/index.d.ts +1 -3
  139. package/es/plugins/link/index.d.ts +3 -1
  140. package/es/plugins/link/node/LinkNode.d.ts +0 -1
  141. package/es/plugins/link/node/LinkNode.js +2 -2
  142. package/es/plugins/link/plugin/index.d.ts +1 -1
  143. package/es/plugins/link/plugin/registry.js +2 -1
  144. package/es/plugins/link/react/ReactLinkPlugin.d.ts +1 -2
  145. package/es/plugins/link/react/ReactLinkPlugin.js +1 -1
  146. package/es/plugins/link/react/index.d.ts +2 -1
  147. package/es/plugins/link/react/type.d.ts +0 -1
  148. package/es/plugins/link/service/i-link-service.d.ts +1 -1
  149. package/es/plugins/link/service/i-link-service.js +2 -1
  150. package/es/plugins/link/utils/index.js +1 -1
  151. package/es/plugins/link-highlight/command/index.d.ts +1 -3
  152. package/es/plugins/link-highlight/index.d.ts +3 -1
  153. package/es/plugins/link-highlight/plugin/index.d.ts +1 -0
  154. package/es/plugins/link-highlight/react/ReactLinkHighlightPlugin.d.ts +1 -2
  155. package/es/plugins/link-highlight/react/index.d.ts +2 -1
  156. package/es/plugins/list/command/index.d.ts +1 -1
  157. package/es/plugins/list/command/index.js +2 -2
  158. package/es/plugins/list/index.d.ts +3 -1
  159. package/es/plugins/list/plugin/checkList.d.ts +0 -1
  160. package/es/plugins/list/plugin/checkList.js +0 -7
  161. package/es/plugins/list/plugin/index.d.ts +1 -0
  162. package/es/plugins/list/react/ReactListPlugin.d.ts +1 -2
  163. package/es/plugins/list/react/index.d.ts +2 -1
  164. package/es/plugins/list/react/style.js +1 -1
  165. package/es/plugins/litexml/command/diffCommand.d.ts +2 -1
  166. package/es/plugins/litexml/command/diffCommand.js +2 -2
  167. package/es/plugins/litexml/command/index.d.ts +3 -1
  168. package/es/plugins/litexml/command/index.js +3 -2
  169. package/es/plugins/litexml/command/symbols.d.ts +6 -8
  170. package/es/plugins/litexml/data-source/litexml-data-source.d.ts +4 -3
  171. package/es/plugins/litexml/data-source/litexml-data-source.js +4 -2
  172. package/es/plugins/litexml/index.d.ts +5 -2
  173. package/es/plugins/litexml/node/DiffNode.d.ts +1 -2
  174. package/es/plugins/litexml/plugin/index.d.ts +1 -1
  175. package/es/plugins/litexml/react/DiffNodeToolbar/index.js +1 -1
  176. package/es/plugins/litexml/react/hooks/useHasDiffNode.d.ts +1 -0
  177. package/es/plugins/litexml/react/index.d.ts +1 -2
  178. package/es/plugins/litexml/react/index.js +1 -1
  179. package/es/plugins/litexml/service/litexml-service.d.ts +3 -3
  180. package/es/plugins/litexml/service/litexml-service.js +2 -1
  181. package/es/plugins/markdown/command/index.d.ts +4 -4
  182. package/es/plugins/markdown/data-source/markdown/parse.d.ts +3 -3
  183. package/es/plugins/markdown/data-source/markdown/parse.js +2 -2
  184. package/es/plugins/markdown/data-source/markdown-data-source.js +1 -1
  185. package/es/plugins/markdown/index.d.ts +3 -2
  186. package/es/plugins/markdown/plugin/index.d.ts +2 -1
  187. package/es/plugins/markdown/react/index.d.ts +1 -2
  188. package/es/plugins/markdown/service/shortcut.d.ts +2 -2
  189. package/es/plugins/markdown/service/shortcut.js +2 -1
  190. package/es/plugins/markdown/service/transformers.d.ts +1 -3
  191. package/es/plugins/markdown/utils/index.d.ts +1 -1
  192. package/es/plugins/markdown/utils/index.js +1 -1
  193. package/es/plugins/math/command/index.d.ts +1 -3
  194. package/es/plugins/math/index.d.ts +2 -1
  195. package/es/plugins/math/node/index.d.ts +1 -2
  196. package/es/plugins/math/node/index.js +3 -2
  197. package/es/plugins/math/plugin/index.d.ts +2 -2
  198. package/es/plugins/math/react/components/MathEditorContent.js +2 -1
  199. package/es/plugins/math/react/components/MathInline.js +2 -2
  200. package/es/plugins/math/react/index.d.ts +0 -1
  201. package/es/plugins/math/react/type.d.ts +0 -1
  202. package/es/plugins/mention/command/index.d.ts +1 -3
  203. package/es/plugins/mention/index.d.ts +3 -1
  204. package/es/plugins/mention/node/MentionNode.d.ts +0 -1
  205. package/es/plugins/mention/plugin/index.d.ts +2 -1
  206. package/es/plugins/mention/react/ReactMentionPlugin.d.ts +1 -2
  207. package/es/plugins/mention/react/index.d.ts +2 -1
  208. package/es/plugins/mention/react/type.d.ts +0 -1
  209. package/es/plugins/slash/index.d.ts +5 -3
  210. package/es/plugins/slash/plugin/index.d.ts +1 -1
  211. package/es/plugins/slash/react/ReactSlashOption.d.ts +1 -2
  212. package/es/plugins/slash/react/ReactSlashPlugin.d.ts +1 -2
  213. package/es/plugins/slash/react/ReactSlashPlugin.js +2 -1
  214. package/es/plugins/slash/react/components/SlashMenu.d.ts +1 -2
  215. package/es/plugins/slash/react/index.d.ts +4 -3
  216. package/es/plugins/slash/react/type.d.ts +2 -1
  217. package/es/plugins/slash/service/i-slash-service.d.ts +2 -1
  218. package/es/plugins/slash/service/i-slash-service.js +2 -1
  219. package/es/plugins/slash/utils/utils.js +1 -1
  220. package/es/plugins/table/command/index.d.ts +4 -6
  221. package/es/plugins/table/command/index.js +4 -4
  222. package/es/plugins/table/index.d.ts +3 -1
  223. package/es/plugins/table/node/index.js +2 -1
  224. package/es/plugins/table/plugin/index.d.ts +1 -1
  225. package/es/plugins/table/plugin/index.js +1 -2
  226. package/es/plugins/table/react/TableActionMenu/index.js +0 -7
  227. package/es/plugins/table/react/TableColController.js +2 -2
  228. package/es/plugins/table/react/TableController/hooks.js +3 -2
  229. package/es/plugins/table/react/TableHoverActions/utils.js +1 -1
  230. package/es/plugins/table/react/TableResize/index.js +1 -1
  231. package/es/plugins/table/react/TableRowController.js +1 -1
  232. package/es/plugins/table/react/hooks.js +0 -7
  233. package/es/plugins/table/react/index.d.ts +0 -1
  234. package/es/plugins/table/react/index.js +1 -1
  235. package/es/plugins/table/react/type.d.ts +2 -1
  236. package/es/plugins/table/service/i-table-controller-menu-service.d.ts +1 -1
  237. package/es/plugins/table/service/i-table-controller-menu-service.js +2 -1
  238. package/es/plugins/table/service/index.d.ts +2 -1
  239. package/es/plugins/table/utils/index.js +1 -1
  240. package/es/plugins/toolbar/command/index.d.ts +0 -1
  241. package/es/plugins/toolbar/index.d.ts +2 -1
  242. package/es/plugins/toolbar/react/index.d.ts +0 -1
  243. package/es/plugins/toolbar/react/type.d.ts +0 -1
  244. package/es/plugins/upload/index.d.ts +2 -1
  245. package/es/plugins/upload/plugin/index.d.ts +1 -0
  246. package/es/plugins/upload/service/i-upload-service.d.ts +2 -1
  247. package/es/plugins/upload/service/i-upload-service.js +2 -1
  248. package/es/plugins/virtual-block/index.d.ts +3 -1
  249. package/es/plugins/virtual-block/plugin/index.d.ts +1 -0
  250. package/es/plugins/virtual-block/plugin/register.js +3 -2
  251. package/es/plugins/virtual-block/react/ReactVirtualBlock.d.ts +1 -2
  252. package/es/plugins/virtual-block/react/index.d.ts +2 -1
  253. package/es/react/ChatInput/ChatInput.d.ts +1 -2
  254. package/es/react/ChatInput/ChatInput.js +2 -1
  255. package/es/react/ChatInput/index.d.ts +2 -1
  256. package/es/react/ChatInput/type.d.ts +0 -1
  257. package/es/react/ChatInputActionBar/ChatInputActionBar.d.ts +1 -2
  258. package/es/react/ChatInputActionBar/index.d.ts +2 -1
  259. package/es/react/ChatInputActionBar/type.d.ts +0 -1
  260. package/es/react/ChatInputActions/ChatInputActions.d.ts +2 -4
  261. package/es/react/ChatInputActions/index.d.ts +2 -1
  262. package/es/react/ChatInputActions/type.d.ts +0 -1
  263. package/es/react/CodeLanguageSelect/CodeLanguageSelect.d.ts +1 -2
  264. package/es/react/CodeLanguageSelect/index.d.ts +2 -1
  265. package/es/react/CodeLanguageSelect/type.d.ts +0 -1
  266. package/es/react/Editor/Editor.js +1 -1
  267. package/es/react/Editor/index.d.ts +1 -2
  268. package/es/react/Editor/index.js +1 -1
  269. package/es/react/Editor/type.d.ts +5 -1
  270. package/es/react/Editor/utils.d.ts +0 -1
  271. package/es/react/EditorProvider/index.d.ts +2 -7
  272. package/es/react/EditorProvider/index.js +1 -1
  273. package/es/react/FloatActions/FloatActions.d.ts +1 -2
  274. package/es/react/FloatActions/index.d.ts +2 -1
  275. package/es/react/FloatActions/type.d.ts +0 -1
  276. package/es/react/SendButton/SendButton.d.ts +1 -2
  277. package/es/react/SendButton/index.d.ts +2 -1
  278. package/es/react/SendButton/type.d.ts +0 -1
  279. package/es/react/hooks/useEditor.d.ts +1 -0
  280. package/es/react/hooks/useEditorState/index.d.ts +1 -0
  281. package/es/react/hooks/useEditorState/index.js +8 -4
  282. package/es/react.d.ts +14 -7
  283. package/es/renderer/LexicalDiff.d.ts +1 -16
  284. package/es/renderer/LexicalDiff.js +1 -1
  285. package/es/renderer/LexicalRenderer.d.ts +1 -11
  286. package/es/renderer/diff/style.js +1 -1
  287. package/es/renderer/diff/types.d.ts +0 -1
  288. package/es/renderer/engine/render-builtin-node.js +1 -1
  289. package/es/renderer/nodes/index.d.ts +0 -1
  290. package/es/renderer/renderers/index.d.ts +0 -1
  291. package/es/renderer/renderers/index.js +1 -1
  292. package/es/renderer/renderers/math.js +2 -2
  293. package/es/renderer/types.d.ts +0 -1
  294. package/es/{symbols-DEEvsKq4.d.ts → symbols-Do7jD4Tt.d.ts} +6 -8
  295. package/es/types/hotkey.d.ts +0 -1
  296. package/es/types/index.d.ts +2 -1
  297. package/es/types/kernel.d.ts +1 -2
  298. package/es/types/locale.d.ts +2 -3
  299. package/es/utils/debug.d.ts +1 -2
  300. package/es/utils/debug.js +1 -1
  301. package/es/utils/hotkey/parseHotkeys.js +1 -1
  302. package/es/utils/hotkey/registerHotkey.d.ts +0 -1
  303. package/package.json +19 -19
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.querySelectorAll(":scope > li").forEach((li) => {
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(li, listItem);
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
- let htmlStack = [];
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
- let lastElement = [];
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
- let lastElement = [];
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
- state.isLink = $isLinkNode(node.getParent()) || $isLinkNode(node);
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?.[lastRow.length - 1]?.cell;
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?.[row.length - 1]?.cell;
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?.[lastRow.length - 1]?.cell;
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?.[lastRow.length - 1]?.cell;
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 lastRow = [...tableMap].reverse().find((row) => row.length > 0);
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();
package/es/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { DataSource } from "./editor-kernel/data-source.js";
1
+ import DataSource from "./editor-kernel/data-source.js";
2
2
  import { HotkeyEnum, HotkeyId, HotkeyItem, HotkeyScopeEnum, HotkeyScopeId, KeyEnum, ModifierCombination } from "./types/hotkey.js";
3
3
  import { getHotkeyById } from "./utils/hotkey/registerHotkey.js";
4
4
  import { IEditor } from "./types/kernel.js";
5
+ import "./types/index.js";
5
6
  import { $closest, $closestNodeType, $getNearestNodeFromDOMNode, $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 "./editor-kernel/utils.js";
6
7
  import { HOVER_COMMAND } from "./editor-kernel/event.js";
7
8
  import { resetRandomKey } from "./editor-kernel/index.js";
@@ -10,22 +11,26 @@ import { LexicalPortalContainer } from "./editor-kernel/react/PortalContainer.js
10
11
  import { useLexicalComposerContext } from "./editor-kernel/react/react-context.js";
11
12
  import { ReactEditor } from "./editor-kernel/react/react-editor.js";
12
13
  import { useLexicalEditor } from "./editor-kernel/react/useLexicalEditor.js";
14
+ import "./editor-kernel/react/index.js";
13
15
  import { ILitexmlService, LitexmlService, XMLReaderFunc, XMLReaderRecord, XMLWriterFunc, XMLWriterRecord } from "./plugins/litexml/service/litexml-service.js";
14
- import { LitexmlDataSource } from "./plugins/litexml/data-source/litexml-data-source.js";
16
+ import LitexmlDataSource from "./plugins/litexml/data-source/litexml-data-source.js";
15
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";
16
18
  import { FileListItem, ImageListItem, MediaLists, extractMediaFromEditorState } from "./headless/extract-media-from-editor-state.js";
17
19
  import { DEFAULT_HEADLESS_EDITOR_PLUGINS, HeadlessDocumentType, HeadlessEditor, HeadlessEditorExport, HeadlessEditorExportOptions, HeadlessEditorHydrationInput, HeadlessEditorOptions, HeadlessLiteXMLBatchOperation, HeadlessLiteXMLInsertOperation, HeadlessLiteXMLOperation, HeadlessLiteXMLRemoveOperation, HeadlessLiteXMLReplaceOperation, createHeadlessEditor } from "./headless/index.js";
18
20
  import { AutoCompletePlugin } from "./plugins/auto-complete/plugin/index.js";
19
- import { ReactAutoCompletePlugin } from "./plugins/auto-complete/react/ReactAutoCompletePlugin.js";
21
+ import ReactAutoCompletePlugin from "./plugins/auto-complete/react/ReactAutoCompletePlugin.js";
22
+ import "./plugins/auto-complete/index.js";
20
23
  import { BlockMovePayload, MOVE_BLOCK_COMMAND, registerBlockMoveCommand } from "./plugins/block/command/index.js";
21
24
  import { BlockPlugin, BlockPluginOptions } from "./plugins/block/plugin/index.js";
22
25
  import { BlockDragTarget } from "./plugins/block/react/core/types.js";
23
26
  import { BlockMenuService, IBlockActionButton, IBlockActionButtonIcon, IBlockMenuItem, IBlockMenuRenderContext, IBlockMenuService, IBlockSelectHandler } from "./plugins/block/service/i-block-menu-service.js";
24
- import { ReactBlockPlugin, ReactBlockPluginProps } from "./plugins/block/react/ReactBlockPlugin.js";
27
+ import ReactBlockPlugin, { ReactBlockPluginProps } from "./plugins/block/react/ReactBlockPlugin.js";
25
28
  import { ANCHOR_PADDING_CSS_VAR, DEFAULT_BLOCK_ANCHOR_PADDING } from "./plugins/block/react/style.js";
29
+ import "./plugins/block/index.js";
26
30
  import { INSERT_CODEINLINE_COMMAND } from "./plugins/code/command/index.js";
27
31
  import { CodePlugin } from "./plugins/code/plugin/index.js";
28
- import { ReactCodePlugin } from "./plugins/code/react/CodeReactPlugin.js";
32
+ import ReactCodePlugin from "./plugins/code/react/CodeReactPlugin.js";
33
+ import "./plugins/code/index.js";
29
34
  import { UPDATE_CODEBLOCK_LANG } from "./plugins/codeblock/command/symbols.js";
30
35
  import { CodeblockPlugin, CodeblockPluginOptions } from "./plugins/codeblock/plugin/index.js";
31
36
  import { ReactCodeblockPluginProps } from "./plugins/codeblock/react/type.js";
@@ -33,87 +38,106 @@ import { ReactCodeblockPlugin } from "./plugins/codeblock/react/ReactCodeblockPl
33
38
  import { bundledLanguagesInfo } from "./plugins/codeblock/index.js";
34
39
  import { INSERT_CODEMIRROR_COMMAND, SELECT_AFTER_CODEMIRROR_COMMAND, SELECT_BEFORE_CODEMIRROR_COMMAND } from "./plugins/codemirror-block/command/index.js";
35
40
  import { CodemirrorPlugin, CodemirrorPluginOptions } from "./plugins/codemirror-block/plugin/index.js";
36
- import { ReactCodemirrorPlugin } from "./plugins/codemirror-block/react/ReactCodemirrorNode.js";
41
+ import ReactCodemirrorPlugin from "./plugins/codemirror-block/react/ReactCodemirrorNode.js";
42
+ import "./plugins/codemirror-block/index.js";
37
43
  import { CollaborationUser } from "./plugins/collaboration/utils.js";
38
44
  import { CollaborationProviderFactory, EditorCollaborationConfig, ReactCollaborationPluginProps } from "./plugins/collaboration/react/type.js";
39
45
  import { ReactCollaborationPlugin } from "./plugins/collaboration/react/ReactCollaborationPlugin.js";
46
+ import "./plugins/collaboration/index.js";
40
47
  import { INSERT_HEADING_COMMAND, INSERT_QUOTE_COMMAND } from "./plugins/common/command/index.js";
41
48
  import { $createCursorNode, $isCardLikeElementNode, $isCursorNode, CardLikeElementNode, cursorNodeSerialized } from "./plugins/common/node/cursor.js";
42
49
  import { CommonPlugin, CommonPluginOptions } from "./plugins/common/plugin/index.js";
43
50
  import { ReactEditorContentProps, ReactPlainTextProps } from "./plugins/common/react/type.js";
44
- import { ReactEditorContent } from "./plugins/common/react/ReactEditorContent.js";
45
- import { ReactPlainText } from "./plugins/common/react/ReactPlainText.js";
51
+ import ReactEditorContent from "./plugins/common/react/ReactEditorContent.js";
52
+ import ReactPlainText from "./plugins/common/react/ReactPlainText.js";
53
+ import "./plugins/common/index.js";
46
54
  import { IMarkdownShortCutService, MARKDOWN_READER_LEVEL, MARKDOWN_READER_LEVEL_HIGH, MARKDOWN_READER_LEVEL_NORMAL, MARKDOWN_WRITER_LEVEL_MAX } from "./plugins/markdown/service/shortcut.js";
47
55
  import { CONTENT_BLOCKS_DATA_TYPE, ContentBlock, ExtractContentBlocksOptions, FileContentBlock, ImageContentBlock, TextContentBlock } from "./plugins/content-blocks/types.js";
48
56
  import { ContentBlocksDataSource } from "./plugins/content-blocks/data-source/content-blocks-data-source.js";
49
57
  import { ContentBlocksPlugin, ContentBlocksPluginOptions } from "./plugins/content-blocks/plugin/index.js";
50
58
  import { extractContentBlocks } from "./plugins/content-blocks/utils/extract.js";
51
59
  import { extractMediaLists } from "./plugins/content-blocks/utils/extract-media-lists.js";
60
+ import "./plugins/content-blocks/index.js";
52
61
  import { INSERT_FILE_COMMAND } from "./plugins/file/command/index.js";
53
62
  import { FilePlugin, FilePluginOptions } from "./plugins/file/plugin/index.js";
54
63
  import { ReactFilePluginProps } from "./plugins/file/react/type.js";
55
- import { ReactFilePlugin } from "./plugins/file/react/ReactFilePlugin.js";
64
+ import ReactFilePlugin from "./plugins/file/react/ReactFilePlugin.js";
65
+ import "./plugins/file/index.js";
56
66
  import { INSERT_HORIZONTAL_RULE_COMMAND } from "./plugins/hr/command/index.js";
57
67
  import { HRPlugin, HRPluginOptions } from "./plugins/hr/plugin/index.js";
58
68
  import { ReactHRPluginProps } from "./plugins/hr/react/type.js";
59
- import { ReactHRPlugin } from "./plugins/hr/react/ReactHRPlugin.js";
69
+ import ReactHRPlugin from "./plugins/hr/react/ReactHRPlugin.js";
70
+ import "./plugins/hr/index.js";
60
71
  import { INSERT_IMAGE_COMMAND } from "./plugins/image/command/index.js";
61
72
  import { ImagePlugin, ImagePluginOptions } from "./plugins/image/plugin/index.js";
62
73
  import { ReactImagePluginProps } from "./plugins/image/react/type.js";
63
- import { ReactImagePlugin } from "./plugins/image/react/ReactImagePlugin.js";
74
+ import ReactImagePlugin from "./plugins/image/react/ReactImagePlugin.js";
75
+ import "./plugins/image/index.js";
64
76
  import { INodePlugin, INodePluginOptions } from "./plugins/inode/plugin/index.js";
65
77
  import { ReactNodePlugin } from "./plugins/inode/react/index.js";
66
78
  import { INodeService } from "./plugins/inode/service/index.js";
79
+ import "./plugins/inode/index.js";
67
80
  import { INSERT_LINK_COMMAND } from "./plugins/link/command/index.js";
68
81
  import { LinkPlugin, LinkPluginOptions } from "./plugins/link/plugin/index.js";
69
82
  import { ReactLinkPluginProps } from "./plugins/link/react/type.js";
70
83
  import { ReactLinkPlugin } from "./plugins/link/react/ReactLinkPlugin.js";
71
84
  import { ILinkService } from "./plugins/link/service/i-link-service.js";
85
+ import "./plugins/link/index.js";
72
86
  import { INSERT_LINK_HIGHLIGHT_COMMAND, registerLinkHighlightCommand } from "./plugins/link-highlight/command/index.js";
73
87
  import { LinkHighlightPlugin, LinkHighlightPluginOptions } from "./plugins/link-highlight/plugin/index.js";
74
- import { ReactLinkHighlightPlugin } from "./plugins/link-highlight/react/ReactLinkHighlightPlugin.js";
88
+ import ReactLinkHighlightPlugin from "./plugins/link-highlight/react/ReactLinkHighlightPlugin.js";
89
+ import "./plugins/link-highlight/index.js";
75
90
  import { INSERT_CHECK_LIST_COMMAND } from "./plugins/list/plugin/checkList.js";
76
91
  import { INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND, UPDATE_LIST_START_COMMAND } from "./plugins/list/command/index.js";
77
92
  import { ListPlugin, ListPluginOptions } from "./plugins/list/plugin/index.js";
78
93
  import { ReactListPluginProps } from "./plugins/list/react/type.js";
79
- import { ReactListPlugin } from "./plugins/list/react/ReactListPlugin.js";
94
+ import ReactListPlugin from "./plugins/list/react/ReactListPlugin.js";
95
+ import "./plugins/list/index.js";
80
96
  import { LitexmlPlugin, LitexmlPluginOptions } from "./plugins/litexml/plugin/index.js";
81
97
  import { ReactLiteXmlPlugin } from "./plugins/litexml/react/index.js";
82
98
  import { useHasDiffNode } from "./plugins/litexml/react/hooks/useHasDiffNode.js";
99
+ import "./plugins/litexml/index.js";
83
100
  import { GET_MARKDOWN_SELECTION_COMMAND, INSERT_MARKDOWN_COMMAND } from "./plugins/markdown/command/index.js";
84
101
  import { MarkdownPlugin } from "./plugins/markdown/plugin/index.js";
85
- import { ReactMarkdownPlugin } from "./plugins/markdown/react/index.js";
102
+ import ReactMarkdownPlugin from "./plugins/markdown/react/index.js";
86
103
  import { isPunctuationChar } from "./plugins/markdown/utils/index.js";
87
104
  import { detectCodeLanguage, detectLanguage } from "./plugins/markdown/utils/detectLanguage.js";
88
105
  import { isPureUrl, isValidUrl } from "./utils/url.js";
106
+ import "./plugins/markdown/index.js";
89
107
  import { INSERT_MATH_COMMAND } from "./plugins/math/command/index.js";
90
108
  import { MathPlugin } from "./plugins/math/plugin/index.js";
91
109
  import { ReactMathPlugin } from "./plugins/math/react/index.js";
110
+ import "./plugins/math/index.js";
92
111
  import { INSERT_MENTION_COMMAND } from "./plugins/mention/command/index.js";
93
112
  import { SerializedMentionNode } from "./plugins/mention/node/MentionNode.js";
94
113
  import { MentionPlugin, MentionPluginOptions } from "./plugins/mention/plugin/index.js";
95
114
  import { ReactMentionPluginProps } from "./plugins/mention/react/type.js";
96
- import { ReactMentionPlugin } from "./plugins/mention/react/ReactMentionPlugin.js";
115
+ import ReactMentionPlugin from "./plugins/mention/react/ReactMentionPlugin.js";
116
+ import "./plugins/mention/index.js";
97
117
  import { ISlashDividerOption, ISlashMenuOption, ISlashOption, ISlashSectionOption, ISlashService, SlashOptions, flattenSlashOptions, isSlashDividerOption, isSlashMenuOption, isSlashSectionOption } from "./plugins/slash/service/i-slash-service.js";
98
118
  import { ITriggerContext, SlashPlugin, SlashPluginOptions } from "./plugins/slash/plugin/index.js";
99
119
  import { MenuRenderProps, ReactSlashOptionProps, ReactSlashPluginProps, SlashMenuProps } from "./plugins/slash/react/type.js";
100
- import { SlashMenu } from "./plugins/slash/react/components/SlashMenu.js";
101
- import { ReactSlashOption } from "./plugins/slash/react/ReactSlashOption.js";
102
- import { ReactSlashPlugin } from "./plugins/slash/react/ReactSlashPlugin.js";
120
+ import SlashMenu from "./plugins/slash/react/components/SlashMenu.js";
121
+ import ReactSlashOption from "./plugins/slash/react/ReactSlashOption.js";
122
+ import ReactSlashPlugin from "./plugins/slash/react/ReactSlashPlugin.js";
123
+ import "./plugins/slash/index.js";
103
124
  import { INSERT_TABLE_COLUMN_COMMAND, INSERT_TABLE_COMMAND, INSERT_TABLE_ROW_COMMAND, SELECT_TABLE_COMMAND } from "./plugins/table/command/index.js";
104
125
  import { TablePlugin, TablePluginOptions } from "./plugins/table/plugin/index.js";
105
126
  import { ReactTablePlugin } from "./plugins/table/react/index.js";
106
127
  import { ITableControllerMenuActionItem, ITableControllerMenuItem, ITableControllerMenuRenderContext, ITableControllerMenuSeparatorItem, ITableControllerMenuService, TableControllerMenuAxis, TableControllerMenuService } from "./plugins/table/service/i-table-controller-menu-service.js";
128
+ import "./plugins/table/index.js";
107
129
  import { HIDE_TOOLBAR_COMMAND, SHOW_TOOLBAR_COMMAND, ToolbarCommandOptions, registerToolbarCommand } from "./plugins/toolbar/command/index.js";
108
130
  import { ReactToolbarPlugin } from "./plugins/toolbar/react/index.js";
131
+ import "./plugins/toolbar/index.js";
109
132
  import { UploadPlugin, UploadPluginOptions } from "./plugins/upload/plugin/index.js";
110
133
  import { IUploadService, UPLOAD_PRIORITY_HIGH, UPLOAD_PRIORITY_LOW, UPLOAD_PRIORITY_MEDIUM } from "./plugins/upload/service/i-upload-service.js";
134
+ import "./plugins/upload/index.js";
111
135
  import { VirtualBlockPlugin, VirtualBlockPluginOptions } from "./plugins/virtual-block/plugin/index.js";
112
- import { ReactVirtualBlockPlugin } from "./plugins/virtual-block/react/ReactVirtualBlock.js";
136
+ import ReactVirtualBlockPlugin from "./plugins/virtual-block/react/ReactVirtualBlock.js";
137
+ import "./plugins/virtual-block/index.js";
113
138
  import { browserDebug, createDebugLogger, debugLogger, debugLoggers, devConsole, prodSafeLogger } from "./utils/debug.js";
114
139
  import { Kernel } from "./editor-kernel/kernel.js";
115
140
  import { scrollIntoView } from "./utils/scrollIntoView.js";
116
-
117
141
  //#region src/index.d.ts
118
142
  /**
119
143
  * Enable hot reload mode globally for all editor instances
@@ -125,4 +149,4 @@ declare function enableHotReload(): void;
125
149
  */
126
150
  declare function disableHotReload(): void;
127
151
  //#endregion
128
- export { $closest, $closestNodeType, $createCursorNode, $getNearestNodeFromDOMNode, $getNodeFromDOMNode, $isCardLikeElementNode, $isCursorNode, ANCHOR_PADDING_CSS_VAR, AutoCompletePlugin, BlockDragTarget, BlockMenuService, BlockMovePayload, BlockPlugin, BlockPluginOptions, CONTENT_BLOCKS_DATA_TYPE, CardLikeElementNode, CodePlugin, CodeblockPlugin, CodeblockPluginOptions, CodemirrorPlugin, CodemirrorPluginOptions, CollaborationProviderFactory, CollaborationUser, CommonPlugin, CommonPluginOptions, ContentBlock, ContentBlocksDataSource, ContentBlocksPlugin, ContentBlocksPluginOptions, 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, EditorCollaborationConfig, ExtractContentBlocksOptions, FileContentBlock, 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, type IEditor, ILinkService, ILitexmlService, IMarkdownShortCutService, INSERT_CHECK_LIST_COMMAND, INSERT_CODEINLINE_COMMAND, INSERT_CODEMIRROR_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, ISlashDividerOption, ISlashMenuOption, ISlashOption, ISlashSectionOption, ISlashService, ITableControllerMenuActionItem, ITableControllerMenuItem, ITableControllerMenuRenderContext, ITableControllerMenuSeparatorItem, ITableControllerMenuService, ITriggerContext, IUploadService, ImageContentBlock, 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, LinkHighlightPlugin, LinkHighlightPluginOptions, LinkPlugin, LinkPluginOptions, ListPlugin, ListPluginOptions, LitexmlDataSource, LitexmlPlugin, LitexmlPluginOptions, LitexmlService, MARKDOWN_READER_LEVEL, MARKDOWN_READER_LEVEL_HIGH, MARKDOWN_READER_LEVEL_NORMAL, MARKDOWN_WRITER_LEVEL_MAX, MOVE_BLOCK_COMMAND, MarkdownPlugin, MathPlugin, MediaLists, MentionPlugin, MentionPluginOptions, MenuRenderProps, ModifierCombination, REMOVE_LIST_COMMAND, ReactAutoCompletePlugin, ReactBlockPlugin, ReactBlockPluginProps, ReactCodePlugin, ReactCodeblockPlugin, ReactCodeblockPluginProps, ReactCodemirrorPlugin, ReactCollaborationPlugin, ReactCollaborationPluginProps, ReactEditor, ReactEditorContent, ReactEditorContentProps, ReactFilePlugin, ReactFilePluginProps, ReactHRPlugin, ReactHRPluginProps, ReactImagePlugin, ReactImagePluginProps, ReactLinkHighlightPlugin, ReactLinkPlugin, ReactLinkPluginProps, ReactListPlugin, ReactListPluginProps, ReactLiteXmlPlugin, ReactMarkdownPlugin, ReactMathPlugin, ReactMentionPlugin, ReactMentionPluginProps, ReactNodePlugin, ReactPlainText, ReactPlainTextProps, ReactSlashOption, ReactSlashOptionProps, ReactSlashPlugin, ReactSlashPluginProps, ReactTablePlugin, ReactToolbarPlugin, ReactVirtualBlockPlugin, SELECT_AFTER_CODEMIRROR_COMMAND, SELECT_BEFORE_CODEMIRROR_COMMAND, SELECT_TABLE_COMMAND, SHOW_TOOLBAR_COMMAND, SerializedMentionNode, SlashMenu, SlashMenuProps, SlashOptions, SlashPlugin, SlashPluginOptions, TableControllerMenuAxis, TableControllerMenuService, TablePlugin, TablePluginOptions, TextContentBlock, ToolbarCommandOptions, UPDATE_CODEBLOCK_LANG, UPDATE_LIST_START_COMMAND, UPLOAD_PRIORITY_HIGH, UPLOAD_PRIORITY_LOW, UPLOAD_PRIORITY_MEDIUM, UploadPlugin, UploadPluginOptions, VirtualBlockPlugin, VirtualBlockPluginOptions, XMLReaderFunc, XMLReaderRecord, XMLWriterFunc, XMLWriterRecord, assert, browserDebug, bundledLanguagesInfo, compareNodeOrder, createDebugLogger, createEmptyEditorState, createHeadlessEditor, cursorNodeSerialized, debugLogger, debugLoggers, detectCodeLanguage, detectLanguage, devConsole, disableHotReload, enableHotReload, extractContentBlocks, extractMediaFromEditorState, extractMediaLists, flattenSlashOptions, genServiceId, generateEditorId, getHotkeyById, getKernelFromEditor, getKernelFromEditorConfig, getNodeKeyFromDOMNode, getParentElement, isDOMNode, isDocumentFragment, isPunctuationChar, isPureUrl, isSlashDividerOption, isSlashMenuOption, isSlashSectionOption, isValidUrl, moment, noop, prodSafeLogger, reconcileDecorator, registerBlockMoveCommand, registerEditorKernel, registerLinkHighlightCommand, registerToolbarCommand, resetRandomKey, scrollIntoView, unregisterEditorKernel, useHasDiffNode, useLexicalComposerContext, useLexicalEditor };
152
+ export { $closest, $closestNodeType, $createCursorNode, $getNearestNodeFromDOMNode, $getNodeFromDOMNode, $isCardLikeElementNode, $isCursorNode, ANCHOR_PADDING_CSS_VAR, AutoCompletePlugin, type BlockDragTarget, BlockMenuService, BlockMovePayload, BlockPlugin, BlockPluginOptions, CONTENT_BLOCKS_DATA_TYPE, CardLikeElementNode, CodePlugin, CodeblockPlugin, CodeblockPluginOptions, CodemirrorPlugin, CodemirrorPluginOptions, type CollaborationProviderFactory, type CollaborationUser, CommonPlugin, CommonPluginOptions, type ContentBlock, ContentBlocksDataSource, ContentBlocksPlugin, type ContentBlocksPluginOptions, 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, 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, type IEditor, ILinkService, ILitexmlService, IMarkdownShortCutService, INSERT_CHECK_LIST_COMMAND, INSERT_CODEINLINE_COMMAND, INSERT_CODEMIRROR_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, ITriggerContext, IUploadService, 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, LinkHighlightPlugin, LinkHighlightPluginOptions, LinkPlugin, LinkPluginOptions, 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, REMOVE_LIST_COMMAND, ReactAutoCompletePlugin, ReactBlockPlugin, type ReactBlockPluginProps, ReactCodePlugin, ReactCodeblockPlugin, type ReactCodeblockPluginProps, ReactCodemirrorPlugin, ReactCollaborationPlugin, type ReactCollaborationPluginProps, ReactEditor, ReactEditorContent, ReactEditorContentProps, ReactFilePlugin, type ReactFilePluginProps, ReactHRPlugin, type ReactHRPluginProps, ReactImagePlugin, type ReactImagePluginProps, ReactLinkHighlightPlugin, ReactLinkPlugin, type ReactLinkPluginProps, ReactListPlugin, type ReactListPluginProps, ReactLiteXmlPlugin, ReactMarkdownPlugin, ReactMathPlugin, ReactMentionPlugin, type ReactMentionPluginProps, ReactNodePlugin, ReactPlainText, ReactPlainTextProps, ReactSlashOption, type ReactSlashOptionProps, ReactSlashPlugin, type ReactSlashPluginProps, ReactTablePlugin, ReactToolbarPlugin, ReactVirtualBlockPlugin, SELECT_AFTER_CODEMIRROR_COMMAND, SELECT_BEFORE_CODEMIRROR_COMMAND, SELECT_TABLE_COMMAND, SHOW_TOOLBAR_COMMAND, type SerializedMentionNode, SlashMenu, type SlashMenuProps, type SlashOptions, SlashPlugin, SlashPluginOptions, TableControllerMenuAxis, TableControllerMenuService, TablePlugin, TablePluginOptions, type TextContentBlock, ToolbarCommandOptions, UPDATE_CODEBLOCK_LANG, UPDATE_LIST_START_COMMAND, UPLOAD_PRIORITY_HIGH, UPLOAD_PRIORITY_LOW, UPLOAD_PRIORITY_MEDIUM, UploadPlugin, UploadPluginOptions, VirtualBlockPlugin, VirtualBlockPluginOptions, type XMLReaderFunc, type XMLReaderRecord, type XMLWriterFunc, type XMLWriterRecord, assert, browserDebug, bundledLanguagesInfo, compareNodeOrder, createDebugLogger, createEmptyEditorState, createHeadlessEditor, cursorNodeSerialized, debugLogger, debugLoggers, detectCodeLanguage, detectLanguage, devConsole, disableHotReload, enableHotReload, extractContentBlocks, extractMediaFromEditorState, extractMediaLists, flattenSlashOptions, genServiceId, generateEditorId, getHotkeyById, getKernelFromEditor, getKernelFromEditorConfig, getNodeKeyFromDOMNode, getParentElement, isDOMNode, isDocumentFragment, isPunctuationChar, isPureUrl, isSlashDividerOption, isSlashMenuOption, isSlashSectionOption, isValidUrl, moment, noop, prodSafeLogger, reconcileDecorator, registerBlockMoveCommand, registerEditorKernel, registerLinkHighlightCommand, registerToolbarCommand, resetRandomKey, scrollIntoView, unregisterEditorKernel, useHasDiffNode, useLexicalComposerContext, useLexicalEditor };
package/es/index.js CHANGED
@@ -8,7 +8,7 @@ import { Kernel, init_kernel, kernel_exports } from "./editor-kernel/kernel.js";
8
8
  import DataSource from "./editor-kernel/data-source.js";
9
9
  import { resetRandomKey } from "./editor-kernel/index.js";
10
10
  import { LexicalErrorBoundary } from "./editor-kernel/react/LexicalErrorBoundary.js";
11
- import LexicalPortalContainer from "./editor-kernel/react/PortalContainer.js";
11
+ import { LexicalPortalContainer } from "./editor-kernel/react/PortalContainer.js";
12
12
  import { useLexicalComposerContext } from "./editor-kernel/react/react-context.js";
13
13
  import { ReactEditor } from "./editor-kernel/react/react-editor.js";
14
14
  import { useLexicalEditor } from "./editor-kernel/react/useLexicalEditor.js";
@@ -17,7 +17,7 @@ import { $createCursorNode, $isCardLikeElementNode, $isCursorNode, CardLikeEleme
17
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
18
  import { INodeService } from "./plugins/inode/service/index.js";
19
19
  import { INodePlugin } from "./plugins/inode/plugin/index.js";
20
- import ReactNodePlugin from "./plugins/inode/react/index.js";
20
+ import { ReactNodePlugin } from "./plugins/inode/react/index.js";
21
21
  import { ILitexmlService, LitexmlService } from "./plugins/litexml/service/litexml-service.js";
22
22
  import LitexmlDataSource from "./plugins/litexml/data-source/litexml-data-source.js";
23
23
  import { isPunctuationChar } from "./plugins/markdown/utils/index.js";
@@ -28,7 +28,7 @@ import { MarkdownPlugin } from "./plugins/markdown/plugin/index.js";
28
28
  import ReactMarkdownPlugin from "./plugins/markdown/react/index.js";
29
29
  import { isPureUrl, isValidUrl } from "./utils/url.js";
30
30
  import { LitexmlPlugin } from "./plugins/litexml/plugin/index.js";
31
- import ReactLiteXmlPlugin from "./plugins/litexml/react/index.js";
31
+ import { ReactLiteXmlPlugin } from "./plugins/litexml/react/index.js";
32
32
  import { useHasDiffNode } from "./plugins/litexml/react/hooks/useHasDiffNode.js";
33
33
  import { CommonPlugin } from "./plugins/common/plugin/index.js";
34
34
  import ReactEditorContent from "./plugins/common/react/ReactEditorContent.js";
@@ -69,10 +69,10 @@ import { ANCHOR_PADDING_CSS_VAR, DEFAULT_BLOCK_ANCHOR_PADDING } from "./plugins/
69
69
  import ReactBlockPlugin from "./plugins/block/react/ReactBlockPlugin.js";
70
70
  import ReactCodePlugin from "./plugins/code/react/CodeReactPlugin.js";
71
71
  import { CodeblockPlugin } from "./plugins/codeblock/plugin/index.js";
72
- import ReactCodeblockPlugin from "./plugins/codeblock/react/ReactCodeblockPlugin.js";
72
+ import { ReactCodeblockPlugin } from "./plugins/codeblock/react/ReactCodeblockPlugin.js";
73
73
  import { bundledLanguagesInfo } from "./plugins/codeblock/index.js";
74
74
  import ReactCodemirrorPlugin from "./plugins/codemirror-block/react/ReactCodemirrorNode.js";
75
- import ReactCollaborationPlugin from "./plugins/collaboration/react/ReactCollaborationPlugin.js";
75
+ import { ReactCollaborationPlugin } from "./plugins/collaboration/react/ReactCollaborationPlugin.js";
76
76
  import { CONTENT_BLOCKS_DATA_TYPE } from "./plugins/content-blocks/types.js";
77
77
  import { extractContentBlocks } from "./plugins/content-blocks/utils/extract.js";
78
78
  import { ContentBlocksDataSource } from "./plugins/content-blocks/data-source/content-blocks-data-source.js";
@@ -81,7 +81,7 @@ import { extractMediaLists } from "./plugins/content-blocks/utils/extract-media-
81
81
  import ReactFilePlugin from "./plugins/file/react/ReactFilePlugin.js";
82
82
  import ReactHRPlugin from "./plugins/hr/react/ReactHRPlugin.js";
83
83
  import ReactImagePlugin from "./plugins/image/react/ReactImagePlugin.js";
84
- import ReactLinkPlugin from "./plugins/link/react/ReactLinkPlugin.js";
84
+ import { ReactLinkPlugin } from "./plugins/link/react/ReactLinkPlugin.js";
85
85
  import { INSERT_LINK_HIGHLIGHT_COMMAND, registerLinkHighlightCommand } from "./plugins/link-highlight/command/index.js";
86
86
  import { LinkHighlightPlugin } from "./plugins/link-highlight/plugin/index.js";
87
87
  import ReactLinkHighlightPlugin from "./plugins/link-highlight/react/ReactLinkHighlightPlugin.js";
@@ -61,4 +61,4 @@ declare const _default: {
61
61
  };
62
62
  };
63
63
  //#endregion
64
- export { _default };
64
+ export { _default as default };
@@ -1,5 +1,4 @@
1
1
  import { Data as Data$1, Node as Node$1 } from "../../../../@types_unist@3.0.3/node_modules/@types/unist/index.js";
2
-
3
2
  //#region node_modules/.pnpm/@types+mdast@4.0.4/node_modules/@types/mdast/index.d.ts
4
3
  // ## Enumeration
5
4
  /**
@@ -950,4 +949,4 @@ interface Yaml extends Literal {
950
949
  */
951
950
  interface YamlData extends Data {}
952
951
  //#endregion
953
- export { Html, PhrasingContent, Root, RootContent };
952
+ export { AlignType, Alternative, Association, BlockContent, BlockContentMap, Blockquote, BlockquoteData, Break, BreakData, Code, CodeData, Data, Definition, DefinitionContent, DefinitionContentMap, DefinitionData, Delete, DeleteData, Emphasis, EmphasisData, FootnoteDefinition, FootnoteDefinitionData, FootnoteReference, FootnoteReferenceData, Heading, HeadingData, Html, HtmlData, Image, ImageData, ImageReference, ImageReferenceData, InlineCode, InlineCodeData, Link, LinkData, LinkReference, LinkReferenceData, List, ListContent, ListContentMap, ListData, ListItem, ListItemData, Literal, Node, Paragraph, ParagraphData, Parent, PhrasingContent, PhrasingContentMap, Reference, ReferenceType, Resource, Root, RootContent, RootContentMap, RootData, RowContent, RowContentMap, Strong, StrongData, Table, TableCell, TableCellData, TableContent, TableContentMap, TableData, TableRow, TableRowData, Text, TextData, ThematicBreak, ThematicBreakData, Yaml, YamlData };
@@ -80,4 +80,4 @@ interface Node {
80
80
  position?: Position | undefined;
81
81
  }
82
82
  //#endregion
83
- export { Data, Node };
83
+ export { Data, Node, Point, Position };
@@ -1,2 +1,4 @@
1
1
  import { AutoCompletePlugin } from "./plugin/index.js";
2
- import { ReactAutoCompletePlugin } from "./react/ReactAutoCompletePlugin.js";
2
+ import ReactAutoCompletePlugin from "./react/ReactAutoCompletePlugin.js";
3
+ import "./react/index.js";
4
+ export { AutoCompletePlugin, ReactAutoCompletePlugin };
@@ -86,4 +86,4 @@ function $createPlaceholderBlockNode() {
86
86
  return $applyNodeReplacement(new PlaceholderBlockNode());
87
87
  }
88
88
  //#endregion
89
- export { PlaceholderBlockNode, PlaceholderNode };
89
+ export { $createPlaceholderBlockNode, $createPlaceholderNode, PlaceholderBlockNode, PlaceholderNode };
@@ -1,4 +1,5 @@
1
1
  import { IEditor, IEditorPluginConstructor } from "../../../types/kernel.js";
2
+ import "../../../types/index.js";
2
3
  //#region src/plugins/auto-complete/plugin/index.d.ts
3
4
  interface AutoCompletePluginOptions {
4
5
  /** Delay in milliseconds before triggering auto-complete (default: 1000ms) */
@@ -28,4 +29,4 @@ interface AutoCompletePluginOptions {
28
29
  }
29
30
  declare const AutoCompletePlugin: IEditorPluginConstructor<AutoCompletePluginOptions>;
30
31
  //#endregion
31
- export { AutoCompletePlugin };
32
+ export { AutoCompletePlugin, AutoCompletePluginOptions };
@@ -1,7 +1,6 @@
1
1
  import { ReactAutoCompletePluginProps } from "./type.js";
2
2
  import { FC } from "react";
3
-
4
3
  //#region src/plugins/auto-complete/react/ReactAutoCompletePlugin.d.ts
5
4
  declare const ReactAutoCompletePlugin: FC<ReactAutoCompletePluginProps>;
6
5
  //#endregion
7
- export { ReactAutoCompletePlugin };
6
+ export { ReactAutoCompletePlugin as default };
@@ -1 +1,2 @@
1
- import { ReactAutoCompletePlugin } from "./ReactAutoCompletePlugin.js";
1
+ import ReactAutoCompletePlugin from "./ReactAutoCompletePlugin.js";
2
+ export { ReactAutoCompletePlugin };
@@ -1,4 +1,5 @@
1
1
  import { IEditor } from "../../../types/kernel.js";
2
+ import "../../../types/index.js";
2
3
  //#region src/plugins/auto-complete/react/type.d.ts
3
4
  interface ReactAutoCompletePluginProps {
4
5
  delay?: number;
@@ -1,13 +1,11 @@
1
- import * as _$lexical from "lexical";
2
1
  import { LexicalEditor } from "lexical";
3
-
4
2
  //#region src/plugins/block/command/index.d.ts
5
3
  interface BlockMovePayload {
6
4
  placement: 'after' | 'before';
7
5
  sourceBlockId: string;
8
6
  targetBlockId: string;
9
7
  }
10
- declare const MOVE_BLOCK_COMMAND: _$lexical.LexicalCommand<BlockMovePayload>;
8
+ declare const MOVE_BLOCK_COMMAND: import("lexical").LexicalCommand<BlockMovePayload>;
11
9
  declare function registerBlockMoveCommand(editor: LexicalEditor): () => void;
12
10
  //#endregion
13
11
  export { BlockMovePayload, MOVE_BLOCK_COMMAND, registerBlockMoveCommand };
@@ -2,5 +2,8 @@ import { BlockMovePayload, MOVE_BLOCK_COMMAND, registerBlockMoveCommand } from "
2
2
  import { BlockPlugin, BlockPluginOptions } from "./plugin/index.js";
3
3
  import { BlockDragTarget } from "./react/core/types.js";
4
4
  import { BlockMenuService, IBlockActionButton, IBlockActionButtonIcon, IBlockMenuItem, IBlockMenuRenderContext, IBlockMenuService, IBlockSelectHandler } from "./service/i-block-menu-service.js";
5
- import { ReactBlockPlugin, ReactBlockPluginProps } from "./react/ReactBlockPlugin.js";
6
- import { ANCHOR_PADDING_CSS_VAR, DEFAULT_BLOCK_ANCHOR_PADDING } from "./react/style.js";
5
+ import "./service/index.js";
6
+ import ReactBlockPlugin, { ReactBlockPluginProps } from "./react/ReactBlockPlugin.js";
7
+ import { ANCHOR_PADDING_CSS_VAR, DEFAULT_BLOCK_ANCHOR_PADDING } from "./react/style.js";
8
+ import "./react/index.js";
9
+ export { ANCHOR_PADDING_CSS_VAR, type BlockDragTarget, BlockMenuService, BlockMovePayload, BlockPlugin, BlockPluginOptions, DEFAULT_BLOCK_ANCHOR_PADDING, IBlockActionButton, IBlockActionButtonIcon, IBlockMenuItem, IBlockMenuRenderContext, IBlockMenuService, IBlockSelectHandler, MOVE_BLOCK_COMMAND, ReactBlockPlugin, type ReactBlockPluginProps, registerBlockMoveCommand };
@@ -1,4 +1,5 @@
1
1
  import { IEditorPluginConstructor } from "../../../types/kernel.js";
2
+ import "../../../types/index.js";
2
3
  //#region src/plugins/block/plugin/index.d.ts
3
4
  interface BlockPluginOptions {
4
5
  /**
@@ -1,9 +1,10 @@
1
1
  import { ILocaleKeys } from "../../../types/locale.js";
2
+ import "../../../types/index.js";
2
3
  import { BlockPluginOptions } from "../plugin/index.js";
3
4
  import { BlockDragTarget } from "./core/types.js";
4
5
  import { IBlockMenuRenderContext } from "../service/i-block-menu-service.js";
6
+ import "../service/index.js";
5
7
  import { FC } from "react";
6
-
7
8
  //#region src/plugins/block/react/ReactBlockPlugin.d.ts
8
9
  interface ReactBlockPluginProps extends Omit<BlockPluginOptions, 'className'> {
9
10
  className?: string;
@@ -15,4 +16,4 @@ interface ReactBlockPluginProps extends Omit<BlockPluginOptions, 'className'> {
15
16
  }
16
17
  declare const ReactBlockPlugin: FC<ReactBlockPluginProps>;
17
18
  //#endregion
18
- export { ReactBlockPlugin, ReactBlockPluginProps };
19
+ export { ReactBlockPluginProps, ReactBlockPlugin as default };
@@ -114,7 +114,8 @@ const ReactBlockPlugin = (props) => {
114
114
  }
115
115
  if ($isRangeSelection(selection)) {
116
116
  const anchorNode = $getNodeByKey(selection.anchor.key);
117
- setFocusedTableBlockId((anchorNode ? $findTableNode(anchorNode) : null)?.getKey() ?? null);
117
+ const tableNode = anchorNode ? $findTableNode(anchorNode) : null;
118
+ setFocusedTableBlockId(tableNode?.getKey() ?? null);
118
119
  return;
119
120
  }
120
121
  setFocusedTableBlockId(null);
@@ -448,10 +449,11 @@ const ReactBlockPlugin = (props) => {
448
449
  const anchorLeft = isTableBlock && tableAnchorRect ? Math.max(tableAnchorRect.left, minTableLeft) : blockRect.left;
449
450
  const rawAnchorTop = tableAnchorRect?.top ?? blockRect.top;
450
451
  const anchorTop = rawAnchorTop >= blockRect.top - 1 && rawAnchorTop <= blockRect.bottom + 1 ? rawAnchorTop : blockRect.top;
451
- setMenuPosition({
452
+ const position = {
452
453
  left: Math.max(gap, anchorLeft - menuWidth - gap - listItemOffset - tableMenuOffset),
453
454
  top: anchorTop
454
- });
455
+ };
456
+ setMenuPosition(position);
455
457
  };
456
458
  updateMenuPosition();
457
459
  window.addEventListener("resize", updateMenuPosition);
@@ -1,5 +1,4 @@
1
1
  import { BlockMovePayload } from "../../command/index.js";
2
-
3
2
  //#region src/plugins/block/react/core/types.d.ts
4
3
  type BlockDragTarget = BlockMovePayload;
5
4
  //#endregion
@@ -1,3 +1,4 @@
1
1
  import { BlockDragTarget } from "./core/types.js";
2
- import { ReactBlockPlugin, ReactBlockPluginProps } from "./ReactBlockPlugin.js";
3
- import { ANCHOR_PADDING_CSS_VAR, DEFAULT_BLOCK_ANCHOR_PADDING } from "./style.js";
2
+ import ReactBlockPlugin, { ReactBlockPluginProps } from "./ReactBlockPlugin.js";
3
+ import { ANCHOR_PADDING_CSS_VAR, DEFAULT_BLOCK_ANCHOR_PADDING } from "./style.js";
4
+ export { ANCHOR_PADDING_CSS_VAR, type BlockDragTarget, DEFAULT_BLOCK_ANCHOR_PADDING, ReactBlockPlugin, type ReactBlockPluginProps };
@@ -1,6 +1,6 @@
1
1
  import { IEditor, IServiceID } from "../../../types/kernel.js";
2
+ import "../../../types/index.js";
2
3
  import { LexicalNode } from "lexical";
3
-
4
4
  //#region src/plugins/block/service/i-block-menu-service.d.ts
5
5
  interface IBlockMenuRenderContext {
6
6
  blockElement: HTMLElement;
@@ -1,5 +1,6 @@
1
- import { genServiceId } from "../../../editor-kernel/utils.js";
1
+ import { genServiceId, init_utils } from "../../../editor-kernel/utils.js";
2
2
  //#region src/plugins/block/service/i-block-menu-service.ts
3
+ init_utils();
3
4
  const IBlockMenuService = genServiceId("BlockMenuService");
4
5
  var BlockMenuService = class {
5
6
  constructor() {