@umoteam/editor 4.6.2 → 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/README.md +55 -48
- package/README.zh-CN.md +42 -37
- package/dist/style.css +1 -1
- package/dist/umo-editor.js +53589 -35882
- package/package.json +58 -46
- package/types/index.d.ts +239 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umoteam/editor",
|
|
3
|
-
"version": "
|
|
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,66 +63,72 @@
|
|
|
62
63
|
"dependencies": {
|
|
63
64
|
"@eslint/object-schema": "^2.1.4",
|
|
64
65
|
"@imgly/background-removal": "1.5.5",
|
|
65
|
-
"@tiptap/
|
|
66
|
-
"@tiptap/
|
|
67
|
-
"@tiptap/extension-
|
|
68
|
-
"@tiptap/extension-
|
|
69
|
-
"@tiptap/extension-
|
|
70
|
-
"@tiptap/extension-
|
|
71
|
-
"@tiptap/extension-
|
|
72
|
-
"@tiptap/extension-
|
|
73
|
-
"@tiptap/extension-
|
|
74
|
-
"@tiptap/extension-
|
|
75
|
-
"@tiptap/extension-
|
|
76
|
-
"@tiptap/extension-
|
|
77
|
-
"@tiptap/extension-
|
|
78
|
-
"@tiptap/extension-
|
|
79
|
-
"@tiptap/extension-
|
|
80
|
-
"@tiptap/extension-
|
|
81
|
-
"@tiptap/extension-
|
|
82
|
-
"@tiptap/extension-
|
|
83
|
-
"@tiptap/extension-
|
|
84
|
-
"@tiptap/extension-
|
|
85
|
-
"@tiptap/extension-
|
|
86
|
-
"@tiptap/extension-
|
|
87
|
-
"@tiptap/extension-
|
|
88
|
-
"@tiptap/extension-
|
|
89
|
-
"@tiptap/extension-
|
|
90
|
-
"@tiptap/extension-
|
|
91
|
-
"@tiptap/extension-
|
|
92
|
-
"@tiptap/extension-
|
|
93
|
-
"@tiptap/extension-
|
|
94
|
-
"@tiptap/
|
|
95
|
-
"@tiptap/
|
|
96
|
-
"@tiptap/
|
|
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": "
|
|
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
109
|
"dom-to-image-more": "^3.4.3",
|
|
104
|
-
"es-drager": "
|
|
110
|
+
"es-drager": "1.2.11",
|
|
105
111
|
"file-saver": "^2.0.5",
|
|
106
112
|
"file64": "^1.0.4",
|
|
113
|
+
"highlight.js": "^11.11.1",
|
|
107
114
|
"hotkeys-js": "^3.13.7",
|
|
108
115
|
"jsbarcode": "^3.11.6",
|
|
109
116
|
"katex": "^0.16.11",
|
|
117
|
+
"lowlight": "^3.3.0",
|
|
110
118
|
"mermaid": "^11.2.0",
|
|
111
119
|
"nzh": "^1.0.13",
|
|
112
120
|
"plyr": "^3.7.8",
|
|
113
121
|
"pretty-bytes": "^6.1.1",
|
|
114
|
-
"prism-code-editor": "^3.4.0",
|
|
115
|
-
"prismjs": "^1.29.0",
|
|
116
122
|
"prosemirror-transform": "^1.10.0",
|
|
117
123
|
"qrcode-svg": "^1.1.0",
|
|
118
124
|
"sign-canvas-plus": "^2.0.3",
|
|
119
125
|
"smooth-signature": "^1.0.15",
|
|
120
126
|
"svg64": "^2.0.0",
|
|
121
127
|
"tippy.js": "^6.3.7",
|
|
122
|
-
"ts-deepmerge": "^7.0.1",
|
|
123
128
|
"vue-i18n": "^10.0.0",
|
|
124
|
-
"
|
|
129
|
+
"y-prosemirror": "^1.2.15",
|
|
130
|
+
"y-protocols": "^1.0.6",
|
|
131
|
+
"yjs": "^13.6.23"
|
|
125
132
|
},
|
|
126
133
|
"devDependencies": {
|
|
127
134
|
"@eslint/eslintrc": "^3.1.0",
|
|
@@ -129,10 +136,14 @@
|
|
|
129
136
|
"@intlify/unplugin-vue-i18n": "^5.0.0",
|
|
130
137
|
"@sereneinserenade/tiptap-search-and-replace": "^0.1.1",
|
|
131
138
|
"@testing-library/vue": "^8.1.0",
|
|
132
|
-
"@tiptap-pro/extension-
|
|
133
|
-
"@tiptap-pro/extension-
|
|
134
|
-
"@tiptap-pro/extension-
|
|
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",
|
|
135
145
|
"@types/dom-to-image": "^2.6.7",
|
|
146
|
+
"@types/eslint-config-prettier": "^6.11.3",
|
|
136
147
|
"@types/file-saver": "^2.0.7",
|
|
137
148
|
"@types/node": "^22.5.4",
|
|
138
149
|
"@types/qrcode-svg": "^1.1.5",
|
|
@@ -142,7 +153,7 @@
|
|
|
142
153
|
"@vue-macros/reactivity-transform": "^1.0.4",
|
|
143
154
|
"@vue-macros/volar": "^0.29.1",
|
|
144
155
|
"@vue/eslint-config-prettier": "^9.0.0",
|
|
145
|
-
"eslint": "^
|
|
156
|
+
"eslint": "^9.21.0",
|
|
146
157
|
"eslint-config-prettier": "^9.1.0",
|
|
147
158
|
"eslint-plugin-functional": "^5.0.8",
|
|
148
159
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
@@ -150,6 +161,7 @@
|
|
|
150
161
|
"eslint-plugin-vue": "^9.28.0",
|
|
151
162
|
"globals": "^15.9.0",
|
|
152
163
|
"husky": "^9.1.5",
|
|
164
|
+
"jiti": "^2.4.2",
|
|
153
165
|
"jsdom": "^25.0.0",
|
|
154
166
|
"less": "^4.2.0",
|
|
155
167
|
"less-loader": "^12.2.0",
|
|
@@ -161,7 +173,7 @@
|
|
|
161
173
|
"stylelint-config-recommended-less": "^3.0.1",
|
|
162
174
|
"stylelint-config-recommended-vue": "^1.5.0",
|
|
163
175
|
"stylelint-less": "^3.0.1",
|
|
164
|
-
"tdesign-vue-next": "
|
|
176
|
+
"tdesign-vue-next": "1.9.8",
|
|
165
177
|
"typescript": "5.5.4",
|
|
166
178
|
"typescript-eslint": "^8.5.0",
|
|
167
179
|
"unplugin-auto-import": "^0.18.2",
|
package/types/index.d.ts
ADDED
|
@@ -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
|
+
}
|