md-editor-v3 4.3.0-beta.3 → 4.3.0-beta.5

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.
@@ -1,5 +1,5 @@
1
- import { defineComponent as S, reactive as E, ref as C, watch as T, onMounted as D, onBeforeUnmount as O, cloneVNode as $, createVNode as u, inject as j } from "vue";
2
- import { p as d } from "./config.mjs";
1
+ import { defineComponent as S, reactive as E, ref as C, watch as D, onMounted as T, onBeforeUnmount as O, cloneVNode as $, createVNode as d, inject as j } from "vue";
2
+ import { p as c } from "./config.mjs";
3
3
  import { g as v } from "./vue-tsx.mjs";
4
4
  const B = {
5
5
  overlay: {
@@ -23,18 +23,18 @@ const B = {
23
23
  }, F = /* @__PURE__ */ S({
24
24
  props: B,
25
25
  setup(e, a) {
26
- const i = `${d}-dropdown-hidden`, t = E({
26
+ const i = `${c}-dropdown-hidden`, t = E({
27
27
  overlayClass: [i],
28
28
  overlayStyle: {},
29
29
  triggerHover: !1,
30
30
  overlayHover: !1
31
- }), o = C(), n = C(), s = () => {
31
+ }), r = C(), n = C(), s = () => {
32
32
  var p;
33
33
  t.triggerHover = !0;
34
- const r = o.value, l = n.value;
35
- if (!r || !l)
34
+ const o = r.value, l = n.value;
35
+ if (!o || !l)
36
36
  return;
37
- const c = r.getBoundingClientRect(), f = r.offsetTop, b = r.offsetLeft, H = c.height, L = c.width, w = ((p = document.querySelector(e.relative)) == null ? void 0 : p.scrollLeft) || 0;
37
+ const u = o.getBoundingClientRect(), f = o.offsetTop, b = o.offsetLeft, H = u.height, L = u.width, w = ((p = document.querySelector(e.relative)) == null ? void 0 : p.scrollLeft) || 0;
38
38
  t.overlayStyle = {
39
39
  ...t.overlayStyle,
40
40
  top: f + H + "px",
@@ -43,35 +43,35 @@ const B = {
43
43
  }, m = () => {
44
44
  t.overlayHover = !0;
45
45
  };
46
- T(() => e.visible, (r) => {
47
- r ? t.overlayClass = t.overlayClass.filter((l) => l !== i) : t.overlayClass.push(i);
46
+ D(() => e.visible, (o) => {
47
+ o ? t.overlayClass = t.overlayClass.filter((l) => l !== i) : t.overlayClass.push(i);
48
48
  });
49
49
  let h = -1;
50
- const g = (r) => {
51
- o.value === r.target ? t.triggerHover = !1 : t.overlayHover = !1, clearTimeout(h), h = window.setTimeout(() => {
50
+ const g = (o) => {
51
+ r.value === o.target ? t.triggerHover = !1 : t.overlayHover = !1, clearTimeout(h), h = window.setTimeout(() => {
52
52
  !t.overlayHover && !t.triggerHover && e.onChange(!1);
53
53
  }, 10);
54
54
  };
55
- return D(() => {
56
- o.value.addEventListener("mouseenter", s), o.value.addEventListener("mouseleave", g), n.value.addEventListener("mouseenter", m), n.value.addEventListener("mouseleave", g);
55
+ return T(() => {
56
+ r.value.addEventListener("mouseenter", s), r.value.addEventListener("mouseleave", g), n.value.addEventListener("mouseenter", m), n.value.addEventListener("mouseleave", g);
57
57
  }), O(() => {
58
- o.value.removeEventListener("mouseenter", s), o.value.removeEventListener("mouseleave", g), n.value.removeEventListener("mouseenter", m), n.value.removeEventListener("mouseleave", g);
58
+ r.value.removeEventListener("mouseenter", s), r.value.removeEventListener("mouseleave", g), n.value.removeEventListener("mouseenter", m), n.value.removeEventListener("mouseleave", g);
59
59
  }), () => {
60
- const r = v({
60
+ const o = v({
61
61
  ctx: a
62
62
  }), l = v({
63
63
  props: e,
64
64
  ctx: a
65
- }, "overlay"), c = $(r instanceof Array ? r[0] : r, {
66
- ref: o
67
- }), f = u("div", {
68
- class: [`${d}-dropdown`, t.overlayClass],
65
+ }, "overlay"), u = $(o instanceof Array ? o[0] : o, {
66
+ ref: r
67
+ }), f = d("div", {
68
+ class: [`${c}-dropdown`, t.overlayClass],
69
69
  style: t.overlayStyle,
70
70
  ref: n
71
- }, [u("div", {
72
- class: `${d}-dropdown-overlay`
71
+ }, [d("div", {
72
+ class: `${c}-dropdown-overlay`
73
73
  }, [l instanceof Array ? l[0] : l])]);
74
- return [c, f];
74
+ return [u, f];
75
75
  };
76
76
  }
77
77
  }), I = {
@@ -99,7 +99,7 @@ const B = {
99
99
  insert: {
100
100
  type: Function
101
101
  },
102
- children: {
102
+ default: {
103
103
  type: [String, Object]
104
104
  }
105
105
  }, y = /* @__PURE__ */ S({
@@ -112,23 +112,23 @@ const B = {
112
112
  const t = v({
113
113
  props: e,
114
114
  ctx: a
115
- }, "trigger"), o = v({
115
+ }, "trigger"), r = v({
116
116
  props: e,
117
117
  ctx: a
118
118
  }, "overlay"), n = v({
119
119
  props: e,
120
120
  ctx: a
121
121
  });
122
- return u(F, {
122
+ return d(F, {
123
123
  relative: `#${i}-toolbar-wrapper`,
124
124
  visible: e.visible,
125
125
  onChange: (s) => {
126
126
  e.onChange instanceof Function ? e.onChange(s) : a.emit("onChange", s);
127
127
  },
128
- overlay: o
128
+ overlay: r
129
129
  }, {
130
- default: () => [u("div", {
131
- class: `${d}-toolbar-item`,
130
+ default: () => [d("div", {
131
+ class: `${c}-toolbar-item`,
132
132
  title: e.title || ""
133
133
  }, [t, n])]
134
134
  });
@@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<{
22
22
  insert: {
23
23
  type: PropType<() => void>;
24
24
  };
25
- children: {
25
+ default: {
26
26
  type: PropType<string | JSX.Element>;
27
27
  };
28
28
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onChange"[], "onChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
@@ -48,7 +48,7 @@ declare const _default: import("vue").DefineComponent<{
48
48
  insert: {
49
49
  type: PropType<() => void>;
50
50
  };
51
- children: {
51
+ default: {
52
52
  type: PropType<string | JSX.Element>;
53
53
  };
54
54
  }>> & {
@@ -25,7 +25,7 @@ declare const _default: {
25
25
  insert: {
26
26
  type: import("vue").PropType<() => void>;
27
27
  };
28
- children: {
28
+ default: {
29
29
  type: import("vue").PropType<string | JSX.Element>;
30
30
  };
31
31
  }>> & {
@@ -64,7 +64,7 @@ declare const _default: {
64
64
  insert: {
65
65
  type: import("vue").PropType<() => void>;
66
66
  };
67
- children: {
67
+ default: {
68
68
  type: import("vue").PropType<string | JSX.Element>;
69
69
  };
70
70
  }>> & {
@@ -111,7 +111,7 @@ declare const _default: {
111
111
  insert: {
112
112
  type: import("vue").PropType<() => void>;
113
113
  };
114
- children: {
114
+ default: {
115
115
  type: import("vue").PropType<string | JSX.Element>;
116
116
  };
117
117
  }>> & {
@@ -140,7 +140,7 @@ declare const _default: {
140
140
  insert: {
141
141
  type: import("vue").PropType<() => void>;
142
142
  };
143
- children: {
143
+ default: {
144
144
  type: import("vue").PropType<string | JSX.Element>;
145
145
  };
146
146
  }>> & {
@@ -92,6 +92,9 @@ declare const Editor: import("vue").DefineComponent<{
92
92
  type: import("vue").PropType<boolean>;
93
93
  default: boolean;
94
94
  };
95
+ onInput: {
96
+ type: import("vue").PropType<(event: Event) => void>;
97
+ };
95
98
  modelValue: {
96
99
  type: import("vue").PropType<string>;
97
100
  default: string;
@@ -169,7 +172,7 @@ declare const Editor: import("vue").DefineComponent<{
169
172
  type: import("vue").PropType<boolean>;
170
173
  default: boolean;
171
174
  };
172
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('./type').EditorEmits, "onChange" | "onFocus" | "onBlur" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
175
+ }, () => 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<{
173
176
  onChange: {
174
177
  type: import("vue").PropType<import('./type').ChangeEvent>;
175
178
  };
@@ -263,6 +266,9 @@ declare const Editor: import("vue").DefineComponent<{
263
266
  type: import("vue").PropType<boolean>;
264
267
  default: boolean;
265
268
  };
269
+ onInput: {
270
+ type: import("vue").PropType<(event: Event) => void>;
271
+ };
266
272
  modelValue: {
267
273
  type: import("vue").PropType<string>;
268
274
  default: string;
@@ -344,6 +350,7 @@ declare const Editor: import("vue").DefineComponent<{
344
350
  onOnChange?: ((...args: any[]) => any) | undefined;
345
351
  onOnFocus?: ((...args: any[]) => any) | undefined;
346
352
  onOnBlur?: ((...args: any[]) => any) | undefined;
353
+ onOnInput?: ((...args: any[]) => any) | undefined;
347
354
  onOnError?: ((...args: any[]) => any) | undefined;
348
355
  onOnSave?: ((...args: any[]) => any) | undefined;
349
356
  onOnUploadImg?: ((...args: any[]) => any) | undefined;
@@ -18,7 +18,6 @@ declare const _default: import("vue").DefineComponent<{
18
18
  };
19
19
  onClose: {
20
20
  type: PropType<() => void>;
21
- default: () => void;
22
21
  };
23
22
  showAdjust: {
24
23
  type: PropType<boolean>;
@@ -32,7 +31,7 @@ declare const _default: import("vue").DefineComponent<{
32
31
  type: PropType<(val: boolean) => void>;
33
32
  default: () => void;
34
33
  };
35
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
34
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClose"[], "onClose", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
36
35
  title: {
37
36
  type: PropType<string>;
38
37
  default: string;
@@ -51,7 +50,6 @@ declare const _default: import("vue").DefineComponent<{
51
50
  };
52
51
  onClose: {
53
52
  type: PropType<() => void>;
54
- default: () => void;
55
53
  };
56
54
  showAdjust: {
57
55
  type: PropType<boolean>;
@@ -65,10 +63,11 @@ declare const _default: import("vue").DefineComponent<{
65
63
  type: PropType<(val: boolean) => void>;
66
64
  default: () => void;
67
65
  };
68
- }>>, {
66
+ }>> & {
67
+ onOnClose?: ((...args: any[]) => any) | undefined;
68
+ }, {
69
69
  title: string;
70
70
  visible: boolean;
71
- onClose: () => void;
72
71
  onAdjust: (val: boolean) => void;
73
72
  width: string;
74
73
  height: string;
@@ -6,7 +6,6 @@ declare const _default: {
6
6
  $props: Partial<{
7
7
  title: string;
8
8
  visible: boolean;
9
- onClose: () => void;
10
9
  onAdjust: (val: boolean) => void;
11
10
  width: string;
12
11
  height: string;
@@ -31,7 +30,6 @@ declare const _default: {
31
30
  };
32
31
  onClose: {
33
32
  type: import("vue").PropType<() => void>;
34
- default: () => void;
35
33
  };
36
34
  showAdjust: {
37
35
  type: import("vue").PropType<boolean>;
@@ -45,7 +43,9 @@ declare const _default: {
45
43
  type: import("vue").PropType<(val: boolean) => void>;
46
44
  default: () => void;
47
45
  };
48
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "title" | "visible" | "onClose" | "onAdjust" | "width" | "height" | "showAdjust" | "isFullscreen">;
46
+ }>> & {
47
+ onOnClose?: ((...args: any[]) => any) | undefined;
48
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "title" | "visible" | "onAdjust" | "width" | "height" | "showAdjust" | "isFullscreen">;
49
49
  $attrs: {
50
50
  [x: string]: unknown;
51
51
  };
@@ -57,7 +57,7 @@ declare const _default: {
57
57
  }>;
58
58
  $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
59
59
  $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
60
- $emit: (event: string, ...args: any[]) => void;
60
+ $emit: (event: "onClose", ...args: any[]) => void;
61
61
  $el: any;
62
62
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
63
63
  title: {
@@ -78,7 +78,6 @@ declare const _default: {
78
78
  };
79
79
  onClose: {
80
80
  type: import("vue").PropType<() => void>;
81
- default: () => void;
82
81
  };
83
82
  showAdjust: {
84
83
  type: import("vue").PropType<boolean>;
@@ -92,10 +91,11 @@ declare const _default: {
92
91
  type: import("vue").PropType<(val: boolean) => void>;
93
92
  default: () => void;
94
93
  };
95
- }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
94
+ }>> & {
95
+ onOnClose?: ((...args: any[]) => any) | undefined;
96
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClose"[], string, {
96
97
  title: string;
97
98
  visible: boolean;
98
- onClose: () => void;
99
99
  onAdjust: (val: boolean) => void;
100
100
  width: string;
101
101
  height: string;
@@ -140,7 +140,6 @@ declare const _default: {
140
140
  };
141
141
  onClose: {
142
142
  type: import("vue").PropType<() => void>;
143
- default: () => void;
144
143
  };
145
144
  showAdjust: {
146
145
  type: import("vue").PropType<boolean>;
@@ -154,7 +153,9 @@ declare const _default: {
154
153
  type: import("vue").PropType<(val: boolean) => void>;
155
154
  default: () => void;
156
155
  };
157
- }>> & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & import("vue").ComponentCustomProperties & {};
156
+ }>> & {
157
+ onOnClose?: ((...args: any[]) => any) | undefined;
158
+ } & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & import("vue").ComponentCustomProperties & {};
158
159
  __isFragment?: undefined;
159
160
  __isTeleport?: undefined;
160
161
  __isSuspense?: undefined;
@@ -177,7 +178,6 @@ declare const _default: {
177
178
  };
178
179
  onClose: {
179
180
  type: import("vue").PropType<() => void>;
180
- default: () => void;
181
181
  };
182
182
  showAdjust: {
183
183
  type: import("vue").PropType<boolean>;
@@ -191,10 +191,11 @@ declare const _default: {
191
191
  type: import("vue").PropType<(val: boolean) => void>;
192
192
  default: () => void;
193
193
  };
194
- }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
194
+ }>> & {
195
+ onOnClose?: ((...args: any[]) => any) | undefined;
196
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClose"[], "onClose", {
195
197
  title: string;
196
198
  visible: boolean;
197
- onClose: () => void;
198
199
  onAdjust: (val: boolean) => void;
199
200
  width: string;
200
201
  height: string;
@@ -127,6 +127,9 @@ declare const _default: {
127
127
  type: import("vue").PropType<boolean>;
128
128
  default: boolean;
129
129
  };
130
+ onInput: {
131
+ type: import("vue").PropType<(event: Event) => void>;
132
+ };
130
133
  modelValue: {
131
134
  type: import("vue").PropType<string>;
132
135
  default: string;
@@ -208,6 +211,7 @@ declare const _default: {
208
211
  onOnChange?: ((...args: any[]) => any) | undefined;
209
212
  onOnFocus?: ((...args: any[]) => any) | undefined;
210
213
  onOnBlur?: ((...args: any[]) => any) | undefined;
214
+ onOnInput?: ((...args: any[]) => any) | undefined;
211
215
  onOnError?: ((...args: any[]) => any) | undefined;
212
216
  onOnSave?: ((...args: any[]) => any) | undefined;
213
217
  onOnUploadImg?: ((...args: any[]) => any) | undefined;
@@ -226,7 +230,7 @@ declare const _default: {
226
230
  }>;
227
231
  $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
228
232
  $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
229
- $emit: (event: "onChange" | "onFocus" | "onBlur" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", ...args: any[]) => void;
233
+ $emit: (event: "onChange" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", ...args: any[]) => void;
230
234
  $el: any;
231
235
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
232
236
  onChange: {
@@ -322,6 +326,9 @@ declare const _default: {
322
326
  type: import("vue").PropType<boolean>;
323
327
  default: boolean;
324
328
  };
329
+ onInput: {
330
+ type: import("vue").PropType<(event: Event) => void>;
331
+ };
325
332
  modelValue: {
326
333
  type: import("vue").PropType<string>;
327
334
  default: string;
@@ -403,6 +410,7 @@ declare const _default: {
403
410
  onOnChange?: ((...args: any[]) => any) | undefined;
404
411
  onOnFocus?: ((...args: any[]) => any) | undefined;
405
412
  onOnBlur?: ((...args: any[]) => any) | undefined;
413
+ onOnInput?: ((...args: any[]) => any) | undefined;
406
414
  onOnError?: ((...args: any[]) => any) | undefined;
407
415
  onOnSave?: ((...args: any[]) => any) | undefined;
408
416
  onOnUploadImg?: ((...args: any[]) => any) | undefined;
@@ -553,6 +561,9 @@ declare const _default: {
553
561
  type: import("vue").PropType<boolean>;
554
562
  default: boolean;
555
563
  };
564
+ onInput: {
565
+ type: import("vue").PropType<(event: Event) => void>;
566
+ };
556
567
  modelValue: {
557
568
  type: import("vue").PropType<string>;
558
569
  default: string;
@@ -634,6 +645,7 @@ declare const _default: {
634
645
  onOnChange?: ((...args: any[]) => any) | undefined;
635
646
  onOnFocus?: ((...args: any[]) => any) | undefined;
636
647
  onOnBlur?: ((...args: any[]) => any) | undefined;
648
+ onOnInput?: ((...args: any[]) => any) | undefined;
637
649
  onOnError?: ((...args: any[]) => any) | undefined;
638
650
  onOnSave?: ((...args: any[]) => any) | undefined;
639
651
  onOnUploadImg?: ((...args: any[]) => any) | undefined;
@@ -738,6 +750,9 @@ declare const _default: {
738
750
  type: import("vue").PropType<boolean>;
739
751
  default: boolean;
740
752
  };
753
+ onInput: {
754
+ type: import("vue").PropType<(event: Event) => void>;
755
+ };
741
756
  modelValue: {
742
757
  type: import("vue").PropType<string>;
743
758
  default: string;
@@ -819,13 +834,14 @@ declare const _default: {
819
834
  onOnChange?: ((...args: any[]) => any) | undefined;
820
835
  onOnFocus?: ((...args: any[]) => any) | undefined;
821
836
  onOnBlur?: ((...args: any[]) => any) | undefined;
837
+ onOnInput?: ((...args: any[]) => any) | undefined;
822
838
  onOnError?: ((...args: any[]) => any) | undefined;
823
839
  onOnSave?: ((...args: any[]) => any) | undefined;
824
840
  onOnUploadImg?: ((...args: any[]) => any) | undefined;
825
841
  onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
826
842
  onOnGetCatalog?: ((...args: any[]) => any) | undefined;
827
843
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
828
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("./type").EditorEmits, "onChange" | "onFocus" | "onBlur" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", {
844
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("./type").EditorEmits, "onChange" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", {
829
845
  editorId: string;
830
846
  class: string;
831
847
  style: string | import("vue").CSSProperties;
@@ -1,6 +1,6 @@
1
1
  import { Extension } from '@codemirror/state';
2
2
  import { EditorView } from '@codemirror/view';
3
- import { FocusOption } from '../../../../MdEditor/type';
3
+ import { FocusOption } from '../../../type';
4
4
  export default class CodeMirrorUt {
5
5
  view: EditorView;
6
6
  private toggleTabSize;
@@ -31,12 +31,12 @@ export default class CodeMirrorUt {
31
31
  * @param text 待替换内容
32
32
  * @param options 替换后是否选中
33
33
  */
34
- replaceSelectedText(text: string, options?: {
34
+ replaceSelectedText(text: string, options: {
35
35
  select: boolean;
36
36
  deviationStart: number;
37
37
  deviationEnd: number;
38
38
  replaceAll: boolean;
39
- }): void;
39
+ } | undefined, editorId: string): void;
40
40
  constructor(view: EditorView);
41
41
  /**
42
42
  * 设置tabSize
@@ -86,6 +86,9 @@ declare const _default: import("vue").DefineComponent<{
86
86
  type: import("vue").PropType<import("../../type").Themes>;
87
87
  default: string;
88
88
  };
89
+ onInput: {
90
+ type: import("vue").PropType<(event: Event) => void>;
91
+ };
89
92
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
90
93
  value: {
91
94
  type: import("vue").PropType<string>;
@@ -174,6 +177,9 @@ declare const _default: import("vue").DefineComponent<{
174
177
  type: import("vue").PropType<import("../../type").Themes>;
175
178
  default: string;
176
179
  };
180
+ onInput: {
181
+ type: import("vue").PropType<(event: Event) => void>;
182
+ };
177
183
  }>>, {
178
184
  onChange: (v: string) => void;
179
185
  onFocus: (event: FocusEvent) => void;
@@ -96,5 +96,8 @@ export declare const contentProps: {
96
96
  type: PropType<Themes>;
97
97
  default: string;
98
98
  };
99
+ onInput: {
100
+ type: PropType<(event: Event) => void>;
101
+ };
99
102
  };
100
103
  export type ContentProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof contentProps>>>>;
@@ -395,6 +395,12 @@ export declare const editorProps: {
395
395
  type: PropType<boolean>;
396
396
  default: boolean;
397
397
  };
398
+ /**
399
+ * 字符输入事件
400
+ */
401
+ onInput: {
402
+ type: PropType<(event: Event) => void>;
403
+ };
398
404
  /**
399
405
  * markdown content.
400
406
  *
@@ -249,8 +249,9 @@ export type Config = (options: ConfigOption) => void;
249
249
  * 编辑器操作潜在的错误
250
250
  */
251
251
  export interface InnerError {
252
- name: string;
252
+ name: 'Cropper' | 'fullscreen' | 'prettier' | 'overlength';
253
253
  message: string;
254
+ data: any;
254
255
  }
255
256
  export interface CodeCss {
256
257
  [key: string]: {
@@ -357,5 +358,5 @@ export interface ExposeParam {
357
358
  }
358
359
  export type EditorProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof editorProps>>>>;
359
360
  export type MdPreviewProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof mdPreviewProps>>>>;
360
- export type EditorEmits = Array<'onChange' | 'onSave' | 'onUploadImg' | 'onHtmlChanged' | 'onGetCatalog' | 'onError' | 'update:modelValue' | 'onBlur' | 'onFocus'>;
361
+ export type EditorEmits = Array<'onChange' | 'onSave' | 'onUploadImg' | 'onHtmlChanged' | 'onGetCatalog' | 'onError' | 'update:modelValue' | 'onBlur' | 'onFocus' | 'onInput'>;
361
362
  export type EditorContext = SetupContext<EditorEmits>;
@@ -76,7 +76,7 @@ declare const MdPreview: import("vue").DefineComponent<{
76
76
  type: import("vue").PropType<boolean>;
77
77
  default: boolean;
78
78
  };
79
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('../MdEditor/type').EditorEmits, "onChange" | "onFocus" | "onBlur" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
79
+ }, () => 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<{
80
80
  modelValue: {
81
81
  type: import("vue").PropType<string>;
82
82
  default: string;
@@ -158,6 +158,7 @@ declare const MdPreview: import("vue").DefineComponent<{
158
158
  onOnChange?: ((...args: any[]) => any) | undefined;
159
159
  onOnFocus?: ((...args: any[]) => any) | undefined;
160
160
  onOnBlur?: ((...args: any[]) => any) | undefined;
161
+ onOnInput?: ((...args: any[]) => any) | undefined;
161
162
  onOnError?: ((...args: any[]) => any) | undefined;
162
163
  onOnSave?: ((...args: any[]) => any) | undefined;
163
164
  onOnUploadImg?: ((...args: any[]) => any) | undefined;
@@ -103,6 +103,7 @@ declare const _default: {
103
103
  onOnChange?: ((...args: any[]) => any) | undefined;
104
104
  onOnFocus?: ((...args: any[]) => any) | undefined;
105
105
  onOnBlur?: ((...args: any[]) => any) | undefined;
106
+ onOnInput?: ((...args: any[]) => any) | undefined;
106
107
  onOnError?: ((...args: any[]) => any) | undefined;
107
108
  onOnSave?: ((...args: any[]) => any) | undefined;
108
109
  onOnUploadImg?: ((...args: any[]) => any) | undefined;
@@ -121,7 +122,7 @@ declare const _default: {
121
122
  }>;
122
123
  $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
123
124
  $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
124
- $emit: (event: "onChange" | "onFocus" | "onBlur" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", ...args: any[]) => void;
125
+ $emit: (event: "onChange" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", ...args: any[]) => void;
125
126
  $el: any;
126
127
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
127
128
  modelValue: {
@@ -205,6 +206,7 @@ declare const _default: {
205
206
  onOnChange?: ((...args: any[]) => any) | undefined;
206
207
  onOnFocus?: ((...args: any[]) => any) | undefined;
207
208
  onOnBlur?: ((...args: any[]) => any) | undefined;
209
+ onOnInput?: ((...args: any[]) => any) | undefined;
208
210
  onOnError?: ((...args: any[]) => any) | undefined;
209
211
  onOnSave?: ((...args: any[]) => any) | undefined;
210
212
  onOnUploadImg?: ((...args: any[]) => any) | undefined;
@@ -331,6 +333,7 @@ declare const _default: {
331
333
  onOnChange?: ((...args: any[]) => any) | undefined;
332
334
  onOnFocus?: ((...args: any[]) => any) | undefined;
333
335
  onOnBlur?: ((...args: any[]) => any) | undefined;
336
+ onOnInput?: ((...args: any[]) => any) | undefined;
334
337
  onOnError?: ((...args: any[]) => any) | undefined;
335
338
  onOnSave?: ((...args: any[]) => any) | undefined;
336
339
  onOnUploadImg?: ((...args: any[]) => any) | undefined;
@@ -423,13 +426,14 @@ declare const _default: {
423
426
  onOnChange?: ((...args: any[]) => any) | undefined;
424
427
  onOnFocus?: ((...args: any[]) => any) | undefined;
425
428
  onOnBlur?: ((...args: any[]) => any) | undefined;
429
+ onOnInput?: ((...args: any[]) => any) | undefined;
426
430
  onOnError?: ((...args: any[]) => any) | undefined;
427
431
  onOnSave?: ((...args: any[]) => any) | undefined;
428
432
  onOnUploadImg?: ((...args: any[]) => any) | undefined;
429
433
  onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
430
434
  onOnGetCatalog?: ((...args: any[]) => any) | undefined;
431
435
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
432
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("..").EditorEmits, "onChange" | "onFocus" | "onBlur" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", {
436
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("..").EditorEmits, "onChange" | "onFocus" | "onBlur" | "onInput" | "onError" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "update:modelValue", {
433
437
  editorId: string;
434
438
  class: string;
435
439
  style: string | import("vue").CSSProperties;