md-editor-v3 2.4.2 → 2.5.0-beta.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 +200 -63
- package/lib/MdEditor/Editor.d.ts +33 -16
- package/lib/MdEditor/config.d.ts +1 -1
- package/lib/MdEditor/index.d.ts +70 -32
- package/lib/MdEditor/type.d.ts +86 -6
- package/lib/md-editor-v3.es.js +322 -177
- package/lib/md-editor-v3.umd.js +36 -36
- package/lib/style.css +1 -1
- package/package.json +10 -11
package/lib/MdEditor/index.d.ts
CHANGED
|
@@ -9,13 +9,13 @@ declare const _default: {
|
|
|
9
9
|
$: import("vue").ComponentInternalInstance;
|
|
10
10
|
$data: {};
|
|
11
11
|
$props: Partial<{
|
|
12
|
+
pageFullscreen: boolean;
|
|
12
13
|
preview: boolean;
|
|
13
14
|
htmlPreview: boolean;
|
|
14
15
|
modelValue: string;
|
|
15
16
|
theme: import("./type").Themes;
|
|
16
17
|
class: string;
|
|
17
18
|
historyLength: number;
|
|
18
|
-
pageFullScreen: boolean;
|
|
19
19
|
previewOnly: boolean;
|
|
20
20
|
language: string;
|
|
21
21
|
toolbars: import("./type").ToolbarNames[];
|
|
@@ -36,6 +36,8 @@ declare const _default: {
|
|
|
36
36
|
footers: import("./type").Footers[];
|
|
37
37
|
scrollAuto: boolean;
|
|
38
38
|
formatCopiedText: (text: string) => string;
|
|
39
|
+
codeStyleReverse: boolean;
|
|
40
|
+
codeStyleReverseList: string[];
|
|
39
41
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
40
42
|
modelValue: {
|
|
41
43
|
type: import("vue").PropType<string>;
|
|
@@ -54,15 +56,15 @@ declare const _default: {
|
|
|
54
56
|
default: number;
|
|
55
57
|
};
|
|
56
58
|
onChange: {
|
|
57
|
-
type: import("vue").PropType<(
|
|
59
|
+
type: import("vue").PropType<import("./type").ChangeEvent>;
|
|
58
60
|
};
|
|
59
61
|
onSave: {
|
|
60
|
-
type: import("vue").PropType<(
|
|
62
|
+
type: import("vue").PropType<import("./type").SaveEvent>;
|
|
61
63
|
};
|
|
62
64
|
onUploadImg: {
|
|
63
|
-
type: import("vue").PropType<(
|
|
65
|
+
type: import("vue").PropType<import("./type").UploadImgEvent>;
|
|
64
66
|
};
|
|
65
|
-
|
|
67
|
+
pageFullscreen: {
|
|
66
68
|
type: import("vue").PropType<boolean>;
|
|
67
69
|
default: boolean;
|
|
68
70
|
};
|
|
@@ -95,10 +97,10 @@ declare const _default: {
|
|
|
95
97
|
default: boolean;
|
|
96
98
|
};
|
|
97
99
|
onHtmlChanged: {
|
|
98
|
-
type: import("vue").PropType<(
|
|
100
|
+
type: import("vue").PropType<import("./type").HtmlChangedEvent>;
|
|
99
101
|
};
|
|
100
102
|
onGetCatalog: {
|
|
101
|
-
type: import("vue").PropType<
|
|
103
|
+
type: import("vue").PropType<import("./type").GetCatalogEvent>;
|
|
102
104
|
};
|
|
103
105
|
editorId: {
|
|
104
106
|
type: import("vue").PropType<string>;
|
|
@@ -148,7 +150,7 @@ declare const _default: {
|
|
|
148
150
|
type: import("vue").PropType<string | JSX.Element>;
|
|
149
151
|
};
|
|
150
152
|
onError: {
|
|
151
|
-
type: import("vue").PropType<
|
|
153
|
+
type: import("vue").PropType<import("./type").ErrorEvent>;
|
|
152
154
|
};
|
|
153
155
|
codeTheme: {
|
|
154
156
|
type: import("vue").PropType<string>;
|
|
@@ -175,7 +177,15 @@ declare const _default: {
|
|
|
175
177
|
noUploadImg: {
|
|
176
178
|
type: import("vue").PropType<boolean>;
|
|
177
179
|
};
|
|
178
|
-
|
|
180
|
+
codeStyleReverse: {
|
|
181
|
+
type: import("vue").PropType<boolean>;
|
|
182
|
+
default: boolean;
|
|
183
|
+
};
|
|
184
|
+
codeStyleReverseList: {
|
|
185
|
+
type: import("vue").PropType<string[]>;
|
|
186
|
+
default: string[];
|
|
187
|
+
};
|
|
188
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "pageFullscreen" | "preview" | "htmlPreview" | "modelValue" | "theme" | "class" | "historyLength" | "previewOnly" | "language" | "toolbars" | "toolbarsExclude" | "noPrettier" | "editorId" | "tabWidth" | "showCodeRowNumber" | "previewTheme" | "style" | "markedHeadingId" | "tableShape" | "noMermaid" | "sanitize" | "placeholder" | "noKatex" | "codeTheme" | "footers" | "scrollAuto" | "formatCopiedText" | "codeStyleReverse" | "codeStyleReverseList">;
|
|
179
189
|
$attrs: {
|
|
180
190
|
[x: string]: unknown;
|
|
181
191
|
};
|
|
@@ -207,15 +217,15 @@ declare const _default: {
|
|
|
207
217
|
default: number;
|
|
208
218
|
};
|
|
209
219
|
onChange: {
|
|
210
|
-
type: import("vue").PropType<(
|
|
220
|
+
type: import("vue").PropType<import("./type").ChangeEvent>;
|
|
211
221
|
};
|
|
212
222
|
onSave: {
|
|
213
|
-
type: import("vue").PropType<(
|
|
223
|
+
type: import("vue").PropType<import("./type").SaveEvent>;
|
|
214
224
|
};
|
|
215
225
|
onUploadImg: {
|
|
216
|
-
type: import("vue").PropType<(
|
|
226
|
+
type: import("vue").PropType<import("./type").UploadImgEvent>;
|
|
217
227
|
};
|
|
218
|
-
|
|
228
|
+
pageFullscreen: {
|
|
219
229
|
type: import("vue").PropType<boolean>;
|
|
220
230
|
default: boolean;
|
|
221
231
|
};
|
|
@@ -248,10 +258,10 @@ declare const _default: {
|
|
|
248
258
|
default: boolean;
|
|
249
259
|
};
|
|
250
260
|
onHtmlChanged: {
|
|
251
|
-
type: import("vue").PropType<(
|
|
261
|
+
type: import("vue").PropType<import("./type").HtmlChangedEvent>;
|
|
252
262
|
};
|
|
253
263
|
onGetCatalog: {
|
|
254
|
-
type: import("vue").PropType<
|
|
264
|
+
type: import("vue").PropType<import("./type").GetCatalogEvent>;
|
|
255
265
|
};
|
|
256
266
|
editorId: {
|
|
257
267
|
type: import("vue").PropType<string>;
|
|
@@ -301,7 +311,7 @@ declare const _default: {
|
|
|
301
311
|
type: import("vue").PropType<string | JSX.Element>;
|
|
302
312
|
};
|
|
303
313
|
onError: {
|
|
304
|
-
type: import("vue").PropType<
|
|
314
|
+
type: import("vue").PropType<import("./type").ErrorEvent>;
|
|
305
315
|
};
|
|
306
316
|
codeTheme: {
|
|
307
317
|
type: import("vue").PropType<string>;
|
|
@@ -328,14 +338,22 @@ declare const _default: {
|
|
|
328
338
|
noUploadImg: {
|
|
329
339
|
type: import("vue").PropType<boolean>;
|
|
330
340
|
};
|
|
341
|
+
codeStyleReverse: {
|
|
342
|
+
type: import("vue").PropType<boolean>;
|
|
343
|
+
default: boolean;
|
|
344
|
+
};
|
|
345
|
+
codeStyleReverseList: {
|
|
346
|
+
type: import("vue").PropType<string[]>;
|
|
347
|
+
default: string[];
|
|
348
|
+
};
|
|
331
349
|
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {
|
|
350
|
+
pageFullscreen: boolean;
|
|
332
351
|
preview: boolean;
|
|
333
352
|
htmlPreview: boolean;
|
|
334
353
|
modelValue: string;
|
|
335
354
|
theme: import("./type").Themes;
|
|
336
355
|
class: string;
|
|
337
356
|
historyLength: number;
|
|
338
|
-
pageFullScreen: boolean;
|
|
339
357
|
previewOnly: boolean;
|
|
340
358
|
language: string;
|
|
341
359
|
toolbars: import("./type").ToolbarNames[];
|
|
@@ -356,6 +374,8 @@ declare const _default: {
|
|
|
356
374
|
footers: import("./type").Footers[];
|
|
357
375
|
scrollAuto: boolean;
|
|
358
376
|
formatCopiedText: (text: string) => string;
|
|
377
|
+
codeStyleReverse: boolean;
|
|
378
|
+
codeStyleReverseList: string[];
|
|
359
379
|
}> & {
|
|
360
380
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
361
381
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -394,15 +414,15 @@ declare const _default: {
|
|
|
394
414
|
default: number;
|
|
395
415
|
};
|
|
396
416
|
onChange: {
|
|
397
|
-
type: import("vue").PropType<(
|
|
417
|
+
type: import("vue").PropType<import("./type").ChangeEvent>;
|
|
398
418
|
};
|
|
399
419
|
onSave: {
|
|
400
|
-
type: import("vue").PropType<(
|
|
420
|
+
type: import("vue").PropType<import("./type").SaveEvent>;
|
|
401
421
|
};
|
|
402
422
|
onUploadImg: {
|
|
403
|
-
type: import("vue").PropType<(
|
|
423
|
+
type: import("vue").PropType<import("./type").UploadImgEvent>;
|
|
404
424
|
};
|
|
405
|
-
|
|
425
|
+
pageFullscreen: {
|
|
406
426
|
type: import("vue").PropType<boolean>;
|
|
407
427
|
default: boolean;
|
|
408
428
|
};
|
|
@@ -435,10 +455,10 @@ declare const _default: {
|
|
|
435
455
|
default: boolean;
|
|
436
456
|
};
|
|
437
457
|
onHtmlChanged: {
|
|
438
|
-
type: import("vue").PropType<(
|
|
458
|
+
type: import("vue").PropType<import("./type").HtmlChangedEvent>;
|
|
439
459
|
};
|
|
440
460
|
onGetCatalog: {
|
|
441
|
-
type: import("vue").PropType<
|
|
461
|
+
type: import("vue").PropType<import("./type").GetCatalogEvent>;
|
|
442
462
|
};
|
|
443
463
|
editorId: {
|
|
444
464
|
type: import("vue").PropType<string>;
|
|
@@ -488,7 +508,7 @@ declare const _default: {
|
|
|
488
508
|
type: import("vue").PropType<string | JSX.Element>;
|
|
489
509
|
};
|
|
490
510
|
onError: {
|
|
491
|
-
type: import("vue").PropType<
|
|
511
|
+
type: import("vue").PropType<import("./type").ErrorEvent>;
|
|
492
512
|
};
|
|
493
513
|
codeTheme: {
|
|
494
514
|
type: import("vue").PropType<string>;
|
|
@@ -515,6 +535,14 @@ declare const _default: {
|
|
|
515
535
|
noUploadImg: {
|
|
516
536
|
type: import("vue").PropType<boolean>;
|
|
517
537
|
};
|
|
538
|
+
codeStyleReverse: {
|
|
539
|
+
type: import("vue").PropType<boolean>;
|
|
540
|
+
default: boolean;
|
|
541
|
+
};
|
|
542
|
+
codeStyleReverseList: {
|
|
543
|
+
type: import("vue").PropType<string[]>;
|
|
544
|
+
default: string[];
|
|
545
|
+
};
|
|
518
546
|
}>> & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & {} & import("vue").ComponentCustomProperties;
|
|
519
547
|
__isFragment?: undefined;
|
|
520
548
|
__isTeleport?: undefined;
|
|
@@ -537,15 +565,15 @@ declare const _default: {
|
|
|
537
565
|
default: number;
|
|
538
566
|
};
|
|
539
567
|
onChange: {
|
|
540
|
-
type: import("vue").PropType<(
|
|
568
|
+
type: import("vue").PropType<import("./type").ChangeEvent>;
|
|
541
569
|
};
|
|
542
570
|
onSave: {
|
|
543
|
-
type: import("vue").PropType<(
|
|
571
|
+
type: import("vue").PropType<import("./type").SaveEvent>;
|
|
544
572
|
};
|
|
545
573
|
onUploadImg: {
|
|
546
|
-
type: import("vue").PropType<(
|
|
574
|
+
type: import("vue").PropType<import("./type").UploadImgEvent>;
|
|
547
575
|
};
|
|
548
|
-
|
|
576
|
+
pageFullscreen: {
|
|
549
577
|
type: import("vue").PropType<boolean>;
|
|
550
578
|
default: boolean;
|
|
551
579
|
};
|
|
@@ -578,10 +606,10 @@ declare const _default: {
|
|
|
578
606
|
default: boolean;
|
|
579
607
|
};
|
|
580
608
|
onHtmlChanged: {
|
|
581
|
-
type: import("vue").PropType<(
|
|
609
|
+
type: import("vue").PropType<import("./type").HtmlChangedEvent>;
|
|
582
610
|
};
|
|
583
611
|
onGetCatalog: {
|
|
584
|
-
type: import("vue").PropType<
|
|
612
|
+
type: import("vue").PropType<import("./type").GetCatalogEvent>;
|
|
585
613
|
};
|
|
586
614
|
editorId: {
|
|
587
615
|
type: import("vue").PropType<string>;
|
|
@@ -631,7 +659,7 @@ declare const _default: {
|
|
|
631
659
|
type: import("vue").PropType<string | JSX.Element>;
|
|
632
660
|
};
|
|
633
661
|
onError: {
|
|
634
|
-
type: import("vue").PropType<
|
|
662
|
+
type: import("vue").PropType<import("./type").ErrorEvent>;
|
|
635
663
|
};
|
|
636
664
|
codeTheme: {
|
|
637
665
|
type: import("vue").PropType<string>;
|
|
@@ -658,14 +686,22 @@ declare const _default: {
|
|
|
658
686
|
noUploadImg: {
|
|
659
687
|
type: import("vue").PropType<boolean>;
|
|
660
688
|
};
|
|
689
|
+
codeStyleReverse: {
|
|
690
|
+
type: import("vue").PropType<boolean>;
|
|
691
|
+
default: boolean;
|
|
692
|
+
};
|
|
693
|
+
codeStyleReverseList: {
|
|
694
|
+
type: import("vue").PropType<string[]>;
|
|
695
|
+
default: string[];
|
|
696
|
+
};
|
|
661
697
|
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue", {
|
|
698
|
+
pageFullscreen: boolean;
|
|
662
699
|
preview: boolean;
|
|
663
700
|
htmlPreview: boolean;
|
|
664
701
|
modelValue: string;
|
|
665
702
|
theme: import("./type").Themes;
|
|
666
703
|
class: string;
|
|
667
704
|
historyLength: number;
|
|
668
|
-
pageFullScreen: boolean;
|
|
669
705
|
previewOnly: boolean;
|
|
670
706
|
language: string;
|
|
671
707
|
toolbars: import("./type").ToolbarNames[];
|
|
@@ -686,6 +722,8 @@ declare const _default: {
|
|
|
686
722
|
footers: import("./type").Footers[];
|
|
687
723
|
scrollAuto: boolean;
|
|
688
724
|
formatCopiedText: (text: string) => string;
|
|
725
|
+
codeStyleReverse: boolean;
|
|
726
|
+
codeStyleReverseList: string[];
|
|
689
727
|
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
690
728
|
readonly NormalToolbar: typeof NormalToolbar;
|
|
691
729
|
readonly DropdownToolbar: typeof DropdownToolbar;
|
package/lib/MdEditor/type.d.ts
CHANGED
|
@@ -58,11 +58,12 @@ export interface StaticTextDefaultValue {
|
|
|
58
58
|
clip2upload: string;
|
|
59
59
|
};
|
|
60
60
|
linkModalTips?: {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
linkTitle?: string;
|
|
62
|
+
imageTitle?: string;
|
|
63
|
+
descLabel?: string;
|
|
64
|
+
descLabelPlaceHolder?: string;
|
|
65
|
+
urlLabel?: string;
|
|
66
|
+
urlLabelPlaceHolder?: string;
|
|
66
67
|
buttonOK?: string;
|
|
67
68
|
};
|
|
68
69
|
clipModalTips?: {
|
|
@@ -101,7 +102,7 @@ export declare type StaticTextDefaultKey = keyof StaticTextDefault;
|
|
|
101
102
|
export declare type ToolbarNames = keyof ToolbarTips | number;
|
|
102
103
|
export declare type Footers = '=' | 'markdownTotal' | 'scrollSwitch' | number;
|
|
103
104
|
export interface SettingType {
|
|
104
|
-
|
|
105
|
+
pageFullscreen: boolean;
|
|
105
106
|
fullscreen: boolean;
|
|
106
107
|
preview: boolean;
|
|
107
108
|
htmlPreview: boolean;
|
|
@@ -237,3 +238,82 @@ export interface CodeCss {
|
|
|
237
238
|
dark: string;
|
|
238
239
|
};
|
|
239
240
|
}
|
|
241
|
+
export declare type UpdateSetting = (k: keyof SettingType, v?: boolean) => void;
|
|
242
|
+
export declare type ChangeEvent = (v: string) => void;
|
|
243
|
+
export declare type SaveEvent = (v: string, h: Promise<string>) => void;
|
|
244
|
+
export declare type UploadImgEvent = (files: Array<File>, callBack: (urls: string[]) => void) => void;
|
|
245
|
+
export declare type HtmlChangedEvent = (h: string) => void;
|
|
246
|
+
export declare type GetCatalogEvent = (list: HeadList[]) => void;
|
|
247
|
+
export declare type ErrorEvent = (err: InnerError) => void;
|
|
248
|
+
export interface ExposeEvent {
|
|
249
|
+
pageFullscreen(status: boolean): void;
|
|
250
|
+
fullscreen(status: boolean): void;
|
|
251
|
+
preview(status: boolean): void;
|
|
252
|
+
htmlPreview(status: boolean): void;
|
|
253
|
+
catalog(status: boolean): void;
|
|
254
|
+
}
|
|
255
|
+
export interface InsertParam {
|
|
256
|
+
targetValue: string;
|
|
257
|
+
select: boolean;
|
|
258
|
+
deviationStart: number;
|
|
259
|
+
deviationEnd: number;
|
|
260
|
+
}
|
|
261
|
+
export declare type InsertContentGenerator = (selectedText: string) => InsertParam;
|
|
262
|
+
export interface ExposeParam {
|
|
263
|
+
/**
|
|
264
|
+
* 添加事件监听
|
|
265
|
+
*
|
|
266
|
+
* @param eventName 事件名称
|
|
267
|
+
* @param callBack 事件回调函数
|
|
268
|
+
*/
|
|
269
|
+
on<E extends keyof ExposeEvent, C extends ExposeEvent[E]>(eventName: E, callBack: C): void;
|
|
270
|
+
/**
|
|
271
|
+
* 切换页面内全屏
|
|
272
|
+
*
|
|
273
|
+
* @param status 是否页面全屏
|
|
274
|
+
*/
|
|
275
|
+
togglePageFullscreen(status?: boolean): void;
|
|
276
|
+
/**
|
|
277
|
+
* 切换屏幕全屏
|
|
278
|
+
*
|
|
279
|
+
* @param status 是否屏幕全屏
|
|
280
|
+
*/
|
|
281
|
+
toggleFullscreen(status?: boolean): void;
|
|
282
|
+
/**
|
|
283
|
+
* 切换是否显示预览
|
|
284
|
+
*
|
|
285
|
+
* @param status 是否显示预览
|
|
286
|
+
*/
|
|
287
|
+
togglePreview(status?: boolean): void;
|
|
288
|
+
/**
|
|
289
|
+
* 切换是否显示html预览
|
|
290
|
+
*
|
|
291
|
+
* @param status html预览状态
|
|
292
|
+
*/
|
|
293
|
+
toggleHtmlPreview(status?: boolean): void;
|
|
294
|
+
/**
|
|
295
|
+
* 切换是否显示目录
|
|
296
|
+
*
|
|
297
|
+
* @param status 是否显示目录,不设置默认相反
|
|
298
|
+
*/
|
|
299
|
+
toggleCatalog(status?: boolean): void;
|
|
300
|
+
/**
|
|
301
|
+
* 触发保存
|
|
302
|
+
*/
|
|
303
|
+
triggerSave(): void;
|
|
304
|
+
/**
|
|
305
|
+
* 手动向文本框插入内容
|
|
306
|
+
*
|
|
307
|
+
* @param {Function} generate 构造插入内容方法
|
|
308
|
+
* 构造方法提供「当前选中」的内容为入参
|
|
309
|
+
* 返回「待插入内容」和插入的属性
|
|
310
|
+
* 入参 selectedText 当前选中的内容
|
|
311
|
+
*
|
|
312
|
+
* targetValue 待插入内容
|
|
313
|
+
* select 插入后是否自动选中内容
|
|
314
|
+
* deviationStart 插入后选中位置的开始偏移量
|
|
315
|
+
* deviationEnd 插入后选中位置的结束偏移量
|
|
316
|
+
*
|
|
317
|
+
*/
|
|
318
|
+
insert(generate: InsertContentGenerator): void;
|
|
319
|
+
}
|