md-editor-v3 5.0.2 → 5.1.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.
@@ -20,6 +20,10 @@ const props$1 = {
20
20
  relative: {
21
21
  type: String,
22
22
  default: "html"
23
+ },
24
+ disabled: {
25
+ type: Boolean,
26
+ default: void 0
23
27
  }
24
28
  };
25
29
  const Dropdown = /* @__PURE__ */ vue.defineComponent({
@@ -37,6 +41,9 @@ const Dropdown = /* @__PURE__ */ vue.defineComponent({
37
41
  const overlayRef = vue.ref();
38
42
  const triggerHandler = () => {
39
43
  var _a, _b;
44
+ if (props2.disabled) {
45
+ return false;
46
+ }
40
47
  ctl.triggerHover = true;
41
48
  const triggerEle = triggerRef.value;
42
49
  const overlayEle = overlayRef.value;
@@ -66,6 +73,9 @@ const Dropdown = /* @__PURE__ */ vue.defineComponent({
66
73
  props2.onChange(true);
67
74
  };
68
75
  const overlayHandler = () => {
76
+ if (props2.disabled) {
77
+ return false;
78
+ }
69
79
  ctl.overlayHover = true;
70
80
  };
71
81
  vue.watch(() => props2.visible, (newV) => {
@@ -133,7 +143,11 @@ const props = {
133
143
  type: Boolean,
134
144
  default: void 0
135
145
  },
136
- // 展示在工具栏的内容,通常是个图标
146
+ /**
147
+ * 展示在工具栏的内容,通常是个图标
148
+ *
149
+ * @deprecated 使用默认插槽代替
150
+ */
137
151
  trigger: {
138
152
  type: [String, Object],
139
153
  default: void 0
@@ -170,13 +184,13 @@ const props = {
170
184
  type: String,
171
185
  default: void 0
172
186
  },
187
+ disabled: {
188
+ type: Boolean,
189
+ default: void 0
190
+ }
173
191
  /**
174
192
  * ==结束
175
193
  */
176
- default: {
177
- type: [String, Object],
178
- default: void 0
179
- }
180
194
  };
181
195
  const DropdownToolbar = /* @__PURE__ */ vue.defineComponent({
182
196
  name: "DropdownToolbar",
@@ -212,7 +226,7 @@ const DropdownToolbar = /* @__PURE__ */ vue.defineComponent({
212
226
  default: () => [vue.createVNode("div", {
213
227
  "class": `${config.prefix}-toolbar-item`,
214
228
  "title": props2.title || ""
215
- }, [Trigger, Default])]
229
+ }, [Default || Trigger])]
216
230
  });
217
231
  };
218
232
  }
@@ -53,8 +53,7 @@ const iconMaps = {
53
53
  formula: lucideVueNext.SquareSigma,
54
54
  close: lucideVueNext.X,
55
55
  delete: lucideVueNext.Trash2,
56
- upload: lucideVueNext.Upload,
57
- "collapse-tips": lucideVueNext.CircleChevronDown
56
+ upload: lucideVueNext.Upload
58
57
  };
59
58
  const Icon$1 = /* @__PURE__ */ vue.defineComponent({
60
59
  name: `${config.prefix}-icon-set`,
@@ -97,7 +96,7 @@ const Icon = /* @__PURE__ */ vue.defineComponent({
97
96
  });
98
97
  const props = {
99
98
  title: {
100
- type: String,
99
+ type: [String, Object],
101
100
  default: ""
102
101
  },
103
102
  visible: {
package/lib/cjs/index.cjs CHANGED
@@ -34,7 +34,25 @@ const props = {
34
34
  onClick: {
35
35
  type: Function,
36
36
  default: void 0
37
+ },
38
+ /**
39
+ * ==没有意义,仅用于规避克隆组件自动嵌入insert方法时,传入的是该组件而产生的waring
40
+ */
41
+ language: {
42
+ type: String,
43
+ default: void 0
44
+ },
45
+ theme: {
46
+ type: String,
47
+ default: void 0
48
+ },
49
+ disabled: {
50
+ type: Boolean,
51
+ default: void 0
37
52
  }
53
+ /**
54
+ * ==结束
55
+ */
38
56
  };
39
57
  const NormalFooterToolbar = /* @__PURE__ */ vue.defineComponent({
40
58
  name: "NormalFooterToolbar",
@@ -535,6 +535,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
535
535
  const theme = inject("theme");
536
536
  const previewTheme = inject("previewTheme");
537
537
  const language = inject("language");
538
+ const disabled = inject("disabled");
538
539
  const {
539
540
  fullscreenHandler
540
541
  } = useSreenfull(props2);
@@ -552,6 +553,9 @@ const ToolBar = /* @__PURE__ */ defineComponent({
552
553
  katex: false
553
554
  });
554
555
  const emitHandler = (direct, params) => {
556
+ if (disabled == null ? void 0 : disabled.value) {
557
+ return false;
558
+ }
555
559
  bus.emit(editorId, REPLACE, direct, params);
556
560
  };
557
561
  const modalData = reactive({
@@ -585,7 +589,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
585
589
  uploadRef.value.addEventListener("change", uploadHandler);
586
590
  });
587
591
  const barRender = (barItem) => {
588
- 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;
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;
589
593
  if (allToolbar.includes(barItem)) {
590
594
  switch (barItem) {
591
595
  case "-": {
@@ -593,7 +597,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
593
597
  }
594
598
  case "bold": {
595
599
  return createVNode("div", {
596
- "class": `${prefix}-toolbar-item`,
600
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
597
601
  "title": (_a = ult.value.toolbarTips) == null ? void 0 : _a.bold,
598
602
  "onClick": () => {
599
603
  emitHandler("bold");
@@ -606,7 +610,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
606
610
  }
607
611
  case "underline": {
608
612
  return createVNode("div", {
609
- "class": `${prefix}-toolbar-item`,
613
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
610
614
  "title": (_c = ult.value.toolbarTips) == null ? void 0 : _c.underline,
611
615
  "onClick": () => {
612
616
  emitHandler("underline");
@@ -619,7 +623,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
619
623
  }
620
624
  case "italic": {
621
625
  return createVNode("div", {
622
- "class": `${prefix}-toolbar-item`,
626
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
623
627
  "title": (_e = ult.value.toolbarTips) == null ? void 0 : _e.italic,
624
628
  "onClick": () => {
625
629
  emitHandler("italic");
@@ -632,7 +636,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
632
636
  }
633
637
  case "strikeThrough": {
634
638
  return createVNode("div", {
635
- "class": `${prefix}-toolbar-item`,
639
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
636
640
  "title": (_g = ult.value.toolbarTips) == null ? void 0 : _g.strikeThrough,
637
641
  "onClick": () => {
638
642
  emitHandler("strikeThrough");
@@ -650,6 +654,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
650
654
  "onChange": (v) => {
651
655
  visible.title = v;
652
656
  },
657
+ "disabled": disabled == null ? void 0 : disabled.value,
653
658
  "overlay": createVNode("ul", {
654
659
  "class": `${prefix}-menu`,
655
660
  "onClick": () => {
@@ -703,7 +708,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
703
708
  default: () => {
704
709
  var _a2, _b2;
705
710
  return [createVNode("div", {
706
- "class": `${prefix}-toolbar-item`,
711
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
707
712
  "title": (_a2 = ult.value.toolbarTips) == null ? void 0 : _a2.title
708
713
  }, [createVNode(Icon, {
709
714
  "name": "title"
@@ -715,7 +720,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
715
720
  }
716
721
  case "sub": {
717
722
  return createVNode("div", {
718
- "class": `${prefix}-toolbar-item`,
723
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
719
724
  "title": (_o = ult.value.toolbarTips) == null ? void 0 : _o.sub,
720
725
  "onClick": () => {
721
726
  emitHandler("sub");
@@ -728,7 +733,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
728
733
  }
729
734
  case "sup": {
730
735
  return createVNode("div", {
731
- "class": `${prefix}-toolbar-item`,
736
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
732
737
  "title": (_q = ult.value.toolbarTips) == null ? void 0 : _q.sup,
733
738
  "onClick": () => {
734
739
  emitHandler("sup");
@@ -741,7 +746,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
741
746
  }
742
747
  case "quote": {
743
748
  return createVNode("div", {
744
- "class": `${prefix}-toolbar-item`,
749
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
745
750
  "title": (_s = ult.value.toolbarTips) == null ? void 0 : _s.quote,
746
751
  "onClick": () => {
747
752
  emitHandler("quote");
@@ -754,7 +759,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
754
759
  }
755
760
  case "unorderedList": {
756
761
  return createVNode("div", {
757
- "class": `${prefix}-toolbar-item`,
762
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
758
763
  "title": (_u = ult.value.toolbarTips) == null ? void 0 : _u.unorderedList,
759
764
  "onClick": () => {
760
765
  emitHandler("unorderedList");
@@ -767,7 +772,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
767
772
  }
768
773
  case "orderedList": {
769
774
  return createVNode("div", {
770
- "class": `${prefix}-toolbar-item`,
775
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
771
776
  "title": (_w = ult.value.toolbarTips) == null ? void 0 : _w.orderedList,
772
777
  "onClick": () => {
773
778
  emitHandler("orderedList");
@@ -780,7 +785,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
780
785
  }
781
786
  case "task": {
782
787
  return createVNode("div", {
783
- "class": `${prefix}-toolbar-item`,
788
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
784
789
  "title": (_y = ult.value.toolbarTips) == null ? void 0 : _y.task,
785
790
  "onClick": () => {
786
791
  emitHandler("task");
@@ -793,7 +798,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
793
798
  }
794
799
  case "codeRow": {
795
800
  return createVNode("div", {
796
- "class": `${prefix}-toolbar-item`,
801
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
797
802
  "title": (_A = ult.value.toolbarTips) == null ? void 0 : _A.codeRow,
798
803
  "onClick": () => {
799
804
  emitHandler("codeRow");
@@ -806,7 +811,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
806
811
  }
807
812
  case "code": {
808
813
  return createVNode("div", {
809
- "class": `${prefix}-toolbar-item`,
814
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
810
815
  "title": (_C = ult.value.toolbarTips) == null ? void 0 : _C.code,
811
816
  "onClick": () => {
812
817
  emitHandler("code");
@@ -819,9 +824,12 @@ const ToolBar = /* @__PURE__ */ defineComponent({
819
824
  }
820
825
  case "link": {
821
826
  return createVNode("div", {
822
- "class": `${prefix}-toolbar-item`,
827
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
823
828
  "title": (_E = ult.value.toolbarTips) == null ? void 0 : _E.link,
824
829
  "onClick": () => {
830
+ if (disabled == null ? void 0 : disabled.value) {
831
+ return false;
832
+ }
825
833
  modalData.type = "link";
826
834
  modalData.linkVisible = true;
827
835
  }
@@ -833,9 +841,12 @@ const ToolBar = /* @__PURE__ */ defineComponent({
833
841
  }
834
842
  case "image": {
835
843
  return props2.noUploadImg ? createVNode("div", {
836
- "class": `${prefix}-toolbar-item`,
844
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
837
845
  "title": (_G = ult.value.toolbarTips) == null ? void 0 : _G.image,
838
846
  "onClick": () => {
847
+ if (disabled == null ? void 0 : disabled.value) {
848
+ return false;
849
+ }
839
850
  modalData.type = "image";
840
851
  modalData.linkVisible = true;
841
852
  }
@@ -849,6 +860,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
849
860
  "onChange": (v) => {
850
861
  visible.image = v;
851
862
  },
863
+ "disabled": disabled == null ? void 0 : disabled.value,
852
864
  "overlay": createVNode("ul", {
853
865
  "class": `${prefix}-menu`,
854
866
  "onClick": () => {
@@ -882,7 +894,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
882
894
  default: () => {
883
895
  var _a2, _b2;
884
896
  return [createVNode("div", {
885
- "class": `${prefix}-toolbar-item`,
897
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
886
898
  "title": (_a2 = ult.value.toolbarTips) == null ? void 0 : _a2.image
887
899
  }, [createVNode(Icon, {
888
900
  "name": "image"
@@ -899,6 +911,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
899
911
  "onChange": (v) => {
900
912
  visible.table = v;
901
913
  },
914
+ "disabled": disabled == null ? void 0 : disabled.value,
902
915
  "key": "bar-table",
903
916
  "overlay": createVNode(TableShape, {
904
917
  "tableShape": props2.tableShape,
@@ -912,7 +925,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
912
925
  default: () => {
913
926
  var _a2, _b2;
914
927
  return [createVNode("div", {
915
- "class": `${prefix}-toolbar-item`,
928
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
916
929
  "title": (_a2 = ult.value.toolbarTips) == null ? void 0 : _a2.table
917
930
  }, [createVNode(Icon, {
918
931
  "name": "table"
@@ -924,9 +937,12 @@ const ToolBar = /* @__PURE__ */ defineComponent({
924
937
  }
925
938
  case "revoke": {
926
939
  return createVNode("div", {
927
- "class": `${prefix}-toolbar-item`,
940
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
928
941
  "title": (_L = ult.value.toolbarTips) == null ? void 0 : _L.revoke,
929
942
  "onClick": () => {
943
+ if (disabled == null ? void 0 : disabled.value) {
944
+ return false;
945
+ }
930
946
  bus.emit(editorId, CTRL_Z);
931
947
  }
932
948
  }, [createVNode(Icon, {
@@ -937,9 +953,12 @@ const ToolBar = /* @__PURE__ */ defineComponent({
937
953
  }
938
954
  case "next": {
939
955
  return createVNode("div", {
940
- "class": `${prefix}-toolbar-item`,
956
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
941
957
  "title": (_N = ult.value.toolbarTips) == null ? void 0 : _N.next,
942
958
  "onClick": () => {
959
+ if (disabled == null ? void 0 : disabled.value) {
960
+ return false;
961
+ }
943
962
  bus.emit(editorId, CTRL_SHIFT_Z);
944
963
  }
945
964
  }, [createVNode(Icon, {
@@ -950,9 +969,12 @@ const ToolBar = /* @__PURE__ */ defineComponent({
950
969
  }
951
970
  case "save": {
952
971
  return createVNode("div", {
953
- "class": `${prefix}-toolbar-item`,
972
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
954
973
  "title": (_P = ult.value.toolbarTips) == null ? void 0 : _P.save,
955
974
  "onClick": () => {
975
+ if (disabled == null ? void 0 : disabled.value) {
976
+ return false;
977
+ }
956
978
  bus.emit(editorId, ON_SAVE);
957
979
  }
958
980
  }, [createVNode(Icon, {
@@ -963,7 +985,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
963
985
  }
964
986
  case "prettier": {
965
987
  return !props2.noPrettier ? createVNode("div", {
966
- "class": `${prefix}-toolbar-item`,
988
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
967
989
  "title": (_R = ult.value.toolbarTips) == null ? void 0 : _R.prettier,
968
990
  "onClick": () => {
969
991
  emitHandler("prettier");
@@ -976,9 +998,12 @@ const ToolBar = /* @__PURE__ */ defineComponent({
976
998
  }
977
999
  case "pageFullscreen": {
978
1000
  return !props2.setting.fullscreen && createVNode("div", {
979
- "class": [`${prefix}-toolbar-item`, props2.setting.pageFullscreen && `${prefix}-toolbar-active`],
1001
+ "class": [`${prefix}-toolbar-item`, props2.setting.pageFullscreen && `${prefix}-toolbar-active`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
980
1002
  "title": (_T = ult.value.toolbarTips) == null ? void 0 : _T.pageFullscreen,
981
1003
  "onClick": () => {
1004
+ if (disabled == null ? void 0 : disabled.value) {
1005
+ return false;
1006
+ }
982
1007
  props2.updateSetting("pageFullscreen");
983
1008
  }
984
1009
  }, [createVNode(Icon, {
@@ -989,9 +1014,12 @@ const ToolBar = /* @__PURE__ */ defineComponent({
989
1014
  }
990
1015
  case "fullscreen": {
991
1016
  return createVNode("div", {
992
- "class": [`${prefix}-toolbar-item`, props2.setting.fullscreen && `${prefix}-toolbar-active`],
1017
+ "class": [`${prefix}-toolbar-item`, props2.setting.fullscreen && `${prefix}-toolbar-active`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
993
1018
  "title": (_V = ult.value.toolbarTips) == null ? void 0 : _V.fullscreen,
994
1019
  "onClick": () => {
1020
+ if (disabled == null ? void 0 : disabled.value) {
1021
+ return false;
1022
+ }
995
1023
  fullscreenHandler();
996
1024
  }
997
1025
  }, [createVNode(Icon, {
@@ -1002,9 +1030,12 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1002
1030
  }
1003
1031
  case "preview": {
1004
1032
  return createVNode("div", {
1005
- "class": [`${prefix}-toolbar-item`, props2.setting.preview && `${prefix}-toolbar-active`],
1033
+ "class": [`${prefix}-toolbar-item`, props2.setting.preview && `${prefix}-toolbar-active`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
1006
1034
  "title": (_X = ult.value.toolbarTips) == null ? void 0 : _X.preview,
1007
1035
  "onClick": () => {
1036
+ if (disabled == null ? void 0 : disabled.value) {
1037
+ return false;
1038
+ }
1008
1039
  props2.updateSetting("preview");
1009
1040
  }
1010
1041
  }, [createVNode(Icon, {
@@ -1015,9 +1046,12 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1015
1046
  }
1016
1047
  case "previewOnly": {
1017
1048
  return createVNode("div", {
1018
- "class": [`${prefix}-toolbar-item`, props2.setting.previewOnly && `${prefix}-toolbar-active`],
1049
+ "class": [`${prefix}-toolbar-item`, props2.setting.previewOnly && `${prefix}-toolbar-active`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
1019
1050
  "title": (_Z = ult.value.toolbarTips) == null ? void 0 : _Z.previewOnly,
1020
1051
  "onClick": () => {
1052
+ if (disabled == null ? void 0 : disabled.value) {
1053
+ return false;
1054
+ }
1021
1055
  props2.updateSetting("previewOnly");
1022
1056
  }
1023
1057
  }, [createVNode(Icon, {
@@ -1028,9 +1062,12 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1028
1062
  }
1029
1063
  case "htmlPreview": {
1030
1064
  return createVNode("div", {
1031
- "class": [`${prefix}-toolbar-item`, props2.setting.htmlPreview && `${prefix}-toolbar-active`],
1065
+ "class": [`${prefix}-toolbar-item`, props2.setting.htmlPreview && `${prefix}-toolbar-active`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
1032
1066
  "title": (_$ = ult.value.toolbarTips) == null ? void 0 : _$.htmlPreview,
1033
1067
  "onClick": () => {
1068
+ if (disabled == null ? void 0 : disabled.value) {
1069
+ return false;
1070
+ }
1034
1071
  props2.updateSetting("htmlPreview");
1035
1072
  }
1036
1073
  }, [createVNode(Icon, {
@@ -1041,9 +1078,12 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1041
1078
  }
1042
1079
  case "catalog": {
1043
1080
  return createVNode("div", {
1044
- "class": [`${prefix}-toolbar-item`, props2.catalogVisible && `${prefix}-toolbar-active`],
1081
+ "class": [`${prefix}-toolbar-item`, props2.catalogVisible && `${prefix}-toolbar-active`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
1045
1082
  "title": (_ba = ult.value.toolbarTips) == null ? void 0 : _ba.catalog,
1046
1083
  "onClick": () => {
1084
+ if (disabled == null ? void 0 : disabled.value) {
1085
+ return false;
1086
+ }
1047
1087
  bus.emit(editorId, CHANGE_CATALOG_VISIBLE);
1048
1088
  },
1049
1089
  "key": "bar-catalog"
@@ -1055,9 +1095,14 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1055
1095
  }
1056
1096
  case "github": {
1057
1097
  return createVNode("div", {
1058
- "class": `${prefix}-toolbar-item`,
1098
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
1059
1099
  "title": (_da = ult.value.toolbarTips) == null ? void 0 : _da.github,
1060
- "onClick": () => linkTo("https://github.com/imzbf/md-editor-v3")
1100
+ "onClick": () => {
1101
+ if (disabled == null ? void 0 : disabled.value) {
1102
+ return false;
1103
+ }
1104
+ linkTo("https://github.com/imzbf/md-editor-v3");
1105
+ }
1061
1106
  }, [createVNode(Icon, {
1062
1107
  "name": "github"
1063
1108
  }, null), props2.showToolbarName && createVNode("div", {
@@ -1071,6 +1116,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1071
1116
  "onChange": (v) => {
1072
1117
  visible.mermaid = v;
1073
1118
  },
1119
+ "disabled": disabled == null ? void 0 : disabled.value,
1074
1120
  "overlay": createVNode("ul", {
1075
1121
  "class": `${prefix}-menu`,
1076
1122
  "onClick": () => {
@@ -1139,7 +1185,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1139
1185
  default: () => {
1140
1186
  var _a2, _b2;
1141
1187
  return [createVNode("div", {
1142
- "class": `${prefix}-toolbar-item`,
1188
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
1143
1189
  "title": (_a2 = ult.value.toolbarTips) == null ? void 0 : _a2.mermaid
1144
1190
  }, [createVNode(Icon, {
1145
1191
  "name": "mermaid"
@@ -1156,6 +1202,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1156
1202
  "onChange": (v) => {
1157
1203
  visible.katex = v;
1158
1204
  },
1205
+ "disabled": disabled == null ? void 0 : disabled.value,
1159
1206
  "overlay": createVNode("ul", {
1160
1207
  "class": `${prefix}-menu`,
1161
1208
  "onClick": () => {
@@ -1182,7 +1229,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1182
1229
  default: () => {
1183
1230
  var _a2, _b2;
1184
1231
  return [createVNode("div", {
1185
- "class": `${prefix}-toolbar-item`,
1232
+ "class": [`${prefix}-toolbar-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`],
1186
1233
  "title": (_a2 = ult.value.toolbarTips) == null ? void 0 : _a2.katex
1187
1234
  }, [createVNode(Icon, {
1188
1235
  "name": "formula"
@@ -1201,6 +1248,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1201
1248
  previewTheme: ((_qa = defItem.props) == null ? void 0 : _qa.theme) || previewTheme.value,
1202
1249
  language: ((_ra = defItem.props) == null ? void 0 : _ra.theme) || language.value,
1203
1250
  codeTheme: ((_sa = defItem.props) == null ? void 0 : _sa.codeTheme) || props2.codeTheme,
1251
+ disabled: ((_ta = defItem.props) == null ? void 0 : _ta.disabled) || (disabled == null ? void 0 : disabled.value),
1204
1252
  insert(generate) {
1205
1253
  bus.emit(editorId, REPLACE, "universal", {
1206
1254
  generate
@@ -1214,10 +1262,11 @@ const ToolBar = /* @__PURE__ */ defineComponent({
1214
1262
  const defItem = props2.defToolbars.children[barItem];
1215
1263
  if (defItem) {
1216
1264
  const defItemCloned = cloneVNode(defItem, {
1217
- theme: ((_ta = defItem.props) == null ? void 0 : _ta.theme) || theme.value,
1218
- previewTheme: ((_ua = defItem.props) == null ? void 0 : _ua.theme) || previewTheme.value,
1219
- language: ((_va = defItem.props) == null ? void 0 : _va.theme) || language.value,
1220
- codeTheme: ((_wa = defItem.props) == null ? void 0 : _wa.codeTheme) || props2.codeTheme,
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),
1221
1270
  insert(generate) {
1222
1271
  bus.emit(editorId, REPLACE, "universal", {
1223
1272
  generate
@@ -2869,6 +2918,10 @@ const props$2 = {
2869
2918
  type: Function,
2870
2919
  default: () => {
2871
2920
  }
2921
+ },
2922
+ disabled: {
2923
+ type: Boolean,
2924
+ default: void 0
2872
2925
  }
2873
2926
  };
2874
2927
  const Checkbox = /* @__PURE__ */ defineComponent({
@@ -2877,9 +2930,11 @@ const Checkbox = /* @__PURE__ */ defineComponent({
2877
2930
  setup(props2) {
2878
2931
  return () => {
2879
2932
  return createVNode("div", {
2880
- "class": [`${prefix}-checkbox`, props2.checked && `${prefix}-checkbox-checked`],
2933
+ "class": [`${prefix}-checkbox`, props2.checked && `${prefix}-checkbox-checked`, props2.disabled && `${prefix}-disabled`],
2881
2934
  "onClick": () => {
2882
- props2.onChange(!props2.checked);
2935
+ if (!props2.disabled) {
2936
+ props2.onChange(!props2.checked);
2937
+ }
2883
2938
  }
2884
2939
  }, null);
2885
2940
  };
@@ -2899,18 +2954,20 @@ const ScrollAuto = /* @__PURE__ */ defineComponent({
2899
2954
  props: props$1,
2900
2955
  setup(props2) {
2901
2956
  const ult = inject("usedLanguageText");
2957
+ const disabled = inject("disabled");
2902
2958
  return () => {
2903
2959
  var _a;
2904
2960
  return createVNode("div", {
2905
- "class": `${prefix}-footer-item`
2961
+ "class": [`${prefix}-footer-item`, (disabled == null ? void 0 : disabled.value) && `${prefix}-disabled`]
2906
2962
  }, [createVNode("label", {
2907
2963
  "class": `${prefix}-footer-label`,
2908
2964
  "onClick": () => {
2909
2965
  props2.onScrollAutoChange(!props2.scrollAuto);
2910
2966
  }
2911
- }, [(_a = ult.value.footer) == null ? void 0 : _a.scrollAuto]), createVNode(Checkbox, {
2967
+ }, [(_a = ult == null ? void 0 : ult.value.footer) == null ? void 0 : _a.scrollAuto]), createVNode(Checkbox, {
2912
2968
  "checked": props2.scrollAuto,
2913
- "onChange": props2.onScrollAutoChange
2969
+ "onChange": props2.onScrollAutoChange,
2970
+ "disabled": disabled == null ? void 0 : disabled.value
2914
2971
  }, null)]);
2915
2972
  };
2916
2973
  }
@@ -2943,6 +3000,9 @@ const Footer = /* @__PURE__ */ defineComponent({
2943
3000
  name: "MDEditorFooter",
2944
3001
  props,
2945
3002
  setup(props2) {
3003
+ const theme = inject("theme");
3004
+ const language = inject("language");
3005
+ const disabled = inject("disabled");
2946
3006
  const splitedItems = computed(() => {
2947
3007
  const moduleSplitIndex = props2.footers.indexOf("=");
2948
3008
  const barLeft = moduleSplitIndex === -1 ? props2.footers : props2.footers.slice(0, moduleSplitIndex);
@@ -2950,6 +3010,7 @@ const Footer = /* @__PURE__ */ defineComponent({
2950
3010
  return [barLeft, barRight];
2951
3011
  });
2952
3012
  const footerRender = (name) => {
3013
+ var _a, _b, _c, _d, _e, _f;
2953
3014
  if (allFooter.includes(name)) {
2954
3015
  switch (name) {
2955
3016
  case "markdownTotal": {
@@ -2965,9 +3026,27 @@ const Footer = /* @__PURE__ */ defineComponent({
2965
3026
  }
2966
3027
  }
2967
3028
  } else if (props2.defFooters instanceof Array) {
2968
- return props2.defFooters[name] || "";
3029
+ const defItem = props2.defFooters[name];
3030
+ if (defItem) {
3031
+ const defItemCloned = cloneVNode(defItem, {
3032
+ theme: ((_a = defItem.props) == null ? void 0 : _a.theme) || theme.value,
3033
+ language: ((_b = defItem.props) == null ? void 0 : _b.language) || language.value,
3034
+ disabled: ((_c = defItem.props) == null ? void 0 : _c.disabled) || (disabled == null ? void 0 : disabled.value)
3035
+ });
3036
+ return defItemCloned;
3037
+ }
3038
+ return "";
2969
3039
  } else if (props2.defFooters && props2.defFooters.children instanceof Array) {
2970
- return props2.defFooters.children[name] || "";
3040
+ const defItem = props2.defFooters.children[name];
3041
+ if (defItem) {
3042
+ const defItemCloned = cloneVNode(defItem, {
3043
+ theme: ((_d = defItem.props) == null ? void 0 : _d.theme) || theme.value,
3044
+ language: ((_e = defItem.props) == null ? void 0 : _e.language) || language.value,
3045
+ disabled: ((_f = defItem.props) == null ? void 0 : _f.disabled) || (disabled == null ? void 0 : disabled.value)
3046
+ });
3047
+ return defItemCloned;
3048
+ }
3049
+ return "";
2971
3050
  } else {
2972
3051
  return "";
2973
3052
  }
@@ -11,7 +11,7 @@ const props = {
11
11
  default: ""
12
12
  },
13
13
  modalTitle: {
14
- type: String,
14
+ type: [String, Object],
15
15
  default: ""
16
16
  },
17
17
  visible: {
@@ -88,6 +88,10 @@ const props = {
88
88
  codeTheme: {
89
89
  type: String,
90
90
  default: void 0
91
+ },
92
+ disabled: {
93
+ type: Boolean,
94
+ default: void 0
91
95
  }
92
96
  /**
93
97
  * ==结束
@@ -103,10 +107,14 @@ const ModalToolbar = /* @__PURE__ */ defineComponent({
103
107
  props: props2,
104
108
  ctx
105
109
  }, "trigger");
110
+ const ModalTitle = getSlot({
111
+ props: props2,
112
+ ctx
113
+ }, "modalTitle");
106
114
  const Default = getSlot({
107
115
  props: props2,
108
116
  ctx
109
- }, "default");
117
+ });
110
118
  return createVNode(Fragment, null, [createVNode("div", {
111
119
  "class": `${prefix}-toolbar-item`,
112
120
  "title": props2.title,
@@ -122,7 +130,7 @@ const ModalToolbar = /* @__PURE__ */ defineComponent({
122
130
  "class": props2.class,
123
131
  "width": props2.width,
124
132
  "height": props2.height,
125
- "title": props2.modalTitle,
133
+ "title": ModalTitle,
126
134
  "visible": props2.visible,
127
135
  "showMask": props2.showMask,
128
136
  "onClose": () => {