md-editor-v3 4.9.0 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -3
- package/lib/cjs/MdEditor.cjs +3 -3
- package/lib/cjs/chunks/config.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +7 -7
- package/lib/es/MdEditor.mjs +54 -52
- package/lib/es/chunks/config.mjs +29 -28
- package/lib/es/chunks/index.mjs +303 -287
- package/lib/types/MdEditor/Editor.d.ts +9 -0
- package/lib/types/MdEditor/index.d.ts +15 -0
- package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +6 -0
- package/lib/types/MdEditor/layouts/Content/index.d.ts +6 -0
- package/lib/types/MdEditor/layouts/Content/props.d.ts +6 -0
- package/lib/types/MdEditor/props.d.ts +8 -0
- package/lib/types/MdEditor/type.d.ts +16 -5
- package/lib/types/MdPreview/MdPreview.d.ts +9 -0
- package/lib/types/MdPreview/index.d.ts +15 -0
- package/lib/umd/index.js +6 -6
- package/package.json +1 -1
|
@@ -190,6 +190,10 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
190
190
|
type: import("vue").PropType<import('./type').CustomIcon>;
|
|
191
191
|
default: {};
|
|
192
192
|
};
|
|
193
|
+
sanitizeMermaid: {
|
|
194
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
195
|
+
default: (h: string) => Promise<string>;
|
|
196
|
+
};
|
|
193
197
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('./type').EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onInputBoxWitdhChange" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
194
198
|
onChange: {
|
|
195
199
|
type: import("vue").PropType<import('./type').ChangeEvent>;
|
|
@@ -382,6 +386,10 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
382
386
|
type: import("vue").PropType<import('./type').CustomIcon>;
|
|
383
387
|
default: {};
|
|
384
388
|
};
|
|
389
|
+
sanitizeMermaid: {
|
|
390
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
391
|
+
default: (h: string) => Promise<string>;
|
|
392
|
+
};
|
|
385
393
|
}>> & {
|
|
386
394
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
387
395
|
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
@@ -428,5 +436,6 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
428
436
|
noHighlight: boolean;
|
|
429
437
|
noImgZoomIn: boolean;
|
|
430
438
|
customIcon: import('./type').CustomIcon;
|
|
439
|
+
sanitizeMermaid: (h: string) => Promise<string>;
|
|
431
440
|
}, {}>;
|
|
432
441
|
export default Editor;
|
|
@@ -36,6 +36,7 @@ declare const _default: {
|
|
|
36
36
|
noHighlight?: boolean | undefined;
|
|
37
37
|
noImgZoomIn?: boolean | undefined;
|
|
38
38
|
customIcon?: import("./type").CustomIcon | undefined;
|
|
39
|
+
sanitizeMermaid?: ((h: string) => Promise<string>) | undefined;
|
|
39
40
|
readonly onChange?: import("./type").ChangeEvent | undefined;
|
|
40
41
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
41
42
|
ref?: import("vue").VNodeRef | undefined;
|
|
@@ -317,6 +318,10 @@ declare const _default: {
|
|
|
317
318
|
type: import("vue").PropType<import("./type").CustomIcon>;
|
|
318
319
|
default: {};
|
|
319
320
|
};
|
|
321
|
+
sanitizeMermaid: {
|
|
322
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
323
|
+
default: (h: string) => Promise<string>;
|
|
324
|
+
};
|
|
320
325
|
}>> & {
|
|
321
326
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
322
327
|
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
@@ -363,6 +368,7 @@ declare const _default: {
|
|
|
363
368
|
noHighlight: boolean;
|
|
364
369
|
noImgZoomIn: boolean;
|
|
365
370
|
customIcon: import("./type").CustomIcon;
|
|
371
|
+
sanitizeMermaid: (h: string) => Promise<string>;
|
|
366
372
|
}, {}, string, {}> & {
|
|
367
373
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
368
374
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -575,6 +581,10 @@ declare const _default: {
|
|
|
575
581
|
type: import("vue").PropType<import("./type").CustomIcon>;
|
|
576
582
|
default: {};
|
|
577
583
|
};
|
|
584
|
+
sanitizeMermaid: {
|
|
585
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
586
|
+
default: (h: string) => Promise<string>;
|
|
587
|
+
};
|
|
578
588
|
}>> & {
|
|
579
589
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
580
590
|
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
@@ -784,6 +794,10 @@ declare const _default: {
|
|
|
784
794
|
type: import("vue").PropType<import("./type").CustomIcon>;
|
|
785
795
|
default: {};
|
|
786
796
|
};
|
|
797
|
+
sanitizeMermaid: {
|
|
798
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
799
|
+
default: (h: string) => Promise<string>;
|
|
800
|
+
};
|
|
787
801
|
}>> & {
|
|
788
802
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
789
803
|
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
@@ -830,6 +844,7 @@ declare const _default: {
|
|
|
830
844
|
noHighlight: boolean;
|
|
831
845
|
noImgZoomIn: boolean;
|
|
832
846
|
customIcon: import("./type").CustomIcon;
|
|
847
|
+
sanitizeMermaid: (h: string) => Promise<string>;
|
|
833
848
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
834
849
|
install: (app: App) => App;
|
|
835
850
|
};
|
|
@@ -50,6 +50,9 @@ declare const ContentPreview: import("vue").DefineComponent<{
|
|
|
50
50
|
noImgZoomIn: {
|
|
51
51
|
type: import("vue").PropType<boolean>;
|
|
52
52
|
};
|
|
53
|
+
sanitizeMermaid: {
|
|
54
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
55
|
+
};
|
|
53
56
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
54
57
|
modelValue: {
|
|
55
58
|
type: import("vue").PropType<string>;
|
|
@@ -98,6 +101,9 @@ declare const ContentPreview: import("vue").DefineComponent<{
|
|
|
98
101
|
noImgZoomIn: {
|
|
99
102
|
type: import("vue").PropType<boolean>;
|
|
100
103
|
};
|
|
104
|
+
sanitizeMermaid: {
|
|
105
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
106
|
+
};
|
|
101
107
|
}>>, {
|
|
102
108
|
mdHeadingId: import('../../type').MdHeadingId;
|
|
103
109
|
modelValue: string;
|
|
@@ -106,6 +106,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
106
106
|
noImgZoomIn: {
|
|
107
107
|
type: import("vue").PropType<boolean>;
|
|
108
108
|
};
|
|
109
|
+
sanitizeMermaid: {
|
|
110
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
111
|
+
};
|
|
109
112
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
110
113
|
onChange: {
|
|
111
114
|
type: import("vue").PropType<(v: string) => void>;
|
|
@@ -214,6 +217,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
214
217
|
noImgZoomIn: {
|
|
215
218
|
type: import("vue").PropType<boolean>;
|
|
216
219
|
};
|
|
220
|
+
sanitizeMermaid: {
|
|
221
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
222
|
+
};
|
|
217
223
|
}>>, {
|
|
218
224
|
onChange: (v: string) => void;
|
|
219
225
|
theme: import("../../type").Themes;
|
|
@@ -50,6 +50,9 @@ export declare const contentPreviewProps: {
|
|
|
50
50
|
noImgZoomIn: {
|
|
51
51
|
type: PropType<boolean>;
|
|
52
52
|
};
|
|
53
|
+
sanitizeMermaid: {
|
|
54
|
+
type: PropType<(h: string) => Promise<string>>;
|
|
55
|
+
};
|
|
53
56
|
};
|
|
54
57
|
export declare const contentProps: {
|
|
55
58
|
onChange: {
|
|
@@ -165,5 +168,8 @@ export declare const contentProps: {
|
|
|
165
168
|
noImgZoomIn: {
|
|
166
169
|
type: PropType<boolean>;
|
|
167
170
|
};
|
|
171
|
+
sanitizeMermaid: {
|
|
172
|
+
type: PropType<(h: string) => Promise<string>>;
|
|
173
|
+
};
|
|
168
174
|
};
|
|
169
175
|
export type ContentProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof contentProps>>>>;
|
|
@@ -186,6 +186,10 @@ export declare const mdPreviewProps: {
|
|
|
186
186
|
type: PropType<CustomIcon>;
|
|
187
187
|
default: {};
|
|
188
188
|
};
|
|
189
|
+
sanitizeMermaid: {
|
|
190
|
+
type: PropType<(h: string) => Promise<string>>;
|
|
191
|
+
default: (h: string) => Promise<string>;
|
|
192
|
+
};
|
|
189
193
|
};
|
|
190
194
|
export declare const editorProps: {
|
|
191
195
|
/**
|
|
@@ -617,6 +621,10 @@ export declare const editorProps: {
|
|
|
617
621
|
type: PropType<CustomIcon>;
|
|
618
622
|
default: {};
|
|
619
623
|
};
|
|
624
|
+
sanitizeMermaid: {
|
|
625
|
+
type: PropType<(h: string) => Promise<string>>;
|
|
626
|
+
default: (h: string) => Promise<string>;
|
|
627
|
+
};
|
|
620
628
|
};
|
|
621
629
|
export declare const mdPreviewEmits: EditorEmits;
|
|
622
630
|
export declare const editorEmits: EditorEmits;
|
|
@@ -238,20 +238,31 @@ export interface ConfigOption {
|
|
|
238
238
|
/**
|
|
239
239
|
* 自定义markdown-it核心库扩展、属性等
|
|
240
240
|
*/
|
|
241
|
-
markdownItConfig: (md: markdownit
|
|
241
|
+
markdownItConfig: (md: markdownit, options: {
|
|
242
|
+
editorId: string;
|
|
243
|
+
}) => void;
|
|
242
244
|
/**
|
|
243
245
|
* 挑选编辑器已预设的markdownIt的扩展
|
|
244
246
|
*
|
|
245
247
|
* @param plugins markdownIt的扩展,带编辑器已设定的属性
|
|
246
248
|
* @returns plugins
|
|
247
249
|
*/
|
|
248
|
-
markdownItPlugins: (plugins: Array<MarkdownItConfigPlugin
|
|
250
|
+
markdownItPlugins: (plugins: Array<MarkdownItConfigPlugin>, options: {
|
|
251
|
+
editorId: string;
|
|
252
|
+
}) => Array<MarkdownItConfigPlugin>;
|
|
249
253
|
/**
|
|
250
254
|
* 如果使用内部的图标,可以切换展示的方式
|
|
251
255
|
*
|
|
252
256
|
* 以规避某些问题,例如Shadow Dom对Svg use的支持问题
|
|
253
257
|
*/
|
|
254
258
|
iconfontType: 'svg' | 'class';
|
|
259
|
+
/**
|
|
260
|
+
* mermaid配置项
|
|
261
|
+
*
|
|
262
|
+
* @param base
|
|
263
|
+
* @returns
|
|
264
|
+
*/
|
|
265
|
+
mermaidConfig: (base: any) => any;
|
|
255
266
|
}
|
|
256
267
|
/**
|
|
257
268
|
* 扩展编辑器内部功能,包括marked和一些内部依赖实例,如highlight、cropper等
|
|
@@ -287,9 +298,9 @@ export interface ExposeEvent {
|
|
|
287
298
|
}
|
|
288
299
|
export interface InsertParam {
|
|
289
300
|
targetValue: string;
|
|
290
|
-
select
|
|
291
|
-
deviationStart
|
|
292
|
-
deviationEnd
|
|
301
|
+
select?: boolean;
|
|
302
|
+
deviationStart?: number;
|
|
303
|
+
deviationEnd?: number;
|
|
293
304
|
}
|
|
294
305
|
/**
|
|
295
306
|
* 插入的内容的构造函数
|
|
@@ -84,6 +84,10 @@ declare const MdPreview: import("vue").DefineComponent<{
|
|
|
84
84
|
type: import("vue").PropType<import('../MdEditor/type').CustomIcon>;
|
|
85
85
|
default: {};
|
|
86
86
|
};
|
|
87
|
+
sanitizeMermaid: {
|
|
88
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
89
|
+
default: (h: string) => Promise<string>;
|
|
90
|
+
};
|
|
87
91
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('../MdEditor/type').EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onInputBoxWitdhChange" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
88
92
|
modelValue: {
|
|
89
93
|
type: import("vue").PropType<string>;
|
|
@@ -170,6 +174,10 @@ declare const MdPreview: import("vue").DefineComponent<{
|
|
|
170
174
|
type: import("vue").PropType<import('../MdEditor/type').CustomIcon>;
|
|
171
175
|
default: {};
|
|
172
176
|
};
|
|
177
|
+
sanitizeMermaid: {
|
|
178
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
179
|
+
default: (h: string) => Promise<string>;
|
|
180
|
+
};
|
|
173
181
|
}>> & {
|
|
174
182
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
175
183
|
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
@@ -203,5 +211,6 @@ declare const MdPreview: import("vue").DefineComponent<{
|
|
|
203
211
|
noHighlight: boolean;
|
|
204
212
|
noImgZoomIn: boolean;
|
|
205
213
|
customIcon: import('../MdEditor/type').CustomIcon;
|
|
214
|
+
sanitizeMermaid: (h: string) => Promise<string>;
|
|
206
215
|
}, {}>;
|
|
207
216
|
export default MdPreview;
|
|
@@ -23,6 +23,7 @@ declare const _default: {
|
|
|
23
23
|
noHighlight?: boolean | undefined;
|
|
24
24
|
noImgZoomIn?: boolean | undefined;
|
|
25
25
|
customIcon?: import("..").CustomIcon | undefined;
|
|
26
|
+
sanitizeMermaid?: ((h: string) => Promise<string>) | undefined;
|
|
26
27
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
27
28
|
ref?: import("vue").VNodeRef | undefined;
|
|
28
29
|
key?: string | number | symbol | undefined;
|
|
@@ -180,6 +181,10 @@ declare const _default: {
|
|
|
180
181
|
type: import("vue").PropType<import("..").CustomIcon>;
|
|
181
182
|
default: {};
|
|
182
183
|
};
|
|
184
|
+
sanitizeMermaid: {
|
|
185
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
186
|
+
default: (h: string) => Promise<string>;
|
|
187
|
+
};
|
|
183
188
|
}>> & {
|
|
184
189
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
185
190
|
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
@@ -213,6 +218,7 @@ declare const _default: {
|
|
|
213
218
|
noHighlight: boolean;
|
|
214
219
|
noImgZoomIn: boolean;
|
|
215
220
|
customIcon: import("..").CustomIcon;
|
|
221
|
+
sanitizeMermaid: (h: string) => Promise<string>;
|
|
216
222
|
}, {}, string, {}> & {
|
|
217
223
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
218
224
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -319,6 +325,10 @@ declare const _default: {
|
|
|
319
325
|
type: import("vue").PropType<import("..").CustomIcon>;
|
|
320
326
|
default: {};
|
|
321
327
|
};
|
|
328
|
+
sanitizeMermaid: {
|
|
329
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
330
|
+
default: (h: string) => Promise<string>;
|
|
331
|
+
};
|
|
322
332
|
}>> & {
|
|
323
333
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
324
334
|
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
@@ -422,6 +432,10 @@ declare const _default: {
|
|
|
422
432
|
type: import("vue").PropType<import("..").CustomIcon>;
|
|
423
433
|
default: {};
|
|
424
434
|
};
|
|
435
|
+
sanitizeMermaid: {
|
|
436
|
+
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
437
|
+
default: (h: string) => Promise<string>;
|
|
438
|
+
};
|
|
425
439
|
}>> & {
|
|
426
440
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
427
441
|
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
@@ -455,6 +469,7 @@ declare const _default: {
|
|
|
455
469
|
noHighlight: boolean;
|
|
456
470
|
noImgZoomIn: boolean;
|
|
457
471
|
customIcon: import("..").CustomIcon;
|
|
472
|
+
sanitizeMermaid: (h: string) => Promise<string>;
|
|
458
473
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
459
474
|
install: (app: App) => App;
|
|
460
475
|
};
|