@haluo/biz 2.0.14-beta.3 → 2.0.15-beta.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/dist/haluo-biz.js +45 -28
- package/dist/haluo-biz.umd.cjs +45 -28
- package/dist/style.css +2 -0
- package/package.json +1 -1
package/dist/haluo-biz.js
CHANGED
|
@@ -2509,7 +2509,9 @@ const _sfc_main = {
|
|
|
2509
2509
|
replaceSeamless: 0,
|
|
2510
2510
|
seamlessCount: 0,
|
|
2511
2511
|
overLine: "",
|
|
2512
|
-
currentVideo: null
|
|
2512
|
+
currentVideo: null,
|
|
2513
|
+
targetMove: "",
|
|
2514
|
+
moverClasses: ["halo-img-content", "halo-video-content"]
|
|
2513
2515
|
};
|
|
2514
2516
|
},
|
|
2515
2517
|
computed: {
|
|
@@ -2796,8 +2798,11 @@ const _sfc_main = {
|
|
|
2796
2798
|
this.parseGood(node);
|
|
2797
2799
|
} else if (node.classList.contains("halo-img-content")) {
|
|
2798
2800
|
const img = node.querySelector("img");
|
|
2799
|
-
|
|
2801
|
+
node.setAttribute("tabindex", -1);
|
|
2802
|
+
node.setAttribute("draggable", true);
|
|
2803
|
+
node.setAttribute("contenteditable", false);
|
|
2800
2804
|
img.setAttribute("draggable", false);
|
|
2805
|
+
this.setDragMove(node);
|
|
2801
2806
|
const desc = img.dataset.desc;
|
|
2802
2807
|
img.style.margin = "0";
|
|
2803
2808
|
const seamlessFlag = ((_a = JSON.parse(img.getAttribute("data"))) == null ? void 0 : _a.seamlessFlag) || "0";
|
|
@@ -2859,6 +2864,9 @@ const _sfc_main = {
|
|
|
2859
2864
|
const replaceBtn = me2.insertVideoBtns(me2.editor, video);
|
|
2860
2865
|
node.appendChild(delBtn);
|
|
2861
2866
|
node.appendChild(replaceBtn);
|
|
2867
|
+
node.setAttribute("tabindex", -1);
|
|
2868
|
+
node.setAttribute("draggable", true);
|
|
2869
|
+
me2.setDragMove(node);
|
|
2862
2870
|
},
|
|
2863
2871
|
async parseArticle(node) {
|
|
2864
2872
|
const data = JSON.parse(node.dataset.article);
|
|
@@ -3240,6 +3248,25 @@ const _sfc_main = {
|
|
|
3240
3248
|
this.styleStatus.size = parseInt(this.fontInfo.size) === 100 ? 17 : this.fontInfo.size;
|
|
3241
3249
|
this.styleStatus.color = this.fontInfo.color;
|
|
3242
3250
|
});
|
|
3251
|
+
editorDom.ondragover = function(e) {
|
|
3252
|
+
if (me2.targetMove && me2.moverClasses.includes(me2.targetMove.className)) {
|
|
3253
|
+
e.preventDefault();
|
|
3254
|
+
}
|
|
3255
|
+
};
|
|
3256
|
+
editorDom.ondrop = function(e) {
|
|
3257
|
+
if (me2.targetMove && me2.moverClasses.includes(me2.targetMove.className)) {
|
|
3258
|
+
if (e.target.parentNode !== editorDom) {
|
|
3259
|
+
return;
|
|
3260
|
+
}
|
|
3261
|
+
if (e.target === editorDom) {
|
|
3262
|
+
e.target.appendChild(me2.targetMove);
|
|
3263
|
+
} else {
|
|
3264
|
+
e.target.after(me2.targetMove);
|
|
3265
|
+
}
|
|
3266
|
+
me2.targetMove = "";
|
|
3267
|
+
e.preventDefault();
|
|
3268
|
+
}
|
|
3269
|
+
};
|
|
3243
3270
|
me2.editor.addEventListener("willPaste", function(type, handler) {
|
|
3244
3271
|
function validateDom() {
|
|
3245
3272
|
const fragment = type && type.fragment || {};
|
|
@@ -3357,8 +3384,10 @@ const _sfc_main = {
|
|
|
3357
3384
|
var p = this.createElement("div", {
|
|
3358
3385
|
"class": "halo-img-content",
|
|
3359
3386
|
"contenteditable": "false",
|
|
3360
|
-
"draggable": "
|
|
3387
|
+
"draggable": "true",
|
|
3388
|
+
"tabindex": "-1"
|
|
3361
3389
|
}, [...childList]);
|
|
3390
|
+
me2.setDragMove(p);
|
|
3362
3391
|
this.insertElement(p, range);
|
|
3363
3392
|
if (isSeameless) {
|
|
3364
3393
|
me2.removeDefault(p, "nextElementSibling");
|
|
@@ -3417,31 +3446,7 @@ const _sfc_main = {
|
|
|
3417
3446
|
p.onclick = function() {
|
|
3418
3447
|
me2.setToast("\u4E0D\u652F\u6301\u64AD\u653E");
|
|
3419
3448
|
};
|
|
3420
|
-
|
|
3421
|
-
p.ondragstart = function(e) {
|
|
3422
|
-
if (!(e.target.className.indexOf("halo-video-content") < 0)) {
|
|
3423
|
-
e.dataTransfer.setData("text/html", e.target);
|
|
3424
|
-
e.dataTransfer.effectAllowed = "move";
|
|
3425
|
-
e.dataTransfer.dropEffect = "move";
|
|
3426
|
-
targetMove = e.target;
|
|
3427
|
-
}
|
|
3428
|
-
};
|
|
3429
|
-
editorDom.ondragover = function(e) {
|
|
3430
|
-
if (targetMove && !(targetMove.className.indexOf("halo-video-content") < 0)) {
|
|
3431
|
-
e.preventDefault();
|
|
3432
|
-
}
|
|
3433
|
-
};
|
|
3434
|
-
editorDom.ondrop = function(e) {
|
|
3435
|
-
if (targetMove && !(targetMove.className.indexOf("halo-video-content") < 0)) {
|
|
3436
|
-
if (e.target === editorDom) {
|
|
3437
|
-
e.target.appendChild(targetMove);
|
|
3438
|
-
} else {
|
|
3439
|
-
e.target.after(targetMove);
|
|
3440
|
-
}
|
|
3441
|
-
targetMove = "";
|
|
3442
|
-
e.preventDefault();
|
|
3443
|
-
}
|
|
3444
|
-
};
|
|
3449
|
+
me2.setDragMove(p);
|
|
3445
3450
|
this.insertElement(p);
|
|
3446
3451
|
setTimeout(() => {
|
|
3447
3452
|
document.documentElement.scrollTop = scrollTop;
|
|
@@ -3465,6 +3470,18 @@ const _sfc_main = {
|
|
|
3465
3470
|
};
|
|
3466
3471
|
me2.sticky();
|
|
3467
3472
|
},
|
|
3473
|
+
setDragMove(p) {
|
|
3474
|
+
const className = p.getAttribute("class");
|
|
3475
|
+
const me2 = this;
|
|
3476
|
+
p.ondragstart = function(e) {
|
|
3477
|
+
if (!(e.target.className.indexOf(className) < 0)) {
|
|
3478
|
+
e.dataTransfer.setData("text/html", e.target);
|
|
3479
|
+
e.dataTransfer.effectAllowed = "move";
|
|
3480
|
+
e.dataTransfer.dropEffect = "move";
|
|
3481
|
+
me2.targetMove = e.target;
|
|
3482
|
+
}
|
|
3483
|
+
};
|
|
3484
|
+
},
|
|
3468
3485
|
removeDefault(next, key) {
|
|
3469
3486
|
const me2 = this;
|
|
3470
3487
|
const cur = next[key];
|
package/dist/haluo-biz.umd.cjs
CHANGED
|
@@ -2511,7 +2511,9 @@
|
|
|
2511
2511
|
replaceSeamless: 0,
|
|
2512
2512
|
seamlessCount: 0,
|
|
2513
2513
|
overLine: "",
|
|
2514
|
-
currentVideo: null
|
|
2514
|
+
currentVideo: null,
|
|
2515
|
+
targetMove: "",
|
|
2516
|
+
moverClasses: ["halo-img-content", "halo-video-content"]
|
|
2515
2517
|
};
|
|
2516
2518
|
},
|
|
2517
2519
|
computed: {
|
|
@@ -2798,8 +2800,11 @@
|
|
|
2798
2800
|
this.parseGood(node);
|
|
2799
2801
|
} else if (node.classList.contains("halo-img-content")) {
|
|
2800
2802
|
const img = node.querySelector("img");
|
|
2801
|
-
|
|
2803
|
+
node.setAttribute("tabindex", -1);
|
|
2804
|
+
node.setAttribute("draggable", true);
|
|
2805
|
+
node.setAttribute("contenteditable", false);
|
|
2802
2806
|
img.setAttribute("draggable", false);
|
|
2807
|
+
this.setDragMove(node);
|
|
2803
2808
|
const desc = img.dataset.desc;
|
|
2804
2809
|
img.style.margin = "0";
|
|
2805
2810
|
const seamlessFlag = ((_a = JSON.parse(img.getAttribute("data"))) == null ? void 0 : _a.seamlessFlag) || "0";
|
|
@@ -2861,6 +2866,9 @@
|
|
|
2861
2866
|
const replaceBtn = me2.insertVideoBtns(me2.editor, video);
|
|
2862
2867
|
node.appendChild(delBtn);
|
|
2863
2868
|
node.appendChild(replaceBtn);
|
|
2869
|
+
node.setAttribute("tabindex", -1);
|
|
2870
|
+
node.setAttribute("draggable", true);
|
|
2871
|
+
me2.setDragMove(node);
|
|
2864
2872
|
},
|
|
2865
2873
|
async parseArticle(node) {
|
|
2866
2874
|
const data = JSON.parse(node.dataset.article);
|
|
@@ -3242,6 +3250,25 @@
|
|
|
3242
3250
|
this.styleStatus.size = parseInt(this.fontInfo.size) === 100 ? 17 : this.fontInfo.size;
|
|
3243
3251
|
this.styleStatus.color = this.fontInfo.color;
|
|
3244
3252
|
});
|
|
3253
|
+
editorDom.ondragover = function(e) {
|
|
3254
|
+
if (me2.targetMove && me2.moverClasses.includes(me2.targetMove.className)) {
|
|
3255
|
+
e.preventDefault();
|
|
3256
|
+
}
|
|
3257
|
+
};
|
|
3258
|
+
editorDom.ondrop = function(e) {
|
|
3259
|
+
if (me2.targetMove && me2.moverClasses.includes(me2.targetMove.className)) {
|
|
3260
|
+
if (e.target.parentNode !== editorDom) {
|
|
3261
|
+
return;
|
|
3262
|
+
}
|
|
3263
|
+
if (e.target === editorDom) {
|
|
3264
|
+
e.target.appendChild(me2.targetMove);
|
|
3265
|
+
} else {
|
|
3266
|
+
e.target.after(me2.targetMove);
|
|
3267
|
+
}
|
|
3268
|
+
me2.targetMove = "";
|
|
3269
|
+
e.preventDefault();
|
|
3270
|
+
}
|
|
3271
|
+
};
|
|
3245
3272
|
me2.editor.addEventListener("willPaste", function(type, handler) {
|
|
3246
3273
|
function validateDom() {
|
|
3247
3274
|
const fragment = type && type.fragment || {};
|
|
@@ -3359,8 +3386,10 @@
|
|
|
3359
3386
|
var p = this.createElement("div", {
|
|
3360
3387
|
"class": "halo-img-content",
|
|
3361
3388
|
"contenteditable": "false",
|
|
3362
|
-
"draggable": "
|
|
3389
|
+
"draggable": "true",
|
|
3390
|
+
"tabindex": "-1"
|
|
3363
3391
|
}, [...childList]);
|
|
3392
|
+
me2.setDragMove(p);
|
|
3364
3393
|
this.insertElement(p, range);
|
|
3365
3394
|
if (isSeameless) {
|
|
3366
3395
|
me2.removeDefault(p, "nextElementSibling");
|
|
@@ -3419,31 +3448,7 @@
|
|
|
3419
3448
|
p.onclick = function() {
|
|
3420
3449
|
me2.setToast("\u4E0D\u652F\u6301\u64AD\u653E");
|
|
3421
3450
|
};
|
|
3422
|
-
|
|
3423
|
-
p.ondragstart = function(e) {
|
|
3424
|
-
if (!(e.target.className.indexOf("halo-video-content") < 0)) {
|
|
3425
|
-
e.dataTransfer.setData("text/html", e.target);
|
|
3426
|
-
e.dataTransfer.effectAllowed = "move";
|
|
3427
|
-
e.dataTransfer.dropEffect = "move";
|
|
3428
|
-
targetMove = e.target;
|
|
3429
|
-
}
|
|
3430
|
-
};
|
|
3431
|
-
editorDom.ondragover = function(e) {
|
|
3432
|
-
if (targetMove && !(targetMove.className.indexOf("halo-video-content") < 0)) {
|
|
3433
|
-
e.preventDefault();
|
|
3434
|
-
}
|
|
3435
|
-
};
|
|
3436
|
-
editorDom.ondrop = function(e) {
|
|
3437
|
-
if (targetMove && !(targetMove.className.indexOf("halo-video-content") < 0)) {
|
|
3438
|
-
if (e.target === editorDom) {
|
|
3439
|
-
e.target.appendChild(targetMove);
|
|
3440
|
-
} else {
|
|
3441
|
-
e.target.after(targetMove);
|
|
3442
|
-
}
|
|
3443
|
-
targetMove = "";
|
|
3444
|
-
e.preventDefault();
|
|
3445
|
-
}
|
|
3446
|
-
};
|
|
3451
|
+
me2.setDragMove(p);
|
|
3447
3452
|
this.insertElement(p);
|
|
3448
3453
|
setTimeout(() => {
|
|
3449
3454
|
document.documentElement.scrollTop = scrollTop;
|
|
@@ -3467,6 +3472,18 @@
|
|
|
3467
3472
|
};
|
|
3468
3473
|
me2.sticky();
|
|
3469
3474
|
},
|
|
3475
|
+
setDragMove(p) {
|
|
3476
|
+
const className = p.getAttribute("class");
|
|
3477
|
+
const me2 = this;
|
|
3478
|
+
p.ondragstart = function(e) {
|
|
3479
|
+
if (!(e.target.className.indexOf(className) < 0)) {
|
|
3480
|
+
e.dataTransfer.setData("text/html", e.target);
|
|
3481
|
+
e.dataTransfer.effectAllowed = "move";
|
|
3482
|
+
e.dataTransfer.dropEffect = "move";
|
|
3483
|
+
me2.targetMove = e.target;
|
|
3484
|
+
}
|
|
3485
|
+
};
|
|
3486
|
+
},
|
|
3470
3487
|
removeDefault(next, key) {
|
|
3471
3488
|
const me2 = this;
|
|
3472
3489
|
const cur = next[key];
|
package/dist/style.css
CHANGED
|
@@ -806,6 +806,7 @@
|
|
|
806
806
|
position: relative;
|
|
807
807
|
text-align: center;
|
|
808
808
|
left: 250px;
|
|
809
|
+
outline: none;
|
|
809
810
|
}
|
|
810
811
|
.editor #editor-content .halo-img-content .img-loading,
|
|
811
812
|
.editor #editor-content .halo-img-content .img-fail {
|
|
@@ -936,6 +937,7 @@
|
|
|
936
937
|
margin: 5px;
|
|
937
938
|
padding-right: 5px;
|
|
938
939
|
position: relative;
|
|
940
|
+
outline: none;
|
|
939
941
|
}
|
|
940
942
|
.editor #editor-content .halo-video-content .video-delete {
|
|
941
943
|
width: 18px;
|