vue-devui 1.5.10 → 1.5.11-hotfix.1

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/vue-devui.es.js CHANGED
@@ -10841,7 +10841,8 @@ var avatar = "";
10841
10841
  var Avatar = defineComponent({
10842
10842
  name: "DAvatar",
10843
10843
  props: avatarProps,
10844
- setup(props) {
10844
+ emits: ["loadError"],
10845
+ setup(props, ctx2) {
10845
10846
  const {
10846
10847
  name,
10847
10848
  width,
@@ -10903,8 +10904,9 @@ var Avatar = defineComponent({
10903
10904
  }
10904
10905
  getBackgroundColor(nameValue.substr(0, 1));
10905
10906
  };
10906
- const showErrorAvatar = () => {
10907
+ const showErrorAvatar = (e) => {
10907
10908
  isErrorImg.value = true;
10909
+ ctx2.emit("loadError", e);
10908
10910
  };
10909
10911
  const calcValues = (nameInput) => {
10910
10912
  const userName = nameInput;
@@ -10967,7 +10969,7 @@ var Avatar = defineComponent({
10967
10969
  "width": width.value,
10968
10970
  "height": height.value
10969
10971
  }, null)]);
10970
- const noBody = !imgSrc.value && isNobody.value || isErrorImg.value ? noBodyElement : null;
10972
+ const noBody = !imgSrc.value && isNobody.value || imgSrc.value && isErrorImg.value ? noBodyElement : null;
10971
10973
  return createVNode("span", {
10972
10974
  "class": ns2.b()
10973
10975
  }, [hasImgSrc, hasNameDisplay, hasNoDisplayName, noBody]);
@@ -23529,7 +23531,7 @@ function useKeydown(props, ctx2) {
23529
23531
  document.removeEventListener("keydown", handleKeydown);
23530
23532
  });
23531
23533
  }
23532
- const ns$e = useNamespace$1("fullscreen");
23534
+ const ns$e = useNamespace("fullscreen");
23533
23535
  const launchNormalFullscreen = (targetElement, props) => {
23534
23536
  targetElement.classList.add(ns$e.b());
23535
23537
  if (props.zIndex) {
@@ -23603,7 +23605,7 @@ function useFullscreen(props, slotElement, ctx2) {
23603
23605
  });
23604
23606
  const handleFullscreenChange = () => {
23605
23607
  if (!document.fullscreenElement) {
23606
- ctx2.emit("update:modelValue");
23608
+ ctx2.emit("update:modelValue", false);
23607
23609
  exitByKeydown = true;
23608
23610
  } else {
23609
23611
  exitByKeydown = false;
@@ -23635,2316 +23637,2321 @@ var Fullscreen = defineComponent({
23635
23637
  });
23636
23638
  var FullscreenInstall = {
23637
23639
  title: "Fullscreen \u5168\u5C4F",
23638
- category: "\u901A\u7528",
23639
- status: "100%",
23640
+ category: "\u57FA\u7840\u7EC4\u4EF6",
23640
23641
  install(app) {
23641
23642
  app.component(Fullscreen.name, Fullscreen);
23642
23643
  }
23643
23644
  };
23644
- const UNDO_ICON = `<svg width="16px" height="14px" viewBox="0 0 16 14">
23645
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23646
- <g fill="#293040">
23647
- <path d="M11,5 C13.7614237,5 16,7.23857625 16,10 C16,12.7614237 13.7614237,15 11,15 L7,15 L7,14 L11,14 C13.209139,14 15,12.209139 15,10 C15,7.790861 13.209139,6 11,6 L5,6 L5,10 L0,5.5 L5,1 L5,5 L11,5 Z" id="\u8DEF\u5F84"></path>
23648
- </g>
23649
- </g>
23650
- </svg>`;
23651
- const REDO_ICON = `<svg width="16px" height="14px" viewBox="0 0 16 14">
23652
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23653
- <g fill="#293040">
23654
- <path d="M5,5 L11,5 L11,1 L16,5.5 L11,10 L11,6 L5,6 C2.790861,6 1,7.790861 1,10 C1,12.209139 2.790861,14 5,14 L9,14 L9,15 L5,15 C2.23857625,15 0,12.7614237 0,10 C0,7.23857625 2.23857625,5 5,5 Z" id="\u8DEF\u5F84"></path>
23655
- </g>
23656
- </g>
23657
- </svg>`;
23658
- const BOLD_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23659
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23660
- <g fill="#293040">
23661
- <path d="M14,11 C14,13.7614237 11.7614237,16 9,16 L2,16 L2,0 L8,0 C10.209139,-4.05812251e-16 12,1.790861 12,4 C12,4.93647913 11.6781808,5.79779336 11.1391019,6.4793831 C12.8303741,7.28108833 14,9.00395379 14,11 Z M9,8 L4,8 L4,14 L9,14 C10.6568542,14 12,12.6568542 12,11 C12,9.34314575 10.6568542,8 9,8 Z M8,6 C9.1045695,6 10,5.1045695 10,4 C10,2.8954305 9.1045695,2 8,2 L4,2 L4,6 L8,6 Z" id="\u5F62\u72B6"></path>
23662
- </g>
23663
- </g>
23664
- </svg>`;
23665
- const ITALIC_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23666
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23667
- <g fill="#293040">
23668
- <polygon id="\u8DEF\u5F84" points="6 15 9 1 6 1 6 0 13 0 13 1 10 1 7 15 10 15 10 16 3 16 3 15"></polygon>
23669
- </g>
23670
- </g>
23671
- </svg>`;
23672
- const UNDERLINE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23673
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23674
- <g fill="#293040">
23675
- <path d="M4,0 L4,7 C4,9.209139 5.790861,11 8,11 C10.209139,11 12,9.209139 12,7 L12,0 L13,0 L13,7 C13,9.76142375 10.7614237,12 8,12 C5.23857625,12 3,9.76142375 3,7 L3,0 L4,0 Z M2,14 L14,14 L14,16 L2,16 L2,14 Z" id="\u5F62\u72B6"></path>
23676
- </g>
23677
- </g>
23678
- </svg>`;
23679
- const STRIKE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23680
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23681
- <g fill="#293040">
23682
- <path d="M16,8 L16,10 L11.4648712,10 C11.8052114,10.5883467 12,11.2714257 12,12 C12,14.209139 10.209139,16 8,16 C5.790861,16 4,14.209139 4,12 C4,11.6547004 4.043753,11.3196199 4.12601749,11 L5.17070571,11 C5.06015422,11.3127789 5,11.6493646 5,12 C5,13.6568542 6.34314575,15 8,15 C9.65685425,15 11,13.6568542 11,12 C11,11.2316456 10.7111464,10.5307565 10.2361065,10 L0,10 L0,8 L5.3541756,8 C4.52375489,7.26705555 4,6.19469253 4,5 C4,2.790861 5.790861,1 8,1 C10.209139,1 12,2.790861 12,5 C12,5.72857429 11.8052114,6.41165327 11.4648712,7 L10.2361065,7 C10.7111464,6.46924351 11,5.76835444 11,5 C11,3.34314575 9.65685425,2 8,2 C6.34314575,2 5,3.34314575 5,5 C5,6.65685425 6.34314575,8 8,8 L16,8 Z M4.53512878,10 L5.76389349,10 L4.53512878,10 L4.53512878,10 Z" id="\u5F62\u72B6"></path>
23683
- </g>
23684
- </g>
23685
- </svg>`;
23686
- const COLOR_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23687
- <g id="edit-icon/background-color" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23688
- <g fill="#293040">
23689
- <g>
23690
- <path d="M10.4761905,8 L5.52380952,8 L4,12 L3,12 L7.5,-3.84581256e-13 L8.5,-3.84581256e-13 L13,12 L12,12 L10.4761905,8 L10.4761905,8 Z M10.0952381,7 L8,1.5 L5.9047619,7 L10.0952381,7 Z M2,14 L14,14 L14,16 L2,16 L2,14 Z" id="\u5F62\u72B6"></path>
23691
- </g>
23692
- </g>
23693
- </g>
23694
- </svg>`;
23695
- const LIST_UNORDERED_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23696
- <g id="edit-icon/unordered-list" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23697
- <g fill="#293040">
23698
- <g>
23699
- <path d="M5,1 L16,1 L16,2.5 L5,2.5 L5,1 Z M2,4 C0.8954305,4 0,3.1045695 0,2 C0,0.8954305 0.8954305,0 2,0 C3.1045695,0 4,0.8954305 4,2 C4,3.1045695 3.1045695,4 2,4 Z M2,3 C2.55228475,3 3,2.55228475 3,2 C3,1.44771525 2.55228475,1 2,1 C1.44771525,1 1,1.44771525 1,2 C1,2.55228475 1.44771525,3 2,3 Z M2,10 C0.8954305,10 0,9.1045695 0,8 C0,6.8954305 0.8954305,6 2,6 C3.1045695,6 4,6.8954305 4,8 C4,9.1045695 3.1045695,10 2,10 Z M2,9 C2.55228475,9 3,8.55228475 3,8 C3,7.44771525 2.55228475,7 2,7 C1.44771525,7 1,7.44771525 1,8 C1,8.55228475 1.44771525,9 2,9 Z M2,16 C0.8954305,16 0,15.1045695 0,14 C0,12.8954305 0.8954305,12 2,12 C3.1045695,12 4,12.8954305 4,14 C4,15.1045695 3.1045695,16 2,16 Z M2,15 C2.55228475,15 3,14.5522847 3,14 C3,13.4477153 2.55228475,13 2,13 C1.44771525,13 1,13.4477153 1,14 C1,14.5522847 1.44771525,15 2,15 Z M5,7 L16,7 L16,8.5 L5,8.5 L5,7 Z M5,13 L16,13 L16,14.5 L5,14.5 L5,13 Z" id="\u5F62\u72B6"></path>
23700
- </g>
23701
- </g>
23702
- </g>
23703
- </svg>`;
23704
- const LIST_ORDERED_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23705
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23706
- <g fill="#293040">
23707
- <path d="M5,1 L16,1 L16,2.5 L5,2.5 L5,1 Z M0,0 L2,0 L2,3 L3,3 L3,4 L0,4 L0,3 L1,3 L1,1 L0,1 L0,0 Z M5,7 L16,7 L16,8.5 L5,8.5 L5,7 Z M5,13 L16,13 L16,14.5 L5,14.5 L5,13 Z M0,15 L1.75,15 C1.88807119,15 2,14.8880712 2,14.75 C2,14.6119288 1.88807119,14.5 1.75,14.5 L0,14.5 L0,13.5 L1.75,13.5 C1.88807119,13.5 2,13.3880712 2,13.25 C2,13.1119288 1.88807119,13 1.75,13 L0,13 L0,12 L1.5,12 C2.32842712,12 3,12.6715729 3,13.5 C3,13.6753177 2.96992289,13.8436105 2.91464715,14 C2.96992289,14.1563895 3,14.3246823 3,14.5 C3,15.3284271 2.32842712,16 1.5,16 L0,16 L0,15 Z M2,7.5 C2,7.35127258 1.9375,7.22627258 1.84375,7.13845444 C1.76307119,7.05596441 1.63807119,7 1.5,7 C1.22385763,7 1,7.22385763 1,7.5 L1.62630326e-19,7.5 C0.147399902,6.5 0.647399902,6 1.5,6 C2.32842712,6 3,6.67157288 3,7.5 C3,8.07312512 2.50016007,8.55650475 2.22821045,8.74661255 C1.95626083,8.93672035 1.77325955,8.99789088 1.76769962,9 L3,9 L3,10 L0,10 L1.62630326e-19,9 C0.619515577,8.77257137 1.06188822,8.55939591 1.32711792,8.36047363 C1.6371448,8.12795347 1.87259637,7.91592701 1.96143498,7.69289356 C1.98627694,7.633537 2,7.5683711 2,7.5 Z" id="\u5F62\u72B6"></path>
23708
- </g>
23709
- </g>
23710
- </svg>`;
23711
- const LIST_CHECK_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23712
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23713
- <path d="M14,15 L14,9.37100497 L15,9.37100497 L15,16 L1,16 L1,2 L10.1946467,2 L10.1946467,3 L2,3 L2,15 L14,15 Z M14.4525049,2.48740937 C14.7356009,2.1850362 15.2102174,2.16940895 15.5125906,2.45250493 C15.8149638,2.73560092 15.8305911,3.21021745 15.5474951,3.51259063 L8.45990379,11.0828057 L4.46558382,7.02621226 C4.17496481,6.73106236 4.17863783,6.25620283 4.47378774,5.96558382 C4.76893764,5.67496481 5.24379717,5.67863783 5.53441618,5.97378774 L8.43263799,8.91719429 L14.4525049,2.48740937 Z" id="\u5F62\u72B6\u7ED3\u5408" fill="#293040" fill-rule="nonzero"></path>
23714
- </g>
23715
- </svg>`;
23716
- const IMAGE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23717
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23718
- <path d="M0,1 L16,1 L16,15 L0,15 L0,1 Z M1,2 L1,14 L15,14 L15,2 L1,2 Z M12,10 L9,11 L4,8 L1,10 L1,9 L4,7 L9,10 L12,9 L15,11 L15,12 L12,10 Z M12,7 C11.4477153,7 11,6.55228475 11,6 C11,5.44771525 11.4477153,5 12,5 C12.5522847,5 13,5.44771525 13,6 C13,6.55228475 12.5522847,7 12,7 Z" id="\u5F62\u72B6" fill="#293040"></path>
23719
- </g>
23720
- </svg>`;
23721
- const FILE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23722
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23723
- <path d="M16,16 L1,16 L1,0 L12,0 L16,4 L16,16 Z M11,1 L2,1 L2,15 L15,15 L15,5 L11,5 L11,1 Z M12,1.533 L12,4 L14.52,4 L12,1.533 Z" fill-rule="nonzero" id="\u5F62\u72B6" fill="#293040"></path>
23724
- <polygon id="path" fill="#293040" points="8 8 6 8 8.5 5 11 8 9 8 9 12 8 12"></polygon>
23725
- </g>
23726
- </svg>`;
23727
- const TABLE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23728
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23729
- <path d="M6,11 L10,11 L10,8 L6,8 L6,11 Z M6,12 L6,15 L5,15 L5,12 L1,12 L1,11 L5,11 L5,8 L1,8 L1,7 L15,7 L15,8 L11,8 L11,11 L15,11 L15,12 L11,12 L11,15 L10,15 L10,12 L6,12 Z M1,0 L15,0 C15.5522847,0 16,0.44771525 16,1 L16,15 C16,15.5522847 15.5522847,16 15,16 L1,16 C0.44771525,16 0,15.5522847 0,15 L0,1 C0,0.44771525 0.44771525,0 1,0 Z M1,1 L1,15 L15,15 L15,1 L1,1 Z" id="\u5F62\u72B6" fill="#293040"></path>
23730
- </g>
23731
- </svg>`;
23732
- const LINK_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23733
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23734
- <path d="M4.499,10.863 L10.863,4.499 L11.573,5.209 L5.209,11.573 L4.499,10.863 Z M3.64649819,6.99452063 C3.66194719,7.01086151 3.67767307,7.02703631 3.69367584,7.04303908 L4.38852082,7.73788406 L1.80224782,10.3241571 C0.732584061,11.3938208 0.732584061,13.1280884 1.80224782,14.1977522 C2.87191157,15.2674159 4.60617918,15.2674159 5.67584293,14.1977522 L8.26211594,11.6114792 L8.95696092,12.3063242 C8.97296369,12.3223269 8.98913849,12.3380528 9.00547937,12.3535018 L6.46886252,14.8901187 C4.98902073,16.3699604 2.58972313,16.3699604 1.10988134,14.8901187 C-0.369960447,13.4102769 -0.369960447,11.0109793 1.10988134,9.53113748 L3.64649819,6.99452063 Z M6.99452063,3.64649819 L9.53113748,1.10988134 C11.0109793,-0.369960447 13.4102769,-0.369960447 14.8901187,1.10988134 C16.3699604,2.58972313 16.3699604,4.98902073 14.8901187,6.46886252 L12.3535018,9.00547937 C12.3380528,8.98913849 12.3223269,8.97296369 12.3063242,8.95696092 L11.6114792,8.26211594 L14.1977522,5.67584293 C15.2674159,4.60617918 15.2674159,2.87191157 14.1977522,1.80224782 C13.1280884,0.732584061 11.3938208,0.732584061 10.3241571,1.80224782 L7.73788406,4.38852082 L7.04303908,3.69367584 C7.02703631,3.67767307 7.01086151,3.66194719 6.99452063,3.64649819 Z" id="\u5F62\u72B6" fill="#293040" fill-rule="nonzero"></path>
23735
- </g>
23736
- </svg>`;
23737
- const CODE_ICON = `<svg viewBox="0 0 1024 1024" width="16" height="16">
23738
- <path d="M438.4 849.1l222.7-646.7c0.2-0.5 0.3-1.1 0.4-1.6L438.4 849.1z" p-id="13752"></path>
23739
- <path d="M661.2 168.7h-67.5c-3.4 0-6.5 2.2-7.6 5.4L354.7 846c-0.3 0.8-0.4 1.7-0.4 2.6 0 4.4 3.6 8 8 8h67.8c3.4 0 6.5-2.2 7.6-5.4l0.7-2.1 223.1-648.3 7.4-21.4c0.3-0.8 0.4-1.7 0.4-2.6-0.1-4.5-3.6-8.1-8.1-8.1zM954.6 502.1c-0.8-1-1.7-1.9-2.7-2.7l-219-171.3c-3.5-2.7-8.5-2.1-11.2 1.4-1.1 1.4-1.7 3.1-1.7 4.9v81.3c0 2.5 1.1 4.8 3.1 6.3l115 90-115 90c-1.9 1.5-3.1 3.8-3.1 6.3v81.3c0 4.4 3.6 8 8 8 1.8 0 3.5-0.6 4.9-1.7l219-171.3c6.9-5.4 8.2-15.5 2.7-22.5zM291.1 328.1l-219 171.3c-1 0.8-1.9 1.7-2.7 2.7-5.4 7-4.2 17 2.7 22.5l219 171.3c1.4 1.1 3.1 1.7 4.9 1.7 4.4 0 8-3.6 8-8v-81.3c0-2.5-1.1-4.8-3.1-6.3l-115-90 115-90c1.9-1.5 3.1-3.8 3.1-6.3v-81.3c0-1.8-0.6-3.5-1.7-4.9-2.7-3.5-7.7-4.1-11.2-1.4z" p-id="13753"></path>
23740
- </svg>`;
23741
- const H1_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23742
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23743
- <path d="M0,0 L16,0 L16,16 L0,16 L0,0 Z M1,1 L1,15 L15,15 L15,1 L1,1 Z M12,12 L13,12 L13,13 L10,13 L10,12 L11,12 L11,9 L10,9 L10,8 L12,8 L12,12 Z M3,3 L11,3 L11,4 L3,4 L3,3 Z" id="\u5F62\u72B6" fill="#293040"></path>
23744
- </g>
23745
- </svg>`;
23746
- const H2_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23747
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23748
- <path d="M0,16 L0,0 L16,0 L16,16 L0,16 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M11,4 L3,4 L3,3 L11,3 L11,4 Z M13,8 L13,11 L10,11 L10,12 L13,12 L13,13 L9,13 L9,10 L12,10 L12,9 L9,9 L9,8 L13,8 Z" id="\u5F62\u72B6" fill="#293040"></path>
23749
- </g>
23750
- </svg>`;
23751
- const FONT_SIZE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16" >
23752
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23753
- <g fill="#293040">
23754
- <path d="M4,9 L4,16 L3,16 L3,9 L0,9 L0,8 L7,8 L7,9 L4,9 Z M11,1 L11,16 L10,16 L10,1 L5,1 L5,0 L16,0 L16,1 L11,1 Z" id="\u5F62\u72B6"></path>
23755
- </g>
23756
- </g>
23757
- </svg>`;
23758
- const FULLSCREEN_EXPAND_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
23759
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
23760
- <path d="M16,16 L11.429,16 L11.429,15 L14.456,15 L11.006,11.226 L11.652,10.519 L15.086,14.275 L15.086,11 L16,11 L16,16 Z M15.164,1.544 L12.009,4.994 L11.418,4.348 L14.558,0.914 L11.82,0.914 L11.82,0 L16,0 L16,4.571 L15.164,4.571 L15.164,1.544 Z M5,15 L5,16 L0,16 L0,11 L1,11 L1,14.275 L4.756,10.519 L5.463,11.226 L1.689,15 L5,15 Z M4.365,4.994 L0.914,1.544 L0.914,4.571 L3.41060513e-13,4.571 L3.41060513e-13,0 L4.571,0 L4.571,0.914 L1.578,0.914 L5.011,4.348 L4.365,4.994 Z" id="\u5F62\u72B6" fill="#293040" fill-rule="nonzero"></path>
23761
- </g>
23762
- </svg>`;
23763
- const FULLSCREEN_CONTRACT_ICON = `<svg class="icon" viewBox="0 0 1024 1024" width="16" height="16">
23764
- <path fill="#293040" d="M682.666667 384h192a21.333333 21.333333 0 0 0 21.333333-21.333333v-42.666667a21.333333 21.333333 0 0 0-21.333333-21.333333H725.333333V149.333333a21.333333 21.333333 0 0 0-21.333333-21.333333h-42.666667a21.333333 21.333333 0 0 0-21.333333 21.333333V341.333333a42.666667 42.666667 0 0 0 42.666667 42.666667zM384 341.333333V149.333333a21.333333 21.333333 0 0 0-21.333333-21.333333h-42.666667a21.333333 21.333333 0 0 0-21.333333 21.333333V298.666667H149.333333a21.333333 21.333333 0 0 0-21.333333 21.333333v42.666667a21.333333 21.333333 0 0 0 21.333333 21.333333H341.333333a42.666667 42.666667 0 0 0 42.666667-42.666667z m341.333333 533.333334V725.333333h149.333334a21.333333 21.333333 0 0 0 21.333333-21.333333v-42.666667a21.333333 21.333333 0 0 0-21.333333-21.333333H682.666667a42.666667 42.666667 0 0 0-42.666667 42.666667v192a21.333333 21.333333 0 0 0 21.333333 21.333333h42.666667a21.333333 21.333333 0 0 0 21.333333-21.333333z m-405.333333 21.333333h42.666667a21.333333 21.333333 0 0 0 21.333333-21.333333V682.666667a42.666667 42.666667 0 0 0-42.666667-42.666667H149.333333a21.333333 21.333333 0 0 0-21.333333 21.333333v42.666667a21.333333 21.333333 0 0 0 21.333333 21.333333H298.666667v149.333334a21.333333 21.333333 0 0 0 21.333333 21.333333z" p-id="17085"></path>
23765
- </svg>`;
23766
- class ToolBarHandler {
23645
+ function listCacheClear$1() {
23646
+ this.__data__ = [];
23647
+ this.size = 0;
23767
23648
  }
23768
- __publicField(ToolBarHandler, "undo", (editor) => {
23769
- editor.undo();
23770
- });
23771
- __publicField(ToolBarHandler, "redo", (editor) => {
23772
- editor.redo();
23773
- });
23774
- __publicField(ToolBarHandler, "bold", (editor) => {
23775
- const cursor = editor.getCursor();
23776
- const selection = editor.getSelection();
23777
- editor.replaceSelection("**" + selection + "**");
23778
- editor.focus();
23779
- if (selection === "") {
23780
- editor.setCursor(cursor.line, cursor.ch + 2);
23781
- }
23782
- });
23783
- __publicField(ToolBarHandler, "italic", (editor) => {
23784
- const cursor = editor.getCursor();
23785
- const selection = editor.getSelection();
23786
- editor.replaceSelection("*" + selection + "*");
23787
- editor.focus();
23788
- if (selection === "") {
23789
- editor.setCursor(cursor.line, cursor.ch + 1);
23790
- }
23791
- });
23792
- __publicField(ToolBarHandler, "h1", (editor) => {
23793
- const cursor = editor.getCursor();
23794
- const selection = editor.getSelection();
23795
- editor.focus();
23796
- if (cursor.ch !== 0) {
23797
- editor.setCursor(cursor.line, 0);
23798
- editor.replaceSelection("# " + selection);
23799
- editor.setCursor(cursor.line, cursor.ch + 2);
23800
- } else {
23801
- editor.replaceSelection("# " + selection);
23649
+ var _listCacheClear = listCacheClear$1;
23650
+ function eq$2(value, other) {
23651
+ return value === other || value !== value && other !== other;
23652
+ }
23653
+ var eq_1 = eq$2;
23654
+ var eq$1 = eq_1;
23655
+ function assocIndexOf$4(array4, key) {
23656
+ var length = array4.length;
23657
+ while (length--) {
23658
+ if (eq$1(array4[length][0], key)) {
23659
+ return length;
23660
+ }
23802
23661
  }
23803
- });
23804
- __publicField(ToolBarHandler, "h2", (editor) => {
23805
- const cursor = editor.getCursor();
23806
- const selection = editor.getSelection();
23807
- editor.focus();
23808
- if (cursor.ch !== 0) {
23809
- editor.setCursor(cursor.line, 0);
23810
- editor.replaceSelection("## " + selection);
23811
- editor.setCursor(cursor.line, cursor.ch + 3);
23812
- } else {
23813
- editor.replaceSelection("## " + selection);
23662
+ return -1;
23663
+ }
23664
+ var _assocIndexOf = assocIndexOf$4;
23665
+ var assocIndexOf$3 = _assocIndexOf;
23666
+ var arrayProto = Array.prototype;
23667
+ var splice = arrayProto.splice;
23668
+ function listCacheDelete$1(key) {
23669
+ var data = this.__data__, index2 = assocIndexOf$3(data, key);
23670
+ if (index2 < 0) {
23671
+ return false;
23814
23672
  }
23815
- });
23816
- __publicField(ToolBarHandler, "ul", (editor) => {
23817
- const selection = editor.getSelection();
23818
- editor.focus();
23819
- if (selection === "") {
23820
- editor.replaceSelection("- " + selection);
23673
+ var lastIndex = data.length - 1;
23674
+ if (index2 == lastIndex) {
23675
+ data.pop();
23821
23676
  } else {
23822
- const selectionText = selection.split("\n");
23823
- for (let i = 0, len = selectionText.length; i < len; i++) {
23824
- selectionText[i] = selectionText[i] === "" ? "" : "- " + selectionText[i];
23825
- }
23826
- editor.replaceSelection(selectionText.join("\n"));
23677
+ splice.call(data, index2, 1);
23827
23678
  }
23828
- });
23829
- __publicField(ToolBarHandler, "ol", (editor) => {
23830
- const selection = editor.getSelection();
23831
- editor.focus();
23832
- if (selection === "") {
23833
- editor.replaceSelection("1. " + selection);
23679
+ --this.size;
23680
+ return true;
23681
+ }
23682
+ var _listCacheDelete = listCacheDelete$1;
23683
+ var assocIndexOf$2 = _assocIndexOf;
23684
+ function listCacheGet$1(key) {
23685
+ var data = this.__data__, index2 = assocIndexOf$2(data, key);
23686
+ return index2 < 0 ? void 0 : data[index2][1];
23687
+ }
23688
+ var _listCacheGet = listCacheGet$1;
23689
+ var assocIndexOf$1 = _assocIndexOf;
23690
+ function listCacheHas$1(key) {
23691
+ return assocIndexOf$1(this.__data__, key) > -1;
23692
+ }
23693
+ var _listCacheHas = listCacheHas$1;
23694
+ var assocIndexOf = _assocIndexOf;
23695
+ function listCacheSet$1(key, value) {
23696
+ var data = this.__data__, index2 = assocIndexOf(data, key);
23697
+ if (index2 < 0) {
23698
+ ++this.size;
23699
+ data.push([key, value]);
23834
23700
  } else {
23835
- const selectionText = selection.split("\n");
23836
- for (let i = 0, len = selectionText.length; i < len; i++) {
23837
- selectionText[i] = selectionText[i] === "" ? "" : i + 1 + ". " + selectionText[i];
23838
- }
23839
- editor.replaceSelection(selectionText.join("\n"));
23701
+ data[index2][1] = value;
23840
23702
  }
23841
- });
23842
- __publicField(ToolBarHandler, "underline", (editor) => {
23843
- const cursor = editor.getCursor();
23844
- const selection = editor.getSelection();
23845
- editor.focus();
23846
- editor.replaceSelection("<ins>" + selection + "</ins>");
23847
- if (selection === "") {
23848
- editor.setCursor(cursor.line, cursor.ch + 5);
23703
+ return this;
23704
+ }
23705
+ var _listCacheSet = listCacheSet$1;
23706
+ var listCacheClear = _listCacheClear, listCacheDelete = _listCacheDelete, listCacheGet = _listCacheGet, listCacheHas = _listCacheHas, listCacheSet = _listCacheSet;
23707
+ function ListCache$4(entries) {
23708
+ var index2 = -1, length = entries == null ? 0 : entries.length;
23709
+ this.clear();
23710
+ while (++index2 < length) {
23711
+ var entry = entries[index2];
23712
+ this.set(entry[0], entry[1]);
23849
23713
  }
23850
- });
23851
- __publicField(ToolBarHandler, "strike", (editor) => {
23852
- const cursor = editor.getCursor();
23853
- const selection = editor.getSelection();
23854
- editor.replaceSelection("~~" + selection + "~~");
23855
- editor.focus();
23856
- if (selection === "") {
23857
- editor.setCursor(cursor.line, cursor.ch + 2);
23714
+ }
23715
+ ListCache$4.prototype.clear = listCacheClear;
23716
+ ListCache$4.prototype["delete"] = listCacheDelete;
23717
+ ListCache$4.prototype.get = listCacheGet;
23718
+ ListCache$4.prototype.has = listCacheHas;
23719
+ ListCache$4.prototype.set = listCacheSet;
23720
+ var _ListCache = ListCache$4;
23721
+ var ListCache$3 = _ListCache;
23722
+ function stackClear$1() {
23723
+ this.__data__ = new ListCache$3();
23724
+ this.size = 0;
23725
+ }
23726
+ var _stackClear = stackClear$1;
23727
+ function stackDelete$1(key) {
23728
+ var data = this.__data__, result2 = data["delete"](key);
23729
+ this.size = data.size;
23730
+ return result2;
23731
+ }
23732
+ var _stackDelete = stackDelete$1;
23733
+ function stackGet$1(key) {
23734
+ return this.__data__.get(key);
23735
+ }
23736
+ var _stackGet = stackGet$1;
23737
+ function stackHas$1(key) {
23738
+ return this.__data__.has(key);
23739
+ }
23740
+ var _stackHas = stackHas$1;
23741
+ var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
23742
+ var _freeGlobal = freeGlobal$1;
23743
+ var freeGlobal = _freeGlobal;
23744
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
23745
+ var root$8 = freeGlobal || freeSelf || Function("return this")();
23746
+ var _root = root$8;
23747
+ var root$7 = _root;
23748
+ var Symbol$4 = root$7.Symbol;
23749
+ var _Symbol = Symbol$4;
23750
+ var Symbol$3 = _Symbol;
23751
+ var objectProto$c = Object.prototype;
23752
+ var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
23753
+ var nativeObjectToString$1 = objectProto$c.toString;
23754
+ var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : void 0;
23755
+ function getRawTag$1(value) {
23756
+ var isOwn = hasOwnProperty$9.call(value, symToStringTag$1), tag2 = value[symToStringTag$1];
23757
+ try {
23758
+ value[symToStringTag$1] = void 0;
23759
+ var unmasked = true;
23760
+ } catch (e) {
23858
23761
  }
23859
- });
23860
- __publicField(ToolBarHandler, "checkList", (editor) => {
23861
- const selection = editor.getSelection();
23862
- editor.focus();
23863
- if (selection === "") {
23864
- editor.replaceSelection("- [ ] " + selection);
23865
- } else {
23866
- const selectionText = selection.split("\n");
23867
- for (let i = 0, len = selectionText.length; i < len; i++) {
23868
- selectionText[i] = selectionText[i] === "" ? "" : "- [ ] " + selectionText[i];
23762
+ var result2 = nativeObjectToString$1.call(value);
23763
+ if (unmasked) {
23764
+ if (isOwn) {
23765
+ value[symToStringTag$1] = tag2;
23766
+ } else {
23767
+ delete value[symToStringTag$1];
23869
23768
  }
23870
- editor.replaceSelection(selectionText.join("\n"));
23871
23769
  }
23872
- });
23873
- __publicField(ToolBarHandler, "font", () => {
23874
- });
23875
- __publicField(ToolBarHandler, "link", (editor) => {
23876
- const cursor = editor.getCursor();
23877
- const selection = editor.getSelection();
23878
- editor.focus();
23879
- editor.replaceSelection("[" + selection + "](url)");
23880
- if (selection === "") {
23881
- editor.setCursor(cursor.line, cursor.ch + 1);
23882
- }
23883
- });
23884
- __publicField(ToolBarHandler, "image", (editor, params) => {
23885
- const stopEventPropagation = (e) => {
23886
- e.stopPropagation();
23887
- };
23888
- if (typeof document !== "undefined" && params.imageUploadToServer) {
23889
- let imageUploader = document.getElementById("markdown_image_upload_input");
23890
- if (imageUploader) {
23891
- imageUploader.removeEventListener("click", stopEventPropagation);
23892
- document.body.removeChild(imageUploader);
23893
- }
23894
- imageUploader = document.createElement("input");
23895
- imageUploader.addEventListener("click", stopEventPropagation);
23896
- imageUploader.setAttribute("type", "file");
23897
- imageUploader.setAttribute("accept", "image/bmp,image/gif,image/jpeg,image/jpg,image/png,image/tiff");
23898
- imageUploader.id = "markdown_image_upload_input";
23899
- imageUploader.style.display = "none";
23900
- document.body.appendChild(imageUploader);
23901
- const callback = ({ name, imgUrl, title }) => {
23902
- editor.focus();
23903
- editor.replaceSelection(`![${name}](${imgUrl} '${title}')`);
23904
- };
23905
- imageUploader.onchange = (e) => {
23906
- const file = e.target["files"][0];
23907
- params.imageUpload.emit({ file, callback });
23908
- };
23909
- imageUploader.click();
23910
- } else {
23911
- const cursor = editor.getCursor();
23912
- const selection = editor.getSelection();
23913
- editor.focus();
23914
- editor.replaceSelection("![" + selection + "](src 'title')");
23915
- if (selection === "") {
23916
- editor.setCursor(cursor.line, cursor.ch + 2);
23917
- }
23770
+ return result2;
23771
+ }
23772
+ var _getRawTag = getRawTag$1;
23773
+ var objectProto$b = Object.prototype;
23774
+ var nativeObjectToString = objectProto$b.toString;
23775
+ function objectToString$1(value) {
23776
+ return nativeObjectToString.call(value);
23777
+ }
23778
+ var _objectToString = objectToString$1;
23779
+ var Symbol$2 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
23780
+ var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
23781
+ var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
23782
+ function baseGetTag$4(value) {
23783
+ if (value == null) {
23784
+ return value === void 0 ? undefinedTag : nullTag;
23918
23785
  }
23919
- });
23920
- __publicField(ToolBarHandler, "file", (editor, params) => {
23921
- const stopEventPropagation = (e) => {
23922
- e.stopPropagation();
23923
- };
23924
- let fileUploader = document.getElementById("markdown_file_upload_input");
23925
- if (fileUploader) {
23926
- fileUploader.removeEventListener("click", stopEventPropagation);
23927
- document.body.removeChild(fileUploader);
23786
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
23787
+ }
23788
+ var _baseGetTag = baseGetTag$4;
23789
+ function isObject$5(value) {
23790
+ var type4 = typeof value;
23791
+ return value != null && (type4 == "object" || type4 == "function");
23792
+ }
23793
+ var isObject_1 = isObject$5;
23794
+ var baseGetTag$3 = _baseGetTag, isObject$4 = isObject_1;
23795
+ var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
23796
+ function isFunction$2(value) {
23797
+ if (!isObject$4(value)) {
23798
+ return false;
23928
23799
  }
23929
- fileUploader = document.createElement("input");
23930
- fileUploader.setAttribute("type", "file");
23931
- fileUploader.addEventListener("click", stopEventPropagation);
23932
- fileUploader.id = "markdown_file_upload_input";
23933
- fileUploader.style.display = "none";
23934
- document.body.appendChild(fileUploader);
23935
- const callback = ({ name, url: url2, title, isImage }) => {
23936
- let showAsImage = false;
23937
- if (isImage !== void 0) {
23938
- showAsImage = isImage;
23939
- } else if (url2) {
23940
- const imageFilter = /^(bmp|gif|jpeg|jpg|png|tiff)$/i;
23941
- showAsImage = imageFilter.test(url2.split(".").pop());
23800
+ var tag2 = baseGetTag$3(value);
23801
+ return tag2 == funcTag$2 || tag2 == genTag$1 || tag2 == asyncTag || tag2 == proxyTag;
23802
+ }
23803
+ var isFunction_1 = isFunction$2;
23804
+ var root$6 = _root;
23805
+ var coreJsData$1 = root$6["__core-js_shared__"];
23806
+ var _coreJsData = coreJsData$1;
23807
+ var coreJsData = _coreJsData;
23808
+ var maskSrcKey = function() {
23809
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
23810
+ return uid ? "Symbol(src)_1." + uid : "";
23811
+ }();
23812
+ function isMasked$1(func) {
23813
+ return !!maskSrcKey && maskSrcKey in func;
23814
+ }
23815
+ var _isMasked = isMasked$1;
23816
+ var funcProto$1 = Function.prototype;
23817
+ var funcToString$1 = funcProto$1.toString;
23818
+ function toSource$2(func) {
23819
+ if (func != null) {
23820
+ try {
23821
+ return funcToString$1.call(func);
23822
+ } catch (e) {
23942
23823
  }
23943
- editor.focus();
23944
- if (showAsImage) {
23945
- editor.replaceSelection(`![${name}](${url2} '${title}')`);
23946
- } else {
23947
- editor.replaceSelection(`[${name}](${url2} '${title}')`);
23824
+ try {
23825
+ return func + "";
23826
+ } catch (e) {
23948
23827
  }
23949
- };
23950
- fileUploader.onchange = (e) => {
23951
- const file = e.target["files"][0];
23952
- params.fileUpload.emit({ file, callback });
23953
- };
23954
- fileUploader.click();
23955
- });
23956
- __publicField(ToolBarHandler, "code", (editor) => {
23957
- const cursor = editor.getCursor();
23958
- const selection = editor.getSelection();
23959
- editor.replaceSelection("`" + selection + "`");
23960
- editor.focus();
23961
- if (selection === "") {
23962
- editor.setCursor(cursor.line, cursor.ch + 1);
23963
23828
  }
23964
- });
23965
- __publicField(ToolBarHandler, "table", (editor) => {
23966
- const table2 = `| | | |
23967
- |--|--|--|
23968
- | | | |`;
23969
- editor.replaceSelection(table2);
23970
- });
23971
- __publicField(ToolBarHandler, "fullscreen", (editor) => {
23972
- editor.focus();
23973
- });
23974
- __publicField(ToolBarHandler, "color", () => {
23975
- });
23976
- const DEFAULT_TOOLBARS = {
23977
- undo: {
23978
- id: "undo",
23979
- name: "undo",
23980
- type: "button",
23981
- icon: UNDO_ICON,
23982
- shortKey: "Ctrl+Z",
23983
- handler: ToolBarHandler.undo
23984
- },
23985
- redo: {
23986
- id: "redo",
23987
- name: "redo",
23988
- type: "button",
23989
- icon: REDO_ICON,
23990
- shortKey: "Ctrl+Y",
23991
- handler: ToolBarHandler.redo
23992
- },
23993
- bold: {
23994
- id: "bold",
23995
- name: "bold",
23996
- type: "button",
23997
- icon: BOLD_ICON,
23998
- shortKey: "Ctrl+B",
23999
- handler: ToolBarHandler.bold
24000
- },
24001
- italic: {
24002
- id: "italic",
24003
- name: "italic",
24004
- type: "button",
24005
- icon: ITALIC_ICON,
24006
- shortKey: "Ctrl+I",
24007
- handler: ToolBarHandler.italic
24008
- },
24009
- strike: {
24010
- id: "strike",
24011
- name: "strike",
24012
- type: "button",
24013
- icon: STRIKE_ICON,
24014
- shortKey: "Ctrl+D",
24015
- handler: ToolBarHandler.strike
24016
- },
24017
- h1: {
24018
- id: "h1",
24019
- name: "h1",
24020
- type: "button",
24021
- icon: H1_ICON,
24022
- shortKey: "Ctrl+1",
24023
- handler: ToolBarHandler.h1
24024
- },
24025
- h2: {
24026
- id: "h2",
24027
- name: "h2",
24028
- type: "button",
24029
- icon: H2_ICON,
24030
- shortKey: "Ctrl+2",
24031
- handler: ToolBarHandler.h2
24032
- },
24033
- ul: {
24034
- id: "ul",
24035
- name: "unorderedlist",
24036
- type: "button",
24037
- icon: LIST_UNORDERED_ICON,
24038
- shortKey: "Ctrl+U",
24039
- handler: ToolBarHandler.ul
24040
- },
24041
- ol: {
24042
- id: "ol",
24043
- name: "orderedlist",
24044
- type: "button",
24045
- icon: LIST_ORDERED_ICON,
24046
- shortKey: "Ctrl+O",
24047
- handler: ToolBarHandler.ol
24048
- },
24049
- checklist: {
24050
- id: "checklist",
24051
- name: "checklist",
24052
- type: "button",
24053
- icon: LIST_CHECK_ICON,
24054
- shortKey: "Ctrl+Alt+C",
24055
- handler: ToolBarHandler.checkList
24056
- },
24057
- underline: {
24058
- id: "underline",
24059
- name: "underline",
24060
- type: "button",
24061
- icon: UNDERLINE_ICON,
24062
- shortKey: "Ctrl+R",
24063
- handler: ToolBarHandler.underline
24064
- },
24065
- font: {
24066
- id: "font",
24067
- name: "size",
24068
- type: "dropDown",
24069
- icon: FONT_SIZE_ICON,
24070
- component: "FontSize",
24071
- handler: ToolBarHandler.font
24072
- },
24073
- link: {
24074
- id: "link",
24075
- name: "link",
24076
- type: "button",
24077
- icon: LINK_ICON,
24078
- shortKey: "Ctrl+L",
24079
- handler: ToolBarHandler.link
24080
- },
24081
- image: {
24082
- id: "image",
24083
- name: "image",
24084
- type: "button",
24085
- icon: IMAGE_ICON,
24086
- shortKey: "Ctrl+G",
24087
- handler: ToolBarHandler.link
24088
- },
24089
- file: {
24090
- id: "file",
24091
- name: "file",
24092
- type: "button",
24093
- icon: FILE_ICON,
24094
- params: {},
24095
- shortKey: "Ctrl+F",
24096
- handler: ToolBarHandler.file
24097
- },
24098
- code: {
24099
- id: "code",
24100
- name: "code",
24101
- type: "button",
24102
- icon: CODE_ICON,
24103
- shortKey: "Ctrl+K",
24104
- handler: ToolBarHandler.code
24105
- },
24106
- table: {
24107
- id: "table",
24108
- name: "table",
24109
- type: "button",
24110
- icon: TABLE_ICON,
24111
- shortKey: "Ctrl+Alt+T",
24112
- handler: ToolBarHandler.table
24113
- },
24114
- fullscreen: {
24115
- id: "fullscreen",
24116
- name: "fullscreen",
24117
- exitName: "exit-fullscreen",
24118
- type: "button",
24119
- icon: FULLSCREEN_EXPAND_ICON,
24120
- exitIcon: FULLSCREEN_CONTRACT_ICON,
24121
- handler: ToolBarHandler.fullscreen
24122
- },
24123
- color: {
24124
- id: "color",
24125
- name: "color&background",
24126
- type: "dropDown",
24127
- icon: COLOR_ICON,
24128
- component: "FontColor",
24129
- handler: ToolBarHandler.color
23829
+ return "";
23830
+ }
23831
+ var _toSource = toSource$2;
23832
+ var isFunction$1 = isFunction_1, isMasked = _isMasked, isObject$3 = isObject_1, toSource$1 = _toSource;
23833
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
23834
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
23835
+ var funcProto = Function.prototype, objectProto$a = Object.prototype;
23836
+ var funcToString = funcProto.toString;
23837
+ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
23838
+ var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty$8).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
23839
+ function baseIsNative$1(value) {
23840
+ if (!isObject$3(value) || isMasked(value)) {
23841
+ return false;
24130
23842
  }
24131
- };
24132
- const DEFAULT_TOOLBAR_CONFIG = [
24133
- ["undo", "redo"],
24134
- ["h1", "h2", "bold", "italic", "strike", "underline", "color", "font"],
24135
- ["ul", "ol", "checklist", "code", "link", "image", "table"],
24136
- "fullscreen"
24137
- ];
24138
- const FONT_COLORS = [
24139
- "#000000",
24140
- "#e60000",
24141
- "#ff9900",
24142
- "#ffff00",
24143
- "#008a00",
24144
- "#0066cc",
24145
- "#9933ff",
24146
- "#ffffff",
24147
- "#facccc",
24148
- "#ffebcc",
24149
- "#ffffcc",
24150
- "#cce8cc",
24151
- "#cce0f5",
24152
- "#ebd6ff",
24153
- "#bbbbbb",
24154
- "#f06666",
24155
- "#ffc266",
24156
- "#ffff66",
24157
- "#66b966",
24158
- "#66a3e0",
24159
- "#c285ff",
24160
- "#888888",
24161
- "#a10000",
24162
- "#b26b00",
24163
- "#b2b200",
24164
- "#006100",
24165
- "#0047b2",
24166
- "#6b24b2",
24167
- "#444444",
24168
- "#5c0000",
24169
- "#663d00",
24170
- "#666600",
24171
- "#003700",
24172
- "#002966",
24173
- "#3d1466"
24174
- ];
24175
- const FONT_SIZE_LIST = [12, 14, 16, 18, 20, 24, 36, 48].map((item) => ({ name: item + "px", value: item }));
24176
- function parseHTMLStringToDomList(html) {
24177
- var _a;
24178
- const domParser = new DOMParser();
24179
- const htmlNode = domParser.parseFromString(html, "text/html");
24180
- return htmlNode.querySelector("body") ? ((_a = htmlNode.querySelector("body")) == null ? void 0 : _a.childNodes) || [] : [];
23843
+ var pattern4 = isFunction$1(value) ? reIsNative : reIsHostCtor;
23844
+ return pattern4.test(toSource$1(value));
24181
23845
  }
24182
- function locale(key) {
24183
- const localeMap = {
24184
- undo: "\u64A4\u9500",
24185
- redo: "\u91CD\u505A",
24186
- clean: "\u6E05\u9664\u683C\u5F0F",
24187
- header: "\u6BB5\u843D\u6837\u5F0F",
24188
- normal: "\u6B63\u6587",
24189
- h1: "\u6807\u98981",
24190
- h2: "\u6807\u98982",
24191
- h3: "\u6807\u98983",
24192
- h4: "\u6807\u98984",
24193
- h5: "\u6807\u98985",
24194
- h6: "\u6807\u98986",
24195
- font: "\u5B57\u4F53",
24196
- size: "\u5B57\u53F7",
24197
- songti: "\u5B8B\u4F53",
24198
- yahei: "\u5FAE\u8F6F\u96C5\u9ED1",
24199
- kaiti: "\u6977\u4F53",
24200
- heiti: "\u9ED1\u4F53",
24201
- lishu: "\u96B6\u4E66",
24202
- bold: "\u7C97\u4F53",
24203
- italic: "\u659C\u4F53",
24204
- underline: "\u4E0B\u5212\u7EBF",
24205
- strike: "\u5220\u9664\u7EBF",
24206
- color: "\u5B57\u4F53\u989C\u8272",
24207
- backgound: "\u80CC\u666F\u8272",
24208
- orderedlist: "\u6709\u5E8F\u5217\u8868",
24209
- unorderedlist: "\u65E0\u5E8F\u5217\u8868",
24210
- checklist: "\u4EFB\u52A1\u5217\u8868",
24211
- left: "\u5DE6\u5BF9\u9F50",
24212
- center: "\u5C45\u4E2D",
24213
- right: "\u53F3\u5BF9\u9F50",
24214
- image: "\u56FE\u7247",
24215
- file: "\u6587\u4EF6",
24216
- table: "\u8868\u683C",
24217
- link: "\u8D85\u94FE\u63A5",
24218
- code: "\u884C\u5185\u4EE3\u7801",
24219
- codeblock: "\u4EE3\u7801\u5757",
24220
- blockquote: "\u5F15\u7528",
24221
- superscript: "\u4E0A\u6807",
24222
- subscript: "\u4E0B\u6807",
24223
- globallink: "\u5168\u5C40\u94FE\u63A5",
24224
- emoji: "\u8868\u60C5",
24225
- fullscreen: "\u5168\u5C4F",
24226
- "exit-fullscreen": "\u9000\u51FA\u5168\u5C4F",
24227
- help: "\u5E2E\u52A9",
24228
- more: "\u66F4\u591A",
24229
- "help-format": "\u683C\u5F0F",
24230
- "help-insert": "\u63D2\u5165",
24231
- "help-operation": "\u64CD\u4F5C",
24232
- mention: "\u63D0\u53CA\u67D0\u4EBA",
24233
- "quick-menu": "\u5FEB\u6377\u83DC\u5355",
24234
- "toggle-help-panel": "\u6253\u5F00/\u5173\u95ED\u5E2E\u52A9\u9762\u677F",
24235
- "scroll-table": "\u6C34\u5E73\u6EDA\u52A8\u8868\u683C",
24236
- "mouse-wheel": "\u9F20\u6807\u6EDA\u8F6E",
24237
- save: "\u4FDD\u5B58",
24238
- "copy-cells": "\u590D\u5236",
24239
- "copy-table": "\u590D\u5236\u8868\u683C",
24240
- "cut-cells": "\u526A\u5207",
24241
- "empty-cells": "\u6E05\u7A7A\u5185\u5BB9",
24242
- "insert-row-up": "\u4E0A\u63D2\u5165\u884C",
24243
- "insert-row-down": "\u4E0B\u63D2\u5165\u884C",
24244
- "insert-column-left": "\u5DE6\u63D2\u5165\u884C",
24245
- "insert-column-right": "\u53F3\u63D2\u5165\u884C",
24246
- "merge-cells": "\u5408\u5E76\u5355\u5143\u683C",
24247
- "unmerge-cells": "\u62C6\u5206\u5355\u5143\u683C",
24248
- "delete-row": "\u5220\u9664\u5F53\u524D\u884C",
24249
- "delete-column": "\u5220\u9664\u5F53\u524D\u5217",
24250
- "delete-table": "\u5220\u9664\u8868\u683C",
24251
- "default-link-text": "\u94FE\u63A5",
24252
- basicblock: "\u5361\u7247",
24253
- linkplaceholder: "\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740\uFF0C\u6309\u56DE\u8F66\u786E\u8BA4",
24254
- "counter-template": "{{count}}/{{totalCount}}",
24255
- char: "\u5B57\u7B26",
24256
- word: "\u5355\u8BCD",
24257
- "counter-limit-tips": "{{countUnit}}\u6570\u8D85\u51FA\u6700\u5927\u5141\u8BB8\u503C",
24258
- "ie-msg": "\u4E3A\u4E86\u66F4\u597D\u4F53\u9A8C\uFF0C\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668",
24259
- loading: "\u6B63\u5728\u52A0\u8F7D\u4E2D...",
24260
- pasting: "\u60A8\u7C98\u8D34\u5185\u5BB9\u8F83\u591A, \u6B63\u5728\u52AA\u529B\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85..."
24261
- };
24262
- return localeMap[key];
23846
+ var _baseIsNative = baseIsNative$1;
23847
+ function getValue$1(object4, key) {
23848
+ return object4 == null ? void 0 : object4[key];
24263
23849
  }
24264
- function _enforceMaxLength(cm, changes) {
24265
- const maxLength = cm.getOption("maxLength");
24266
- if (maxLength && changes.update) {
24267
- let changeContent = changes.text.join("\n");
24268
- let delta = changeContent.length - (cm.indexFromPos(changes.to) - cm.indexFromPos(changes.from));
24269
- if (delta <= 0) {
24270
- return true;
24271
- }
24272
- delta = cm.getValue().length + delta - maxLength;
24273
- if (delta > 0) {
24274
- changeContent = changeContent.substr(0, changeContent.length - delta);
24275
- changes.update(changes.from, changes.to, changeContent.split("\n"));
24276
- }
23850
+ var _getValue = getValue$1;
23851
+ var baseIsNative = _baseIsNative, getValue = _getValue;
23852
+ function getNative$7(object4, key) {
23853
+ var value = getValue(object4, key);
23854
+ return baseIsNative(value) ? value : void 0;
23855
+ }
23856
+ var _getNative = getNative$7;
23857
+ var getNative$6 = _getNative, root$5 = _root;
23858
+ var Map$4 = getNative$6(root$5, "Map");
23859
+ var _Map = Map$4;
23860
+ var getNative$5 = _getNative;
23861
+ var nativeCreate$4 = getNative$5(Object, "create");
23862
+ var _nativeCreate = nativeCreate$4;
23863
+ var nativeCreate$3 = _nativeCreate;
23864
+ function hashClear$1() {
23865
+ this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
23866
+ this.size = 0;
23867
+ }
23868
+ var _hashClear = hashClear$1;
23869
+ function hashDelete$1(key) {
23870
+ var result2 = this.has(key) && delete this.__data__[key];
23871
+ this.size -= result2 ? 1 : 0;
23872
+ return result2;
23873
+ }
23874
+ var _hashDelete = hashDelete$1;
23875
+ var nativeCreate$2 = _nativeCreate;
23876
+ var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
23877
+ var objectProto$9 = Object.prototype;
23878
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
23879
+ function hashGet$1(key) {
23880
+ var data = this.__data__;
23881
+ if (nativeCreate$2) {
23882
+ var result2 = data[key];
23883
+ return result2 === HASH_UNDEFINED$1 ? void 0 : result2;
24277
23884
  }
24278
- return true;
23885
+ return hasOwnProperty$7.call(data, key) ? data[key] : void 0;
24279
23886
  }
24280
- function refreshEditorCursor() {
24281
- let event;
24282
- if (typeof Event === "function") {
24283
- event = new Event("resize");
24284
- } else {
24285
- event = document.createEvent("Event");
24286
- event.initEvent("resize", true, true);
23887
+ var _hashGet = hashGet$1;
23888
+ var nativeCreate$1 = _nativeCreate;
23889
+ var objectProto$8 = Object.prototype;
23890
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
23891
+ function hashHas$1(key) {
23892
+ var data = this.__data__;
23893
+ return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$6.call(data, key);
23894
+ }
23895
+ var _hashHas = hashHas$1;
23896
+ var nativeCreate = _nativeCreate;
23897
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
23898
+ function hashSet$1(key, value) {
23899
+ var data = this.__data__;
23900
+ this.size += this.has(key) ? 0 : 1;
23901
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
23902
+ return this;
23903
+ }
23904
+ var _hashSet = hashSet$1;
23905
+ var hashClear = _hashClear, hashDelete = _hashDelete, hashGet = _hashGet, hashHas = _hashHas, hashSet = _hashSet;
23906
+ function Hash$1(entries) {
23907
+ var index2 = -1, length = entries == null ? 0 : entries.length;
23908
+ this.clear();
23909
+ while (++index2 < length) {
23910
+ var entry = entries[index2];
23911
+ this.set(entry[0], entry[1]);
24287
23912
  }
24288
- window.dispatchEvent(event);
24289
23913
  }
24290
- function useEditorMd(props, ctx2) {
24291
- const {
24292
- imageUploadToServer,
24293
- hidePreviewView,
24294
- mode,
24295
- maxlength,
24296
- options,
24297
- toolbarConfig,
24298
- customToolbars,
24299
- customHintReplaceFn,
24300
- hintConfig,
24301
- disableChangeEvent,
24302
- modelValue
24303
- } = toRefs(props);
24304
- const toolbars = reactive(DEFAULT_TOOLBARS);
24305
- const editorRef = ref();
24306
- const renderRef = ref();
24307
- const previewHtmlList = ref([]);
24308
- let editorIns;
24309
- let canPreviewScrollView = false;
24310
- let CodeMirror;
24311
- computed(() => {
24312
- const result2 = [];
24313
- for (const key in hintConfig == null ? void 0 : hintConfig.value) {
24314
- if (typeof (hintConfig == null ? void 0 : hintConfig.value[key]) === "function" || (hintConfig == null ? void 0 : hintConfig.value[key]) && typeof (hintConfig == null ? void 0 : hintConfig.value[key].handler) === "function") {
24315
- result2.push(key);
24316
- }
24317
- }
24318
- return result2;
24319
- });
24320
- const getEditorIns = () => editorIns;
24321
- const editorScroll = () => {
24322
- if (editorIns) {
24323
- const scrollInfo = editorIns.getScrollInfo();
24324
- const height = scrollInfo.height - scrollInfo.clientHeight;
24325
- const ratio = parseFloat(scrollInfo.top) / height;
24326
- const preview = renderRef.value.$el;
24327
- const move = (preview.scrollHeight - preview.clientHeight) * ratio;
24328
- preview.scrollTop = move;
24329
- }
24330
- };
24331
- const previewScroll = () => {
24332
- const preview = renderRef.value.$el;
24333
- const height = preview.scrollHeight - preview.clientHeight;
24334
- const ratio = parseFloat(preview.scrollTop) / height;
24335
- const move = (editorIns.getScrollInfo().height - editorIns.getScrollInfo().clientHeight) * ratio;
24336
- editorIns.scrollTo(0, move);
24337
- };
24338
- const previewContentChange = (html) => {
24339
- previewHtmlList.value = [];
24340
- const domList = parseHTMLStringToDomList(html);
24341
- domList.forEach((ele) => {
24342
- if (ele.outerHTML) {
24343
- previewHtmlList.value.push(ele.outerHTML);
24344
- }
24345
- });
24346
- setTimeout(() => {
24347
- editorScroll();
24348
- });
24349
- nextTick(() => {
24350
- ctx2.emit("previewContentChange");
24351
- });
24352
- };
24353
- const onPreviewScroll = () => {
24354
- if (!canPreviewScrollView) {
24355
- return;
24356
- }
24357
- previewScroll();
24358
- };
24359
- const onPreviewMouseover = () => {
24360
- canPreviewScrollView = true;
24361
- };
24362
- const onPreviewMouseout = () => {
24363
- canPreviewScrollView = false;
24364
- };
24365
- const onChecked = (e) => {
24366
- ctx2.emit("mdCheckedEvent", e);
24367
- };
24368
- const onChange = debounce(() => {
24369
- const content2 = editorIns.getValue();
24370
- if (!disableChangeEvent.value) {
24371
- ctx2.emit("update:modelValue", content2);
24372
- ctx2.emit("contentChange", content2);
24373
- }
24374
- if (!canPreviewScrollView) {
24375
- editorScroll();
24376
- }
24377
- }, disableChangeEvent.value ? 500 : 10, true);
24378
- const onScroll2 = () => {
24379
- if (!canPreviewScrollView) {
24380
- editorScroll();
24381
- }
24382
- };
24383
- const initEditor = () => {
24384
- var _a;
24385
- editorIns = CodeMirror.fromTextArea(editorRef.value, __spreadValues({
24386
- mode: "markdown",
24387
- lineNumbers: false,
24388
- lineWrapping: true
24389
- }, options.value));
24390
- if (maxlength.value) {
24391
- editorIns.setOption("maxLength", maxlength.value);
24392
- }
24393
- editorIns.setOption("readOnly", mode.value === "readonly");
24394
- const shortKeys = {};
24395
- const flatToolbarConfig = toolbarConfig.value.flat();
24396
- const tempToolbars = __spreadValues(__spreadValues({}, toolbars), customToolbars == null ? void 0 : customToolbars.value);
24397
- for (const key of Object.keys(tempToolbars)) {
24398
- const toolbarItem = tempToolbars[key];
24399
- if (toolbarItem.shortKey && flatToolbarConfig.includes(toolbarItem.id)) {
24400
- shortKeys[toolbarItem.shortKey.replace(/\+/g, "-")] = (_a = toolbarItem.handler) == null ? void 0 : _a.bind(null, editorIns, toolbarItem.params);
24401
- }
24402
- }
24403
- editorIns.setOption("extraKeys", shortKeys);
24404
- editorIns.on("beforeChange", _enforceMaxLength);
24405
- editorIns.setSize("auto", "100%");
24406
- refreshEditorCursor();
24407
- editorIns.setCursor(editorIns.lineCount(), 0);
24408
- ctx2.emit("afterEditorInit", editorIns);
24409
- editorIns.on("change", onChange);
24410
- editorIns.on("scroll", onScroll2);
24411
- setTimeout(() => {
24412
- ctx2.emit("contentChange", editorIns.getValue());
24413
- }, 100);
24414
- };
24415
- const onPaste = (e) => {
24416
- const clipboardData = e.clipboardData;
24417
- if (!(clipboardData && clipboardData.items)) {
24418
- return;
24419
- }
24420
- if (clipboardData.items.length <= 3) {
24421
- for (let i = 0; i < clipboardData.items.length; i++) {
24422
- const item = clipboardData.items[i];
24423
- if (item.kind === "file" && item.type.indexOf("image") !== -1) {
24424
- const file = item.getAsFile();
24425
- if ((file == null ? void 0 : file.size) === 0) {
24426
- return;
24427
- }
24428
- if (imageUploadToServer.value) {
24429
- const callback = ({ name, imgUrl, title }) => {
24430
- editorRef.value.focus();
24431
- editorRef.value.replaceSelection(`![${name}](${imgUrl} '${title}')`);
24432
- };
24433
- ctx2.emit("imageUpload", { file, callback });
24434
- }
24435
- }
24436
- }
24437
- }
24438
- };
24439
- onMounted(async () => {
24440
- await import("codemirror/addon/display/placeholder.js");
24441
- await import("codemirror/mode/markdown/markdown.js");
24442
- const module = await import("codemirror");
24443
- CodeMirror = module.default;
24444
- initEditor();
24445
- });
24446
- watch(modelValue, (val) => {
24447
- if (editorIns) {
24448
- if (val === editorIns.getValue()) {
24449
- return;
24450
- }
24451
- editorIns.setValue(val);
24452
- }
24453
- });
24454
- watch(imageUploadToServer, (val) => {
24455
- if (toolbars["image"].params) {
24456
- toolbars["image"].params.imageUploadToServer = val;
24457
- }
24458
- });
24459
- watch(hidePreviewView, () => {
24460
- refreshEditorCursor();
24461
- });
24462
- watch(mode, (val) => {
24463
- setTimeout(() => {
24464
- if (editorIns) {
24465
- refreshEditorCursor();
24466
- editorIns.setOption("readOnly", val === "readonly");
24467
- }
24468
- });
24469
- });
24470
- watch(maxlength, (val) => {
24471
- if (editorIns) {
24472
- editorIns.setOption("maxLength", val);
24473
- }
24474
- });
24475
- return {
24476
- editorRef,
24477
- renderRef,
24478
- toolbars,
24479
- previewHtmlList,
24480
- getEditorIns,
24481
- onPaste,
24482
- previewContentChange,
24483
- onChecked,
24484
- onPreviewScroll,
24485
- onPreviewMouseout,
24486
- onPreviewMouseover
23914
+ Hash$1.prototype.clear = hashClear;
23915
+ Hash$1.prototype["delete"] = hashDelete;
23916
+ Hash$1.prototype.get = hashGet;
23917
+ Hash$1.prototype.has = hashHas;
23918
+ Hash$1.prototype.set = hashSet;
23919
+ var _Hash = Hash$1;
23920
+ var Hash = _Hash, ListCache$2 = _ListCache, Map$3 = _Map;
23921
+ function mapCacheClear$1() {
23922
+ this.size = 0;
23923
+ this.__data__ = {
23924
+ "hash": new Hash(),
23925
+ "map": new (Map$3 || ListCache$2)(),
23926
+ "string": new Hash()
24487
23927
  };
24488
23928
  }
24489
- function useEditorMdTheme(callback) {
24490
- const isDarkMode = ref(false);
24491
- let themeService;
24492
- const themeChange = () => {
24493
- if (themeService) {
24494
- isDarkMode.value = themeService.currentTheme.id.indexOf("dark") !== -1;
24495
- callback();
24496
- }
24497
- };
24498
- onBeforeMount(() => {
24499
- themeService = window["devuiThemeService"];
24500
- });
24501
- onMounted(() => {
24502
- themeChange();
24503
- if (themeService && themeService.eventBus) {
24504
- themeService.eventBus.add("themeChanged", themeChange);
24505
- }
24506
- });
24507
- onBeforeUnmount(() => {
24508
- if (themeService && themeService.eventBus) {
24509
- themeService.eventBus.remove("themeChanged", themeChange);
24510
- }
24511
- });
24512
- return { isDarkMode };
23929
+ var _mapCacheClear = mapCacheClear$1;
23930
+ function isKeyable$1(value) {
23931
+ var type4 = typeof value;
23932
+ return type4 == "string" || type4 == "number" || type4 == "symbol" || type4 == "boolean" ? value !== "__proto__" : value === null;
24513
23933
  }
24514
- const commonProps$1 = {
24515
- baseUrl: {
24516
- type: String,
24517
- default: null
24518
- },
24519
- breaks: {
24520
- type: Boolean,
24521
- default: true
24522
- },
24523
- customParse: {
24524
- type: Function,
24525
- default: null
24526
- },
24527
- renderParse: {
24528
- type: Function,
24529
- default: null
24530
- },
24531
- mdRules: {
24532
- type: Object,
24533
- default: () => ({})
24534
- },
24535
- customRendererRules: {
24536
- type: Array,
24537
- default: () => []
24538
- },
24539
- customXssRules: {
24540
- type: Array,
24541
- default: () => []
24542
- },
24543
- mdPlugins: {
24544
- type: Array,
24545
- default: () => []
23934
+ var _isKeyable = isKeyable$1;
23935
+ var isKeyable = _isKeyable;
23936
+ function getMapData$4(map, key) {
23937
+ var data = map.__data__;
23938
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
23939
+ }
23940
+ var _getMapData = getMapData$4;
23941
+ var getMapData$3 = _getMapData;
23942
+ function mapCacheDelete$1(key) {
23943
+ var result2 = getMapData$3(this, key)["delete"](key);
23944
+ this.size -= result2 ? 1 : 0;
23945
+ return result2;
23946
+ }
23947
+ var _mapCacheDelete = mapCacheDelete$1;
23948
+ var getMapData$2 = _getMapData;
23949
+ function mapCacheGet$1(key) {
23950
+ return getMapData$2(this, key).get(key);
23951
+ }
23952
+ var _mapCacheGet = mapCacheGet$1;
23953
+ var getMapData$1 = _getMapData;
23954
+ function mapCacheHas$1(key) {
23955
+ return getMapData$1(this, key).has(key);
23956
+ }
23957
+ var _mapCacheHas = mapCacheHas$1;
23958
+ var getMapData = _getMapData;
23959
+ function mapCacheSet$1(key, value) {
23960
+ var data = getMapData(this, key), size = data.size;
23961
+ data.set(key, value);
23962
+ this.size += data.size == size ? 0 : 1;
23963
+ return this;
23964
+ }
23965
+ var _mapCacheSet = mapCacheSet$1;
23966
+ var mapCacheClear = _mapCacheClear, mapCacheDelete = _mapCacheDelete, mapCacheGet = _mapCacheGet, mapCacheHas = _mapCacheHas, mapCacheSet = _mapCacheSet;
23967
+ function MapCache$1(entries) {
23968
+ var index2 = -1, length = entries == null ? 0 : entries.length;
23969
+ this.clear();
23970
+ while (++index2 < length) {
23971
+ var entry = entries[index2];
23972
+ this.set(entry[0], entry[1]);
24546
23973
  }
24547
- };
24548
- const editorMdProps = __spreadProps(__spreadValues({}, commonProps$1), {
24549
- modelValue: {
24550
- type: String,
24551
- default: ""
24552
- },
24553
- options: {
24554
- type: Object,
24555
- default: () => ({})
24556
- },
24557
- mode: {
24558
- type: String,
24559
- default: "normal"
24560
- },
24561
- customThemeConfig: {
24562
- type: Object
24563
- },
24564
- customToolbars: {
24565
- type: Object
24566
- },
24567
- disableChangeEvent: {
24568
- type: Boolean,
24569
- default: false
24570
- },
24571
- editorContainerHeight: {
24572
- type: Number
24573
- },
24574
- imageUploadToServer: {
24575
- type: Boolean,
24576
- default: false
24577
- },
24578
- hidePreviewView: {
24579
- type: Boolean,
24580
- default: false
24581
- },
24582
- maxlength: {
24583
- type: Number,
24584
- default: null
24585
- },
24586
- placeholder: {
24587
- type: String,
24588
- default: ""
24589
- },
24590
- toolbarConfig: {
24591
- type: Array,
24592
- default: () => DEFAULT_TOOLBAR_CONFIG
24593
- },
24594
- fullscreenZIndex: {
24595
- type: Number,
24596
- default: 10
24597
- },
24598
- hintConfig: {
24599
- type: Object
24600
- },
24601
- customHintReplaceFn: {
24602
- type: Function
23974
+ }
23975
+ MapCache$1.prototype.clear = mapCacheClear;
23976
+ MapCache$1.prototype["delete"] = mapCacheDelete;
23977
+ MapCache$1.prototype.get = mapCacheGet;
23978
+ MapCache$1.prototype.has = mapCacheHas;
23979
+ MapCache$1.prototype.set = mapCacheSet;
23980
+ var _MapCache = MapCache$1;
23981
+ var ListCache$1 = _ListCache, Map$2 = _Map, MapCache = _MapCache;
23982
+ var LARGE_ARRAY_SIZE = 200;
23983
+ function stackSet$1(key, value) {
23984
+ var data = this.__data__;
23985
+ if (data instanceof ListCache$1) {
23986
+ var pairs = data.__data__;
23987
+ if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
23988
+ pairs.push([key, value]);
23989
+ this.size = ++data.size;
23990
+ return this;
23991
+ }
23992
+ data = this.__data__ = new MapCache(pairs);
24603
23993
  }
24604
- });
24605
- const EditorMdInjectionKey = Symbol("d-editor-md");
24606
- const mdRenderProps = __spreadProps(__spreadValues({}, commonProps$1), {
24607
- content: {
24608
- type: String,
24609
- default: ""
24610
- },
24611
- disableRender: {
24612
- type: Boolean,
24613
- default: false
23994
+ data.set(key, value);
23995
+ this.size = data.size;
23996
+ return this;
23997
+ }
23998
+ var _stackSet = stackSet$1;
23999
+ var ListCache = _ListCache, stackClear = _stackClear, stackDelete = _stackDelete, stackGet = _stackGet, stackHas = _stackHas, stackSet = _stackSet;
24000
+ function Stack$1(entries) {
24001
+ var data = this.__data__ = new ListCache(entries);
24002
+ this.size = data.size;
24003
+ }
24004
+ Stack$1.prototype.clear = stackClear;
24005
+ Stack$1.prototype["delete"] = stackDelete;
24006
+ Stack$1.prototype.get = stackGet;
24007
+ Stack$1.prototype.has = stackHas;
24008
+ Stack$1.prototype.set = stackSet;
24009
+ var _Stack = Stack$1;
24010
+ function arrayEach$1(array4, iteratee) {
24011
+ var index2 = -1, length = array4 == null ? 0 : array4.length;
24012
+ while (++index2 < length) {
24013
+ if (iteratee(array4[index2], index2, array4) === false) {
24014
+ break;
24015
+ }
24614
24016
  }
24615
- });
24616
- const mdToolbarItemProps = {
24617
- config: {
24618
- type: Object,
24619
- default: () => ({})
24017
+ return array4;
24018
+ }
24019
+ var _arrayEach = arrayEach$1;
24020
+ var getNative$4 = _getNative;
24021
+ var defineProperty$1 = function() {
24022
+ try {
24023
+ var func = getNative$4(Object, "defineProperty");
24024
+ func({}, "", {});
24025
+ return func;
24026
+ } catch (e) {
24620
24027
  }
24621
- };
24622
- const tooltipProps = {
24623
- content: {
24624
- type: String,
24625
- default: ""
24626
- },
24627
- position: {
24628
- type: [String, Array],
24629
- default: "top"
24630
- },
24631
- showAnimation: {
24632
- type: Boolean,
24633
- default: true
24634
- },
24635
- mouseEnterDelay: {
24636
- type: Number,
24637
- default: 150
24638
- },
24639
- mouseLeaveDelay: {
24640
- type: Number,
24641
- default: 100
24642
- },
24643
- enterable: {
24644
- type: Boolean,
24645
- default: true
24646
- },
24647
- disabled: {
24648
- type: Boolean,
24649
- default: false
24650
- },
24651
- hideAfter: {
24652
- type: Number,
24653
- default: 0
24028
+ }();
24029
+ var _defineProperty = defineProperty$1;
24030
+ var defineProperty = _defineProperty;
24031
+ function baseAssignValue$2(object4, key, value) {
24032
+ if (key == "__proto__" && defineProperty) {
24033
+ defineProperty(object4, key, {
24034
+ "configurable": true,
24035
+ "enumerable": true,
24036
+ "value": value,
24037
+ "writable": true
24038
+ });
24039
+ } else {
24040
+ object4[key] = value;
24654
24041
  }
24655
- };
24656
- const transformOriginMap = {
24657
- top: "50% calc(100% + 8px)",
24658
- bottom: "50% -8px",
24659
- left: "calc(100% + 8px)",
24660
- right: "-8px 50%"
24661
- };
24662
- function useTooltip(origin, props) {
24663
- const { position, mouseEnterDelay, mouseLeaveDelay, enterable, disabled, hideAfter } = toRefs(props);
24664
- const visible = ref(false);
24665
- const isEnter = ref(false);
24666
- const positionArr = computed(() => typeof position.value === "string" ? [position.value] : position.value);
24667
- const placement = ref(positionArr.value[0]);
24668
- const overlayStyles = computed(() => ({
24669
- transformOrigin: transformOriginMap[placement.value]
24670
- }));
24671
- const enter = lodash.exports.debounce(() => {
24672
- isEnter.value && (visible.value = true);
24673
- }, mouseEnterDelay.value);
24674
- const leave = lodash.exports.debounce(() => {
24675
- !isEnter.value && (visible.value = false);
24676
- }, mouseLeaveDelay.value);
24677
- const onMouseenter = () => {
24678
- if (disabled.value) {
24679
- return;
24042
+ }
24043
+ var _baseAssignValue = baseAssignValue$2;
24044
+ var baseAssignValue$1 = _baseAssignValue, eq = eq_1;
24045
+ var objectProto$7 = Object.prototype;
24046
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
24047
+ function assignValue$2(object4, key, value) {
24048
+ var objValue = object4[key];
24049
+ if (!(hasOwnProperty$5.call(object4, key) && eq(objValue, value)) || value === void 0 && !(key in object4)) {
24050
+ baseAssignValue$1(object4, key, value);
24051
+ }
24052
+ }
24053
+ var _assignValue = assignValue$2;
24054
+ var assignValue$1 = _assignValue, baseAssignValue = _baseAssignValue;
24055
+ function copyObject$4(source, props, object4, customizer) {
24056
+ var isNew = !object4;
24057
+ object4 || (object4 = {});
24058
+ var index2 = -1, length = props.length;
24059
+ while (++index2 < length) {
24060
+ var key = props[index2];
24061
+ var newValue = customizer ? customizer(object4[key], source[key], key, object4, source) : void 0;
24062
+ if (newValue === void 0) {
24063
+ newValue = source[key];
24680
24064
  }
24681
- isEnter.value = true;
24682
- enter();
24683
- };
24684
- const onMouseleave = () => {
24685
- isEnter.value = false;
24686
- leave();
24687
- };
24688
- const onPositionChange = (pos) => {
24689
- placement.value = pos;
24690
- };
24691
- const quickLeave = () => {
24692
- isEnter.value = false;
24693
- visible.value = false;
24694
- };
24695
- const onMouseenterOverlay = () => {
24696
- if (!enterable.value) {
24697
- quickLeave();
24065
+ if (isNew) {
24066
+ baseAssignValue(object4, key, newValue);
24698
24067
  } else {
24699
- onMouseenter();
24068
+ assignValue$1(object4, key, newValue);
24700
24069
  }
24070
+ }
24071
+ return object4;
24072
+ }
24073
+ var _copyObject = copyObject$4;
24074
+ function baseTimes$1(n, iteratee) {
24075
+ var index2 = -1, result2 = Array(n);
24076
+ while (++index2 < n) {
24077
+ result2[index2] = iteratee(index2);
24078
+ }
24079
+ return result2;
24080
+ }
24081
+ var _baseTimes = baseTimes$1;
24082
+ function isObjectLike$5(value) {
24083
+ return value != null && typeof value == "object";
24084
+ }
24085
+ var isObjectLike_1 = isObjectLike$5;
24086
+ var baseGetTag$2 = _baseGetTag, isObjectLike$4 = isObjectLike_1;
24087
+ var argsTag$2 = "[object Arguments]";
24088
+ function baseIsArguments$1(value) {
24089
+ return isObjectLike$4(value) && baseGetTag$2(value) == argsTag$2;
24090
+ }
24091
+ var _baseIsArguments = baseIsArguments$1;
24092
+ var baseIsArguments = _baseIsArguments, isObjectLike$3 = isObjectLike_1;
24093
+ var objectProto$6 = Object.prototype;
24094
+ var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
24095
+ var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
24096
+ var isArguments$1 = baseIsArguments(function() {
24097
+ return arguments;
24098
+ }()) ? baseIsArguments : function(value) {
24099
+ return isObjectLike$3(value) && hasOwnProperty$4.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
24100
+ };
24101
+ var isArguments_1 = isArguments$1;
24102
+ var isArray$3 = Array.isArray;
24103
+ var isArray_1 = isArray$3;
24104
+ var isBuffer$2 = { exports: {} };
24105
+ function stubFalse() {
24106
+ return false;
24107
+ }
24108
+ var stubFalse_1 = stubFalse;
24109
+ (function(module, exports) {
24110
+ var root2 = _root, stubFalse2 = stubFalse_1;
24111
+ var freeExports = exports && !exports.nodeType && exports;
24112
+ var freeModule = freeExports && true && module && !module.nodeType && module;
24113
+ var moduleExports = freeModule && freeModule.exports === freeExports;
24114
+ var Buffer2 = moduleExports ? root2.Buffer : void 0;
24115
+ var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
24116
+ var isBuffer2 = nativeIsBuffer || stubFalse2;
24117
+ module.exports = isBuffer2;
24118
+ })(isBuffer$2, isBuffer$2.exports);
24119
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
24120
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
24121
+ function isIndex$1(value, length) {
24122
+ var type4 = typeof value;
24123
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
24124
+ return !!length && (type4 == "number" || type4 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
24125
+ }
24126
+ var _isIndex = isIndex$1;
24127
+ var MAX_SAFE_INTEGER = 9007199254740991;
24128
+ function isLength$2(value) {
24129
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
24130
+ }
24131
+ var isLength_1 = isLength$2;
24132
+ var baseGetTag$1 = _baseGetTag, isLength$1 = isLength_1, isObjectLike$2 = isObjectLike_1;
24133
+ var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", errorTag$1 = "[object Error]", funcTag$1 = "[object Function]", mapTag$4 = "[object Map]", numberTag$2 = "[object Number]", objectTag$2 = "[object Object]", regexpTag$2 = "[object RegExp]", setTag$4 = "[object Set]", stringTag$2 = "[object String]", weakMapTag$2 = "[object WeakMap]";
24134
+ var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$3 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
24135
+ var typedArrayTags = {};
24136
+ typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
24137
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] = typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] = typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] = typedArrayTags[weakMapTag$2] = false;
24138
+ function baseIsTypedArray$1(value) {
24139
+ return isObjectLike$2(value) && isLength$1(value.length) && !!typedArrayTags[baseGetTag$1(value)];
24140
+ }
24141
+ var _baseIsTypedArray = baseIsTypedArray$1;
24142
+ function baseUnary$3(func) {
24143
+ return function(value) {
24144
+ return func(value);
24701
24145
  };
24702
- onMounted(() => {
24703
- origin.value.addEventListener("mouseenter", onMouseenter);
24704
- origin.value.addEventListener("mouseleave", onMouseleave);
24705
- });
24706
- let timer;
24707
- watch(visible, (newVal) => {
24708
- if (newVal && hideAfter.value) {
24709
- timer && clearTimeout(timer);
24710
- timer = setTimeout(quickLeave, hideAfter.value);
24146
+ }
24147
+ var _baseUnary = baseUnary$3;
24148
+ var _nodeUtil = { exports: {} };
24149
+ (function(module, exports) {
24150
+ var freeGlobal2 = _freeGlobal;
24151
+ var freeExports = exports && !exports.nodeType && exports;
24152
+ var freeModule = freeExports && true && module && !module.nodeType && module;
24153
+ var moduleExports = freeModule && freeModule.exports === freeExports;
24154
+ var freeProcess = moduleExports && freeGlobal2.process;
24155
+ var nodeUtil2 = function() {
24156
+ try {
24157
+ var types2 = freeModule && freeModule.require && freeModule.require("util").types;
24158
+ if (types2) {
24159
+ return types2;
24160
+ }
24161
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
24162
+ } catch (e) {
24711
24163
  }
24712
- });
24713
- return {
24714
- visible,
24715
- placement,
24716
- positionArr,
24717
- overlayStyles,
24718
- onPositionChange,
24719
- onMouseenter,
24720
- onMouseleave,
24721
- onMouseenterOverlay
24164
+ }();
24165
+ module.exports = nodeUtil2;
24166
+ })(_nodeUtil, _nodeUtil.exports);
24167
+ var baseIsTypedArray = _baseIsTypedArray, baseUnary$2 = _baseUnary, nodeUtil$2 = _nodeUtil.exports;
24168
+ var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
24169
+ var isTypedArray$1 = nodeIsTypedArray ? baseUnary$2(nodeIsTypedArray) : baseIsTypedArray;
24170
+ var isTypedArray_1 = isTypedArray$1;
24171
+ var baseTimes = _baseTimes, isArguments = isArguments_1, isArray$2 = isArray_1, isBuffer$1 = isBuffer$2.exports, isIndex = _isIndex, isTypedArray = isTypedArray_1;
24172
+ var objectProto$5 = Object.prototype;
24173
+ var hasOwnProperty$3 = objectProto$5.hasOwnProperty;
24174
+ function arrayLikeKeys$2(value, inherited) {
24175
+ var isArr = isArray$2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String) : [], length = result2.length;
24176
+ for (var key in value) {
24177
+ if ((inherited || hasOwnProperty$3.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
24178
+ result2.push(key);
24179
+ }
24180
+ }
24181
+ return result2;
24182
+ }
24183
+ var _arrayLikeKeys = arrayLikeKeys$2;
24184
+ var objectProto$4 = Object.prototype;
24185
+ function isPrototype$3(value) {
24186
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$4;
24187
+ return value === proto;
24188
+ }
24189
+ var _isPrototype = isPrototype$3;
24190
+ function overArg$2(func, transform) {
24191
+ return function(arg) {
24192
+ return func(transform(arg));
24722
24193
  };
24723
24194
  }
24724
- var tooltip = "";
24725
- var Tooltip = defineComponent({
24726
- name: "DTooltip",
24727
- props: tooltipProps,
24728
- setup(props, {
24729
- slots
24730
- }) {
24731
- const {
24732
- showAnimation,
24733
- content: content2
24734
- } = toRefs(props);
24735
- const origin = ref();
24736
- const tooltipRef = ref();
24737
- const {
24738
- visible,
24739
- placement,
24740
- positionArr,
24741
- overlayStyles,
24742
- onPositionChange,
24743
- onMouseleave,
24744
- onMouseenterOverlay
24745
- } = useTooltip(origin, props);
24746
- const ns2 = useNamespace$1("tooltip");
24747
- const className2 = computed(() => {
24748
- return [ns2.b(), ns2.m(placement.value)].join(" ");
24749
- });
24750
- provide(POPPER_TRIGGER_TOKEN, origin);
24751
- return () => createVNode(Fragment, null, [createVNode(PopperTrigger, null, {
24752
- default: () => {
24753
- var _a;
24754
- return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
24755
- }
24756
- }), createVNode(Teleport, {
24757
- "to": "body"
24758
- }, {
24759
- default: () => [createVNode(Transition, {
24760
- "name": showAnimation.value ? ns2.m(`fade-${placement.value}`) : ""
24761
- }, {
24762
- default: () => [createVNode(FlexibleOverlay, {
24763
- "modelValue": visible.value,
24764
- "onUpdate:modelValue": ($event) => visible.value = $event,
24765
- "ref": tooltipRef,
24766
- "class": className2.value,
24767
- "origin": origin.value,
24768
- "position": positionArr.value,
24769
- "offset": 6,
24770
- "show-arrow": true,
24771
- "style": overlayStyles.value,
24772
- "onPositionChange": onPositionChange,
24773
- "onMouseenter": onMouseenterOverlay,
24774
- "onMouseleave": onMouseleave
24775
- }, {
24776
- default: () => [createVNode("span", {
24777
- "innerHTML": content2.value
24778
- }, null)]
24779
- })]
24780
- })]
24781
- })]);
24195
+ var _overArg = overArg$2;
24196
+ var overArg$1 = _overArg;
24197
+ var nativeKeys$1 = overArg$1(Object.keys, Object);
24198
+ var _nativeKeys = nativeKeys$1;
24199
+ var isPrototype$2 = _isPrototype, nativeKeys = _nativeKeys;
24200
+ var objectProto$3 = Object.prototype;
24201
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
24202
+ function baseKeys$1(object4) {
24203
+ if (!isPrototype$2(object4)) {
24204
+ return nativeKeys(object4);
24782
24205
  }
24783
- });
24784
- var TooltipInstall = {
24785
- title: "Tooltip \u63D0\u793A",
24786
- category: "\u53CD\u9988",
24787
- status: "100%",
24788
- install(app) {
24789
- app.component(Tooltip.name, Tooltip);
24206
+ var result2 = [];
24207
+ for (var key in Object(object4)) {
24208
+ if (hasOwnProperty$2.call(object4, key) && key != "constructor") {
24209
+ result2.push(key);
24210
+ }
24790
24211
  }
24791
- };
24792
- var FontColor = defineComponent({
24793
- name: "FontColor",
24794
- setup() {
24795
- const {
24796
- getEditorIns,
24797
- t
24798
- } = inject(EditorMdInjectionKey);
24799
- const setColor = (type4, color2) => {
24800
- const editorIns = getEditorIns();
24801
- const selection = editorIns.getSelection();
24802
- const styleType = type4 === "bg" ? "background-color:" : "color:";
24803
- editorIns.focus();
24804
- editorIns.replaceSelection(`<span style="${styleType}${color2};">${selection}</span>`);
24805
- setTimeout(() => {
24806
- if (selection === "") {
24807
- const cursor = editorIns.getCursor();
24808
- editorIns.setCursor(cursor.line, cursor.ch - 7);
24809
- }
24810
- });
24811
- };
24812
- return () => createVNode("div", {
24813
- "class": "dropdown-font-color"
24814
- }, [createVNode("div", {
24815
- "class": "color-wrap"
24816
- }, [createVNode("p", null, [t("color")]), createVNode("ul", {
24817
- "class": "color-picker"
24818
- }, [FONT_COLORS.map((item, index2) => createVNode("li", {
24819
- "key": index2,
24820
- "style": {
24821
- backgroundColor: item
24822
- },
24823
- "onClick": () => setColor("ft", item)
24824
- }, null))])]), createVNode("div", {
24825
- "class": "color-wrap"
24826
- }, [createVNode("p", null, [t("background")]), createVNode("ul", {
24827
- "class": "color-picker"
24828
- }, [FONT_COLORS.map((item, index2) => createVNode("li", {
24829
- "key": index2,
24830
- "style": {
24831
- backgroundColor: item
24832
- },
24833
- "onClick": () => setColor("bg", item)
24834
- }, null))])])]);
24212
+ return result2;
24213
+ }
24214
+ var _baseKeys = baseKeys$1;
24215
+ var isFunction = isFunction_1, isLength = isLength_1;
24216
+ function isArrayLike$2(value) {
24217
+ return value != null && isLength(value.length) && !isFunction(value);
24218
+ }
24219
+ var isArrayLike_1 = isArrayLike$2;
24220
+ var arrayLikeKeys$1 = _arrayLikeKeys, baseKeys = _baseKeys, isArrayLike$1 = isArrayLike_1;
24221
+ function keys$3(object4) {
24222
+ return isArrayLike$1(object4) ? arrayLikeKeys$1(object4) : baseKeys(object4);
24223
+ }
24224
+ var keys_1 = keys$3;
24225
+ var copyObject$3 = _copyObject, keys$2 = keys_1;
24226
+ function baseAssign$1(object4, source) {
24227
+ return object4 && copyObject$3(source, keys$2(source), object4);
24228
+ }
24229
+ var _baseAssign = baseAssign$1;
24230
+ function nativeKeysIn$1(object4) {
24231
+ var result2 = [];
24232
+ if (object4 != null) {
24233
+ for (var key in Object(object4)) {
24234
+ result2.push(key);
24235
+ }
24835
24236
  }
24836
- });
24837
- var FontSize = defineComponent({
24838
- name: "FontSize",
24839
- setup() {
24840
- const {
24841
- getEditorIns
24842
- } = inject(EditorMdInjectionKey);
24843
- const setSize = (val) => {
24844
- const editorIns = getEditorIns();
24845
- const selection = editorIns.getSelection();
24846
- editorIns.focus();
24847
- editorIns.replaceSelection(`<span style="font-size:${val}px;">${selection}</span>`);
24848
- setTimeout(() => {
24849
- if (selection === "") {
24850
- const cursor = editorIns.getCursor();
24851
- editorIns.setCursor(cursor.line, cursor.ch - 7);
24852
- }
24853
- });
24854
- };
24855
- return () => createVNode("ul", {
24856
- "class": "dropdown-font-size"
24857
- }, [FONT_SIZE_LIST.map((item, index2) => createVNode("li", {
24858
- "key": index2,
24859
- "onClick": () => setSize(item.value)
24860
- }, [item.name]))]);
24237
+ return result2;
24238
+ }
24239
+ var _nativeKeysIn = nativeKeysIn$1;
24240
+ var isObject$2 = isObject_1, isPrototype$1 = _isPrototype, nativeKeysIn = _nativeKeysIn;
24241
+ var objectProto$2 = Object.prototype;
24242
+ var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
24243
+ function baseKeysIn$1(object4) {
24244
+ if (!isObject$2(object4)) {
24245
+ return nativeKeysIn(object4);
24861
24246
  }
24862
- });
24863
- var ToolbarItem = defineComponent({
24864
- name: "DMdToolbarItem",
24865
- props: mdToolbarItemProps,
24866
- setup(props) {
24867
- const config = reactive(props.config);
24868
- const {
24869
- showFullscreen,
24870
- getEditorIns,
24871
- t
24872
- } = inject(EditorMdInjectionKey);
24873
- const getTooltipContent = (name, shortKey) => {
24874
- var _a;
24875
- if (!name && !shortKey) {
24876
- return "";
24877
- }
24878
- if (name === "fullscreen") {
24879
- return `<center>${showFullscreen.value ? t(config.exitName) : t(name)}</center>`;
24880
- }
24881
- let n = void 0;
24882
- if (name == null ? void 0 : name.includes("&")) {
24883
- const temp = name.split("&");
24884
- n = t(temp[0]) + " & " + t(temp[1]);
24885
- }
24886
- return `<center>${(_a = n != null ? n : t(name)) != null ? _a : ""}<br>${shortKey != null ? shortKey : ""}</center>`;
24887
- };
24888
- const onToolbarItemClick = () => {
24889
- var _a;
24890
- const editorIns = getEditorIns();
24891
- if (config.id === "fullscreen") {
24892
- showFullscreen.value = !showFullscreen.value;
24893
- } else {
24894
- (_a = config.handler) == null ? void 0 : _a.call(config, editorIns, config.params);
24895
- }
24896
- };
24897
- return () => createVNode(Fragment, null, [config.type === "button" && createVNode(Tooltip, {
24898
- "position": ["top", "bottom"],
24899
- "content": getTooltipContent(config.name, config.shortKey)
24900
- }, {
24901
- default: () => [createVNode("span", {
24902
- "class": "md-toolbar-item",
24903
- "onClick": onToolbarItemClick,
24904
- "innerHTML": config.id === "fullscreen" ? showFullscreen.value ? config.exitIcon : config.icon : config.icon
24905
- }, null)]
24906
- }), config.type === "dropDown" && createVNode(Dropdown$1, {
24907
- "position": ["bottom-start"],
24908
- "align": "start"
24909
- }, {
24910
- default: () => createVNode("span", null, [createVNode(Tooltip, {
24911
- "position": ["top"],
24912
- "content": getTooltipContent(config.name)
24913
- }, {
24914
- default: () => [createVNode("span", {
24915
- "class": "md-toolbar-item",
24916
- "onClick": () => {
24917
- var _a;
24918
- return (_a = config.handler) == null ? void 0 : _a.call(config);
24919
- },
24920
- "innerHTML": config.icon
24921
- }, null)]
24922
- })]),
24923
- menu: () => createVNode(Fragment, null, [config.component === "FontSize" && createVNode(FontSize, null, null), config.component === "FontColor" && createVNode(FontColor, null, null)])
24924
- })]);
24247
+ var isProto = isPrototype$1(object4), result2 = [];
24248
+ for (var key in object4) {
24249
+ if (!(key == "constructor" && (isProto || !hasOwnProperty$1.call(object4, key)))) {
24250
+ result2.push(key);
24251
+ }
24252
+ }
24253
+ return result2;
24254
+ }
24255
+ var _baseKeysIn = baseKeysIn$1;
24256
+ var arrayLikeKeys = _arrayLikeKeys, baseKeysIn = _baseKeysIn, isArrayLike = isArrayLike_1;
24257
+ function keysIn$3(object4) {
24258
+ return isArrayLike(object4) ? arrayLikeKeys(object4, true) : baseKeysIn(object4);
24259
+ }
24260
+ var keysIn_1 = keysIn$3;
24261
+ var copyObject$2 = _copyObject, keysIn$2 = keysIn_1;
24262
+ function baseAssignIn$1(object4, source) {
24263
+ return object4 && copyObject$2(source, keysIn$2(source), object4);
24264
+ }
24265
+ var _baseAssignIn = baseAssignIn$1;
24266
+ var _cloneBuffer = { exports: {} };
24267
+ (function(module, exports) {
24268
+ var root2 = _root;
24269
+ var freeExports = exports && !exports.nodeType && exports;
24270
+ var freeModule = freeExports && true && module && !module.nodeType && module;
24271
+ var moduleExports = freeModule && freeModule.exports === freeExports;
24272
+ var Buffer2 = moduleExports ? root2.Buffer : void 0, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
24273
+ function cloneBuffer2(buffer, isDeep) {
24274
+ if (isDeep) {
24275
+ return buffer.slice();
24276
+ }
24277
+ var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
24278
+ buffer.copy(result2);
24279
+ return result2;
24925
24280
  }
24926
- });
24927
- function useToolbar() {
24928
- const { toolbars, toolbarConfig } = inject(EditorMdInjectionKey);
24929
- return { toolbars, toolbarConfig };
24281
+ module.exports = cloneBuffer2;
24282
+ })(_cloneBuffer, _cloneBuffer.exports);
24283
+ function copyArray$1(source, array4) {
24284
+ var index2 = -1, length = source.length;
24285
+ array4 || (array4 = Array(length));
24286
+ while (++index2 < length) {
24287
+ array4[index2] = source[index2];
24288
+ }
24289
+ return array4;
24930
24290
  }
24931
- var toolbar = "";
24932
- var Toolbar = defineComponent({
24933
- name: "DMdToolbar",
24934
- setup() {
24935
- const {
24936
- toolbars,
24937
- toolbarConfig
24938
- } = useToolbar();
24939
- return () => createVNode("div", {
24940
- "class": "md-toolbar-container"
24941
- }, [toolbarConfig.value.map((item, index2) => Array.isArray(item) ? createVNode(Fragment, null, [item.map((key, idx) => createVNode(ToolbarItem, {
24942
- "config": toolbars[key],
24943
- "key": `${index2}-${idx}`
24944
- }, null)), createVNode("span", {
24945
- "class": "md-toolbar-span"
24946
- }, null)]) : createVNode(ToolbarItem, {
24947
- "config": toolbars[item],
24948
- "key": index2
24949
- }, null))]);
24291
+ var _copyArray = copyArray$1;
24292
+ function arrayFilter$1(array4, predicate) {
24293
+ var index2 = -1, length = array4 == null ? 0 : array4.length, resIndex = 0, result2 = [];
24294
+ while (++index2 < length) {
24295
+ var value = array4[index2];
24296
+ if (predicate(value, index2, array4)) {
24297
+ result2[resIndex++] = value;
24298
+ }
24950
24299
  }
24951
- });
24952
- const DEFAULT_CONFIG$1 = {
24953
- startOnLoad: false,
24954
- securityLevel: "strict",
24955
- theme: "default",
24956
- flowchart: {
24957
- htmlLabels: true,
24958
- useMaxWidth: false
24300
+ return result2;
24301
+ }
24302
+ var _arrayFilter = arrayFilter$1;
24303
+ function stubArray$2() {
24304
+ return [];
24305
+ }
24306
+ var stubArray_1 = stubArray$2;
24307
+ var arrayFilter = _arrayFilter, stubArray$1 = stubArray_1;
24308
+ var objectProto$1 = Object.prototype;
24309
+ var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
24310
+ var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
24311
+ var getSymbols$3 = !nativeGetSymbols$1 ? stubArray$1 : function(object4) {
24312
+ if (object4 == null) {
24313
+ return [];
24959
24314
  }
24315
+ object4 = Object(object4);
24316
+ return arrayFilter(nativeGetSymbols$1(object4), function(symbol) {
24317
+ return propertyIsEnumerable.call(object4, symbol);
24318
+ });
24960
24319
  };
24961
- function render(code, options) {
24962
- try {
24963
- return `<div class="mermaid" id="${options.id}">${code}</div>`;
24964
- } catch (err) {
24965
- return `<pre>${err.name}: ${err.message}</pre>`;
24320
+ var _getSymbols = getSymbols$3;
24321
+ var copyObject$1 = _copyObject, getSymbols$2 = _getSymbols;
24322
+ function copySymbols$1(source, object4) {
24323
+ return copyObject$1(source, getSymbols$2(source), object4);
24324
+ }
24325
+ var _copySymbols = copySymbols$1;
24326
+ function arrayPush$2(array4, values) {
24327
+ var index2 = -1, length = values.length, offset2 = array4.length;
24328
+ while (++index2 < length) {
24329
+ array4[offset2 + index2] = values[index2];
24966
24330
  }
24331
+ return array4;
24967
24332
  }
24968
- function mermaidRender(md, options = {}) {
24969
- Mermaid.initialize(Object.assign(DEFAULT_CONFIG$1, options));
24970
- const defaultRenderer = md.renderer.rules.fence.bind(md.renderer.rules);
24971
- md.renderer.rules.fence = (tokens, idx, opts, env, self2) => {
24972
- const token = tokens[idx];
24973
- const code = token.content.trim();
24974
- if (token.info.startsWith("mermaid")) {
24975
- return render(code, options);
24333
+ var _arrayPush = arrayPush$2;
24334
+ var overArg = _overArg;
24335
+ var getPrototype$2 = overArg(Object.getPrototypeOf, Object);
24336
+ var _getPrototype = getPrototype$2;
24337
+ var arrayPush$1 = _arrayPush, getPrototype$1 = _getPrototype, getSymbols$1 = _getSymbols, stubArray = stubArray_1;
24338
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
24339
+ var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object4) {
24340
+ var result2 = [];
24341
+ while (object4) {
24342
+ arrayPush$1(result2, getSymbols$1(object4));
24343
+ object4 = getPrototype$1(object4);
24344
+ }
24345
+ return result2;
24346
+ };
24347
+ var _getSymbolsIn = getSymbolsIn$2;
24348
+ var copyObject = _copyObject, getSymbolsIn$1 = _getSymbolsIn;
24349
+ function copySymbolsIn$1(source, object4) {
24350
+ return copyObject(source, getSymbolsIn$1(source), object4);
24351
+ }
24352
+ var _copySymbolsIn = copySymbolsIn$1;
24353
+ var arrayPush = _arrayPush, isArray$1 = isArray_1;
24354
+ function baseGetAllKeys$2(object4, keysFunc, symbolsFunc) {
24355
+ var result2 = keysFunc(object4);
24356
+ return isArray$1(object4) ? result2 : arrayPush(result2, symbolsFunc(object4));
24357
+ }
24358
+ var _baseGetAllKeys = baseGetAllKeys$2;
24359
+ var baseGetAllKeys$1 = _baseGetAllKeys, getSymbols = _getSymbols, keys$1 = keys_1;
24360
+ function getAllKeys$1(object4) {
24361
+ return baseGetAllKeys$1(object4, keys$1, getSymbols);
24362
+ }
24363
+ var _getAllKeys = getAllKeys$1;
24364
+ var baseGetAllKeys = _baseGetAllKeys, getSymbolsIn = _getSymbolsIn, keysIn$1 = keysIn_1;
24365
+ function getAllKeysIn$1(object4) {
24366
+ return baseGetAllKeys(object4, keysIn$1, getSymbolsIn);
24367
+ }
24368
+ var _getAllKeysIn = getAllKeysIn$1;
24369
+ var getNative$3 = _getNative, root$4 = _root;
24370
+ var DataView$1 = getNative$3(root$4, "DataView");
24371
+ var _DataView = DataView$1;
24372
+ var getNative$2 = _getNative, root$3 = _root;
24373
+ var Promise$2 = getNative$2(root$3, "Promise");
24374
+ var _Promise = Promise$2;
24375
+ var getNative$1 = _getNative, root$2 = _root;
24376
+ var Set$2 = getNative$1(root$2, "Set");
24377
+ var _Set = Set$2;
24378
+ var getNative = _getNative, root$1 = _root;
24379
+ var WeakMap$2 = getNative(root$1, "WeakMap");
24380
+ var _WeakMap = WeakMap$2;
24381
+ var DataView = _DataView, Map$1 = _Map, Promise$1 = _Promise, Set$1 = _Set, WeakMap$1 = _WeakMap, baseGetTag = _baseGetTag, toSource = _toSource;
24382
+ var mapTag$3 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$3 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
24383
+ var dataViewTag$2 = "[object DataView]";
24384
+ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
24385
+ var getTag$3 = baseGetTag;
24386
+ if (DataView && getTag$3(new DataView(new ArrayBuffer(1))) != dataViewTag$2 || Map$1 && getTag$3(new Map$1()) != mapTag$3 || Promise$1 && getTag$3(Promise$1.resolve()) != promiseTag || Set$1 && getTag$3(new Set$1()) != setTag$3 || WeakMap$1 && getTag$3(new WeakMap$1()) != weakMapTag$1) {
24387
+ getTag$3 = function(value) {
24388
+ var result2 = baseGetTag(value), Ctor = result2 == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
24389
+ if (ctorString) {
24390
+ switch (ctorString) {
24391
+ case dataViewCtorString:
24392
+ return dataViewTag$2;
24393
+ case mapCtorString:
24394
+ return mapTag$3;
24395
+ case promiseCtorString:
24396
+ return promiseTag;
24397
+ case setCtorString:
24398
+ return setTag$3;
24399
+ case weakMapCtorString:
24400
+ return weakMapTag$1;
24401
+ }
24976
24402
  }
24977
- return defaultRenderer(tokens, idx, opts, env, self2);
24403
+ return result2;
24978
24404
  };
24979
24405
  }
24980
- function refreshMermaid(delay = 0) {
24981
- setTimeout(() => {
24982
- Mermaid.init();
24983
- }, delay);
24406
+ var _getTag = getTag$3;
24407
+ var objectProto = Object.prototype;
24408
+ var hasOwnProperty = objectProto.hasOwnProperty;
24409
+ function initCloneArray$1(array4) {
24410
+ var length = array4.length, result2 = new array4.constructor(length);
24411
+ if (length && typeof array4[0] == "string" && hasOwnProperty.call(array4, "index")) {
24412
+ result2.index = array4.index;
24413
+ result2.input = array4.input;
24414
+ }
24415
+ return result2;
24984
24416
  }
24985
- function listCacheClear$1() {
24986
- this.__data__ = [];
24987
- this.size = 0;
24417
+ var _initCloneArray = initCloneArray$1;
24418
+ var root = _root;
24419
+ var Uint8Array$1 = root.Uint8Array;
24420
+ var _Uint8Array = Uint8Array$1;
24421
+ var Uint8Array2 = _Uint8Array;
24422
+ function cloneArrayBuffer$3(arrayBuffer) {
24423
+ var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
24424
+ new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
24425
+ return result2;
24988
24426
  }
24989
- var _listCacheClear = listCacheClear$1;
24990
- function eq$2(value, other) {
24991
- return value === other || value !== value && other !== other;
24427
+ var _cloneArrayBuffer = cloneArrayBuffer$3;
24428
+ var cloneArrayBuffer$2 = _cloneArrayBuffer;
24429
+ function cloneDataView$1(dataView, isDeep) {
24430
+ var buffer = isDeep ? cloneArrayBuffer$2(dataView.buffer) : dataView.buffer;
24431
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
24992
24432
  }
24993
- var eq_1 = eq$2;
24994
- var eq$1 = eq_1;
24995
- function assocIndexOf$4(array4, key) {
24996
- var length = array4.length;
24997
- while (length--) {
24998
- if (eq$1(array4[length][0], key)) {
24999
- return length;
24433
+ var _cloneDataView = cloneDataView$1;
24434
+ var reFlags = /\w*$/;
24435
+ function cloneRegExp$1(regexp4) {
24436
+ var result2 = new regexp4.constructor(regexp4.source, reFlags.exec(regexp4));
24437
+ result2.lastIndex = regexp4.lastIndex;
24438
+ return result2;
24439
+ }
24440
+ var _cloneRegExp = cloneRegExp$1;
24441
+ var Symbol$1 = _Symbol;
24442
+ var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
24443
+ function cloneSymbol$1(symbol) {
24444
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
24445
+ }
24446
+ var _cloneSymbol = cloneSymbol$1;
24447
+ var cloneArrayBuffer$1 = _cloneArrayBuffer;
24448
+ function cloneTypedArray$1(typedArray, isDeep) {
24449
+ var buffer = isDeep ? cloneArrayBuffer$1(typedArray.buffer) : typedArray.buffer;
24450
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
24451
+ }
24452
+ var _cloneTypedArray = cloneTypedArray$1;
24453
+ var cloneArrayBuffer = _cloneArrayBuffer, cloneDataView = _cloneDataView, cloneRegExp = _cloneRegExp, cloneSymbol = _cloneSymbol, cloneTypedArray = _cloneTypedArray;
24454
+ var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]";
24455
+ var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
24456
+ function initCloneByTag$1(object4, tag2, isDeep) {
24457
+ var Ctor = object4.constructor;
24458
+ switch (tag2) {
24459
+ case arrayBufferTag$1:
24460
+ return cloneArrayBuffer(object4);
24461
+ case boolTag$1:
24462
+ case dateTag$1:
24463
+ return new Ctor(+object4);
24464
+ case dataViewTag$1:
24465
+ return cloneDataView(object4, isDeep);
24466
+ case float32Tag$1:
24467
+ case float64Tag$1:
24468
+ case int8Tag$1:
24469
+ case int16Tag$1:
24470
+ case int32Tag$1:
24471
+ case uint8Tag$1:
24472
+ case uint8ClampedTag$1:
24473
+ case uint16Tag$1:
24474
+ case uint32Tag$1:
24475
+ return cloneTypedArray(object4, isDeep);
24476
+ case mapTag$2:
24477
+ return new Ctor();
24478
+ case numberTag$1:
24479
+ case stringTag$1:
24480
+ return new Ctor(object4);
24481
+ case regexpTag$1:
24482
+ return cloneRegExp(object4);
24483
+ case setTag$2:
24484
+ return new Ctor();
24485
+ case symbolTag$1:
24486
+ return cloneSymbol(object4);
24487
+ }
24488
+ }
24489
+ var _initCloneByTag = initCloneByTag$1;
24490
+ var isObject$1 = isObject_1;
24491
+ var objectCreate = Object.create;
24492
+ var baseCreate$1 = function() {
24493
+ function object4() {
24494
+ }
24495
+ return function(proto) {
24496
+ if (!isObject$1(proto)) {
24497
+ return {};
24498
+ }
24499
+ if (objectCreate) {
24500
+ return objectCreate(proto);
24501
+ }
24502
+ object4.prototype = proto;
24503
+ var result2 = new object4();
24504
+ object4.prototype = void 0;
24505
+ return result2;
24506
+ };
24507
+ }();
24508
+ var _baseCreate = baseCreate$1;
24509
+ var baseCreate = _baseCreate, getPrototype = _getPrototype, isPrototype = _isPrototype;
24510
+ function initCloneObject$1(object4) {
24511
+ return typeof object4.constructor == "function" && !isPrototype(object4) ? baseCreate(getPrototype(object4)) : {};
24512
+ }
24513
+ var _initCloneObject = initCloneObject$1;
24514
+ var getTag$2 = _getTag, isObjectLike$1 = isObjectLike_1;
24515
+ var mapTag$1 = "[object Map]";
24516
+ function baseIsMap$1(value) {
24517
+ return isObjectLike$1(value) && getTag$2(value) == mapTag$1;
24518
+ }
24519
+ var _baseIsMap = baseIsMap$1;
24520
+ var baseIsMap = _baseIsMap, baseUnary$1 = _baseUnary, nodeUtil$1 = _nodeUtil.exports;
24521
+ var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
24522
+ var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
24523
+ var isMap_1 = isMap$1;
24524
+ var getTag$1 = _getTag, isObjectLike = isObjectLike_1;
24525
+ var setTag$1 = "[object Set]";
24526
+ function baseIsSet$1(value) {
24527
+ return isObjectLike(value) && getTag$1(value) == setTag$1;
24528
+ }
24529
+ var _baseIsSet = baseIsSet$1;
24530
+ var baseIsSet = _baseIsSet, baseUnary = _baseUnary, nodeUtil = _nodeUtil.exports;
24531
+ var nodeIsSet = nodeUtil && nodeUtil.isSet;
24532
+ var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
24533
+ var isSet_1 = isSet$1;
24534
+ var Stack = _Stack, arrayEach = _arrayEach, assignValue = _assignValue, baseAssign = _baseAssign, baseAssignIn = _baseAssignIn, cloneBuffer = _cloneBuffer.exports, copyArray = _copyArray, copySymbols = _copySymbols, copySymbolsIn = _copySymbolsIn, getAllKeys = _getAllKeys, getAllKeysIn = _getAllKeysIn, getTag = _getTag, initCloneArray = _initCloneArray, initCloneByTag = _initCloneByTag, initCloneObject = _initCloneObject, isArray = isArray_1, isBuffer = isBuffer$2.exports, isMap = isMap_1, isObject = isObject_1, isSet = isSet_1, keys = keys_1, keysIn = keysIn_1;
24535
+ var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$1 = 4;
24536
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
24537
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
24538
+ var cloneableTags = {};
24539
+ cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
24540
+ cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
24541
+ function baseClone$1(value, bitmask, customizer, key, object4, stack) {
24542
+ var result2, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
24543
+ if (customizer) {
24544
+ result2 = object4 ? customizer(value, key, object4, stack) : customizer(value);
24545
+ }
24546
+ if (result2 !== void 0) {
24547
+ return result2;
24548
+ }
24549
+ if (!isObject(value)) {
24550
+ return value;
24551
+ }
24552
+ var isArr = isArray(value);
24553
+ if (isArr) {
24554
+ result2 = initCloneArray(value);
24555
+ if (!isDeep) {
24556
+ return copyArray(value, result2);
24557
+ }
24558
+ } else {
24559
+ var tag2 = getTag(value), isFunc = tag2 == funcTag || tag2 == genTag;
24560
+ if (isBuffer(value)) {
24561
+ return cloneBuffer(value, isDeep);
24562
+ }
24563
+ if (tag2 == objectTag || tag2 == argsTag || isFunc && !object4) {
24564
+ result2 = isFlat || isFunc ? {} : initCloneObject(value);
24565
+ if (!isDeep) {
24566
+ return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value));
24567
+ }
24568
+ } else {
24569
+ if (!cloneableTags[tag2]) {
24570
+ return object4 ? value : {};
24571
+ }
24572
+ result2 = initCloneByTag(value, tag2, isDeep);
25000
24573
  }
25001
24574
  }
25002
- return -1;
24575
+ stack || (stack = new Stack());
24576
+ var stacked = stack.get(value);
24577
+ if (stacked) {
24578
+ return stacked;
24579
+ }
24580
+ stack.set(value, result2);
24581
+ if (isSet(value)) {
24582
+ value.forEach(function(subValue) {
24583
+ result2.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack));
24584
+ });
24585
+ } else if (isMap(value)) {
24586
+ value.forEach(function(subValue, key2) {
24587
+ result2.set(key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
24588
+ });
24589
+ }
24590
+ var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
24591
+ var props = isArr ? void 0 : keysFunc(value);
24592
+ arrayEach(props || value, function(subValue, key2) {
24593
+ if (props) {
24594
+ key2 = subValue;
24595
+ subValue = value[key2];
24596
+ }
24597
+ assignValue(result2, key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
24598
+ });
24599
+ return result2;
24600
+ }
24601
+ var _baseClone = baseClone$1;
24602
+ var baseClone = _baseClone;
24603
+ var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4;
24604
+ function cloneDeep(value) {
24605
+ return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
24606
+ }
24607
+ var cloneDeep_1 = cloneDeep;
24608
+ const UNDO_ICON = `<svg width="16px" height="14px" viewBox="0 0 16 14">
24609
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24610
+ <g fill="#293040">
24611
+ <path d="M11,5 C13.7614237,5 16,7.23857625 16,10 C16,12.7614237 13.7614237,15 11,15 L7,15 L7,14 L11,14 C13.209139,14 15,12.209139 15,10 C15,7.790861 13.209139,6 11,6 L5,6 L5,10 L0,5.5 L5,1 L5,5 L11,5 Z" id="\u8DEF\u5F84"></path>
24612
+ </g>
24613
+ </g>
24614
+ </svg>`;
24615
+ const REDO_ICON = `<svg width="16px" height="14px" viewBox="0 0 16 14">
24616
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24617
+ <g fill="#293040">
24618
+ <path d="M5,5 L11,5 L11,1 L16,5.5 L11,10 L11,6 L5,6 C2.790861,6 1,7.790861 1,10 C1,12.209139 2.790861,14 5,14 L9,14 L9,15 L5,15 C2.23857625,15 0,12.7614237 0,10 C0,7.23857625 2.23857625,5 5,5 Z" id="\u8DEF\u5F84"></path>
24619
+ </g>
24620
+ </g>
24621
+ </svg>`;
24622
+ const BOLD_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24623
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24624
+ <g fill="#293040">
24625
+ <path d="M14,11 C14,13.7614237 11.7614237,16 9,16 L2,16 L2,0 L8,0 C10.209139,-4.05812251e-16 12,1.790861 12,4 C12,4.93647913 11.6781808,5.79779336 11.1391019,6.4793831 C12.8303741,7.28108833 14,9.00395379 14,11 Z M9,8 L4,8 L4,14 L9,14 C10.6568542,14 12,12.6568542 12,11 C12,9.34314575 10.6568542,8 9,8 Z M8,6 C9.1045695,6 10,5.1045695 10,4 C10,2.8954305 9.1045695,2 8,2 L4,2 L4,6 L8,6 Z" id="\u5F62\u72B6"></path>
24626
+ </g>
24627
+ </g>
24628
+ </svg>`;
24629
+ const ITALIC_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24630
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24631
+ <g fill="#293040">
24632
+ <polygon id="\u8DEF\u5F84" points="6 15 9 1 6 1 6 0 13 0 13 1 10 1 7 15 10 15 10 16 3 16 3 15"></polygon>
24633
+ </g>
24634
+ </g>
24635
+ </svg>`;
24636
+ const UNDERLINE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24637
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24638
+ <g fill="#293040">
24639
+ <path d="M4,0 L4,7 C4,9.209139 5.790861,11 8,11 C10.209139,11 12,9.209139 12,7 L12,0 L13,0 L13,7 C13,9.76142375 10.7614237,12 8,12 C5.23857625,12 3,9.76142375 3,7 L3,0 L4,0 Z M2,14 L14,14 L14,16 L2,16 L2,14 Z" id="\u5F62\u72B6"></path>
24640
+ </g>
24641
+ </g>
24642
+ </svg>`;
24643
+ const STRIKE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24644
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24645
+ <g fill="#293040">
24646
+ <path d="M16,8 L16,10 L11.4648712,10 C11.8052114,10.5883467 12,11.2714257 12,12 C12,14.209139 10.209139,16 8,16 C5.790861,16 4,14.209139 4,12 C4,11.6547004 4.043753,11.3196199 4.12601749,11 L5.17070571,11 C5.06015422,11.3127789 5,11.6493646 5,12 C5,13.6568542 6.34314575,15 8,15 C9.65685425,15 11,13.6568542 11,12 C11,11.2316456 10.7111464,10.5307565 10.2361065,10 L0,10 L0,8 L5.3541756,8 C4.52375489,7.26705555 4,6.19469253 4,5 C4,2.790861 5.790861,1 8,1 C10.209139,1 12,2.790861 12,5 C12,5.72857429 11.8052114,6.41165327 11.4648712,7 L10.2361065,7 C10.7111464,6.46924351 11,5.76835444 11,5 C11,3.34314575 9.65685425,2 8,2 C6.34314575,2 5,3.34314575 5,5 C5,6.65685425 6.34314575,8 8,8 L16,8 Z M4.53512878,10 L5.76389349,10 L4.53512878,10 L4.53512878,10 Z" id="\u5F62\u72B6"></path>
24647
+ </g>
24648
+ </g>
24649
+ </svg>`;
24650
+ const COLOR_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24651
+ <g id="edit-icon/background-color" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24652
+ <g fill="#293040">
24653
+ <g>
24654
+ <path d="M10.4761905,8 L5.52380952,8 L4,12 L3,12 L7.5,-3.84581256e-13 L8.5,-3.84581256e-13 L13,12 L12,12 L10.4761905,8 L10.4761905,8 Z M10.0952381,7 L8,1.5 L5.9047619,7 L10.0952381,7 Z M2,14 L14,14 L14,16 L2,16 L2,14 Z" id="\u5F62\u72B6"></path>
24655
+ </g>
24656
+ </g>
24657
+ </g>
24658
+ </svg>`;
24659
+ const LIST_UNORDERED_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24660
+ <g id="edit-icon/unordered-list" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24661
+ <g fill="#293040">
24662
+ <g>
24663
+ <path d="M5,1 L16,1 L16,2.5 L5,2.5 L5,1 Z M2,4 C0.8954305,4 0,3.1045695 0,2 C0,0.8954305 0.8954305,0 2,0 C3.1045695,0 4,0.8954305 4,2 C4,3.1045695 3.1045695,4 2,4 Z M2,3 C2.55228475,3 3,2.55228475 3,2 C3,1.44771525 2.55228475,1 2,1 C1.44771525,1 1,1.44771525 1,2 C1,2.55228475 1.44771525,3 2,3 Z M2,10 C0.8954305,10 0,9.1045695 0,8 C0,6.8954305 0.8954305,6 2,6 C3.1045695,6 4,6.8954305 4,8 C4,9.1045695 3.1045695,10 2,10 Z M2,9 C2.55228475,9 3,8.55228475 3,8 C3,7.44771525 2.55228475,7 2,7 C1.44771525,7 1,7.44771525 1,8 C1,8.55228475 1.44771525,9 2,9 Z M2,16 C0.8954305,16 0,15.1045695 0,14 C0,12.8954305 0.8954305,12 2,12 C3.1045695,12 4,12.8954305 4,14 C4,15.1045695 3.1045695,16 2,16 Z M2,15 C2.55228475,15 3,14.5522847 3,14 C3,13.4477153 2.55228475,13 2,13 C1.44771525,13 1,13.4477153 1,14 C1,14.5522847 1.44771525,15 2,15 Z M5,7 L16,7 L16,8.5 L5,8.5 L5,7 Z M5,13 L16,13 L16,14.5 L5,14.5 L5,13 Z" id="\u5F62\u72B6"></path>
24664
+ </g>
24665
+ </g>
24666
+ </g>
24667
+ </svg>`;
24668
+ const LIST_ORDERED_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24669
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24670
+ <g fill="#293040">
24671
+ <path d="M5,1 L16,1 L16,2.5 L5,2.5 L5,1 Z M0,0 L2,0 L2,3 L3,3 L3,4 L0,4 L0,3 L1,3 L1,1 L0,1 L0,0 Z M5,7 L16,7 L16,8.5 L5,8.5 L5,7 Z M5,13 L16,13 L16,14.5 L5,14.5 L5,13 Z M0,15 L1.75,15 C1.88807119,15 2,14.8880712 2,14.75 C2,14.6119288 1.88807119,14.5 1.75,14.5 L0,14.5 L0,13.5 L1.75,13.5 C1.88807119,13.5 2,13.3880712 2,13.25 C2,13.1119288 1.88807119,13 1.75,13 L0,13 L0,12 L1.5,12 C2.32842712,12 3,12.6715729 3,13.5 C3,13.6753177 2.96992289,13.8436105 2.91464715,14 C2.96992289,14.1563895 3,14.3246823 3,14.5 C3,15.3284271 2.32842712,16 1.5,16 L0,16 L0,15 Z M2,7.5 C2,7.35127258 1.9375,7.22627258 1.84375,7.13845444 C1.76307119,7.05596441 1.63807119,7 1.5,7 C1.22385763,7 1,7.22385763 1,7.5 L1.62630326e-19,7.5 C0.147399902,6.5 0.647399902,6 1.5,6 C2.32842712,6 3,6.67157288 3,7.5 C3,8.07312512 2.50016007,8.55650475 2.22821045,8.74661255 C1.95626083,8.93672035 1.77325955,8.99789088 1.76769962,9 L3,9 L3,10 L0,10 L1.62630326e-19,9 C0.619515577,8.77257137 1.06188822,8.55939591 1.32711792,8.36047363 C1.6371448,8.12795347 1.87259637,7.91592701 1.96143498,7.69289356 C1.98627694,7.633537 2,7.5683711 2,7.5 Z" id="\u5F62\u72B6"></path>
24672
+ </g>
24673
+ </g>
24674
+ </svg>`;
24675
+ const LIST_CHECK_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24676
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24677
+ <path d="M14,15 L14,9.37100497 L15,9.37100497 L15,16 L1,16 L1,2 L10.1946467,2 L10.1946467,3 L2,3 L2,15 L14,15 Z M14.4525049,2.48740937 C14.7356009,2.1850362 15.2102174,2.16940895 15.5125906,2.45250493 C15.8149638,2.73560092 15.8305911,3.21021745 15.5474951,3.51259063 L8.45990379,11.0828057 L4.46558382,7.02621226 C4.17496481,6.73106236 4.17863783,6.25620283 4.47378774,5.96558382 C4.76893764,5.67496481 5.24379717,5.67863783 5.53441618,5.97378774 L8.43263799,8.91719429 L14.4525049,2.48740937 Z" id="\u5F62\u72B6\u7ED3\u5408" fill="#293040" fill-rule="nonzero"></path>
24678
+ </g>
24679
+ </svg>`;
24680
+ const IMAGE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24681
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24682
+ <path d="M0,1 L16,1 L16,15 L0,15 L0,1 Z M1,2 L1,14 L15,14 L15,2 L1,2 Z M12,10 L9,11 L4,8 L1,10 L1,9 L4,7 L9,10 L12,9 L15,11 L15,12 L12,10 Z M12,7 C11.4477153,7 11,6.55228475 11,6 C11,5.44771525 11.4477153,5 12,5 C12.5522847,5 13,5.44771525 13,6 C13,6.55228475 12.5522847,7 12,7 Z" id="\u5F62\u72B6" fill="#293040"></path>
24683
+ </g>
24684
+ </svg>`;
24685
+ const FILE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24686
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24687
+ <path d="M16,16 L1,16 L1,0 L12,0 L16,4 L16,16 Z M11,1 L2,1 L2,15 L15,15 L15,5 L11,5 L11,1 Z M12,1.533 L12,4 L14.52,4 L12,1.533 Z" fill-rule="nonzero" id="\u5F62\u72B6" fill="#293040"></path>
24688
+ <polygon id="path" fill="#293040" points="8 8 6 8 8.5 5 11 8 9 8 9 12 8 12"></polygon>
24689
+ </g>
24690
+ </svg>`;
24691
+ const TABLE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24692
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24693
+ <path d="M6,11 L10,11 L10,8 L6,8 L6,11 Z M6,12 L6,15 L5,15 L5,12 L1,12 L1,11 L5,11 L5,8 L1,8 L1,7 L15,7 L15,8 L11,8 L11,11 L15,11 L15,12 L11,12 L11,15 L10,15 L10,12 L6,12 Z M1,0 L15,0 C15.5522847,0 16,0.44771525 16,1 L16,15 C16,15.5522847 15.5522847,16 15,16 L1,16 C0.44771525,16 0,15.5522847 0,15 L0,1 C0,0.44771525 0.44771525,0 1,0 Z M1,1 L1,15 L15,15 L15,1 L1,1 Z" id="\u5F62\u72B6" fill="#293040"></path>
24694
+ </g>
24695
+ </svg>`;
24696
+ const LINK_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24697
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24698
+ <path d="M4.499,10.863 L10.863,4.499 L11.573,5.209 L5.209,11.573 L4.499,10.863 Z M3.64649819,6.99452063 C3.66194719,7.01086151 3.67767307,7.02703631 3.69367584,7.04303908 L4.38852082,7.73788406 L1.80224782,10.3241571 C0.732584061,11.3938208 0.732584061,13.1280884 1.80224782,14.1977522 C2.87191157,15.2674159 4.60617918,15.2674159 5.67584293,14.1977522 L8.26211594,11.6114792 L8.95696092,12.3063242 C8.97296369,12.3223269 8.98913849,12.3380528 9.00547937,12.3535018 L6.46886252,14.8901187 C4.98902073,16.3699604 2.58972313,16.3699604 1.10988134,14.8901187 C-0.369960447,13.4102769 -0.369960447,11.0109793 1.10988134,9.53113748 L3.64649819,6.99452063 Z M6.99452063,3.64649819 L9.53113748,1.10988134 C11.0109793,-0.369960447 13.4102769,-0.369960447 14.8901187,1.10988134 C16.3699604,2.58972313 16.3699604,4.98902073 14.8901187,6.46886252 L12.3535018,9.00547937 C12.3380528,8.98913849 12.3223269,8.97296369 12.3063242,8.95696092 L11.6114792,8.26211594 L14.1977522,5.67584293 C15.2674159,4.60617918 15.2674159,2.87191157 14.1977522,1.80224782 C13.1280884,0.732584061 11.3938208,0.732584061 10.3241571,1.80224782 L7.73788406,4.38852082 L7.04303908,3.69367584 C7.02703631,3.67767307 7.01086151,3.66194719 6.99452063,3.64649819 Z" id="\u5F62\u72B6" fill="#293040" fill-rule="nonzero"></path>
24699
+ </g>
24700
+ </svg>`;
24701
+ const CODE_ICON = `<svg viewBox="0 0 1024 1024" width="16" height="16">
24702
+ <path d="M438.4 849.1l222.7-646.7c0.2-0.5 0.3-1.1 0.4-1.6L438.4 849.1z" p-id="13752"></path>
24703
+ <path d="M661.2 168.7h-67.5c-3.4 0-6.5 2.2-7.6 5.4L354.7 846c-0.3 0.8-0.4 1.7-0.4 2.6 0 4.4 3.6 8 8 8h67.8c3.4 0 6.5-2.2 7.6-5.4l0.7-2.1 223.1-648.3 7.4-21.4c0.3-0.8 0.4-1.7 0.4-2.6-0.1-4.5-3.6-8.1-8.1-8.1zM954.6 502.1c-0.8-1-1.7-1.9-2.7-2.7l-219-171.3c-3.5-2.7-8.5-2.1-11.2 1.4-1.1 1.4-1.7 3.1-1.7 4.9v81.3c0 2.5 1.1 4.8 3.1 6.3l115 90-115 90c-1.9 1.5-3.1 3.8-3.1 6.3v81.3c0 4.4 3.6 8 8 8 1.8 0 3.5-0.6 4.9-1.7l219-171.3c6.9-5.4 8.2-15.5 2.7-22.5zM291.1 328.1l-219 171.3c-1 0.8-1.9 1.7-2.7 2.7-5.4 7-4.2 17 2.7 22.5l219 171.3c1.4 1.1 3.1 1.7 4.9 1.7 4.4 0 8-3.6 8-8v-81.3c0-2.5-1.1-4.8-3.1-6.3l-115-90 115-90c1.9-1.5 3.1-3.8 3.1-6.3v-81.3c0-1.8-0.6-3.5-1.7-4.9-2.7-3.5-7.7-4.1-11.2-1.4z" p-id="13753"></path>
24704
+ </svg>`;
24705
+ const H1_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24706
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24707
+ <path d="M0,0 L16,0 L16,16 L0,16 L0,0 Z M1,1 L1,15 L15,15 L15,1 L1,1 Z M12,12 L13,12 L13,13 L10,13 L10,12 L11,12 L11,9 L10,9 L10,8 L12,8 L12,12 Z M3,3 L11,3 L11,4 L3,4 L3,3 Z" id="\u5F62\u72B6" fill="#293040"></path>
24708
+ </g>
24709
+ </svg>`;
24710
+ const H2_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24711
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24712
+ <path d="M0,16 L0,0 L16,0 L16,16 L0,16 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M11,4 L3,4 L3,3 L11,3 L11,4 Z M13,8 L13,11 L10,11 L10,12 L13,12 L13,13 L9,13 L9,10 L12,10 L12,9 L9,9 L9,8 L13,8 Z" id="\u5F62\u72B6" fill="#293040"></path>
24713
+ </g>
24714
+ </svg>`;
24715
+ const FONT_SIZE_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16" >
24716
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24717
+ <g fill="#293040">
24718
+ <path d="M4,9 L4,16 L3,16 L3,9 L0,9 L0,8 L7,8 L7,9 L4,9 Z M11,1 L11,16 L10,16 L10,1 L5,1 L5,0 L16,0 L16,1 L11,1 Z" id="\u5F62\u72B6"></path>
24719
+ </g>
24720
+ </g>
24721
+ </svg>`;
24722
+ const FULLSCREEN_EXPAND_ICON = `<svg width="16px" height="16px" viewBox="0 0 16 16">
24723
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24724
+ <path d="M16,16 L11.429,16 L11.429,15 L14.456,15 L11.006,11.226 L11.652,10.519 L15.086,14.275 L15.086,11 L16,11 L16,16 Z M15.164,1.544 L12.009,4.994 L11.418,4.348 L14.558,0.914 L11.82,0.914 L11.82,0 L16,0 L16,4.571 L15.164,4.571 L15.164,1.544 Z M5,15 L5,16 L0,16 L0,11 L1,11 L1,14.275 L4.756,10.519 L5.463,11.226 L1.689,15 L5,15 Z M4.365,4.994 L0.914,1.544 L0.914,4.571 L3.41060513e-13,4.571 L3.41060513e-13,0 L4.571,0 L4.571,0.914 L1.578,0.914 L5.011,4.348 L4.365,4.994 Z" id="\u5F62\u72B6" fill="#293040" fill-rule="nonzero"></path>
24725
+ </g>
24726
+ </svg>`;
24727
+ const FULLSCREEN_CONTRACT_ICON = `<svg class="icon" viewBox="0 0 1024 1024" width="16" height="16">
24728
+ <path fill="#293040" d="M682.666667 384h192a21.333333 21.333333 0 0 0 21.333333-21.333333v-42.666667a21.333333 21.333333 0 0 0-21.333333-21.333333H725.333333V149.333333a21.333333 21.333333 0 0 0-21.333333-21.333333h-42.666667a21.333333 21.333333 0 0 0-21.333333 21.333333V341.333333a42.666667 42.666667 0 0 0 42.666667 42.666667zM384 341.333333V149.333333a21.333333 21.333333 0 0 0-21.333333-21.333333h-42.666667a21.333333 21.333333 0 0 0-21.333333 21.333333V298.666667H149.333333a21.333333 21.333333 0 0 0-21.333333 21.333333v42.666667a21.333333 21.333333 0 0 0 21.333333 21.333333H341.333333a42.666667 42.666667 0 0 0 42.666667-42.666667z m341.333333 533.333334V725.333333h149.333334a21.333333 21.333333 0 0 0 21.333333-21.333333v-42.666667a21.333333 21.333333 0 0 0-21.333333-21.333333H682.666667a42.666667 42.666667 0 0 0-42.666667 42.666667v192a21.333333 21.333333 0 0 0 21.333333 21.333333h42.666667a21.333333 21.333333 0 0 0 21.333333-21.333333z m-405.333333 21.333333h42.666667a21.333333 21.333333 0 0 0 21.333333-21.333333V682.666667a42.666667 42.666667 0 0 0-42.666667-42.666667H149.333333a21.333333 21.333333 0 0 0-21.333333 21.333333v42.666667a21.333333 21.333333 0 0 0 21.333333 21.333333H298.666667v149.333334a21.333333 21.333333 0 0 0 21.333333 21.333333z" p-id="17085"></path>
24729
+ </svg>`;
24730
+ class ToolBarHandler {
25003
24731
  }
25004
- var _assocIndexOf = assocIndexOf$4;
25005
- var assocIndexOf$3 = _assocIndexOf;
25006
- var arrayProto = Array.prototype;
25007
- var splice = arrayProto.splice;
25008
- function listCacheDelete$1(key) {
25009
- var data = this.__data__, index2 = assocIndexOf$3(data, key);
25010
- if (index2 < 0) {
25011
- return false;
24732
+ __publicField(ToolBarHandler, "undo", (editor) => {
24733
+ editor.undo();
24734
+ });
24735
+ __publicField(ToolBarHandler, "redo", (editor) => {
24736
+ editor.redo();
24737
+ });
24738
+ __publicField(ToolBarHandler, "bold", (editor) => {
24739
+ const cursor = editor.getCursor();
24740
+ const selection = editor.getSelection();
24741
+ editor.replaceSelection("**" + selection + "**");
24742
+ editor.focus();
24743
+ if (selection === "") {
24744
+ editor.setCursor(cursor.line, cursor.ch + 2);
25012
24745
  }
25013
- var lastIndex = data.length - 1;
25014
- if (index2 == lastIndex) {
25015
- data.pop();
25016
- } else {
25017
- splice.call(data, index2, 1);
24746
+ });
24747
+ __publicField(ToolBarHandler, "italic", (editor) => {
24748
+ const cursor = editor.getCursor();
24749
+ const selection = editor.getSelection();
24750
+ editor.replaceSelection("*" + selection + "*");
24751
+ editor.focus();
24752
+ if (selection === "") {
24753
+ editor.setCursor(cursor.line, cursor.ch + 1);
25018
24754
  }
25019
- --this.size;
25020
- return true;
25021
- }
25022
- var _listCacheDelete = listCacheDelete$1;
25023
- var assocIndexOf$2 = _assocIndexOf;
25024
- function listCacheGet$1(key) {
25025
- var data = this.__data__, index2 = assocIndexOf$2(data, key);
25026
- return index2 < 0 ? void 0 : data[index2][1];
25027
- }
25028
- var _listCacheGet = listCacheGet$1;
25029
- var assocIndexOf$1 = _assocIndexOf;
25030
- function listCacheHas$1(key) {
25031
- return assocIndexOf$1(this.__data__, key) > -1;
25032
- }
25033
- var _listCacheHas = listCacheHas$1;
25034
- var assocIndexOf = _assocIndexOf;
25035
- function listCacheSet$1(key, value) {
25036
- var data = this.__data__, index2 = assocIndexOf(data, key);
25037
- if (index2 < 0) {
25038
- ++this.size;
25039
- data.push([key, value]);
24755
+ });
24756
+ __publicField(ToolBarHandler, "h1", (editor) => {
24757
+ const cursor = editor.getCursor();
24758
+ const selection = editor.getSelection();
24759
+ editor.focus();
24760
+ if (cursor.ch !== 0) {
24761
+ editor.setCursor(cursor.line, 0);
24762
+ editor.replaceSelection("# " + selection);
24763
+ editor.setCursor(cursor.line, cursor.ch + 2);
25040
24764
  } else {
25041
- data[index2][1] = value;
24765
+ editor.replaceSelection("# " + selection);
25042
24766
  }
25043
- return this;
25044
- }
25045
- var _listCacheSet = listCacheSet$1;
25046
- var listCacheClear = _listCacheClear, listCacheDelete = _listCacheDelete, listCacheGet = _listCacheGet, listCacheHas = _listCacheHas, listCacheSet = _listCacheSet;
25047
- function ListCache$4(entries) {
25048
- var index2 = -1, length = entries == null ? 0 : entries.length;
25049
- this.clear();
25050
- while (++index2 < length) {
25051
- var entry = entries[index2];
25052
- this.set(entry[0], entry[1]);
24767
+ });
24768
+ __publicField(ToolBarHandler, "h2", (editor) => {
24769
+ const cursor = editor.getCursor();
24770
+ const selection = editor.getSelection();
24771
+ editor.focus();
24772
+ if (cursor.ch !== 0) {
24773
+ editor.setCursor(cursor.line, 0);
24774
+ editor.replaceSelection("## " + selection);
24775
+ editor.setCursor(cursor.line, cursor.ch + 3);
24776
+ } else {
24777
+ editor.replaceSelection("## " + selection);
25053
24778
  }
25054
- }
25055
- ListCache$4.prototype.clear = listCacheClear;
25056
- ListCache$4.prototype["delete"] = listCacheDelete;
25057
- ListCache$4.prototype.get = listCacheGet;
25058
- ListCache$4.prototype.has = listCacheHas;
25059
- ListCache$4.prototype.set = listCacheSet;
25060
- var _ListCache = ListCache$4;
25061
- var ListCache$3 = _ListCache;
25062
- function stackClear$1() {
25063
- this.__data__ = new ListCache$3();
25064
- this.size = 0;
25065
- }
25066
- var _stackClear = stackClear$1;
25067
- function stackDelete$1(key) {
25068
- var data = this.__data__, result2 = data["delete"](key);
25069
- this.size = data.size;
25070
- return result2;
25071
- }
25072
- var _stackDelete = stackDelete$1;
25073
- function stackGet$1(key) {
25074
- return this.__data__.get(key);
25075
- }
25076
- var _stackGet = stackGet$1;
25077
- function stackHas$1(key) {
25078
- return this.__data__.has(key);
25079
- }
25080
- var _stackHas = stackHas$1;
25081
- var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
25082
- var _freeGlobal = freeGlobal$1;
25083
- var freeGlobal = _freeGlobal;
25084
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
25085
- var root$8 = freeGlobal || freeSelf || Function("return this")();
25086
- var _root = root$8;
25087
- var root$7 = _root;
25088
- var Symbol$4 = root$7.Symbol;
25089
- var _Symbol = Symbol$4;
25090
- var Symbol$3 = _Symbol;
25091
- var objectProto$c = Object.prototype;
25092
- var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
25093
- var nativeObjectToString$1 = objectProto$c.toString;
25094
- var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : void 0;
25095
- function getRawTag$1(value) {
25096
- var isOwn = hasOwnProperty$9.call(value, symToStringTag$1), tag2 = value[symToStringTag$1];
25097
- try {
25098
- value[symToStringTag$1] = void 0;
25099
- var unmasked = true;
25100
- } catch (e) {
24779
+ });
24780
+ __publicField(ToolBarHandler, "ul", (editor) => {
24781
+ const selection = editor.getSelection();
24782
+ editor.focus();
24783
+ if (selection === "") {
24784
+ editor.replaceSelection("- " + selection);
24785
+ } else {
24786
+ const selectionText = selection.split("\n");
24787
+ for (let i = 0, len = selectionText.length; i < len; i++) {
24788
+ selectionText[i] = selectionText[i] === "" ? "" : "- " + selectionText[i];
24789
+ }
24790
+ editor.replaceSelection(selectionText.join("\n"));
25101
24791
  }
25102
- var result2 = nativeObjectToString$1.call(value);
25103
- if (unmasked) {
25104
- if (isOwn) {
25105
- value[symToStringTag$1] = tag2;
25106
- } else {
25107
- delete value[symToStringTag$1];
24792
+ });
24793
+ __publicField(ToolBarHandler, "ol", (editor) => {
24794
+ const selection = editor.getSelection();
24795
+ editor.focus();
24796
+ if (selection === "") {
24797
+ editor.replaceSelection("1. " + selection);
24798
+ } else {
24799
+ const selectionText = selection.split("\n");
24800
+ for (let i = 0, len = selectionText.length; i < len; i++) {
24801
+ selectionText[i] = selectionText[i] === "" ? "" : i + 1 + ". " + selectionText[i];
25108
24802
  }
24803
+ editor.replaceSelection(selectionText.join("\n"));
25109
24804
  }
25110
- return result2;
25111
- }
25112
- var _getRawTag = getRawTag$1;
25113
- var objectProto$b = Object.prototype;
25114
- var nativeObjectToString = objectProto$b.toString;
25115
- function objectToString$1(value) {
25116
- return nativeObjectToString.call(value);
25117
- }
25118
- var _objectToString = objectToString$1;
25119
- var Symbol$2 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
25120
- var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
25121
- var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
25122
- function baseGetTag$4(value) {
25123
- if (value == null) {
25124
- return value === void 0 ? undefinedTag : nullTag;
24805
+ });
24806
+ __publicField(ToolBarHandler, "underline", (editor) => {
24807
+ const cursor = editor.getCursor();
24808
+ const selection = editor.getSelection();
24809
+ editor.focus();
24810
+ editor.replaceSelection("<ins>" + selection + "</ins>");
24811
+ if (selection === "") {
24812
+ editor.setCursor(cursor.line, cursor.ch + 5);
25125
24813
  }
25126
- return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
25127
- }
25128
- var _baseGetTag = baseGetTag$4;
25129
- function isObject$5(value) {
25130
- var type4 = typeof value;
25131
- return value != null && (type4 == "object" || type4 == "function");
25132
- }
25133
- var isObject_1 = isObject$5;
25134
- var baseGetTag$3 = _baseGetTag, isObject$4 = isObject_1;
25135
- var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
25136
- function isFunction$2(value) {
25137
- if (!isObject$4(value)) {
25138
- return false;
24814
+ });
24815
+ __publicField(ToolBarHandler, "strike", (editor) => {
24816
+ const cursor = editor.getCursor();
24817
+ const selection = editor.getSelection();
24818
+ editor.replaceSelection("~~" + selection + "~~");
24819
+ editor.focus();
24820
+ if (selection === "") {
24821
+ editor.setCursor(cursor.line, cursor.ch + 2);
25139
24822
  }
25140
- var tag2 = baseGetTag$3(value);
25141
- return tag2 == funcTag$2 || tag2 == genTag$1 || tag2 == asyncTag || tag2 == proxyTag;
25142
- }
25143
- var isFunction_1 = isFunction$2;
25144
- var root$6 = _root;
25145
- var coreJsData$1 = root$6["__core-js_shared__"];
25146
- var _coreJsData = coreJsData$1;
25147
- var coreJsData = _coreJsData;
25148
- var maskSrcKey = function() {
25149
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
25150
- return uid ? "Symbol(src)_1." + uid : "";
25151
- }();
25152
- function isMasked$1(func) {
25153
- return !!maskSrcKey && maskSrcKey in func;
25154
- }
25155
- var _isMasked = isMasked$1;
25156
- var funcProto$1 = Function.prototype;
25157
- var funcToString$1 = funcProto$1.toString;
25158
- function toSource$2(func) {
25159
- if (func != null) {
25160
- try {
25161
- return funcToString$1.call(func);
25162
- } catch (e) {
24823
+ });
24824
+ __publicField(ToolBarHandler, "checkList", (editor) => {
24825
+ const selection = editor.getSelection();
24826
+ editor.focus();
24827
+ if (selection === "") {
24828
+ editor.replaceSelection("- [ ] " + selection);
24829
+ } else {
24830
+ const selectionText = selection.split("\n");
24831
+ for (let i = 0, len = selectionText.length; i < len; i++) {
24832
+ selectionText[i] = selectionText[i] === "" ? "" : "- [ ] " + selectionText[i];
25163
24833
  }
25164
- try {
25165
- return func + "";
25166
- } catch (e) {
24834
+ editor.replaceSelection(selectionText.join("\n"));
24835
+ }
24836
+ });
24837
+ __publicField(ToolBarHandler, "font", () => {
24838
+ });
24839
+ __publicField(ToolBarHandler, "link", (editor) => {
24840
+ const cursor = editor.getCursor();
24841
+ const selection = editor.getSelection();
24842
+ editor.focus();
24843
+ editor.replaceSelection("[" + selection + "](url)");
24844
+ if (selection === "") {
24845
+ editor.setCursor(cursor.line, cursor.ch + 1);
24846
+ }
24847
+ });
24848
+ __publicField(ToolBarHandler, "image", (editor, params) => {
24849
+ const stopEventPropagation = (e) => {
24850
+ e.stopPropagation();
24851
+ };
24852
+ if (typeof document !== "undefined" && params.imageUploadToServer) {
24853
+ let imageUploader = document.getElementById("markdown_image_upload_input");
24854
+ if (imageUploader) {
24855
+ imageUploader.removeEventListener("click", stopEventPropagation);
24856
+ document.body.removeChild(imageUploader);
24857
+ }
24858
+ imageUploader = document.createElement("input");
24859
+ imageUploader.addEventListener("click", stopEventPropagation);
24860
+ imageUploader.setAttribute("type", "file");
24861
+ imageUploader.setAttribute("accept", "image/bmp,image/gif,image/jpeg,image/jpg,image/png,image/tiff");
24862
+ imageUploader.id = "markdown_image_upload_input";
24863
+ imageUploader.style.display = "none";
24864
+ document.body.appendChild(imageUploader);
24865
+ const callback = ({ name, imgUrl, title }) => {
24866
+ editor.focus();
24867
+ editor.replaceSelection(`![${name}](${imgUrl} '${title}')`);
24868
+ };
24869
+ imageUploader.onchange = (e) => {
24870
+ const file = e.target["files"][0];
24871
+ params.imageUpload({ file, callback });
24872
+ };
24873
+ imageUploader.click();
24874
+ } else {
24875
+ const cursor = editor.getCursor();
24876
+ const selection = editor.getSelection();
24877
+ editor.focus();
24878
+ editor.replaceSelection("![" + selection + "](src 'title')");
24879
+ if (selection === "") {
24880
+ editor.setCursor(cursor.line, cursor.ch + 2);
25167
24881
  }
25168
24882
  }
25169
- return "";
25170
- }
25171
- var _toSource = toSource$2;
25172
- var isFunction$1 = isFunction_1, isMasked = _isMasked, isObject$3 = isObject_1, toSource$1 = _toSource;
25173
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
25174
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
25175
- var funcProto = Function.prototype, objectProto$a = Object.prototype;
25176
- var funcToString = funcProto.toString;
25177
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
25178
- var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty$8).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
25179
- function baseIsNative$1(value) {
25180
- if (!isObject$3(value) || isMasked(value)) {
25181
- return false;
24883
+ });
24884
+ __publicField(ToolBarHandler, "file", (editor, params) => {
24885
+ const stopEventPropagation = (e) => {
24886
+ e.stopPropagation();
24887
+ };
24888
+ let fileUploader = document.getElementById("markdown_file_upload_input");
24889
+ if (fileUploader) {
24890
+ fileUploader.removeEventListener("click", stopEventPropagation);
24891
+ document.body.removeChild(fileUploader);
25182
24892
  }
25183
- var pattern4 = isFunction$1(value) ? reIsNative : reIsHostCtor;
25184
- return pattern4.test(toSource$1(value));
25185
- }
25186
- var _baseIsNative = baseIsNative$1;
25187
- function getValue$1(object4, key) {
25188
- return object4 == null ? void 0 : object4[key];
25189
- }
25190
- var _getValue = getValue$1;
25191
- var baseIsNative = _baseIsNative, getValue = _getValue;
25192
- function getNative$7(object4, key) {
25193
- var value = getValue(object4, key);
25194
- return baseIsNative(value) ? value : void 0;
25195
- }
25196
- var _getNative = getNative$7;
25197
- var getNative$6 = _getNative, root$5 = _root;
25198
- var Map$4 = getNative$6(root$5, "Map");
25199
- var _Map = Map$4;
25200
- var getNative$5 = _getNative;
25201
- var nativeCreate$4 = getNative$5(Object, "create");
25202
- var _nativeCreate = nativeCreate$4;
25203
- var nativeCreate$3 = _nativeCreate;
25204
- function hashClear$1() {
25205
- this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
25206
- this.size = 0;
25207
- }
25208
- var _hashClear = hashClear$1;
25209
- function hashDelete$1(key) {
25210
- var result2 = this.has(key) && delete this.__data__[key];
25211
- this.size -= result2 ? 1 : 0;
25212
- return result2;
25213
- }
25214
- var _hashDelete = hashDelete$1;
25215
- var nativeCreate$2 = _nativeCreate;
25216
- var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
25217
- var objectProto$9 = Object.prototype;
25218
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
25219
- function hashGet$1(key) {
25220
- var data = this.__data__;
25221
- if (nativeCreate$2) {
25222
- var result2 = data[key];
25223
- return result2 === HASH_UNDEFINED$1 ? void 0 : result2;
24893
+ fileUploader = document.createElement("input");
24894
+ fileUploader.setAttribute("type", "file");
24895
+ fileUploader.addEventListener("click", stopEventPropagation);
24896
+ fileUploader.id = "markdown_file_upload_input";
24897
+ fileUploader.style.display = "none";
24898
+ document.body.appendChild(fileUploader);
24899
+ const callback = ({ name, url: url2, title, isImage }) => {
24900
+ let showAsImage = false;
24901
+ if (isImage !== void 0) {
24902
+ showAsImage = isImage;
24903
+ } else if (url2) {
24904
+ const imageFilter = /^(bmp|gif|jpeg|jpg|png|tiff)$/i;
24905
+ showAsImage = imageFilter.test(url2.split(".").pop());
24906
+ }
24907
+ editor.focus();
24908
+ if (showAsImage) {
24909
+ editor.replaceSelection(`![${name}](${url2} '${title}')`);
24910
+ } else {
24911
+ editor.replaceSelection(`[${name}](${url2} '${title}')`);
24912
+ }
24913
+ };
24914
+ fileUploader.onchange = (e) => {
24915
+ const file = e.target["files"][0];
24916
+ params.fileUpload.emit({ file, callback });
24917
+ };
24918
+ fileUploader.click();
24919
+ });
24920
+ __publicField(ToolBarHandler, "code", (editor) => {
24921
+ const cursor = editor.getCursor();
24922
+ const selection = editor.getSelection();
24923
+ editor.replaceSelection("`" + selection + "`");
24924
+ editor.focus();
24925
+ if (selection === "") {
24926
+ editor.setCursor(cursor.line, cursor.ch + 1);
25224
24927
  }
25225
- return hasOwnProperty$7.call(data, key) ? data[key] : void 0;
25226
- }
25227
- var _hashGet = hashGet$1;
25228
- var nativeCreate$1 = _nativeCreate;
25229
- var objectProto$8 = Object.prototype;
25230
- var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
25231
- function hashHas$1(key) {
25232
- var data = this.__data__;
25233
- return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$6.call(data, key);
25234
- }
25235
- var _hashHas = hashHas$1;
25236
- var nativeCreate = _nativeCreate;
25237
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
25238
- function hashSet$1(key, value) {
25239
- var data = this.__data__;
25240
- this.size += this.has(key) ? 0 : 1;
25241
- data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
25242
- return this;
25243
- }
25244
- var _hashSet = hashSet$1;
25245
- var hashClear = _hashClear, hashDelete = _hashDelete, hashGet = _hashGet, hashHas = _hashHas, hashSet = _hashSet;
25246
- function Hash$1(entries) {
25247
- var index2 = -1, length = entries == null ? 0 : entries.length;
25248
- this.clear();
25249
- while (++index2 < length) {
25250
- var entry = entries[index2];
25251
- this.set(entry[0], entry[1]);
24928
+ });
24929
+ __publicField(ToolBarHandler, "table", (editor) => {
24930
+ const table2 = `| | | |
24931
+ |--|--|--|
24932
+ | | | |`;
24933
+ editor.replaceSelection(table2);
24934
+ });
24935
+ __publicField(ToolBarHandler, "fullscreen", (editor) => {
24936
+ editor.focus();
24937
+ });
24938
+ __publicField(ToolBarHandler, "color", () => {
24939
+ });
24940
+ const DEFAULT_TOOLBARS = {
24941
+ undo: {
24942
+ id: "undo",
24943
+ name: "undo",
24944
+ type: "button",
24945
+ icon: UNDO_ICON,
24946
+ shortKey: "Ctrl+Z",
24947
+ handler: ToolBarHandler.undo
24948
+ },
24949
+ redo: {
24950
+ id: "redo",
24951
+ name: "redo",
24952
+ type: "button",
24953
+ icon: REDO_ICON,
24954
+ shortKey: "Ctrl+Y",
24955
+ handler: ToolBarHandler.redo
24956
+ },
24957
+ bold: {
24958
+ id: "bold",
24959
+ name: "bold",
24960
+ type: "button",
24961
+ icon: BOLD_ICON,
24962
+ shortKey: "Ctrl+B",
24963
+ handler: ToolBarHandler.bold
24964
+ },
24965
+ italic: {
24966
+ id: "italic",
24967
+ name: "italic",
24968
+ type: "button",
24969
+ icon: ITALIC_ICON,
24970
+ shortKey: "Ctrl+I",
24971
+ handler: ToolBarHandler.italic
24972
+ },
24973
+ strike: {
24974
+ id: "strike",
24975
+ name: "strike",
24976
+ type: "button",
24977
+ icon: STRIKE_ICON,
24978
+ shortKey: "Ctrl+D",
24979
+ handler: ToolBarHandler.strike
24980
+ },
24981
+ h1: {
24982
+ id: "h1",
24983
+ name: "h1",
24984
+ type: "button",
24985
+ icon: H1_ICON,
24986
+ shortKey: "Ctrl+1",
24987
+ handler: ToolBarHandler.h1
24988
+ },
24989
+ h2: {
24990
+ id: "h2",
24991
+ name: "h2",
24992
+ type: "button",
24993
+ icon: H2_ICON,
24994
+ shortKey: "Ctrl+2",
24995
+ handler: ToolBarHandler.h2
24996
+ },
24997
+ ul: {
24998
+ id: "ul",
24999
+ name: "unorderedlist",
25000
+ type: "button",
25001
+ icon: LIST_UNORDERED_ICON,
25002
+ shortKey: "Ctrl+U",
25003
+ handler: ToolBarHandler.ul
25004
+ },
25005
+ ol: {
25006
+ id: "ol",
25007
+ name: "orderedlist",
25008
+ type: "button",
25009
+ icon: LIST_ORDERED_ICON,
25010
+ shortKey: "Ctrl+O",
25011
+ handler: ToolBarHandler.ol
25012
+ },
25013
+ checklist: {
25014
+ id: "checklist",
25015
+ name: "checklist",
25016
+ type: "button",
25017
+ icon: LIST_CHECK_ICON,
25018
+ shortKey: "Ctrl+Alt+C",
25019
+ handler: ToolBarHandler.checkList
25020
+ },
25021
+ underline: {
25022
+ id: "underline",
25023
+ name: "underline",
25024
+ type: "button",
25025
+ icon: UNDERLINE_ICON,
25026
+ shortKey: "Ctrl+R",
25027
+ handler: ToolBarHandler.underline
25028
+ },
25029
+ font: {
25030
+ id: "font",
25031
+ name: "size",
25032
+ type: "dropDown",
25033
+ icon: FONT_SIZE_ICON,
25034
+ component: "FontSize",
25035
+ handler: ToolBarHandler.font
25036
+ },
25037
+ link: {
25038
+ id: "link",
25039
+ name: "link",
25040
+ type: "button",
25041
+ icon: LINK_ICON,
25042
+ shortKey: "Ctrl+L",
25043
+ handler: ToolBarHandler.link
25044
+ },
25045
+ image: {
25046
+ id: "image",
25047
+ name: "image",
25048
+ type: "button",
25049
+ icon: IMAGE_ICON,
25050
+ shortKey: "Ctrl+G",
25051
+ params: { imageUploadToServer: false },
25052
+ handler: ToolBarHandler.image
25053
+ },
25054
+ file: {
25055
+ id: "file",
25056
+ name: "file",
25057
+ type: "button",
25058
+ icon: FILE_ICON,
25059
+ params: {},
25060
+ shortKey: "Ctrl+F",
25061
+ handler: ToolBarHandler.file
25062
+ },
25063
+ code: {
25064
+ id: "code",
25065
+ name: "code",
25066
+ type: "button",
25067
+ icon: CODE_ICON,
25068
+ shortKey: "Ctrl+K",
25069
+ handler: ToolBarHandler.code
25070
+ },
25071
+ table: {
25072
+ id: "table",
25073
+ name: "table",
25074
+ type: "button",
25075
+ icon: TABLE_ICON,
25076
+ shortKey: "Ctrl+Alt+T",
25077
+ handler: ToolBarHandler.table
25078
+ },
25079
+ fullscreen: {
25080
+ id: "fullscreen",
25081
+ name: "fullscreen",
25082
+ exitName: "exit-fullscreen",
25083
+ type: "button",
25084
+ icon: FULLSCREEN_EXPAND_ICON,
25085
+ exitIcon: FULLSCREEN_CONTRACT_ICON,
25086
+ handler: ToolBarHandler.fullscreen
25087
+ },
25088
+ color: {
25089
+ id: "color",
25090
+ name: "color&background",
25091
+ type: "dropDown",
25092
+ icon: COLOR_ICON,
25093
+ component: "FontColor",
25094
+ handler: ToolBarHandler.color
25252
25095
  }
25096
+ };
25097
+ const DEFAULT_TOOLBAR_CONFIG = [
25098
+ ["undo", "redo"],
25099
+ ["h1", "h2", "bold", "italic", "strike", "underline", "color", "font"],
25100
+ ["ul", "ol", "checklist", "code", "link", "image", "table"],
25101
+ "fullscreen"
25102
+ ];
25103
+ const FONT_COLORS = [
25104
+ "#000000",
25105
+ "#e60000",
25106
+ "#ff9900",
25107
+ "#ffff00",
25108
+ "#008a00",
25109
+ "#0066cc",
25110
+ "#9933ff",
25111
+ "#ffffff",
25112
+ "#facccc",
25113
+ "#ffebcc",
25114
+ "#ffffcc",
25115
+ "#cce8cc",
25116
+ "#cce0f5",
25117
+ "#ebd6ff",
25118
+ "#bbbbbb",
25119
+ "#f06666",
25120
+ "#ffc266",
25121
+ "#ffff66",
25122
+ "#66b966",
25123
+ "#66a3e0",
25124
+ "#c285ff",
25125
+ "#888888",
25126
+ "#a10000",
25127
+ "#b26b00",
25128
+ "#b2b200",
25129
+ "#006100",
25130
+ "#0047b2",
25131
+ "#6b24b2",
25132
+ "#444444",
25133
+ "#5c0000",
25134
+ "#663d00",
25135
+ "#666600",
25136
+ "#003700",
25137
+ "#002966",
25138
+ "#3d1466"
25139
+ ];
25140
+ const FONT_SIZE_LIST = [12, 14, 16, 18, 20, 24, 36, 48].map((item) => ({ name: item + "px", value: item }));
25141
+ function parseHTMLStringToDomList(html) {
25142
+ var _a;
25143
+ const domParser = new DOMParser();
25144
+ const htmlNode = domParser.parseFromString(html, "text/html");
25145
+ return htmlNode.querySelector("body") ? ((_a = htmlNode.querySelector("body")) == null ? void 0 : _a.childNodes) || [] : [];
25253
25146
  }
25254
- Hash$1.prototype.clear = hashClear;
25255
- Hash$1.prototype["delete"] = hashDelete;
25256
- Hash$1.prototype.get = hashGet;
25257
- Hash$1.prototype.has = hashHas;
25258
- Hash$1.prototype.set = hashSet;
25259
- var _Hash = Hash$1;
25260
- var Hash = _Hash, ListCache$2 = _ListCache, Map$3 = _Map;
25261
- function mapCacheClear$1() {
25262
- this.size = 0;
25263
- this.__data__ = {
25264
- "hash": new Hash(),
25265
- "map": new (Map$3 || ListCache$2)(),
25266
- "string": new Hash()
25147
+ function locale(key) {
25148
+ const localeMap = {
25149
+ undo: "\u64A4\u9500",
25150
+ redo: "\u91CD\u505A",
25151
+ clean: "\u6E05\u9664\u683C\u5F0F",
25152
+ header: "\u6BB5\u843D\u6837\u5F0F",
25153
+ normal: "\u6B63\u6587",
25154
+ h1: "\u6807\u98981",
25155
+ h2: "\u6807\u98982",
25156
+ h3: "\u6807\u98983",
25157
+ h4: "\u6807\u98984",
25158
+ h5: "\u6807\u98985",
25159
+ h6: "\u6807\u98986",
25160
+ font: "\u5B57\u4F53",
25161
+ size: "\u5B57\u53F7",
25162
+ songti: "\u5B8B\u4F53",
25163
+ yahei: "\u5FAE\u8F6F\u96C5\u9ED1",
25164
+ kaiti: "\u6977\u4F53",
25165
+ heiti: "\u9ED1\u4F53",
25166
+ lishu: "\u96B6\u4E66",
25167
+ bold: "\u7C97\u4F53",
25168
+ italic: "\u659C\u4F53",
25169
+ underline: "\u4E0B\u5212\u7EBF",
25170
+ strike: "\u5220\u9664\u7EBF",
25171
+ color: "\u5B57\u4F53\u989C\u8272",
25172
+ backgound: "\u80CC\u666F\u8272",
25173
+ orderedlist: "\u6709\u5E8F\u5217\u8868",
25174
+ unorderedlist: "\u65E0\u5E8F\u5217\u8868",
25175
+ checklist: "\u4EFB\u52A1\u5217\u8868",
25176
+ left: "\u5DE6\u5BF9\u9F50",
25177
+ center: "\u5C45\u4E2D",
25178
+ right: "\u53F3\u5BF9\u9F50",
25179
+ image: "\u56FE\u7247",
25180
+ file: "\u6587\u4EF6",
25181
+ table: "\u8868\u683C",
25182
+ link: "\u8D85\u94FE\u63A5",
25183
+ code: "\u884C\u5185\u4EE3\u7801",
25184
+ codeblock: "\u4EE3\u7801\u5757",
25185
+ blockquote: "\u5F15\u7528",
25186
+ superscript: "\u4E0A\u6807",
25187
+ subscript: "\u4E0B\u6807",
25188
+ globallink: "\u5168\u5C40\u94FE\u63A5",
25189
+ emoji: "\u8868\u60C5",
25190
+ fullscreen: "\u5168\u5C4F",
25191
+ "exit-fullscreen": "\u9000\u51FA\u5168\u5C4F",
25192
+ help: "\u5E2E\u52A9",
25193
+ more: "\u66F4\u591A",
25194
+ "help-format": "\u683C\u5F0F",
25195
+ "help-insert": "\u63D2\u5165",
25196
+ "help-operation": "\u64CD\u4F5C",
25197
+ mention: "\u63D0\u53CA\u67D0\u4EBA",
25198
+ "quick-menu": "\u5FEB\u6377\u83DC\u5355",
25199
+ "toggle-help-panel": "\u6253\u5F00/\u5173\u95ED\u5E2E\u52A9\u9762\u677F",
25200
+ "scroll-table": "\u6C34\u5E73\u6EDA\u52A8\u8868\u683C",
25201
+ "mouse-wheel": "\u9F20\u6807\u6EDA\u8F6E",
25202
+ save: "\u4FDD\u5B58",
25203
+ "copy-cells": "\u590D\u5236",
25204
+ "copy-table": "\u590D\u5236\u8868\u683C",
25205
+ "cut-cells": "\u526A\u5207",
25206
+ "empty-cells": "\u6E05\u7A7A\u5185\u5BB9",
25207
+ "insert-row-up": "\u4E0A\u63D2\u5165\u884C",
25208
+ "insert-row-down": "\u4E0B\u63D2\u5165\u884C",
25209
+ "insert-column-left": "\u5DE6\u63D2\u5165\u884C",
25210
+ "insert-column-right": "\u53F3\u63D2\u5165\u884C",
25211
+ "merge-cells": "\u5408\u5E76\u5355\u5143\u683C",
25212
+ "unmerge-cells": "\u62C6\u5206\u5355\u5143\u683C",
25213
+ "delete-row": "\u5220\u9664\u5F53\u524D\u884C",
25214
+ "delete-column": "\u5220\u9664\u5F53\u524D\u5217",
25215
+ "delete-table": "\u5220\u9664\u8868\u683C",
25216
+ "default-link-text": "\u94FE\u63A5",
25217
+ basicblock: "\u5361\u7247",
25218
+ linkplaceholder: "\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740\uFF0C\u6309\u56DE\u8F66\u786E\u8BA4",
25219
+ "counter-template": "{{count}}/{{totalCount}}",
25220
+ char: "\u5B57\u7B26",
25221
+ word: "\u5355\u8BCD",
25222
+ "counter-limit-tips": "{{countUnit}}\u6570\u8D85\u51FA\u6700\u5927\u5141\u8BB8\u503C",
25223
+ "ie-msg": "\u4E3A\u4E86\u66F4\u597D\u4F53\u9A8C\uFF0C\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668",
25224
+ loading: "\u6B63\u5728\u52A0\u8F7D\u4E2D...",
25225
+ pasting: "\u60A8\u7C98\u8D34\u5185\u5BB9\u8F83\u591A, \u6B63\u5728\u52AA\u529B\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85..."
25267
25226
  };
25227
+ return localeMap[key];
25268
25228
  }
25269
- var _mapCacheClear = mapCacheClear$1;
25270
- function isKeyable$1(value) {
25271
- var type4 = typeof value;
25272
- return type4 == "string" || type4 == "number" || type4 == "symbol" || type4 == "boolean" ? value !== "__proto__" : value === null;
25273
- }
25274
- var _isKeyable = isKeyable$1;
25275
- var isKeyable = _isKeyable;
25276
- function getMapData$4(map, key) {
25277
- var data = map.__data__;
25278
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
25279
- }
25280
- var _getMapData = getMapData$4;
25281
- var getMapData$3 = _getMapData;
25282
- function mapCacheDelete$1(key) {
25283
- var result2 = getMapData$3(this, key)["delete"](key);
25284
- this.size -= result2 ? 1 : 0;
25285
- return result2;
25286
- }
25287
- var _mapCacheDelete = mapCacheDelete$1;
25288
- var getMapData$2 = _getMapData;
25289
- function mapCacheGet$1(key) {
25290
- return getMapData$2(this, key).get(key);
25291
- }
25292
- var _mapCacheGet = mapCacheGet$1;
25293
- var getMapData$1 = _getMapData;
25294
- function mapCacheHas$1(key) {
25295
- return getMapData$1(this, key).has(key);
25296
- }
25297
- var _mapCacheHas = mapCacheHas$1;
25298
- var getMapData = _getMapData;
25299
- function mapCacheSet$1(key, value) {
25300
- var data = getMapData(this, key), size = data.size;
25301
- data.set(key, value);
25302
- this.size += data.size == size ? 0 : 1;
25303
- return this;
25304
- }
25305
- var _mapCacheSet = mapCacheSet$1;
25306
- var mapCacheClear = _mapCacheClear, mapCacheDelete = _mapCacheDelete, mapCacheGet = _mapCacheGet, mapCacheHas = _mapCacheHas, mapCacheSet = _mapCacheSet;
25307
- function MapCache$1(entries) {
25308
- var index2 = -1, length = entries == null ? 0 : entries.length;
25309
- this.clear();
25310
- while (++index2 < length) {
25311
- var entry = entries[index2];
25312
- this.set(entry[0], entry[1]);
25313
- }
25314
- }
25315
- MapCache$1.prototype.clear = mapCacheClear;
25316
- MapCache$1.prototype["delete"] = mapCacheDelete;
25317
- MapCache$1.prototype.get = mapCacheGet;
25318
- MapCache$1.prototype.has = mapCacheHas;
25319
- MapCache$1.prototype.set = mapCacheSet;
25320
- var _MapCache = MapCache$1;
25321
- var ListCache$1 = _ListCache, Map$2 = _Map, MapCache = _MapCache;
25322
- var LARGE_ARRAY_SIZE = 200;
25323
- function stackSet$1(key, value) {
25324
- var data = this.__data__;
25325
- if (data instanceof ListCache$1) {
25326
- var pairs = data.__data__;
25327
- if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
25328
- pairs.push([key, value]);
25329
- this.size = ++data.size;
25330
- return this;
25229
+ function _enforceMaxLength(cm, changes) {
25230
+ const maxLength = cm.getOption("maxLength");
25231
+ if (maxLength && changes.update) {
25232
+ let changeContent = changes.text.join("\n");
25233
+ let delta = changeContent.length - (cm.indexFromPos(changes.to) - cm.indexFromPos(changes.from));
25234
+ if (delta <= 0) {
25235
+ return true;
25331
25236
  }
25332
- data = this.__data__ = new MapCache(pairs);
25333
- }
25334
- data.set(key, value);
25335
- this.size = data.size;
25336
- return this;
25337
- }
25338
- var _stackSet = stackSet$1;
25339
- var ListCache = _ListCache, stackClear = _stackClear, stackDelete = _stackDelete, stackGet = _stackGet, stackHas = _stackHas, stackSet = _stackSet;
25340
- function Stack$1(entries) {
25341
- var data = this.__data__ = new ListCache(entries);
25342
- this.size = data.size;
25343
- }
25344
- Stack$1.prototype.clear = stackClear;
25345
- Stack$1.prototype["delete"] = stackDelete;
25346
- Stack$1.prototype.get = stackGet;
25347
- Stack$1.prototype.has = stackHas;
25348
- Stack$1.prototype.set = stackSet;
25349
- var _Stack = Stack$1;
25350
- function arrayEach$1(array4, iteratee) {
25351
- var index2 = -1, length = array4 == null ? 0 : array4.length;
25352
- while (++index2 < length) {
25353
- if (iteratee(array4[index2], index2, array4) === false) {
25354
- break;
25237
+ delta = cm.getValue().length + delta - maxLength;
25238
+ if (delta > 0) {
25239
+ changeContent = changeContent.substr(0, changeContent.length - delta);
25240
+ changes.update(changes.from, changes.to, changeContent.split("\n"));
25355
25241
  }
25356
25242
  }
25357
- return array4;
25243
+ return true;
25358
25244
  }
25359
- var _arrayEach = arrayEach$1;
25360
- var getNative$4 = _getNative;
25361
- var defineProperty$1 = function() {
25362
- try {
25363
- var func = getNative$4(Object, "defineProperty");
25364
- func({}, "", {});
25365
- return func;
25366
- } catch (e) {
25367
- }
25368
- }();
25369
- var _defineProperty = defineProperty$1;
25370
- var defineProperty = _defineProperty;
25371
- function baseAssignValue$2(object4, key, value) {
25372
- if (key == "__proto__" && defineProperty) {
25373
- defineProperty(object4, key, {
25374
- "configurable": true,
25375
- "enumerable": true,
25376
- "value": value,
25377
- "writable": true
25378
- });
25245
+ function refreshEditorCursor() {
25246
+ let event;
25247
+ if (typeof Event === "function") {
25248
+ event = new Event("resize");
25379
25249
  } else {
25380
- object4[key] = value;
25381
- }
25382
- }
25383
- var _baseAssignValue = baseAssignValue$2;
25384
- var baseAssignValue$1 = _baseAssignValue, eq = eq_1;
25385
- var objectProto$7 = Object.prototype;
25386
- var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
25387
- function assignValue$2(object4, key, value) {
25388
- var objValue = object4[key];
25389
- if (!(hasOwnProperty$5.call(object4, key) && eq(objValue, value)) || value === void 0 && !(key in object4)) {
25390
- baseAssignValue$1(object4, key, value);
25250
+ event = document.createEvent("Event");
25251
+ event.initEvent("resize", true, true);
25391
25252
  }
25253
+ window.dispatchEvent(event);
25392
25254
  }
25393
- var _assignValue = assignValue$2;
25394
- var assignValue$1 = _assignValue, baseAssignValue = _baseAssignValue;
25395
- function copyObject$4(source, props, object4, customizer) {
25396
- var isNew = !object4;
25397
- object4 || (object4 = {});
25398
- var index2 = -1, length = props.length;
25399
- while (++index2 < length) {
25400
- var key = props[index2];
25401
- var newValue = customizer ? customizer(object4[key], source[key], key, object4, source) : void 0;
25402
- if (newValue === void 0) {
25403
- newValue = source[key];
25255
+ function useEditorMd(props, ctx2) {
25256
+ const {
25257
+ imageUploadToServer,
25258
+ hidePreviewView,
25259
+ mode,
25260
+ maxlength,
25261
+ options,
25262
+ toolbarConfig,
25263
+ customToolbars,
25264
+ customHintReplaceFn,
25265
+ hintConfig,
25266
+ disableChangeEvent,
25267
+ modelValue
25268
+ } = toRefs(props);
25269
+ const toolbars = reactive(cloneDeep_1(DEFAULT_TOOLBARS));
25270
+ const editorRef = ref();
25271
+ const renderRef = ref();
25272
+ const previewHtmlList = ref([]);
25273
+ let editorIns;
25274
+ let canPreviewScrollView = false;
25275
+ let CodeMirror;
25276
+ computed(() => {
25277
+ const result2 = [];
25278
+ for (const key in hintConfig == null ? void 0 : hintConfig.value) {
25279
+ if (typeof (hintConfig == null ? void 0 : hintConfig.value[key]) === "function" || (hintConfig == null ? void 0 : hintConfig.value[key]) && typeof (hintConfig == null ? void 0 : hintConfig.value[key].handler) === "function") {
25280
+ result2.push(key);
25281
+ }
25404
25282
  }
25405
- if (isNew) {
25406
- baseAssignValue(object4, key, newValue);
25407
- } else {
25408
- assignValue$1(object4, key, newValue);
25283
+ return result2;
25284
+ });
25285
+ const getEditorIns = () => editorIns;
25286
+ const editorScroll = () => {
25287
+ if (editorIns) {
25288
+ const scrollInfo = editorIns.getScrollInfo();
25289
+ const height = scrollInfo.height - scrollInfo.clientHeight;
25290
+ const ratio = parseFloat(scrollInfo.top) / height;
25291
+ const preview = renderRef.value.$el;
25292
+ const move = (preview.scrollHeight - preview.clientHeight) * ratio;
25293
+ preview.scrollTop = move;
25409
25294
  }
25410
- }
25411
- return object4;
25412
- }
25413
- var _copyObject = copyObject$4;
25414
- function baseTimes$1(n, iteratee) {
25415
- var index2 = -1, result2 = Array(n);
25416
- while (++index2 < n) {
25417
- result2[index2] = iteratee(index2);
25418
- }
25419
- return result2;
25420
- }
25421
- var _baseTimes = baseTimes$1;
25422
- function isObjectLike$5(value) {
25423
- return value != null && typeof value == "object";
25424
- }
25425
- var isObjectLike_1 = isObjectLike$5;
25426
- var baseGetTag$2 = _baseGetTag, isObjectLike$4 = isObjectLike_1;
25427
- var argsTag$2 = "[object Arguments]";
25428
- function baseIsArguments$1(value) {
25429
- return isObjectLike$4(value) && baseGetTag$2(value) == argsTag$2;
25430
- }
25431
- var _baseIsArguments = baseIsArguments$1;
25432
- var baseIsArguments = _baseIsArguments, isObjectLike$3 = isObjectLike_1;
25433
- var objectProto$6 = Object.prototype;
25434
- var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
25435
- var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
25436
- var isArguments$1 = baseIsArguments(function() {
25437
- return arguments;
25438
- }()) ? baseIsArguments : function(value) {
25439
- return isObjectLike$3(value) && hasOwnProperty$4.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
25440
- };
25441
- var isArguments_1 = isArguments$1;
25442
- var isArray$3 = Array.isArray;
25443
- var isArray_1 = isArray$3;
25444
- var isBuffer$2 = { exports: {} };
25445
- function stubFalse() {
25446
- return false;
25447
- }
25448
- var stubFalse_1 = stubFalse;
25449
- (function(module, exports) {
25450
- var root2 = _root, stubFalse2 = stubFalse_1;
25451
- var freeExports = exports && !exports.nodeType && exports;
25452
- var freeModule = freeExports && true && module && !module.nodeType && module;
25453
- var moduleExports = freeModule && freeModule.exports === freeExports;
25454
- var Buffer2 = moduleExports ? root2.Buffer : void 0;
25455
- var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
25456
- var isBuffer2 = nativeIsBuffer || stubFalse2;
25457
- module.exports = isBuffer2;
25458
- })(isBuffer$2, isBuffer$2.exports);
25459
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
25460
- var reIsUint = /^(?:0|[1-9]\d*)$/;
25461
- function isIndex$1(value, length) {
25462
- var type4 = typeof value;
25463
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
25464
- return !!length && (type4 == "number" || type4 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
25465
- }
25466
- var _isIndex = isIndex$1;
25467
- var MAX_SAFE_INTEGER = 9007199254740991;
25468
- function isLength$2(value) {
25469
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
25470
- }
25471
- var isLength_1 = isLength$2;
25472
- var baseGetTag$1 = _baseGetTag, isLength$1 = isLength_1, isObjectLike$2 = isObjectLike_1;
25473
- var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", errorTag$1 = "[object Error]", funcTag$1 = "[object Function]", mapTag$4 = "[object Map]", numberTag$2 = "[object Number]", objectTag$2 = "[object Object]", regexpTag$2 = "[object RegExp]", setTag$4 = "[object Set]", stringTag$2 = "[object String]", weakMapTag$2 = "[object WeakMap]";
25474
- var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$3 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
25475
- var typedArrayTags = {};
25476
- typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
25477
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] = typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] = typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] = typedArrayTags[weakMapTag$2] = false;
25478
- function baseIsTypedArray$1(value) {
25479
- return isObjectLike$2(value) && isLength$1(value.length) && !!typedArrayTags[baseGetTag$1(value)];
25480
- }
25481
- var _baseIsTypedArray = baseIsTypedArray$1;
25482
- function baseUnary$3(func) {
25483
- return function(value) {
25484
- return func(value);
25485
25295
  };
25486
- }
25487
- var _baseUnary = baseUnary$3;
25488
- var _nodeUtil = { exports: {} };
25489
- (function(module, exports) {
25490
- var freeGlobal2 = _freeGlobal;
25491
- var freeExports = exports && !exports.nodeType && exports;
25492
- var freeModule = freeExports && true && module && !module.nodeType && module;
25493
- var moduleExports = freeModule && freeModule.exports === freeExports;
25494
- var freeProcess = moduleExports && freeGlobal2.process;
25495
- var nodeUtil2 = function() {
25496
- try {
25497
- var types2 = freeModule && freeModule.require && freeModule.require("util").types;
25498
- if (types2) {
25499
- return types2;
25500
- }
25501
- return freeProcess && freeProcess.binding && freeProcess.binding("util");
25502
- } catch (e) {
25296
+ const previewScroll = () => {
25297
+ const preview = renderRef.value.$el;
25298
+ const height = preview.scrollHeight - preview.clientHeight;
25299
+ const ratio = parseFloat(preview.scrollTop) / height;
25300
+ const move = (editorIns.getScrollInfo().height - editorIns.getScrollInfo().clientHeight) * ratio;
25301
+ editorIns.scrollTo(0, move);
25302
+ };
25303
+ const previewContentChange = (html) => {
25304
+ previewHtmlList.value = [];
25305
+ const domList = parseHTMLStringToDomList(html);
25306
+ domList.forEach((ele) => {
25307
+ if (ele.outerHTML) {
25308
+ previewHtmlList.value.push(ele.outerHTML);
25309
+ }
25310
+ });
25311
+ setTimeout(() => {
25312
+ editorScroll();
25313
+ });
25314
+ nextTick(() => {
25315
+ ctx2.emit("previewContentChange");
25316
+ });
25317
+ };
25318
+ const onPreviewScroll = () => {
25319
+ if (!canPreviewScrollView) {
25320
+ return;
25321
+ }
25322
+ previewScroll();
25323
+ };
25324
+ const onPreviewMouseover = () => {
25325
+ canPreviewScrollView = true;
25326
+ };
25327
+ const onPreviewMouseout = () => {
25328
+ canPreviewScrollView = false;
25329
+ };
25330
+ const onChecked = (e) => {
25331
+ ctx2.emit("mdCheckedEvent", e);
25332
+ };
25333
+ const onChange = debounce(() => {
25334
+ const content2 = editorIns.getValue();
25335
+ if (!disableChangeEvent.value) {
25336
+ ctx2.emit("update:modelValue", content2);
25337
+ ctx2.emit("contentChange", content2);
25503
25338
  }
25504
- }();
25505
- module.exports = nodeUtil2;
25506
- })(_nodeUtil, _nodeUtil.exports);
25507
- var baseIsTypedArray = _baseIsTypedArray, baseUnary$2 = _baseUnary, nodeUtil$2 = _nodeUtil.exports;
25508
- var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
25509
- var isTypedArray$1 = nodeIsTypedArray ? baseUnary$2(nodeIsTypedArray) : baseIsTypedArray;
25510
- var isTypedArray_1 = isTypedArray$1;
25511
- var baseTimes = _baseTimes, isArguments = isArguments_1, isArray$2 = isArray_1, isBuffer$1 = isBuffer$2.exports, isIndex = _isIndex, isTypedArray = isTypedArray_1;
25512
- var objectProto$5 = Object.prototype;
25513
- var hasOwnProperty$3 = objectProto$5.hasOwnProperty;
25514
- function arrayLikeKeys$2(value, inherited) {
25515
- var isArr = isArray$2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String) : [], length = result2.length;
25516
- for (var key in value) {
25517
- if ((inherited || hasOwnProperty$3.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
25518
- result2.push(key);
25339
+ if (!canPreviewScrollView) {
25340
+ editorScroll();
25341
+ }
25342
+ }, disableChangeEvent.value ? 500 : 10, true);
25343
+ const onScroll2 = () => {
25344
+ if (!canPreviewScrollView) {
25345
+ editorScroll();
25519
25346
  }
25520
- }
25521
- return result2;
25522
- }
25523
- var _arrayLikeKeys = arrayLikeKeys$2;
25524
- var objectProto$4 = Object.prototype;
25525
- function isPrototype$3(value) {
25526
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$4;
25527
- return value === proto;
25528
- }
25529
- var _isPrototype = isPrototype$3;
25530
- function overArg$2(func, transform) {
25531
- return function(arg) {
25532
- return func(transform(arg));
25533
25347
  };
25534
- }
25535
- var _overArg = overArg$2;
25536
- var overArg$1 = _overArg;
25537
- var nativeKeys$1 = overArg$1(Object.keys, Object);
25538
- var _nativeKeys = nativeKeys$1;
25539
- var isPrototype$2 = _isPrototype, nativeKeys = _nativeKeys;
25540
- var objectProto$3 = Object.prototype;
25541
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
25542
- function baseKeys$1(object4) {
25543
- if (!isPrototype$2(object4)) {
25544
- return nativeKeys(object4);
25545
- }
25546
- var result2 = [];
25547
- for (var key in Object(object4)) {
25548
- if (hasOwnProperty$2.call(object4, key) && key != "constructor") {
25549
- result2.push(key);
25348
+ const initEditor = () => {
25349
+ var _a;
25350
+ editorIns = CodeMirror.fromTextArea(editorRef.value, __spreadValues({
25351
+ mode: "markdown",
25352
+ lineNumbers: false,
25353
+ lineWrapping: true
25354
+ }, options.value));
25355
+ if (maxlength.value) {
25356
+ editorIns.setOption("maxLength", maxlength.value);
25550
25357
  }
25551
- }
25552
- return result2;
25553
- }
25554
- var _baseKeys = baseKeys$1;
25555
- var isFunction = isFunction_1, isLength = isLength_1;
25556
- function isArrayLike$2(value) {
25557
- return value != null && isLength(value.length) && !isFunction(value);
25558
- }
25559
- var isArrayLike_1 = isArrayLike$2;
25560
- var arrayLikeKeys$1 = _arrayLikeKeys, baseKeys = _baseKeys, isArrayLike$1 = isArrayLike_1;
25561
- function keys$3(object4) {
25562
- return isArrayLike$1(object4) ? arrayLikeKeys$1(object4) : baseKeys(object4);
25563
- }
25564
- var keys_1 = keys$3;
25565
- var copyObject$3 = _copyObject, keys$2 = keys_1;
25566
- function baseAssign$1(object4, source) {
25567
- return object4 && copyObject$3(source, keys$2(source), object4);
25568
- }
25569
- var _baseAssign = baseAssign$1;
25570
- function nativeKeysIn$1(object4) {
25571
- var result2 = [];
25572
- if (object4 != null) {
25573
- for (var key in Object(object4)) {
25574
- result2.push(key);
25358
+ editorIns.setOption("readOnly", mode.value === "readonly");
25359
+ const shortKeys = {};
25360
+ const flatToolbarConfig = toolbarConfig.value.flat();
25361
+ const tempToolbars = __spreadValues(__spreadValues({}, toolbars), customToolbars == null ? void 0 : customToolbars.value);
25362
+ for (const key of Object.keys(tempToolbars)) {
25363
+ const toolbarItem = tempToolbars[key];
25364
+ if (toolbarItem.shortKey && flatToolbarConfig.includes(toolbarItem.id)) {
25365
+ shortKeys[toolbarItem.shortKey.replace(/\+/g, "-")] = (_a = toolbarItem.handler) == null ? void 0 : _a.bind(null, editorIns, toolbarItem.params);
25366
+ }
25575
25367
  }
25576
- }
25577
- return result2;
25578
- }
25579
- var _nativeKeysIn = nativeKeysIn$1;
25580
- var isObject$2 = isObject_1, isPrototype$1 = _isPrototype, nativeKeysIn = _nativeKeysIn;
25581
- var objectProto$2 = Object.prototype;
25582
- var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
25583
- function baseKeysIn$1(object4) {
25584
- if (!isObject$2(object4)) {
25585
- return nativeKeysIn(object4);
25586
- }
25587
- var isProto = isPrototype$1(object4), result2 = [];
25588
- for (var key in object4) {
25589
- if (!(key == "constructor" && (isProto || !hasOwnProperty$1.call(object4, key)))) {
25590
- result2.push(key);
25368
+ editorIns.setOption("extraKeys", shortKeys);
25369
+ editorIns.on("beforeChange", _enforceMaxLength);
25370
+ editorIns.setSize("auto", "100%");
25371
+ refreshEditorCursor();
25372
+ editorIns.setCursor(editorIns.lineCount(), 0);
25373
+ ctx2.emit("afterEditorInit", editorIns);
25374
+ editorIns.on("change", onChange);
25375
+ editorIns.on("scroll", onScroll2);
25376
+ setTimeout(() => {
25377
+ ctx2.emit("contentChange", editorIns.getValue());
25378
+ }, 100);
25379
+ };
25380
+ const onPaste = (e) => {
25381
+ const clipboardData = e.clipboardData;
25382
+ if (!(clipboardData && clipboardData.items)) {
25383
+ return;
25591
25384
  }
25592
- }
25593
- return result2;
25594
- }
25595
- var _baseKeysIn = baseKeysIn$1;
25596
- var arrayLikeKeys = _arrayLikeKeys, baseKeysIn = _baseKeysIn, isArrayLike = isArrayLike_1;
25597
- function keysIn$3(object4) {
25598
- return isArrayLike(object4) ? arrayLikeKeys(object4, true) : baseKeysIn(object4);
25599
- }
25600
- var keysIn_1 = keysIn$3;
25601
- var copyObject$2 = _copyObject, keysIn$2 = keysIn_1;
25602
- function baseAssignIn$1(object4, source) {
25603
- return object4 && copyObject$2(source, keysIn$2(source), object4);
25604
- }
25605
- var _baseAssignIn = baseAssignIn$1;
25606
- var _cloneBuffer = { exports: {} };
25607
- (function(module, exports) {
25608
- var root2 = _root;
25609
- var freeExports = exports && !exports.nodeType && exports;
25610
- var freeModule = freeExports && true && module && !module.nodeType && module;
25611
- var moduleExports = freeModule && freeModule.exports === freeExports;
25612
- var Buffer2 = moduleExports ? root2.Buffer : void 0, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
25613
- function cloneBuffer2(buffer, isDeep) {
25614
- if (isDeep) {
25615
- return buffer.slice();
25385
+ if (clipboardData.items.length <= 3) {
25386
+ for (let i = 0; i < clipboardData.items.length; i++) {
25387
+ const item = clipboardData.items[i];
25388
+ if (item.kind === "file" && item.type.indexOf("image") !== -1) {
25389
+ const file = item.getAsFile();
25390
+ if ((file == null ? void 0 : file.size) === 0) {
25391
+ return;
25392
+ }
25393
+ if (imageUploadToServer.value) {
25394
+ const callback = ({ name, imgUrl, title }) => {
25395
+ editorRef.value.focus();
25396
+ editorRef.value.replaceSelection(`![${name}](${imgUrl} '${title}')`);
25397
+ };
25398
+ ctx2.emit("imageUpload", { file, callback });
25399
+ }
25400
+ }
25401
+ }
25616
25402
  }
25617
- var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
25618
- buffer.copy(result2);
25619
- return result2;
25620
- }
25621
- module.exports = cloneBuffer2;
25622
- })(_cloneBuffer, _cloneBuffer.exports);
25623
- function copyArray$1(source, array4) {
25624
- var index2 = -1, length = source.length;
25625
- array4 || (array4 = Array(length));
25626
- while (++index2 < length) {
25627
- array4[index2] = source[index2];
25628
- }
25629
- return array4;
25630
- }
25631
- var _copyArray = copyArray$1;
25632
- function arrayFilter$1(array4, predicate) {
25633
- var index2 = -1, length = array4 == null ? 0 : array4.length, resIndex = 0, result2 = [];
25634
- while (++index2 < length) {
25635
- var value = array4[index2];
25636
- if (predicate(value, index2, array4)) {
25637
- result2[resIndex++] = value;
25403
+ };
25404
+ onMounted(async () => {
25405
+ await import("codemirror/addon/display/placeholder.js");
25406
+ await import("codemirror/mode/markdown/markdown.js");
25407
+ const module = await import("codemirror");
25408
+ CodeMirror = module.default;
25409
+ initEditor();
25410
+ });
25411
+ watch(modelValue, (val) => {
25412
+ if (editorIns) {
25413
+ if (val === editorIns.getValue()) {
25414
+ return;
25415
+ }
25416
+ editorIns.setValue(val);
25638
25417
  }
25639
- }
25640
- return result2;
25641
- }
25642
- var _arrayFilter = arrayFilter$1;
25643
- function stubArray$2() {
25644
- return [];
25645
- }
25646
- var stubArray_1 = stubArray$2;
25647
- var arrayFilter = _arrayFilter, stubArray$1 = stubArray_1;
25648
- var objectProto$1 = Object.prototype;
25649
- var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
25650
- var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
25651
- var getSymbols$3 = !nativeGetSymbols$1 ? stubArray$1 : function(object4) {
25652
- if (object4 == null) {
25653
- return [];
25654
- }
25655
- object4 = Object(object4);
25656
- return arrayFilter(nativeGetSymbols$1(object4), function(symbol) {
25657
- return propertyIsEnumerable.call(object4, symbol);
25658
25418
  });
25659
- };
25660
- var _getSymbols = getSymbols$3;
25661
- var copyObject$1 = _copyObject, getSymbols$2 = _getSymbols;
25662
- function copySymbols$1(source, object4) {
25663
- return copyObject$1(source, getSymbols$2(source), object4);
25664
- }
25665
- var _copySymbols = copySymbols$1;
25666
- function arrayPush$2(array4, values) {
25667
- var index2 = -1, length = values.length, offset2 = array4.length;
25668
- while (++index2 < length) {
25669
- array4[offset2 + index2] = values[index2];
25670
- }
25671
- return array4;
25672
- }
25673
- var _arrayPush = arrayPush$2;
25674
- var overArg = _overArg;
25675
- var getPrototype$2 = overArg(Object.getPrototypeOf, Object);
25676
- var _getPrototype = getPrototype$2;
25677
- var arrayPush$1 = _arrayPush, getPrototype$1 = _getPrototype, getSymbols$1 = _getSymbols, stubArray = stubArray_1;
25678
- var nativeGetSymbols = Object.getOwnPropertySymbols;
25679
- var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object4) {
25680
- var result2 = [];
25681
- while (object4) {
25682
- arrayPush$1(result2, getSymbols$1(object4));
25683
- object4 = getPrototype$1(object4);
25684
- }
25685
- return result2;
25686
- };
25687
- var _getSymbolsIn = getSymbolsIn$2;
25688
- var copyObject = _copyObject, getSymbolsIn$1 = _getSymbolsIn;
25689
- function copySymbolsIn$1(source, object4) {
25690
- return copyObject(source, getSymbolsIn$1(source), object4);
25691
- }
25692
- var _copySymbolsIn = copySymbolsIn$1;
25693
- var arrayPush = _arrayPush, isArray$1 = isArray_1;
25694
- function baseGetAllKeys$2(object4, keysFunc, symbolsFunc) {
25695
- var result2 = keysFunc(object4);
25696
- return isArray$1(object4) ? result2 : arrayPush(result2, symbolsFunc(object4));
25697
- }
25698
- var _baseGetAllKeys = baseGetAllKeys$2;
25699
- var baseGetAllKeys$1 = _baseGetAllKeys, getSymbols = _getSymbols, keys$1 = keys_1;
25700
- function getAllKeys$1(object4) {
25701
- return baseGetAllKeys$1(object4, keys$1, getSymbols);
25702
- }
25703
- var _getAllKeys = getAllKeys$1;
25704
- var baseGetAllKeys = _baseGetAllKeys, getSymbolsIn = _getSymbolsIn, keysIn$1 = keysIn_1;
25705
- function getAllKeysIn$1(object4) {
25706
- return baseGetAllKeys(object4, keysIn$1, getSymbolsIn);
25707
- }
25708
- var _getAllKeysIn = getAllKeysIn$1;
25709
- var getNative$3 = _getNative, root$4 = _root;
25710
- var DataView$1 = getNative$3(root$4, "DataView");
25711
- var _DataView = DataView$1;
25712
- var getNative$2 = _getNative, root$3 = _root;
25713
- var Promise$2 = getNative$2(root$3, "Promise");
25714
- var _Promise = Promise$2;
25715
- var getNative$1 = _getNative, root$2 = _root;
25716
- var Set$2 = getNative$1(root$2, "Set");
25717
- var _Set = Set$2;
25718
- var getNative = _getNative, root$1 = _root;
25719
- var WeakMap$2 = getNative(root$1, "WeakMap");
25720
- var _WeakMap = WeakMap$2;
25721
- var DataView = _DataView, Map$1 = _Map, Promise$1 = _Promise, Set$1 = _Set, WeakMap$1 = _WeakMap, baseGetTag = _baseGetTag, toSource = _toSource;
25722
- var mapTag$3 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$3 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
25723
- var dataViewTag$2 = "[object DataView]";
25724
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
25725
- var getTag$3 = baseGetTag;
25726
- if (DataView && getTag$3(new DataView(new ArrayBuffer(1))) != dataViewTag$2 || Map$1 && getTag$3(new Map$1()) != mapTag$3 || Promise$1 && getTag$3(Promise$1.resolve()) != promiseTag || Set$1 && getTag$3(new Set$1()) != setTag$3 || WeakMap$1 && getTag$3(new WeakMap$1()) != weakMapTag$1) {
25727
- getTag$3 = function(value) {
25728
- var result2 = baseGetTag(value), Ctor = result2 == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
25729
- if (ctorString) {
25730
- switch (ctorString) {
25731
- case dataViewCtorString:
25732
- return dataViewTag$2;
25733
- case mapCtorString:
25734
- return mapTag$3;
25735
- case promiseCtorString:
25736
- return promiseTag;
25737
- case setCtorString:
25738
- return setTag$3;
25739
- case weakMapCtorString:
25740
- return weakMapTag$1;
25419
+ watch(imageUploadToServer, (val) => {
25420
+ if (toolbars["image"].params) {
25421
+ toolbars["image"].params.imageUploadToServer = val;
25422
+ }
25423
+ if (toolbars["image"].params && !toolbars["image"].params.imageUpload) {
25424
+ toolbars["image"].params.imageUpload = (data) => {
25425
+ ctx2.emit("imageUpload", data);
25426
+ };
25427
+ }
25428
+ }, { immediate: true });
25429
+ watch(hidePreviewView, () => {
25430
+ refreshEditorCursor();
25431
+ });
25432
+ watch(mode, (val) => {
25433
+ setTimeout(() => {
25434
+ if (editorIns) {
25435
+ refreshEditorCursor();
25436
+ editorIns.setOption("readOnly", val === "readonly");
25741
25437
  }
25438
+ });
25439
+ });
25440
+ watch(maxlength, (val) => {
25441
+ if (editorIns) {
25442
+ editorIns.setOption("maxLength", val);
25742
25443
  }
25743
- return result2;
25444
+ });
25445
+ return {
25446
+ editorRef,
25447
+ renderRef,
25448
+ toolbars,
25449
+ previewHtmlList,
25450
+ getEditorIns,
25451
+ onPaste,
25452
+ previewContentChange,
25453
+ onChecked,
25454
+ onPreviewScroll,
25455
+ onPreviewMouseout,
25456
+ onPreviewMouseover
25744
25457
  };
25745
25458
  }
25746
- var _getTag = getTag$3;
25747
- var objectProto = Object.prototype;
25748
- var hasOwnProperty = objectProto.hasOwnProperty;
25749
- function initCloneArray$1(array4) {
25750
- var length = array4.length, result2 = new array4.constructor(length);
25751
- if (length && typeof array4[0] == "string" && hasOwnProperty.call(array4, "index")) {
25752
- result2.index = array4.index;
25753
- result2.input = array4.input;
25754
- }
25755
- return result2;
25756
- }
25757
- var _initCloneArray = initCloneArray$1;
25758
- var root = _root;
25759
- var Uint8Array$1 = root.Uint8Array;
25760
- var _Uint8Array = Uint8Array$1;
25761
- var Uint8Array2 = _Uint8Array;
25762
- function cloneArrayBuffer$3(arrayBuffer) {
25763
- var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
25764
- new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
25765
- return result2;
25766
- }
25767
- var _cloneArrayBuffer = cloneArrayBuffer$3;
25768
- var cloneArrayBuffer$2 = _cloneArrayBuffer;
25769
- function cloneDataView$1(dataView, isDeep) {
25770
- var buffer = isDeep ? cloneArrayBuffer$2(dataView.buffer) : dataView.buffer;
25771
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
25772
- }
25773
- var _cloneDataView = cloneDataView$1;
25774
- var reFlags = /\w*$/;
25775
- function cloneRegExp$1(regexp4) {
25776
- var result2 = new regexp4.constructor(regexp4.source, reFlags.exec(regexp4));
25777
- result2.lastIndex = regexp4.lastIndex;
25778
- return result2;
25779
- }
25780
- var _cloneRegExp = cloneRegExp$1;
25781
- var Symbol$1 = _Symbol;
25782
- var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
25783
- function cloneSymbol$1(symbol) {
25784
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
25785
- }
25786
- var _cloneSymbol = cloneSymbol$1;
25787
- var cloneArrayBuffer$1 = _cloneArrayBuffer;
25788
- function cloneTypedArray$1(typedArray, isDeep) {
25789
- var buffer = isDeep ? cloneArrayBuffer$1(typedArray.buffer) : typedArray.buffer;
25790
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
25459
+ function useEditorMdTheme(callback) {
25460
+ const isDarkMode = ref(false);
25461
+ let themeService;
25462
+ const themeChange = () => {
25463
+ if (themeService) {
25464
+ isDarkMode.value = themeService.currentTheme.id.indexOf("dark") !== -1;
25465
+ callback();
25466
+ }
25467
+ };
25468
+ onBeforeMount(() => {
25469
+ themeService = window["devuiThemeService"];
25470
+ });
25471
+ onMounted(() => {
25472
+ themeChange();
25473
+ if (themeService && themeService.eventBus) {
25474
+ themeService.eventBus.add("themeChanged", themeChange);
25475
+ }
25476
+ });
25477
+ onBeforeUnmount(() => {
25478
+ if (themeService && themeService.eventBus) {
25479
+ themeService.eventBus.remove("themeChanged", themeChange);
25480
+ }
25481
+ });
25482
+ return { isDarkMode };
25791
25483
  }
25792
- var _cloneTypedArray = cloneTypedArray$1;
25793
- var cloneArrayBuffer = _cloneArrayBuffer, cloneDataView = _cloneDataView, cloneRegExp = _cloneRegExp, cloneSymbol = _cloneSymbol, cloneTypedArray = _cloneTypedArray;
25794
- var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]";
25795
- var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
25796
- function initCloneByTag$1(object4, tag2, isDeep) {
25797
- var Ctor = object4.constructor;
25798
- switch (tag2) {
25799
- case arrayBufferTag$1:
25800
- return cloneArrayBuffer(object4);
25801
- case boolTag$1:
25802
- case dateTag$1:
25803
- return new Ctor(+object4);
25804
- case dataViewTag$1:
25805
- return cloneDataView(object4, isDeep);
25806
- case float32Tag$1:
25807
- case float64Tag$1:
25808
- case int8Tag$1:
25809
- case int16Tag$1:
25810
- case int32Tag$1:
25811
- case uint8Tag$1:
25812
- case uint8ClampedTag$1:
25813
- case uint16Tag$1:
25814
- case uint32Tag$1:
25815
- return cloneTypedArray(object4, isDeep);
25816
- case mapTag$2:
25817
- return new Ctor();
25818
- case numberTag$1:
25819
- case stringTag$1:
25820
- return new Ctor(object4);
25821
- case regexpTag$1:
25822
- return cloneRegExp(object4);
25823
- case setTag$2:
25824
- return new Ctor();
25825
- case symbolTag$1:
25826
- return cloneSymbol(object4);
25484
+ const commonProps$1 = {
25485
+ baseUrl: {
25486
+ type: String,
25487
+ default: null
25488
+ },
25489
+ breaks: {
25490
+ type: Boolean,
25491
+ default: true
25492
+ },
25493
+ customParse: {
25494
+ type: Function,
25495
+ default: null
25496
+ },
25497
+ renderParse: {
25498
+ type: Function,
25499
+ default: null
25500
+ },
25501
+ mdRules: {
25502
+ type: Object,
25503
+ default: () => ({})
25504
+ },
25505
+ customRendererRules: {
25506
+ type: Array,
25507
+ default: () => []
25508
+ },
25509
+ customXssRules: {
25510
+ type: Array,
25511
+ default: () => []
25512
+ },
25513
+ mdPlugins: {
25514
+ type: Array,
25515
+ default: () => []
25516
+ }
25517
+ };
25518
+ const editorMdProps = __spreadProps(__spreadValues({}, commonProps$1), {
25519
+ modelValue: {
25520
+ type: String,
25521
+ default: ""
25522
+ },
25523
+ options: {
25524
+ type: Object,
25525
+ default: () => ({})
25526
+ },
25527
+ mode: {
25528
+ type: String,
25529
+ default: "normal"
25530
+ },
25531
+ customThemeConfig: {
25532
+ type: Object
25533
+ },
25534
+ customToolbars: {
25535
+ type: Object
25536
+ },
25537
+ disableChangeEvent: {
25538
+ type: Boolean,
25539
+ default: false
25540
+ },
25541
+ editorContainerHeight: {
25542
+ type: Number
25543
+ },
25544
+ imageUploadToServer: {
25545
+ type: Boolean,
25546
+ default: false
25547
+ },
25548
+ hidePreviewView: {
25549
+ type: Boolean,
25550
+ default: false
25551
+ },
25552
+ maxlength: {
25553
+ type: Number,
25554
+ default: null
25555
+ },
25556
+ placeholder: {
25557
+ type: String,
25558
+ default: ""
25559
+ },
25560
+ toolbarConfig: {
25561
+ type: Array,
25562
+ default: () => DEFAULT_TOOLBAR_CONFIG
25563
+ },
25564
+ fullscreenZIndex: {
25565
+ type: Number,
25566
+ default: 10
25567
+ },
25568
+ hintConfig: {
25569
+ type: Object
25570
+ },
25571
+ customHintReplaceFn: {
25572
+ type: Function
25827
25573
  }
25828
- }
25829
- var _initCloneByTag = initCloneByTag$1;
25830
- var isObject$1 = isObject_1;
25831
- var objectCreate = Object.create;
25832
- var baseCreate$1 = function() {
25833
- function object4() {
25574
+ });
25575
+ const EditorMdInjectionKey = Symbol("d-editor-md");
25576
+ const mdRenderProps = __spreadProps(__spreadValues({}, commonProps$1), {
25577
+ content: {
25578
+ type: String,
25579
+ default: ""
25580
+ },
25581
+ disableRender: {
25582
+ type: Boolean,
25583
+ default: false
25834
25584
  }
25835
- return function(proto) {
25836
- if (!isObject$1(proto)) {
25837
- return {};
25585
+ });
25586
+ const mdToolbarItemProps = {
25587
+ config: {
25588
+ type: Object,
25589
+ default: () => ({})
25590
+ }
25591
+ };
25592
+ const tooltipProps = {
25593
+ content: {
25594
+ type: String,
25595
+ default: ""
25596
+ },
25597
+ position: {
25598
+ type: [String, Array],
25599
+ default: "top"
25600
+ },
25601
+ showAnimation: {
25602
+ type: Boolean,
25603
+ default: true
25604
+ },
25605
+ mouseEnterDelay: {
25606
+ type: Number,
25607
+ default: 150
25608
+ },
25609
+ mouseLeaveDelay: {
25610
+ type: Number,
25611
+ default: 100
25612
+ },
25613
+ enterable: {
25614
+ type: Boolean,
25615
+ default: true
25616
+ },
25617
+ disabled: {
25618
+ type: Boolean,
25619
+ default: false
25620
+ },
25621
+ hideAfter: {
25622
+ type: Number,
25623
+ default: 0
25624
+ }
25625
+ };
25626
+ const transformOriginMap = {
25627
+ top: "50% calc(100% + 8px)",
25628
+ bottom: "50% -8px",
25629
+ left: "calc(100% + 8px)",
25630
+ right: "-8px 50%"
25631
+ };
25632
+ function useTooltip(origin, props) {
25633
+ const { position, mouseEnterDelay, mouseLeaveDelay, enterable, disabled, hideAfter } = toRefs(props);
25634
+ const visible = ref(false);
25635
+ const isEnter = ref(false);
25636
+ const positionArr = computed(() => typeof position.value === "string" ? [position.value] : position.value);
25637
+ const placement = ref(positionArr.value[0]);
25638
+ const overlayStyles = computed(() => ({
25639
+ transformOrigin: transformOriginMap[placement.value]
25640
+ }));
25641
+ const enter = lodash.exports.debounce(() => {
25642
+ isEnter.value && (visible.value = true);
25643
+ }, mouseEnterDelay.value);
25644
+ const leave = lodash.exports.debounce(() => {
25645
+ !isEnter.value && (visible.value = false);
25646
+ }, mouseLeaveDelay.value);
25647
+ const onMouseenter = () => {
25648
+ if (disabled.value) {
25649
+ return;
25838
25650
  }
25839
- if (objectCreate) {
25840
- return objectCreate(proto);
25651
+ isEnter.value = true;
25652
+ enter();
25653
+ };
25654
+ const onMouseleave = () => {
25655
+ isEnter.value = false;
25656
+ leave();
25657
+ };
25658
+ const onPositionChange = (pos) => {
25659
+ placement.value = pos;
25660
+ };
25661
+ const quickLeave = () => {
25662
+ isEnter.value = false;
25663
+ visible.value = false;
25664
+ };
25665
+ const onMouseenterOverlay = () => {
25666
+ if (!enterable.value) {
25667
+ quickLeave();
25668
+ } else {
25669
+ onMouseenter();
25841
25670
  }
25842
- object4.prototype = proto;
25843
- var result2 = new object4();
25844
- object4.prototype = void 0;
25845
- return result2;
25846
25671
  };
25847
- }();
25848
- var _baseCreate = baseCreate$1;
25849
- var baseCreate = _baseCreate, getPrototype = _getPrototype, isPrototype = _isPrototype;
25850
- function initCloneObject$1(object4) {
25851
- return typeof object4.constructor == "function" && !isPrototype(object4) ? baseCreate(getPrototype(object4)) : {};
25852
- }
25853
- var _initCloneObject = initCloneObject$1;
25854
- var getTag$2 = _getTag, isObjectLike$1 = isObjectLike_1;
25855
- var mapTag$1 = "[object Map]";
25856
- function baseIsMap$1(value) {
25857
- return isObjectLike$1(value) && getTag$2(value) == mapTag$1;
25858
- }
25859
- var _baseIsMap = baseIsMap$1;
25860
- var baseIsMap = _baseIsMap, baseUnary$1 = _baseUnary, nodeUtil$1 = _nodeUtil.exports;
25861
- var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
25862
- var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
25863
- var isMap_1 = isMap$1;
25864
- var getTag$1 = _getTag, isObjectLike = isObjectLike_1;
25865
- var setTag$1 = "[object Set]";
25866
- function baseIsSet$1(value) {
25867
- return isObjectLike(value) && getTag$1(value) == setTag$1;
25672
+ onMounted(() => {
25673
+ origin.value.addEventListener("mouseenter", onMouseenter);
25674
+ origin.value.addEventListener("mouseleave", onMouseleave);
25675
+ });
25676
+ let timer;
25677
+ watch(visible, (newVal) => {
25678
+ if (newVal && hideAfter.value) {
25679
+ timer && clearTimeout(timer);
25680
+ timer = setTimeout(quickLeave, hideAfter.value);
25681
+ }
25682
+ });
25683
+ return {
25684
+ visible,
25685
+ placement,
25686
+ positionArr,
25687
+ overlayStyles,
25688
+ onPositionChange,
25689
+ onMouseenter,
25690
+ onMouseleave,
25691
+ onMouseenterOverlay
25692
+ };
25868
25693
  }
25869
- var _baseIsSet = baseIsSet$1;
25870
- var baseIsSet = _baseIsSet, baseUnary = _baseUnary, nodeUtil = _nodeUtil.exports;
25871
- var nodeIsSet = nodeUtil && nodeUtil.isSet;
25872
- var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
25873
- var isSet_1 = isSet$1;
25874
- var Stack = _Stack, arrayEach = _arrayEach, assignValue = _assignValue, baseAssign = _baseAssign, baseAssignIn = _baseAssignIn, cloneBuffer = _cloneBuffer.exports, copyArray = _copyArray, copySymbols = _copySymbols, copySymbolsIn = _copySymbolsIn, getAllKeys = _getAllKeys, getAllKeysIn = _getAllKeysIn, getTag = _getTag, initCloneArray = _initCloneArray, initCloneByTag = _initCloneByTag, initCloneObject = _initCloneObject, isArray = isArray_1, isBuffer = isBuffer$2.exports, isMap = isMap_1, isObject = isObject_1, isSet = isSet_1, keys = keys_1, keysIn = keysIn_1;
25875
- var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$1 = 4;
25876
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
25877
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
25878
- var cloneableTags = {};
25879
- cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
25880
- cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
25881
- function baseClone$1(value, bitmask, customizer, key, object4, stack) {
25882
- var result2, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
25883
- if (customizer) {
25884
- result2 = object4 ? customizer(value, key, object4, stack) : customizer(value);
25694
+ var tooltip = "";
25695
+ var Tooltip = defineComponent({
25696
+ name: "DTooltip",
25697
+ props: tooltipProps,
25698
+ setup(props, {
25699
+ slots
25700
+ }) {
25701
+ const {
25702
+ showAnimation,
25703
+ content: content2
25704
+ } = toRefs(props);
25705
+ const origin = ref();
25706
+ const tooltipRef = ref();
25707
+ const {
25708
+ visible,
25709
+ placement,
25710
+ positionArr,
25711
+ overlayStyles,
25712
+ onPositionChange,
25713
+ onMouseleave,
25714
+ onMouseenterOverlay
25715
+ } = useTooltip(origin, props);
25716
+ const ns2 = useNamespace$1("tooltip");
25717
+ const className2 = computed(() => {
25718
+ return [ns2.b(), ns2.m(placement.value)].join(" ");
25719
+ });
25720
+ provide(POPPER_TRIGGER_TOKEN, origin);
25721
+ return () => createVNode(Fragment, null, [createVNode(PopperTrigger, null, {
25722
+ default: () => {
25723
+ var _a;
25724
+ return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
25725
+ }
25726
+ }), createVNode(Teleport, {
25727
+ "to": "body"
25728
+ }, {
25729
+ default: () => [createVNode(Transition, {
25730
+ "name": showAnimation.value ? ns2.m(`fade-${placement.value}`) : ""
25731
+ }, {
25732
+ default: () => [createVNode(FlexibleOverlay, {
25733
+ "modelValue": visible.value,
25734
+ "onUpdate:modelValue": ($event) => visible.value = $event,
25735
+ "ref": tooltipRef,
25736
+ "class": className2.value,
25737
+ "origin": origin.value,
25738
+ "position": positionArr.value,
25739
+ "offset": 6,
25740
+ "show-arrow": true,
25741
+ "style": overlayStyles.value,
25742
+ "onPositionChange": onPositionChange,
25743
+ "onMouseenter": onMouseenterOverlay,
25744
+ "onMouseleave": onMouseleave
25745
+ }, {
25746
+ default: () => [createVNode("span", {
25747
+ "innerHTML": content2.value
25748
+ }, null)]
25749
+ })]
25750
+ })]
25751
+ })]);
25885
25752
  }
25886
- if (result2 !== void 0) {
25887
- return result2;
25753
+ });
25754
+ var TooltipInstall = {
25755
+ title: "Tooltip \u63D0\u793A",
25756
+ category: "\u53CD\u9988",
25757
+ status: "100%",
25758
+ install(app) {
25759
+ app.component(Tooltip.name, Tooltip);
25888
25760
  }
25889
- if (!isObject(value)) {
25890
- return value;
25761
+ };
25762
+ var FontColor = defineComponent({
25763
+ name: "FontColor",
25764
+ setup() {
25765
+ const {
25766
+ getEditorIns,
25767
+ t
25768
+ } = inject(EditorMdInjectionKey);
25769
+ const setColor = (type4, color2) => {
25770
+ const editorIns = getEditorIns();
25771
+ const selection = editorIns.getSelection();
25772
+ const styleType = type4 === "bg" ? "background-color:" : "color:";
25773
+ editorIns.focus();
25774
+ editorIns.replaceSelection(`<span style="${styleType}${color2};">${selection}</span>`);
25775
+ setTimeout(() => {
25776
+ if (selection === "") {
25777
+ const cursor = editorIns.getCursor();
25778
+ editorIns.setCursor(cursor.line, cursor.ch - 7);
25779
+ }
25780
+ });
25781
+ };
25782
+ return () => createVNode("div", {
25783
+ "class": "dropdown-font-color"
25784
+ }, [createVNode("div", {
25785
+ "class": "color-wrap"
25786
+ }, [createVNode("p", null, [t("color")]), createVNode("ul", {
25787
+ "class": "color-picker"
25788
+ }, [FONT_COLORS.map((item, index2) => createVNode("li", {
25789
+ "key": index2,
25790
+ "style": {
25791
+ backgroundColor: item
25792
+ },
25793
+ "onClick": () => setColor("ft", item)
25794
+ }, null))])]), createVNode("div", {
25795
+ "class": "color-wrap"
25796
+ }, [createVNode("p", null, [t("background")]), createVNode("ul", {
25797
+ "class": "color-picker"
25798
+ }, [FONT_COLORS.map((item, index2) => createVNode("li", {
25799
+ "key": index2,
25800
+ "style": {
25801
+ backgroundColor: item
25802
+ },
25803
+ "onClick": () => setColor("bg", item)
25804
+ }, null))])])]);
25891
25805
  }
25892
- var isArr = isArray(value);
25893
- if (isArr) {
25894
- result2 = initCloneArray(value);
25895
- if (!isDeep) {
25896
- return copyArray(value, result2);
25897
- }
25898
- } else {
25899
- var tag2 = getTag(value), isFunc = tag2 == funcTag || tag2 == genTag;
25900
- if (isBuffer(value)) {
25901
- return cloneBuffer(value, isDeep);
25902
- }
25903
- if (tag2 == objectTag || tag2 == argsTag || isFunc && !object4) {
25904
- result2 = isFlat || isFunc ? {} : initCloneObject(value);
25905
- if (!isDeep) {
25906
- return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value));
25806
+ });
25807
+ var FontSize = defineComponent({
25808
+ name: "FontSize",
25809
+ setup() {
25810
+ const {
25811
+ getEditorIns
25812
+ } = inject(EditorMdInjectionKey);
25813
+ const setSize = (val) => {
25814
+ const editorIns = getEditorIns();
25815
+ const selection = editorIns.getSelection();
25816
+ editorIns.focus();
25817
+ editorIns.replaceSelection(`<span style="font-size:${val}px;">${selection}</span>`);
25818
+ setTimeout(() => {
25819
+ if (selection === "") {
25820
+ const cursor = editorIns.getCursor();
25821
+ editorIns.setCursor(cursor.line, cursor.ch - 7);
25822
+ }
25823
+ });
25824
+ };
25825
+ return () => createVNode("ul", {
25826
+ "class": "dropdown-font-size"
25827
+ }, [FONT_SIZE_LIST.map((item, index2) => createVNode("li", {
25828
+ "key": index2,
25829
+ "onClick": () => setSize(item.value)
25830
+ }, [item.name]))]);
25831
+ }
25832
+ });
25833
+ var ToolbarItem = defineComponent({
25834
+ name: "DMdToolbarItem",
25835
+ props: mdToolbarItemProps,
25836
+ setup(props) {
25837
+ const config = reactive(props.config);
25838
+ const {
25839
+ showFullscreen,
25840
+ getEditorIns,
25841
+ t
25842
+ } = inject(EditorMdInjectionKey);
25843
+ const getTooltipContent = (name, shortKey) => {
25844
+ var _a;
25845
+ if (!name && !shortKey) {
25846
+ return "";
25907
25847
  }
25908
- } else {
25909
- if (!cloneableTags[tag2]) {
25910
- return object4 ? value : {};
25848
+ if (name === "fullscreen") {
25849
+ return `<center>${showFullscreen.value ? t(config.exitName) : t(name)}</center>`;
25911
25850
  }
25912
- result2 = initCloneByTag(value, tag2, isDeep);
25913
- }
25851
+ let n = void 0;
25852
+ if (name == null ? void 0 : name.includes("&")) {
25853
+ const temp = name.split("&");
25854
+ n = t(temp[0]) + " & " + t(temp[1]);
25855
+ }
25856
+ return `<center>${(_a = n != null ? n : t(name)) != null ? _a : ""}<br>${shortKey != null ? shortKey : ""}</center>`;
25857
+ };
25858
+ const onToolbarItemClick = () => {
25859
+ var _a;
25860
+ const editorIns = getEditorIns();
25861
+ if (config.id === "fullscreen") {
25862
+ showFullscreen.value = !showFullscreen.value;
25863
+ } else {
25864
+ (_a = config.handler) == null ? void 0 : _a.call(config, editorIns, config.params);
25865
+ }
25866
+ };
25867
+ return () => createVNode(Fragment, null, [config.type === "button" && createVNode(Tooltip, {
25868
+ "position": ["top", "bottom"],
25869
+ "content": getTooltipContent(config.name, config.shortKey)
25870
+ }, {
25871
+ default: () => [createVNode("span", {
25872
+ "class": "md-toolbar-item",
25873
+ "onClick": onToolbarItemClick,
25874
+ "innerHTML": config.id === "fullscreen" ? showFullscreen.value ? config.exitIcon : config.icon : config.icon
25875
+ }, null)]
25876
+ }), config.type === "dropDown" && createVNode(Dropdown$1, {
25877
+ "position": ["bottom-start"],
25878
+ "align": "start"
25879
+ }, {
25880
+ default: () => createVNode("span", null, [createVNode(Tooltip, {
25881
+ "position": ["top"],
25882
+ "content": getTooltipContent(config.name)
25883
+ }, {
25884
+ default: () => [createVNode("span", {
25885
+ "class": "md-toolbar-item",
25886
+ "onClick": () => {
25887
+ var _a;
25888
+ return (_a = config.handler) == null ? void 0 : _a.call(config);
25889
+ },
25890
+ "innerHTML": config.icon
25891
+ }, null)]
25892
+ })]),
25893
+ menu: () => createVNode(Fragment, null, [config.component === "FontSize" && createVNode(FontSize, null, null), config.component === "FontColor" && createVNode(FontColor, null, null)])
25894
+ })]);
25914
25895
  }
25915
- stack || (stack = new Stack());
25916
- var stacked = stack.get(value);
25917
- if (stacked) {
25918
- return stacked;
25896
+ });
25897
+ function useToolbar() {
25898
+ const { toolbars, toolbarConfig } = inject(EditorMdInjectionKey);
25899
+ return { toolbars, toolbarConfig };
25900
+ }
25901
+ var toolbar = "";
25902
+ var Toolbar = defineComponent({
25903
+ name: "DMdToolbar",
25904
+ setup() {
25905
+ const {
25906
+ toolbars,
25907
+ toolbarConfig
25908
+ } = useToolbar();
25909
+ return () => createVNode("div", {
25910
+ "class": "md-toolbar-container"
25911
+ }, [toolbarConfig.value.map((item, index2) => Array.isArray(item) ? createVNode(Fragment, null, [item.map((key, idx) => createVNode(ToolbarItem, {
25912
+ "config": toolbars[key],
25913
+ "key": `${index2}-${idx}`
25914
+ }, null)), createVNode("span", {
25915
+ "class": "md-toolbar-span"
25916
+ }, null)]) : createVNode(ToolbarItem, {
25917
+ "config": toolbars[item],
25918
+ "key": index2
25919
+ }, null))]);
25919
25920
  }
25920
- stack.set(value, result2);
25921
- if (isSet(value)) {
25922
- value.forEach(function(subValue) {
25923
- result2.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack));
25924
- });
25925
- } else if (isMap(value)) {
25926
- value.forEach(function(subValue, key2) {
25927
- result2.set(key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
25928
- });
25921
+ });
25922
+ const DEFAULT_CONFIG$1 = {
25923
+ startOnLoad: false,
25924
+ securityLevel: "strict",
25925
+ theme: "default",
25926
+ flowchart: {
25927
+ htmlLabels: true,
25928
+ useMaxWidth: false
25929
25929
  }
25930
- var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
25931
- var props = isArr ? void 0 : keysFunc(value);
25932
- arrayEach(props || value, function(subValue, key2) {
25933
- if (props) {
25934
- key2 = subValue;
25935
- subValue = value[key2];
25930
+ };
25931
+ function render(code, options) {
25932
+ try {
25933
+ return `<div class="mermaid" id="${options.id}">${code}</div>`;
25934
+ } catch (err) {
25935
+ return `<pre>${err.name}: ${err.message}</pre>`;
25936
+ }
25937
+ }
25938
+ function mermaidRender(md, options = {}) {
25939
+ Mermaid.initialize(Object.assign(DEFAULT_CONFIG$1, options));
25940
+ const defaultRenderer = md.renderer.rules.fence.bind(md.renderer.rules);
25941
+ md.renderer.rules.fence = (tokens, idx, opts, env, self2) => {
25942
+ const token = tokens[idx];
25943
+ const code = token.content.trim();
25944
+ if (token.info.startsWith("mermaid")) {
25945
+ return render(code, options);
25936
25946
  }
25937
- assignValue(result2, key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
25938
- });
25939
- return result2;
25947
+ return defaultRenderer(tokens, idx, opts, env, self2);
25948
+ };
25940
25949
  }
25941
- var _baseClone = baseClone$1;
25942
- var baseClone = _baseClone;
25943
- var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4;
25944
- function cloneDeep(value) {
25945
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
25950
+ function refreshMermaid(delay = 0) {
25951
+ setTimeout(() => {
25952
+ Mermaid.init();
25953
+ }, delay);
25946
25954
  }
25947
- var cloneDeep_1 = cloneDeep;
25948
25955
  const TOC = "[toc]";
25949
25956
  const TOC_RE = /^\[toc\]/im;
25950
25957
  const repeatAsterisk = (string3, num) => new Array(num + 1).join(string3) + "*";
@@ -26378,7 +26385,7 @@ function _isSlot$7(s) {
26378
26385
  var EditorMd = defineComponent({
26379
26386
  name: "DEditorMd",
26380
26387
  props: editorMdProps,
26381
- emits: ["update:modelValue", "mdCheckedEvent", "selectHint", "afterEditorInit", "contentChange", "previewContentChange"],
26388
+ emits: ["update:modelValue", "mdCheckedEvent", "selectHint", "afterEditorInit", "contentChange", "previewContentChange", "imageUpload"],
26382
26389
  setup(props, ctx2) {
26383
26390
  const {
26384
26391
  mode,
@@ -26435,7 +26442,8 @@ var EditorMd = defineComponent({
26435
26442
  "dp-md-readonly": mode.value === "readonly",
26436
26443
  "dp-md-editonly": mode.value === "editonly",
26437
26444
  "dp-md-dark": isDarkMode.value
26438
- }]
26445
+ }],
26446
+ "onPaste": onPaste
26439
26447
  }, [createVNode("div", {
26440
26448
  "class": "dp-md-toolbar-container"
26441
26449
  }, [createVNode(Toolbar, null, null)]), createVNode("div", {
@@ -43721,7 +43729,7 @@ const installs = [
43721
43729
  VirtualListInstall
43722
43730
  ];
43723
43731
  var vueDevui = {
43724
- version: "1.5.10",
43732
+ version: "1.5.11-hotfix.1",
43725
43733
  install(app) {
43726
43734
  installs.forEach((p) => app.use(p));
43727
43735
  }