@jx-health/rich-editor 0.0.1
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 +23 -0
- package/dist/index.d.ts +1129 -0
- package/dist/index.js +23421 -0
- package/dist/style.css +1654 -0
- package/package.json +120 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1129 @@
|
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
|
+
import { HTMLAttributes, Plugin } from "vue";
|
|
3
|
+
import * as _$_tiptap_core0 from "@tiptap/core";
|
|
4
|
+
import { AnyExtension, Editor, Editor as Editor$1, Editor as EditorInstance, Extension, JSONContent, JSONContent as JSONContent$1, Node, Range } from "@tiptap/core";
|
|
5
|
+
import { Editor as Editor$2, Node as Node$1, useEditor } from "@tiptap/vue-3";
|
|
6
|
+
import { PluginKey } from "@tiptap/pm/state";
|
|
7
|
+
import { TooltipContentProps } from "reka-ui";
|
|
8
|
+
import { Mark } from "@tiptap/pm/model";
|
|
9
|
+
import { BoldOptions as BoldOptions$1 } from "@tiptap/extension-bold";
|
|
10
|
+
import { ItalicOptions as ItalicOptions$1 } from "@tiptap/extension-italic";
|
|
11
|
+
import { UnderlineOptions as UnderlineOptions$1 } from "@tiptap/extension-underline";
|
|
12
|
+
import { StrikeOptions as StrikeOptions$1 } from "@tiptap/extension-strike";
|
|
13
|
+
import { CodeOptions as CodeOptions$1 } from "@tiptap/extension-code";
|
|
14
|
+
import { HeadingOptions as HeadingOptions$1 } from "@tiptap/extension-heading";
|
|
15
|
+
import { TextAlignOptions as TextAlignOptions$1 } from "@tiptap/extension-text-align";
|
|
16
|
+
import { ColorOptions as ColorOptions$1 } from "@tiptap/extension-color";
|
|
17
|
+
import { HighlightOptions as HighlightOptions$1 } from "@tiptap/extension-highlight";
|
|
18
|
+
import { BulletListOptions as BulletListOptions$1 } from "@tiptap/extension-bullet-list";
|
|
19
|
+
import { OrderedListOptions as OrderedListOptions$1 } from "@tiptap/extension-ordered-list";
|
|
20
|
+
import { TaskItemOptions } from "@tiptap/extension-task-item";
|
|
21
|
+
import { TaskListOptions as TaskListOptions$1 } from "@tiptap/extension-task-list";
|
|
22
|
+
import { BlockquoteOptions as BlockquoteOptions$1 } from "@tiptap/extension-blockquote";
|
|
23
|
+
import { LinkOptions as LinkOptions$1 } from "@tiptap/extension-link";
|
|
24
|
+
import { HorizontalRuleOptions as HorizontalRuleOptions$1 } from "@tiptap/extension-horizontal-rule";
|
|
25
|
+
import { HistoryOptions as HistoryOptions$1 } from "@tiptap/extension-history";
|
|
26
|
+
import { CharacterCountOptions } from "@tiptap/extension-character-count";
|
|
27
|
+
import { DropcursorOptions } from "@tiptap/extension-dropcursor";
|
|
28
|
+
import { FocusOptions } from "@tiptap/extension-focus";
|
|
29
|
+
import { HardBreakOptions } from "@tiptap/extension-hard-break";
|
|
30
|
+
import { ListItemOptions } from "@tiptap/extension-list-item";
|
|
31
|
+
import { ParagraphOptions } from "@tiptap/extension-paragraph";
|
|
32
|
+
import { PlaceholderOptions } from "@tiptap/extension-placeholder";
|
|
33
|
+
import { TextStyleOptions } from "@tiptap/extension-text-style";
|
|
34
|
+
import { SubscriptExtensionOptions } from "@tiptap/extension-subscript";
|
|
35
|
+
import { SuperscriptExtensionOptions } from "@tiptap/extension-superscript";
|
|
36
|
+
import * as _$_tiptap_extension_image0 from "@tiptap/extension-image";
|
|
37
|
+
import { TableHeaderOptions } from "@tiptap/extension-table-header";
|
|
38
|
+
import { TableRowOptions } from "@tiptap/extension-table-row";
|
|
39
|
+
import { TableCellOptions } from "@tiptap/extension-table-cell";
|
|
40
|
+
import { FontFamilyOptions as FontFamilyOptions$1 } from "@tiptap/extension-font-family";
|
|
41
|
+
|
|
42
|
+
//#region src/components/icons/icons.d.ts
|
|
43
|
+
declare const icons: {
|
|
44
|
+
Bold: string;
|
|
45
|
+
LoaderCircle: string;
|
|
46
|
+
Italic: string;
|
|
47
|
+
Underline: string;
|
|
48
|
+
Quote: string;
|
|
49
|
+
TextQuote: string;
|
|
50
|
+
Strikethrough: string;
|
|
51
|
+
Minus: string;
|
|
52
|
+
Eraser: string;
|
|
53
|
+
PaintRoller: string;
|
|
54
|
+
Redo2: string;
|
|
55
|
+
Undo2: string;
|
|
56
|
+
AlignCenter: string;
|
|
57
|
+
AlignJustify: string;
|
|
58
|
+
AlignLeft: string;
|
|
59
|
+
AlignRight: string;
|
|
60
|
+
ChevronUp: string;
|
|
61
|
+
ChevronDown: string;
|
|
62
|
+
Subscript: string;
|
|
63
|
+
Superscript: string;
|
|
64
|
+
Code: string;
|
|
65
|
+
Code2: string;
|
|
66
|
+
Type: string;
|
|
67
|
+
IndentIncrease: string;
|
|
68
|
+
IndentDecrease: string;
|
|
69
|
+
List: string;
|
|
70
|
+
ListOrdered: string;
|
|
71
|
+
ListTodo: string;
|
|
72
|
+
Link: string;
|
|
73
|
+
ImageUp: string;
|
|
74
|
+
Video: string;
|
|
75
|
+
Maximize: string;
|
|
76
|
+
Minimize: string;
|
|
77
|
+
Table: string;
|
|
78
|
+
Sparkles: string;
|
|
79
|
+
Magic: string;
|
|
80
|
+
Pencil: string;
|
|
81
|
+
Unlink: string;
|
|
82
|
+
BetweenHorizonalEnd: string;
|
|
83
|
+
BetweenHorizonalStart: string;
|
|
84
|
+
ColumnDelete: string;
|
|
85
|
+
BetweenVerticalStart: string;
|
|
86
|
+
BetweenVerticalEnd: string;
|
|
87
|
+
RowDelete: string;
|
|
88
|
+
TableCellsMerge: string;
|
|
89
|
+
TableCellsSplit: string;
|
|
90
|
+
Trash2: string;
|
|
91
|
+
Trash: string;
|
|
92
|
+
Replace: string;
|
|
93
|
+
ChevronsUpDown: string;
|
|
94
|
+
LineHeight: string;
|
|
95
|
+
Word: string;
|
|
96
|
+
Paragraph: string;
|
|
97
|
+
Heading1: string;
|
|
98
|
+
Heading2: string;
|
|
99
|
+
Heading3: string;
|
|
100
|
+
Columns2: string;
|
|
101
|
+
Columns3: string;
|
|
102
|
+
Columns4: string;
|
|
103
|
+
Plus: string;
|
|
104
|
+
Grip: string;
|
|
105
|
+
Copy: string;
|
|
106
|
+
Clipboard: string;
|
|
107
|
+
MenuDown: string;
|
|
108
|
+
SizeS: string;
|
|
109
|
+
SizeM: string;
|
|
110
|
+
SizeL: string;
|
|
111
|
+
AspectRatio: string;
|
|
112
|
+
Gaode: string;
|
|
113
|
+
Baidu: string;
|
|
114
|
+
Youku: string;
|
|
115
|
+
BiliBili: string;
|
|
116
|
+
Modao: string;
|
|
117
|
+
Lanhu: string;
|
|
118
|
+
QQVideo: string;
|
|
119
|
+
Figma: string;
|
|
120
|
+
Canva: string;
|
|
121
|
+
Processon: string;
|
|
122
|
+
Codepen: string;
|
|
123
|
+
Jinshuju: string;
|
|
124
|
+
PanelLeft: string;
|
|
125
|
+
PanelRight: string;
|
|
126
|
+
Columns: string;
|
|
127
|
+
AI: string;
|
|
128
|
+
ChevronRight: string;
|
|
129
|
+
ArrowUp: string;
|
|
130
|
+
Paste: string;
|
|
131
|
+
Cut: string;
|
|
132
|
+
File: string;
|
|
133
|
+
Refresh: string;
|
|
134
|
+
Eye: string;
|
|
135
|
+
Printer: string;
|
|
136
|
+
Tablet: string;
|
|
137
|
+
Phone: string;
|
|
138
|
+
Monitor: string;
|
|
139
|
+
TextSelect: string;
|
|
140
|
+
SpellCheck: string;
|
|
141
|
+
DocSearch: string;
|
|
142
|
+
Close: string;
|
|
143
|
+
ImageSize: string;
|
|
144
|
+
FlipVertical: string;
|
|
145
|
+
FlipHorizontal: string;
|
|
146
|
+
WrapText: string;
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/types/index.d.ts
|
|
150
|
+
/**
|
|
151
|
+
* Represents the onChange event for RichEditor.
|
|
152
|
+
*/
|
|
153
|
+
type RichEditorOnChange = {
|
|
154
|
+
/** Editor object */editor: Editor$1; /** Output content, can be a string or JSON content */
|
|
155
|
+
output: string | JSONContent$1;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Represents the keys for different extensions.
|
|
159
|
+
*/
|
|
160
|
+
type ExtensionNameKeys = 'bold' | 'italic' | 'underline' | 'strike' | 'color' | 'highlight' | 'heading' | 'textAlign' | 'bulletList' | 'orderedList' | 'taskList' | 'indent' | 'link' | 'image' | 'video' | 'table' | 'blockquote' | 'horizontalRule' | 'code' | 'codeBlock' | 'clear' | 'history' | 'fullscreen';
|
|
161
|
+
/**
|
|
162
|
+
* Represents the general options for Tiptap extensions.
|
|
163
|
+
*/
|
|
164
|
+
interface GeneralOptions<T> {
|
|
165
|
+
/** Enabled divider */
|
|
166
|
+
divider: boolean;
|
|
167
|
+
/** Enabled spacer */
|
|
168
|
+
spacer: boolean;
|
|
169
|
+
/** Button view function */
|
|
170
|
+
button: ButtonView<T>;
|
|
171
|
+
/** Show on Toolbar */
|
|
172
|
+
toolbar?: boolean;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Represents the props for the ButtonView component.
|
|
176
|
+
*/
|
|
177
|
+
interface ButtonViewReturnComponentProps {
|
|
178
|
+
/** Method triggered when action is performed */
|
|
179
|
+
action?: (value?: any) => void;
|
|
180
|
+
/** Whether it is in the active state */
|
|
181
|
+
isActive?: () => boolean;
|
|
182
|
+
/** Button icon */
|
|
183
|
+
icon?: keyof typeof icons;
|
|
184
|
+
/** Text displayed on hover */
|
|
185
|
+
tooltip?: string;
|
|
186
|
+
[x: string]: any;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Represents the slots for the ButtonView component.
|
|
190
|
+
*/
|
|
191
|
+
interface ButtonViewReturnComponentSlots {
|
|
192
|
+
/** Dialog slot */
|
|
193
|
+
dialog: () => any;
|
|
194
|
+
[x: string]: () => any;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Represents the return value for the ButtonView component.
|
|
198
|
+
*/
|
|
199
|
+
interface ButtonViewReturn {
|
|
200
|
+
/** Component */
|
|
201
|
+
component: unknown;
|
|
202
|
+
/** Component props */
|
|
203
|
+
componentProps: ButtonViewReturnComponentProps;
|
|
204
|
+
/** Component slots */
|
|
205
|
+
componentSlots?: ButtonViewReturnComponentSlots;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Represents the parameters for the ButtonView function.
|
|
209
|
+
*/
|
|
210
|
+
interface ButtonViewParams<T = any> {
|
|
211
|
+
/** Editor object */
|
|
212
|
+
editor: Editor$2;
|
|
213
|
+
/** Extension object */
|
|
214
|
+
extension: Extension<T>;
|
|
215
|
+
/** Translation function */
|
|
216
|
+
t: (path: string) => string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Represents the ButtonView function.
|
|
220
|
+
*/
|
|
221
|
+
interface ButtonView<T = any> {
|
|
222
|
+
(options: ButtonViewParams<T>): ButtonViewReturn | ButtonViewReturn[];
|
|
223
|
+
}
|
|
224
|
+
interface RichEditorProps {
|
|
225
|
+
/**
|
|
226
|
+
* Input value
|
|
227
|
+
* Can be HTML string or JSON content
|
|
228
|
+
*/
|
|
229
|
+
modelValue?: string | JSONContent$1;
|
|
230
|
+
/**
|
|
231
|
+
* Editor output type
|
|
232
|
+
* - html: outputs HTML string
|
|
233
|
+
* - json: outputs JSON object
|
|
234
|
+
* - text: outputs plain text
|
|
235
|
+
* @default 'html'
|
|
236
|
+
*/
|
|
237
|
+
output?: 'html' | 'json' | 'text';
|
|
238
|
+
/**
|
|
239
|
+
* Dark mode
|
|
240
|
+
* @default undefined - follows system
|
|
241
|
+
*/
|
|
242
|
+
dark?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* Make editor readonly
|
|
245
|
+
* @default false
|
|
246
|
+
*/
|
|
247
|
+
disabled?: boolean;
|
|
248
|
+
/**
|
|
249
|
+
* Hide Editor Toolbar
|
|
250
|
+
* @default false
|
|
251
|
+
*/
|
|
252
|
+
hideToolbar?: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Hide Editor Menubar
|
|
255
|
+
* @default false
|
|
256
|
+
*/
|
|
257
|
+
hideMenubar?: boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Hide Editor Bubble Menu
|
|
260
|
+
* @default false
|
|
261
|
+
*/
|
|
262
|
+
hideBubble?: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Remove tiptap default wrapper when editor is empty eg. <p></p>
|
|
265
|
+
* @default false
|
|
266
|
+
*/
|
|
267
|
+
removeDefaultWrapper?: boolean;
|
|
268
|
+
/**
|
|
269
|
+
* Editor content maximum width
|
|
270
|
+
* Can be number (px) or CSS unit string
|
|
271
|
+
*/
|
|
272
|
+
maxWidth?: string | number;
|
|
273
|
+
/**
|
|
274
|
+
* Editor content minimum height
|
|
275
|
+
* Can be number (px) or CSS unit string
|
|
276
|
+
*/
|
|
277
|
+
minHeight?: string | number;
|
|
278
|
+
/**
|
|
279
|
+
* Editor content maximum height
|
|
280
|
+
* Can be number (px) or CSS unit string
|
|
281
|
+
*/
|
|
282
|
+
maxHeight?: string | number;
|
|
283
|
+
/**
|
|
284
|
+
* Tiptap extensions
|
|
285
|
+
* Used to extend editor functionality
|
|
286
|
+
*/
|
|
287
|
+
extensions?: AnyExtension[];
|
|
288
|
+
/**
|
|
289
|
+
* Editor container class
|
|
290
|
+
* Accepts string, array or object
|
|
291
|
+
*/
|
|
292
|
+
editorClass?: string | string[] | Record<string, any>;
|
|
293
|
+
/**
|
|
294
|
+
* Editor content class
|
|
295
|
+
* Accepts string, array or object
|
|
296
|
+
*/
|
|
297
|
+
contentClass?: string | string[] | Record<string, any>;
|
|
298
|
+
}
|
|
299
|
+
interface RichEditorEmits {
|
|
300
|
+
(event: 'enter'): void;
|
|
301
|
+
(event: 'change', value: RichEditorOnChange): void;
|
|
302
|
+
(event: 'update:modelValue', value: string | JSONContent$1): void;
|
|
303
|
+
}
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region src/components/RichEditor.vue.d.ts
|
|
306
|
+
declare var __VLS_68: {
|
|
307
|
+
editor: Editor$2;
|
|
308
|
+
};
|
|
309
|
+
type __VLS_Slots$1 = {} & {
|
|
310
|
+
footer?: (props: typeof __VLS_68) => any;
|
|
311
|
+
};
|
|
312
|
+
declare const __VLS_base$1: _$vue.DefineComponent<RichEditorProps, {
|
|
313
|
+
editor: Editor$2;
|
|
314
|
+
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {} & {
|
|
315
|
+
enter: () => any;
|
|
316
|
+
change: (value: RichEditorOnChange) => any;
|
|
317
|
+
"update:modelValue": (value: string | JSONContent$1) => any;
|
|
318
|
+
}, string, _$vue.PublicProps, Readonly<RichEditorProps> & Readonly<{
|
|
319
|
+
onEnter?: (() => any) | undefined;
|
|
320
|
+
onChange?: ((value: RichEditorOnChange) => any) | undefined;
|
|
321
|
+
"onUpdate:modelValue"?: ((value: string | JSONContent$1) => any) | undefined;
|
|
322
|
+
}>, {
|
|
323
|
+
modelValue: string | JSONContent$1;
|
|
324
|
+
output: "html" | "json" | "text";
|
|
325
|
+
dark: boolean;
|
|
326
|
+
disabled: boolean;
|
|
327
|
+
hideToolbar: boolean;
|
|
328
|
+
hideMenubar: boolean;
|
|
329
|
+
hideBubble: boolean;
|
|
330
|
+
removeDefaultWrapper: boolean;
|
|
331
|
+
maxWidth: string | number;
|
|
332
|
+
minHeight: string | number;
|
|
333
|
+
maxHeight: string | number;
|
|
334
|
+
extensions: AnyExtension[];
|
|
335
|
+
editorClass: string | string[] | Record<string, any>;
|
|
336
|
+
contentClass: string | string[] | Record<string, any>;
|
|
337
|
+
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
338
|
+
declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
|
|
339
|
+
declare const _default$1: typeof __VLS_export$1;
|
|
340
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
341
|
+
new (): {
|
|
342
|
+
$slots: S;
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/components/ActionButton.vue.d.ts
|
|
347
|
+
interface Props {
|
|
348
|
+
icon?: keyof typeof icons;
|
|
349
|
+
title?: string;
|
|
350
|
+
tooltip?: string;
|
|
351
|
+
disabled?: boolean;
|
|
352
|
+
shortcutKeys?: string[];
|
|
353
|
+
customClass?: string;
|
|
354
|
+
loading?: boolean;
|
|
355
|
+
tooltipOptions?: TooltipContentProps;
|
|
356
|
+
color?: string;
|
|
357
|
+
action?: ButtonViewReturnComponentProps['action'];
|
|
358
|
+
isActive?: ButtonViewReturnComponentProps['isActive'];
|
|
359
|
+
editor?: Editor$1;
|
|
360
|
+
class?: HTMLAttributes['class'];
|
|
361
|
+
}
|
|
362
|
+
declare var __VLS_38: {}, __VLS_40: {};
|
|
363
|
+
type __VLS_Slots = {} & {
|
|
364
|
+
icon?: (props: typeof __VLS_38) => any;
|
|
365
|
+
} & {
|
|
366
|
+
default?: (props: typeof __VLS_40) => any;
|
|
367
|
+
};
|
|
368
|
+
declare const __VLS_base: _$vue.DefineComponent<Props, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
369
|
+
disabled: boolean;
|
|
370
|
+
icon: keyof typeof icons;
|
|
371
|
+
title: string;
|
|
372
|
+
tooltip: string;
|
|
373
|
+
shortcutKeys: string[];
|
|
374
|
+
customClass: string;
|
|
375
|
+
loading: boolean;
|
|
376
|
+
tooltipOptions: TooltipContentProps;
|
|
377
|
+
color: string;
|
|
378
|
+
action: (value?: any) => void;
|
|
379
|
+
isActive: () => boolean;
|
|
380
|
+
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
381
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
382
|
+
declare const _default: typeof __VLS_export;
|
|
383
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
384
|
+
new (): {
|
|
385
|
+
$slots: S;
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region src/extensions/Bold/Bold.d.ts
|
|
390
|
+
interface BoldOptions extends BoldOptions$1, GeneralOptions<BoldOptions> {}
|
|
391
|
+
declare const Bold: _$_tiptap_core0.Mark<BoldOptions, any>;
|
|
392
|
+
//#endregion
|
|
393
|
+
//#region src/extensions/Italic/Italic.d.ts
|
|
394
|
+
interface ItalicOptions extends ItalicOptions$1, GeneralOptions<ItalicOptions> {}
|
|
395
|
+
declare const Italic: _$_tiptap_core0.Mark<ItalicOptions, any>;
|
|
396
|
+
//#endregion
|
|
397
|
+
//#region src/extensions/UnderLine/Underline.d.ts
|
|
398
|
+
interface UnderlineOptions extends UnderlineOptions$1, GeneralOptions<UnderlineOptions> {}
|
|
399
|
+
declare const Underline: _$_tiptap_core0.Mark<UnderlineOptions, any>;
|
|
400
|
+
//#endregion
|
|
401
|
+
//#region src/extensions/Strike/Strike.d.ts
|
|
402
|
+
interface StrikeOptions extends StrikeOptions$1, GeneralOptions<StrikeOptions> {}
|
|
403
|
+
declare const Strike: _$_tiptap_core0.Mark<StrikeOptions, any>;
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region src/extensions/Code/Code.d.ts
|
|
406
|
+
interface CodeOptions extends CodeOptions$1, GeneralOptions<CodeOptions> {}
|
|
407
|
+
declare const Code: _$_tiptap_core0.Mark<CodeOptions, any>;
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region src/extensions/CodeBlock/CodeBlock.d.ts
|
|
410
|
+
interface CodeBlockOptions extends GeneralOptions<CodeBlockOptions> {}
|
|
411
|
+
declare module '@tiptap/core' {
|
|
412
|
+
interface Commands<ReturnType> {
|
|
413
|
+
setCodeBlock: {
|
|
414
|
+
setCodeBlock: (options?: any) => ReturnType;
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Matches a code block with backticks.
|
|
420
|
+
*/
|
|
421
|
+
declare const CodeBlock: Node<any, any>;
|
|
422
|
+
//#endregion
|
|
423
|
+
//#region src/extensions/Heading/Heading.d.ts
|
|
424
|
+
interface HeadingOptions extends HeadingOptions$1, GeneralOptions<HeadingOptions> {}
|
|
425
|
+
declare const Heading: _$_tiptap_core0.Node<HeadingOptions, any>;
|
|
426
|
+
//#endregion
|
|
427
|
+
//#region src/extensions/TextAlign/TextAlign.d.ts
|
|
428
|
+
type Alignments = 'left' | 'center' | 'right' | 'justify';
|
|
429
|
+
/**
|
|
430
|
+
* Represents the interface for text align options, extending TiptapTextAlignOptions and GeneralOptions.
|
|
431
|
+
*/
|
|
432
|
+
interface TextAlignOptions extends TextAlignOptions$1, GeneralOptions<TextAlignOptions> {
|
|
433
|
+
/**
|
|
434
|
+
* List of available alignment options
|
|
435
|
+
*
|
|
436
|
+
* @default ['left', 'center', 'right', 'justify']
|
|
437
|
+
*/
|
|
438
|
+
alignments: Alignments[];
|
|
439
|
+
}
|
|
440
|
+
declare const TextAlign: Extension<TextAlignOptions, any>;
|
|
441
|
+
//#endregion
|
|
442
|
+
//#region src/extensions/FontSize/FontSize.d.ts
|
|
443
|
+
/**
|
|
444
|
+
* Represents the interface for font size options, extending GeneralOptions.
|
|
445
|
+
*/
|
|
446
|
+
interface FontSizeOptions extends GeneralOptions<FontSizeOptions> {
|
|
447
|
+
types: string[];
|
|
448
|
+
/**
|
|
449
|
+
* List of available font size values
|
|
450
|
+
*
|
|
451
|
+
* @default DEFAULT_FONT_SIZE_LIST
|
|
452
|
+
*/
|
|
453
|
+
fontSizes: string[];
|
|
454
|
+
}
|
|
455
|
+
declare module '@tiptap/core' {
|
|
456
|
+
interface Commands<ReturnType> {
|
|
457
|
+
fontSize: {
|
|
458
|
+
/**
|
|
459
|
+
* Set the text font size. ex: "12px", "2em", or "small". Must be a valid
|
|
460
|
+
* CSS font-size
|
|
461
|
+
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
462
|
+
*/
|
|
463
|
+
setFontSize: (fontSize: string) => ReturnType;
|
|
464
|
+
/**
|
|
465
|
+
* Unset the font size
|
|
466
|
+
*/
|
|
467
|
+
unsetFontSize: () => ReturnType;
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
declare const FontSize: Extension<FontSizeOptions, any>;
|
|
472
|
+
//#endregion
|
|
473
|
+
//#region src/extensions/Color/Color.d.ts
|
|
474
|
+
interface ColorOptions extends ColorOptions$1, GeneralOptions<ColorOptions> {}
|
|
475
|
+
declare const Color: _$_tiptap_core0.Extension<ColorOptions, any>;
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region src/extensions/Highlight/Highlight.d.ts
|
|
478
|
+
interface HighlightOptions extends HighlightOptions$1, GeneralOptions<HighlightOptions> {}
|
|
479
|
+
declare const Highlight: _$_tiptap_core0.Mark<HighlightOptions, any>;
|
|
480
|
+
//#endregion
|
|
481
|
+
//#region src/extensions/BulletList/BulletList.d.ts
|
|
482
|
+
interface BulletListOptions extends BulletListOptions$1, GeneralOptions<BulletListOptions> {}
|
|
483
|
+
declare const BulletList: _$_tiptap_core0.Node<BulletListOptions, any>;
|
|
484
|
+
//#endregion
|
|
485
|
+
//#region src/extensions/Clear/Clear.d.ts
|
|
486
|
+
interface ClearOptions extends GeneralOptions<ClearOptions> {}
|
|
487
|
+
declare const Clear: Node<ClearOptions, any>;
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region src/extensions/OrderedList/OrderedList.d.ts
|
|
490
|
+
interface OrderedListOptions extends OrderedListOptions$1, GeneralOptions<OrderedListOptions> {}
|
|
491
|
+
declare const OrderedList: _$_tiptap_core0.Node<OrderedListOptions, any>;
|
|
492
|
+
//#endregion
|
|
493
|
+
//#region src/extensions/TaskList/TaskList.d.ts
|
|
494
|
+
/**
|
|
495
|
+
* Represents the interface for task list options, extending TiptapTaskListOptions and GeneralOptions.
|
|
496
|
+
*/
|
|
497
|
+
interface TaskListOptions extends TaskListOptions$1, GeneralOptions<TaskListOptions> {
|
|
498
|
+
/** options for task items */
|
|
499
|
+
taskItem: Partial<TaskItemOptions>;
|
|
500
|
+
}
|
|
501
|
+
declare const TaskList: _$_tiptap_core0.Node<TaskListOptions, any>;
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/extensions/Blockquote/Blockquote.d.ts
|
|
504
|
+
interface BlockquoteOptions extends BlockquoteOptions$1, GeneralOptions<BlockquoteOptions> {}
|
|
505
|
+
declare const Blockquote: _$_tiptap_core0.Node<BlockquoteOptions, any>;
|
|
506
|
+
//#endregion
|
|
507
|
+
//#region src/extensions/Link/Link.d.ts
|
|
508
|
+
interface LinkOptions extends LinkOptions$1, GeneralOptions<LinkOptions> {}
|
|
509
|
+
declare const Link: _$_tiptap_core0.Mark<LinkOptions, any>;
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region src/extensions/HorizontalRule/HorizontalRule.d.ts
|
|
512
|
+
interface HorizontalRuleOptions extends HorizontalRuleOptions$1, GeneralOptions<HorizontalRuleOptions> {}
|
|
513
|
+
declare const HorizontalRule: _$_tiptap_core0.Node<HorizontalRuleOptions, any>;
|
|
514
|
+
//#endregion
|
|
515
|
+
//#region src/extensions/History/History.d.ts
|
|
516
|
+
interface HistoryOptions extends HistoryOptions$1, GeneralOptions<HistoryOptions> {}
|
|
517
|
+
declare const History: _$_tiptap_core0.Extension<HistoryOptions, any>;
|
|
518
|
+
//#endregion
|
|
519
|
+
//#region src/extensions/Fullscreen/Fullscreen.d.ts
|
|
520
|
+
interface FullscreenOptions extends GeneralOptions<FullscreenOptions> {}
|
|
521
|
+
declare module '@tiptap/core' {
|
|
522
|
+
interface Commands<ReturnType> {
|
|
523
|
+
fullscreen: {
|
|
524
|
+
setFullscreen: () => ReturnType;
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
declare const Fullscreen: Extension<FullscreenOptions, any>;
|
|
529
|
+
//#endregion
|
|
530
|
+
//#region src/extensions/TrailingNode/TrailingNode.d.ts
|
|
531
|
+
/**
|
|
532
|
+
* Extension based on:
|
|
533
|
+
* - https://github.com/ueberdosis/tiptap/blob/v1/packages/tiptap-extensions/src/extensions/TrailingNode.js
|
|
534
|
+
* - https://github.com/remirror/remirror/blob/e0f1bec4a1e8073ce8f5500d62193e52321155b9/packages/prosemirror-trailing-node/src/trailing-node-plugin.ts
|
|
535
|
+
*/
|
|
536
|
+
interface TrailingNodeOptions {
|
|
537
|
+
node: string;
|
|
538
|
+
notAfter: string[];
|
|
539
|
+
}
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region src/components/menus/BasicBubble.d.ts
|
|
542
|
+
/** Represents the size types for bubble images or videos */
|
|
543
|
+
type BubbleImageOrVideoSizeType = 'size-small' | 'size-medium' | 'size-large';
|
|
544
|
+
/** Represents the various types for bubble images */
|
|
545
|
+
type BubbleImageType = `video-${BubbleImageOrVideoSizeType}` | 'image' | 'image-aspect-ratio' | 'remove';
|
|
546
|
+
/** Represents the types for bubble videos */
|
|
547
|
+
type BubbleVideoType = 'video' | 'remove';
|
|
548
|
+
/** Represents the overall types for bubbles */
|
|
549
|
+
type BubbleAllType = BubbleImageType | BubbleVideoType | ExtensionNameKeys | 'divider' | (string & {});
|
|
550
|
+
/** Represents the key types for node types */
|
|
551
|
+
type NodeTypeKey = 'image' | 'text' | 'video';
|
|
552
|
+
/** Represents the menu of bubble types for each node type */
|
|
553
|
+
type BubbleTypeMenu = Partial<Record<NodeTypeKey, BubbleMenuItem[]>>;
|
|
554
|
+
/** Represents the menu of overall bubble types for each node type */
|
|
555
|
+
type NodeTypeMenu = Partial<Record<NodeTypeKey, BubbleAllType[]>>;
|
|
556
|
+
/**
|
|
557
|
+
* Represents the structure of a bubble menu item.
|
|
558
|
+
*/
|
|
559
|
+
interface BubbleMenuItem extends ButtonViewReturn {
|
|
560
|
+
/** The type of the bubble item */
|
|
561
|
+
type: BubbleAllType;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Represents a function to generate a bubble menu
|
|
565
|
+
*/
|
|
566
|
+
interface BubbleView<T = any> {
|
|
567
|
+
/**
|
|
568
|
+
* Generates a bubble menu based on the provided options.
|
|
569
|
+
* @param {ButtonViewParams<T>} options - The options for generating the bubble menu.
|
|
570
|
+
* @returns {BubbleTypeMenu} The generated bubble menu.
|
|
571
|
+
*/
|
|
572
|
+
(options: ButtonViewParams<T>): BubbleTypeMenu;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Represents the options for configuring bubbles.
|
|
576
|
+
* @interface BubbleOptions
|
|
577
|
+
* @template T
|
|
578
|
+
*/
|
|
579
|
+
interface BubbleOptions<T> {
|
|
580
|
+
/** The menu of bubble types for each node type. */
|
|
581
|
+
list: NodeTypeMenu;
|
|
582
|
+
/** The default list of bubble types. */
|
|
583
|
+
defaultBubbleList: typeof defaultBubbleList;
|
|
584
|
+
/** The function to generate a bubble menu. */
|
|
585
|
+
button: BubbleView<T>;
|
|
586
|
+
}
|
|
587
|
+
declare const defaultBubbleList: (editor: Editor$2) => BubbleMenuItem[];
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region src/extensions/TextBubble/TextBubble.d.ts
|
|
590
|
+
interface TextBubbleOptions extends GeneralOptions<TextBubbleOptions> {}
|
|
591
|
+
//#endregion
|
|
592
|
+
//#region src/extensions/BaseKit.d.ts
|
|
593
|
+
/**
|
|
594
|
+
* Represents the interface for options in the base toolkit.
|
|
595
|
+
*/
|
|
596
|
+
interface BaseKitOptions {
|
|
597
|
+
/**
|
|
598
|
+
* Whether to enable the document option
|
|
599
|
+
*
|
|
600
|
+
* @default true
|
|
601
|
+
*/
|
|
602
|
+
document: false;
|
|
603
|
+
/**
|
|
604
|
+
* Whether to enable the text option
|
|
605
|
+
*
|
|
606
|
+
* @default true
|
|
607
|
+
*/
|
|
608
|
+
text: false;
|
|
609
|
+
/**
|
|
610
|
+
* Whether to enable the Gapcursor
|
|
611
|
+
*
|
|
612
|
+
* @default true
|
|
613
|
+
*/
|
|
614
|
+
gapcursor: false;
|
|
615
|
+
/**
|
|
616
|
+
* Dropcursor options or false, indicating whether to enable the drop cursor
|
|
617
|
+
*
|
|
618
|
+
* @default true
|
|
619
|
+
*/
|
|
620
|
+
dropcursor: Partial<DropcursorOptions> | false;
|
|
621
|
+
/**
|
|
622
|
+
* character count options or false, indicating whether to enable character count
|
|
623
|
+
*
|
|
624
|
+
* @default true
|
|
625
|
+
*/
|
|
626
|
+
characterCount: Partial<CharacterCountOptions> | false;
|
|
627
|
+
/**
|
|
628
|
+
* HardBreak options or false, indicating whether to enable hard breaks
|
|
629
|
+
*
|
|
630
|
+
* @default true
|
|
631
|
+
*/
|
|
632
|
+
hardBreak: Partial<HardBreakOptions> | false;
|
|
633
|
+
/**
|
|
634
|
+
* Placeholder options or false, indicating whether to enable placeholders
|
|
635
|
+
*
|
|
636
|
+
* @default true
|
|
637
|
+
*/
|
|
638
|
+
placeholder: Partial<PlaceholderOptions> | false;
|
|
639
|
+
/**
|
|
640
|
+
* Paragraph options or false, indicating whether to enable paragraph functionality
|
|
641
|
+
*
|
|
642
|
+
* @default true
|
|
643
|
+
*/
|
|
644
|
+
paragraph: Partial<ParagraphOptions> | false;
|
|
645
|
+
/**
|
|
646
|
+
* Focus options or false, indicating whether to enable focus functionality
|
|
647
|
+
*
|
|
648
|
+
* @default true
|
|
649
|
+
*/
|
|
650
|
+
focus: Partial<FocusOptions> | false;
|
|
651
|
+
/**
|
|
652
|
+
* ListItem options or false, indicating whether to enable list item functionality
|
|
653
|
+
*
|
|
654
|
+
* @default true
|
|
655
|
+
*/
|
|
656
|
+
listItem: Partial<ListItemOptions> | false;
|
|
657
|
+
/**
|
|
658
|
+
* Text Style options or false, indicating whether to enable text style functionality
|
|
659
|
+
*
|
|
660
|
+
* @default true
|
|
661
|
+
*/
|
|
662
|
+
textStyle: Partial<TextStyleOptions> | false;
|
|
663
|
+
/**
|
|
664
|
+
* Bubble options, taking `BubbleOptions<BaseKitOptions>` as parameters, indicating whether to enable the bubble functionality
|
|
665
|
+
*/
|
|
666
|
+
bubble: Partial<BubbleOptions<BaseKitOptions>>;
|
|
667
|
+
/**
|
|
668
|
+
* Trailing node options or false, indicating whether to enable the trailing node
|
|
669
|
+
*
|
|
670
|
+
* @default true
|
|
671
|
+
*/
|
|
672
|
+
trailingNode: Partial<TrailingNodeOptions> | false;
|
|
673
|
+
/**
|
|
674
|
+
* textBubble options or false, indicating whether to enable the textBubble
|
|
675
|
+
*
|
|
676
|
+
* @default true
|
|
677
|
+
*/
|
|
678
|
+
textBubble: Partial<TextBubbleOptions> | false;
|
|
679
|
+
/**
|
|
680
|
+
* selection options or false, indicating whether to enable the selection
|
|
681
|
+
*
|
|
682
|
+
* @default true
|
|
683
|
+
*/
|
|
684
|
+
selection: any | false;
|
|
685
|
+
/**
|
|
686
|
+
* highlightParagraph options or false, indicating whether to enable the highlightParagraph
|
|
687
|
+
*
|
|
688
|
+
* @default true
|
|
689
|
+
*/
|
|
690
|
+
highlightParagraph: any | false;
|
|
691
|
+
}
|
|
692
|
+
declare const BaseKit: Extension<BaseKitOptions, any>;
|
|
693
|
+
//#endregion
|
|
694
|
+
//#region src/extensions/Subscript/Subscript.d.ts
|
|
695
|
+
/**
|
|
696
|
+
* Represents the interface for subscript and superscript options, extending GeneralOptions.
|
|
697
|
+
*/
|
|
698
|
+
interface SubAndSuperScriptOptions extends GeneralOptions<SubAndSuperScriptOptions> {
|
|
699
|
+
/**
|
|
700
|
+
* subscript options or false, indicating whether subscript is enabled
|
|
701
|
+
*
|
|
702
|
+
* @default true
|
|
703
|
+
*/
|
|
704
|
+
subscript: Partial<SubscriptExtensionOptions> | false;
|
|
705
|
+
/**
|
|
706
|
+
* superscript options or false, indicating whether superscript is enabled
|
|
707
|
+
*
|
|
708
|
+
* @default true
|
|
709
|
+
*/
|
|
710
|
+
superscript: Partial<SuperscriptExtensionOptions> | false;
|
|
711
|
+
}
|
|
712
|
+
declare const SubAndSuperScript: Extension<SubAndSuperScriptOptions, any>;
|
|
713
|
+
//#endregion
|
|
714
|
+
//#region src/extensions/MoreMark/MoreMark.d.ts
|
|
715
|
+
interface MoreMarkOptions extends GeneralOptions<MoreMarkOptions> {
|
|
716
|
+
/**
|
|
717
|
+
* // 下标
|
|
718
|
+
*
|
|
719
|
+
* @default true
|
|
720
|
+
*/
|
|
721
|
+
subscript: Partial<SubscriptExtensionOptions> | false;
|
|
722
|
+
/**
|
|
723
|
+
* // 上标
|
|
724
|
+
*
|
|
725
|
+
* @default true
|
|
726
|
+
*/
|
|
727
|
+
superscript: Partial<SuperscriptExtensionOptions> | false;
|
|
728
|
+
}
|
|
729
|
+
declare const MoreMark: Extension<MoreMarkOptions, any>;
|
|
730
|
+
//#endregion
|
|
731
|
+
//#region src/extensions/Indent/Indent.d.ts
|
|
732
|
+
interface IndentOptions extends GeneralOptions<IndentOptions> {
|
|
733
|
+
types: string[];
|
|
734
|
+
minIndent: number;
|
|
735
|
+
maxIndent: number;
|
|
736
|
+
}
|
|
737
|
+
declare module '@tiptap/core' {
|
|
738
|
+
interface Commands<ReturnType> {
|
|
739
|
+
indent: {
|
|
740
|
+
/**
|
|
741
|
+
* Set the indent attribute
|
|
742
|
+
*/
|
|
743
|
+
indent: () => ReturnType;
|
|
744
|
+
/**
|
|
745
|
+
* Set the outdent attribute
|
|
746
|
+
*/
|
|
747
|
+
outdent: () => ReturnType;
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
declare const Indent: Extension<IndentOptions, any>;
|
|
752
|
+
//#endregion
|
|
753
|
+
//#region src/extensions/LineHeight/LineHeight.d.ts
|
|
754
|
+
interface LineHeightOptions extends GeneralOptions<LineHeightOptions> {
|
|
755
|
+
types: string[];
|
|
756
|
+
lineHeights: string[];
|
|
757
|
+
defaultHeight: string;
|
|
758
|
+
}
|
|
759
|
+
declare module '@tiptap/core' {
|
|
760
|
+
interface Commands<ReturnType> {
|
|
761
|
+
lineHeight: {
|
|
762
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
763
|
+
unsetLineHeight: () => ReturnType;
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
declare const LineHeight: Extension<LineHeightOptions, any>;
|
|
768
|
+
//#endregion
|
|
769
|
+
//#region src/extensions/SlashCommand/SlashCommand.d.ts
|
|
770
|
+
declare const SlashCommand: Extension<any, {
|
|
771
|
+
rect: {
|
|
772
|
+
width: number;
|
|
773
|
+
height: number;
|
|
774
|
+
left: number;
|
|
775
|
+
top: number;
|
|
776
|
+
right: number;
|
|
777
|
+
bottom: number;
|
|
778
|
+
};
|
|
779
|
+
}>;
|
|
780
|
+
//#endregion
|
|
781
|
+
//#region src/extensions/Image/Image.d.ts
|
|
782
|
+
interface SetImageAttrsOptions {
|
|
783
|
+
src?: string;
|
|
784
|
+
/** The alternative text for the image. */
|
|
785
|
+
alt?: string;
|
|
786
|
+
/** The title of the image. */
|
|
787
|
+
title?: string;
|
|
788
|
+
/** The width of the image. */
|
|
789
|
+
width?: number | string | null;
|
|
790
|
+
/** image FlipX */
|
|
791
|
+
flipX?: boolean;
|
|
792
|
+
/** image FlipY */
|
|
793
|
+
flipY?: boolean;
|
|
794
|
+
}
|
|
795
|
+
declare module '@tiptap/core' {
|
|
796
|
+
interface Commands<ReturnType> {
|
|
797
|
+
imageResize: {
|
|
798
|
+
/**
|
|
799
|
+
* Add an image
|
|
800
|
+
*/
|
|
801
|
+
setImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
802
|
+
/**
|
|
803
|
+
* Update an image
|
|
804
|
+
*/
|
|
805
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
declare const Image: _$_tiptap_core0.Node<_$_tiptap_extension_image0.ImageOptions, any>;
|
|
810
|
+
//#endregion
|
|
811
|
+
//#region src/extensions/Video/Video.d.ts
|
|
812
|
+
/**
|
|
813
|
+
* Represents the interface for video options, extending GeneralOptions.
|
|
814
|
+
*/
|
|
815
|
+
interface VideoOptions {
|
|
816
|
+
/**
|
|
817
|
+
* Indicates whether fullscreen play is allowed
|
|
818
|
+
*
|
|
819
|
+
* @default true
|
|
820
|
+
*/
|
|
821
|
+
allowFullscreen: boolean;
|
|
822
|
+
/**
|
|
823
|
+
* Indicates whether to display the frameborder
|
|
824
|
+
*
|
|
825
|
+
* @default false
|
|
826
|
+
*/
|
|
827
|
+
frameborder: boolean;
|
|
828
|
+
/**
|
|
829
|
+
* Width of the video, can be a number or string
|
|
830
|
+
*
|
|
831
|
+
* @default VIDEO_SIZE['size-medium']
|
|
832
|
+
*/
|
|
833
|
+
width: number | string;
|
|
834
|
+
/** HTML attributes object for passing additional attributes */
|
|
835
|
+
HTMLAttributes: {
|
|
836
|
+
[key: string]: any;
|
|
837
|
+
};
|
|
838
|
+
upload?: (file: File) => Promise<string>;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Represents the type for setting video options
|
|
842
|
+
*/
|
|
843
|
+
type SetVideoOptions = {
|
|
844
|
+
/** The source URL of the video */src: string; /** The width of the video */
|
|
845
|
+
width: string | number;
|
|
846
|
+
};
|
|
847
|
+
declare module '@tiptap/core' {
|
|
848
|
+
interface Commands<ReturnType> {
|
|
849
|
+
video: {
|
|
850
|
+
/**
|
|
851
|
+
* Add an video
|
|
852
|
+
*/
|
|
853
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
854
|
+
/**
|
|
855
|
+
* Update an video
|
|
856
|
+
*/
|
|
857
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
declare const Video: Node<VideoOptions, any>;
|
|
862
|
+
//#endregion
|
|
863
|
+
//#region src/extensions/Table/cell-background.d.ts
|
|
864
|
+
type TableCellBackgroundOptions = {
|
|
865
|
+
HTMLAttributes: Record<string, any>;
|
|
866
|
+
types?: any;
|
|
867
|
+
};
|
|
868
|
+
declare module '@tiptap/core' {
|
|
869
|
+
interface Commands<ReturnType> {
|
|
870
|
+
tableCellBackground: {
|
|
871
|
+
setTableCellBackground: (color: string) => ReturnType;
|
|
872
|
+
unsetTableCellBackground: () => ReturnType;
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
//#endregion
|
|
877
|
+
//#region src/extensions/Table/table.d.ts
|
|
878
|
+
interface TableOptions extends GeneralOptions<TableOptions> {
|
|
879
|
+
HTMLAttributes: Record<string, any>;
|
|
880
|
+
resizable: boolean;
|
|
881
|
+
handleWidth: number;
|
|
882
|
+
cellMinWidth: number;
|
|
883
|
+
lastColumnResizable: boolean;
|
|
884
|
+
allowTableNodeSelection: boolean;
|
|
885
|
+
/** options for table rows */
|
|
886
|
+
tableRow: Partial<TableRowOptions>;
|
|
887
|
+
/** options for table headers */
|
|
888
|
+
tableHeader: Partial<TableHeaderOptions>;
|
|
889
|
+
/** options for table cells */
|
|
890
|
+
tableCell: Partial<TableCellOptions>;
|
|
891
|
+
/** options for table cell background */
|
|
892
|
+
tableCellBackground: Partial<TableCellBackgroundOptions>;
|
|
893
|
+
}
|
|
894
|
+
declare const Table: _$_tiptap_core0.Node<TableOptions, any>;
|
|
895
|
+
//#endregion
|
|
896
|
+
//#region src/extensions/AI/AI.d.ts
|
|
897
|
+
interface MenuItem {
|
|
898
|
+
label: string;
|
|
899
|
+
prompt?: string;
|
|
900
|
+
children?: MenuItem[];
|
|
901
|
+
}
|
|
902
|
+
interface AIOptions extends GeneralOptions<AIOptions> {
|
|
903
|
+
completions: (history: Array<{
|
|
904
|
+
role: string;
|
|
905
|
+
content: string;
|
|
906
|
+
}>, signal?: AbortSignal) => Promise<any>;
|
|
907
|
+
/**
|
|
908
|
+
* AI Shortcuts Menu
|
|
909
|
+
*/
|
|
910
|
+
shortcuts: MenuItem[];
|
|
911
|
+
}
|
|
912
|
+
declare const AI: Node<AIOptions, any>;
|
|
913
|
+
//#endregion
|
|
914
|
+
//#region src/extensions/FormatPainter/FormatPainter.d.ts
|
|
915
|
+
/**
|
|
916
|
+
* Represents the interface for font size options, extending GeneralOptions.
|
|
917
|
+
*/
|
|
918
|
+
interface FormatPainterOptions extends GeneralOptions<FormatPainterOptions> {}
|
|
919
|
+
declare module '@tiptap/core' {
|
|
920
|
+
interface Commands<ReturnType> {
|
|
921
|
+
painter: {
|
|
922
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* 格式刷
|
|
928
|
+
*/
|
|
929
|
+
declare const FormatPainter: Extension<FormatPainterOptions, any>;
|
|
930
|
+
//#endregion
|
|
931
|
+
//#region src/extensions/ImportWord/ImportWord.d.ts
|
|
932
|
+
interface ImportWordOptions extends GeneralOptions<ImportWordOptions> {
|
|
933
|
+
/**
|
|
934
|
+
* Function for custom wort to html
|
|
935
|
+
*/
|
|
936
|
+
convert?: (file: File) => Promise<string>;
|
|
937
|
+
/** Function for uploading images */
|
|
938
|
+
upload?: (files: File[]) => Promise<unknown>;
|
|
939
|
+
/**
|
|
940
|
+
* File Size limit
|
|
941
|
+
*
|
|
942
|
+
* @default 1024 * 1024 * 10
|
|
943
|
+
*/
|
|
944
|
+
limit: number;
|
|
945
|
+
}
|
|
946
|
+
declare module '@tiptap/core' {
|
|
947
|
+
interface Commands<ReturnType> {
|
|
948
|
+
importWord: {
|
|
949
|
+
/**
|
|
950
|
+
* toggle import from word
|
|
951
|
+
*/
|
|
952
|
+
toggleImportWord: () => ReturnType;
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
declare const ImportWord: Extension<ImportWordOptions, any>;
|
|
957
|
+
//#endregion
|
|
958
|
+
//#region src/extensions/MultiColumn/Columns.d.ts
|
|
959
|
+
declare enum ColumnLayout {
|
|
960
|
+
SidebarLeft = "sidebar-left",
|
|
961
|
+
SidebarRight = "sidebar-right",
|
|
962
|
+
TwoColumn = "two-column",
|
|
963
|
+
ThreeColumn = "three-column",
|
|
964
|
+
FourColumn = "four-column"
|
|
965
|
+
}
|
|
966
|
+
declare module '@tiptap/core' {
|
|
967
|
+
interface Commands<ReturnType> {
|
|
968
|
+
columns: {
|
|
969
|
+
setColumns: () => ReturnType;
|
|
970
|
+
setThreeColumns: () => ReturnType;
|
|
971
|
+
setFourColumns: () => ReturnType;
|
|
972
|
+
setLayout: (layout: ColumnLayout) => ReturnType;
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
interface ColumnsOptions extends GeneralOptions<ColumnsOptions> {
|
|
977
|
+
columnOptions: any;
|
|
978
|
+
layout: ColumnLayout;
|
|
979
|
+
}
|
|
980
|
+
declare const Columns: Node<ColumnsOptions, any>;
|
|
981
|
+
//#endregion
|
|
982
|
+
//#region src/extensions/ImageUpload/ImageUpload.d.ts
|
|
983
|
+
interface ImageUploadOptions {
|
|
984
|
+
upload: (file: File) => Promise<string>;
|
|
985
|
+
acceptMimes: string[];
|
|
986
|
+
maxSize: number;
|
|
987
|
+
}
|
|
988
|
+
declare module '@tiptap/core' {
|
|
989
|
+
interface Commands<ReturnType> {
|
|
990
|
+
imageUpload: {
|
|
991
|
+
setImageUpload: () => ReturnType;
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
declare const ImageUpload: Node$1<ImageUploadOptions, any>;
|
|
996
|
+
//#endregion
|
|
997
|
+
//#region src/extensions/VideoUpload/VideoUpload.d.ts
|
|
998
|
+
interface VideoOptions$1 {
|
|
999
|
+
upload?: (files: File[]) => void;
|
|
1000
|
+
}
|
|
1001
|
+
declare module '@tiptap/core' {
|
|
1002
|
+
interface Commands<ReturnType> {
|
|
1003
|
+
videoUpload: {
|
|
1004
|
+
setVideoUpload: () => ReturnType;
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
declare const VideoUpload: Node$1<VideoOptions$1, any>;
|
|
1009
|
+
//#endregion
|
|
1010
|
+
//#region src/extensions/FontFamily/FontFamily.d.ts
|
|
1011
|
+
interface FontFamilyOptions extends FontFamilyOptions$1, GeneralOptions<FontFamilyOptions> {
|
|
1012
|
+
fontFamilyMap: {
|
|
1013
|
+
[key: string]: string;
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
declare module '@tiptap/core' {
|
|
1017
|
+
interface Commands<ReturnType> {
|
|
1018
|
+
fontFamily: {
|
|
1019
|
+
/**
|
|
1020
|
+
* Set the text font family.
|
|
1021
|
+
* CSS font-size
|
|
1022
|
+
*
|
|
1023
|
+
*/
|
|
1024
|
+
setFontFamily: (fontFamily: string) => ReturnType;
|
|
1025
|
+
/**
|
|
1026
|
+
* Unset the font family
|
|
1027
|
+
*/
|
|
1028
|
+
unsetFontFamily: () => ReturnType;
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
declare const FontFamily: _$_tiptap_core0.Extension<FontFamilyOptions, any>;
|
|
1033
|
+
//#endregion
|
|
1034
|
+
//#region src/extensions/Preview/Preview.d.ts
|
|
1035
|
+
declare module '@tiptap/core' {
|
|
1036
|
+
interface Commands<ReturnType> {
|
|
1037
|
+
preview: {
|
|
1038
|
+
togglePreview: () => ReturnType;
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
interface PreviewOptions extends GeneralOptions<PreviewOptions> {}
|
|
1043
|
+
declare const Preview: Extension<PreviewOptions, any>;
|
|
1044
|
+
//#endregion
|
|
1045
|
+
//#region src/extensions/FindAndReplace/FindAndReplace.d.ts
|
|
1046
|
+
declare module '@tiptap/core' {
|
|
1047
|
+
interface Commands<ReturnType> {
|
|
1048
|
+
search: {
|
|
1049
|
+
/**
|
|
1050
|
+
* @description Set search term in extension.
|
|
1051
|
+
*/
|
|
1052
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
1053
|
+
/**
|
|
1054
|
+
* @description Set replace term in extension.
|
|
1055
|
+
*/
|
|
1056
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
1057
|
+
/**
|
|
1058
|
+
* @description Set case sensitivity in extension.
|
|
1059
|
+
*/
|
|
1060
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
1061
|
+
/**
|
|
1062
|
+
* @description Reset current search result to first instance.
|
|
1063
|
+
*/
|
|
1064
|
+
resetIndex: () => ReturnType;
|
|
1065
|
+
/**
|
|
1066
|
+
* @description Find next instance of search result.
|
|
1067
|
+
*/
|
|
1068
|
+
nextSearchResult: () => ReturnType;
|
|
1069
|
+
/**
|
|
1070
|
+
* @description Find previous instance of search result.
|
|
1071
|
+
*/
|
|
1072
|
+
previousSearchResult: () => ReturnType;
|
|
1073
|
+
/**
|
|
1074
|
+
* @description Replace first instance of search result with given replace term.
|
|
1075
|
+
*/
|
|
1076
|
+
replace: () => ReturnType;
|
|
1077
|
+
/**
|
|
1078
|
+
* @description Replace all instances of search result with given replace term.
|
|
1079
|
+
*/
|
|
1080
|
+
replaceAll: () => ReturnType;
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
interface FindAndReplaceOptions extends GeneralOptions<FindAndReplaceOptions> {
|
|
1085
|
+
searchResultClass: string;
|
|
1086
|
+
disableRegex: boolean;
|
|
1087
|
+
}
|
|
1088
|
+
interface FindAndReplaceStorage {
|
|
1089
|
+
searchTerm: string;
|
|
1090
|
+
replaceTerm: string;
|
|
1091
|
+
results: Range[];
|
|
1092
|
+
lastSearchTerm: string;
|
|
1093
|
+
caseSensitive: boolean;
|
|
1094
|
+
lastCaseSensitive: boolean;
|
|
1095
|
+
resultIndex: number;
|
|
1096
|
+
lastResultIndex: number;
|
|
1097
|
+
}
|
|
1098
|
+
declare const FindAndReplace: Extension<FindAndReplaceOptions, FindAndReplaceStorage>;
|
|
1099
|
+
//#endregion
|
|
1100
|
+
//#region src/extensions/Printer/Printer.d.ts
|
|
1101
|
+
interface PrinterOptions extends GeneralOptions<PrinterOptions> {}
|
|
1102
|
+
declare const Printer: Extension<PrinterOptions, any>;
|
|
1103
|
+
//#endregion
|
|
1104
|
+
//#region src/extensions/Iframe/Iframe.d.ts
|
|
1105
|
+
interface IframeOptions extends GeneralOptions<IframeOptions> {
|
|
1106
|
+
allowFullscreen: boolean;
|
|
1107
|
+
HTMLAttributes: {
|
|
1108
|
+
[key: string]: any;
|
|
1109
|
+
};
|
|
1110
|
+
}
|
|
1111
|
+
declare module '@tiptap/core' {
|
|
1112
|
+
interface Commands<ReturnType> {
|
|
1113
|
+
iframe: {
|
|
1114
|
+
/**
|
|
1115
|
+
* Add an iframe
|
|
1116
|
+
*/
|
|
1117
|
+
setIframe: (options: {
|
|
1118
|
+
src: string;
|
|
1119
|
+
service: string;
|
|
1120
|
+
}) => ReturnType;
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
declare const Iframe: Node<IframeOptions, any>;
|
|
1125
|
+
//#endregion
|
|
1126
|
+
//#region src/index.d.ts
|
|
1127
|
+
declare const RichEditorPlugin: Plugin;
|
|
1128
|
+
//#endregion
|
|
1129
|
+
export { AI, _default as ActionButton, BaseKit, type BaseKitOptions, Blockquote, type BlockquoteOptions, Bold, type BoldOptions, BulletList, type BulletListOptions, ButtonView, ButtonViewParams, ButtonViewReturn, ButtonViewReturnComponentProps, ButtonViewReturnComponentSlots, Clear, type ClearOptions, Code, CodeBlock, type CodeBlockOptions, type CodeOptions, Color, type ColorOptions, Columns, type ColumnsOptions, type Editor, type EditorInstance, ExtensionNameKeys, FindAndReplace, FontFamily, type FontFamilyOptions, FontSize, type FontSizeOptions, FormatPainter, type FormatPainterOptions, Fullscreen, type FullscreenOptions, GeneralOptions, Heading, type HeadingOptions, Highlight, type HighlightOptions, History, type HistoryOptions, HorizontalRule, type HorizontalRuleOptions, Iframe, type IframeOptions, Image, ImageUpload, type ImageUploadOptions, ImportWord, type ImportWordOptions, Indent, type IndentOptions, Italic, type ItalicOptions, type JSONContent, LineHeight, type LineHeightOptions, Link, type LinkOptions, MoreMark, type MoreMarkOptions, OrderedList, type OrderedListOptions, Preview, type PreviewOptions, Printer, type PrinterOptions, _default$1 as RichEditor, type RichEditorEmits, RichEditorOnChange, RichEditorPlugin, RichEditorPlugin as default, type RichEditorProps, type SetImageAttrsOptions, SlashCommand, Strike, type StrikeOptions, SubAndSuperScript, type SubAndSuperScriptOptions, Table, type TableOptions, TaskList, type TaskListOptions, TextAlign, type TextAlignOptions, Underline, type UnderlineOptions, Video, type VideoOptions, VideoUpload, useEditor };
|