@lobehub/editor 4.17.2 → 4.18.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 (36) hide show
  1. package/es/headless/index.js +12 -2
  2. package/es/headless.js +3119 -1224
  3. package/es/index.d.ts +1 -1
  4. package/es/index.js +13 -13
  5. package/es/plugins/codeblock/command/index.d.ts +2 -8
  6. package/es/plugins/codeblock/command/index.js +3 -3
  7. package/es/plugins/codeblock/command/symbols.d.ts +8 -0
  8. package/es/plugins/codeblock/command/symbols.js +5 -0
  9. package/es/plugins/codeblock/index.d.ts +1 -1
  10. package/es/plugins/codeblock/index.js +1 -1
  11. package/es/plugins/codeblock/plugin/FacadeShiki.js +1 -1
  12. package/es/plugins/codeblock/plugin/index.js +1 -1
  13. package/es/plugins/codemirror-block/command/index.js +1 -1
  14. package/es/plugins/codemirror-block/node/CodeMirrorNode.js +10 -1
  15. package/es/plugins/codemirror-block/plugin/index.d.ts +1 -1
  16. package/es/plugins/file/plugin/index.d.ts +2 -2
  17. package/es/plugins/file/plugin/index.js +26 -23
  18. package/es/plugins/image/node/block-image-node.d.ts +1 -0
  19. package/es/plugins/image/node/block-image-node.js +6 -0
  20. package/es/plugins/image/node/image-node.d.ts +1 -0
  21. package/es/plugins/image/node/image-node.js +6 -0
  22. package/es/plugins/image/plugin/index.d.ts +3 -3
  23. package/es/plugins/image/plugin/index.js +5 -23
  24. package/es/plugins/image/react/ReactImagePlugin.js +18 -0
  25. package/es/plugins/image/react/components/Image.js +1 -1
  26. package/es/plugins/math/plugin/index.d.ts +1 -1
  27. package/es/plugins/math/react/components/MathEditor.js +1 -1
  28. package/es/plugins/math/react/components/MathInline.js +1 -1
  29. package/es/plugins/mention/plugin/index.d.ts +1 -1
  30. package/es/plugins/mention/plugin/index.js +1 -1
  31. package/es/react/hooks/useEditorState/index.js +2 -2
  32. package/es/renderer/engine/shiki.js +1 -1
  33. package/es/renderer/nodes/index.js +4 -4
  34. package/es/renderer/renderers/codeblock.js +1 -0
  35. package/package.json +1 -1
  36. package/es/headless/plugins/codeblock.js +0 -82
@@ -1,15 +1,20 @@
1
1
  import { moment } from "../editor-kernel/utils.js";
2
2
  import Editor from "../editor-kernel/index.js";
3
3
  import { LITEXML_APPLY_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND } from "../plugins/litexml/command/symbols.js";
4
+ import { INodePlugin } from "../plugins/inode/plugin/index.js";
4
5
  import { MarkdownPlugin } from "../plugins/markdown/plugin/index.js";
5
6
  import { LitexmlPlugin } from "../plugins/litexml/plugin/index.js";
6
7
  import { CommonPlugin } from "../plugins/common/plugin/index.js";
7
8
  import { CodePlugin } from "../plugins/code/plugin/index.js";
9
+ import { CodemirrorPlugin } from "../plugins/codemirror-block/plugin/index.js";
10
+ import { FilePlugin } from "../plugins/file/plugin/index.js";
8
11
  import { HRPlugin } from "../plugins/hr/plugin/index.js";
12
+ import { ImagePlugin } from "../plugins/image/plugin/index.js";
9
13
  import { LinkPlugin } from "../plugins/link/plugin/index.js";
10
14
  import { ListPlugin } from "../plugins/list/plugin/index.js";
15
+ import { MathPlugin } from "../plugins/math/plugin/index.js";
16
+ import { MentionPlugin } from "../plugins/mention/plugin/index.js";
11
17
  import { TablePlugin } from "../plugins/table/plugin/index.js";
12
- import { HeadlessCodeblockPlugin } from "./plugins/codeblock.js";
13
18
  import "./extract-media-from-editor-state.js";
14
19
  //#region src/headless/index.ts
15
20
  const getNumericId = (id) => {
@@ -100,10 +105,15 @@ const preserveSerializedCodeTextInEditorData = (editorData) => ({
100
105
  });
101
106
  const DEFAULT_HEADLESS_EDITOR_PLUGINS = [
102
107
  [CommonPlugin, { enableHotkey: false }],
108
+ INodePlugin,
103
109
  MarkdownPlugin,
104
110
  [LinkPlugin, { enableHotkey: false }],
105
111
  CodePlugin,
106
- HeadlessCodeblockPlugin,
112
+ CodemirrorPlugin,
113
+ ImagePlugin,
114
+ FilePlugin,
115
+ MathPlugin,
116
+ MentionPlugin,
107
117
  HRPlugin,
108
118
  ListPlugin,
109
119
  TablePlugin,