@umoteam/editor 5.0.0 → 6.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umoteam/editor",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
4
  "type": "module",
5
5
  "description": "Umo Editor is open-source document editor based on Vue3 and Tiptap. Umo Editor provides comprehensive document editing capabilities and AI creation features, supports pagination, supports Markdown syntax, offers basic rich text editing functions, allows for the insertion of various node types in multiple formats, provides a variety of practical tools, and supports setting page styles. It also supports exporting in various formats, printing and print preview, block-level document editing, adding custom extensions, multi-language settings, and a dark theme.",
6
6
  "keywords": [
@@ -33,7 +33,8 @@
33
33
  "email": "support@umodoc.com"
34
34
  },
35
35
  "files": [
36
- "dist"
36
+ "dist",
37
+ "types/index.d.ts"
37
38
  ],
38
39
  "exports": {
39
40
  ".": {
@@ -62,68 +63,72 @@
62
63
  "dependencies": {
63
64
  "@eslint/object-schema": "^2.1.4",
64
65
  "@imgly/background-removal": "1.5.5",
65
- "@tiptap/core": "^2.6.6",
66
- "@tiptap/extension-bold": "^2.6.6",
67
- "@tiptap/extension-bubble-menu": "^2.6.6",
68
- "@tiptap/extension-bullet-list": "^2.6.6",
69
- "@tiptap/extension-character-count": "^2.6.6",
70
- "@tiptap/extension-color": "^2.6.6",
71
- "@tiptap/extension-document": "^2.6.6",
72
- "@tiptap/extension-dropcursor": "^2.6.6",
73
- "@tiptap/extension-focus": "^2.6.6",
74
- "@tiptap/extension-font-family": "^2.6.6",
75
- "@tiptap/extension-heading": "^2.6.6",
76
- "@tiptap/extension-highlight": "^2.6.6",
77
- "@tiptap/extension-horizontal-rule": "^2.6.6",
78
- "@tiptap/extension-image": "^2.6.6",
79
- "@tiptap/extension-link": "^2.6.6",
80
- "@tiptap/extension-ordered-list": "^2.6.6",
81
- "@tiptap/extension-placeholder": "^2.6.6",
82
- "@tiptap/extension-subscript": "^2.6.6",
83
- "@tiptap/extension-superscript": "^2.6.6",
84
- "@tiptap/extension-table": "^2.6.6",
85
- "@tiptap/extension-table-cell": "^2.6.6",
86
- "@tiptap/extension-table-header": "^2.6.6",
87
- "@tiptap/extension-table-row": "^2.6.6",
88
- "@tiptap/extension-task-item": "^2.6.6",
89
- "@tiptap/extension-task-list": "^2.6.6",
90
- "@tiptap/extension-text-align": "^2.6.6",
91
- "@tiptap/extension-text-style": "^2.6.6",
92
- "@tiptap/extension-typography": "^2.6.6",
93
- "@tiptap/extension-underline": "^2.6.6",
94
- "@tiptap/pm": "^2.6.6",
95
- "@tiptap/starter-kit": "^2.6.6",
96
- "@tiptap/vue-3": "^2.6.6",
66
+ "@tiptap-extend/columns": "^2.1.6",
67
+ "@tiptap/core": "2.11.5",
68
+ "@tiptap/extension-bold": "2.11.5",
69
+ "@tiptap/extension-bubble-menu": "2.11.5",
70
+ "@tiptap/extension-bullet-list": "2.11.5",
71
+ "@tiptap/extension-character-count": "2.11.5",
72
+ "@tiptap/extension-code-block": "^2.11.7",
73
+ "@tiptap/extension-code-block-lowlight": "^2.11.7",
74
+ "@tiptap/extension-collaboration": "^2.11.5",
75
+ "@tiptap/extension-color": "2.11.5",
76
+ "@tiptap/extension-document": "2.11.5",
77
+ "@tiptap/extension-dropcursor": "2.11.5",
78
+ "@tiptap/extension-focus": "2.11.5",
79
+ "@tiptap/extension-font-family": "2.11.5",
80
+ "@tiptap/extension-heading": "2.11.5",
81
+ "@tiptap/extension-highlight": "2.11.5",
82
+ "@tiptap/extension-horizontal-rule": "2.11.5",
83
+ "@tiptap/extension-image": "2.11.5",
84
+ "@tiptap/extension-link": "2.11.5",
85
+ "@tiptap/extension-mention": "2.11.5",
86
+ "@tiptap/extension-ordered-list": "2.11.5",
87
+ "@tiptap/extension-placeholder": "2.11.5",
88
+ "@tiptap/extension-subscript": "2.11.5",
89
+ "@tiptap/extension-superscript": "2.11.5",
90
+ "@tiptap/extension-table": "2.11.5",
91
+ "@tiptap/extension-table-cell": "2.11.5",
92
+ "@tiptap/extension-table-header": "2.11.5",
93
+ "@tiptap/extension-table-row": "2.11.5",
94
+ "@tiptap/extension-task-item": "2.11.5",
95
+ "@tiptap/extension-task-list": "2.11.5",
96
+ "@tiptap/extension-text-align": "2.11.5",
97
+ "@tiptap/extension-text-style": "2.11.5",
98
+ "@tiptap/extension-typography": "2.11.5",
99
+ "@tiptap/extension-underline": "2.11.5",
100
+ "@tiptap/pm": "2.11.5",
101
+ "@tiptap/starter-kit": "2.11.5",
102
+ "@tiptap/suggestion": "2.11.5",
103
+ "@tiptap/vue-3": "2.11.5",
97
104
  "@tool-belt/type-predicates": "^1.3.0",
98
105
  "@types/svg64": "^1.1.2",
99
- "@umoteam/editor-external": "4.5.0",
100
- "@vue-monaco/editor": "^0.0.6",
106
+ "@umoteam/editor-external": "5.0.0",
101
107
  "@vueuse/core": "^11.0.3",
102
108
  "buffer-image-size": "^0.6.4",
103
- "docx": "^8.5.0",
104
109
  "dom-to-image-more": "^3.4.3",
105
- "es-drager": "^1.2.11",
110
+ "es-drager": "1.2.11",
106
111
  "file-saver": "^2.0.5",
107
112
  "file64": "^1.0.4",
113
+ "highlight.js": "^11.11.1",
108
114
  "hotkeys-js": "^3.13.7",
109
115
  "jsbarcode": "^3.11.6",
110
116
  "katex": "^0.16.11",
117
+ "lowlight": "^3.3.0",
111
118
  "mermaid": "^11.2.0",
112
119
  "nzh": "^1.0.13",
113
120
  "plyr": "^3.7.8",
114
121
  "pretty-bytes": "^6.1.1",
115
- "prism-code-editor": "^3.4.0",
116
- "prismjs": "^1.29.0",
117
- "prosemirror-docx": "^0.2.0",
118
122
  "prosemirror-transform": "^1.10.0",
119
123
  "qrcode-svg": "^1.1.0",
120
124
  "sign-canvas-plus": "^2.0.3",
121
125
  "smooth-signature": "^1.0.15",
122
126
  "svg64": "^2.0.0",
123
127
  "tippy.js": "^6.3.7",
124
- "ts-deepmerge": "^7.0.1",
125
128
  "vue-i18n": "^10.0.0",
126
- "zeed-dom": "^0.14.0"
129
+ "y-prosemirror": "^1.2.15",
130
+ "y-protocols": "^1.0.6",
131
+ "yjs": "^13.6.23"
127
132
  },
128
133
  "devDependencies": {
129
134
  "@eslint/eslintrc": "^3.1.0",
@@ -131,10 +136,14 @@
131
136
  "@intlify/unplugin-vue-i18n": "^5.0.0",
132
137
  "@sereneinserenade/tiptap-search-and-replace": "^0.1.1",
133
138
  "@testing-library/vue": "^8.1.0",
134
- "@tiptap-pro/extension-invisible-characters": "^2.11.2",
135
- "@tiptap-pro/extension-mathematics": "^2.11.2",
136
- "@tiptap-pro/extension-table-of-contents": "^2.11.2",
139
+ "@tiptap-pro/extension-drag-handle": "2.17.5",
140
+ "@tiptap-pro/extension-drag-handle-vue-3": "2.17.5",
141
+ "@tiptap-pro/extension-invisible-characters": "2.17.5",
142
+ "@tiptap-pro/extension-mathematics": "2.17.5",
143
+ "@tiptap-pro/extension-node-range": "2.17.5",
144
+ "@tiptap-pro/extension-table-of-contents": "2.17.5",
137
145
  "@types/dom-to-image": "^2.6.7",
146
+ "@types/eslint-config-prettier": "^6.11.3",
138
147
  "@types/file-saver": "^2.0.7",
139
148
  "@types/node": "^22.5.4",
140
149
  "@types/qrcode-svg": "^1.1.5",
@@ -144,7 +153,7 @@
144
153
  "@vue-macros/reactivity-transform": "^1.0.4",
145
154
  "@vue-macros/volar": "^0.29.1",
146
155
  "@vue/eslint-config-prettier": "^9.0.0",
147
- "eslint": "^8.57.0",
156
+ "eslint": "^9.21.0",
148
157
  "eslint-config-prettier": "^9.1.0",
149
158
  "eslint-plugin-functional": "^5.0.8",
150
159
  "eslint-plugin-simple-import-sort": "^12.1.1",
@@ -152,6 +161,7 @@
152
161
  "eslint-plugin-vue": "^9.28.0",
153
162
  "globals": "^15.9.0",
154
163
  "husky": "^9.1.5",
164
+ "jiti": "^2.4.2",
155
165
  "jsdom": "^25.0.0",
156
166
  "less": "^4.2.0",
157
167
  "less-loader": "^12.2.0",
@@ -163,7 +173,7 @@
163
173
  "stylelint-config-recommended-less": "^3.0.1",
164
174
  "stylelint-config-recommended-vue": "^1.5.0",
165
175
  "stylelint-less": "^3.0.1",
166
- "tdesign-vue-next": "^1.10.0",
176
+ "tdesign-vue-next": "1.9.8",
167
177
  "typescript": "5.5.4",
168
178
  "typescript-eslint": "^8.5.0",
169
179
  "unplugin-auto-import": "^0.18.2",
@@ -0,0 +1,239 @@
1
+ import type { Extension } from '@tiptap/core'
2
+ import type { AsyncFunction } from '@tool-belt/type-predicates'
3
+
4
+ export type SupportedLocale = 'en-US' | 'zh-CN' | 'ru-RU'
5
+ export interface MarginOption {
6
+ left: number
7
+ right: number
8
+ top: number
9
+ bottom: number
10
+ }
11
+ export interface WatermarkOption {
12
+ type: string
13
+ alpha: number
14
+ fontColor: string
15
+ fontSize: number
16
+ fontFamily: string
17
+ fontWeight: string
18
+ text: string
19
+ }
20
+ export interface PageOption {
21
+ defaultMargin?: MarginOption
22
+ defaultOrientation?: string
23
+ defaultBackground?: string
24
+ showBreakMarks?: boolean
25
+ showBookmark?: boolean
26
+ watermark?: WatermarkOption
27
+ size?: {
28
+ width: number
29
+ height: number
30
+ label?: LocaleLabel
31
+ }
32
+ margin?: {
33
+ right: number
34
+ left: number
35
+ bottom: number
36
+ top: number
37
+ layout?: 'narrow' | 'moderate' | 'wide' | 'custom'
38
+ }
39
+ orientation?: string
40
+ background?: string
41
+ header?: boolean
42
+ footer?: boolean
43
+ showLineNumber?: boolean
44
+ showToc?: boolean
45
+ zoomLevel?: number
46
+ bodyHeight?: number
47
+ autoWidth?: boolean
48
+ preview?: {
49
+ enabled?: boolean
50
+ laserPointer?: boolean
51
+ }
52
+ }
53
+
54
+ export type ToolbarMenu =
55
+ | 'base'
56
+ | 'insert'
57
+ | 'table'
58
+ | 'tools'
59
+ | 'page'
60
+ | 'export'
61
+ | 'advanced'
62
+ | 'custom'
63
+
64
+ export interface ToolbarOptions {
65
+ defaultMode: 'classic' | 'ribbon'
66
+ menus: ToolbarMenu[]
67
+ disableMenuItems: string[]
68
+ importWord: {
69
+ enabled: boolean
70
+ options: unknown
71
+ useCustomMethod?: boolean
72
+ onCustomImportMethod?: (file: File) => Promise<{
73
+ id: string
74
+ url: string
75
+ value: string
76
+ messages: { type: string; message: string }
77
+ }>
78
+ }
79
+ }
80
+
81
+ export interface AutoSaveOptions {
82
+ enabled: boolean
83
+ interval: number
84
+ }
85
+
86
+ export interface DocumentOptions {
87
+ id?: string
88
+ title: string
89
+ content: string
90
+ placeholder?: Record<string, string>
91
+ enableSpellcheck?: boolean
92
+ enableMarkdown?: boolean
93
+ enableBubbleMenu?: boolean
94
+ enableBlockMenu?: boolean
95
+ // enableComment?: boolean
96
+ readOnly?: boolean
97
+ autofocus?: 'start' | 'end' | 'all' | number | boolean | null
98
+ characterLimit?: number
99
+ typographyRules?: Record<string, unknown>
100
+ editorProps?: Record<string, unknown>
101
+ parseOptions?: Record<string, unknown>
102
+ autoSave?: AutoSaveOptions
103
+ }
104
+
105
+ export type LocaleLabel =
106
+ | string
107
+ | { en_US: string; zh_CN: string; ru_RU: string }
108
+
109
+ export interface PageSize {
110
+ label: LocaleLabel
111
+ width: number
112
+ height: number
113
+ default?: boolean
114
+ }
115
+
116
+ export interface Font {
117
+ label: LocaleLabel
118
+ value: string | null
119
+ }
120
+
121
+ export interface LineHeight {
122
+ label: LocaleLabel
123
+ value: number
124
+ default?: boolean
125
+ }
126
+
127
+ export interface GraphicSymbol {
128
+ label: LocaleLabel
129
+ items: string
130
+ }
131
+
132
+ export interface Emoji {
133
+ label: LocaleLabel
134
+ items: string
135
+ }
136
+
137
+ export interface Template {
138
+ title: string
139
+ content: string
140
+ description?: string
141
+ value: string
142
+ divider?: boolean
143
+ }
144
+
145
+ export interface AssistantOptions {
146
+ enabled: boolean
147
+ maxlength: number
148
+ commands: CommandItem[]
149
+ onMessage?: AsyncFunction
150
+ }
151
+
152
+ export interface EchartsOptions {
153
+ mode: number
154
+ renderImage: boolean
155
+ onCustomSettings?: CallableFunction
156
+ }
157
+
158
+ export interface UserItem {
159
+ id: string
160
+ label: string
161
+ avatar?: string
162
+ }
163
+
164
+ export interface WebPageItem {
165
+ label: LocaleLabel
166
+ icon: string
167
+ validate(url: string): boolean
168
+ transformURL?(url: string): string
169
+ }
170
+
171
+ export interface CommandItem {
172
+ label: LocaleLabel
173
+ value: LocaleLabel
174
+ autoSend?: boolean
175
+ }
176
+
177
+ export interface AssistantPayload {
178
+ lang: string
179
+ input: string
180
+ command: string
181
+ output: string
182
+ }
183
+
184
+ export interface AssistantContent {
185
+ html: string
186
+ text: string
187
+ json: unknown
188
+ }
189
+ export interface AssistantResult {
190
+ prompt: string
191
+ content: string
192
+ error: boolean
193
+ command?: string
194
+ }
195
+
196
+ export interface FileOptions {
197
+ allowedMimeTypes: string[]
198
+ maxSize: number
199
+ preview: {
200
+ extensions?: string[]
201
+ url: string
202
+ }[]
203
+ }
204
+
205
+ export interface UmoEditorOptions {
206
+ editorKey: string
207
+ locale: SupportedLocale
208
+ theme: 'light' | 'dark'
209
+ height: string
210
+ fullscreenZIndex: number
211
+ dicts?: {
212
+ pageSizes: PageSize[]
213
+ fonts: Font[]
214
+ colors: string[]
215
+ lineHeights: LineHeight[]
216
+ symbols: GraphicSymbol[]
217
+ emojis: Emoji[]
218
+ }
219
+ toolbar?: ToolbarOptions
220
+ page: PageOption
221
+ document?: DocumentOptions
222
+ ai?: {
223
+ assistant: AssistantOptions
224
+ }
225
+ echarts?: EchartsOptions
226
+ webPages?: WebPageItem[]
227
+ templates?: Template[]
228
+ cdnUrl?: string
229
+ shareUrl?: string
230
+ diagrams?: Record<string, unknown>
231
+ file?: FileOptions
232
+ user?: Record<string, unknown>
233
+ users?: UserItem[]
234
+ extensions?: Extension[]
235
+ translations?: Record<string, unknown>
236
+ onSave?: AsyncFunction
237
+ onFileUpload?: (file: File) => Promise<{ id: string; url: string }>
238
+ onFileDelete?: CallableFunction
239
+ }