lengyue-editor 1.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/LICENSE +8 -0
- package/README.md +158 -0
- package/README.zh-CN.md +157 -0
- package/dist/style.css +1 -0
- package/dist/umo-editor.js +62397 -0
- package/package.json +215 -0
- package/types/index.d.ts +274 -0
- package/types/src/components/index.d.ts +9 -0
- package/types/src/components/index.vue.d.ts +1698 -0
- package/types/src/components/menus/button.vue.d.ts +583 -0
- package/types/src/components/modal.vue.d.ts +2 -0
- package/types/src/components/tooltip.vue.d.ts +27 -0
package/package.json
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lengyue-editor",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
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
|
+
"keywords": [
|
|
7
|
+
"umo editor",
|
|
8
|
+
"umodoc editor",
|
|
9
|
+
"document editor",
|
|
10
|
+
"docs editor",
|
|
11
|
+
"word editor",
|
|
12
|
+
"office edtior",
|
|
13
|
+
"web editor",
|
|
14
|
+
"richtext editor",
|
|
15
|
+
"wysiwyg editor",
|
|
16
|
+
"vue editor",
|
|
17
|
+
"vue3 editor",
|
|
18
|
+
"ai editor",
|
|
19
|
+
"editor",
|
|
20
|
+
"web office",
|
|
21
|
+
"online office",
|
|
22
|
+
"tiptap"
|
|
23
|
+
],
|
|
24
|
+
"author": {
|
|
25
|
+
"name": "umodoc",
|
|
26
|
+
"email": "contact@umodoc.com",
|
|
27
|
+
"url": "https://www.umodoc.com"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"homepage": "https://www.umodoc.com",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/umodoc/editor.git"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/umodoc/editor/issues",
|
|
37
|
+
"email": "contact@umodoc.com"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"types/index.d.ts",
|
|
42
|
+
"types/src/*"
|
|
43
|
+
],
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"types": "./types/index.d.ts",
|
|
47
|
+
"import": "./dist/umo-editor.js"
|
|
48
|
+
},
|
|
49
|
+
"./style": {
|
|
50
|
+
"import": "./dist/style.css"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"types": "./types/index.d.ts",
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "vite build",
|
|
56
|
+
"dev": "vite --port 9000 --open --force",
|
|
57
|
+
"format": "prettier --write .",
|
|
58
|
+
"check:code": "eslint --cache src",
|
|
59
|
+
"check:style": "stylelint src/**/*.{css,less,vue}",
|
|
60
|
+
"check:types": "vue-tsc --noEmit",
|
|
61
|
+
"lint:code": "eslint --cache --fix src",
|
|
62
|
+
"lint:style": "stylelint --fix src/**/*.{css,less,vue}",
|
|
63
|
+
"test": "NODE_NO_WARNINGS=1 vitest",
|
|
64
|
+
"test:coverage": "npm run test --coverage",
|
|
65
|
+
"test:watch": "npm run test --watch --coverage",
|
|
66
|
+
"prepare": "husky",
|
|
67
|
+
"prepublishOnly": "npm run build"
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"@eslint/object-schema": "^2.1.4",
|
|
71
|
+
"@imgly/background-removal": "1.5.5",
|
|
72
|
+
"@tiptap-extend/columns": "^2.1.6",
|
|
73
|
+
"@tiptap/core": "2.11.5",
|
|
74
|
+
"@tiptap/extension-bold": "2.11.5",
|
|
75
|
+
"@tiptap/extension-bubble-menu": "2.11.5",
|
|
76
|
+
"@tiptap/extension-bullet-list": "2.11.5",
|
|
77
|
+
"@tiptap/extension-character-count": "2.11.5",
|
|
78
|
+
"@tiptap/extension-code-block": "2.11.5",
|
|
79
|
+
"@tiptap/extension-code-block-lowlight": "2.11.5",
|
|
80
|
+
"@tiptap/extension-collaboration": "2.11.5",
|
|
81
|
+
"@tiptap/extension-color": "2.11.5",
|
|
82
|
+
"@tiptap/extension-document": "2.11.5",
|
|
83
|
+
"@tiptap/extension-dropcursor": "2.11.5",
|
|
84
|
+
"@tiptap/extension-focus": "2.11.5",
|
|
85
|
+
"@tiptap/extension-font-family": "2.11.5",
|
|
86
|
+
"@tiptap/extension-heading": "2.11.5",
|
|
87
|
+
"@tiptap/extension-highlight": "2.11.5",
|
|
88
|
+
"@tiptap/extension-history": "2.11.5",
|
|
89
|
+
"@tiptap/extension-horizontal-rule": "2.11.5",
|
|
90
|
+
"@tiptap/extension-image": "2.11.5",
|
|
91
|
+
"@tiptap/extension-link": "2.11.5",
|
|
92
|
+
"@tiptap/extension-mention": "2.11.5",
|
|
93
|
+
"@tiptap/extension-ordered-list": "2.11.5",
|
|
94
|
+
"@tiptap/extension-placeholder": "2.11.5",
|
|
95
|
+
"@tiptap/extension-subscript": "2.11.5",
|
|
96
|
+
"@tiptap/extension-superscript": "2.11.5",
|
|
97
|
+
"@tiptap/extension-table": "2.11.5",
|
|
98
|
+
"@tiptap/extension-table-cell": "2.11.5",
|
|
99
|
+
"@tiptap/extension-table-header": "2.11.5",
|
|
100
|
+
"@tiptap/extension-table-row": "2.11.5",
|
|
101
|
+
"@tiptap/extension-task-item": "2.11.5",
|
|
102
|
+
"@tiptap/extension-task-list": "2.11.5",
|
|
103
|
+
"@tiptap/extension-text-align": "2.11.5",
|
|
104
|
+
"@tiptap/extension-text-style": "2.11.5",
|
|
105
|
+
"@tiptap/extension-typography": "2.11.5",
|
|
106
|
+
"@tiptap/extension-underline": "2.11.5",
|
|
107
|
+
"@tiptap/pm": "2.11.5",
|
|
108
|
+
"@tiptap/starter-kit": "2.11.5",
|
|
109
|
+
"@tiptap/suggestion": "2.11.5",
|
|
110
|
+
"@tiptap/vue-3": "2.11.5",
|
|
111
|
+
"@tool-belt/type-predicates": "^1.3.0",
|
|
112
|
+
"@types/svg64": "^1.1.2",
|
|
113
|
+
"@umoteam/editor-external": "^9.0.0",
|
|
114
|
+
"@umoteam/viewer": "^0.3.0",
|
|
115
|
+
"@vueuse/core": "^11.0.3",
|
|
116
|
+
"ajv": "^8.18.0",
|
|
117
|
+
"buffer-image-size": "^0.6.4",
|
|
118
|
+
"dom-to-image-more": "^3.4.3",
|
|
119
|
+
"es-drager": "1.2.11",
|
|
120
|
+
"file-saver": "^2.0.5",
|
|
121
|
+
"file64": "^1.0.4",
|
|
122
|
+
"highlight.js": "^11.11.1",
|
|
123
|
+
"hotkeys-js": "^3.13.7",
|
|
124
|
+
"jsbarcode": "^3.11.6",
|
|
125
|
+
"katex": "^0.16.11",
|
|
126
|
+
"lowlight": "^3.3.0",
|
|
127
|
+
"mermaid": "^11.2.0",
|
|
128
|
+
"nzh": "^1.0.13",
|
|
129
|
+
"plyr": "^3.7.8",
|
|
130
|
+
"pretty-bytes": "^6.1.1",
|
|
131
|
+
"prosemirror-transform": "^1.10.0",
|
|
132
|
+
"pure-svg-code": "^1.0.6",
|
|
133
|
+
"sign-canvas-plus": "^2.0.3",
|
|
134
|
+
"smooth-signature": "^1.0.15",
|
|
135
|
+
"svg64": "^2.0.0",
|
|
136
|
+
"tippy.js": "^6.3.7",
|
|
137
|
+
"vue-i18n": "^10.0.0",
|
|
138
|
+
"y-prosemirror": "^1.2.15",
|
|
139
|
+
"y-protocols": "^1.0.6",
|
|
140
|
+
"yjs": "^13.6.23"
|
|
141
|
+
},
|
|
142
|
+
"devDependencies": {
|
|
143
|
+
"@eslint/eslintrc": "^3.1.0",
|
|
144
|
+
"@eslint/js": "^9.10.0",
|
|
145
|
+
"@intlify/unplugin-vue-i18n": "^5.0.0",
|
|
146
|
+
"@sereneinserenade/tiptap-search-and-replace": "^0.1.1",
|
|
147
|
+
"@testing-library/vue": "^8.1.0",
|
|
148
|
+
"@tiptap-pro/extension-drag-handle": "2.17.5",
|
|
149
|
+
"@tiptap-pro/extension-drag-handle-vue-3": "2.17.5",
|
|
150
|
+
"@tiptap-pro/extension-invisible-characters": "2.17.5",
|
|
151
|
+
"@tiptap-pro/extension-mathematics": "2.17.5",
|
|
152
|
+
"@tiptap-pro/extension-node-range": "2.17.5",
|
|
153
|
+
"@tiptap-pro/extension-table-of-contents": "2.17.5",
|
|
154
|
+
"@types/dom-to-image": "^2.6.7",
|
|
155
|
+
"@types/eslint-config-prettier": "^6.11.3",
|
|
156
|
+
"@types/file-saver": "^2.0.7",
|
|
157
|
+
"@types/node": "^22.5.4",
|
|
158
|
+
"@types/qrcode-svg": "^1.1.5",
|
|
159
|
+
"@typescript-eslint/eslint-plugin": "^8.5.0",
|
|
160
|
+
"@typescript-eslint/parser": "^8.5.0",
|
|
161
|
+
"@vitejs/plugin-vue": "^4.6.2",
|
|
162
|
+
"@vue-macros/reactivity-transform": "^1.0.4",
|
|
163
|
+
"@vue-macros/volar": "^0.29.1",
|
|
164
|
+
"@vue/eslint-config-prettier": "^9.0.0",
|
|
165
|
+
"eslint": "^9.21.0",
|
|
166
|
+
"eslint-config-prettier": "^9.1.0",
|
|
167
|
+
"eslint-plugin-functional": "^5.0.8",
|
|
168
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
169
|
+
"eslint-plugin-unused-imports": "^4.1.3",
|
|
170
|
+
"eslint-plugin-vue": "^9.28.0",
|
|
171
|
+
"globals": "^15.9.0",
|
|
172
|
+
"husky": "^9.1.5",
|
|
173
|
+
"jiti": "^2.4.2",
|
|
174
|
+
"jsdom": "^25.0.0",
|
|
175
|
+
"less": "^4.2.0",
|
|
176
|
+
"less-loader": "^12.2.0",
|
|
177
|
+
"lint-staged": "^15.2.10",
|
|
178
|
+
"postcss": "^8.3.3",
|
|
179
|
+
"postcss-html": "^1.7.0",
|
|
180
|
+
"prettier": "^3.3.3",
|
|
181
|
+
"stylelint": "^16.9.0",
|
|
182
|
+
"stylelint-config-recommended-less": "^3.0.1",
|
|
183
|
+
"stylelint-config-recommended-vue": "^1.5.0",
|
|
184
|
+
"stylelint-less": "^3.0.1",
|
|
185
|
+
"tdesign-vue-next": "1.9.8",
|
|
186
|
+
"typescript": "5.5.4",
|
|
187
|
+
"typescript-eslint": "^8.5.0",
|
|
188
|
+
"unplugin-auto-import": "^0.18.2",
|
|
189
|
+
"unplugin-vue": "^5.1.5",
|
|
190
|
+
"unplugin-vue-components": "^0.27.4",
|
|
191
|
+
"unplugin-vue-macros": "^2.11.11",
|
|
192
|
+
"vite": "^5.0.0",
|
|
193
|
+
"vite-plugin-dts": "^4.5.4",
|
|
194
|
+
"vite-plugin-inspect": "^0.8.7",
|
|
195
|
+
"vite-plugin-svg-icons": "^2.0.1",
|
|
196
|
+
"vite-tsconfig-paths": "^5.0.1",
|
|
197
|
+
"vitest": "^2.0.5",
|
|
198
|
+
"vue": "^3.0.11",
|
|
199
|
+
"vue-tsc": "^2.1.6"
|
|
200
|
+
},
|
|
201
|
+
"engines": {
|
|
202
|
+
"node": ">=18.0.0"
|
|
203
|
+
},
|
|
204
|
+
"lint-staged": {
|
|
205
|
+
"*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,less,css,yml,yaml,json,md,html}": [
|
|
206
|
+
"prettier --write src"
|
|
207
|
+
],
|
|
208
|
+
"*.{css,less,vue}": [
|
|
209
|
+
"stylelint --write src/**/*.{css,less,vue}"
|
|
210
|
+
],
|
|
211
|
+
"*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}": [
|
|
212
|
+
"eslint --fix src"
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import type { Extension, HTMLContent, JSONContent } from '@tiptap/core'
|
|
2
|
+
import type { FocusPosition } from '@tiptap/core'
|
|
3
|
+
import { Fragment, Node as ProseMirrorNode } from '@tiptap/pm/model'
|
|
4
|
+
|
|
5
|
+
export type SupportedLocale = 'en-US' | 'zh-CN'
|
|
6
|
+
export type LayoutOption = 'web' | 'page'
|
|
7
|
+
export interface MarginOption {
|
|
8
|
+
left: number
|
|
9
|
+
right: number
|
|
10
|
+
top: number
|
|
11
|
+
bottom: number
|
|
12
|
+
}
|
|
13
|
+
export interface WatermarkOption {
|
|
14
|
+
type?: string
|
|
15
|
+
alpha?: number
|
|
16
|
+
fontColor?: string
|
|
17
|
+
fontSize?: number
|
|
18
|
+
fontFamily?: string
|
|
19
|
+
fontWeight?: string
|
|
20
|
+
text?: string
|
|
21
|
+
}
|
|
22
|
+
export interface PageOption {
|
|
23
|
+
layouts: LayoutOption[]
|
|
24
|
+
defaultMargin?: MarginOption
|
|
25
|
+
defaultOrientation?: string
|
|
26
|
+
defaultBackground?: string
|
|
27
|
+
showBreakMarks?: boolean
|
|
28
|
+
showBookmark?: boolean
|
|
29
|
+
watermark?: WatermarkOption
|
|
30
|
+
size?: {
|
|
31
|
+
width: number
|
|
32
|
+
height: number
|
|
33
|
+
label?: LocaleLabel
|
|
34
|
+
}
|
|
35
|
+
margin?: {
|
|
36
|
+
right: number
|
|
37
|
+
left: number
|
|
38
|
+
bottom: number
|
|
39
|
+
top: number
|
|
40
|
+
layout?: 'narrow' | 'moderate' | 'wide' | 'custom'
|
|
41
|
+
}
|
|
42
|
+
orientation?: string
|
|
43
|
+
background?: string
|
|
44
|
+
header?: boolean
|
|
45
|
+
footer?: boolean
|
|
46
|
+
showLineNumber?: boolean
|
|
47
|
+
showToc?: boolean
|
|
48
|
+
zoomLevel?: number
|
|
49
|
+
bodyHeight?: number
|
|
50
|
+
autoWidth?: boolean
|
|
51
|
+
preview?: {
|
|
52
|
+
enabled?: boolean
|
|
53
|
+
laserPointer?: boolean
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type ToolbarMenu =
|
|
58
|
+
| 'base'
|
|
59
|
+
| 'insert'
|
|
60
|
+
| 'table'
|
|
61
|
+
| 'tools'
|
|
62
|
+
| 'page'
|
|
63
|
+
| 'export'
|
|
64
|
+
| 'advanced'
|
|
65
|
+
| 'custom'
|
|
66
|
+
|
|
67
|
+
export interface ToolbarOptions {
|
|
68
|
+
showSaveLabel?: boolean
|
|
69
|
+
defaultMode?: 'classic' | 'ribbon'
|
|
70
|
+
menus?: ToolbarMenu[]
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface ImportWordOptions {
|
|
74
|
+
enabled?: boolean
|
|
75
|
+
maxSize?: number
|
|
76
|
+
options?: unknown
|
|
77
|
+
useCustomMethod?: boolean
|
|
78
|
+
onCustomImportMethod?: (file: File) => Promise<{
|
|
79
|
+
id: string
|
|
80
|
+
url: string
|
|
81
|
+
value: string
|
|
82
|
+
messages: { type: string; message: string }
|
|
83
|
+
}>
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface AutoSaveOptions {
|
|
87
|
+
enabled?: boolean
|
|
88
|
+
interval?: number
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface DocumentOptions {
|
|
92
|
+
id?: string
|
|
93
|
+
title?: string
|
|
94
|
+
content?: string
|
|
95
|
+
placeholder?: Record<string, string>
|
|
96
|
+
enableSpellcheck?: boolean
|
|
97
|
+
enableMarkdown?: boolean
|
|
98
|
+
enableBubbleMenu?: boolean
|
|
99
|
+
enableBlockMenu?: boolean
|
|
100
|
+
readOnly?: boolean
|
|
101
|
+
autofocus?: 'start' | 'end' | 'all' | number | boolean | null
|
|
102
|
+
characterLimit?: number
|
|
103
|
+
typographyRules?: Record<string, unknown>
|
|
104
|
+
editorProps?: Record<string, unknown>
|
|
105
|
+
parseOptions?: Record<string, unknown>
|
|
106
|
+
autoSave?: AutoSaveOptions
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type LocaleLabel = string | { en_US: string; zh_CN: string }
|
|
110
|
+
|
|
111
|
+
export interface PageSize {
|
|
112
|
+
label: LocaleLabel
|
|
113
|
+
width: number
|
|
114
|
+
height: number
|
|
115
|
+
default?: boolean
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface Font {
|
|
119
|
+
label: LocaleLabel
|
|
120
|
+
value: string | null
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface LineHeight {
|
|
124
|
+
label: LocaleLabel
|
|
125
|
+
value: number
|
|
126
|
+
default?: boolean
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface GraphicSymbol {
|
|
130
|
+
label: LocaleLabel
|
|
131
|
+
items: string
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface Emoji {
|
|
135
|
+
label: LocaleLabel
|
|
136
|
+
items: string
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface Template {
|
|
140
|
+
title: string
|
|
141
|
+
content: string
|
|
142
|
+
description?: string
|
|
143
|
+
value?: string
|
|
144
|
+
divider?: boolean
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface AssistantOptions {
|
|
148
|
+
enabled?: boolean
|
|
149
|
+
maxlength?: number
|
|
150
|
+
commands?: CommandItem[]
|
|
151
|
+
onMessage?: (
|
|
152
|
+
payload: AssistantPayload,
|
|
153
|
+
content: AssistantContent,
|
|
154
|
+
) => Promise<ReadableStream | string>
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface EchartsOptions {
|
|
158
|
+
mode?: number
|
|
159
|
+
renderImage?: boolean
|
|
160
|
+
onCustomSettings?: CallableFunction
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface UserItem {
|
|
164
|
+
id: string
|
|
165
|
+
label: string
|
|
166
|
+
avatar?: string
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface WebPageItem {
|
|
170
|
+
label?: LocaleLabel
|
|
171
|
+
icon?: string
|
|
172
|
+
validate?(url: string): boolean
|
|
173
|
+
transformURL?(url: string): string
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface CommandItem {
|
|
177
|
+
label?: LocaleLabel
|
|
178
|
+
value?: LocaleLabel
|
|
179
|
+
autoSend?: boolean
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface AssistantPayload {
|
|
183
|
+
lang?: string
|
|
184
|
+
input?: string
|
|
185
|
+
command?: string
|
|
186
|
+
output?: string
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface AssistantContent {
|
|
190
|
+
html: HTMLContent
|
|
191
|
+
json: JSONContent
|
|
192
|
+
text: string
|
|
193
|
+
}
|
|
194
|
+
export interface AssistantResult {
|
|
195
|
+
prompt?: string
|
|
196
|
+
content?: string
|
|
197
|
+
error?: boolean
|
|
198
|
+
command?: string
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface FileOptions {
|
|
202
|
+
allowedMimeTypes?: string[]
|
|
203
|
+
maxSize?: number
|
|
204
|
+
preview?: {
|
|
205
|
+
extensions?: string[]
|
|
206
|
+
url?: string
|
|
207
|
+
}[]
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export type InsterContentType = string | Fragment | ProseMirrorNode
|
|
211
|
+
|
|
212
|
+
export interface SetContentOptions {
|
|
213
|
+
emitUpdate: boolean
|
|
214
|
+
focusPosition: FocusPosition
|
|
215
|
+
focusOptions: { scrollIntoView: boolean }
|
|
216
|
+
}
|
|
217
|
+
export type InsterContentOptions = Omit<SetContentOptions, 'emitUpdate'> & {
|
|
218
|
+
updateSelection: boolean
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export type SetContentType = InsterContentType | JSONContent | JSONContent[]
|
|
222
|
+
|
|
223
|
+
type OnSaveFunction = (
|
|
224
|
+
content: {
|
|
225
|
+
html: HTMLContent
|
|
226
|
+
json: JSONContent
|
|
227
|
+
text: string
|
|
228
|
+
},
|
|
229
|
+
page: PageOption,
|
|
230
|
+
document: DocumentOptions,
|
|
231
|
+
) => Promise<unknown>
|
|
232
|
+
|
|
233
|
+
type DeleteFileType = 'image' | 'video' | 'audio' | 'file' | 'inlineImage'
|
|
234
|
+
|
|
235
|
+
export interface UmoEditorOptions {
|
|
236
|
+
editorKey?: string
|
|
237
|
+
locale?: SupportedLocale
|
|
238
|
+
theme?: 'light' | 'dark'
|
|
239
|
+
height?: string
|
|
240
|
+
fullscreenZIndex?: number
|
|
241
|
+
dicts?: {
|
|
242
|
+
pageSizes?: PageSize[]
|
|
243
|
+
fonts?: Font[]
|
|
244
|
+
colors?: string[]
|
|
245
|
+
lineHeights?: LineHeight[]
|
|
246
|
+
symbols?: GraphicSymbol[]
|
|
247
|
+
emojis?: Emoji[]
|
|
248
|
+
}
|
|
249
|
+
toolbar?: ToolbarOptions
|
|
250
|
+
page?: PageOption
|
|
251
|
+
document?: DocumentOptions
|
|
252
|
+
ai?: {
|
|
253
|
+
assistant?: AssistantOptions
|
|
254
|
+
}
|
|
255
|
+
echarts?: EchartsOptions
|
|
256
|
+
webPages?: WebPageItem[]
|
|
257
|
+
templates?: Template[]
|
|
258
|
+
cdnUrl?: string
|
|
259
|
+
shareUrl?: string
|
|
260
|
+
diagrams?: Record<string, unknown>
|
|
261
|
+
importWord?: ImportWordOptions
|
|
262
|
+
file?: FileOptions
|
|
263
|
+
user?: Record<string, unknown>
|
|
264
|
+
users?: UserItem[]
|
|
265
|
+
extensions?: Extension[]
|
|
266
|
+
disableExtensions?: string[]
|
|
267
|
+
translations?: Record<string, unknown>
|
|
268
|
+
onSave?: OnSaveFunction
|
|
269
|
+
onFileUpload?: (file: File) => Promise<{ id: string; url: string }>
|
|
270
|
+
onFileDelete?: (id: string, url: string, type?: DeleteFileType) => void
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// 组件类型声明
|
|
274
|
+
export * from './src/components'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UmoEditorOptions } from '../../../types';
|
|
2
|
+
import { default as UmoEditor } from './index.vue';
|
|
3
|
+
import { default as UmoMenuButton } from './menus/button.vue';
|
|
4
|
+
import { default as UmoDialog } from './modal.vue';
|
|
5
|
+
import { default as UmoTooltip } from './tooltip.vue';
|
|
6
|
+
declare const useUmoEditor: {
|
|
7
|
+
install: (app: any, options?: Partial<UmoEditorOptions>) => void;
|
|
8
|
+
};
|
|
9
|
+
export { UmoEditor as default, UmoDialog, UmoEditor, UmoMenuButton, UmoTooltip, useUmoEditor, };
|