@umoteam/editor 6.1.0 → 7.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 +16 -2
- package/README.zh-CN.md +13 -3
- package/dist/style.css +1 -1
- package/dist/umo-editor.js +11811 -12624
- package/package.json +2 -1
- package/types/index.d.ts +59 -56
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umoteam/editor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.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": [
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
],
|
|
43
43
|
"exports": {
|
|
44
44
|
".": {
|
|
45
|
+
"types": "./types/index.d.ts",
|
|
45
46
|
"import": "./dist/umo-editor.js"
|
|
46
47
|
},
|
|
47
48
|
"./style": {
|
package/types/index.d.ts
CHANGED
|
@@ -9,13 +9,13 @@ export interface MarginOption {
|
|
|
9
9
|
bottom: number
|
|
10
10
|
}
|
|
11
11
|
export interface WatermarkOption {
|
|
12
|
-
type
|
|
13
|
-
alpha
|
|
14
|
-
fontColor
|
|
15
|
-
fontSize
|
|
16
|
-
fontFamily
|
|
17
|
-
fontWeight
|
|
18
|
-
text
|
|
12
|
+
type?: string
|
|
13
|
+
alpha?: number
|
|
14
|
+
fontColor?: string
|
|
15
|
+
fontSize?: number
|
|
16
|
+
fontFamily?: string
|
|
17
|
+
fontWeight?: string
|
|
18
|
+
text?: string
|
|
19
19
|
}
|
|
20
20
|
export interface PageOption {
|
|
21
21
|
defaultMargin?: MarginOption
|
|
@@ -62,12 +62,13 @@ export type ToolbarMenu =
|
|
|
62
62
|
| 'custom'
|
|
63
63
|
|
|
64
64
|
export interface ToolbarOptions {
|
|
65
|
-
defaultMode
|
|
66
|
-
menus
|
|
67
|
-
disableMenuItems
|
|
68
|
-
importWord
|
|
69
|
-
enabled
|
|
70
|
-
|
|
65
|
+
defaultMode?: 'classic' | 'ribbon'
|
|
66
|
+
menus?: ToolbarMenu[]
|
|
67
|
+
disableMenuItems?: string[]
|
|
68
|
+
importWord?: {
|
|
69
|
+
enabled?: boolean
|
|
70
|
+
maxSize?: number
|
|
71
|
+
options?: unknown
|
|
71
72
|
useCustomMethod?: boolean
|
|
72
73
|
onCustomImportMethod?: (file: File) => Promise<{
|
|
73
74
|
id: string
|
|
@@ -79,20 +80,19 @@ export interface ToolbarOptions {
|
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
export interface AutoSaveOptions {
|
|
82
|
-
enabled
|
|
83
|
-
interval
|
|
83
|
+
enabled?: boolean
|
|
84
|
+
interval?: number
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
export interface DocumentOptions {
|
|
87
88
|
id?: string
|
|
88
|
-
title
|
|
89
|
-
content
|
|
89
|
+
title?: string
|
|
90
|
+
content?: string
|
|
90
91
|
placeholder?: Record<string, string>
|
|
91
92
|
enableSpellcheck?: boolean
|
|
92
93
|
enableMarkdown?: boolean
|
|
93
94
|
enableBubbleMenu?: boolean
|
|
94
95
|
enableBlockMenu?: boolean
|
|
95
|
-
// enableComment?: boolean
|
|
96
96
|
readOnly?: boolean
|
|
97
97
|
autofocus?: 'start' | 'end' | 'all' | number | boolean | null
|
|
98
98
|
characterLimit?: number
|
|
@@ -138,20 +138,20 @@ export interface Template {
|
|
|
138
138
|
title: string
|
|
139
139
|
content: string
|
|
140
140
|
description?: string
|
|
141
|
-
value
|
|
141
|
+
value?: string
|
|
142
142
|
divider?: boolean
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
export interface AssistantOptions {
|
|
146
|
-
enabled
|
|
147
|
-
maxlength
|
|
148
|
-
commands
|
|
146
|
+
enabled?: boolean
|
|
147
|
+
maxlength?: number
|
|
148
|
+
commands?: CommandItem[]
|
|
149
149
|
onMessage?: AsyncFunction
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
export interface EchartsOptions {
|
|
153
|
-
mode
|
|
154
|
-
renderImage
|
|
153
|
+
mode?: number
|
|
154
|
+
renderImage?: boolean
|
|
155
155
|
onCustomSettings?: CallableFunction
|
|
156
156
|
}
|
|
157
157
|
|
|
@@ -162,65 +162,65 @@ export interface UserItem {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
export interface WebPageItem {
|
|
165
|
-
label
|
|
166
|
-
icon
|
|
167
|
-
validate(url: string): boolean
|
|
165
|
+
label?: LocaleLabel
|
|
166
|
+
icon?: string
|
|
167
|
+
validate?(url: string): boolean
|
|
168
168
|
transformURL?(url: string): string
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
export interface CommandItem {
|
|
172
|
-
label
|
|
173
|
-
value
|
|
172
|
+
label?: LocaleLabel
|
|
173
|
+
value?: LocaleLabel
|
|
174
174
|
autoSend?: boolean
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
export interface AssistantPayload {
|
|
178
|
-
lang
|
|
179
|
-
input
|
|
180
|
-
command
|
|
181
|
-
output
|
|
178
|
+
lang?: string
|
|
179
|
+
input?: string
|
|
180
|
+
command?: string
|
|
181
|
+
output?: string
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
export interface AssistantContent {
|
|
185
|
-
html
|
|
186
|
-
text
|
|
187
|
-
json
|
|
185
|
+
html?: string
|
|
186
|
+
text?: string
|
|
187
|
+
json?: unknown
|
|
188
188
|
}
|
|
189
189
|
export interface AssistantResult {
|
|
190
|
-
prompt
|
|
191
|
-
content
|
|
192
|
-
error
|
|
190
|
+
prompt?: string
|
|
191
|
+
content?: string
|
|
192
|
+
error?: boolean
|
|
193
193
|
command?: string
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
export interface FileOptions {
|
|
197
|
-
allowedMimeTypes
|
|
198
|
-
maxSize
|
|
199
|
-
preview
|
|
197
|
+
allowedMimeTypes?: string[]
|
|
198
|
+
maxSize?: number
|
|
199
|
+
preview?: {
|
|
200
200
|
extensions?: string[]
|
|
201
|
-
url
|
|
201
|
+
url?: string
|
|
202
202
|
}[]
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
export interface UmoEditorOptions {
|
|
206
|
-
editorKey
|
|
207
|
-
locale
|
|
208
|
-
theme
|
|
209
|
-
height
|
|
210
|
-
fullscreenZIndex
|
|
206
|
+
editorKey?: string
|
|
207
|
+
locale?: SupportedLocale
|
|
208
|
+
theme?: 'light' | 'dark'
|
|
209
|
+
height?: string
|
|
210
|
+
fullscreenZIndex?: number
|
|
211
211
|
dicts?: {
|
|
212
|
-
pageSizes
|
|
213
|
-
fonts
|
|
214
|
-
colors
|
|
215
|
-
lineHeights
|
|
216
|
-
symbols
|
|
217
|
-
emojis
|
|
212
|
+
pageSizes?: PageSize[]
|
|
213
|
+
fonts?: Font[]
|
|
214
|
+
colors?: string[]
|
|
215
|
+
lineHeights?: LineHeight[]
|
|
216
|
+
symbols?: GraphicSymbol[]
|
|
217
|
+
emojis?: Emoji[]
|
|
218
218
|
}
|
|
219
219
|
toolbar?: ToolbarOptions
|
|
220
|
-
page
|
|
220
|
+
page?: PageOption
|
|
221
221
|
document?: DocumentOptions
|
|
222
222
|
ai?: {
|
|
223
|
-
assistant
|
|
223
|
+
assistant?: AssistantOptions
|
|
224
224
|
}
|
|
225
225
|
echarts?: EchartsOptions
|
|
226
226
|
webPages?: WebPageItem[]
|
|
@@ -237,3 +237,6 @@ export interface UmoEditorOptions {
|
|
|
237
237
|
onFileUpload?: (file: File) => Promise<{ id: string; url: string }>
|
|
238
238
|
onFileDelete?: CallableFunction
|
|
239
239
|
}
|
|
240
|
+
|
|
241
|
+
// 组件类型声明
|
|
242
|
+
export * from '../dist/umo-editor'
|