md-editor-v3 5.1.0 → 5.2.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.
@@ -590,7 +590,7 @@ const ToolBar = /* @__PURE__ */ vue.defineComponent({
590
590
  uploadRef.value.addEventListener("change", uploadHandler);
591
591
  });
592
592
  const barRender = (barItem) => {
593
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya;
593
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa;
594
594
  if (config.allToolbar.includes(barItem)) {
595
595
  switch (barItem) {
596
596
  case "-": {
@@ -1250,6 +1250,7 @@ const ToolBar = /* @__PURE__ */ vue.defineComponent({
1250
1250
  language: ((_ra = defItem.props) == null ? void 0 : _ra.theme) || language2.value,
1251
1251
  codeTheme: ((_sa = defItem.props) == null ? void 0 : _sa.codeTheme) || props2.codeTheme,
1252
1252
  disabled: ((_ta = defItem.props) == null ? void 0 : _ta.disabled) || (disabled == null ? void 0 : disabled.value),
1253
+ showToolbarName: ((_ua = defItem.props) == null ? void 0 : _ua.showToolbarName) || props2.showToolbarName,
1253
1254
  insert(generate) {
1254
1255
  eventName.bus.emit(editorId, eventName.REPLACE, "universal", {
1255
1256
  generate
@@ -1263,11 +1264,12 @@ const ToolBar = /* @__PURE__ */ vue.defineComponent({
1263
1264
  const defItem = props2.defToolbars.children[barItem];
1264
1265
  if (defItem) {
1265
1266
  const defItemCloned = vue.cloneVNode(defItem, {
1266
- theme: ((_ua = defItem.props) == null ? void 0 : _ua.theme) || theme.value,
1267
- previewTheme: ((_va = defItem.props) == null ? void 0 : _va.theme) || previewTheme.value,
1268
- language: ((_wa = defItem.props) == null ? void 0 : _wa.theme) || language2.value,
1269
- codeTheme: ((_xa = defItem.props) == null ? void 0 : _xa.codeTheme) || props2.codeTheme,
1270
- disabled: ((_ya = defItem.props) == null ? void 0 : _ya.disabled) || (disabled == null ? void 0 : disabled.value),
1267
+ theme: ((_va = defItem.props) == null ? void 0 : _va.theme) || theme.value,
1268
+ previewTheme: ((_wa = defItem.props) == null ? void 0 : _wa.theme) || previewTheme.value,
1269
+ language: ((_xa = defItem.props) == null ? void 0 : _xa.theme) || language2.value,
1270
+ codeTheme: ((_ya = defItem.props) == null ? void 0 : _ya.codeTheme) || props2.codeTheme,
1271
+ disabled: ((_za = defItem.props) == null ? void 0 : _za.disabled) || (disabled == null ? void 0 : disabled.value),
1272
+ showToolbarName: ((_Aa = defItem.props) == null ? void 0 : _Aa.showToolbarName) || props2.showToolbarName,
1271
1273
  insert(generate) {
1272
1274
  eventName.bus.emit(editorId, eventName.REPLACE, "universal", {
1273
1275
  generate
@@ -2756,8 +2758,10 @@ const useResize = (props2, contentRef, resizeRef) => {
2756
2758
  state2.resizedWidth = ibw;
2757
2759
  (_c = props2.oninputBoxWidthChange) == null ? void 0 : _c.call(props2, ibw);
2758
2760
  };
2759
- const resizeMousedown = () => {
2760
- document.addEventListener("mousemove", resizeMousemove);
2761
+ const resizeMousedown = (ev) => {
2762
+ if (ev.target === resizeRef.value) {
2763
+ document.addEventListener("mousemove", resizeMousemove);
2764
+ }
2761
2765
  };
2762
2766
  const resizeMouseup = () => {
2763
2767
  document.removeEventListener("mousemove", resizeMousemove);
@@ -2765,18 +2769,18 @@ const useResize = (props2, contentRef, resizeRef) => {
2765
2769
  vue.watch(
2766
2770
  [resizeRef],
2767
2771
  () => {
2768
- var _a, _b;
2769
- (_a = resizeRef.value) == null ? void 0 : _a.addEventListener("mousedown", resizeMousedown);
2770
- (_b = resizeRef.value) == null ? void 0 : _b.addEventListener("mouseup", resizeMouseup);
2772
+ document.removeEventListener("mousedown", resizeMousedown);
2773
+ document.removeEventListener("mouseup", resizeMouseup);
2774
+ document.addEventListener("mousedown", resizeMousedown);
2775
+ document.addEventListener("mouseup", resizeMouseup);
2771
2776
  },
2772
2777
  {
2773
2778
  immediate: true
2774
2779
  }
2775
2780
  );
2776
2781
  vue.onBeforeUnmount(() => {
2777
- var _a, _b;
2778
- (_a = resizeRef.value) == null ? void 0 : _a.removeEventListener("mousedown", resizeMousedown);
2779
- (_b = resizeRef.value) == null ? void 0 : _b.removeEventListener("mouseup", resizeMouseup);
2782
+ document.removeEventListener("mousedown", resizeMousedown);
2783
+ document.removeEventListener("mouseup", resizeMouseup);
2780
2784
  });
2781
2785
  vue.watch(
2782
2786
  () => props2.inputBoxWidth,
@@ -93,6 +93,10 @@ const props = {
93
93
  disabled: {
94
94
  type: Boolean,
95
95
  default: void 0
96
+ },
97
+ showToolbarName: {
98
+ type: Boolean,
99
+ default: void 0
96
100
  }
97
101
  /**
98
102
  * ==结束
@@ -117,14 +121,13 @@ const ModalToolbar = /* @__PURE__ */ vue.defineComponent({
117
121
  ctx
118
122
  });
119
123
  return vue.createVNode(vue.Fragment, null, [vue.createVNode("div", {
120
- "class": `${config.prefix}-toolbar-item`,
124
+ "class": [`${config.prefix}-toolbar-item`, props2.disabled && `${config.prefix}-disabled`],
121
125
  "title": props2.title,
122
126
  "onClick": () => {
123
- if (props2.onClick instanceof Function) {
124
- props2.onClick();
125
- } else {
126
- ctx.emit("onClick");
127
- }
127
+ var _a;
128
+ if (props2.disabled) return;
129
+ (_a = props2.onClick) == null ? void 0 : _a.call(props2);
130
+ ctx.emit("onClick");
128
131
  }
129
132
  }, [Trigger]), vue.createVNode(MdModal.MdModal, {
130
133
  "style": props2.style,
@@ -46,6 +46,10 @@ const props = {
46
46
  disabled: {
47
47
  type: Boolean,
48
48
  default: void 0
49
+ },
50
+ showToolbarName: {
51
+ type: Boolean,
52
+ default: void 0
49
53
  }
50
54
  /**
51
55
  * ==结束
@@ -66,14 +70,13 @@ const NormalToolbar = /* @__PURE__ */ vue.defineComponent({
66
70
  ctx
67
71
  });
68
72
  return vue.createVNode("div", {
69
- "class": `${config.prefix}-toolbar-item`,
73
+ "class": [`${config.prefix}-toolbar-item`, props2.disabled && `${config.prefix}-disabled`],
70
74
  "title": props2.title,
71
75
  "onClick": (e) => {
72
- if (props2.onClick instanceof Function) {
73
- props2.onClick(e);
74
- } else {
75
- ctx.emit("onClick", e);
76
- }
76
+ var _a;
77
+ if (props2.disabled) return;
78
+ (_a = props2.onClick) == null ? void 0 : _a.call(props2, e);
79
+ ctx.emit("onClick", e);
77
80
  }
78
81
  }, [Default || Trigger]);
79
82
  };
@@ -170,7 +170,7 @@ const zoomMermaid = /* @__PURE__ */ (() => {
170
170
  });
171
171
  };
172
172
  const handler = (containers) => {
173
- containers.forEach((mm) => {
173
+ containers == null ? void 0 : containers.forEach((mm) => {
174
174
  addEvent(mm);
175
175
  });
176
176
  };
@@ -965,7 +965,8 @@ const useMarkdownIt = (props, previewOnly) => {
965
965
  eventName.bus.emit(editorId, eventName.CATALOG_CHANGED, headsRef.value);
966
966
  vue.nextTick(() => {
967
967
  replaceMermaid().then(() => {
968
- dom.zoomMermaid(rootRef.value.querySelectorAll(`#${editorId} .${config.prefix}-mermaid`));
968
+ var _a;
969
+ dom.zoomMermaid((_a = rootRef.value) == null ? void 0 : _a.querySelectorAll(`#${editorId} .${config.prefix}-mermaid`));
969
970
  });
970
971
  });
971
972
  };
@@ -992,8 +993,9 @@ const useMarkdownIt = (props, previewOnly) => {
992
993
  if (props.setting.preview) {
993
994
  vue.nextTick(() => {
994
995
  replaceMermaid().then(() => {
996
+ var _a;
995
997
  dom.zoomMermaid(
996
- rootRef.value.querySelectorAll(`#${editorId} .${config.prefix}-mermaid`)
998
+ (_a = rootRef.value) == null ? void 0 : _a.querySelectorAll(`#${editorId} .${config.prefix}-mermaid`)
997
999
  );
998
1000
  });
999
1001
  eventName.bus.emit(editorId, eventName.CATALOG_CHANGED, headsRef.value);
@@ -187,6 +187,10 @@ const props = {
187
187
  disabled: {
188
188
  type: Boolean,
189
189
  default: void 0
190
+ },
191
+ showToolbarName: {
192
+ type: Boolean,
193
+ default: void 0
190
194
  }
191
195
  /**
192
196
  * ==结束
@@ -221,10 +225,11 @@ const DropdownToolbar = /* @__PURE__ */ vue.defineComponent({
221
225
  ctx.emit("onChange", v);
222
226
  }
223
227
  },
224
- "overlay": Overlay
228
+ "overlay": Overlay,
229
+ "disabled": props2.disabled
225
230
  }, {
226
231
  default: () => [vue.createVNode("div", {
227
- "class": `${config.prefix}-toolbar-item`,
232
+ "class": [`${config.prefix}-toolbar-item`, props2.disabled && `${config.prefix}-disabled`],
228
233
  "title": props2.title || ""
229
234
  }, [Default || Trigger])]
230
235
  });
@@ -508,6 +508,7 @@ const MdCatalog = /* @__PURE__ */ vue.defineComponent({
508
508
  };
509
509
  const findActiveHeading = (list) => {
510
510
  if (list.length === 0) {
511
+ activeItem.value = void 0;
511
512
  state.list = [];
512
513
  return false;
513
514
  }
@@ -7,5 +7,6 @@ exports.allFooter = config.allFooter;
7
7
  exports.allToolbar = config.allToolbar;
8
8
  exports.config = config.config;
9
9
  exports.editorExtensionsAttrs = config.editorExtensionsAttrs;
10
+ exports.prefix = config.prefix;
10
11
  exports.en_US = en_US;
11
12
  exports.zh_CN = zh_CN;
package/lib/cjs/index.cjs CHANGED
@@ -65,13 +65,12 @@ const NormalFooterToolbar = /* @__PURE__ */ vue.defineComponent({
65
65
  ctx
66
66
  });
67
67
  return vue.createVNode("div", {
68
- "class": `${config$1.prefix}-footer-item`,
68
+ "class": [`${config$1.prefix}-footer-item`, props2.disabled && `${config$1.prefix}-disabled`],
69
69
  "onClick": (e) => {
70
- if (props2.onClick instanceof Function) {
71
- props2.onClick(e);
72
- } else {
73
- ctx.emit("onClick", e);
74
- }
70
+ var _a;
71
+ if (props2.disabled) return;
72
+ (_a = props2.onClick) == null ? void 0 : _a.call(props2, e);
73
+ ctx.emit("onClick", e);
75
74
  }
76
75
  }, [Children]);
77
76
  };
@@ -1390,6 +1389,7 @@ exports.allFooter = config$1.allFooter;
1390
1389
  exports.allToolbar = config$1.allToolbar;
1391
1390
  exports.config = config$1.config;
1392
1391
  exports.editorExtensionsAttrs = config$1.editorExtensionsAttrs;
1392
+ exports.prefix = config$1.prefix;
1393
1393
  exports.en_US = config.en_US;
1394
1394
  exports.zh_CN = config.zh_CN;
1395
1395
  exports.NormalFooterToolbar = NormalFooterToolbar;
@@ -589,7 +589,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
589
589
  uploadRef.value.addEventListener("change", uploadHandler);
590
590
  });
591
591
  const barRender = (barItem) => {
592
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya;
592
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa;
593
593
  if (allToolbar.includes(barItem)) {
594
594
  switch (barItem) {
595
595
  case "-": {
@@ -1249,6 +1249,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1249
1249
  language: ((_ra = defItem.props) == null ? void 0 : _ra.theme) || language.value,
1250
1250
  codeTheme: ((_sa = defItem.props) == null ? void 0 : _sa.codeTheme) || props2.codeTheme,
1251
1251
  disabled: ((_ta = defItem.props) == null ? void 0 : _ta.disabled) || (disabled == null ? void 0 : disabled.value),
1252
+ showToolbarName: ((_ua = defItem.props) == null ? void 0 : _ua.showToolbarName) || props2.showToolbarName,
1252
1253
  insert(generate) {
1253
1254
  bus.emit(editorId, REPLACE, "universal", {
1254
1255
  generate
@@ -1262,11 +1263,12 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1262
1263
  const defItem = props2.defToolbars.children[barItem];
1263
1264
  if (defItem) {
1264
1265
  const defItemCloned = cloneVNode(defItem, {
1265
- theme: ((_ua = defItem.props) == null ? void 0 : _ua.theme) || theme.value,
1266
- previewTheme: ((_va = defItem.props) == null ? void 0 : _va.theme) || previewTheme.value,
1267
- language: ((_wa = defItem.props) == null ? void 0 : _wa.theme) || language.value,
1268
- codeTheme: ((_xa = defItem.props) == null ? void 0 : _xa.codeTheme) || props2.codeTheme,
1269
- disabled: ((_ya = defItem.props) == null ? void 0 : _ya.disabled) || (disabled == null ? void 0 : disabled.value),
1266
+ theme: ((_va = defItem.props) == null ? void 0 : _va.theme) || theme.value,
1267
+ previewTheme: ((_wa = defItem.props) == null ? void 0 : _wa.theme) || previewTheme.value,
1268
+ language: ((_xa = defItem.props) == null ? void 0 : _xa.theme) || language.value,
1269
+ codeTheme: ((_ya = defItem.props) == null ? void 0 : _ya.codeTheme) || props2.codeTheme,
1270
+ disabled: ((_za = defItem.props) == null ? void 0 : _za.disabled) || (disabled == null ? void 0 : disabled.value),
1271
+ showToolbarName: ((_Aa = defItem.props) == null ? void 0 : _Aa.showToolbarName) || props2.showToolbarName,
1270
1272
  insert(generate) {
1271
1273
  bus.emit(editorId, REPLACE, "universal", {
1272
1274
  generate
@@ -2755,8 +2757,10 @@ const useResize = (props2, contentRef, resizeRef) => {
2755
2757
  state.resizedWidth = ibw;
2756
2758
  (_c = props2.oninputBoxWidthChange) == null ? void 0 : _c.call(props2, ibw);
2757
2759
  };
2758
- const resizeMousedown = () => {
2759
- document.addEventListener("mousemove", resizeMousemove);
2760
+ const resizeMousedown = (ev) => {
2761
+ if (ev.target === resizeRef.value) {
2762
+ document.addEventListener("mousemove", resizeMousemove);
2763
+ }
2760
2764
  };
2761
2765
  const resizeMouseup = () => {
2762
2766
  document.removeEventListener("mousemove", resizeMousemove);
@@ -2764,18 +2768,18 @@ const useResize = (props2, contentRef, resizeRef) => {
2764
2768
  watch(
2765
2769
  [resizeRef],
2766
2770
  () => {
2767
- var _a, _b;
2768
- (_a = resizeRef.value) == null ? void 0 : _a.addEventListener("mousedown", resizeMousedown);
2769
- (_b = resizeRef.value) == null ? void 0 : _b.addEventListener("mouseup", resizeMouseup);
2771
+ document.removeEventListener("mousedown", resizeMousedown);
2772
+ document.removeEventListener("mouseup", resizeMouseup);
2773
+ document.addEventListener("mousedown", resizeMousedown);
2774
+ document.addEventListener("mouseup", resizeMouseup);
2770
2775
  },
2771
2776
  {
2772
2777
  immediate: true
2773
2778
  }
2774
2779
  );
2775
2780
  onBeforeUnmount(() => {
2776
- var _a, _b;
2777
- (_a = resizeRef.value) == null ? void 0 : _a.removeEventListener("mousedown", resizeMousedown);
2778
- (_b = resizeRef.value) == null ? void 0 : _b.removeEventListener("mouseup", resizeMouseup);
2781
+ document.removeEventListener("mousedown", resizeMousedown);
2782
+ document.removeEventListener("mouseup", resizeMouseup);
2779
2783
  });
2780
2784
  watch(
2781
2785
  () => props2.inputBoxWidth,
@@ -92,6 +92,10 @@ const props = {
92
92
  disabled: {
93
93
  type: Boolean,
94
94
  default: void 0
95
+ },
96
+ showToolbarName: {
97
+ type: Boolean,
98
+ default: void 0
95
99
  }
96
100
  /**
97
101
  * ==结束
@@ -116,14 +120,13 @@ const ModalToolbar = /* @__PURE__ */ defineComponent({
116
120
  ctx
117
121
  });
118
122
  return createVNode(Fragment, null, [createVNode("div", {
119
- "class": `${prefix}-toolbar-item`,
123
+ "class": [`${prefix}-toolbar-item`, props2.disabled && `${prefix}-disabled`],
120
124
  "title": props2.title,
121
125
  "onClick": () => {
122
- if (props2.onClick instanceof Function) {
123
- props2.onClick();
124
- } else {
125
- ctx.emit("onClick");
126
- }
126
+ var _a;
127
+ if (props2.disabled) return;
128
+ (_a = props2.onClick) == null ? void 0 : _a.call(props2);
129
+ ctx.emit("onClick");
127
130
  }
128
131
  }, [Trigger]), createVNode(MdModal, {
129
132
  "style": props2.style,
@@ -45,6 +45,10 @@ const props = {
45
45
  disabled: {
46
46
  type: Boolean,
47
47
  default: void 0
48
+ },
49
+ showToolbarName: {
50
+ type: Boolean,
51
+ default: void 0
48
52
  }
49
53
  /**
50
54
  * ==结束
@@ -65,14 +69,13 @@ const NormalToolbar = /* @__PURE__ */ defineComponent({
65
69
  ctx
66
70
  });
67
71
  return createVNode("div", {
68
- "class": `${prefix}-toolbar-item`,
72
+ "class": [`${prefix}-toolbar-item`, props2.disabled && `${prefix}-disabled`],
69
73
  "title": props2.title,
70
74
  "onClick": (e) => {
71
- if (props2.onClick instanceof Function) {
72
- props2.onClick(e);
73
- } else {
74
- ctx.emit("onClick", e);
75
- }
75
+ var _a;
76
+ if (props2.disabled) return;
77
+ (_a = props2.onClick) == null ? void 0 : _a.call(props2, e);
78
+ ctx.emit("onClick", e);
76
79
  }
77
80
  }, [Default || Trigger]);
78
81
  };
@@ -169,7 +169,7 @@ const zoomMermaid = /* @__PURE__ */ (() => {
169
169
  });
170
170
  };
171
171
  const handler = (containers) => {
172
- containers.forEach((mm) => {
172
+ containers == null ? void 0 : containers.forEach((mm) => {
173
173
  addEvent(mm);
174
174
  });
175
175
  };
@@ -964,7 +964,8 @@ const useMarkdownIt = (props, previewOnly) => {
964
964
  bus.emit(editorId, CATALOG_CHANGED, headsRef.value);
965
965
  nextTick(() => {
966
966
  replaceMermaid().then(() => {
967
- zoomMermaid(rootRef.value.querySelectorAll(`#${editorId} .${prefix}-mermaid`));
967
+ var _a;
968
+ zoomMermaid((_a = rootRef.value) == null ? void 0 : _a.querySelectorAll(`#${editorId} .${prefix}-mermaid`));
968
969
  });
969
970
  });
970
971
  };
@@ -991,8 +992,9 @@ const useMarkdownIt = (props, previewOnly) => {
991
992
  if (props.setting.preview) {
992
993
  nextTick(() => {
993
994
  replaceMermaid().then(() => {
995
+ var _a;
994
996
  zoomMermaid(
995
- rootRef.value.querySelectorAll(`#${editorId} .${prefix}-mermaid`)
997
+ (_a = rootRef.value) == null ? void 0 : _a.querySelectorAll(`#${editorId} .${prefix}-mermaid`)
996
998
  );
997
999
  });
998
1000
  bus.emit(editorId, CATALOG_CHANGED, headsRef.value);
@@ -186,6 +186,10 @@ const props = {
186
186
  disabled: {
187
187
  type: Boolean,
188
188
  default: void 0
189
+ },
190
+ showToolbarName: {
191
+ type: Boolean,
192
+ default: void 0
189
193
  }
190
194
  /**
191
195
  * ==结束
@@ -220,10 +224,11 @@ const DropdownToolbar = /* @__PURE__ */ defineComponent({
220
224
  ctx.emit("onChange", v);
221
225
  }
222
226
  },
223
- "overlay": Overlay
227
+ "overlay": Overlay,
228
+ "disabled": props2.disabled
224
229
  }, {
225
230
  default: () => [createVNode("div", {
226
- "class": `${prefix}-toolbar-item`,
231
+ "class": [`${prefix}-toolbar-item`, props2.disabled && `${prefix}-disabled`],
227
232
  "title": props2.title || ""
228
233
  }, [Default || Trigger])]
229
234
  });
@@ -507,6 +507,7 @@ const MdCatalog = /* @__PURE__ */ defineComponent({
507
507
  };
508
508
  const findActiveHeading = (list) => {
509
509
  if (list.length === 0) {
510
+ activeItem.value = void 0;
510
511
  state.list = [];
511
512
  return false;
512
513
  }
package/lib/es/config.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { s as staticTextDefault } from "./chunks/config.mjs";
2
- import { b, a, c, e } from "./chunks/config.mjs";
2
+ import { b, a, c, e, p } from "./chunks/config.mjs";
3
3
  const zh_CN = staticTextDefault["zh-CN"];
4
4
  const en_US = staticTextDefault["en-US"];
5
5
  export {
@@ -8,5 +8,6 @@ export {
8
8
  c as config,
9
9
  e as editorExtensionsAttrs,
10
10
  en_US,
11
+ p as prefix,
11
12
  zh_CN
12
13
  };
package/lib/es/index.mjs CHANGED
@@ -65,13 +65,12 @@ const NormalFooterToolbar = /* @__PURE__ */ defineComponent({
65
65
  ctx
66
66
  });
67
67
  return createVNode("div", {
68
- "class": `${prefix}-footer-item`,
68
+ "class": [`${prefix}-footer-item`, props2.disabled && `${prefix}-disabled`],
69
69
  "onClick": (e2) => {
70
- if (props2.onClick instanceof Function) {
71
- props2.onClick(e2);
72
- } else {
73
- ctx.emit("onClick", e2);
74
- }
70
+ var _a;
71
+ if (props2.disabled) return;
72
+ (_a = props2.onClick) == null ? void 0 : _a.call(props2, e2);
73
+ ctx.emit("onClick", e2);
75
74
  }
76
75
  }, [Children]);
77
76
  };
@@ -1395,5 +1394,6 @@ export {
1395
1394
  c as config,
1396
1395
  e as editorExtensionsAttrs,
1397
1396
  en_US,
1397
+ prefix,
1398
1398
  zh_CN
1399
1399
  };
@@ -6,6 +6,7 @@ declare const _default: import("vue").DefineComponent<{
6
6
  readonly insert: (() => void) | undefined;
7
7
  readonly language: string | undefined;
8
8
  readonly disabled: boolean | undefined;
9
+ readonly showToolbarName: boolean | undefined;
9
10
  readonly theme: Themes | undefined;
10
11
  readonly previewTheme: string | undefined;
11
12
  readonly codeTheme: string | undefined;
@@ -22,6 +23,7 @@ declare const _default: import("vue").DefineComponent<{
22
23
  readonly insert: (() => void) | undefined;
23
24
  readonly language: string | undefined;
24
25
  readonly disabled: boolean | undefined;
26
+ readonly showToolbarName: boolean | undefined;
25
27
  readonly theme: Themes | undefined;
26
28
  readonly previewTheme: string | undefined;
27
29
  readonly codeTheme: string | undefined;
@@ -40,6 +42,7 @@ declare const _default: import("vue").DefineComponent<{
40
42
  insert: () => void;
41
43
  language: string;
42
44
  disabled: boolean;
45
+ showToolbarName: boolean;
43
46
  theme: Themes;
44
47
  previewTheme: string;
45
48
  codeTheme: string;
@@ -31,4 +31,4 @@ export declare const createHTMLElement: <K extends keyof HTMLElementTagNameMap>(
31
31
  /**
32
32
  * 缩放、拖拽mermaid模块
33
33
  */
34
- export declare const zoomMermaid: (containers: NodeListOf<HTMLElement>) => void;
34
+ export declare const zoomMermaid: (containers?: NodeListOf<HTMLElement>) => void;
@@ -17,6 +17,7 @@ declare const _default: import("vue").DefineComponent<{
17
17
  readonly insert: (() => void) | undefined;
18
18
  readonly language: string | undefined;
19
19
  readonly disabled: boolean | undefined;
20
+ readonly showToolbarName: boolean | undefined;
20
21
  readonly theme: Themes | undefined;
21
22
  readonly previewTheme: string | undefined;
22
23
  readonly codeTheme: string | undefined;
@@ -42,6 +43,7 @@ declare const _default: import("vue").DefineComponent<{
42
43
  readonly insert: (() => void) | undefined;
43
44
  readonly language: string | undefined;
44
45
  readonly disabled: boolean | undefined;
46
+ readonly showToolbarName: boolean | undefined;
45
47
  readonly theme: Themes | undefined;
46
48
  readonly previewTheme: string | undefined;
47
49
  readonly codeTheme: string | undefined;
@@ -65,6 +67,7 @@ declare const _default: import("vue").DefineComponent<{
65
67
  insert: () => void;
66
68
  language: string;
67
69
  disabled: boolean;
70
+ showToolbarName: boolean;
68
71
  theme: Themes;
69
72
  previewTheme: string;
70
73
  codeTheme: string;
@@ -6,6 +6,7 @@ declare const _default: import("vue").DefineComponent<{
6
6
  readonly insert: (() => void) | undefined;
7
7
  readonly language: string | undefined;
8
8
  readonly disabled: boolean | undefined;
9
+ readonly showToolbarName: boolean | undefined;
9
10
  readonly theme: Themes | undefined;
10
11
  readonly previewTheme: string | undefined;
11
12
  readonly codeTheme: string | undefined;
@@ -18,6 +19,7 @@ declare const _default: import("vue").DefineComponent<{
18
19
  readonly insert: (() => void) | undefined;
19
20
  readonly language: string | undefined;
20
21
  readonly disabled: boolean | undefined;
22
+ readonly showToolbarName: boolean | undefined;
21
23
  readonly theme: Themes | undefined;
22
24
  readonly previewTheme: string | undefined;
23
25
  readonly codeTheme: string | undefined;
@@ -32,6 +34,7 @@ declare const _default: import("vue").DefineComponent<{
32
34
  insert: () => void;
33
35
  language: string;
34
36
  disabled: boolean;
37
+ showToolbarName: boolean;
35
38
  theme: Themes;
36
39
  previewTheme: string;
37
40
  codeTheme: string;
@@ -1,3 +1,3 @@
1
- export { config, allToolbar, allFooter, editorExtensionsAttrs } from './MdEditor/config';
1
+ export { prefix, config, allToolbar, allFooter, editorExtensionsAttrs } from './MdEditor/config';
2
2
  export declare const zh_CN: import(".").StaticTextDefaultValue;
3
3
  export declare const en_US: import(".").StaticTextDefaultValue;