vue-editify 0.2.22 → 0.2.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -632,7 +632,6 @@ declare const _default: import('vue').DefineComponent<{
632
632
  observe: (target: Node, options?: MutationObserverInit) => void;
633
633
  takeRecords: () => MutationRecord[];
634
634
  } | null;
635
- __illegalDoms: Node[];
636
635
  initRange: () => void;
637
636
  delete: () => void;
638
637
  insertText: (data: string) => void;
package/lib/editify.es.js CHANGED
@@ -2849,14 +2849,6 @@ const doPaste = async function(html, text2, files) {
2849
2849
  }
2850
2850
  }
2851
2851
  };
2852
- const removeIllegalDoms = function() {
2853
- var _a;
2854
- while (this.__illegalDoms.length > 0) {
2855
- const node = this.__illegalDoms[0];
2856
- (_a = node.parentNode) == null ? void 0 : _a.removeChild(node);
2857
- this.__illegalDoms.splice(0, 1);
2858
- }
2859
- };
2860
2852
  const setEditorDomObserve = function() {
2861
2853
  if (!window.MutationObserver) {
2862
2854
  console.warn("The current browser does not support MutationObserver");
@@ -2866,9 +2858,11 @@ const setEditorDomObserve = function() {
2866
2858
  this.__domObserver = null;
2867
2859
  }
2868
2860
  this.__domObserver = new MutationObserver((mutationList) => {
2861
+ var _a;
2869
2862
  let length = mutationList.length;
2870
2863
  for (let i = 0; i < length; i++) {
2871
2864
  if (mutationList[i].type == "childList") {
2865
+ const illegalDoms = [];
2872
2866
  const addNodesLength = mutationList[i].addedNodes.length;
2873
2867
  for (let j = 0; j < addNodesLength; j++) {
2874
2868
  const node = mutationList[i].addedNodes[j];
@@ -2877,12 +2871,17 @@ const setEditorDomObserve = function() {
2877
2871
  const key = parentNode ? data$1.get(parentNode, "data-alex-editor-key") : null;
2878
2872
  const element2 = key ? this.getElementByKey(key) : null;
2879
2873
  if (element2 && !element2.isText()) {
2880
- this.__illegalDoms.push(node);
2874
+ illegalDoms.push(node);
2881
2875
  }
2882
2876
  } else if (element$1.isElement(node) && !data$1.get(node, "data-alex-editor-key")) {
2883
- this.__illegalDoms.push(node);
2877
+ illegalDoms.push(node);
2884
2878
  }
2885
2879
  }
2880
+ while (illegalDoms.length > 0) {
2881
+ const node = illegalDoms[0];
2882
+ (_a = node.parentNode) == null ? void 0 : _a.removeChild(node);
2883
+ illegalDoms.splice(0, 1);
2884
+ }
2886
2885
  }
2887
2886
  }
2888
2887
  });
@@ -3569,7 +3568,6 @@ class AlexEditor {
3569
3568
  __publicField(this, "__innerSelectionChange", false);
3570
3569
  __publicField(this, "__chineseInputTimer", null);
3571
3570
  __publicField(this, "__domObserver", null);
3572
- __publicField(this, "__illegalDoms", []);
3573
3571
  this.$el = initEditorNode(node);
3574
3572
  const options = initEditorOptions(opts);
3575
3573
  this.disabled = options.disabled;
@@ -4195,7 +4193,6 @@ class AlexEditor {
4195
4193
  this.$el.innerHTML = "";
4196
4194
  this.$el.appendChild(fragment);
4197
4195
  } else {
4198
- removeIllegalDoms.apply(this);
4199
4196
  patch(this.stack, this.__oldStack, false).forEach((item) => {
4200
4197
  if (item.newElement) {
4201
4198
  const el = item.newElement.parent ? item.newElement.parent : item.newElement;
@@ -5008,7 +5005,7 @@ class AlexEditor {
5008
5005
  event$1.off(this.$el, "beforeinput.alex_editor compositionstart.alex_editor compositionupdate.alex_editor compositionend.alex_editor keydown.alex_editor cut.alex_editor paste.alex_editor copy.alex_editor dragstart.alex_editor drop.alex_editor focus.alex_editor blur.alex_editor");
5009
5006
  }
5010
5007
  }
5011
- const version$2 = "1.4.35";
5008
+ const version$2 = "1.4.36";
5012
5009
  console.log(`%c alex-editor %c v${version$2} `, "padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;", "padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;");
5013
5010
  const number = {
5014
5011
  /**
@@ -44683,7 +44680,7 @@ const Editify = withInstall(editify);
44683
44680
  const install = (app) => {
44684
44681
  app.component(Editify.name, Editify);
44685
44682
  };
44686
- const version = "0.2.22";
44683
+ const version = "0.2.23";
44687
44684
  console.log(`%c vue-editify %c v${version} `, "padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;", "padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;");
44688
44685
  export {
44689
44686
  AlexElement,