@umoteam/editor 8.0.0 → 9.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 +12 -2
- package/README.zh-CN.md +17 -6
- package/dist/style.css +1 -1
- package/dist/umo-editor.js +15669 -15642
- package/package.json +6 -5
- package/types/index.d.ts +11 -6
- package/types/src/components/index.d.ts +1 -1
- package/types/src/components/menus/button.vue.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umoteam/editor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.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": [
|
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
"@tiptap/extension-font-family": "2.11.5",
|
|
86
86
|
"@tiptap/extension-heading": "2.11.5",
|
|
87
87
|
"@tiptap/extension-highlight": "2.11.5",
|
|
88
|
+
"@tiptap/extension-history": "2.11.5",
|
|
88
89
|
"@tiptap/extension-horizontal-rule": "2.11.5",
|
|
89
90
|
"@tiptap/extension-image": "2.11.5",
|
|
90
91
|
"@tiptap/extension-link": "2.11.5",
|
|
@@ -109,8 +110,8 @@
|
|
|
109
110
|
"@tiptap/vue-3": "2.11.5",
|
|
110
111
|
"@tool-belt/type-predicates": "^1.3.0",
|
|
111
112
|
"@types/svg64": "^1.1.2",
|
|
112
|
-
"@umoteam/editor-external": "
|
|
113
|
-
"@umoteam/viewer": "^0.
|
|
113
|
+
"@umoteam/editor-external": "^9.0.0",
|
|
114
|
+
"@umoteam/viewer": "^0.3.0",
|
|
114
115
|
"@vueuse/core": "^11.0.3",
|
|
115
116
|
"buffer-image-size": "^0.6.4",
|
|
116
117
|
"dom-to-image-more": "^3.4.3",
|
|
@@ -127,7 +128,7 @@
|
|
|
127
128
|
"plyr": "^3.7.8",
|
|
128
129
|
"pretty-bytes": "^6.1.1",
|
|
129
130
|
"prosemirror-transform": "^1.10.0",
|
|
130
|
-
"
|
|
131
|
+
"pure-svg-code": "^1.0.6",
|
|
131
132
|
"sign-canvas-plus": "^2.0.3",
|
|
132
133
|
"smooth-signature": "^1.0.15",
|
|
133
134
|
"svg64": "^2.0.0",
|
|
@@ -187,7 +188,7 @@
|
|
|
187
188
|
"unplugin-vue": "^5.1.5",
|
|
188
189
|
"unplugin-vue-components": "^0.27.4",
|
|
189
190
|
"unplugin-vue-macros": "^2.11.11",
|
|
190
|
-
"vite": "^
|
|
191
|
+
"vite": "^5.0.0",
|
|
191
192
|
"vite-plugin-dts": "^4.5.4",
|
|
192
193
|
"vite-plugin-inspect": "^0.8.7",
|
|
193
194
|
"vite-plugin-svg-icons": "^2.0.1",
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Extension, HTMLContent, JSONContent } from '@tiptap/core'
|
|
2
2
|
import type { FocusPosition } from '@tiptap/core'
|
|
3
3
|
import { Fragment, Node as ProseMirrorNode } from '@tiptap/pm/model'
|
|
4
|
-
import type { AsyncFunction } from '@tool-belt/type-predicates'
|
|
5
4
|
|
|
6
5
|
export type SupportedLocale = 'en-US' | 'zh-CN'
|
|
7
6
|
export type LayoutOption = 'web' | 'page'
|
|
@@ -66,6 +65,7 @@ export type ToolbarMenu =
|
|
|
66
65
|
| 'custom'
|
|
67
66
|
|
|
68
67
|
export interface ToolbarOptions {
|
|
68
|
+
showSaveLabel?: boolean
|
|
69
69
|
defaultMode?: 'classic' | 'ribbon'
|
|
70
70
|
menus?: ToolbarMenu[]
|
|
71
71
|
}
|
|
@@ -148,7 +148,10 @@ export interface AssistantOptions {
|
|
|
148
148
|
enabled?: boolean
|
|
149
149
|
maxlength?: number
|
|
150
150
|
commands?: CommandItem[]
|
|
151
|
-
onMessage?:
|
|
151
|
+
onMessage?: (
|
|
152
|
+
payload: AssistantPayload,
|
|
153
|
+
content: AssistantContent,
|
|
154
|
+
) => Promise<ReadableStream | string>
|
|
152
155
|
}
|
|
153
156
|
|
|
154
157
|
export interface EchartsOptions {
|
|
@@ -184,9 +187,9 @@ export interface AssistantPayload {
|
|
|
184
187
|
}
|
|
185
188
|
|
|
186
189
|
export interface AssistantContent {
|
|
187
|
-
html
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
html: HTMLContent
|
|
191
|
+
json: JSONContent
|
|
192
|
+
text: string
|
|
190
193
|
}
|
|
191
194
|
export interface AssistantResult {
|
|
192
195
|
prompt?: string
|
|
@@ -227,6 +230,8 @@ type OnSaveFunction = (
|
|
|
227
230
|
document: DocumentOptions,
|
|
228
231
|
) => Promise<unknown>
|
|
229
232
|
|
|
233
|
+
type DeleteFileType = 'image' | 'video' | 'audio' | 'file' | 'inlineImage'
|
|
234
|
+
|
|
230
235
|
export interface UmoEditorOptions {
|
|
231
236
|
editorKey?: string
|
|
232
237
|
locale?: SupportedLocale
|
|
@@ -262,7 +267,7 @@ export interface UmoEditorOptions {
|
|
|
262
267
|
translations?: Record<string, unknown>
|
|
263
268
|
onSave?: OnSaveFunction
|
|
264
269
|
onFileUpload?: (file: File) => Promise<{ id: string; url: string }>
|
|
265
|
-
onFileDelete?:
|
|
270
|
+
onFileDelete?: (id: string, url: string, type?: DeleteFileType) => void
|
|
266
271
|
}
|
|
267
272
|
|
|
268
273
|
// 组件类型声明
|
|
@@ -4,6 +4,6 @@ import { default as UmoMenuButton } from './menus/button.vue';
|
|
|
4
4
|
import { default as UmoDialog } from './modal.vue';
|
|
5
5
|
import { default as UmoTooltip } from './tooltip.vue';
|
|
6
6
|
declare const useUmoEditor: {
|
|
7
|
-
install: (app: any, options
|
|
7
|
+
install: (app: any, options?: Partial<UmoEditorOptions>) => void;
|
|
8
8
|
};
|
|
9
9
|
export { UmoEditor as default, UmoDialog, UmoEditor, UmoMenuButton, UmoTooltip, useUmoEditor, };
|
|
@@ -355,8 +355,8 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
|
|
|
355
355
|
}>> & Readonly<{
|
|
356
356
|
"onToggle-popup"?: ((...args: any[]) => any) | undefined;
|
|
357
357
|
}>, {
|
|
358
|
-
shortcut: string;
|
|
359
358
|
text: string;
|
|
359
|
+
shortcut: string;
|
|
360
360
|
menuType: string;
|
|
361
361
|
huge: boolean;
|
|
362
362
|
forceHuge: boolean;
|