md-editor-v3 4.5.0 → 4.6.0-beta.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 +1 -0
- package/lib/cjs/MdCatalog.cjs +1 -1
- package/lib/cjs/MdEditor.cjs +11 -11
- package/lib/cjs/chunks/index.cjs +6 -6
- package/lib/cjs/chunks/index4.cjs +2 -2
- package/lib/cjs/index.cjs +1 -1
- package/lib/es/MdCatalog.mjs +28 -28
- package/lib/es/MdEditor.mjs +711 -703
- package/lib/es/chunks/index.mjs +206 -201
- package/lib/es/chunks/index4.mjs +64 -46
- package/lib/es/index.mjs +17 -16
- package/lib/types/MdEditor/Editor.d.ts +8 -1
- package/lib/types/MdEditor/index.d.ts +18 -2
- package/lib/types/MdEditor/layouts/Content/index.d.ts +9 -0
- package/lib/types/MdEditor/layouts/Content/props.d.ts +4 -0
- package/lib/types/MdEditor/props.d.ts +3 -0
- package/lib/types/MdEditor/static/event-name.d.ts +9 -0
- package/lib/types/MdEditor/type.d.ts +4 -2
- package/lib/types/MdPreview/MdPreview.d.ts +2 -1
- package/lib/types/MdPreview/index.d.ts +6 -2
- package/lib/umd/index.js +41 -41
- package/package.json +2 -2
package/lib/es/chunks/index4.mjs
CHANGED
|
@@ -1,69 +1,87 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
class
|
|
1
|
+
var r = Object.defineProperty;
|
|
2
|
+
var p = (o, s, t) => s in o ? r(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
|
+
var i = (o, s, t) => (p(o, typeof s != "symbol" ? s + "" : s, t), t);
|
|
4
|
+
class h {
|
|
5
5
|
constructor() {
|
|
6
6
|
// 事件池
|
|
7
|
-
|
|
7
|
+
i(this, "pools", {});
|
|
8
8
|
}
|
|
9
9
|
// 移除事件监听
|
|
10
|
-
remove(
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
remove(s, t, n) {
|
|
11
|
+
const a = this.pools[s] && this.pools[s][t];
|
|
12
|
+
a && (this.pools[s][t] = a.filter((e) => e !== n));
|
|
13
13
|
}
|
|
14
14
|
// 清空全部事件,由于单一实例,多次注册会被共享内容
|
|
15
|
-
clear(
|
|
16
|
-
this.pools[
|
|
15
|
+
clear(s) {
|
|
16
|
+
this.pools[s] = {};
|
|
17
17
|
}
|
|
18
18
|
// 注册事件监听
|
|
19
|
-
on(
|
|
20
|
-
return this.pools[
|
|
19
|
+
on(s, t) {
|
|
20
|
+
return this.pools[s] || (this.pools[s] = {}), this.pools[s][t.name] || (this.pools[s][t.name] = []), this.pools[s][t.name].push(t.callback), this.pools[s][t.name].includes(t.callback);
|
|
21
21
|
}
|
|
22
22
|
// 触发事件
|
|
23
|
-
emit(
|
|
24
|
-
this.pools[
|
|
25
|
-
const
|
|
26
|
-
|
|
23
|
+
emit(s, t, ...n) {
|
|
24
|
+
this.pools[s] || (this.pools[s] = {});
|
|
25
|
+
const a = this.pools[s][t];
|
|
26
|
+
a && a.forEach((e) => {
|
|
27
27
|
try {
|
|
28
|
-
|
|
29
|
-
} catch (
|
|
30
|
-
console.error(`${
|
|
28
|
+
e(...n);
|
|
29
|
+
} catch (c) {
|
|
30
|
+
console.error(`${t} monitor event exception!`, c);
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
const
|
|
35
|
+
const C = new h(), E = "onSave", g = "changeCatalogVisible", A = "changeFullscreen", R = "pageFullscreenChanged", _ = "fullscreenChanged", d = "previewChanged", L = "htmlPreviewChanged", N = "catalogVisibleChanged", f = "textareaFocus", S = "buildFinished", b = "errorCatcher", G = "replace", H = "uploadImage", T = "openModals", F = "ctrlZ", m = "ctrlShiftZ", I = "catalogChanged", D = "pushCatalog", O = (o, s = "image.png") => {
|
|
36
|
+
const t = o.split(","), n = t[0].match(/:(.*?);/);
|
|
37
37
|
if (n) {
|
|
38
|
-
const
|
|
39
|
-
let
|
|
40
|
-
const
|
|
41
|
-
for (;
|
|
42
|
-
|
|
43
|
-
return new File([
|
|
38
|
+
const l = n[1], a = atob(t[1]);
|
|
39
|
+
let e = a.length;
|
|
40
|
+
const c = new Uint8Array(e);
|
|
41
|
+
for (; e--; )
|
|
42
|
+
c[e] = a.charCodeAt(e);
|
|
43
|
+
return new File([c], s, { type: l });
|
|
44
44
|
}
|
|
45
45
|
return null;
|
|
46
|
-
},
|
|
46
|
+
}, w = (o) => {
|
|
47
47
|
if (!o)
|
|
48
48
|
return o;
|
|
49
|
-
const
|
|
50
|
-
`),
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
}),
|
|
54
|
-
},
|
|
55
|
-
if (!o || !
|
|
49
|
+
const s = o.split(`
|
|
50
|
+
`), t = ['<span rn-wrapper aria-hidden="true">'];
|
|
51
|
+
return s.forEach(() => {
|
|
52
|
+
t.push("<span></span>");
|
|
53
|
+
}), t.push("</span>"), `<span class="code-block">${o}</span>${t.join("")}`;
|
|
54
|
+
}, P = (o, s) => {
|
|
55
|
+
if (!o || !s)
|
|
56
56
|
return 0;
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
return
|
|
60
|
-
const n =
|
|
61
|
-
return
|
|
62
|
-
},
|
|
57
|
+
const t = o == null ? void 0 : o.getBoundingClientRect();
|
|
58
|
+
if (s === document.documentElement)
|
|
59
|
+
return t.top - s.clientTop;
|
|
60
|
+
const n = s == null ? void 0 : s.getBoundingClientRect();
|
|
61
|
+
return t.top - n.top;
|
|
62
|
+
}, U = () => `${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`;
|
|
63
63
|
export {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
S as B,
|
|
65
|
+
A as C,
|
|
66
|
+
b as E,
|
|
67
|
+
_ as F,
|
|
68
|
+
L as H,
|
|
69
|
+
T as O,
|
|
70
|
+
D as P,
|
|
71
|
+
G as R,
|
|
72
|
+
f as T,
|
|
73
|
+
H as U,
|
|
74
|
+
O as a,
|
|
75
|
+
C as b,
|
|
76
|
+
g as c,
|
|
77
|
+
E as d,
|
|
78
|
+
m as e,
|
|
79
|
+
F as f,
|
|
80
|
+
w as g,
|
|
81
|
+
I as h,
|
|
82
|
+
R as i,
|
|
83
|
+
d as j,
|
|
84
|
+
N as k,
|
|
85
|
+
P as l,
|
|
86
|
+
U as u
|
|
69
87
|
};
|
package/lib/es/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { M as
|
|
3
|
-
import { default as
|
|
4
|
-
import { D as
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import { c as
|
|
8
|
-
import { M as
|
|
1
|
+
import { default as C } from "./MdEditor.mjs";
|
|
2
|
+
import { M as N } from "./chunks/index.mjs";
|
|
3
|
+
import { default as h } from "./NormalToolbar.mjs";
|
|
4
|
+
import { D as k } from "./chunks/index2.mjs";
|
|
5
|
+
import { default as y } from "./ModalToolbar.mjs";
|
|
6
|
+
import { default as A } from "./MdCatalog.mjs";
|
|
7
|
+
import { c as F } from "./chunks/config.mjs";
|
|
8
|
+
import { M as H } from "./chunks/index3.mjs";
|
|
9
9
|
import "vue";
|
|
10
10
|
import "@vavt/util";
|
|
11
11
|
import "./chunks/index4.mjs";
|
|
@@ -14,6 +14,7 @@ import "codemirror";
|
|
|
14
14
|
import "@codemirror/view";
|
|
15
15
|
import "@codemirror/language-data";
|
|
16
16
|
import "@codemirror/lang-markdown";
|
|
17
|
+
import "@codemirror/lang-html";
|
|
17
18
|
import "@codemirror/commands";
|
|
18
19
|
import "@codemirror/language";
|
|
19
20
|
import "@lezer/highlight";
|
|
@@ -27,12 +28,12 @@ import "markdown-it-image-figures";
|
|
|
27
28
|
import "markdown-it-task-lists";
|
|
28
29
|
import "lru-cache";
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
k as DropdownToolbar,
|
|
32
|
+
A as MdCatalog,
|
|
33
|
+
C as MdEditor,
|
|
34
|
+
H as MdModal,
|
|
35
|
+
N as MdPreview,
|
|
36
|
+
y as ModalToolbar,
|
|
37
|
+
h as NormalToolbar,
|
|
38
|
+
F as config
|
|
38
39
|
};
|
|
@@ -95,6 +95,9 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
95
95
|
onInput: {
|
|
96
96
|
type: import("vue").PropType<(event: Event) => void>;
|
|
97
97
|
};
|
|
98
|
+
onDrop: {
|
|
99
|
+
type: import("vue").PropType<(event: DragEvent) => void>;
|
|
100
|
+
};
|
|
98
101
|
modelValue: {
|
|
99
102
|
type: import("vue").PropType<string>;
|
|
100
103
|
default: string;
|
|
@@ -180,7 +183,7 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
180
183
|
type: import("vue").PropType<import('./type').CustomIcon>;
|
|
181
184
|
default: {};
|
|
182
185
|
};
|
|
183
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('./type').EditorEmits, "onChange" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
186
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('./type').EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
184
187
|
onChange: {
|
|
185
188
|
type: import("vue").PropType<import('./type').ChangeEvent>;
|
|
186
189
|
};
|
|
@@ -277,6 +280,9 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
277
280
|
onInput: {
|
|
278
281
|
type: import("vue").PropType<(event: Event) => void>;
|
|
279
282
|
};
|
|
283
|
+
onDrop: {
|
|
284
|
+
type: import("vue").PropType<(event: DragEvent) => void>;
|
|
285
|
+
};
|
|
280
286
|
modelValue: {
|
|
281
287
|
type: import("vue").PropType<string>;
|
|
282
288
|
default: string;
|
|
@@ -364,6 +370,7 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
364
370
|
};
|
|
365
371
|
}>> & {
|
|
366
372
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
373
|
+
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
367
374
|
onOnFocus?: ((...args: any[]) => any) | undefined;
|
|
368
375
|
onOnBlur?: ((...args: any[]) => any) | undefined;
|
|
369
376
|
onOnInput?: ((...args: any[]) => any) | undefined;
|
|
@@ -132,6 +132,9 @@ declare const _default: {
|
|
|
132
132
|
onInput: {
|
|
133
133
|
type: import("vue").PropType<(event: Event) => void>;
|
|
134
134
|
};
|
|
135
|
+
onDrop: {
|
|
136
|
+
type: import("vue").PropType<(event: DragEvent) => void>;
|
|
137
|
+
};
|
|
135
138
|
modelValue: {
|
|
136
139
|
type: import("vue").PropType<string>;
|
|
137
140
|
default: string;
|
|
@@ -219,6 +222,7 @@ declare const _default: {
|
|
|
219
222
|
};
|
|
220
223
|
}>> & {
|
|
221
224
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
225
|
+
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
222
226
|
onOnFocus?: ((...args: any[]) => any) | undefined;
|
|
223
227
|
onOnBlur?: ((...args: any[]) => any) | undefined;
|
|
224
228
|
onOnInput?: ((...args: any[]) => any) | undefined;
|
|
@@ -240,7 +244,7 @@ declare const _default: {
|
|
|
240
244
|
}>;
|
|
241
245
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
242
246
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
243
|
-
$emit: (event: "onChange" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", ...args: any[]) => void;
|
|
247
|
+
$emit: (event: "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", ...args: any[]) => void;
|
|
244
248
|
$el: any;
|
|
245
249
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
246
250
|
onChange: {
|
|
@@ -339,6 +343,9 @@ declare const _default: {
|
|
|
339
343
|
onInput: {
|
|
340
344
|
type: import("vue").PropType<(event: Event) => void>;
|
|
341
345
|
};
|
|
346
|
+
onDrop: {
|
|
347
|
+
type: import("vue").PropType<(event: DragEvent) => void>;
|
|
348
|
+
};
|
|
342
349
|
modelValue: {
|
|
343
350
|
type: import("vue").PropType<string>;
|
|
344
351
|
default: string;
|
|
@@ -426,6 +433,7 @@ declare const _default: {
|
|
|
426
433
|
};
|
|
427
434
|
}>> & {
|
|
428
435
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
436
|
+
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
429
437
|
onOnFocus?: ((...args: any[]) => any) | undefined;
|
|
430
438
|
onOnBlur?: ((...args: any[]) => any) | undefined;
|
|
431
439
|
onOnInput?: ((...args: any[]) => any) | undefined;
|
|
@@ -584,6 +592,9 @@ declare const _default: {
|
|
|
584
592
|
onInput: {
|
|
585
593
|
type: import("vue").PropType<(event: Event) => void>;
|
|
586
594
|
};
|
|
595
|
+
onDrop: {
|
|
596
|
+
type: import("vue").PropType<(event: DragEvent) => void>;
|
|
597
|
+
};
|
|
587
598
|
modelValue: {
|
|
588
599
|
type: import("vue").PropType<string>;
|
|
589
600
|
default: string;
|
|
@@ -671,6 +682,7 @@ declare const _default: {
|
|
|
671
682
|
};
|
|
672
683
|
}>> & {
|
|
673
684
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
685
|
+
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
674
686
|
onOnFocus?: ((...args: any[]) => any) | undefined;
|
|
675
687
|
onOnBlur?: ((...args: any[]) => any) | undefined;
|
|
676
688
|
onOnInput?: ((...args: any[]) => any) | undefined;
|
|
@@ -781,6 +793,9 @@ declare const _default: {
|
|
|
781
793
|
onInput: {
|
|
782
794
|
type: import("vue").PropType<(event: Event) => void>;
|
|
783
795
|
};
|
|
796
|
+
onDrop: {
|
|
797
|
+
type: import("vue").PropType<(event: DragEvent) => void>;
|
|
798
|
+
};
|
|
784
799
|
modelValue: {
|
|
785
800
|
type: import("vue").PropType<string>;
|
|
786
801
|
default: string;
|
|
@@ -868,6 +883,7 @@ declare const _default: {
|
|
|
868
883
|
};
|
|
869
884
|
}>> & {
|
|
870
885
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
886
|
+
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
871
887
|
onOnFocus?: ((...args: any[]) => any) | undefined;
|
|
872
888
|
onOnBlur?: ((...args: any[]) => any) | undefined;
|
|
873
889
|
onOnInput?: ((...args: any[]) => any) | undefined;
|
|
@@ -877,7 +893,7 @@ declare const _default: {
|
|
|
877
893
|
onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
|
|
878
894
|
onOnGetCatalog?: ((...args: any[]) => any) | undefined;
|
|
879
895
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
880
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("./type").EditorEmits, "onChange" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", {
|
|
896
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("./type").EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", {
|
|
881
897
|
editorId: string;
|
|
882
898
|
class: string;
|
|
883
899
|
style: string | import("vue").CSSProperties;
|
|
@@ -49,6 +49,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
49
49
|
onInput: {
|
|
50
50
|
type: import("vue").PropType<(event: Event) => void>;
|
|
51
51
|
};
|
|
52
|
+
onDrop: {
|
|
53
|
+
type: import("vue").PropType<(event: DragEvent) => void>;
|
|
54
|
+
default: () => void;
|
|
55
|
+
};
|
|
52
56
|
modelValue: {
|
|
53
57
|
type: import("vue").PropType<string>;
|
|
54
58
|
default: string;
|
|
@@ -147,6 +151,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
147
151
|
onInput: {
|
|
148
152
|
type: import("vue").PropType<(event: Event) => void>;
|
|
149
153
|
};
|
|
154
|
+
onDrop: {
|
|
155
|
+
type: import("vue").PropType<(event: DragEvent) => void>;
|
|
156
|
+
default: () => void;
|
|
157
|
+
};
|
|
150
158
|
modelValue: {
|
|
151
159
|
type: import("vue").PropType<string>;
|
|
152
160
|
default: string;
|
|
@@ -196,6 +204,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
196
204
|
};
|
|
197
205
|
}>>, {
|
|
198
206
|
onChange: (v: string) => void;
|
|
207
|
+
onDrop: (event: DragEvent) => void;
|
|
199
208
|
onFocus: (event: FocusEvent) => void;
|
|
200
209
|
onBlur: (event: FocusEvent) => void;
|
|
201
210
|
mdHeadingId: import("../../type").MdHeadingId;
|
|
@@ -108,6 +108,10 @@ export declare const contentProps: {
|
|
|
108
108
|
onInput: {
|
|
109
109
|
type: PropType<(event: Event) => void>;
|
|
110
110
|
};
|
|
111
|
+
onDrop: {
|
|
112
|
+
type: PropType<(event: DragEvent) => void>;
|
|
113
|
+
default: () => void;
|
|
114
|
+
};
|
|
111
115
|
modelValue: {
|
|
112
116
|
type: PropType<string>;
|
|
113
117
|
default: string;
|
|
@@ -7,3 +7,12 @@ export declare const PREVIEW_CHANGED = "previewChanged";
|
|
|
7
7
|
export declare const HTML_PREVIEW_CHANGED = "htmlPreviewChanged";
|
|
8
8
|
export declare const CATALOG_VISIBLE_CHANGED = "catalogVisibleChanged";
|
|
9
9
|
export declare const TEXTAREA_FOCUS = "textareaFocus";
|
|
10
|
+
export declare const BUILD_FINISHED = "buildFinished";
|
|
11
|
+
export declare const ERROR_CATCHER = "errorCatcher";
|
|
12
|
+
export declare const REPLACE = "replace";
|
|
13
|
+
export declare const UPLOAD_IMAGE = "uploadImage";
|
|
14
|
+
export declare const OPEN_MODALS = "openModals";
|
|
15
|
+
export declare const CTRL_Z = "ctrlZ";
|
|
16
|
+
export declare const CTRL_SHIFT_Z = "ctrlShiftZ";
|
|
17
|
+
export declare const CATALOG_CHANGED = "catalogChanged";
|
|
18
|
+
export declare const PUSH_CATALOG = "pushCatalog";
|
|
@@ -229,9 +229,11 @@ export interface ConfigOption {
|
|
|
229
229
|
*
|
|
230
230
|
* @params theme 当前主题
|
|
231
231
|
* @params innerExtensions 当前主题下的扩展列表
|
|
232
|
-
* [keymap, minimalSetup, markdown, EditorView.lineWrapping, EditorView.updateListener, EditorView.domEventHandlers, oneDark??oneLight]
|
|
232
|
+
* [keymap, minimalSetup, html, markdown, EditorView.lineWrapping, EditorView.updateListener, EditorView.domEventHandlers, oneDark??oneLight]
|
|
233
233
|
* [快捷键, 最低配置, markdown识别, 横向自动换行, 更新事件, dom监听事件, oneDark主题(暗夜模式下), oneLight(默认模式下)]
|
|
234
234
|
*
|
|
235
|
+
* 如果要添加其他自带的扩展,比如java,注意添加到markdown之前,不然自动提示不正常
|
|
236
|
+
*
|
|
235
237
|
* @params keyBindings md-editor-v3内置的快捷键
|
|
236
238
|
*/
|
|
237
239
|
codeMirrorExtensions: (theme: Themes, extensions: Array<Extension>, keyBindings: Array<KeyBinding>) => Array<Extension>;
|
|
@@ -370,7 +372,7 @@ export interface ExposeParam {
|
|
|
370
372
|
}
|
|
371
373
|
export type EditorProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof editorProps>>>>;
|
|
372
374
|
export type MdPreviewProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof mdPreviewProps>>>>;
|
|
373
|
-
export type EditorEmits = Array<'onChange' | 'onSave' | 'onUploadImg' | 'onHtmlChanged' | 'onGetCatalog' | 'onError' | 'update:modelValue' | 'onBlur' | 'onFocus' | 'onInput'>;
|
|
375
|
+
export type EditorEmits = Array<'onChange' | 'onSave' | 'onUploadImg' | 'onHtmlChanged' | 'onGetCatalog' | 'onError' | 'update:modelValue' | 'onBlur' | 'onFocus' | 'onInput' | 'onDrop'>;
|
|
374
376
|
export type EditorContext = SetupContext<EditorEmits>;
|
|
375
377
|
/**
|
|
376
378
|
* 自定义图标的数据类型
|
|
@@ -84,7 +84,7 @@ declare const MdPreview: import("vue").DefineComponent<{
|
|
|
84
84
|
type: import("vue").PropType<import('../MdEditor/type').CustomIcon>;
|
|
85
85
|
default: {};
|
|
86
86
|
};
|
|
87
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('../MdEditor/type').EditorEmits, "onChange" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
87
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('../MdEditor/type').EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
88
88
|
modelValue: {
|
|
89
89
|
type: import("vue").PropType<string>;
|
|
90
90
|
default: string;
|
|
@@ -172,6 +172,7 @@ declare const MdPreview: import("vue").DefineComponent<{
|
|
|
172
172
|
};
|
|
173
173
|
}>> & {
|
|
174
174
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
175
|
+
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
175
176
|
onOnFocus?: ((...args: any[]) => any) | undefined;
|
|
176
177
|
onOnBlur?: ((...args: any[]) => any) | undefined;
|
|
177
178
|
onOnInput?: ((...args: any[]) => any) | undefined;
|
|
@@ -111,6 +111,7 @@ declare const _default: {
|
|
|
111
111
|
};
|
|
112
112
|
}>> & {
|
|
113
113
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
114
|
+
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
114
115
|
onOnFocus?: ((...args: any[]) => any) | undefined;
|
|
115
116
|
onOnBlur?: ((...args: any[]) => any) | undefined;
|
|
116
117
|
onOnInput?: ((...args: any[]) => any) | undefined;
|
|
@@ -132,7 +133,7 @@ declare const _default: {
|
|
|
132
133
|
}>;
|
|
133
134
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
134
135
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
135
|
-
$emit: (event: "onChange" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", ...args: any[]) => void;
|
|
136
|
+
$emit: (event: "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", ...args: any[]) => void;
|
|
136
137
|
$el: any;
|
|
137
138
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
138
139
|
modelValue: {
|
|
@@ -222,6 +223,7 @@ declare const _default: {
|
|
|
222
223
|
};
|
|
223
224
|
}>> & {
|
|
224
225
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
226
|
+
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
225
227
|
onOnFocus?: ((...args: any[]) => any) | undefined;
|
|
226
228
|
onOnBlur?: ((...args: any[]) => any) | undefined;
|
|
227
229
|
onOnInput?: ((...args: any[]) => any) | undefined;
|
|
@@ -359,6 +361,7 @@ declare const _default: {
|
|
|
359
361
|
};
|
|
360
362
|
}>> & {
|
|
361
363
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
364
|
+
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
362
365
|
onOnFocus?: ((...args: any[]) => any) | undefined;
|
|
363
366
|
onOnBlur?: ((...args: any[]) => any) | undefined;
|
|
364
367
|
onOnInput?: ((...args: any[]) => any) | undefined;
|
|
@@ -460,6 +463,7 @@ declare const _default: {
|
|
|
460
463
|
};
|
|
461
464
|
}>> & {
|
|
462
465
|
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
466
|
+
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
463
467
|
onOnFocus?: ((...args: any[]) => any) | undefined;
|
|
464
468
|
onOnBlur?: ((...args: any[]) => any) | undefined;
|
|
465
469
|
onOnInput?: ((...args: any[]) => any) | undefined;
|
|
@@ -469,7 +473,7 @@ declare const _default: {
|
|
|
469
473
|
onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
|
|
470
474
|
onOnGetCatalog?: ((...args: any[]) => any) | undefined;
|
|
471
475
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
472
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("..").EditorEmits, "onChange" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", {
|
|
476
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("..").EditorEmits, "onChange" | "onDrop" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", {
|
|
473
477
|
editorId: string;
|
|
474
478
|
class: string;
|
|
475
479
|
style: string | import("vue").CSSProperties;
|