@haluo/biz 2.0.15-beta.1 → 2.0.15-beta.2

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 CHANGED
@@ -2509,6 +2509,7 @@ const _sfc_main = {
2509
2509
  replaceSeamless: 0,
2510
2510
  seamlessCount: 0,
2511
2511
  overLine: "",
2512
+ lasteDropDom: "",
2512
2513
  currentVideo: null,
2513
2514
  targetMove: "",
2514
2515
  moverClasses: ["halo-img-content", "halo-video-content"]
@@ -3250,22 +3251,29 @@ const _sfc_main = {
3250
3251
  });
3251
3252
  editorDom.ondragover = function(e) {
3252
3253
  if (me2.targetMove && me2.moverClasses.includes(me2.targetMove.className)) {
3254
+ if (e.target.offsetParent === editorDom) {
3255
+ me2.overLine = e.target.offsetHeight + e.target.offsetTop + "px";
3256
+ me2.lasteDropDom = e.target;
3257
+ }
3253
3258
  e.preventDefault();
3254
3259
  }
3255
3260
  };
3256
3261
  editorDom.ondrop = function(e) {
3257
3262
  if (me2.targetMove && me2.moverClasses.includes(me2.targetMove.className)) {
3258
- if (e.target.parentNode !== editorDom) {
3263
+ const target = me2.lasteDropDom || e.target;
3264
+ if (target.parentNode !== editorDom) {
3259
3265
  return;
3260
3266
  }
3261
- if (e.target === editorDom) {
3262
- e.target.appendChild(me2.targetMove);
3267
+ if (target === editorDom) {
3268
+ target.appendChild(me2.targetMove);
3263
3269
  } else {
3264
- e.target.after(me2.targetMove);
3270
+ target.after(me2.targetMove);
3265
3271
  }
3266
3272
  me2.targetMove = "";
3273
+ me2.lasteDropDom = "";
3267
3274
  e.preventDefault();
3268
3275
  }
3276
+ me2.overLine = "";
3269
3277
  };
3270
3278
  me2.editor.addEventListener("willPaste", function(type, handler) {
3271
3279
  function validateDom() {
@@ -3921,9 +3929,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
3921
3929
  withDirectives(createElementVNode("div", {
3922
3930
  style: normalizeStyle({ textAlign: $options.align }),
3923
3931
  class: "placeholder"
3924
- }, "\u8BF7\u8F93\u5165\u6B63\u6587", 4), [
3932
+ }, "\u8BF7\u8F93\u5165\u6B63\u6587 ", 4), [
3925
3933
  [vShow, !$options.isInputing && !$data.titleCount && !$data.hasArticleCard]
3926
3934
  ]),
3935
+ $data.overLine ? (openBlock(), createElementBlock("div", {
3936
+ key: 0,
3937
+ class: "overline",
3938
+ style: normalizeStyle({ top: $data.overLine })
3939
+ }, null, 4)) : createCommentVNode("", true),
3927
3940
  createElementVNode("div", {
3928
3941
  id: "editor-content",
3929
3942
  style: normalizeStyle({ cursor: $data.cursorStyle }),
@@ -2511,6 +2511,7 @@
2511
2511
  replaceSeamless: 0,
2512
2512
  seamlessCount: 0,
2513
2513
  overLine: "",
2514
+ lasteDropDom: "",
2514
2515
  currentVideo: null,
2515
2516
  targetMove: "",
2516
2517
  moverClasses: ["halo-img-content", "halo-video-content"]
@@ -3252,22 +3253,29 @@
3252
3253
  });
3253
3254
  editorDom.ondragover = function(e) {
3254
3255
  if (me2.targetMove && me2.moverClasses.includes(me2.targetMove.className)) {
3256
+ if (e.target.offsetParent === editorDom) {
3257
+ me2.overLine = e.target.offsetHeight + e.target.offsetTop + "px";
3258
+ me2.lasteDropDom = e.target;
3259
+ }
3255
3260
  e.preventDefault();
3256
3261
  }
3257
3262
  };
3258
3263
  editorDom.ondrop = function(e) {
3259
3264
  if (me2.targetMove && me2.moverClasses.includes(me2.targetMove.className)) {
3260
- if (e.target.parentNode !== editorDom) {
3265
+ const target = me2.lasteDropDom || e.target;
3266
+ if (target.parentNode !== editorDom) {
3261
3267
  return;
3262
3268
  }
3263
- if (e.target === editorDom) {
3264
- e.target.appendChild(me2.targetMove);
3269
+ if (target === editorDom) {
3270
+ target.appendChild(me2.targetMove);
3265
3271
  } else {
3266
- e.target.after(me2.targetMove);
3272
+ target.after(me2.targetMove);
3267
3273
  }
3268
3274
  me2.targetMove = "";
3275
+ me2.lasteDropDom = "";
3269
3276
  e.preventDefault();
3270
3277
  }
3278
+ me2.overLine = "";
3271
3279
  };
3272
3280
  me2.editor.addEventListener("willPaste", function(type, handler) {
3273
3281
  function validateDom() {
@@ -3923,9 +3931,14 @@
3923
3931
  vue.withDirectives(vue.createElementVNode("div", {
3924
3932
  style: vue.normalizeStyle({ textAlign: $options.align }),
3925
3933
  class: "placeholder"
3926
- }, "\u8BF7\u8F93\u5165\u6B63\u6587", 4), [
3934
+ }, "\u8BF7\u8F93\u5165\u6B63\u6587 ", 4), [
3927
3935
  [vue.vShow, !$options.isInputing && !$data.titleCount && !$data.hasArticleCard]
3928
3936
  ]),
3937
+ $data.overLine ? (vue.openBlock(), vue.createElementBlock("div", {
3938
+ key: 0,
3939
+ class: "overline",
3940
+ style: vue.normalizeStyle({ top: $data.overLine })
3941
+ }, null, 4)) : vue.createCommentVNode("", true),
3929
3942
  vue.createElementVNode("div", {
3930
3943
  id: "editor-content",
3931
3944
  style: vue.normalizeStyle({ cursor: $data.cursorStyle }),
package/dist/style.css CHANGED
@@ -1065,6 +1065,14 @@
1065
1065
  height: 100vh;
1066
1066
  background-color: rgba(0, 0, 0, 0.3);
1067
1067
  }
1068
+ .editor .overline {
1069
+ position: absolute;
1070
+ z-index: 50;
1071
+ pointer-events: none;
1072
+ background-color: #1a74ff;
1073
+ width: 100%;
1074
+ height: 1px;
1075
+ }
1068
1076
  .video-progress {
1069
1077
  width: 440px;
1070
1078
  height: 220px;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@haluo/biz",
3
3
  "description": "rich text",
4
- "version": "2.0.15-beta.1",
4
+ "version": "2.0.15-beta.2",
5
5
  "type": "module",
6
6
  "module": "./dist/haluo-biz.js",
7
7
  "main": "./dist/haluo-biz.umd.cjs",