@lobehub/editor 4.22.0 → 4.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/es/_virtual/_rolldown/runtime.js +8 -1
  2. package/es/codemirror/components/CopyButton.d.ts +0 -1
  3. package/es/codemirror/components/LanguageSelect.d.ts +0 -1
  4. package/es/codemirror/components/MoreOptions.d.ts +0 -1
  5. package/es/codemirror/components/Toolbar.d.ts +0 -1
  6. package/es/codemirror/constants.d.ts +0 -1
  7. package/es/codemirror/types.d.ts +0 -1
  8. package/es/common/sys.js +1 -1
  9. package/es/editor-kernel/data-source.d.ts +1 -2
  10. package/es/editor-kernel/event.d.ts +1 -3
  11. package/es/editor-kernel/index.d.ts +3 -2
  12. package/es/editor-kernel/index.js +4 -4
  13. package/es/editor-kernel/inode/i-element-node.d.ts +0 -1
  14. package/es/editor-kernel/inode/i-node.d.ts +0 -1
  15. package/es/editor-kernel/inode/index.d.ts +3 -1
  16. package/es/editor-kernel/inode/paragraph-node.d.ts +1 -1
  17. package/es/editor-kernel/inode/root-node.d.ts +0 -1
  18. package/es/editor-kernel/inode/text-node.d.ts +0 -1
  19. package/es/editor-kernel/kernel.d.ts +1 -2
  20. package/es/editor-kernel/react/LexicalErrorBoundary.d.ts +2 -6
  21. package/es/editor-kernel/react/PortalContainer.d.ts +7 -3
  22. package/es/editor-kernel/react/PortalContainer.js +4 -4
  23. package/es/editor-kernel/react/index.d.ts +2 -1
  24. package/es/editor-kernel/react/react-context.d.ts +3 -2
  25. package/es/editor-kernel/react/react-editor.d.ts +2 -2
  26. package/es/editor-kernel/react/useDecorators.js +3 -2
  27. package/es/editor-kernel/react/useLexicalEditor.d.ts +0 -1
  28. package/es/editor-kernel/react/useLexicalEditor.js +1 -1
  29. package/es/editor-kernel/utils.d.ts +2 -3
  30. package/es/headless/extract-media-from-editor-state.d.ts +0 -1
  31. package/es/headless/extract-media-from-editor-state.js +1 -1
  32. package/es/headless/index.d.ts +3 -2
  33. package/es/headless/index.js +4 -3
  34. package/es/headless.d.ts +2 -3
  35. package/es/headless.js +20 -41
  36. package/es/index.d.ts +45 -21
  37. package/es/index.js +6 -6
  38. package/es/locale/index.d.ts +1 -1
  39. package/es/node_modules/.pnpm/@types_mdast@4.0.4/node_modules/@types/mdast/index.d.ts +1 -2
  40. package/es/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts +1 -1
  41. package/es/plugins/auto-complete/index.d.ts +3 -1
  42. package/es/plugins/auto-complete/node/placeholderNode.js +1 -1
  43. package/es/plugins/auto-complete/plugin/index.d.ts +2 -1
  44. package/es/plugins/auto-complete/react/ReactAutoCompletePlugin.d.ts +1 -2
  45. package/es/plugins/auto-complete/react/index.d.ts +2 -1
  46. package/es/plugins/auto-complete/react/type.d.ts +1 -0
  47. package/es/plugins/block/command/index.d.ts +1 -3
  48. package/es/plugins/block/index.d.ts +5 -2
  49. package/es/plugins/block/plugin/index.d.ts +1 -0
  50. package/es/plugins/block/react/ReactBlockPlugin.d.ts +3 -2
  51. package/es/plugins/block/react/ReactBlockPlugin.js +5 -3
  52. package/es/plugins/block/react/core/types.d.ts +0 -1
  53. package/es/plugins/block/react/index.d.ts +3 -2
  54. package/es/plugins/block/service/i-block-menu-service.d.ts +1 -1
  55. package/es/plugins/block/service/i-block-menu-service.js +2 -1
  56. package/es/plugins/block/service/index.d.ts +2 -1
  57. package/es/plugins/code/command/index.d.ts +1 -3
  58. package/es/plugins/code/index.d.ts +3 -1
  59. package/es/plugins/code/plugin/index.d.ts +2 -1
  60. package/es/plugins/code/react/CodeReactPlugin.d.ts +1 -2
  61. package/es/plugins/code/react/index.d.ts +2 -1
  62. package/es/plugins/codeblock/command/index.d.ts +3 -1
  63. package/es/plugins/codeblock/command/index.js +1 -1
  64. package/es/plugins/codeblock/command/symbols.d.ts +1 -3
  65. package/es/plugins/codeblock/index.d.ts +3 -1
  66. package/es/plugins/codeblock/index.js +4 -4
  67. package/es/plugins/codeblock/plugin/index.d.ts +1 -0
  68. package/es/plugins/codeblock/react/ReactCodeblockPlugin.d.ts +1 -2
  69. package/es/plugins/codeblock/react/ReactCodeblockPlugin.js +1 -1
  70. package/es/plugins/codeblock/react/index.d.ts +2 -1
  71. package/es/plugins/codeblock/react/style.js +0 -1
  72. package/es/plugins/codeblock/react/type.d.ts +1 -0
  73. package/es/plugins/codemirror-block/command/index.d.ts +3 -5
  74. package/es/plugins/codemirror-block/index.d.ts +3 -1
  75. package/es/plugins/codemirror-block/node/CodeMirrorNode.d.ts +1 -2
  76. package/es/plugins/codemirror-block/plugin/index.d.ts +1 -1
  77. package/es/plugins/codemirror-block/react/ReactCodemirrorNode.d.ts +1 -2
  78. package/es/plugins/codemirror-block/react/index.d.ts +2 -1
  79. package/es/plugins/collaboration/index.d.ts +3 -1
  80. package/es/plugins/collaboration/react/ReactCollaborationPlugin.d.ts +1 -2
  81. package/es/plugins/collaboration/react/ReactCollaborationPlugin.js +1 -1
  82. package/es/plugins/collaboration/react/index.d.ts +2 -1
  83. package/es/plugins/collaboration/react/type.d.ts +0 -1
  84. package/es/plugins/collaboration/utils.d.ts +0 -1
  85. package/es/plugins/collaboration/utils.js +1 -1
  86. package/es/plugins/common/command/index.d.ts +2 -4
  87. package/es/plugins/common/data-source/json-data-source.js +1 -1
  88. package/es/plugins/common/index.d.ts +4 -2
  89. package/es/plugins/common/node/cursor.d.ts +1 -2
  90. package/es/plugins/common/plugin/index.d.ts +1 -1
  91. package/es/plugins/common/plugin/index.js +2 -1
  92. package/es/plugins/common/plugin/paste-handler.d.ts +0 -1
  93. package/es/plugins/common/plugin/register.js +4 -3
  94. package/es/plugins/common/react/Placeholder/index.js +2 -1
  95. package/es/plugins/common/react/ReactEditorContent.d.ts +1 -2
  96. package/es/plugins/common/react/ReactPlainText.d.ts +2 -4
  97. package/es/plugins/common/react/index.d.ts +3 -2
  98. package/es/plugins/common/react/type.d.ts +2 -1
  99. package/es/plugins/common/utils/index.js +1 -1
  100. package/es/plugins/content-blocks/data-source/content-blocks-data-source.d.ts +2 -2
  101. package/es/plugins/content-blocks/index.d.ts +2 -1
  102. package/es/plugins/content-blocks/plugin/index.d.ts +1 -1
  103. package/es/plugins/content-blocks/types.d.ts +1 -2
  104. package/es/plugins/content-blocks/utils/extract-media-lists.d.ts +0 -1
  105. package/es/plugins/content-blocks/utils/extract.d.ts +0 -1
  106. package/es/plugins/content-blocks/utils/extract.js +2 -2
  107. package/es/plugins/file/command/index.d.ts +1 -3
  108. package/es/plugins/file/index.d.ts +3 -1
  109. package/es/plugins/file/node/FileNode.d.ts +1 -2
  110. package/es/plugins/file/plugin/index.d.ts +1 -1
  111. package/es/plugins/file/react/ReactFilePlugin.d.ts +1 -2
  112. package/es/plugins/file/react/index.d.ts +2 -1
  113. package/es/plugins/file/react/type.d.ts +1 -1
  114. package/es/plugins/hr/command/index.d.ts +1 -3
  115. package/es/plugins/hr/index.d.ts +3 -1
  116. package/es/plugins/hr/node/HorizontalRuleNode.d.ts +1 -2
  117. package/es/plugins/hr/plugin/index.d.ts +1 -1
  118. package/es/plugins/hr/react/ReactHRPlugin.d.ts +1 -2
  119. package/es/plugins/hr/react/index.d.ts +2 -1
  120. package/es/plugins/image/command/index.d.ts +1 -3
  121. package/es/plugins/image/index.d.ts +3 -1
  122. package/es/plugins/image/node/basie-image-node.d.ts +0 -1
  123. package/es/plugins/image/node/block-image-node.d.ts +0 -1
  124. package/es/plugins/image/node/image-node.d.ts +0 -1
  125. package/es/plugins/image/plugin/index.d.ts +1 -1
  126. package/es/plugins/image/react/ReactImagePlugin.d.ts +1 -2
  127. package/es/plugins/image/react/components/Image.js +4 -2
  128. package/es/plugins/image/react/components/style.js +3 -3
  129. package/es/plugins/image/react/components/useSupenseImage.js +1 -1
  130. package/es/plugins/image/react/index.d.ts +2 -1
  131. package/es/plugins/inode/index.d.ts +2 -1
  132. package/es/plugins/inode/plugin/index.d.ts +1 -0
  133. package/es/plugins/inode/react/index.d.ts +1 -2
  134. package/es/plugins/inode/react/index.js +1 -1
  135. package/es/plugins/inode/service/index.d.ts +2 -0
  136. package/es/plugins/inode/service/index.js +2 -1
  137. package/es/plugins/link/command/index.d.ts +1 -3
  138. package/es/plugins/link/index.d.ts +3 -1
  139. package/es/plugins/link/node/LinkNode.d.ts +0 -1
  140. package/es/plugins/link/node/LinkNode.js +2 -2
  141. package/es/plugins/link/plugin/index.d.ts +1 -1
  142. package/es/plugins/link/plugin/registry.js +2 -1
  143. package/es/plugins/link/react/ReactLinkPlugin.d.ts +1 -2
  144. package/es/plugins/link/react/ReactLinkPlugin.js +1 -1
  145. package/es/plugins/link/react/index.d.ts +2 -1
  146. package/es/plugins/link/react/type.d.ts +0 -1
  147. package/es/plugins/link/service/i-link-service.d.ts +1 -1
  148. package/es/plugins/link/service/i-link-service.js +2 -1
  149. package/es/plugins/link/utils/index.js +1 -1
  150. package/es/plugins/link-highlight/command/index.d.ts +1 -3
  151. package/es/plugins/link-highlight/index.d.ts +3 -1
  152. package/es/plugins/link-highlight/plugin/index.d.ts +1 -0
  153. package/es/plugins/link-highlight/react/ReactLinkHighlightPlugin.d.ts +1 -2
  154. package/es/plugins/link-highlight/react/index.d.ts +2 -1
  155. package/es/plugins/list/command/index.d.ts +1 -1
  156. package/es/plugins/list/command/index.js +2 -2
  157. package/es/plugins/list/index.d.ts +3 -1
  158. package/es/plugins/list/plugin/checkList.d.ts +0 -1
  159. package/es/plugins/list/plugin/checkList.js +0 -7
  160. package/es/plugins/list/plugin/index.d.ts +1 -0
  161. package/es/plugins/list/react/ReactListPlugin.d.ts +1 -2
  162. package/es/plugins/list/react/index.d.ts +2 -1
  163. package/es/plugins/list/react/style.js +1 -1
  164. package/es/plugins/litexml/command/diffCommand.d.ts +2 -1
  165. package/es/plugins/litexml/command/diffCommand.js +2 -2
  166. package/es/plugins/litexml/command/index.d.ts +3 -1
  167. package/es/plugins/litexml/command/index.js +3 -2
  168. package/es/plugins/litexml/command/symbols.d.ts +6 -8
  169. package/es/plugins/litexml/data-source/litexml-data-source.d.ts +4 -3
  170. package/es/plugins/litexml/data-source/litexml-data-source.js +4 -2
  171. package/es/plugins/litexml/index.d.ts +5 -2
  172. package/es/plugins/litexml/node/DiffNode.d.ts +1 -2
  173. package/es/plugins/litexml/plugin/index.d.ts +1 -1
  174. package/es/plugins/litexml/react/DiffNodeToolbar/index.js +1 -1
  175. package/es/plugins/litexml/react/hooks/useHasDiffNode.d.ts +1 -0
  176. package/es/plugins/litexml/react/index.d.ts +1 -2
  177. package/es/plugins/litexml/react/index.js +1 -1
  178. package/es/plugins/litexml/service/litexml-service.d.ts +3 -3
  179. package/es/plugins/litexml/service/litexml-service.js +2 -1
  180. package/es/plugins/markdown/command/index.d.ts +4 -4
  181. package/es/plugins/markdown/data-source/markdown/parse.d.ts +3 -3
  182. package/es/plugins/markdown/data-source/markdown/parse.js +2 -2
  183. package/es/plugins/markdown/data-source/markdown-data-source.js +1 -1
  184. package/es/plugins/markdown/index.d.ts +3 -2
  185. package/es/plugins/markdown/plugin/index.d.ts +2 -1
  186. package/es/plugins/markdown/react/index.d.ts +1 -2
  187. package/es/plugins/markdown/service/shortcut.d.ts +2 -2
  188. package/es/plugins/markdown/service/shortcut.js +2 -1
  189. package/es/plugins/markdown/service/transformers.d.ts +1 -3
  190. package/es/plugins/markdown/utils/index.d.ts +1 -1
  191. package/es/plugins/markdown/utils/index.js +1 -1
  192. package/es/plugins/math/command/index.d.ts +1 -3
  193. package/es/plugins/math/index.d.ts +2 -1
  194. package/es/plugins/math/node/index.d.ts +1 -2
  195. package/es/plugins/math/node/index.js +3 -2
  196. package/es/plugins/math/plugin/index.d.ts +2 -2
  197. package/es/plugins/math/react/components/MathEditorContent.js +2 -1
  198. package/es/plugins/math/react/components/MathInline.js +2 -2
  199. package/es/plugins/math/react/index.d.ts +0 -1
  200. package/es/plugins/math/react/type.d.ts +0 -1
  201. package/es/plugins/mention/command/index.d.ts +1 -3
  202. package/es/plugins/mention/index.d.ts +3 -1
  203. package/es/plugins/mention/node/MentionNode.d.ts +0 -1
  204. package/es/plugins/mention/plugin/index.d.ts +2 -1
  205. package/es/plugins/mention/react/ReactMentionPlugin.d.ts +1 -2
  206. package/es/plugins/mention/react/index.d.ts +2 -1
  207. package/es/plugins/mention/react/type.d.ts +0 -1
  208. package/es/plugins/slash/index.d.ts +5 -3
  209. package/es/plugins/slash/plugin/index.d.ts +1 -1
  210. package/es/plugins/slash/react/ReactSlashOption.d.ts +1 -2
  211. package/es/plugins/slash/react/ReactSlashPlugin.d.ts +1 -2
  212. package/es/plugins/slash/react/ReactSlashPlugin.js +2 -1
  213. package/es/plugins/slash/react/components/SlashMenu.d.ts +1 -2
  214. package/es/plugins/slash/react/index.d.ts +4 -3
  215. package/es/plugins/slash/react/type.d.ts +2 -1
  216. package/es/plugins/slash/service/i-slash-service.d.ts +2 -1
  217. package/es/plugins/slash/service/i-slash-service.js +2 -1
  218. package/es/plugins/slash/utils/utils.js +1 -1
  219. package/es/plugins/table/command/index.d.ts +4 -6
  220. package/es/plugins/table/command/index.js +4 -4
  221. package/es/plugins/table/index.d.ts +3 -1
  222. package/es/plugins/table/node/index.js +2 -1
  223. package/es/plugins/table/plugin/index.d.ts +1 -1
  224. package/es/plugins/table/plugin/index.js +1 -2
  225. package/es/plugins/table/react/TableActionMenu/index.js +0 -7
  226. package/es/plugins/table/react/TableColController.js +2 -2
  227. package/es/plugins/table/react/TableController/hooks.js +3 -2
  228. package/es/plugins/table/react/TableHoverActions/utils.js +1 -1
  229. package/es/plugins/table/react/TableResize/index.js +1 -1
  230. package/es/plugins/table/react/TableRowController.js +1 -1
  231. package/es/plugins/table/react/hooks.js +0 -7
  232. package/es/plugins/table/react/index.d.ts +0 -1
  233. package/es/plugins/table/react/index.js +1 -1
  234. package/es/plugins/table/react/type.d.ts +2 -1
  235. package/es/plugins/table/service/i-table-controller-menu-service.d.ts +1 -1
  236. package/es/plugins/table/service/i-table-controller-menu-service.js +2 -1
  237. package/es/plugins/table/service/index.d.ts +2 -1
  238. package/es/plugins/table/utils/index.js +1 -1
  239. package/es/plugins/toolbar/command/index.d.ts +0 -1
  240. package/es/plugins/toolbar/index.d.ts +2 -1
  241. package/es/plugins/toolbar/react/index.d.ts +0 -1
  242. package/es/plugins/toolbar/react/type.d.ts +0 -1
  243. package/es/plugins/upload/index.d.ts +2 -1
  244. package/es/plugins/upload/plugin/index.d.ts +1 -0
  245. package/es/plugins/upload/service/i-upload-service.d.ts +2 -1
  246. package/es/plugins/upload/service/i-upload-service.js +2 -1
  247. package/es/plugins/virtual-block/index.d.ts +3 -1
  248. package/es/plugins/virtual-block/plugin/index.d.ts +1 -0
  249. package/es/plugins/virtual-block/plugin/register.js +3 -2
  250. package/es/plugins/virtual-block/react/ReactVirtualBlock.d.ts +1 -2
  251. package/es/plugins/virtual-block/react/index.d.ts +2 -1
  252. package/es/react/ChatInput/ChatInput.d.ts +1 -2
  253. package/es/react/ChatInput/ChatInput.js +2 -1
  254. package/es/react/ChatInput/index.d.ts +2 -1
  255. package/es/react/ChatInput/type.d.ts +0 -1
  256. package/es/react/ChatInputActionBar/ChatInputActionBar.d.ts +1 -2
  257. package/es/react/ChatInputActionBar/index.d.ts +2 -1
  258. package/es/react/ChatInputActionBar/type.d.ts +0 -1
  259. package/es/react/ChatInputActions/ChatInputActions.d.ts +2 -4
  260. package/es/react/ChatInputActions/index.d.ts +2 -1
  261. package/es/react/ChatInputActions/type.d.ts +0 -1
  262. package/es/react/CodeLanguageSelect/CodeLanguageSelect.d.ts +1 -2
  263. package/es/react/CodeLanguageSelect/index.d.ts +2 -1
  264. package/es/react/CodeLanguageSelect/type.d.ts +0 -1
  265. package/es/react/Editor/Editor.js +1 -1
  266. package/es/react/Editor/index.d.ts +1 -2
  267. package/es/react/Editor/index.js +1 -1
  268. package/es/react/Editor/type.d.ts +5 -1
  269. package/es/react/Editor/utils.d.ts +0 -1
  270. package/es/react/EditorProvider/index.d.ts +2 -7
  271. package/es/react/EditorProvider/index.js +1 -1
  272. package/es/react/FloatActions/FloatActions.d.ts +1 -2
  273. package/es/react/FloatActions/index.d.ts +2 -1
  274. package/es/react/FloatActions/type.d.ts +0 -1
  275. package/es/react/SendButton/SendButton.d.ts +1 -2
  276. package/es/react/SendButton/index.d.ts +2 -1
  277. package/es/react/SendButton/type.d.ts +0 -1
  278. package/es/react/hooks/useEditor.d.ts +1 -0
  279. package/es/react/hooks/useEditorState/index.d.ts +1 -0
  280. package/es/react/hooks/useEditorState/index.js +8 -4
  281. package/es/react.d.ts +14 -7
  282. package/es/renderer/LexicalDiff.d.ts +1 -16
  283. package/es/renderer/LexicalDiff.js +1 -1
  284. package/es/renderer/LexicalRenderer.d.ts +1 -11
  285. package/es/renderer/diff/style.js +1 -1
  286. package/es/renderer/diff/types.d.ts +0 -1
  287. package/es/renderer/engine/render-builtin-node.js +1 -1
  288. package/es/renderer/nodes/index.d.ts +0 -1
  289. package/es/renderer/renderers/index.d.ts +0 -1
  290. package/es/renderer/renderers/index.js +1 -1
  291. package/es/renderer/renderers/math.js +2 -2
  292. package/es/renderer/types.d.ts +0 -1
  293. package/es/{symbols-DEEvsKq4.d.ts → symbols-Do7jD4Tt.d.ts} +6 -8
  294. package/es/types/hotkey.d.ts +0 -1
  295. package/es/types/index.d.ts +2 -1
  296. package/es/types/kernel.d.ts +1 -2
  297. package/es/types/locale.d.ts +2 -3
  298. package/es/utils/debug.d.ts +1 -2
  299. package/es/utils/debug.js +1 -1
  300. package/es/utils/hotkey/parseHotkeys.js +1 -1
  301. package/es/utils/hotkey/registerHotkey.d.ts +0 -1
  302. package/package.json +13 -13
@@ -1,6 +1,5 @@
1
1
  import { FC } from "react";
2
-
3
2
  //#region src/plugins/markdown/react/index.d.ts
4
3
  declare const ReactMarkdownPlugin: FC<void>;
5
4
  //#endregion
6
- export { ReactMarkdownPlugin };
5
+ export { ReactMarkdownPlugin as default };
@@ -1,9 +1,9 @@
1
1
  import { IServiceID } from "../../../types/kernel.js";
2
2
  import { IRootNode } from "../../../editor-kernel/inode/root-node.js";
3
+ import "../../../editor-kernel/inode/index.js";
3
4
  import { MarkdownReaderFunc, TransformerRecord } from "../data-source/markdown/parse.js";
4
5
  import { Transformer } from "./transformers.js";
5
6
  import { BaseSelection, ElementNode, LexicalEditor, LexicalNode, TextNode } from "lexical";
6
-
7
7
  //#region src/plugins/markdown/service/shortcut.d.ts
8
8
  interface IMarkdownWriterContext {
9
9
  /**
@@ -54,4 +54,4 @@ interface IMarkdownShortCutService {
54
54
  }
55
55
  declare const IMarkdownShortCutService: IServiceID<IMarkdownShortCutService>;
56
56
  //#endregion
57
- export { IMarkdownShortCutService, MARKDOWN_READER_LEVEL, MARKDOWN_READER_LEVEL_HIGH, MARKDOWN_READER_LEVEL_NORMAL, MARKDOWN_WRITER_LEVEL_MAX };
57
+ export { IMarkdownShortCutService, IMarkdownWriterContext, MARKDOWN_READER_LEVEL, MARKDOWN_READER_LEVEL_HIGH, MARKDOWN_READER_LEVEL_NORMAL, MARKDOWN_WRITER_LEVEL_MAX };
@@ -1,9 +1,10 @@
1
1
  import { createDebugLogger, init_debug } from "../../../utils/debug.js";
2
- import { genServiceId } from "../../../editor-kernel/utils.js";
2
+ import { genServiceId, init_utils } from "../../../editor-kernel/utils.js";
3
3
  import { parseMarkdownToLexical } from "../data-source/markdown/parse.js";
4
4
  import { indexBy, insertIRootNode } from "../utils/index.js";
5
5
  import { $runTextFormatTransformers, runElementTransformers, runTextMatchTransformers, testElementTransformers } from "./transformers.js";
6
6
  //#region src/plugins/markdown/service/shortcut.ts
7
+ init_utils();
7
8
  init_debug();
8
9
  const MARKDOWN_WRITER_LEVEL_MAX = 0;
9
10
  const MARKDOWN_READER_LEVEL_HIGH = 1;
@@ -1,5 +1,4 @@
1
1
  import { ElementNode, LexicalNode, RangeSelection, TextFormatType, TextNode } from "lexical";
2
-
3
2
  //#region src/plugins/markdown/service/transformers.d.ts
4
3
  type TextFormatTransformer = Readonly<{
5
4
  format?: ReadonlyArray<TextFormatType>;
@@ -51,11 +50,10 @@ type ElementTransformer = {
51
50
  /**
52
51
  * Whether the match is from an import operation (e.g. through `$convertFromMarkdownString`) or not (e.g. through typing in the editor).
53
52
  */
54
-
55
53
  isImport: boolean) => boolean | void;
56
54
  trigger?: 'enter';
57
55
  type: 'element';
58
56
  };
59
57
  type Transformer = ElementTransformer | TextFormatTransformer | TextMatchTransformer;
60
58
  //#endregion
61
- export { Transformer };
59
+ export { ElementTransformer, TextFormatTransformer, TextMatchTransformer, Transformer };
@@ -1,5 +1,5 @@
1
+ import "../../../editor-kernel/inode/index.js";
1
2
  import { BaseSelection, LexicalEditor, LexicalNode, TextNode } from "lexical";
2
-
3
3
  //#region src/plugins/markdown/utils/index.d.ts
4
4
  /**
5
5
  * Checks if a character is a punctuation character.
@@ -140,4 +140,4 @@ function insertIRootNode(editor, root, selection) {
140
140
  $insertGeneratedNodes(editor, $generateNodesFromSerializedNodes(root.children), selection);
141
141
  }
142
142
  //#endregion
143
- export { $generateNodesFromSerializedNodes, $insertGeneratedNodes, PUNCTUATION_OR_SPACE, canContainTransformableMarkdown, getOpenTagStartIndex, indexBy, insertIRootNode, isEqualSubString, isPunctuationChar };
143
+ export { $addNodeStyle, $generateNodesFromSerializedNodes, $insertGeneratedNodes, CSS_TO_STYLES, PUNCTUATION_OR_SPACE, canContainTransformableMarkdown, getOpenTagStartIndex, getStyleObjectFromRawCSS, indexBy, insertIRootNode, isEqualSubString, isPunctuationChar };
@@ -1,8 +1,6 @@
1
- import * as _$lexical from "lexical";
2
1
  import { LexicalEditor } from "lexical";
3
-
4
2
  //#region src/plugins/math/command/index.d.ts
5
- declare const INSERT_MATH_COMMAND: _$lexical.LexicalCommand<{
3
+ declare const INSERT_MATH_COMMAND: import("lexical").LexicalCommand<{
6
4
  code: string;
7
5
  }>;
8
6
  //#endregion
@@ -1,3 +1,4 @@
1
1
  import { INSERT_MATH_COMMAND } from "./command/index.js";
2
2
  import { MathPlugin } from "./plugin/index.js";
3
- import { ReactMathPlugin } from "./react/index.js";
3
+ import { ReactMathPlugin } from "./react/index.js";
4
+ export { INSERT_MATH_COMMAND, MathPlugin, ReactMathPlugin };
@@ -1,5 +1,4 @@
1
1
  import { DOMConversionMap, DOMExportOutput, DecoratorNode, EditorConfig, LexicalEditor, LexicalNode, LexicalUpdateJSON, SerializedLexicalNode, Spread } from "lexical";
2
-
3
2
  //#region src/plugins/math/node/index.d.ts
4
3
  type SerializedMathInlineNode = Spread<{
5
4
  code: string;
@@ -41,4 +40,4 @@ declare class MathBlockNode extends DecoratorNode<unknown> {
41
40
  decorate(editor: LexicalEditor): unknown;
42
41
  }
43
42
  //#endregion
44
- export { MathBlockNode, MathInlineNode };
43
+ export { MathBlockNode, MathInlineNode, SerializedMathInlineNode };
@@ -1,7 +1,8 @@
1
- import { getKernelFromEditor } from "../../../editor-kernel/utils.js";
1
+ import { getKernelFromEditor, init_utils } from "../../../editor-kernel/utils.js";
2
2
  import { $applyNodeReplacement, DecoratorNode } from "lexical";
3
3
  import { addClassNamesToElement } from "@lexical/utils";
4
4
  //#region src/plugins/math/node/index.ts
5
+ init_utils();
5
6
  var MathInlineNode = class MathInlineNode extends DecoratorNode {
6
7
  static getType() {
7
8
  return "math";
@@ -158,4 +159,4 @@ function $isMathNode(node) {
158
159
  return node instanceof MathInlineNode || node instanceof MathBlockNode;
159
160
  }
160
161
  //#endregion
161
- export { $createMathBlockNode, $createMathInlineNode, $isMathNode, MathBlockNode, MathInlineNode };
162
+ export { $convertMathBlockElement, $convertMathInlineElement, $createMathBlockNode, $createMathInlineNode, $isMathNode, MathBlockNode, MathInlineNode };
@@ -1,7 +1,7 @@
1
1
  import { IEditorPluginConstructor } from "../../../types/kernel.js";
2
+ import "../../../types/index.js";
2
3
  import { MathBlockNode, MathInlineNode } from "../node/index.js";
3
4
  import { LexicalEditor } from "lexical";
4
-
5
5
  //#region src/plugins/math/plugin/index.d.ts
6
6
  interface MathPluginOptions {
7
7
  decorator?: (node: MathInlineNode | MathBlockNode, editor: LexicalEditor) => unknown;
@@ -12,4 +12,4 @@ interface MathPluginOptions {
12
12
  }
13
13
  declare const MathPlugin: IEditorPluginConstructor<MathPluginOptions>;
14
14
  //#endregion
15
- export { MathPlugin };
15
+ export { MathPlugin, MathPluginOptions };
@@ -31,7 +31,8 @@ const MathEditorContent = memo(({ focusRef, mathNode, onArrowLeft, onArrowRight,
31
31
  setLatexError("");
32
32
  onValidationChange?.(true);
33
33
  } catch (error) {
34
- setLatexError(error instanceof Error ? error.message : "LaTeX Parse Error");
34
+ const errorMessage = error instanceof Error ? error.message : "LaTeX Parse Error";
35
+ setLatexError(errorMessage);
35
36
  onValidationChange?.(false);
36
37
  }
37
38
  }, 50);
@@ -7,7 +7,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  import { $getSelection, $isNodeSelection } from "lexical";
9
9
  import { addClassNamesToElement, removeClassNamesFromElement } from "@lexical/utils";
10
- import katex from "katex";
10
+ import Katex from "katex";
11
11
  //#region src/plugins/math/react/components/MathInline.tsx
12
12
  init_debug();
13
13
  const logger = createDebugLogger("plugin", "math");
@@ -17,7 +17,7 @@ const MathInline = ({ editor, node, className }) => {
17
17
  const [isEditing, setIsEditing] = useState(false);
18
18
  const isMathBlock = node instanceof MathBlockNode;
19
19
  useEffect(() => {
20
- if (ref.current && node.code) katex.render(node.code, ref.current, {
20
+ if (ref.current && node.code) Katex.render(node.code, ref.current, {
21
21
  displayMode: node instanceof MathBlockNode,
22
22
  throwOnError: false
23
23
  });
@@ -1,6 +1,5 @@
1
1
  import { ReactMathPluginProps } from "./type.js";
2
2
  import { FC } from "react";
3
-
4
3
  //#region src/plugins/math/react/index.d.ts
5
4
  declare const ReactMathPlugin: FC<ReactMathPluginProps>;
6
5
  //#endregion
@@ -1,5 +1,4 @@
1
1
  import { FC, ReactNode } from "react";
2
-
3
2
  //#region src/plugins/math/react/type.d.ts
4
3
  interface ReactMathPluginProps {
5
4
  className?: string;
@@ -1,8 +1,6 @@
1
- import * as _$lexical from "lexical";
2
1
  import { LexicalEditor } from "lexical";
3
-
4
2
  //#region src/plugins/mention/command/index.d.ts
5
- declare const INSERT_MENTION_COMMAND: _$lexical.LexicalCommand<{
3
+ declare const INSERT_MENTION_COMMAND: import("lexical").LexicalCommand<{
6
4
  label: string;
7
5
  metadata?: Record<string, unknown>;
8
6
  }>;
@@ -2,4 +2,6 @@ import { INSERT_MENTION_COMMAND } from "./command/index.js";
2
2
  import { SerializedMentionNode } from "./node/MentionNode.js";
3
3
  import { MentionPlugin, MentionPluginOptions } from "./plugin/index.js";
4
4
  import { ReactMentionPluginProps } from "./react/type.js";
5
- import { ReactMentionPlugin } from "./react/ReactMentionPlugin.js";
5
+ import ReactMentionPlugin from "./react/ReactMentionPlugin.js";
6
+ import "./react/index.js";
7
+ export { INSERT_MENTION_COMMAND, MentionPlugin, MentionPluginOptions, ReactMentionPlugin, type ReactMentionPluginProps, type SerializedMentionNode };
@@ -1,5 +1,4 @@
1
1
  import { DOMConversionMap, DOMExportOutput, DecoratorNode, EditorConfig, LexicalEditor, LexicalNode, LexicalUpdateJSON, SerializedLexicalNode, Spread } from "lexical";
2
-
3
2
  //#region src/plugins/mention/node/MentionNode.d.ts
4
3
  type SerializedMentionNode = Spread<{
5
4
  label?: string;
@@ -1,9 +1,10 @@
1
1
  import { IEditorPluginConstructor } from "../../../types/kernel.js";
2
+ import "../../../types/index.js";
2
3
  import { INode } from "../../../editor-kernel/inode/i-node.js";
4
+ import "../../../editor-kernel/inode/index.js";
3
5
  import { Html } from "../../../node_modules/.pnpm/@types_mdast@4.0.4/node_modules/@types/mdast/index.js";
4
6
  import { MentionNode, SerializedMentionNode } from "../node/MentionNode.js";
5
7
  import { LexicalEditor } from "lexical";
6
-
7
8
  //#region src/plugins/mention/plugin/index.d.ts
8
9
  interface MentionPluginOptions {
9
10
  decorator?: (node: MentionNode, editor: LexicalEditor) => any;
@@ -1,7 +1,6 @@
1
1
  import { ReactMentionPluginProps } from "./type.js";
2
2
  import { FC } from "react";
3
-
4
3
  //#region src/plugins/mention/react/ReactMentionPlugin.d.ts
5
4
  declare const ReactMentionPlugin: FC<ReactMentionPluginProps>;
6
5
  //#endregion
7
- export { ReactMentionPlugin };
6
+ export { ReactMentionPlugin as default };
@@ -1,2 +1,3 @@
1
1
  import { ReactMentionPluginProps } from "./type.js";
2
- import { ReactMentionPlugin } from "./ReactMentionPlugin.js";
2
+ import ReactMentionPlugin from "./ReactMentionPlugin.js";
3
+ export { ReactMentionPlugin, type ReactMentionPluginProps };
@@ -1,5 +1,4 @@
1
1
  import { MentionNode } from "../node/MentionNode.js";
2
-
3
2
  //#region src/plugins/mention/react/type.d.ts
4
3
  interface ReactMentionPluginProps {
5
4
  className?: string;
@@ -1,6 +1,8 @@
1
1
  import { ISlashDividerOption, ISlashMenuOption, ISlashOption, ISlashSectionOption, ISlashService, SlashOptions, flattenSlashOptions, isSlashDividerOption, isSlashMenuOption, isSlashSectionOption } from "./service/i-slash-service.js";
2
2
  import { ITriggerContext, SlashPlugin, SlashPluginOptions } from "./plugin/index.js";
3
3
  import { MenuRenderProps, ReactSlashOptionProps, ReactSlashPluginProps, SlashMenuProps } from "./react/type.js";
4
- import { SlashMenu } from "./react/components/SlashMenu.js";
5
- import { ReactSlashOption } from "./react/ReactSlashOption.js";
6
- import { ReactSlashPlugin } from "./react/ReactSlashPlugin.js";
4
+ import SlashMenu from "./react/components/SlashMenu.js";
5
+ import ReactSlashOption from "./react/ReactSlashOption.js";
6
+ import ReactSlashPlugin from "./react/ReactSlashPlugin.js";
7
+ import "./react/index.js";
8
+ export { type ISlashDividerOption, type ISlashMenuOption, type ISlashOption, type ISlashSectionOption, type ISlashService, ITriggerContext, type MenuRenderProps, ReactSlashOption, type ReactSlashOptionProps, ReactSlashPlugin, type ReactSlashPluginProps, SlashMenu, type SlashMenuProps, type SlashOptions, SlashPlugin, SlashPluginOptions, flattenSlashOptions, isSlashDividerOption, isSlashMenuOption, isSlashSectionOption };
@@ -1,6 +1,6 @@
1
1
  import { IEditorPluginConstructor } from "../../../types/kernel.js";
2
+ import "../../../types/index.js";
2
3
  import { ISlashOption, SlashOptions } from "../service/i-slash-service.js";
3
-
4
4
  //#region src/plugins/slash/plugin/index.d.ts
5
5
  interface ITriggerContext {
6
6
  getRect: () => DOMRect;
@@ -1,7 +1,6 @@
1
1
  import { ReactSlashOptionProps } from "./type.js";
2
2
  import { FC } from "react";
3
-
4
3
  //#region src/plugins/slash/react/ReactSlashOption.d.ts
5
4
  declare const ReactSlashOption: FC<ReactSlashOptionProps>;
6
5
  //#endregion
7
- export { ReactSlashOption };
6
+ export { ReactSlashOption as default };
@@ -1,7 +1,6 @@
1
1
  import { ReactSlashPluginProps } from "./type.js";
2
2
  import { FC } from "react";
3
-
4
3
  //#region src/plugins/slash/react/ReactSlashPlugin.d.ts
5
4
  declare const ReactSlashPlugin: FC<ReactSlashPluginProps>;
6
5
  //#endregion
7
- export { ReactSlashPlugin };
6
+ export { ReactSlashPlugin as default };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { noop } from "../../../editor-kernel/utils.js";
2
+ import { init_utils, noop } from "../../../editor-kernel/utils.js";
3
3
  import { useLexicalComposerContext } from "../../../editor-kernel/react/react-context.js";
4
4
  import { useLexicalEditor } from "../../../editor-kernel/react/useLexicalEditor.js";
5
5
  import { $splitNodeContainingQuery } from "../utils/utils.js";
@@ -12,6 +12,7 @@ import { jsx } from "react/jsx-runtime";
12
12
  import { COMMAND_PRIORITY_CRITICAL, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_DOWN_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND } from "lexical";
13
13
  import { mergeRegister } from "@lexical/utils";
14
14
  //#region src/plugins/slash/react/ReactSlashPlugin.tsx
15
+ init_utils();
15
16
  const ReactSlashPlugin = ({ children, anchorClassName, getPopupContainer, placement }) => {
16
17
  const [editor] = useLexicalComposerContext();
17
18
  const [isOpen, setIsOpen] = useState(false);
@@ -1,6 +1,5 @@
1
1
  import { SlashMenuProps } from "../type.js";
2
2
  import { FC } from "react";
3
-
4
3
  //#region src/plugins/slash/react/components/SlashMenu.d.ts
5
4
  /**
6
5
  * SlashMenu component - Only responsible for rendering the menu UI
@@ -8,4 +7,4 @@ import { FC } from "react";
8
7
  */
9
8
  declare const SlashMenu: FC<SlashMenuProps>;
10
9
  //#endregion
11
- export { SlashMenu };
10
+ export { SlashMenu as default };
@@ -1,4 +1,5 @@
1
1
  import { MenuRenderProps, ReactSlashOptionProps, ReactSlashPluginProps, SlashMenuProps } from "./type.js";
2
- import { SlashMenu } from "./components/SlashMenu.js";
3
- import { ReactSlashOption } from "./ReactSlashOption.js";
4
- import { ReactSlashPlugin } from "./ReactSlashPlugin.js";
2
+ import SlashMenu from "./components/SlashMenu.js";
3
+ import ReactSlashOption from "./ReactSlashOption.js";
4
+ import ReactSlashPlugin from "./ReactSlashPlugin.js";
5
+ export { type MenuRenderProps, ReactSlashOption, type ReactSlashOptionProps, ReactSlashPlugin, type ReactSlashPluginProps, SlashMenu, type SlashMenuProps };
@@ -1,8 +1,9 @@
1
1
  import { IEditor } from "../../../types/kernel.js";
2
+ import "../../../types/index.js";
2
3
  import { ISlashMenuOption, ISlashOption, SlashOptions } from "../service/i-slash-service.js";
4
+ import "../index.js";
3
5
  import { FC, ReactElement } from "react";
4
6
  import { IFuseOptions } from "fuse.js";
5
-
6
7
  //#region src/plugins/slash/react/type.d.ts
7
8
  interface ReactSlashOptionProps {
8
9
  /**
@@ -1,8 +1,9 @@
1
1
  import { IEditor, IServiceID } from "../../../types/kernel.js";
2
+ import "../../../types/index.js";
3
+ import "../utils/utils.js";
2
4
  import { DropdownMenuItemType } from "@lobehub/ui";
3
5
  import { ReactNode } from "react";
4
6
  import Fuse, { IFuseOptions } from "fuse.js";
5
-
6
7
  //#region src/plugins/slash/service/i-slash-service.d.ts
7
8
  type ISlashDividerOption = {
8
9
  type: 'divider';
@@ -1,8 +1,9 @@
1
1
  import { createDebugLogger, init_debug } from "../../../utils/debug.js";
2
- import { genServiceId } from "../../../editor-kernel/utils.js";
2
+ import { genServiceId, init_utils } from "../../../editor-kernel/utils.js";
3
3
  import { getBasicTypeaheadTriggerMatch } from "../utils/utils.js";
4
4
  import Fuse from "fuse.js";
5
5
  //#region src/plugins/slash/service/i-slash-service.ts
6
+ init_utils();
6
7
  init_debug();
7
8
  const isSlashDividerOption = (option) => "type" in option && option.type === "divider";
8
9
  const isSlashSectionOption = (option) => "type" in option && option.type === "section";
@@ -94,4 +94,4 @@ function $splitNodeContainingQuery(match) {
94
94
  return newNode;
95
95
  }
96
96
  //#endregion
97
- export { $splitNodeContainingQuery, getBasicTypeaheadTriggerMatch, getQueryTextForSearch, tryToPositionRange };
97
+ export { $splitNodeContainingQuery, PUNCTUATION, getBasicTypeaheadTriggerMatch, getQueryTextForSearch, getTextUpToAnchor, tryToPositionRange };
@@ -1,26 +1,24 @@
1
1
  import { InsertTableCommandPayloadHeaders } from "@lexical/table";
2
- import * as _$lexical from "lexical";
3
2
  import { LexicalEditor } from "lexical";
4
-
5
3
  //#region src/plugins/table/command/index.d.ts
6
- declare const INSERT_TABLE_COMMAND: _$lexical.LexicalCommand<{
4
+ declare const INSERT_TABLE_COMMAND: import("lexical").LexicalCommand<{
7
5
  columns: string;
8
6
  includeHeaders?: InsertTableCommandPayloadHeaders;
9
7
  rows: string;
10
8
  }>;
11
- declare const SELECT_TABLE_COMMAND: _$lexical.LexicalCommand<{
9
+ declare const SELECT_TABLE_COMMAND: import("lexical").LexicalCommand<{
12
10
  anchorIndex?: number;
13
11
  columnIndex?: number;
14
12
  extend?: boolean;
15
13
  rowIndex?: number;
16
14
  table: string;
17
15
  }>;
18
- declare const INSERT_TABLE_COLUMN_COMMAND: _$lexical.LexicalCommand<{
16
+ declare const INSERT_TABLE_COLUMN_COMMAND: import("lexical").LexicalCommand<{
19
17
  columnIndex: number;
20
18
  insertAfter?: boolean;
21
19
  table: string;
22
20
  }>;
23
- declare const INSERT_TABLE_ROW_COMMAND: _$lexical.LexicalCommand<{
21
+ declare const INSERT_TABLE_ROW_COMMAND: import("lexical").LexicalCommand<{
24
22
  insertAfter?: boolean;
25
23
  rowIndex: number;
26
24
  table: string;
@@ -44,7 +44,7 @@ const $selectTableRows = (tableNode, from, to) => {
44
44
  const firstRow = tableMap[from];
45
45
  const lastRow = tableMap[to];
46
46
  const firstCell = firstRow?.[0]?.cell;
47
- const lastCell = lastRow?.[lastRow.length - 1]?.cell;
47
+ const lastCell = lastRow?.at(-1)?.cell;
48
48
  if (!firstCell || !lastCell) return false;
49
49
  const tableSelection = $createTableSelection();
50
50
  tableSelection.set(tableNode.getKey(), firstCell.getKey(), lastCell.getKey());
@@ -116,7 +116,7 @@ function registerTableCommand(editor) {
116
116
  const [tableMap] = $computeTableMapSkipCellCheck(tableNode, null, null);
117
117
  const row = tableMap[rowIndex];
118
118
  const firstCell = row?.[0]?.cell;
119
- const lastCell = row?.[row.length - 1]?.cell;
119
+ const lastCell = row?.at(-1)?.cell;
120
120
  if (!firstCell || !lastCell) return false;
121
121
  const tableSelection = $createTableSelection();
122
122
  tableSelection.set(table, firstCell.getKey(), lastCell.getKey());
@@ -206,7 +206,7 @@ function registerTableCommand(editor) {
206
206
  const firstRow = tableMap[from];
207
207
  const lastRow = tableMap[to];
208
208
  const firstCell = firstRow?.[0]?.cell;
209
- const lastCell = lastRow?.[lastRow.length - 1]?.cell;
209
+ const lastCell = lastRow?.at(-1)?.cell;
210
210
  if (!firstCell || !lastCell) return false;
211
211
  tableSelection.set(table, firstCell.getKey(), lastCell.getKey());
212
212
  $setSelection(tableSelection);
@@ -227,7 +227,7 @@ function registerTableCommand(editor) {
227
227
  const firstRow = tableMap[0];
228
228
  const lastRow = tableMap.at(-1);
229
229
  const firstCell = firstRow?.[0]?.cell;
230
- const lastCell = lastRow?.[lastRow.length - 1]?.cell;
230
+ const lastCell = lastRow?.at(-1)?.cell;
231
231
  if (!firstCell || !lastCell) return false;
232
232
  tableSelection.set(table, firstCell.getKey(), lastCell.getKey());
233
233
  $setSelection(tableSelection);
@@ -1,4 +1,6 @@
1
1
  import { INSERT_TABLE_COLUMN_COMMAND, INSERT_TABLE_COMMAND, INSERT_TABLE_ROW_COMMAND, SELECT_TABLE_COMMAND } from "./command/index.js";
2
2
  import { TablePlugin, TablePluginOptions } from "./plugin/index.js";
3
3
  import { ReactTablePlugin } from "./react/index.js";
4
- import { ITableControllerMenuActionItem, ITableControllerMenuItem, ITableControllerMenuRenderContext, ITableControllerMenuSeparatorItem, ITableControllerMenuService, TableControllerMenuAxis, TableControllerMenuService } from "./service/i-table-controller-menu-service.js";
4
+ import { ITableControllerMenuActionItem, ITableControllerMenuItem, ITableControllerMenuRenderContext, ITableControllerMenuSeparatorItem, ITableControllerMenuService, TableControllerMenuAxis, TableControllerMenuService } from "./service/i-table-controller-menu-service.js";
5
+ import "./service/index.js";
6
+ export { INSERT_TABLE_COLUMN_COMMAND, INSERT_TABLE_COMMAND, INSERT_TABLE_ROW_COMMAND, ITableControllerMenuActionItem, ITableControllerMenuItem, ITableControllerMenuRenderContext, ITableControllerMenuSeparatorItem, ITableControllerMenuService, ReactTablePlugin, SELECT_TABLE_COMMAND, TableControllerMenuAxis, TableControllerMenuService, TablePlugin, TablePluginOptions };
@@ -1,7 +1,8 @@
1
- import { getKernelFromEditor, getKernelFromEditorConfig, reconcileDecorator } from "../../../editor-kernel/utils.js";
1
+ import { getKernelFromEditor, getKernelFromEditorConfig, init_utils, reconcileDecorator } from "../../../editor-kernel/utils.js";
2
2
  import { TableNode, TableNode as TableNode$1 } from "@lexical/table";
3
3
  import { setDOMUnmanaged } from "lexical";
4
4
  //#region src/plugins/table/node/index.ts
5
+ init_utils();
5
6
  const OriginalCreateDOM = TableNode.prototype.createDOM;
6
7
  const OriginalUpdateDOM = TableNode.prototype.updateDOM;
7
8
  const SCROLL_INDICATOR_WIDTH = 24;
@@ -1,8 +1,8 @@
1
1
  import { IEditorPluginConstructor } from "../../../types/kernel.js";
2
+ import "../../../types/index.js";
2
3
  import { TableNode } from "../node/index.js";
3
4
  import { ReactNode } from "react";
4
5
  import { LexicalEditor } from "lexical";
5
-
6
6
  //#region src/plugins/table/plugin/index.d.ts
7
7
  interface TablePluginOptions {
8
8
  decoratorCol?: (node: TableNode, editor: LexicalEditor) => ReactNode;
@@ -84,8 +84,7 @@ const TablePlugin = class extends KernelPlugin {
84
84
  if (!$isTableNode(node)) return false;
85
85
  const [tableMap] = $computeTableMapSkipCellCheck(node, null, null);
86
86
  const firstCell = tableMap[0]?.[0]?.cell;
87
- const lastRow = [...tableMap].reverse().find((row) => row.length > 0);
88
- const lastCell = lastRow?.[lastRow.length - 1]?.cell;
87
+ const lastCell = [...tableMap].reverse().find((row) => row.length > 0)?.at(-1)?.cell;
89
88
  if (!firstCell || !lastCell) return false;
90
89
  const tableSelection = $createTableSelection();
91
90
  tableSelection.set(node.getKey(), firstCell.getKey(), lastCell.getKey());
@@ -10,13 +10,6 @@ import { $getTableCellNodeFromLexicalNode, $getTableNodeFromLexicalNodeOrThrow,
10
10
  import { $getNodeByKey, $getSelection, $isRangeSelection, COMMAND_PRIORITY_CRITICAL, SELECTION_CHANGE_COMMAND, getDOMSelection } from "lexical";
11
11
  import { mergeRegister } from "@lexical/utils";
12
12
  //#region src/plugins/table/react/TableActionMenu/index.tsx
13
- /**
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- *
19
- */
20
13
  const TableActionMenu = memo(({ cellMerge, editor }) => {
21
14
  const anchorElem = useAnchor();
22
15
  const menuButtonRef = useRef(null);
@@ -1,11 +1,11 @@
1
- import LexicalPortalContainer from "../../../editor-kernel/react/PortalContainer.js";
1
+ import { LexicalPortalContainer } from "../../../editor-kernel/react/PortalContainer.js";
2
2
  import { INSERT_TABLE_COLUMN_COMMAND, MOVE_TABLE_COLUMN_COMMAND, SELECT_TABLE_COMMAND } from "../command/index.js";
3
+ import { useTableControllerSelection } from "./hooks.js";
3
4
  import { sum, useTableAxisDrag, useTableColumnMetrics } from "./TableController/hooks.js";
4
5
  import { styles } from "./TableController/style.js";
5
6
  import { createTableDragImage } from "./TableController/utils.js";
6
7
  import TableControllerMenu from "./TableControllerMenu.js";
7
8
  import TableInsertButton from "./TableInsertButton.js";
8
- import { useTableControllerSelection } from "./hooks.js";
9
9
  import { memo, useCallback, useEffect, useRef, useState } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { cx } from "antd-style";
@@ -98,9 +98,10 @@ const useTableRowMetrics = (editor, node) => {
98
98
  const rows = tableElement.querySelectorAll("tr");
99
99
  if (rows.length === 0) return;
100
100
  const tableRect = table instanceof HTMLElement ? table.getBoundingClientRect() : null;
101
- const nextHeights = getControlledRowHeights(Array.from(rows, (row, index) => {
101
+ const measuredHeights = Array.from(rows, (row, index) => {
102
102
  return normalizeRowControllerHeight(row.getBoundingClientRect().height, index + 1 === rows.length);
103
- }), tableRect?.height || 0);
103
+ });
104
+ const nextHeights = getControlledRowHeights(measuredHeights, tableRect?.height || 0);
104
105
  setRowHeights((currentHeights) => {
105
106
  if (currentHeights.length === nextHeights.length && currentHeights.every((height, index) => height === nextHeights[index])) return currentHeights;
106
107
  return nextHeights;
@@ -29,4 +29,4 @@ function useDebounce(fn, ms, maxWait) {
29
29
  }, ms, { maxWait }), [ms, maxWait]);
30
30
  }
31
31
  //#endregion
32
- export { getMouseInfo, useDebounce };
32
+ export { getMouseInfo, getThemeSelector, useDebounce };
@@ -325,4 +325,4 @@ var TableResize_default = memo(({ editor, eventEmitter, resizeMode }) => {
325
325
  }), container);
326
326
  });
327
327
  //#endregion
328
- export { TableResize_default as default };
328
+ export { TableCellResize, TableResize_default as default };
@@ -1,10 +1,10 @@
1
1
  import { INSERT_TABLE_ROW_COMMAND, MOVE_TABLE_ROW_COMMAND, SELECT_TABLE_COMMAND } from "../command/index.js";
2
+ import { useTableControllerSelection } from "./hooks.js";
2
3
  import { sum, useTableAxisDrag, useTableRowMetrics } from "./TableController/hooks.js";
3
4
  import { styles } from "./TableController/style.js";
4
5
  import { createTableDragImage } from "./TableController/utils.js";
5
6
  import TableControllerMenu from "./TableControllerMenu.js";
6
7
  import TableInsertButton from "./TableInsertButton.js";
7
- import { useTableControllerSelection } from "./hooks.js";
8
8
  import { memo, useCallback, useEffect, useRef, useState } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { cx } from "antd-style";
@@ -4,13 +4,6 @@ import { $findTableNode, $isTableSelection } from "@lexical/table";
4
4
  import "es-toolkit/compat";
5
5
  import { $getNodeByKey, $getSelection, $isRangeSelection } from "lexical";
6
6
  //#region src/plugins/table/react/hooks.ts
7
- /**
8
- * Copyright (c) Meta Platforms, Inc. and affiliates.
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- *
13
- */
14
7
  const isSameSelection = (current, next) => {
15
8
  return current.isTableFocused === next.isTableFocused && current.isTableSelected === next.isTableSelected && current.selectedColumns.length === next.selectedColumns.length && current.selectedRows.length === next.selectedRows.length && current.selectedColumns.every((column, index) => column === next.selectedColumns[index]) && current.selectedRows.every((row, index) => row === next.selectedRows[index]);
16
9
  };
@@ -1,6 +1,5 @@
1
1
  import { ReactTablePluginProps } from "./type.js";
2
2
  import { FC } from "react";
3
-
4
3
  //#region src/plugins/table/react/index.d.ts
5
4
  declare const ReactTablePlugin: FC<ReactTablePluginProps>;
6
5
  //#endregion
@@ -6,12 +6,12 @@ import { $updateDOMForSelection } from "../utils/index.js";
6
6
  import { ITableControllerMenuService } from "../service/i-table-controller-menu-service.js";
7
7
  import { TablePlugin } from "../plugin/index.js";
8
8
  import PortalAnchor from "../../../editor-kernel/react/PortalAnchor.js";
9
+ import { selectionOutlineStyles, styles } from "./style.js";
9
10
  import TableActionMenu from "./TableActionMenu/index.js";
10
11
  import TableColController from "./TableColController.js";
11
12
  import TableHoverActions from "./TableHoverActions/index.js";
12
13
  import TableResize_default from "./TableResize/index.js";
13
14
  import TableRowController from "./TableRowController.js";
14
- import { selectionOutlineStyles, styles } from "./style.js";
15
15
  import { useAutoFitPastedTable } from "./useAutoFitPastedTable.js";
16
16
  import { useCallback, useEffect, useLayoutEffect, useMemo, useState } from "react";
17
17
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1,5 @@
1
1
  import { ILocaleKeys } from "../../../types/locale.js";
2
+ import "../../../types/index.js";
2
3
  //#region src/plugins/table/react/type.d.ts
3
4
  type TableResizeMode = 'realtime' | 'deferred';
4
5
  interface ReactTablePluginProps {
@@ -7,4 +8,4 @@ interface ReactTablePluginProps {
7
8
  resizeMode?: TableResizeMode;
8
9
  }
9
10
  //#endregion
10
- export { ReactTablePluginProps };
11
+ export { ReactTablePluginProps, TableResizeMode };