md-editor-v3 2.0.0-beta.1 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +551 -530
- package/lib/MdEditor/Editor.d.ts +4 -7
- package/lib/MdEditor/extensions/DropdownToolbar.d.ts +1 -4
- package/lib/MdEditor/extensions/{Catalog → MdCatalog}/CatalogLink.d.ts +0 -0
- package/lib/MdEditor/extensions/{Catalog → MdCatalog}/index.d.ts +2 -2
- package/lib/MdEditor/extensions/ModalToolbar.d.ts +1 -10
- package/lib/MdEditor/extensions/NormalToolbar.d.ts +1 -4
- package/lib/MdEditor/index.d.ts +15 -20
- package/lib/MdEditor/type.d.ts +6 -1
- package/lib/md-editor-v3.es.js +107 -97
- package/lib/md-editor-v3.umd.js +39 -39
- package/lib/style.css +1 -1
- package/package.json +132 -132
package/lib/MdEditor/Editor.d.ts
CHANGED
|
@@ -114,13 +114,12 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
114
114
|
};
|
|
115
115
|
onError: {
|
|
116
116
|
type: PropType<(err: InnerError) => void>;
|
|
117
|
-
default: () => () => void;
|
|
118
117
|
};
|
|
119
|
-
|
|
118
|
+
codeTheme: {
|
|
120
119
|
type: PropType<string>;
|
|
121
120
|
default: string;
|
|
122
121
|
};
|
|
123
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
122
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onSave" | "onChange" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
124
123
|
modelValue: {
|
|
125
124
|
type: PropType<string>;
|
|
126
125
|
default: string;
|
|
@@ -233,9 +232,8 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
233
232
|
};
|
|
234
233
|
onError: {
|
|
235
234
|
type: PropType<(err: InnerError) => void>;
|
|
236
|
-
default: () => () => void;
|
|
237
235
|
};
|
|
238
|
-
|
|
236
|
+
codeTheme: {
|
|
239
237
|
type: PropType<string>;
|
|
240
238
|
default: string;
|
|
241
239
|
};
|
|
@@ -263,7 +261,6 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
263
261
|
sanitize: (html: string) => string;
|
|
264
262
|
placeholder: string;
|
|
265
263
|
noKatex: boolean;
|
|
266
|
-
|
|
267
|
-
codeCssName: string;
|
|
264
|
+
codeTheme: string;
|
|
268
265
|
}>;
|
|
269
266
|
export default Editor;
|
|
@@ -12,12 +12,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
12
12
|
};
|
|
13
13
|
onChange: {
|
|
14
14
|
type: PropType<(visible: boolean) => void>;
|
|
15
|
-
default: () => () => void;
|
|
16
15
|
};
|
|
17
16
|
overlay: {
|
|
18
17
|
type: PropType<string | JSX.Element>;
|
|
19
18
|
};
|
|
20
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
19
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
20
|
title: {
|
|
22
21
|
type: PropType<string>;
|
|
23
22
|
default: string;
|
|
@@ -30,13 +29,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
29
|
};
|
|
31
30
|
onChange: {
|
|
32
31
|
type: PropType<(visible: boolean) => void>;
|
|
33
|
-
default: () => () => void;
|
|
34
32
|
};
|
|
35
33
|
overlay: {
|
|
36
34
|
type: PropType<string | JSX.Element>;
|
|
37
35
|
};
|
|
38
36
|
}>>, {
|
|
39
37
|
title: string;
|
|
40
|
-
onChange: (visible: boolean) => void;
|
|
41
38
|
}>;
|
|
42
39
|
export default _default;
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ export interface TocItem {
|
|
|
5
5
|
level: number;
|
|
6
6
|
children?: Array<TocItem>;
|
|
7
7
|
}
|
|
8
|
-
declare const
|
|
8
|
+
declare const MdCatalog: import("vue").DefineComponent<{
|
|
9
9
|
editorId: {
|
|
10
10
|
type: PropType<string>;
|
|
11
11
|
};
|
|
@@ -48,4 +48,4 @@ declare const Catalog: import("vue").DefineComponent<{
|
|
|
48
48
|
class: string;
|
|
49
49
|
markedHeadingId: MarkedHeadingId;
|
|
50
50
|
}>;
|
|
51
|
-
export default
|
|
51
|
+
export default MdCatalog;
|
|
@@ -24,11 +24,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
24
|
};
|
|
25
25
|
onClick: {
|
|
26
26
|
type: PropType<() => void>;
|
|
27
|
-
default: () => () => void;
|
|
28
27
|
};
|
|
29
28
|
onClose: {
|
|
30
29
|
type: PropType<() => void>;
|
|
31
|
-
default: () => () => void;
|
|
32
30
|
};
|
|
33
31
|
/**
|
|
34
32
|
* 显示全屏按钮
|
|
@@ -43,9 +41,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
43
41
|
};
|
|
44
42
|
onAdjust: {
|
|
45
43
|
type: PropType<(val: boolean) => void>;
|
|
46
|
-
default: () => () => void;
|
|
47
44
|
};
|
|
48
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
45
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onClick" | "onClose" | "onAdjust", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
49
46
|
title: {
|
|
50
47
|
type: PropType<string>;
|
|
51
48
|
default: string;
|
|
@@ -70,11 +67,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
70
67
|
};
|
|
71
68
|
onClick: {
|
|
72
69
|
type: PropType<() => void>;
|
|
73
|
-
default: () => () => void;
|
|
74
70
|
};
|
|
75
71
|
onClose: {
|
|
76
72
|
type: PropType<() => void>;
|
|
77
|
-
default: () => () => void;
|
|
78
73
|
};
|
|
79
74
|
/**
|
|
80
75
|
* 显示全屏按钮
|
|
@@ -89,17 +84,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
89
84
|
};
|
|
90
85
|
onAdjust: {
|
|
91
86
|
type: PropType<(val: boolean) => void>;
|
|
92
|
-
default: () => () => void;
|
|
93
87
|
};
|
|
94
88
|
}>>, {
|
|
95
89
|
title: string;
|
|
96
|
-
onClick: () => void;
|
|
97
90
|
modalTitle: string;
|
|
98
91
|
width: string;
|
|
99
92
|
height: string;
|
|
100
|
-
onClose: () => void;
|
|
101
93
|
showAdjust: boolean;
|
|
102
94
|
isFullscreen: boolean;
|
|
103
|
-
onAdjust: (val: boolean) => void;
|
|
104
95
|
}>;
|
|
105
96
|
export default _default;
|
|
@@ -9,9 +9,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9
9
|
};
|
|
10
10
|
onClick: {
|
|
11
11
|
type: PropType<(e: MouseEvent) => void>;
|
|
12
|
-
default: () => () => void;
|
|
13
12
|
};
|
|
14
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
13
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
14
|
title: {
|
|
16
15
|
type: PropType<string>;
|
|
17
16
|
default: string;
|
|
@@ -21,10 +20,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
21
20
|
};
|
|
22
21
|
onClick: {
|
|
23
22
|
type: PropType<(e: MouseEvent) => void>;
|
|
24
|
-
default: () => () => void;
|
|
25
23
|
};
|
|
26
24
|
}>>, {
|
|
27
25
|
title: string;
|
|
28
|
-
onClick: (e: MouseEvent) => void;
|
|
29
26
|
}>;
|
|
30
27
|
export default _default;
|
package/lib/MdEditor/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
1
2
|
import NormalToolbar from './extensions/NormalToolbar';
|
|
2
3
|
import DropdownToolbar from './extensions/DropdownToolbar';
|
|
3
|
-
import
|
|
4
|
+
import MdCatalog from './extensions/MdCatalog';
|
|
4
5
|
import ModalToolbar from './extensions/ModalToolbar';
|
|
5
6
|
import configFn from './utils/config';
|
|
6
7
|
declare const _default: {
|
|
@@ -31,8 +32,7 @@ declare const _default: {
|
|
|
31
32
|
sanitize: (html: string) => string;
|
|
32
33
|
placeholder: string;
|
|
33
34
|
noKatex: boolean;
|
|
34
|
-
|
|
35
|
-
codeCssName: string;
|
|
35
|
+
codeTheme: string;
|
|
36
36
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
37
37
|
modelValue: {
|
|
38
38
|
type: import("vue").PropType<string>;
|
|
@@ -146,13 +146,12 @@ declare const _default: {
|
|
|
146
146
|
};
|
|
147
147
|
onError: {
|
|
148
148
|
type: import("vue").PropType<(err: import("./type").InnerError) => void>;
|
|
149
|
-
default: () => () => void;
|
|
150
149
|
};
|
|
151
|
-
|
|
150
|
+
codeTheme: {
|
|
152
151
|
type: import("vue").PropType<string>;
|
|
153
152
|
default: string;
|
|
154
153
|
};
|
|
155
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "editorId" | "preview" | "htmlPreview" | "tabWidth" | "theme" | "historyLength" | "previewOnly" | "showCodeRowNumber" | "previewTheme" | "noPrettier" | "style" | "class" | "modelValue" | "pageFullScreen" | "language" | "toolbars" | "toolbarsExclude" | "markedHeadingId" | "tableShape" | "noMermaid" | "sanitize" | "placeholder" | "noKatex" | "
|
|
154
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "editorId" | "preview" | "htmlPreview" | "tabWidth" | "theme" | "historyLength" | "previewOnly" | "showCodeRowNumber" | "previewTheme" | "noPrettier" | "style" | "class" | "modelValue" | "pageFullScreen" | "language" | "toolbars" | "toolbarsExclude" | "markedHeadingId" | "tableShape" | "noMermaid" | "sanitize" | "placeholder" | "noKatex" | "codeTheme">;
|
|
156
155
|
$attrs: {
|
|
157
156
|
[x: string]: unknown;
|
|
158
157
|
};
|
|
@@ -164,7 +163,7 @@ declare const _default: {
|
|
|
164
163
|
}>;
|
|
165
164
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
166
165
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
167
|
-
$emit: (event: string, ...args: any[]) => void;
|
|
166
|
+
$emit: ((event: string, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
|
|
168
167
|
$el: any;
|
|
169
168
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
170
169
|
modelValue: {
|
|
@@ -279,13 +278,12 @@ declare const _default: {
|
|
|
279
278
|
};
|
|
280
279
|
onError: {
|
|
281
280
|
type: import("vue").PropType<(err: import("./type").InnerError) => void>;
|
|
282
|
-
default: () => () => void;
|
|
283
281
|
};
|
|
284
|
-
|
|
282
|
+
codeTheme: {
|
|
285
283
|
type: import("vue").PropType<string>;
|
|
286
284
|
default: string;
|
|
287
285
|
};
|
|
288
|
-
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
286
|
+
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {
|
|
289
287
|
editorId: string;
|
|
290
288
|
preview: boolean;
|
|
291
289
|
htmlPreview: boolean;
|
|
@@ -309,8 +307,7 @@ declare const _default: {
|
|
|
309
307
|
sanitize: (html: string) => string;
|
|
310
308
|
placeholder: string;
|
|
311
309
|
noKatex: boolean;
|
|
312
|
-
|
|
313
|
-
codeCssName: string;
|
|
310
|
+
codeTheme: string;
|
|
314
311
|
}> & {
|
|
315
312
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
316
313
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -444,9 +441,8 @@ declare const _default: {
|
|
|
444
441
|
};
|
|
445
442
|
onError: {
|
|
446
443
|
type: import("vue").PropType<(err: import("./type").InnerError) => void>;
|
|
447
|
-
default: () => () => void;
|
|
448
444
|
};
|
|
449
|
-
|
|
445
|
+
codeTheme: {
|
|
450
446
|
type: import("vue").PropType<string>;
|
|
451
447
|
default: string;
|
|
452
448
|
};
|
|
@@ -567,13 +563,12 @@ declare const _default: {
|
|
|
567
563
|
};
|
|
568
564
|
onError: {
|
|
569
565
|
type: import("vue").PropType<(err: import("./type").InnerError) => void>;
|
|
570
|
-
default: () => () => void;
|
|
571
566
|
};
|
|
572
|
-
|
|
567
|
+
codeTheme: {
|
|
573
568
|
type: import("vue").PropType<string>;
|
|
574
569
|
default: string;
|
|
575
570
|
};
|
|
576
|
-
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
571
|
+
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onSave" | "onChange" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError", {
|
|
577
572
|
editorId: string;
|
|
578
573
|
preview: boolean;
|
|
579
574
|
htmlPreview: boolean;
|
|
@@ -597,14 +592,14 @@ declare const _default: {
|
|
|
597
592
|
sanitize: (html: string) => string;
|
|
598
593
|
placeholder: string;
|
|
599
594
|
noKatex: boolean;
|
|
600
|
-
|
|
601
|
-
codeCssName: string;
|
|
595
|
+
codeTheme: string;
|
|
602
596
|
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
603
597
|
readonly NormalToolbar: typeof NormalToolbar;
|
|
604
598
|
readonly DropdownToolbar: typeof DropdownToolbar;
|
|
605
|
-
readonly
|
|
599
|
+
readonly MdCatalog: typeof MdCatalog;
|
|
606
600
|
readonly ModalToolbar: typeof ModalToolbar;
|
|
607
601
|
readonly config: typeof configFn;
|
|
602
|
+
install: (app: App) => App;
|
|
608
603
|
};
|
|
609
604
|
export default _default;
|
|
610
605
|
export * from './type';
|
package/lib/MdEditor/type.d.ts
CHANGED
|
@@ -70,7 +70,8 @@ export interface StaticTextDefaultValue {
|
|
|
70
70
|
};
|
|
71
71
|
copyCode?: {
|
|
72
72
|
text?: string;
|
|
73
|
-
|
|
73
|
+
successTips?: string;
|
|
74
|
+
failTips?: string;
|
|
74
75
|
};
|
|
75
76
|
mermaid?: {
|
|
76
77
|
flow?: string;
|
|
@@ -200,6 +201,10 @@ export interface ConfigOption {
|
|
|
200
201
|
* 自定义内部mermaid模块
|
|
201
202
|
*/
|
|
202
203
|
mermaidTemplate?: MermaidTemplate;
|
|
204
|
+
/**
|
|
205
|
+
* 输入渲染延迟(ms)
|
|
206
|
+
*/
|
|
207
|
+
renderDelay?: number;
|
|
203
208
|
};
|
|
204
209
|
}
|
|
205
210
|
/**
|