@tmagic/stage 1.1.3 → 1.1.4

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.
@@ -28,6 +28,7 @@
28
28
  ZIndex2["SELECTED_EL"] = "666";
29
29
  ZIndex2["GHOST_EL"] = "700";
30
30
  ZIndex2["DRAG_EL"] = "9";
31
+ ZIndex2["HIGHLIGHT_EL"] = "8";
31
32
  return ZIndex2;
32
33
  })(ZIndex || {});
33
34
  var MouseButton = /* @__PURE__ */ ((MouseButton2) => {
@@ -258,6 +259,10 @@
258
259
  select(el, event) {
259
260
  const oldTarget = this.target;
260
261
  this.target = el;
262
+ if (!this.dragEl) {
263
+ this.dragEl = globalThis.document.createElement("div");
264
+ this.container.append(this.dragEl);
265
+ }
261
266
  if (!this.moveable || this.target !== oldTarget) {
262
267
  this.init(el);
263
268
  this.moveableHelper = MoveableHelper__default.default.create({
@@ -308,6 +313,7 @@
308
313
  if (!this.moveable)
309
314
  return;
310
315
  this.destroyDragEl();
316
+ this.dragEl = void 0;
311
317
  this.moveable.target = null;
312
318
  this.moveable.updateTarget();
313
319
  }
@@ -327,9 +333,9 @@
327
333
  }
328
334
  this.mode = getMode(el);
329
335
  this.destroyGhostEl();
330
- this.destroyDragEl();
331
- this.dragEl = globalThis.document.createElement("div");
332
- this.container.append(this.dragEl);
336
+ if (!this.dragEl) {
337
+ return;
338
+ }
333
339
  this.dragEl.style.cssText = getTargetElStyle(el);
334
340
  this.dragEl.id = `${DRAG_EL_ID_PREFIX}${el.id}`;
335
341
  if (typeof this.core.config.updateDragEl === "function") {
@@ -686,7 +692,7 @@
686
692
  top: ${top}px;
687
693
  width: ${el.clientWidth}px;
688
694
  height: ${el.clientHeight}px;
689
- z-index: ${ZIndex.DRAG_EL};
695
+ z-index: ${ZIndex.HIGHLIGHT_EL};
690
696
  `;
691
697
  this.operationEl.id = `${prefix}${el.id}`;
692
698
  if (typeof this.core.config.updateDragEl === "function") {