@yiitap/vue 1.2.3 → 1.3.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/dist/index.cjs +80 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +80 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15129 -13400
- package/dist/index.mjs.map +1 -1
- package/dist/vue.css +1 -1
- package/package.json +23 -18
- package/types/components/YiiEditor.vue.d.ts +331 -124
- package/types/components/buttons/OAiBtn.vue.d.ts +20 -0
- package/types/components/common/OBlockList.vue.d.ts +26 -0
- package/types/components/common/OBlockListItem.vue.d.ts +16 -0
- package/types/components/common/OBlockPopover.vue.d.ts +46 -4
- package/types/components/common/OBlockToolbar.vue.d.ts +28 -4
- package/types/components/common/OCommandBtn.vue.d.ts +2 -2
- package/types/components/common/OCommonBtn.vue.d.ts +22 -4
- package/types/components/common/OContextMenu.vue.d.ts +28 -4
- package/types/components/common/ODocToc.vue.d.ts +38 -5
- package/types/components/common/OMenubarBtn.vue.d.ts +100 -2
- package/types/components/common/OToast.d.ts +11 -0
- package/types/components/index.d.ts +5 -0
- package/types/components/menus/OAiMenu.vue.d.ts +27 -0
- package/types/components/menus/OBubbleMenu.vue.d.ts +1 -1
- package/types/components/menus/OFloatingMenu.vue.d.ts +1 -1
- package/types/components/ui/OBtn.vue.d.ts +36 -0
- package/types/components/ui/OBtnGroup.vue.d.ts +100 -0
- package/types/components/ui/OIcon.vue.d.ts +19 -1
- package/types/components/ui/OInput.vue.d.ts +23 -1
- package/types/components/ui/OPopover.vue.d.ts +38 -0
- package/types/constants/ai.d.ts +6 -0
- package/types/constants/block.d.ts +2 -0
- package/types/constants/data.d.ts +4 -0
- package/types/constants/index.d.ts +4 -0
- package/types/extensions/ai-block/index.d.ts +3 -0
- package/types/extensions/ai-block/view.vue.d.ts +92 -0
- package/types/extensions/char-command/emoji/suggestion.d.ts +5 -9
- package/types/extensions/char-command/slash/suggestion.d.ts +5 -9
- package/types/extensions/char-command/slash/view.vue.d.ts +1 -1
- package/types/extensions/dynamic.d.ts +1 -1
- package/types/extensions/index.d.ts +48 -23
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/useAi.d.ts +6 -0
- package/types/hooks/useI18n.d.ts +1 -0
- package/types/hooks/useNodeView.d.ts +6 -0
- package/types/i18n/messages/en.d.ts +47 -0
- package/types/i18n/messages/zh-hans.d.ts +45 -0
- package/types/i18n/messages/zh-hant.d.ts +1 -0
- package/types/index.d.ts +3 -2
- package/types/utils/convert.d.ts +1 -0
- package/types/constants/demo-article.d.ts +0 -7
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
1
2
|
import { EditorContent } from '@tiptap/vue-3';
|
|
2
3
|
import OMainMenu from './menus/OMainMenu.vue';
|
|
3
4
|
import OBubbleMenu from './menus/OBubbleMenu.vue';
|
|
4
5
|
import OFloatingMenu from './menus/OFloatingMenu.vue';
|
|
5
6
|
import OSideMenu from './menus/OSideMenu.vue';
|
|
7
|
+
import type { Editor } from '@tiptap/core';
|
|
6
8
|
declare const darkModeAlt: import("vue").Ref<boolean, boolean>;
|
|
7
9
|
declare const editor: import("vue").ShallowRef<import("@tiptap/vue-3").Editor, import("@tiptap/vue-3").Editor>;
|
|
8
10
|
declare const mainMenuOptions: import("vue").ComputedRef<{
|
|
9
11
|
editor: import("@tiptap/vue-3").Editor;
|
|
10
|
-
menu:
|
|
12
|
+
menu: string[];
|
|
11
13
|
}>;
|
|
12
14
|
declare const bubbleMenuOptions: import("vue").ComputedRef<{
|
|
13
15
|
editor: import("@tiptap/vue-3").Editor;
|
|
14
|
-
menu:
|
|
16
|
+
menu: string[];
|
|
15
17
|
}>;
|
|
16
18
|
declare const floatingMenuOptions: import("vue").ComputedRef<{
|
|
17
19
|
editor: import("@tiptap/vue-3").Editor;
|
|
18
|
-
menu:
|
|
20
|
+
menu: string[];
|
|
19
21
|
}>;
|
|
20
22
|
declare const sideMenuOptions: import("vue").ComputedRef<{
|
|
21
23
|
editor: import("@tiptap/vue-3").Editor;
|
|
@@ -29,85 +31,130 @@ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$
|
|
|
29
31
|
'toolbar-right'?: (props: typeof __VLS_6) => any;
|
|
30
32
|
}>;
|
|
31
33
|
declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
34
|
+
/**
|
|
35
|
+
* Initial content. This can be HTML or JSON.
|
|
36
|
+
*/
|
|
32
37
|
content: {
|
|
33
38
|
type: (StringConstructor | ObjectConstructor)[];
|
|
34
39
|
default: string;
|
|
35
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* Determines if users can write into the editor.
|
|
43
|
+
*/
|
|
36
44
|
editable: {
|
|
37
45
|
type: BooleanConstructor;
|
|
38
46
|
default: boolean;
|
|
39
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Set the locale of the editor
|
|
50
|
+
*/
|
|
40
51
|
locale: {
|
|
41
52
|
type: StringConstructor;
|
|
42
53
|
default: string;
|
|
43
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* By default, Yiitap is in light mode, you can set it to dark mode.
|
|
57
|
+
*/
|
|
44
58
|
darkMode: {
|
|
45
59
|
type: BooleanConstructor;
|
|
46
60
|
default: boolean;
|
|
47
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* Show main menu or not.
|
|
64
|
+
*/
|
|
48
65
|
showMainMenu: {
|
|
49
66
|
type: BooleanConstructor;
|
|
50
67
|
default: boolean;
|
|
51
68
|
};
|
|
69
|
+
/**
|
|
70
|
+
* Show bubble menu or not.
|
|
71
|
+
*/
|
|
52
72
|
showBubbleMenu: {
|
|
53
73
|
type: BooleanConstructor;
|
|
54
74
|
default: boolean;
|
|
55
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* Show floating menu or not.
|
|
78
|
+
*/
|
|
56
79
|
showFloatingMenu: {
|
|
57
80
|
type: BooleanConstructor;
|
|
58
81
|
default: boolean;
|
|
59
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Show side menu or not.
|
|
85
|
+
*/
|
|
60
86
|
showSideMenu: {
|
|
61
87
|
type: BooleanConstructor;
|
|
62
88
|
default: boolean;
|
|
63
89
|
};
|
|
90
|
+
/**
|
|
91
|
+
* Show side node or not.
|
|
92
|
+
*/
|
|
64
93
|
showSideNode: {
|
|
65
94
|
type: BooleanConstructor;
|
|
66
95
|
default: boolean;
|
|
67
96
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
default: boolean;
|
|
75
|
-
};
|
|
76
|
-
scrollable: {
|
|
77
|
-
type: BooleanConstructor;
|
|
78
|
-
default: boolean;
|
|
79
|
-
};
|
|
80
|
-
editorProps: {
|
|
81
|
-
type: ObjectConstructor;
|
|
82
|
-
default: () => {};
|
|
83
|
-
};
|
|
97
|
+
/**
|
|
98
|
+
* Configure the list of extensions you want to enable.
|
|
99
|
+
*
|
|
100
|
+
* By default, Yiitap enables
|
|
101
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/extensions/index.ts" target="_blank">BuiltinExtensions</a>.
|
|
102
|
+
*/
|
|
84
103
|
extensions: {
|
|
85
104
|
type: () => string[];
|
|
86
105
|
default: () => any[];
|
|
87
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* Configure the list of menu items you want to enable in main menu.
|
|
109
|
+
*
|
|
110
|
+
* By default, Yiitap uses
|
|
111
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">DefaultMenu</a>.
|
|
112
|
+
*/
|
|
88
113
|
mainMenu: {
|
|
89
|
-
type:
|
|
114
|
+
type: () => string[];
|
|
90
115
|
default: () => any[];
|
|
91
116
|
};
|
|
117
|
+
/**
|
|
118
|
+
* Configure the list of menu items you want to enable in table menu.
|
|
119
|
+
*
|
|
120
|
+
* By default, Yiitap uses
|
|
121
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">TableMenu</a>.
|
|
122
|
+
*/
|
|
92
123
|
tableMenu: {
|
|
93
|
-
type:
|
|
124
|
+
type: () => string[];
|
|
94
125
|
default: () => any[];
|
|
95
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* Configure the list of menu items you want to enable in bubble menu.
|
|
129
|
+
*
|
|
130
|
+
* By default, Yiitap uses
|
|
131
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">DefaultBubble</a>.
|
|
132
|
+
*/
|
|
96
133
|
bubbleMenu: {
|
|
97
|
-
type:
|
|
134
|
+
type: () => string[];
|
|
98
135
|
default: () => any[];
|
|
99
136
|
};
|
|
137
|
+
/**
|
|
138
|
+
* Configure the list of menu items you want to enable in floating menu.
|
|
139
|
+
*
|
|
140
|
+
* By default, Yiitap uses
|
|
141
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">DefaultFloating</a>.
|
|
142
|
+
*/
|
|
100
143
|
floatingMenu: {
|
|
101
|
-
type:
|
|
144
|
+
type: () => string[];
|
|
102
145
|
default: () => any[];
|
|
103
146
|
};
|
|
147
|
+
/**
|
|
148
|
+
* Set the page view of the editor.
|
|
149
|
+
*/
|
|
104
150
|
pageView: {
|
|
105
151
|
type: StringConstructor;
|
|
106
152
|
default: string;
|
|
153
|
+
validator: (value: string) => boolean;
|
|
107
154
|
};
|
|
108
|
-
|
|
109
|
-
type:
|
|
110
|
-
default: () =>
|
|
155
|
+
aiOption: {
|
|
156
|
+
type: PropType<AiOption>;
|
|
157
|
+
default: () => void;
|
|
111
158
|
};
|
|
112
159
|
}>, {
|
|
113
160
|
EditorContent: typeof EditorContent;
|
|
@@ -121,307 +168,467 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
121
168
|
bubbleMenuOptions: typeof bubbleMenuOptions;
|
|
122
169
|
floatingMenuOptions: typeof floatingMenuOptions;
|
|
123
170
|
sideMenuOptions: typeof sideMenuOptions;
|
|
124
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
125
|
-
update: (
|
|
126
|
-
|
|
171
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
172
|
+
update: (payload: {
|
|
173
|
+
json: Object;
|
|
174
|
+
html: string;
|
|
175
|
+
}) => any;
|
|
176
|
+
transaction: (payload: {
|
|
177
|
+
editor: Editor;
|
|
178
|
+
transaction: Object;
|
|
179
|
+
}) => any;
|
|
127
180
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
181
|
+
/**
|
|
182
|
+
* Initial content. This can be HTML or JSON.
|
|
183
|
+
*/
|
|
128
184
|
content: {
|
|
129
185
|
type: (StringConstructor | ObjectConstructor)[];
|
|
130
186
|
default: string;
|
|
131
187
|
};
|
|
188
|
+
/**
|
|
189
|
+
* Determines if users can write into the editor.
|
|
190
|
+
*/
|
|
132
191
|
editable: {
|
|
133
192
|
type: BooleanConstructor;
|
|
134
193
|
default: boolean;
|
|
135
194
|
};
|
|
195
|
+
/**
|
|
196
|
+
* Set the locale of the editor
|
|
197
|
+
*/
|
|
136
198
|
locale: {
|
|
137
199
|
type: StringConstructor;
|
|
138
200
|
default: string;
|
|
139
201
|
};
|
|
202
|
+
/**
|
|
203
|
+
* By default, Yiitap is in light mode, you can set it to dark mode.
|
|
204
|
+
*/
|
|
140
205
|
darkMode: {
|
|
141
206
|
type: BooleanConstructor;
|
|
142
207
|
default: boolean;
|
|
143
208
|
};
|
|
209
|
+
/**
|
|
210
|
+
* Show main menu or not.
|
|
211
|
+
*/
|
|
144
212
|
showMainMenu: {
|
|
145
213
|
type: BooleanConstructor;
|
|
146
214
|
default: boolean;
|
|
147
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* Show bubble menu or not.
|
|
218
|
+
*/
|
|
148
219
|
showBubbleMenu: {
|
|
149
220
|
type: BooleanConstructor;
|
|
150
221
|
default: boolean;
|
|
151
222
|
};
|
|
223
|
+
/**
|
|
224
|
+
* Show floating menu or not.
|
|
225
|
+
*/
|
|
152
226
|
showFloatingMenu: {
|
|
153
227
|
type: BooleanConstructor;
|
|
154
228
|
default: boolean;
|
|
155
229
|
};
|
|
230
|
+
/**
|
|
231
|
+
* Show side menu or not.
|
|
232
|
+
*/
|
|
156
233
|
showSideMenu: {
|
|
157
234
|
type: BooleanConstructor;
|
|
158
235
|
default: boolean;
|
|
159
236
|
};
|
|
237
|
+
/**
|
|
238
|
+
* Show side node or not.
|
|
239
|
+
*/
|
|
160
240
|
showSideNode: {
|
|
161
241
|
type: BooleanConstructor;
|
|
162
242
|
default: boolean;
|
|
163
243
|
};
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
default: boolean;
|
|
171
|
-
};
|
|
172
|
-
scrollable: {
|
|
173
|
-
type: BooleanConstructor;
|
|
174
|
-
default: boolean;
|
|
175
|
-
};
|
|
176
|
-
editorProps: {
|
|
177
|
-
type: ObjectConstructor;
|
|
178
|
-
default: () => {};
|
|
179
|
-
};
|
|
244
|
+
/**
|
|
245
|
+
* Configure the list of extensions you want to enable.
|
|
246
|
+
*
|
|
247
|
+
* By default, Yiitap enables
|
|
248
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/extensions/index.ts" target="_blank">BuiltinExtensions</a>.
|
|
249
|
+
*/
|
|
180
250
|
extensions: {
|
|
181
251
|
type: () => string[];
|
|
182
252
|
default: () => any[];
|
|
183
253
|
};
|
|
254
|
+
/**
|
|
255
|
+
* Configure the list of menu items you want to enable in main menu.
|
|
256
|
+
*
|
|
257
|
+
* By default, Yiitap uses
|
|
258
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">DefaultMenu</a>.
|
|
259
|
+
*/
|
|
184
260
|
mainMenu: {
|
|
185
|
-
type:
|
|
261
|
+
type: () => string[];
|
|
186
262
|
default: () => any[];
|
|
187
263
|
};
|
|
264
|
+
/**
|
|
265
|
+
* Configure the list of menu items you want to enable in table menu.
|
|
266
|
+
*
|
|
267
|
+
* By default, Yiitap uses
|
|
268
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">TableMenu</a>.
|
|
269
|
+
*/
|
|
188
270
|
tableMenu: {
|
|
189
|
-
type:
|
|
271
|
+
type: () => string[];
|
|
190
272
|
default: () => any[];
|
|
191
273
|
};
|
|
274
|
+
/**
|
|
275
|
+
* Configure the list of menu items you want to enable in bubble menu.
|
|
276
|
+
*
|
|
277
|
+
* By default, Yiitap uses
|
|
278
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">DefaultBubble</a>.
|
|
279
|
+
*/
|
|
192
280
|
bubbleMenu: {
|
|
193
|
-
type:
|
|
281
|
+
type: () => string[];
|
|
194
282
|
default: () => any[];
|
|
195
283
|
};
|
|
284
|
+
/**
|
|
285
|
+
* Configure the list of menu items you want to enable in floating menu.
|
|
286
|
+
*
|
|
287
|
+
* By default, Yiitap uses
|
|
288
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">DefaultFloating</a>.
|
|
289
|
+
*/
|
|
196
290
|
floatingMenu: {
|
|
197
|
-
type:
|
|
291
|
+
type: () => string[];
|
|
198
292
|
default: () => any[];
|
|
199
293
|
};
|
|
294
|
+
/**
|
|
295
|
+
* Set the page view of the editor.
|
|
296
|
+
*/
|
|
200
297
|
pageView: {
|
|
201
298
|
type: StringConstructor;
|
|
202
299
|
default: string;
|
|
300
|
+
validator: (value: string) => boolean;
|
|
203
301
|
};
|
|
204
|
-
|
|
205
|
-
type:
|
|
206
|
-
default: () =>
|
|
302
|
+
aiOption: {
|
|
303
|
+
type: PropType<AiOption>;
|
|
304
|
+
default: () => void;
|
|
207
305
|
};
|
|
208
306
|
}>> & Readonly<{
|
|
209
|
-
onUpdate?: (
|
|
210
|
-
|
|
307
|
+
onUpdate?: (payload: {
|
|
308
|
+
json: Object;
|
|
309
|
+
html: string;
|
|
310
|
+
}) => any;
|
|
311
|
+
onTransaction?: (payload: {
|
|
312
|
+
editor: Editor;
|
|
313
|
+
transaction: Object;
|
|
314
|
+
}) => any;
|
|
211
315
|
}>, {
|
|
316
|
+
aiOption: AiOption;
|
|
212
317
|
locale: string;
|
|
213
318
|
darkMode: boolean;
|
|
214
|
-
options: Record<string, any>;
|
|
215
319
|
content: string | Record<string, any>;
|
|
216
320
|
extensions: string[];
|
|
217
321
|
editable: boolean;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
floatingMenu: unknown[];
|
|
322
|
+
bubbleMenu: string[];
|
|
323
|
+
floatingMenu: string[];
|
|
221
324
|
showMainMenu: boolean;
|
|
222
325
|
showBubbleMenu: boolean;
|
|
223
326
|
showFloatingMenu: boolean;
|
|
224
327
|
showSideMenu: boolean;
|
|
225
328
|
showSideNode: boolean;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
scrollable: boolean;
|
|
229
|
-
mainMenu: unknown[];
|
|
230
|
-
tableMenu: unknown[];
|
|
329
|
+
mainMenu: string[];
|
|
330
|
+
tableMenu: string[];
|
|
231
331
|
pageView: string;
|
|
232
332
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
233
333
|
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
334
|
+
/**
|
|
335
|
+
* Initial content. This can be HTML or JSON.
|
|
336
|
+
*/
|
|
234
337
|
content: {
|
|
235
338
|
type: (StringConstructor | ObjectConstructor)[];
|
|
236
339
|
default: string;
|
|
237
340
|
};
|
|
341
|
+
/**
|
|
342
|
+
* Determines if users can write into the editor.
|
|
343
|
+
*/
|
|
238
344
|
editable: {
|
|
239
345
|
type: BooleanConstructor;
|
|
240
346
|
default: boolean;
|
|
241
347
|
};
|
|
348
|
+
/**
|
|
349
|
+
* Set the locale of the editor
|
|
350
|
+
*/
|
|
242
351
|
locale: {
|
|
243
352
|
type: StringConstructor;
|
|
244
353
|
default: string;
|
|
245
354
|
};
|
|
355
|
+
/**
|
|
356
|
+
* By default, Yiitap is in light mode, you can set it to dark mode.
|
|
357
|
+
*/
|
|
246
358
|
darkMode: {
|
|
247
359
|
type: BooleanConstructor;
|
|
248
360
|
default: boolean;
|
|
249
361
|
};
|
|
362
|
+
/**
|
|
363
|
+
* Show main menu or not.
|
|
364
|
+
*/
|
|
250
365
|
showMainMenu: {
|
|
251
366
|
type: BooleanConstructor;
|
|
252
367
|
default: boolean;
|
|
253
368
|
};
|
|
369
|
+
/**
|
|
370
|
+
* Show bubble menu or not.
|
|
371
|
+
*/
|
|
254
372
|
showBubbleMenu: {
|
|
255
373
|
type: BooleanConstructor;
|
|
256
374
|
default: boolean;
|
|
257
375
|
};
|
|
376
|
+
/**
|
|
377
|
+
* Show floating menu or not.
|
|
378
|
+
*/
|
|
258
379
|
showFloatingMenu: {
|
|
259
380
|
type: BooleanConstructor;
|
|
260
381
|
default: boolean;
|
|
261
382
|
};
|
|
383
|
+
/**
|
|
384
|
+
* Show side menu or not.
|
|
385
|
+
*/
|
|
262
386
|
showSideMenu: {
|
|
263
387
|
type: BooleanConstructor;
|
|
264
388
|
default: boolean;
|
|
265
389
|
};
|
|
390
|
+
/**
|
|
391
|
+
* Show side node or not.
|
|
392
|
+
*/
|
|
266
393
|
showSideNode: {
|
|
267
394
|
type: BooleanConstructor;
|
|
268
395
|
default: boolean;
|
|
269
396
|
};
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
default: boolean;
|
|
277
|
-
};
|
|
278
|
-
scrollable: {
|
|
279
|
-
type: BooleanConstructor;
|
|
280
|
-
default: boolean;
|
|
281
|
-
};
|
|
282
|
-
editorProps: {
|
|
283
|
-
type: ObjectConstructor;
|
|
284
|
-
default: () => {};
|
|
285
|
-
};
|
|
397
|
+
/**
|
|
398
|
+
* Configure the list of extensions you want to enable.
|
|
399
|
+
*
|
|
400
|
+
* By default, Yiitap enables
|
|
401
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/extensions/index.ts" target="_blank">BuiltinExtensions</a>.
|
|
402
|
+
*/
|
|
286
403
|
extensions: {
|
|
287
404
|
type: () => string[];
|
|
288
405
|
default: () => any[];
|
|
289
406
|
};
|
|
407
|
+
/**
|
|
408
|
+
* Configure the list of menu items you want to enable in main menu.
|
|
409
|
+
*
|
|
410
|
+
* By default, Yiitap uses
|
|
411
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">DefaultMenu</a>.
|
|
412
|
+
*/
|
|
290
413
|
mainMenu: {
|
|
291
|
-
type:
|
|
414
|
+
type: () => string[];
|
|
292
415
|
default: () => any[];
|
|
293
416
|
};
|
|
417
|
+
/**
|
|
418
|
+
* Configure the list of menu items you want to enable in table menu.
|
|
419
|
+
*
|
|
420
|
+
* By default, Yiitap uses
|
|
421
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">TableMenu</a>.
|
|
422
|
+
*/
|
|
294
423
|
tableMenu: {
|
|
295
|
-
type:
|
|
424
|
+
type: () => string[];
|
|
296
425
|
default: () => any[];
|
|
297
426
|
};
|
|
427
|
+
/**
|
|
428
|
+
* Configure the list of menu items you want to enable in bubble menu.
|
|
429
|
+
*
|
|
430
|
+
* By default, Yiitap uses
|
|
431
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">DefaultBubble</a>.
|
|
432
|
+
*/
|
|
298
433
|
bubbleMenu: {
|
|
299
|
-
type:
|
|
434
|
+
type: () => string[];
|
|
300
435
|
default: () => any[];
|
|
301
436
|
};
|
|
437
|
+
/**
|
|
438
|
+
* Configure the list of menu items you want to enable in floating menu.
|
|
439
|
+
*
|
|
440
|
+
* By default, Yiitap uses
|
|
441
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">DefaultFloating</a>.
|
|
442
|
+
*/
|
|
302
443
|
floatingMenu: {
|
|
303
|
-
type:
|
|
444
|
+
type: () => string[];
|
|
304
445
|
default: () => any[];
|
|
305
446
|
};
|
|
447
|
+
/**
|
|
448
|
+
* Set the page view of the editor.
|
|
449
|
+
*/
|
|
306
450
|
pageView: {
|
|
307
451
|
type: StringConstructor;
|
|
308
452
|
default: string;
|
|
453
|
+
validator: (value: string) => boolean;
|
|
309
454
|
};
|
|
310
|
-
|
|
311
|
-
type:
|
|
312
|
-
default: () =>
|
|
455
|
+
aiOption: {
|
|
456
|
+
type: PropType<AiOption>;
|
|
457
|
+
default: () => void;
|
|
313
458
|
};
|
|
314
459
|
}>, {
|
|
460
|
+
/**
|
|
461
|
+
* Editor instance. More about <a href="https://tiptap.dev/docs/editor/api/editor" target="_blank">editor api</a>.
|
|
462
|
+
*/
|
|
315
463
|
editor: import("vue").ShallowRef<import("@tiptap/vue-3").Editor, import("@tiptap/vue-3").Editor>;
|
|
464
|
+
/**
|
|
465
|
+
* Whether in dark mode
|
|
466
|
+
*/
|
|
316
467
|
darkMode: import("vue").Ref<boolean, boolean>;
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
468
|
+
/**
|
|
469
|
+
* Current locale
|
|
470
|
+
*/
|
|
471
|
+
locale: import("vue").Ref<string, string>;
|
|
472
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
473
|
+
update: (payload: {
|
|
474
|
+
json: Object;
|
|
475
|
+
html: string;
|
|
476
|
+
}) => any;
|
|
477
|
+
transaction: (payload: {
|
|
478
|
+
editor: Editor;
|
|
479
|
+
transaction: Object;
|
|
480
|
+
}) => any;
|
|
321
481
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
482
|
+
/**
|
|
483
|
+
* Initial content. This can be HTML or JSON.
|
|
484
|
+
*/
|
|
322
485
|
content: {
|
|
323
486
|
type: (StringConstructor | ObjectConstructor)[];
|
|
324
487
|
default: string;
|
|
325
488
|
};
|
|
489
|
+
/**
|
|
490
|
+
* Determines if users can write into the editor.
|
|
491
|
+
*/
|
|
326
492
|
editable: {
|
|
327
493
|
type: BooleanConstructor;
|
|
328
494
|
default: boolean;
|
|
329
495
|
};
|
|
496
|
+
/**
|
|
497
|
+
* Set the locale of the editor
|
|
498
|
+
*/
|
|
330
499
|
locale: {
|
|
331
500
|
type: StringConstructor;
|
|
332
501
|
default: string;
|
|
333
502
|
};
|
|
503
|
+
/**
|
|
504
|
+
* By default, Yiitap is in light mode, you can set it to dark mode.
|
|
505
|
+
*/
|
|
334
506
|
darkMode: {
|
|
335
507
|
type: BooleanConstructor;
|
|
336
508
|
default: boolean;
|
|
337
509
|
};
|
|
510
|
+
/**
|
|
511
|
+
* Show main menu or not.
|
|
512
|
+
*/
|
|
338
513
|
showMainMenu: {
|
|
339
514
|
type: BooleanConstructor;
|
|
340
515
|
default: boolean;
|
|
341
516
|
};
|
|
517
|
+
/**
|
|
518
|
+
* Show bubble menu or not.
|
|
519
|
+
*/
|
|
342
520
|
showBubbleMenu: {
|
|
343
521
|
type: BooleanConstructor;
|
|
344
522
|
default: boolean;
|
|
345
523
|
};
|
|
524
|
+
/**
|
|
525
|
+
* Show floating menu or not.
|
|
526
|
+
*/
|
|
346
527
|
showFloatingMenu: {
|
|
347
528
|
type: BooleanConstructor;
|
|
348
529
|
default: boolean;
|
|
349
530
|
};
|
|
531
|
+
/**
|
|
532
|
+
* Show side menu or not.
|
|
533
|
+
*/
|
|
350
534
|
showSideMenu: {
|
|
351
535
|
type: BooleanConstructor;
|
|
352
536
|
default: boolean;
|
|
353
537
|
};
|
|
538
|
+
/**
|
|
539
|
+
* Show side node or not.
|
|
540
|
+
*/
|
|
354
541
|
showSideNode: {
|
|
355
542
|
type: BooleanConstructor;
|
|
356
543
|
default: boolean;
|
|
357
544
|
};
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
default: boolean;
|
|
365
|
-
};
|
|
366
|
-
scrollable: {
|
|
367
|
-
type: BooleanConstructor;
|
|
368
|
-
default: boolean;
|
|
369
|
-
};
|
|
370
|
-
editorProps: {
|
|
371
|
-
type: ObjectConstructor;
|
|
372
|
-
default: () => {};
|
|
373
|
-
};
|
|
545
|
+
/**
|
|
546
|
+
* Configure the list of extensions you want to enable.
|
|
547
|
+
*
|
|
548
|
+
* By default, Yiitap enables
|
|
549
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/extensions/index.ts" target="_blank">BuiltinExtensions</a>.
|
|
550
|
+
*/
|
|
374
551
|
extensions: {
|
|
375
552
|
type: () => string[];
|
|
376
553
|
default: () => any[];
|
|
377
554
|
};
|
|
555
|
+
/**
|
|
556
|
+
* Configure the list of menu items you want to enable in main menu.
|
|
557
|
+
*
|
|
558
|
+
* By default, Yiitap uses
|
|
559
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">DefaultMenu</a>.
|
|
560
|
+
*/
|
|
378
561
|
mainMenu: {
|
|
379
|
-
type:
|
|
562
|
+
type: () => string[];
|
|
380
563
|
default: () => any[];
|
|
381
564
|
};
|
|
565
|
+
/**
|
|
566
|
+
* Configure the list of menu items you want to enable in table menu.
|
|
567
|
+
*
|
|
568
|
+
* By default, Yiitap uses
|
|
569
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">TableMenu</a>.
|
|
570
|
+
*/
|
|
382
571
|
tableMenu: {
|
|
383
|
-
type:
|
|
572
|
+
type: () => string[];
|
|
384
573
|
default: () => any[];
|
|
385
574
|
};
|
|
575
|
+
/**
|
|
576
|
+
* Configure the list of menu items you want to enable in bubble menu.
|
|
577
|
+
*
|
|
578
|
+
* By default, Yiitap uses
|
|
579
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">DefaultBubble</a>.
|
|
580
|
+
*/
|
|
386
581
|
bubbleMenu: {
|
|
387
|
-
type:
|
|
582
|
+
type: () => string[];
|
|
388
583
|
default: () => any[];
|
|
389
584
|
};
|
|
585
|
+
/**
|
|
586
|
+
* Configure the list of menu items you want to enable in floating menu.
|
|
587
|
+
*
|
|
588
|
+
* By default, Yiitap uses
|
|
589
|
+
* <a href="https://github.com/yiitap/yiitap/blob/main/packages/vue/src/constants/menu.ts" target="_blank">DefaultFloating</a>.
|
|
590
|
+
*/
|
|
390
591
|
floatingMenu: {
|
|
391
|
-
type:
|
|
592
|
+
type: () => string[];
|
|
392
593
|
default: () => any[];
|
|
393
594
|
};
|
|
595
|
+
/**
|
|
596
|
+
* Set the page view of the editor.
|
|
597
|
+
*/
|
|
394
598
|
pageView: {
|
|
395
599
|
type: StringConstructor;
|
|
396
600
|
default: string;
|
|
601
|
+
validator: (value: string) => boolean;
|
|
397
602
|
};
|
|
398
|
-
|
|
399
|
-
type:
|
|
400
|
-
default: () =>
|
|
603
|
+
aiOption: {
|
|
604
|
+
type: PropType<AiOption>;
|
|
605
|
+
default: () => void;
|
|
401
606
|
};
|
|
402
607
|
}>> & Readonly<{
|
|
403
|
-
onUpdate?: (
|
|
404
|
-
|
|
608
|
+
onUpdate?: (payload: {
|
|
609
|
+
json: Object;
|
|
610
|
+
html: string;
|
|
611
|
+
}) => any;
|
|
612
|
+
onTransaction?: (payload: {
|
|
613
|
+
editor: Editor;
|
|
614
|
+
transaction: Object;
|
|
615
|
+
}) => any;
|
|
405
616
|
}>, {
|
|
617
|
+
aiOption: AiOption;
|
|
406
618
|
locale: string;
|
|
407
619
|
darkMode: boolean;
|
|
408
|
-
options: Record<string, any>;
|
|
409
620
|
content: string | Record<string, any>;
|
|
410
621
|
extensions: string[];
|
|
411
622
|
editable: boolean;
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
floatingMenu: unknown[];
|
|
623
|
+
bubbleMenu: string[];
|
|
624
|
+
floatingMenu: string[];
|
|
415
625
|
showMainMenu: boolean;
|
|
416
626
|
showBubbleMenu: boolean;
|
|
417
627
|
showFloatingMenu: boolean;
|
|
418
628
|
showSideMenu: boolean;
|
|
419
629
|
showSideNode: boolean;
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
scrollable: boolean;
|
|
423
|
-
mainMenu: unknown[];
|
|
424
|
-
tableMenu: unknown[];
|
|
630
|
+
mainMenu: string[];
|
|
631
|
+
tableMenu: string[];
|
|
425
632
|
pageView: string;
|
|
426
633
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
427
634
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|