@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/react.d.ts CHANGED
@@ -1,21 +1,28 @@
1
1
  import { ANCHOR_PADDING_CSS_VAR, DEFAULT_BLOCK_ANCHOR_PADDING } from "./plugins/block/react/style.js";
2
2
  import { CollaborationProviderFactory, EditorCollaborationConfig } from "./plugins/collaboration/react/type.js";
3
+ import "./plugins/collaboration/index.js";
3
4
  import { ChatInputProps } from "./react/ChatInput/type.js";
4
- import { ChatInput } from "./react/ChatInput/ChatInput.js";
5
+ import ChatInput from "./react/ChatInput/ChatInput.js";
6
+ import "./react/ChatInput/index.js";
5
7
  import { ChatInputActionBarProps } from "./react/ChatInputActionBar/type.js";
6
- import { ChatInputActionBar } from "./react/ChatInputActionBar/ChatInputActionBar.js";
8
+ import ChatInputActionBar from "./react/ChatInputActionBar/ChatInputActionBar.js";
9
+ import "./react/ChatInputActionBar/index.js";
7
10
  import { ChatInputActionEvent, ChatInputActionsProps } from "./react/ChatInputActions/type.js";
8
- import { ChatInputActions } from "./react/ChatInputActions/ChatInputActions.js";
11
+ import ChatInputActions from "./react/ChatInputActions/ChatInputActions.js";
12
+ import "./react/ChatInputActions/index.js";
9
13
  import { CodeLanguageSelectProps } from "./react/CodeLanguageSelect/type.js";
10
- import { CodeLanguageSelect } from "./react/CodeLanguageSelect/CodeLanguageSelect.js";
14
+ import CodeLanguageSelect from "./react/CodeLanguageSelect/CodeLanguageSelect.js";
15
+ import "./react/CodeLanguageSelect/index.js";
11
16
  import { useEditor } from "./react/hooks/useEditor.js";
12
17
  import { EditorState, useEditorState } from "./react/hooks/useEditorState/index.js";
13
18
  import { EditorProps } from "./react/Editor/type.js";
14
19
  import { withProps } from "./react/Editor/utils.js";
15
- import { Editor } from "./react/Editor/index.js";
20
+ import Editor from "./react/Editor/index.js";
16
21
  import { EditorProvider, EditorProviderConfig, EditorProviderProps, useEditorContent } from "./react/EditorProvider/index.js";
17
22
  import { FloatActionsProps } from "./react/FloatActions/type.js";
18
- import { FloatActions } from "./react/FloatActions/FloatActions.js";
23
+ import FloatActions from "./react/FloatActions/FloatActions.js";
24
+ import "./react/FloatActions/index.js";
19
25
  import { SendButtonProps } from "./react/SendButton/type.js";
20
- import { SendButton } from "./react/SendButton/SendButton.js";
26
+ import SendButton from "./react/SendButton/SendButton.js";
27
+ import "./react/SendButton/index.js";
21
28
  export { ANCHOR_PADDING_CSS_VAR, ChatInput, ChatInputActionBar, type ChatInputActionBarProps, type ChatInputActionEvent, ChatInputActions, type ChatInputActionsProps, type ChatInputProps, CodeLanguageSelect, type CodeLanguageSelectProps, type CollaborationProviderFactory, DEFAULT_BLOCK_ANCHOR_PADDING, Editor, type EditorCollaborationConfig, type EditorProps, EditorProvider, type EditorProviderConfig, type EditorProviderProps, type EditorState, FloatActions, type FloatActionsProps, SendButton, type SendButtonProps, useEditor, useEditorContent, useEditorState, withProps };
@@ -1,10 +1,8 @@
1
1
  import { DiffAppearance } from "./diff/style.js";
2
2
  import { LexicalDiffBlockRenderContext, LexicalDiffBlockRenderer, LexicalDiffCell, LexicalDiffRow, LexicalDiffRowKind } from "./diff/types.js";
3
3
  import { LexicalRendererProps } from "./types.js";
4
- import * as _$react from "react";
5
4
  import { CSSProperties, ReactNode } from "react";
6
5
  import { SerializedEditorState } from "lexical";
7
-
8
6
  //#region src/renderer/LexicalDiff.d.ts
9
7
  interface LexicalDiffProps {
10
8
  appearance?: DiffAppearance;
@@ -23,19 +21,6 @@ interface LexicalDiffProps {
23
21
  style?: CSSProperties;
24
22
  variant?: LexicalRendererProps['variant'];
25
23
  }
26
- declare function LexicalDiff({
27
- oldValue,
28
- newValue,
29
- variant,
30
- appearance,
31
- extraNodes,
32
- overrides,
33
- renderContext,
34
- labels,
35
- blockRenderers,
36
- renderBlockDiff,
37
- className,
38
- style
39
- }: LexicalDiffProps): _$react.JSX.Element;
24
+ declare function LexicalDiff({ oldValue, newValue, variant, appearance, extraNodes, overrides, renderContext, labels, blockRenderers, renderBlockDiff, className, style }: LexicalDiffProps): import("react").JSX.Element;
40
25
  //#endregion
41
26
  export { LexicalDiff, LexicalDiffProps };
@@ -1,6 +1,6 @@
1
- import { LexicalRenderer } from "./LexicalRenderer.js";
2
1
  import { computeLexicalDiffRows } from "./diff/compute.js";
3
2
  import { diffStyles } from "./diff/style.js";
3
+ import { LexicalRenderer } from "./LexicalRenderer.js";
4
4
  import { useMemo } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { cx } from "antd-style";
@@ -1,16 +1,6 @@
1
1
  import { LexicalRendererProps } from "./types.js";
2
2
  import { ReactElement } from "react";
3
-
4
3
  //#region src/renderer/LexicalRenderer.d.ts
5
- declare function LexicalRenderer({
6
- value,
7
- overrides,
8
- extraNodes,
9
- renderContext,
10
- as: Tag,
11
- className,
12
- style,
13
- variant
14
- }: LexicalRendererProps): ReactElement;
4
+ declare function LexicalRenderer({ value, overrides, extraNodes, renderContext, as: Tag, className, style, variant }: LexicalRendererProps): ReactElement;
15
5
  //#endregion
16
6
  export { LexicalRenderer };
@@ -92,7 +92,7 @@ const borderlessOverrides = createStaticStyles(({ css, cssVar }) => ({
92
92
  }));
93
93
  function merge(baseSet, overrides) {
94
94
  const result = {};
95
- const allKeys = new Set([...Object.keys(baseSet), ...Object.keys(overrides)]);
95
+ const allKeys = /* @__PURE__ */ new Set([...Object.keys(baseSet), ...Object.keys(overrides)]);
96
96
  for (const key of allKeys) result[key] = cx(baseSet[key], overrides[key]);
97
97
  return result;
98
98
  }
@@ -1,6 +1,5 @@
1
1
  import { ReactNode } from "react";
2
2
  import { SerializedLexicalNode } from "lexical";
3
-
4
3
  //#region src/renderer/diff/types.d.ts
5
4
  type LexicalDiffRowKind = 'delete' | 'equal' | 'insert' | 'modify';
6
5
  interface LexicalDiffCell {
@@ -3,7 +3,7 @@ import { parseCSSText } from "./utils.js";
3
3
  import { createElement } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/renderer/engine/render-builtin-node.tsx
6
- const SAFE_URL_PROTOCOLS = new Set([
6
+ const SAFE_URL_PROTOCOLS = /* @__PURE__ */ new Set([
7
7
  "http:",
8
8
  "https:",
9
9
  "mailto:",
@@ -1,5 +1,4 @@
1
1
  import { Klass, LexicalNode } from "lexical";
2
-
3
2
  //#region src/renderer/nodes/index.d.ts
4
3
  declare const rendererNodes: Array<Klass<LexicalNode>>;
5
4
  //#endregion
@@ -1,5 +1,4 @@
1
1
  import { RendererRegistry } from "../types.js";
2
-
3
2
  //#region src/renderer/renderers/index.d.ts
4
3
  declare function createDefaultRenderers(): RendererRegistry;
5
4
  //#endregion
@@ -6,7 +6,7 @@ import { renderMath } from "./math.js";
6
6
  import { renderMention } from "./mention.js";
7
7
  //#region src/renderer/renderers/index.ts
8
8
  function createDefaultRenderers() {
9
- return new Map([
9
+ return /* @__PURE__ */ new Map([
10
10
  ["image", renderImage],
11
11
  ["block-image", renderBlockImage],
12
12
  ["math", renderMath],
@@ -1,11 +1,11 @@
1
1
  import { getMathBlockClassName, getMathInlineClassName } from "../style.js";
2
2
  import { createElement } from "react";
3
- import katex from "katex";
3
+ import Katex from "katex";
4
4
  //#region src/renderer/renderers/math.tsx
5
5
  function renderMath(node, key) {
6
6
  const code = node.code || "";
7
7
  const displayMode = node.type === "mathBlock";
8
- const html = katex.renderToString(code, {
8
+ const html = Katex.renderToString(code, {
9
9
  displayMode,
10
10
  throwOnError: false
11
11
  });
@@ -1,6 +1,5 @@
1
1
  import { CSSProperties, JSX, ReactNode } from "react";
2
2
  import { Klass, LexicalNode, SerializedEditorState } from "lexical";
3
-
4
3
  //#region src/renderer/types.d.ts
5
4
  type NodeRenderer = (node: Record<string, any>, key: string, children: ReactNode[] | null) => ReactNode;
6
5
  type RendererRegistry = Map<string, NodeRenderer>;
@@ -1,5 +1,3 @@
1
- import * as _$lexical from "lexical";
2
-
3
1
  //#region src/plugins/litexml/command/symbols.d.ts
4
2
  /**
5
3
  * LiteXML command identities.
@@ -24,7 +22,7 @@ declare enum DiffAction {
24
22
  Reject = 0,
25
23
  Accept = 1
26
24
  }
27
- declare const LITEXML_MODIFY_COMMAND: _$lexical.LexicalCommand<({
25
+ declare const LITEXML_MODIFY_COMMAND: import("lexical").LexicalCommand<({
28
26
  action: "insert";
29
27
  beforeId: string;
30
28
  litexml: string;
@@ -39,15 +37,15 @@ declare const LITEXML_MODIFY_COMMAND: _$lexical.LexicalCommand<({
39
37
  action: "modify";
40
38
  litexml: string | string[];
41
39
  })[]>;
42
- declare const LITEXML_APPLY_COMMAND: _$lexical.LexicalCommand<{
40
+ declare const LITEXML_APPLY_COMMAND: import("lexical").LexicalCommand<{
43
41
  delay?: boolean;
44
42
  litexml: string | string[];
45
43
  }>;
46
- declare const LITEXML_REMOVE_COMMAND: _$lexical.LexicalCommand<{
44
+ declare const LITEXML_REMOVE_COMMAND: import("lexical").LexicalCommand<{
47
45
  delay?: boolean;
48
46
  id: string;
49
47
  }>;
50
- declare const LITEXML_INSERT_COMMAND: _$lexical.LexicalCommand<{
48
+ declare const LITEXML_INSERT_COMMAND: import("lexical").LexicalCommand<{
51
49
  beforeId: string;
52
50
  delay?: boolean;
53
51
  litexml: string;
@@ -56,11 +54,11 @@ declare const LITEXML_INSERT_COMMAND: _$lexical.LexicalCommand<{
56
54
  delay?: boolean;
57
55
  litexml: string;
58
56
  }>;
59
- declare const LITEXML_DIFFNODE_COMMAND: _$lexical.LexicalCommand<{
57
+ declare const LITEXML_DIFFNODE_COMMAND: import("lexical").LexicalCommand<{
60
58
  action: DiffAction;
61
59
  nodeKey: string;
62
60
  }>;
63
- declare const LITEXML_DIFFNODE_ALL_COMMAND: _$lexical.LexicalCommand<{
61
+ declare const LITEXML_DIFFNODE_ALL_COMMAND: import("lexical").LexicalCommand<{
64
62
  action: DiffAction;
65
63
  }>;
66
64
  //#endregion
@@ -1,5 +1,4 @@
1
1
  import { CommandListenerPriority } from "lexical";
2
-
3
2
  //#region src/types/hotkey.d.ts
4
3
  declare const KeyEnum: {
5
4
  readonly Alt: "alt";
@@ -1,2 +1,3 @@
1
1
  import { ILocaleKeys, LocaleType } from "./locale.js";
2
- import { IBeforeEditorInitLifecycle, IDecorator, IDecoratorFunc, IDocumentOptions, IEditor, IEditorKernel, IEditorPlugin, IEditorPluginConstructor, IKernelEventMap, INodeRegistrationTransform, IPlugin, ISelectionObject, IServiceID } from "./kernel.js";
2
+ import { IBeforeEditorInitLifecycle, IDecorator, IDecoratorFunc, IDocumentOptions, IEditor, IEditorKernel, IEditorPlugin, IEditorPluginConstructor, IKernelEventMap, INodeRegistrationTransform, IPlugin, ISelectionObject, IServiceID } from "./kernel.js";
3
+ export { IBeforeEditorInitLifecycle, IDecorator, IDecoratorFunc, IDocumentOptions, IEditor, IEditorKernel, IEditorPlugin, IEditorPluginConstructor, IKernelEventMap, ILocaleKeys, INodeRegistrationTransform, IPlugin, ISelectionObject, IServiceID, LocaleType };
@@ -1,10 +1,9 @@
1
- import { DataSource } from "../editor-kernel/data-source.js";
1
+ import DataSource from "../editor-kernel/data-source.js";
2
2
  import { HotkeyId } from "./hotkey.js";
3
3
  import { HotkeyOptions, HotkeysEvent } from "../utils/hotkey/registerHotkey.js";
4
4
  import { ILocaleKeys } from "./locale.js";
5
5
  import { HistoryState, HistoryStateEntry } from "@lexical/history";
6
6
  import { CommandListener, CommandListenerPriority, CommandPayloadType, EditorState, LexicalCommand, LexicalEditor, LexicalNode, LexicalNodeConfig } from "lexical";
7
-
8
7
  //#region src/types/kernel.d.ts
9
8
  type IDecoratorFunc = (_node: LexicalNode, _editor: LexicalEditor) => any;
10
9
  type INodeRegistrationTransform = (node: LexicalNodeConfig, index: number) => LexicalNodeConfig | null | undefined;
@@ -1,11 +1,10 @@
1
- import { _default } from "../locale/index.js";
2
-
1
+ import _default from "../locale/index.js";
3
2
  //#region src/types/locale.d.ts
4
3
  /**
5
4
  * Internationalization key type declaration, plugins can extend through declaration merging
6
5
  */
7
6
  type LocaleType = typeof _default;
8
- type FlattenKeys<T, Prefix extends string = ''> = { [K in keyof T & string]: T[K] extends string ? Prefix extends '' ? K : `${Prefix}.${K}` : T[K] extends Record<string, any> ? FlattenKeys<T[K], Prefix extends '' ? K : `${Prefix}.${K}`> : never }[keyof T & string];
7
+ type FlattenKeys<T, Prefix extends string = ''> = { [K in keyof T & string]: T[K] extends string ? Prefix extends '' ? K : `${Prefix}.${K}` : T[K] extends Record<string, any> ? FlattenKeys<T[K], Prefix extends '' ? K : `${Prefix}.${K}`> : never; }[keyof T & string];
9
8
  type ILocaleKeys = Record<FlattenKeys<LocaleType>, string>;
10
9
  //#endregion
11
10
  export { ILocaleKeys, LocaleType };
@@ -1,5 +1,4 @@
1
1
  import createDebug from "debug";
2
-
3
2
  //#region src/utils/debug.d.ts
4
3
  /**
5
4
  * Debug utility factory for LobeHub Editor
@@ -422,4 +421,4 @@ declare const browserDebug: {
422
421
  showStatus: () => void;
423
422
  };
424
423
  //#endregion
425
- export { browserDebug, createDebugLogger, debugLogger, debugLoggers, devConsole, prodSafeLogger };
424
+ export { DebugLogger, browserDebug, createDebugLogger, debugLogger, debugLoggers, devConsole, prodSafeLogger };
package/es/utils/debug.js CHANGED
@@ -235,4 +235,4 @@ var init_debug = __esmMin((() => {
235
235
  }));
236
236
  //#endregion
237
237
  init_debug();
238
- export { browserDebug, createDebugLogger, debugLogger, debugLoggers, debug_exports, devConsole, init_debug, prodSafeLogger };
238
+ export { DebugLogger, browserDebug, createDebugLogger, debugLogger, debugLoggers, debug_exports, devConsole, init_debug, prodSafeLogger };
@@ -21,7 +21,7 @@ function parseHotkey(hotkey) {
21
21
  var reservedModifierKeywords, mappedKeys;
22
22
  var init_parseHotkeys = __esmMin((() => {
23
23
  init_sys();
24
- reservedModifierKeywords = new Set([
24
+ reservedModifierKeywords = /* @__PURE__ */ new Set([
25
25
  "shift",
26
26
  "alt",
27
27
  "meta",
@@ -1,5 +1,4 @@
1
1
  import { HotkeyId, HotkeyItem, ModifierCombination } from "../../types/hotkey.js";
2
-
3
2
  //#region src/utils/hotkey/registerHotkey.d.ts
4
3
  type HotkeysEvent = {
5
4
  key?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/editor",
3
- "version": "4.21.0",
3
+ "version": "4.23.0",
4
4
  "description": "A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -61,11 +61,11 @@
61
61
  "build:clean": "tsx ./scripts/clean.ts",
62
62
  "build:watch": "tsdown --watch",
63
63
  "ci": "npm run lint:circular && npm run lint && npm run type-check",
64
- "clean": "rm -r es lib dist coverage .dumi/tmp .eslintcache node_modules/.cache",
65
- "dev": "dumi dev",
66
- "docs:build": "dumi build",
67
- "docs:build-analyze": "ANALYZE=1 dumi build",
68
- "docs:dev": "dumi dev",
64
+ "clean": "rm -r es lib dist coverage .react-router .eslintcache node_modules/.cache",
65
+ "dev": "lobedocs dev",
66
+ "docs:build": "lobedocs build",
67
+ "docs:build-analyze": "ANALYZE=1 lobedocs build",
68
+ "docs:dev": "lobedocs dev",
69
69
  "postinstall": "node ./scripts/postinstall-lexical-patch.cjs",
70
70
  "lint": "eslint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
71
71
  "lint:circular": "dpdm src/**/*.{ts,tsx} --warning false --tree false --exit-code circular:1 -T true",
@@ -76,7 +76,7 @@
76
76
  "prepare": "husky && npm run setup",
77
77
  "prettier": "prettier -c --write --no-error-on-unmatched-pattern \"**/**\"",
78
78
  "release": "semantic-release",
79
- "setup": "dumi setup",
79
+ "setup": "lobedocs typegen",
80
80
  "start": "npm run docs:dev",
81
81
  "test": "vitest",
82
82
  "test:coverage": "vitest run --coverage --passWithNoTests",
@@ -84,8 +84,8 @@
84
84
  "type-check": "tsc --noEmit"
85
85
  },
86
86
  "dependencies": {
87
- "@floating-ui/dom": "^1.7.4",
88
- "@floating-ui/react": "^0.27.16",
87
+ "@floating-ui/dom": "^1.8.0",
88
+ "@floating-ui/react": "^0.27.20",
89
89
  "@lexical/clipboard": "0.42.0",
90
90
  "@lexical/code-core": "0.42.0",
91
91
  "@lexical/dragon": "0.42.0",
@@ -98,29 +98,29 @@
98
98
  "@lexical/table": "0.42.0",
99
99
  "@lexical/utils": "0.42.0",
100
100
  "@lexical/yjs": "0.42.0",
101
- "@shikijs/core": "^3.20.0",
102
- "@shikijs/engine-javascript": "^3.20.0",
103
- "@xmldom/xmldom": "^0.8.11",
101
+ "@shikijs/core": "^4.3.1",
102
+ "@shikijs/engine-javascript": "^4.3.1",
103
+ "@xmldom/xmldom": "^0.9.10",
104
104
  "ahooks": "^3.9.6",
105
105
  "antd-style": "^4.1.0",
106
106
  "debug": "^4.4.3",
107
- "es-toolkit": "^1.43.0",
107
+ "es-toolkit": "^1.50.0",
108
108
  "eventemitter3": "^5.0.1",
109
- "fuse.js": "^7.1.0",
110
- "katex": "^0.16.27",
109
+ "fuse.js": "^7.5.0",
110
+ "katex": "^0.18.1",
111
111
  "lexical": "0.42.0",
112
- "lucide-react": "^0.562.0",
113
- "mermaid": "^11.13.0",
112
+ "lucide-react": "^1.26.0",
113
+ "mermaid": "^11.16.0",
114
114
  "polished": "^4.3.1",
115
115
  "re-resizable": "^6.11.2",
116
- "react-error-boundary": "^6.0.2",
116
+ "react-error-boundary": "^6.1.2",
117
117
  "react-merge-refs": "^3.0.2",
118
118
  "remark": "^15.0.1",
119
119
  "remark-cjk-friendly": "^1.2.3",
120
120
  "remark-gfm": "^4.0.1",
121
121
  "remark-math": "^6.0.0",
122
122
  "remark-supersub": "^1.0.0",
123
- "shiki": "^3.20.0",
123
+ "shiki": "^4.3.1",
124
124
  "ts-key-enum": "^3.0.13",
125
125
  "use-merge-value": "^1.2.0",
126
126
  "yjs": "^13.6.31"