vue-editify 0.2.23 → 0.2.24
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/lib/editify/editify.vue.d.ts +1 -0
- package/lib/editify.es.js +14 -11
- package/lib/editify.umd.js +1 -1
- package/lib/index.d.ts +2 -1
- package/package.json +2 -2
- package/src/index.ts +1 -1
|
@@ -632,6 +632,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
632
632
|
observe: (target: Node, options?: MutationObserverInit) => void;
|
|
633
633
|
takeRecords: () => MutationRecord[];
|
|
634
634
|
} | null;
|
|
635
|
+
__illegalDoms: Node[];
|
|
635
636
|
initRange: () => void;
|
|
636
637
|
delete: () => void;
|
|
637
638
|
insertText: (data: string) => void;
|
package/lib/editify.es.js
CHANGED
|
@@ -2849,6 +2849,14 @@ 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
|
+
};
|
|
2852
2860
|
const setEditorDomObserve = function() {
|
|
2853
2861
|
if (!window.MutationObserver) {
|
|
2854
2862
|
console.warn("The current browser does not support MutationObserver");
|
|
@@ -2858,11 +2866,9 @@ const setEditorDomObserve = function() {
|
|
|
2858
2866
|
this.__domObserver = null;
|
|
2859
2867
|
}
|
|
2860
2868
|
this.__domObserver = new MutationObserver((mutationList) => {
|
|
2861
|
-
var _a;
|
|
2862
2869
|
let length = mutationList.length;
|
|
2863
2870
|
for (let i = 0; i < length; i++) {
|
|
2864
2871
|
if (mutationList[i].type == "childList") {
|
|
2865
|
-
const illegalDoms = [];
|
|
2866
2872
|
const addNodesLength = mutationList[i].addedNodes.length;
|
|
2867
2873
|
for (let j = 0; j < addNodesLength; j++) {
|
|
2868
2874
|
const node = mutationList[i].addedNodes[j];
|
|
@@ -2871,17 +2877,12 @@ const setEditorDomObserve = function() {
|
|
|
2871
2877
|
const key = parentNode ? data$1.get(parentNode, "data-alex-editor-key") : null;
|
|
2872
2878
|
const element2 = key ? this.getElementByKey(key) : null;
|
|
2873
2879
|
if (element2 && !element2.isText()) {
|
|
2874
|
-
|
|
2880
|
+
this.__illegalDoms.push(node);
|
|
2875
2881
|
}
|
|
2876
2882
|
} else if (element$1.isElement(node) && !data$1.get(node, "data-alex-editor-key")) {
|
|
2877
|
-
|
|
2883
|
+
this.__illegalDoms.push(node);
|
|
2878
2884
|
}
|
|
2879
2885
|
}
|
|
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
|
-
}
|
|
2885
2886
|
}
|
|
2886
2887
|
}
|
|
2887
2888
|
});
|
|
@@ -3568,6 +3569,7 @@ class AlexEditor {
|
|
|
3568
3569
|
__publicField(this, "__innerSelectionChange", false);
|
|
3569
3570
|
__publicField(this, "__chineseInputTimer", null);
|
|
3570
3571
|
__publicField(this, "__domObserver", null);
|
|
3572
|
+
__publicField(this, "__illegalDoms", []);
|
|
3571
3573
|
this.$el = initEditorNode(node);
|
|
3572
3574
|
const options = initEditorOptions(opts);
|
|
3573
3575
|
this.disabled = options.disabled;
|
|
@@ -4193,6 +4195,7 @@ class AlexEditor {
|
|
|
4193
4195
|
this.$el.innerHTML = "";
|
|
4194
4196
|
this.$el.appendChild(fragment);
|
|
4195
4197
|
} else {
|
|
4198
|
+
removeIllegalDoms.apply(this);
|
|
4196
4199
|
patch(this.stack, this.__oldStack, false).forEach((item) => {
|
|
4197
4200
|
if (item.newElement) {
|
|
4198
4201
|
const el = item.newElement.parent ? item.newElement.parent : item.newElement;
|
|
@@ -5005,7 +5008,7 @@ class AlexEditor {
|
|
|
5005
5008
|
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");
|
|
5006
5009
|
}
|
|
5007
5010
|
}
|
|
5008
|
-
const version$2 = "1.4.
|
|
5011
|
+
const version$2 = "1.4.37";
|
|
5009
5012
|
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;");
|
|
5010
5013
|
const number = {
|
|
5011
5014
|
/**
|
|
@@ -44680,7 +44683,7 @@ const Editify = withInstall(editify);
|
|
|
44680
44683
|
const install = (app) => {
|
|
44681
44684
|
app.component(Editify.name, Editify);
|
|
44682
44685
|
};
|
|
44683
|
-
const version = "0.2.
|
|
44686
|
+
const version = "0.2.24";
|
|
44684
44687
|
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;");
|
|
44685
44688
|
export {
|
|
44686
44689
|
AlexElement,
|