@famibee/skynovel 1.29.1 → 1.29.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/app.js CHANGED
@@ -772,27 +772,27 @@ function addStyle(style) {
772
772
  gs.innerHTML = css_key4del + style;
773
773
  document.getElementsByTagName("head")[0].appendChild(gs);
774
774
  }
775
- function argChk_Num(hash2, name, def) {
776
- const v2 = hash2[name];
777
- if (!(name in hash2)) {
775
+ function argChk_Num(hash2, name2, def) {
776
+ const v2 = hash2[name2];
777
+ if (!(name2 in hash2)) {
778
778
  if (isNaN(def))
779
- throw `[${hash2[":\u30BF\u30B0\u540D"]}]\u5C5E\u6027 ${name} \u306F\u5FC5\u9808\u3067\u3059`;
780
- hash2[name] = def;
779
+ throw `[${hash2[":\u30BF\u30B0\u540D"]}]\u5C5E\u6027 ${name2} \u306F\u5FC5\u9808\u3067\u3059`;
780
+ hash2[name2] = def;
781
781
  return def;
782
782
  }
783
783
  const n = String(v2).slice(0, 2) === "0x" ? parseInt(v2) : parseFloat(v2);
784
784
  if (isNaN(n))
785
- throw `[${hash2[":\u30BF\u30B0\u540D"]}]\u5C5E\u6027 ${name} \u306E\u5024\u3010${v2}\u3011\u304C\u6570\u5024\u3067\u306F\u3042\u308A\u307E\u305B\u3093`;
786
- return hash2[name] = n;
785
+ throw `[${hash2[":\u30BF\u30B0\u540D"]}]\u5C5E\u6027 ${name2} \u306E\u5024\u3010${v2}\u3011\u304C\u6570\u5024\u3067\u306F\u3042\u308A\u307E\u305B\u3093`;
786
+ return hash2[name2] = n;
787
787
  }
788
- function argChk_Boolean(hash2, name, def) {
789
- if (!(name in hash2))
790
- return hash2[name] = def;
791
- const v2 = hash2[name];
788
+ function argChk_Boolean(hash2, name2, def) {
789
+ if (!(name2 in hash2))
790
+ return hash2[name2] = def;
791
+ const v2 = hash2[name2];
792
792
  if (v2 === null)
793
793
  return false;
794
794
  const v22 = String(v2);
795
- return hash2[name] = v22 === "false" ? false : Boolean(v22);
795
+ return hash2[name2] = v22 === "false" ? false : Boolean(v22);
796
796
  }
797
797
  function parseColor(v2) {
798
798
  if (v2.charAt(0) === "#")
@@ -808,11 +808,11 @@ function parseColor(v2) {
808
808
  throw `\u8272\u540D\u524D ${v2} \u304C\u7570\u5E38\u3067\u3059`;
809
809
  return parseInt(cc.slice(1), 16);
810
810
  }
811
- function argChk_Color(hash2, name, def) {
812
- const v2 = hash2[name];
811
+ function argChk_Color(hash2, name2, def) {
812
+ const v2 = hash2[name2];
813
813
  if (!v2)
814
- return hash2[name] = def;
815
- return hash2[name] = parseColor(String(v2));
814
+ return hash2[name2] = def;
815
+ return hash2[name2] = parseColor(String(v2));
816
816
  }
817
817
  const REG_FN = /^[^\/\.]+$|[^\/]+(?=\.)/;
818
818
  function getFn(p) {
@@ -829,10 +829,10 @@ class CmnLib {
829
829
  CmnLib.stageW = 0;
830
830
  CmnLib.stageH = 0;
831
831
  CmnLib.debugLog = false;
832
- CmnLib.isSafari = platform.name === "Safari";
833
- CmnLib.isFirefox = platform.name === "Firefox";
834
- CmnLib.isMac = new RegExp("OS X").test((_b2 = (_a2 = platform.os) == null ? void 0 : _a2.family) != null ? _b2 : "");
835
- CmnLib.isMobile = !new RegExp("(Windows|OS X)").test((_d = (_c2 = platform.os) == null ? void 0 : _c2.family) != null ? _d : "");
832
+ CmnLib.isSafari = platform$1.exports.name === "Safari";
833
+ CmnLib.isFirefox = platform$1.exports.name === "Firefox";
834
+ CmnLib.isMac = new RegExp("OS X").test((_b2 = (_a2 = platform$1.exports.os) == null ? void 0 : _a2.family) != null ? _b2 : "");
835
+ CmnLib.isMobile = !new RegExp("(Windows|OS X)").test((_d = (_c2 = platform$1.exports.os) == null ? void 0 : _c2.family) != null ? _d : "");
836
836
  CmnLib.hDip = {};
837
837
  CmnLib.isDbg = false;
838
838
  CmnLib.isPackaged = false;
@@ -9567,8 +9567,8 @@ function __extends$q(d2, b2) {
9567
9567
  }
9568
9568
  d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
9569
9569
  }
9570
- var __assign$7 = function() {
9571
- __assign$7 = Object.assign || function __assign2(t) {
9570
+ var __assign$8 = function() {
9571
+ __assign$8 = Object.assign || function __assign2(t) {
9572
9572
  var arguments$1 = arguments;
9573
9573
  for (var s2, i2 = 1, n = arguments.length; i2 < n; i2++) {
9574
9574
  s2 = arguments$1[i2];
@@ -9580,7 +9580,7 @@ var __assign$7 = function() {
9580
9580
  }
9581
9581
  return t;
9582
9582
  };
9583
- return __assign$7.apply(this, arguments);
9583
+ return __assign$8.apply(this, arguments);
9584
9584
  };
9585
9585
  function __rest$3(s2, e) {
9586
9586
  var t = {};
@@ -15239,7 +15239,7 @@ var AbstractRenderer = function(_super) {
15239
15239
  if (region.height === 0) {
15240
15240
  region.height = 1;
15241
15241
  }
15242
- var renderTexture = RenderTexture.create(__assign$7({ width: region.width, height: region.height }, textureOptions));
15242
+ var renderTexture = RenderTexture.create(__assign$8({ width: region.width, height: region.height }, textureOptions));
15243
15243
  tempMatrix$2.tx = -region.x;
15244
15244
  tempMatrix$2.ty = -region.y;
15245
15245
  this.render(displayObject, {
@@ -18310,7 +18310,6 @@ function allSettled(arr) {
18310
18310
  });
18311
18311
  }
18312
18312
  var setTimeoutFunc = setTimeout;
18313
- var setImmediateFunc = typeof setImmediate !== "undefined" ? setImmediate : null;
18314
18313
  function isArray$1(x) {
18315
18314
  return Boolean(x && typeof x.length !== "undefined");
18316
18315
  }
@@ -18490,8 +18489,8 @@ Promise$1.race = function(arr) {
18490
18489
  }
18491
18490
  });
18492
18491
  };
18493
- Promise$1._immediateFn = typeof setImmediateFunc === "function" && function(fn) {
18494
- setImmediateFunc(fn);
18492
+ Promise$1._immediateFn = typeof setImmediate === "function" && function(fn) {
18493
+ setImmediate(fn);
18495
18494
  } || function(fn) {
18496
18495
  setTimeoutFunc(fn, 0);
18497
18496
  };
@@ -32307,6 +32306,7 @@ var OBJECT = "object";
32307
32306
  var STRING = "string";
32308
32307
  var NUMBER = "number";
32309
32308
  var UNDEFINED = "undefined";
32309
+ var IS_WINDOW = typeof window !== UNDEFINED;
32310
32310
  var OPEN_CLOSED_CHARACTERS = [{
32311
32311
  open: "(",
32312
32312
  close: ")"
@@ -32586,6 +32586,23 @@ function find$1(arr, callback, defalutValue) {
32586
32586
  var index = findIndex(arr, callback);
32587
32587
  return index > -1 ? arr[index] : defalutValue;
32588
32588
  }
32589
+ var requestAnimationFrame$1 = /* @__PURE__ */ function() {
32590
+ var firstTime = now();
32591
+ var raf = IS_WINDOW && (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame);
32592
+ return raf ? raf.bind(window) : function(callback) {
32593
+ var currTime = now();
32594
+ var id = window.setTimeout(function() {
32595
+ callback(currTime - firstTime);
32596
+ }, 1e3 / 60);
32597
+ return id;
32598
+ };
32599
+ }();
32600
+ var cancelAnimationFrame$1 = /* @__PURE__ */ function() {
32601
+ var caf = IS_WINDOW && (window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame);
32602
+ return caf ? caf.bind(window) : function(handle2) {
32603
+ clearTimeout(handle2);
32604
+ };
32605
+ }();
32589
32606
  function getKeys(obj) {
32590
32607
  if (Object.keys) {
32591
32608
  return Object.keys(obj);
@@ -32753,8 +32770,8 @@ function __extends$6(d2, b2) {
32753
32770
  }
32754
32771
  d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
32755
32772
  }
32756
- var __assign$6 = function() {
32757
- __assign$6 = Object.assign || function __assign2(t) {
32773
+ var __assign$7 = function() {
32774
+ __assign$7 = Object.assign || function __assign2(t) {
32758
32775
  for (var s2, i2 = 1, n = arguments.length; i2 < n; i2++) {
32759
32776
  s2 = arguments[i2];
32760
32777
  for (var p in s2)
@@ -32763,7 +32780,7 @@ var __assign$6 = function() {
32763
32780
  }
32764
32781
  return t;
32765
32782
  };
32766
- return __assign$6.apply(this, arguments);
32783
+ return __assign$7.apply(this, arguments);
32767
32784
  };
32768
32785
  function __rest$2(s2, e) {
32769
32786
  var t = {};
@@ -32777,7 +32794,7 @@ function __rest$2(s2, e) {
32777
32794
  }
32778
32795
  return t;
32779
32796
  }
32780
- function __spreadArrays$4() {
32797
+ function __spreadArrays$3() {
32781
32798
  for (var s2 = 0, i2 = 0, il = arguments.length; i2 < il; i2++)
32782
32799
  s2 += arguments[i2].length;
32783
32800
  for (var r2 = Array(s2), k = 0, i2 = 0; i2 < il; i2++)
@@ -32887,7 +32904,7 @@ function createElement(type, props) {
32887
32904
  type,
32888
32905
  key,
32889
32906
  ref: ref2,
32890
- props: __assign$6(__assign$6({}, otherProps), {
32907
+ props: __assign$7(__assign$7({}, otherProps), {
32891
32908
  children: flat$1(children).filter(function(child) {
32892
32909
  return child != null && child !== false;
32893
32910
  })
@@ -33256,7 +33273,7 @@ var Component = /* @__PURE__ */ function() {
33256
33273
  }
33257
33274
  clearTimeout(this.$_timer);
33258
33275
  this.$_timer = 0;
33259
- this.$_state = __assign$6(__assign$6({}, this.$_state), state);
33276
+ this.$_state = __assign$7(__assign$7({}, this.$_state), state);
33260
33277
  if (!isForceUpdate) {
33261
33278
  this.$_timer = setTimeout(function() {
33262
33279
  _this.$_timer = 0;
@@ -33279,7 +33296,7 @@ var Component = /* @__PURE__ */ function() {
33279
33296
  __proto.$_setState = function(callback, isForceUpdate) {
33280
33297
  var hooks = [];
33281
33298
  var provider = this.$_provider;
33282
- var isUpdate = renderProviders(provider.container, [provider], [provider.original], hooks, __assign$6(__assign$6({}, this.state), this.$_state), isForceUpdate);
33299
+ var isUpdate = renderProviders(provider.container, [provider], [provider.original], hooks, __assign$7(__assign$7({}, this.state), this.$_state), isForceUpdate);
33283
33300
  if (isUpdate) {
33284
33301
  if (callback) {
33285
33302
  hooks.push(callback);
@@ -33379,7 +33396,7 @@ function diffProviders(containerProvider, providers, children) {
33379
33396
  childProvider.index = to;
33380
33397
  return false;
33381
33398
  });
33382
- return __spreadArrays$4(result.added, changed.map(function(_a3) {
33399
+ return __spreadArrays$3(result.added, changed.map(function(_a3) {
33383
33400
  _a3[0];
33384
33401
  var to = _a3[1];
33385
33402
  return to;
@@ -34185,7 +34202,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
34185
34202
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
34186
34203
  PERFORMANCE OF THIS SOFTWARE.
34187
34204
  ***************************************************************************** */
34188
- function __spreadArrays$3() {
34205
+ function __spreadArrays$2() {
34189
34206
  for (var s2 = 0, i2 = 0, il = arguments.length; i2 < il; i2++)
34190
34207
  s2 += arguments[i2].length;
34191
34208
  for (var r2 = Array(s2), k = 0, i2 = 0; i2 < il; i2++)
@@ -34370,7 +34387,7 @@ function getPointsOnLines(points, lines) {
34370
34387
  });
34371
34388
  }
34372
34389
  function convertLines(points) {
34373
- return __spreadArrays$3(points.slice(1), [points[0]]).map(function(point, i2) {
34390
+ return __spreadArrays$2(points.slice(1), [points[0]]).map(function(point, i2) {
34374
34391
  return [points[i2], point];
34375
34392
  });
34376
34393
  }
@@ -34493,8 +34510,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
34493
34510
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
34494
34511
  PERFORMANCE OF THIS SOFTWARE.
34495
34512
  ***************************************************************************** */
34496
- var __assign$5 = function() {
34497
- __assign$5 = Object.assign || function __assign2(t) {
34513
+ var __assign$6 = function() {
34514
+ __assign$6 = Object.assign || function __assign2(t) {
34498
34515
  for (var s2, i2 = 1, n = arguments.length; i2 < n; i2++) {
34499
34516
  s2 = arguments[i2];
34500
34517
  for (var p in s2)
@@ -34503,9 +34520,9 @@ var __assign$5 = function() {
34503
34520
  }
34504
34521
  return t;
34505
34522
  };
34506
- return __assign$5.apply(this, arguments);
34523
+ return __assign$6.apply(this, arguments);
34507
34524
  };
34508
- function __spreadArrays$2() {
34525
+ function __spreadArrays$1() {
34509
34526
  for (var s2 = 0, i2 = 0, il = arguments.length; i2 < il; i2++)
34510
34527
  s2 += arguments[i2].length;
34511
34528
  for (var r2 = Array(s2), k = 0, i2 = 0; i2 < il; i2++)
@@ -34578,7 +34595,7 @@ var EventEmitter$1 = /* @__PURE__ */ function() {
34578
34595
  isStop = true;
34579
34596
  };
34580
34597
  param.currentTarget = this;
34581
- __spreadArrays$2(events).forEach(function(info) {
34598
+ __spreadArrays$1(events).forEach(function(info) {
34582
34599
  info.listener(param);
34583
34600
  if (info.once) {
34584
34601
  _this.off(eventName, info.listener);
@@ -34596,7 +34613,7 @@ var EventEmitter$1 = /* @__PURE__ */ function() {
34596
34613
  var events = this._events;
34597
34614
  events[eventName] = events[eventName] || [];
34598
34615
  var listeners = events[eventName];
34599
- listeners.push(__assign$5({
34616
+ listeners.push(__assign$6({
34600
34617
  listener
34601
34618
  }, options));
34602
34619
  };
@@ -34636,6 +34653,18 @@ function __extends$4(d2, b2) {
34636
34653
  }
34637
34654
  d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
34638
34655
  }
34656
+ var __assign$5 = function() {
34657
+ __assign$5 = Object.assign || function __assign2(t) {
34658
+ for (var s2, i2 = 1, n = arguments.length; i2 < n; i2++) {
34659
+ s2 = arguments[i2];
34660
+ for (var p in s2)
34661
+ if (Object.prototype.hasOwnProperty.call(s2, p))
34662
+ t[p] = s2[p];
34663
+ }
34664
+ return t;
34665
+ };
34666
+ return __assign$5.apply(this, arguments);
34667
+ };
34639
34668
  function getDefaultScrollPosition$1(e) {
34640
34669
  var container = e.container;
34641
34670
  if (container === document.body) {
@@ -34647,10 +34676,12 @@ var DragScroll = /* @__PURE__ */ function(_super) {
34647
34676
  __extends$4(DragScroll2, _super);
34648
34677
  function DragScroll2() {
34649
34678
  var _this = _super !== null && _super.apply(this, arguments) || this;
34650
- _this.startRect = null;
34651
- _this.startPos = [];
34652
- _this.prevTime = 0;
34653
- _this.timer = 0;
34679
+ _this._startRect = null;
34680
+ _this._startPos = [];
34681
+ _this._prevTime = 0;
34682
+ _this._timer = 0;
34683
+ _this._prevScrollPos = [0, 0];
34684
+ _this._isWait = false;
34654
34685
  return _this;
34655
34686
  }
34656
34687
  var __proto = DragScroll2.prototype;
@@ -34670,83 +34701,115 @@ var DragScroll = /* @__PURE__ */ function(_super) {
34670
34701
  width = rect.width;
34671
34702
  height = rect.height;
34672
34703
  }
34673
- this.startPos = [e.clientX, e.clientY];
34674
- this.startRect = {
34704
+ this._startPos = [e.clientX, e.clientY];
34705
+ this._startRect = {
34675
34706
  top,
34676
34707
  left,
34677
34708
  width,
34678
34709
  height
34679
34710
  };
34711
+ this._prevScrollPos = this._getScrollPosition([0, 0], options);
34680
34712
  };
34681
34713
  __proto.drag = function(e, options) {
34682
- var _this = this;
34683
34714
  var clientX = e.clientX, clientY = e.clientY;
34684
- var container = options.container, _a3 = options.threshold, threshold = _a3 === void 0 ? 0 : _a3, _b3 = options.throttleTime, throttleTime = _b3 === void 0 ? 0 : _b3, _c3 = options.getScrollPosition, getScrollPosition = _c3 === void 0 ? getDefaultScrollPosition$1 : _c3;
34685
- var _d2 = this, startRect = _d2.startRect, startPos = _d2.startPos;
34686
- var nowTime = now();
34687
- var distTime = Math.max(throttleTime + this.prevTime - nowTime, 0);
34715
+ var _a3 = options.threshold, threshold = _a3 === void 0 ? 0 : _a3;
34716
+ var _b3 = this, _startRect = _b3._startRect, _startPos = _b3._startPos;
34688
34717
  var direction = [0, 0];
34689
- if (startRect.top > clientY - threshold) {
34690
- if (startPos[1] > startRect.top || clientY < startPos[1]) {
34718
+ if (_startRect.top > clientY - threshold) {
34719
+ if (_startPos[1] > _startRect.top || clientY < _startPos[1]) {
34691
34720
  direction[1] = -1;
34692
34721
  }
34693
- } else if (startRect.top + startRect.height < clientY + threshold) {
34694
- if (startPos[1] < startRect.top + startRect.height || clientY > startPos[1]) {
34722
+ } else if (_startRect.top + _startRect.height < clientY + threshold) {
34723
+ if (_startPos[1] < _startRect.top + _startRect.height || clientY > _startPos[1]) {
34695
34724
  direction[1] = 1;
34696
34725
  }
34697
34726
  }
34698
- if (startRect.left > clientX - threshold) {
34699
- if (startPos[0] > startRect.left || clientX < startPos[0]) {
34727
+ if (_startRect.left > clientX - threshold) {
34728
+ if (_startPos[0] > _startRect.left || clientX < _startPos[0]) {
34700
34729
  direction[0] = -1;
34701
34730
  }
34702
- } else if (startRect.left + startRect.width < clientX + threshold) {
34703
- if (startPos[0] < startRect.left + startRect.width || clientX > startPos[0]) {
34731
+ } else if (_startRect.left + _startRect.width < clientX + threshold) {
34732
+ if (_startPos[0] < _startRect.left + _startRect.width || clientX > _startPos[0]) {
34704
34733
  direction[0] = 1;
34705
34734
  }
34706
34735
  }
34707
- clearTimeout(this.timer);
34736
+ clearTimeout(this._timer);
34708
34737
  if (!direction[0] && !direction[1]) {
34709
34738
  return false;
34710
34739
  }
34711
- if (distTime > 0) {
34712
- this.timer = window.setTimeout(function() {
34713
- _this.drag(e, options);
34714
- }, distTime);
34740
+ return this._continueDrag(__assign$5(__assign$5({}, options), {
34741
+ direction,
34742
+ inputEvent: e,
34743
+ isDrag: true
34744
+ }));
34745
+ };
34746
+ __proto.checkScroll = function(options) {
34747
+ var _this = this;
34748
+ if (this._isWait) {
34715
34749
  return false;
34716
34750
  }
34717
- this.prevTime = nowTime;
34718
- var prevPos = getScrollPosition({
34719
- container,
34720
- direction
34721
- });
34722
- this.trigger("scroll", {
34723
- container,
34724
- direction,
34725
- inputEvent: e
34726
- });
34727
- var nextPos = getScrollPosition({
34728
- container,
34729
- direction
34730
- });
34731
- var offsetX = nextPos[0] - prevPos[0];
34732
- var offsetY = nextPos[1] - prevPos[1];
34751
+ var _a3 = options.prevScrollPos, prevScrollPos = _a3 === void 0 ? this._prevScrollPos : _a3, direction = options.direction, _b3 = options.throttleTime, throttleTime = _b3 === void 0 ? 0 : _b3, inputEvent = options.inputEvent, isDrag = options.isDrag;
34752
+ var nextScrollPos = this._getScrollPosition(direction || [0, 0], options);
34753
+ var offsetX = nextScrollPos[0] - prevScrollPos[0];
34754
+ var offsetY = nextScrollPos[1] - prevScrollPos[1];
34755
+ var nextDirection = direction || [offsetX ? Math.abs(offsetX) / offsetX : 0, offsetY ? Math.abs(offsetY) / offsetY : 0];
34756
+ this._prevScrollPos = nextScrollPos;
34733
34757
  if (!offsetX && !offsetY) {
34734
34758
  return false;
34735
34759
  }
34736
34760
  this.trigger("move", {
34737
- offsetX: direction[0] ? offsetX : 0,
34738
- offsetY: direction[1] ? offsetY : 0,
34739
- inputEvent: e
34761
+ offsetX: nextDirection[0] ? offsetX : 0,
34762
+ offsetY: nextDirection[1] ? offsetY : 0,
34763
+ inputEvent
34740
34764
  });
34741
- if (throttleTime) {
34742
- this.timer = window.setTimeout(function() {
34743
- _this.drag(e, options);
34765
+ if (throttleTime && isDrag) {
34766
+ this._timer = window.setTimeout(function() {
34767
+ _this._continueDrag(options);
34744
34768
  }, throttleTime);
34745
34769
  }
34746
34770
  return true;
34747
34771
  };
34748
34772
  __proto.dragEnd = function() {
34749
- clearTimeout(this.timer);
34773
+ clearTimeout(this._timer);
34774
+ };
34775
+ __proto._getScrollPosition = function(direction, options) {
34776
+ var container = options.container, _a3 = options.getScrollPosition, getScrollPosition = _a3 === void 0 ? getDefaultScrollPosition$1 : _a3;
34777
+ return getScrollPosition({
34778
+ container,
34779
+ direction
34780
+ });
34781
+ };
34782
+ __proto._continueDrag = function(options) {
34783
+ var _this = this;
34784
+ var container = options.container, direction = options.direction, throttleTime = options.throttleTime, useScroll = options.useScroll, isDrag = options.isDrag, inputEvent = options.inputEvent;
34785
+ if (isDrag && this._isWait) {
34786
+ return;
34787
+ }
34788
+ var nowTime = now();
34789
+ var distTime = Math.max(throttleTime + this._prevTime - nowTime, 0);
34790
+ if (distTime > 0) {
34791
+ this._timer = window.setTimeout(function() {
34792
+ _this._continueDrag(options);
34793
+ }, distTime);
34794
+ return false;
34795
+ }
34796
+ this._prevTime = nowTime;
34797
+ var prevScrollPos = this._getScrollPosition(direction, options);
34798
+ this._prevScrollPos = prevScrollPos;
34799
+ if (isDrag) {
34800
+ this._isWait = true;
34801
+ }
34802
+ this.trigger("scroll", {
34803
+ container,
34804
+ direction,
34805
+ inputEvent
34806
+ });
34807
+ this._isWait = false;
34808
+ return useScroll || this.checkScroll(__assign$5(__assign$5({}, options), {
34809
+ prevScrollPos,
34810
+ direction,
34811
+ inputEvent
34812
+ }));
34750
34813
  };
34751
34814
  return DragScroll2;
34752
34815
  }(EventEmitter$2);
@@ -34888,16 +34951,6 @@ var ClientStore = /* @__PURE__ */ function() {
34888
34951
  this.length = clients.length;
34889
34952
  }
34890
34953
  var __proto = ClientStore2.prototype;
34891
- __proto.addClients = function(clients) {
34892
- if (clients === void 0) {
34893
- clients = this.prevClients;
34894
- }
34895
- var position = this.getPosition(clients);
34896
- var deltaX = position.deltaX, deltaY = position.deltaY;
34897
- this.movement += Math.sqrt(deltaX * deltaX + deltaY * deltaY);
34898
- this.prevClients = clients;
34899
- return position;
34900
- };
34901
34954
  __proto.getAngle = function(clients) {
34902
34955
  if (clients === void 0) {
34903
34956
  clients = this.prevClients;
@@ -34910,8 +34963,15 @@ var ClientStore = /* @__PURE__ */ function() {
34910
34963
  }
34911
34964
  return getRotatiion(clients) - getRotatiion(this.startClients);
34912
34965
  };
34913
- __proto.getPosition = function(clients) {
34914
- return getPosition(clients || this.prevClients, this.prevClients, this.startClients);
34966
+ __proto.getPosition = function(clients, isAdd) {
34967
+ if (clients === void 0) {
34968
+ clients = this.prevClients;
34969
+ }
34970
+ var position = getPosition(clients || this.prevClients, this.prevClients, this.startClients);
34971
+ var deltaX = position.deltaX, deltaY = position.deltaY;
34972
+ this.movement += Math.sqrt(deltaX * deltaX + deltaY * deltaY);
34973
+ this.prevClients = clients;
34974
+ return position;
34915
34975
  };
34916
34976
  __proto.getPositions = function(clients) {
34917
34977
  if (clients === void 0) {
@@ -34950,10 +35010,6 @@ var ClientStore = /* @__PURE__ */ function() {
34950
35010
  client.clientX -= deltaX;
34951
35011
  client.clientY -= deltaY;
34952
35012
  });
34953
- this.prevClients.forEach(function(client) {
34954
- client.clientX -= deltaX;
34955
- client.clientY -= deltaY;
34956
- });
34957
35013
  };
34958
35014
  return ClientStore2;
34959
35015
  }();
@@ -34977,6 +35033,7 @@ var Gesto = /* @__PURE__ */ function(_super) {
34977
35033
  _this.targets = [];
34978
35034
  _this.prevTime = 0;
34979
35035
  _this.doubleFlag = false;
35036
+ _this._dragFlag = false;
34980
35037
  _this.onDragStart = function(e, isTrusted) {
34981
35038
  if (isTrusted === void 0) {
34982
35039
  isTrusted = true;
@@ -35009,6 +35066,7 @@ var Gesto = /* @__PURE__ */ function(_super) {
35009
35066
  _this.clientStores = [new ClientStore(getEventClients(e))];
35010
35067
  _this.flag = true;
35011
35068
  _this.isDrag = false;
35069
+ _this._dragFlag = true;
35012
35070
  _this.datas = {};
35013
35071
  if (preventRightClick && (e.which === 3 || e.button === 2)) {
35014
35072
  _this.initDrag();
@@ -35020,7 +35078,14 @@ var Gesto = /* @__PURE__ */ function(_super) {
35020
35078
  inputEvent: e,
35021
35079
  isTrusted,
35022
35080
  isDouble: _this.doubleFlag
35023
- }, _this.getCurrentStore().getPosition()));
35081
+ }, _this.getCurrentStore().getPosition(), {
35082
+ preventDefault: function() {
35083
+ e.preventDefault();
35084
+ },
35085
+ preventDrag: function() {
35086
+ _this._dragFlag = false;
35087
+ }
35088
+ }));
35024
35089
  if (result === false) {
35025
35090
  _this.initDrag();
35026
35091
  }
@@ -35056,20 +35121,22 @@ var Gesto = /* @__PURE__ */ function(_super) {
35056
35121
  }
35057
35122
  var clients = getEventClients(e);
35058
35123
  var result = _this.moveClients(clients, e, false);
35059
- if (_this.pinchFlag || result.deltaX || result.deltaY) {
35060
- var dragResult = _this.emit("drag", __assign$4({}, result, {
35061
- isScroll: !!isScroll,
35062
- inputEvent: e
35063
- }));
35064
- if (dragResult === false) {
35065
- _this.stop();
35066
- return;
35124
+ if (_this._dragFlag) {
35125
+ if (_this.pinchFlag || result.deltaX || result.deltaY) {
35126
+ var dragResult = _this.emit("drag", __assign$4({}, result, {
35127
+ isScroll: !!isScroll,
35128
+ inputEvent: e
35129
+ }));
35130
+ if (dragResult === false) {
35131
+ _this.stop();
35132
+ return;
35133
+ }
35134
+ }
35135
+ if (_this.pinchFlag) {
35136
+ _this.onPinch(e, clients);
35067
35137
  }
35068
35138
  }
35069
- if (_this.pinchFlag) {
35070
- _this.onPinch(e, clients);
35071
- }
35072
- _this.getCurrentStore().addClients(clients);
35139
+ _this.getCurrentStore().getPosition(clients, true);
35073
35140
  };
35074
35141
  _this.onDragEnd = function(e) {
35075
35142
  if (!_this.flag) {
@@ -35080,7 +35147,7 @@ var Gesto = /* @__PURE__ */ function(_super) {
35080
35147
  removeEvent(container2, "touchstart", _this.onDragStart);
35081
35148
  }
35082
35149
  _this.flag = false;
35083
- var position = _this.getCurrentStore().getPosition();
35150
+ var position = _this._getPosition();
35084
35151
  var currentTime = now();
35085
35152
  var isDouble = !_this.isDrag && _this.doubleFlag;
35086
35153
  _this.prevTime = _this.isDrag || isDouble ? 0 : currentTime;
@@ -35198,6 +35265,17 @@ var Gesto = /* @__PURE__ */ function(_super) {
35198
35265
  }
35199
35266
  return this;
35200
35267
  };
35268
+ __proto.getCurrentEvent = function(inputEvent) {
35269
+ return __assign$4({
35270
+ datas: this.datas
35271
+ }, this._getPosition(), {
35272
+ movement: this.getMovement(),
35273
+ isDrag: this.isDrag,
35274
+ isPinch: this.isPinch,
35275
+ isScroll: false,
35276
+ inputEvent
35277
+ });
35278
+ };
35201
35279
  __proto.getEventDatas = function() {
35202
35280
  return this.datas;
35203
35281
  };
@@ -35291,9 +35369,10 @@ var Gesto = /* @__PURE__ */ function(_super) {
35291
35369
  return this.clientStores[0];
35292
35370
  };
35293
35371
  __proto.moveClients = function(clients, inputEvent, isAdd) {
35294
- var store = this.getCurrentStore();
35295
- var position = store[isAdd ? "addClients" : "getPosition"](clients);
35296
- this.isDrag = true;
35372
+ var position = this._getPosition(clients, isAdd);
35373
+ if (position.deltaX || position.deltaY) {
35374
+ this.isDrag = true;
35375
+ }
35297
35376
  return __assign$4({
35298
35377
  datas: this.datas
35299
35378
  }, position, {
@@ -35304,6 +35383,20 @@ var Gesto = /* @__PURE__ */ function(_super) {
35304
35383
  inputEvent
35305
35384
  });
35306
35385
  };
35386
+ __proto._getPosition = function(clients, isAdd) {
35387
+ var store = this.getCurrentStore();
35388
+ var position = store.getPosition(clients, isAdd);
35389
+ var _a3 = this.clientStores.slice(1).reduce(function(prev2, cur) {
35390
+ var storePosition = cur.getPosition();
35391
+ prev2.distX += storePosition.distX;
35392
+ prev2.distY += storePosition.distY;
35393
+ return prev2;
35394
+ }, position), distX = _a3.distX, distY = _a3.distY;
35395
+ return __assign$4({}, position, {
35396
+ distX,
35397
+ distY
35398
+ });
35399
+ };
35307
35400
  return Gesto2;
35308
35401
  }(EventEmitter$2);
35309
35402
  var Gesto$1 = Gesto;
@@ -35533,12 +35626,14 @@ var extendStatics$1 = function(d2, b2) {
35533
35626
  d3.__proto__ = b3;
35534
35627
  } || function(d3, b3) {
35535
35628
  for (var p in b3)
35536
- if (b3.hasOwnProperty(p))
35629
+ if (Object.prototype.hasOwnProperty.call(b3, p))
35537
35630
  d3[p] = b3[p];
35538
35631
  };
35539
35632
  return extendStatics$1(d2, b2);
35540
35633
  };
35541
35634
  function __extends$1(d2, b2) {
35635
+ if (typeof b2 !== "function" && b2 !== null)
35636
+ throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
35542
35637
  extendStatics$1(d2, b2);
35543
35638
  function __() {
35544
35639
  this.constructor = d2;
@@ -35579,13 +35674,16 @@ function __decorate$1(decorators, target, key, desc) {
35579
35674
  r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2;
35580
35675
  return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
35581
35676
  }
35582
- function __spreadArrays$1() {
35583
- for (var s2 = 0, i2 = 0, il = arguments.length; i2 < il; i2++)
35584
- s2 += arguments[i2].length;
35585
- for (var r2 = Array(s2), k = 0, i2 = 0; i2 < il; i2++)
35586
- for (var a2 = arguments[i2], j2 = 0, jl = a2.length; j2 < jl; j2++, k++)
35587
- r2[k] = a2[j2];
35588
- return r2;
35677
+ function __spreadArray(to, from, pack) {
35678
+ if (pack || arguments.length === 2)
35679
+ for (var i2 = 0, l2 = from.length, ar; i2 < l2; i2++) {
35680
+ if (ar || !(i2 in from)) {
35681
+ if (!ar)
35682
+ ar = Array.prototype.slice.call(from, 0, i2);
35683
+ ar[i2] = from[i2];
35684
+ }
35685
+ }
35686
+ return to.concat(ar || Array.prototype.slice.call(from));
35589
35687
  }
35590
35688
  function makeAble(name, able) {
35591
35689
  var _a3;
@@ -35600,7 +35698,6 @@ function getSVGCursor(scale, degree) {
35600
35698
  }
35601
35699
  function getCursorCSS(degree) {
35602
35700
  var x1 = getSVGCursor(1, degree);
35603
- var x2 = getSVGCursor(2, degree);
35604
35701
  var degree45 = Math.round(degree / 45) * 45 % 180;
35605
35702
  var defaultCursor = "ns-resize";
35606
35703
  if (degree45 === 135) {
@@ -35610,7 +35707,7 @@ function getCursorCSS(degree) {
35610
35707
  } else if (degree45 === 90) {
35611
35708
  defaultCursor = "ew-resize";
35612
35709
  }
35613
- return "cursor:" + defaultCursor + ";cursor: url('" + x1 + "') 16 16, " + defaultCursor + ";cursor: -webkit-image-set(url('" + x1 + "') 1x, url('" + x2 + "') 2x) 16 16, " + defaultCursor + ";";
35710
+ return "cursor:" + defaultCursor + ";cursor: url('" + x1 + "') 16 16, " + defaultCursor + ";";
35614
35711
  }
35615
35712
  var agent = agent$1();
35616
35713
  var IS_WEBKIT = agent.browser.webkit;
@@ -35652,7 +35749,7 @@ var DIRECTION_ROTATIONS = {
35652
35749
  sw: 225,
35653
35750
  se: 135
35654
35751
  };
35655
- var MOVEABLE_METHODS = ["isMoveableElement", "updateRect", "updateTarget", "destroy", "dragStart", "isInside", "hitTest", "setState", "getRect", "request", "isDragging", "getManager"];
35752
+ var MOVEABLE_METHODS = ["isMoveableElement", "updateRect", "updateTarget", "destroy", "dragStart", "isInside", "hitTest", "setState", "getRect", "request", "isDragging", "getManager", "forceUpdate"];
35656
35753
  function multiply2(pos1, pos2) {
35657
35754
  return [pos1[0] * pos2[0], pos1[1] * pos2[1]];
35658
35755
  }
@@ -35661,7 +35758,7 @@ function prefix() {
35661
35758
  for (var _i = 0; _i < arguments.length; _i++) {
35662
35759
  classNames[_i] = arguments[_i];
35663
35760
  }
35664
- return prefixNames.apply(void 0, __spreadArrays$1([PREFIX], classNames));
35761
+ return prefixNames.apply(void 0, __spreadArray([PREFIX], classNames));
35665
35762
  }
35666
35763
  function getTransformMatrix(transform) {
35667
35764
  if (!transform || transform === "none") {
@@ -35956,11 +36053,12 @@ function calculateElementInfo(target, container, rootContainer, isAbsolute3d) {
35956
36053
  }, allResult);
35957
36054
  }
35958
36055
  function calculateMatrixStack(target, container, rootContainer, isAbsolute3d) {
36056
+ var _a3;
35959
36057
  if (rootContainer === void 0) {
35960
36058
  rootContainer = container;
35961
36059
  }
35962
- var _a3 = getMatrixStackInfo(target, container), matrixes = _a3.matrixes, is3d = _a3.is3d, prevTargetMatrix = _a3.targetMatrix, transformOrigin = _a3.transformOrigin, targetOrigin = _a3.targetOrigin, offsetContainer = _a3.offsetContainer;
35963
- var _b3 = getMatrixStackInfo(offsetContainer, rootContainer, true), rootMatrixes = _b3.matrixes, isRoot3d = _b3.is3d;
36060
+ var _b3 = getMatrixStackInfo(target, container), matrixes = _b3.matrixes, is3d = _b3.is3d, prevTargetMatrix = _b3.targetMatrix, transformOrigin = _b3.transformOrigin, targetOrigin = _b3.targetOrigin, offsetContainer = _b3.offsetContainer;
36061
+ var _c3 = getMatrixStackInfo(offsetContainer, rootContainer, true), rootMatrixes = _c3.matrixes, isRoot3d = _c3.is3d;
35964
36062
  var isNext3d = isAbsolute3d || isRoot3d || is3d;
35965
36063
  var n = isNext3d ? 4 : 3;
35966
36064
  var isSVGGraphicElement = target.tagName.toLowerCase() !== "svg" && "ownerSVGElement" in target;
@@ -35970,8 +36068,6 @@ function calculateMatrixStack(target, container, rootContainer, isAbsolute3d) {
35970
36068
  var beforeMatrix = createIdentityMatrix(n);
35971
36069
  var offsetMatrix = createIdentityMatrix(n);
35972
36070
  var length2 = matrixes.length;
35973
- var originalRootContainer = rootContainer || document.body;
35974
- var endContainer = getOffsetInfo(originalRootContainer, originalRootContainer, true).offsetParent;
35975
36071
  rootMatrixes.reverse();
35976
36072
  matrixes.reverse();
35977
36073
  if (!is3d && isNext3d) {
@@ -35984,6 +36080,11 @@ function calculateMatrixStack(target, container, rootContainer, isAbsolute3d) {
35984
36080
  rootMatrixes.forEach(function(info) {
35985
36081
  rootMatrix = multiply(rootMatrix, info.matrix, n);
35986
36082
  });
36083
+ var originalRootContainer = rootContainer || document.body;
36084
+ var endContainer = ((_a3 = rootMatrixes[0]) === null || _a3 === void 0 ? void 0 : _a3.target) || getOffsetInfo(originalRootContainer, originalRootContainer, true).offsetParent;
36085
+ var rootMatrixBeforeOffset = rootMatrixes.slice(1).reduce(function(matrix, info) {
36086
+ return multiply(matrix, info.matrix, n);
36087
+ }, createIdentityMatrix(n));
35987
36088
  matrixes.forEach(function(info, i2) {
35988
36089
  if (length2 - 2 === i2) {
35989
36090
  beforeMatrix = allMatrix.slice();
@@ -35993,7 +36094,7 @@ function calculateMatrixStack(target, container, rootContainer, isAbsolute3d) {
35993
36094
  }
35994
36095
  if (!info.matrix) {
35995
36096
  var nextInfo = matrixes[i2 + 1];
35996
- var offset = getSVGOffset(info, nextInfo, endContainer, n, multiply(rootMatrix, allMatrix, n));
36097
+ var offset = getSVGOffset(info, nextInfo, endContainer, n, multiply(rootMatrixBeforeOffset, allMatrix, n));
35997
36098
  info.matrix = createOriginMatrix(offset, n);
35998
36099
  }
35999
36100
  allMatrix = multiply(allMatrix, info.matrix, n);
@@ -36375,10 +36476,9 @@ function roundSign(num) {
36375
36476
  return Math.round(num % 1 === -0.5 ? num - 1 : num);
36376
36477
  }
36377
36478
  function unset(self2, name) {
36378
- if (self2[name]) {
36379
- self2[name].unset();
36380
- self2[name] = null;
36381
- }
36479
+ var _a3;
36480
+ (_a3 = self2[name]) === null || _a3 === void 0 ? void 0 : _a3.unset();
36481
+ self2[name] = null;
36382
36482
  }
36383
36483
  function fillParams(moveable, e, params) {
36384
36484
  var datas = e.datas;
@@ -36662,7 +36762,7 @@ function getRefTargets(targets, isSelector) {
36662
36762
  var userTargets = isArrayFormat(targets) ? [].slice.call(targets) : [targets];
36663
36763
  return userTargets.reduce(function(prev2, target) {
36664
36764
  if (isString(target) && isSelector) {
36665
- return __spreadArrays$1(prev2, [].slice.call(document.querySelectorAll(target)));
36765
+ return __spreadArray(__spreadArray([], prev2), [].slice.call(document.querySelectorAll(target)));
36666
36766
  }
36667
36767
  prev2.push(getRefTarget(target, isSelector));
36668
36768
  return prev2;
@@ -37013,9 +37113,15 @@ function resolveTransformEvent(event, functionName) {
37013
37113
  var index = datas.transformIndex;
37014
37114
  var nextTransforms = originalDatas.nextTransforms;
37015
37115
  var nextTransformAppendedIndexes = originalDatas.nextTransformAppendedIndexes;
37016
- var nextIndex = index === -1 ? nextTransforms.length : index + nextTransformAppendedIndexes.filter(function(i2) {
37017
- return i2 < index;
37018
- }).length;
37116
+ var nextIndex = 0;
37117
+ if (index === -1) {
37118
+ nextIndex = nextTransforms.length;
37119
+ datas.transformIndex = nextIndex;
37120
+ } else {
37121
+ nextIndex = index + nextTransformAppendedIndexes.filter(function(i2) {
37122
+ return i2 < index;
37123
+ }).length;
37124
+ }
37019
37125
  var result = getTransform(nextTransforms, nextIndex);
37020
37126
  var targetFunction = result.targetFunction;
37021
37127
  var matFunctionName = functionName === "rotate" ? "rotateZ" : functionName;
@@ -37032,7 +37138,7 @@ function resolveTransformEvent(event, functionName) {
37032
37138
  datas.isAppendTransform = false;
37033
37139
  } else {
37034
37140
  datas.isAppendTransform = true;
37035
- originalDatas.nextTransformAppendedIndexes = __spreadArrays$1(nextTransformAppendedIndexes, [nextIndex]);
37141
+ originalDatas.nextTransformAppendedIndexes = __spreadArray(__spreadArray([], nextTransformAppendedIndexes), [nextIndex]);
37036
37142
  }
37037
37143
  }
37038
37144
  function convertTransformFormat(datas, value, dist) {
@@ -37199,6 +37305,10 @@ function fillOriginalTransform(e, transform) {
37199
37305
  var originalDatas = e.originalDatas.beforeRenderable;
37200
37306
  originalDatas.nextTransforms = splitSpace(transform);
37201
37307
  }
37308
+ function getNextTransformText(e) {
37309
+ var originalDatas = e.originalDatas.beforeRenderable;
37310
+ return originalDatas.nextTransforms.join(" ");
37311
+ }
37202
37312
  function fillTransformEvent(moveable, nextTransform, delta, isPinch, e) {
37203
37313
  fillOriginalTransform(e, nextTransform);
37204
37314
  return {
@@ -37571,7 +37681,7 @@ function getTotalGuidelines(moveable) {
37571
37681
  var _a3 = moveable.state, snapOffset = _a3.snapOffset, _b3 = _a3.containerClientRect, overflow = _b3.overflow, containerHeight = _b3.scrollHeight, containerWidth = _b3.scrollWidth, containerClientHeight = _b3.clientHeight, containerClientWidth = _b3.clientWidth, clientLeft = _b3.clientLeft, clientTop = _b3.clientTop;
37572
37682
  var _c3 = moveable.props, _d2 = _c3.snapGap, snapGap = _d2 === void 0 ? true : _d2, verticalGuidelines = _c3.verticalGuidelines, horizontalGuidelines = _c3.horizontalGuidelines, _e = _c3.snapThreshold, snapThreshold = _e === void 0 ? 5 : _e, _f = _c3.snapGridWidth, snapGridWidth = _f === void 0 ? 0 : _f, _g = _c3.snapGridHeight, snapGridHeight = _g === void 0 ? 0 : _g;
37573
37683
  var elementGuidelines = getElementGuidelines(moveable);
37574
- var totalGuidelines = __spreadArrays$1(elementGuidelines);
37684
+ var totalGuidelines = __spreadArray([], elementGuidelines);
37575
37685
  if (snapGap) {
37576
37686
  var _h = getRect(getAbsolutePosesByState(moveable.state)), top = _h.top, left = _h.left, bottom = _h.bottom, right = _h.right;
37577
37687
  totalGuidelines.push.apply(totalGuidelines, getGapGuidelines(moveable, {
@@ -38130,7 +38240,7 @@ function isBoundRotate(relativePoses, boundDots, center, rad) {
38130
38240
  var nextPoses = rad ? relativePoses.map(function(pos) {
38131
38241
  return rotate(pos, rad);
38132
38242
  }) : relativePoses;
38133
- var dots = __spreadArrays$1([center], boundDots);
38243
+ var dots = __spreadArray([center], boundDots);
38134
38244
  return [[nextPoses[0], nextPoses[1]], [nextPoses[1], nextPoses[3]], [nextPoses[3], nextPoses[2]], [nextPoses[2], nextPoses[0]]].some(function(line) {
38135
38245
  return !isSameStartLine(dots, line);
38136
38246
  });
@@ -38482,7 +38592,7 @@ function renderGuideline(info, React) {
38482
38592
  }
38483
38593
  function renderInnerGuideline(info, React) {
38484
38594
  return renderGuideline(__assign$2(__assign$2({}, info), {
38485
- classNames: __spreadArrays$1([prefix("line", "guideline", info.direction)], info.classNames).filter(function(className) {
38595
+ classNames: __spreadArray([prefix("line", "guideline", info.direction)], info.classNames).filter(function(className) {
38486
38596
  return className;
38487
38597
  }),
38488
38598
  size: info.size || info.sizeValue + "px",
@@ -38706,11 +38816,11 @@ function renderGapGuidelines(moveable, guidelines, targetPos, targetRect, React)
38706
38816
  var targetSideEnd = targetRect[sideNames.end];
38707
38817
  nextGuidelines.forEach(function(_a3) {
38708
38818
  var gap = _a3.gap, gapRects = _a3.gapRects, className = _a3.className;
38709
- var sideStartPos = Math.max.apply(Math, __spreadArrays$1([targetSideStart], gapRects.map(function(_a4) {
38819
+ var sideStartPos = Math.max.apply(Math, __spreadArray([targetSideStart], gapRects.map(function(_a4) {
38710
38820
  var rect = _a4.rect;
38711
38821
  return rect[sideNames.start];
38712
38822
  })));
38713
- var sideEndPos = Math.min.apply(Math, __spreadArrays$1([targetSideEnd], gapRects.map(function(_a4) {
38823
+ var sideEndPos = Math.min.apply(Math, __spreadArray([targetSideEnd], gapRects.map(function(_a4) {
38714
38824
  var rect = _a4.rect;
38715
38825
  return rect[sideNames.end];
38716
38826
  })));
@@ -39144,7 +39254,7 @@ function getNextFixedPoses(matrix, width, height, fixedPos, direction, is3d) {
39144
39254
  function getSizeOffsetInfo(moveable, poses, direction, keepRatio, isRequest, datas) {
39145
39255
  var directions = getCheckSnapDirections(direction, keepRatio);
39146
39256
  var lines = getCheckInnerBoundLines(poses, direction, keepRatio);
39147
- var offsets = __spreadArrays$1(getSnapBoundInfo(moveable, poses, directions, keepRatio, isRequest, datas), getInnerBoundInfo(moveable, lines, getPosByDirection(poses, [0, 0]), datas));
39257
+ var offsets = __spreadArray(__spreadArray([], getSnapBoundInfo(moveable, poses, directions, keepRatio, isRequest, datas)), getInnerBoundInfo(moveable, lines, getPosByDirection(poses, [0, 0]), datas));
39148
39258
  var widthOffsetInfo = getNearOffsetInfo(offsets, 0);
39149
39259
  var heightOffsetInfo = getNearOffsetInfo(offsets, 1);
39150
39260
  return {
@@ -39236,7 +39346,7 @@ function checkSnapRotate(moveable, rect, origin, rotation) {
39236
39346
  var nextPoses = prevPoses.map(function(pos) {
39237
39347
  return rotate(pos, rad);
39238
39348
  });
39239
- var result = __spreadArrays$1(checkRotateBounds(moveable, prevPoses, nextPoses, origin, rotation), checkRotateInnerBounds(moveable, prevPoses, nextPoses, origin, rotation));
39349
+ var result = __spreadArray(__spreadArray([], checkRotateBounds(moveable, prevPoses, nextPoses, origin, rotation)), checkRotateInnerBounds(moveable, prevPoses, nextPoses, origin, rotation));
39240
39350
  result.sort(function(a2, b2) {
39241
39351
  return Math.abs(a2 - rotation) - Math.abs(b2 - rotation);
39242
39352
  });
@@ -39328,6 +39438,7 @@ function addBoundGuidelines(moveable, verticalPoses, horizontalPoses, verticalSn
39328
39438
  }
39329
39439
  var Snappable = {
39330
39440
  name: "snappable",
39441
+ dragRelation: "strong",
39331
39442
  props: {
39332
39443
  snappable: [Boolean, Array],
39333
39444
  snapContainer: Object,
@@ -39431,7 +39542,7 @@ var Snappable = {
39431
39542
  if (hasExternalPoses) {
39432
39543
  addBoundGuidelines(moveable, [externalRect.left, externalRect.right], [externalRect.top, externalRect.bottom], verticalSnapPoses, horizontalSnapPoses, snapRenderInfo.externalBounds);
39433
39544
  }
39434
- var allGuidelines = __spreadArrays$1(verticalGuidelines, horizontalGuidelines);
39545
+ var allGuidelines = __spreadArray(__spreadArray([], verticalGuidelines), horizontalGuidelines);
39435
39546
  var elementGuidelines = allGuidelines.filter(function(guideline) {
39436
39547
  return guideline.element && !guideline.gapRects;
39437
39548
  });
@@ -39446,7 +39557,7 @@ var Snappable = {
39446
39557
  elements: elementGuidelines,
39447
39558
  gaps: gapGuidelines
39448
39559
  }, true);
39449
- return __spreadArrays$1(renderDashedGuidelines(moveable, elementGuidelines, [minLeft, minTop], targetRect, React), renderGapGuidelines(moveable, gapGuidelines, [minLeft, minTop], targetRect, React), renderGuidelines(moveable, "horizontal", horizontalGuidelines, [targetLeft, targetTop], targetRect, React), renderGuidelines(moveable, "vertical", verticalGuidelines, [targetLeft, targetTop], targetRect, React), renderSnapPoses(moveable, "horizontal", horizontalSnapPoses, minLeft, targetTop, width, 0, React), renderSnapPoses(moveable, "vertical", verticalSnapPoses, minTop, targetLeft, height, 1, React));
39560
+ return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], renderDashedGuidelines(moveable, elementGuidelines, [minLeft, minTop], targetRect, React)), renderGapGuidelines(moveable, gapGuidelines, [minLeft, minTop], targetRect, React)), renderGuidelines(moveable, "horizontal", horizontalGuidelines, [targetLeft, targetTop], targetRect, React)), renderGuidelines(moveable, "vertical", verticalGuidelines, [targetLeft, targetTop], targetRect, React)), renderSnapPoses(moveable, "horizontal", horizontalSnapPoses, minLeft, targetTop, width, 0, React)), renderSnapPoses(moveable, "vertical", verticalSnapPoses, minTop, targetLeft, height, 1, React));
39450
39561
  },
39451
39562
  dragStart: function(moveable, e) {
39452
39563
  moveable.state.snapRenderInfo = {
@@ -39654,6 +39765,7 @@ var Draggable = {
39654
39765
  var right = datas.right - beforeDist[0];
39655
39766
  var bottom = datas.bottom - beforeDist[1];
39656
39767
  var nextTransform = convertTransformFormat(datas, "translate(" + translate[0] + "px, " + translate[1] + "px)", "translate(" + dist[0] + "px, " + dist[1] + "px)");
39768
+ fillOriginalTransform(e, nextTransform);
39657
39769
  moveable.state.dragInfo.dist = parentEvent ? [0, 0] : dist;
39658
39770
  if (!parentEvent && !parentMoveable && delta.every(function(num) {
39659
39771
  return !num;
@@ -39687,22 +39799,23 @@ var Draggable = {
39687
39799
  var _a3 = e.datas, deltaOffset = _a3.deltaOffset, distOffset = _a3.distOffset;
39688
39800
  if (deltaOffset[0] || deltaOffset[1]) {
39689
39801
  datas.deltaOffset = [0, 0];
39690
- distOffset[0] += deltaOffset[0];
39691
- distOffset[1] += deltaOffset[1];
39802
+ distOffset[0] = deltaOffset[0];
39803
+ distOffset[1] = deltaOffset[1];
39692
39804
  return this.drag(moveable, e);
39693
39805
  }
39694
39806
  return false;
39695
39807
  },
39696
39808
  dragEnd: function(moveable, e) {
39697
- var parentEvent = e.parentEvent, datas = e.datas, isDrag = e.isDrag;
39809
+ var parentEvent = e.parentEvent, datas = e.datas;
39698
39810
  moveable.state.gesto = null;
39699
39811
  moveable.state.dragInfo = null;
39700
39812
  if (!datas.isDrag) {
39701
39813
  return;
39702
39814
  }
39703
39815
  datas.isDrag = false;
39704
- !parentEvent && triggerEvent(moveable, "onDragEnd", fillEndParams(moveable, e, {}));
39705
- return isDrag;
39816
+ var param = fillEndParams(moveable, e, {});
39817
+ !parentEvent && triggerEvent(moveable, "onDragEnd", param);
39818
+ return param;
39706
39819
  },
39707
39820
  dragGroupStart: function(moveable, e) {
39708
39821
  var datas = e.datas, clientX = e.clientX, clientY = e.clientY;
@@ -39743,9 +39856,10 @@ var Draggable = {
39743
39856
  return;
39744
39857
  }
39745
39858
  this.dragEnd(moveable, e);
39746
- triggerChildGesto(moveable, this, "dragEnd", [0, 0], e, false);
39859
+ var events = triggerChildGesto(moveable, this, "dragEnd", [0, 0], e, false);
39747
39860
  triggerEvent(moveable, "onDragGroupEnd", fillEndParams(moveable, e, {
39748
- targets: moveable.props.targets
39861
+ targets: moveable.props.targets,
39862
+ events
39749
39863
  }));
39750
39864
  return isDrag;
39751
39865
  },
@@ -39794,7 +39908,7 @@ function renderDirectionControls(moveable, defaultDirections, React, additionalC
39794
39908
  if (additionalClassName === void 0) {
39795
39909
  additionalClassName = "";
39796
39910
  }
39797
- var _a3 = moveable.state, renderPoses = _a3.renderPoses, radRotation = _a3.rotation, direction = _a3.direction;
39911
+ var _a3 = moveable.state, renderPoses = _a3.renderPoses, rotationRad = _a3.rotation, direction = _a3.direction;
39798
39912
  var _b3 = moveable.props, _c3 = _b3.renderDirections, directions = _c3 === void 0 ? defaultDirections : _c3, zoom = _b3.zoom;
39799
39913
  var directionMap = {};
39800
39914
  if (!directions) {
@@ -39802,7 +39916,7 @@ function renderDirectionControls(moveable, defaultDirections, React, additionalC
39802
39916
  }
39803
39917
  var sign2 = direction > 0 ? 1 : -1;
39804
39918
  var renderDirections = directions === true ? DIRECTIONS : directions;
39805
- var degRotation = radRotation / Math.PI * 180;
39919
+ var degRotation = rotationRad / Math.PI * 180;
39806
39920
  renderDirections.forEach(function(dir) {
39807
39921
  directionMap[dir] = true;
39808
39922
  });
@@ -39817,7 +39931,7 @@ function renderDirectionControls(moveable, defaultDirections, React, additionalC
39817
39931
  "data-rotation": directionRotation,
39818
39932
  "data-direction": dir,
39819
39933
  key: "direction-" + dir,
39820
- style: getControlTransform.apply(void 0, __spreadArrays$1([radRotation, zoom], indexes.map(function(index) {
39934
+ style: getControlTransform.apply(void 0, __spreadArray([rotationRad, zoom], indexes.map(function(index) {
39821
39935
  return renderPoses[index];
39822
39936
  })))
39823
39937
  });
@@ -39832,7 +39946,7 @@ function renderLine(React, direction, pos1, pos2, zoom, key) {
39832
39946
  var rotation = direction ? throttle(rad / Math.PI * 180, 15) % 180 : -1;
39833
39947
  return React.createElement("div", {
39834
39948
  key: "line" + key,
39835
- className: prefix.apply(void 0, __spreadArrays$1(["line", "direction", direction], classNames)),
39949
+ className: prefix.apply(void 0, __spreadArray(["line", "direction", direction], classNames)),
39836
39950
  "data-rotation": rotation,
39837
39951
  "data-line-index": key,
39838
39952
  "data-direction": direction,
@@ -40102,13 +40216,14 @@ var Rotatable = {
40102
40216
  return params;
40103
40217
  },
40104
40218
  dragControlEnd: function(moveable, e) {
40105
- var datas = e.datas, isDrag = e.isDrag;
40219
+ var datas = e.datas;
40106
40220
  if (!datas.isRotate) {
40107
- return false;
40221
+ return;
40108
40222
  }
40109
40223
  datas.isRotate = false;
40110
- triggerEvent(moveable, "onRotateEnd", fillEndParams(moveable, e, {}));
40111
- return isDrag;
40224
+ var params = fillEndParams(moveable, e, {});
40225
+ triggerEvent(moveable, "onRotateEnd", params);
40226
+ return params;
40112
40227
  },
40113
40228
  dragGroupControlCondition: dragControlCondition,
40114
40229
  dragGroupControlStart: function(moveable, e) {
@@ -40175,9 +40290,10 @@ var Rotatable = {
40175
40290
  return;
40176
40291
  }
40177
40292
  this.dragControlEnd(moveable, e);
40178
- triggerChildAbles(moveable, this, "dragControlEnd", e);
40293
+ var events = triggerChildAbles(moveable, this, "dragControlEnd", e);
40179
40294
  var nextParams = fillEndParams(moveable, e, {
40180
- targets: moveable.props.targets
40295
+ targets: moveable.props.targets,
40296
+ events
40181
40297
  });
40182
40298
  triggerEvent(moveable, "onRotateGroupEnd", nextParams);
40183
40299
  return isDrag;
@@ -40391,7 +40507,7 @@ var Resizable = {
40391
40507
  distHeight = Math.sin(ratioRad) * distSize;
40392
40508
  }
40393
40509
  } else if (!keepRatio) {
40394
- var nextDirection = __spreadArrays$1(direction);
40510
+ var nextDirection = __spreadArray([], direction);
40395
40511
  if (!startOffsetWidth) {
40396
40512
  if (dist[0] < 0) {
40397
40513
  nextDirection[0] = -1;
@@ -40520,19 +40636,18 @@ var Resizable = {
40520
40636
  datas.prevHeight += errorHeight;
40521
40637
  }
40522
40638
  if (isErrorWidth || isErrorHeight) {
40523
- this.dragControl(moveable, e);
40524
- return true;
40639
+ return this.dragControl(moveable, e);
40525
40640
  }
40526
40641
  },
40527
40642
  dragControlEnd: function(moveable, e) {
40528
- var datas = e.datas, isDrag = e.isDrag;
40643
+ var datas = e.datas;
40529
40644
  if (!datas.isResize) {
40530
- return false;
40645
+ return;
40531
40646
  }
40532
40647
  datas.isResize = false;
40533
40648
  var params = fillEndParams(moveable, e, {});
40534
40649
  triggerEvent(moveable, "onResizeEnd", params);
40535
- return isDrag;
40650
+ return params;
40536
40651
  },
40537
40652
  dragGroupControlCondition: directionCondition,
40538
40653
  dragGroupControlStart: function(moveable, e) {
@@ -40604,9 +40719,10 @@ var Resizable = {
40604
40719
  return;
40605
40720
  }
40606
40721
  this.dragControlEnd(moveable, e);
40607
- triggerChildAbles(moveable, this, "dragControlEnd", e);
40722
+ var events = triggerChildAbles(moveable, this, "dragControlEnd", e);
40608
40723
  var nextParams = fillEndParams(moveable, e, {
40609
- targets: moveable.props.targets
40724
+ targets: moveable.props.targets,
40725
+ events
40610
40726
  });
40611
40727
  triggerEvent(moveable, "onResizeGroupEnd", nextParams);
40612
40728
  return isDrag;
@@ -40963,9 +41079,10 @@ var Scalable = {
40963
41079
  return;
40964
41080
  }
40965
41081
  this.dragControlEnd(moveable, e);
40966
- triggerChildAbles(moveable, this, "dragControlEnd", e);
41082
+ var events = triggerChildAbles(moveable, this, "dragControlEnd", e);
40967
41083
  var nextParams = fillEndParams(moveable, e, {
40968
- targets: moveable.props.targets
41084
+ targets: moveable.props.targets,
41085
+ events
40969
41086
  });
40970
41087
  triggerEvent(moveable, "onScaleGroupEnd", nextParams);
40971
41088
  return isDrag;
@@ -41045,7 +41162,7 @@ var Warpable = {
41045
41162
  var linePosTo2 = getMiddleLinePos(pos4, pos3);
41046
41163
  var linePosTo3 = getMiddleLinePos(pos2, pos4);
41047
41164
  var linePosTo4 = getMiddleLinePos(pos4, pos2);
41048
- return __spreadArrays$1([React.createElement("div", {
41165
+ return __spreadArray([React.createElement("div", {
41049
41166
  className: prefix("line"),
41050
41167
  key: "middeLine1",
41051
41168
  style: getLineStyle(linePosFrom1, linePosTo1, zoom)
@@ -41332,7 +41449,7 @@ var DragArea = {
41332
41449
  enableNativeEvent: function(moveable) {
41333
41450
  var state = moveable.state;
41334
41451
  if (state.disableNativeEvent) {
41335
- requestAnimationFrame(function() {
41452
+ requestAnimationFrame$1(function() {
41336
41453
  state.disableNativeEvent = false;
41337
41454
  });
41338
41455
  }
@@ -41366,6 +41483,7 @@ var Scrollable = {
41366
41483
  onScroll: "scroll",
41367
41484
  onScrollGroup: "scrollGroup"
41368
41485
  },
41486
+ dragRelation: "strong",
41369
41487
  dragStart: function(moveable, e) {
41370
41488
  var props = moveable.props;
41371
41489
  var _a3 = props.scrollContainer, scrollContainer = _a3 === void 0 ? moveable.getContainer() : _a3;
@@ -41469,6 +41587,7 @@ var Default = {
41469
41587
  container: Object,
41470
41588
  portalContainer: Object,
41471
41589
  rootContainer: Object,
41590
+ useResizeObserver: Boolean,
41472
41591
  zoom: Number,
41473
41592
  transformOrigin: Array,
41474
41593
  edge: Boolean,
@@ -41629,7 +41748,7 @@ function getRadiusValues(values, width, height, left, top, minCounts) {
41629
41748
  _d2 = calculateRatio([verticalPoses[1], verticalPoses[2]], height), verticalPoses[1] = _d2[0], verticalPoses[2] = _d2[1];
41630
41749
  var nextHorizontalPoses = horizontalPoses.slice(0, Math.max(minCounts[0], horizontalValues.length));
41631
41750
  var nextVerticalPoses = verticalPoses.slice(0, Math.max(minCounts[1], verticalValues.length));
41632
- return __spreadArrays$1(nextHorizontalPoses.map(function(pos, i2) {
41751
+ return __spreadArray(__spreadArray([], nextHorizontalPoses.map(function(pos, i2) {
41633
41752
  var direction = RADIUS_DIRECTIONS[i2];
41634
41753
  return {
41635
41754
  horizontal: HORIZONTAL_RADIUS_DIRECTIONS[i2],
@@ -41639,7 +41758,7 @@ function getRadiusValues(values, width, height, left, top, minCounts) {
41639
41758
  raw: horizontalRawPoses[i2],
41640
41759
  direction
41641
41760
  };
41642
- }), nextVerticalPoses.map(function(pos, i2) {
41761
+ })), nextVerticalPoses.map(function(pos, i2) {
41643
41762
  var direction = RADIUS_DIRECTIONS[i2];
41644
41763
  return {
41645
41764
  horizontal: 0,
@@ -41784,7 +41903,7 @@ function getClipStyles(moveable, clipPath, poses) {
41784
41903
  });
41785
41904
  if (poses.length > 8) {
41786
41905
  var _c3 = minus(poses[4], poses[0]), subWidth = _c3[0], subHeight = _c3[1];
41787
- clipStyles.push.apply(clipStyles, __spreadArrays$1(["round"], getRadiusStyles(poses.slice(8), clipPoses.slice(8), clipRelative, subWidth, subHeight, left, top, right, bottom).styles));
41906
+ clipStyles.push.apply(clipStyles, __spreadArray(["round"], getRadiusStyles(poses.slice(8), clipPoses.slice(8), clipRelative, subWidth, subHeight, left, top, right, bottom).styles));
41788
41907
  }
41789
41908
  return clipStyles;
41790
41909
  } else if (isCircle || clipType === "ellipse") {
@@ -41863,7 +41982,7 @@ function getClipPath(target, width, height, defaultClip, customClip) {
41863
41982
  radiusY_1 = convertUnitSize(yRadius, height);
41864
41983
  }
41865
41984
  var centerPos_1 = [convertUnitSize(xPos, width), convertUnitSize(yPos, height)];
41866
- var poses = __spreadArrays$1([{
41985
+ var poses = __spreadArray([{
41867
41986
  vertical: 1,
41868
41987
  horizontal: 1,
41869
41988
  pos: centerPos_1,
@@ -41902,7 +42021,7 @@ function getClipPath(target, width, height, defaultClip, customClip) {
41902
42021
  var nextRight = width - right;
41903
42022
  var nextBottom = height - bottom;
41904
42023
  var radiusPoses = getRadiusValues(radiusValues, nextRight - left, nextBottom - top, left, top);
41905
- var poses = __spreadArrays$1(getRectPoses(top, nextRight, nextBottom, left), radiusPoses);
42024
+ var poses = __spreadArray(__spreadArray([], getRectPoses(top, nextRight, nextBottom, left)), radiusPoses);
41906
42025
  return {
41907
42026
  type: "inset",
41908
42027
  clipText,
@@ -42021,7 +42140,7 @@ var Clippable = {
42021
42140
  css: [".control.clip-control {\n background: #6d6;\n cursor: pointer;\n}\n.control.clip-control.clip-radius {\n background: #d66;\n}\n.line.clip-line {\n background: #6e6;\n cursor: move;\n z-index: 1;\n}\n.clip-area {\n position: absolute;\n top: 0;\n left: 0;\n}\n.clip-ellipse {\n position: absolute;\n cursor: move;\n border: 1px solid #6d6;\n border: var(--zoompx) solid #6d6;\n border-radius: 50%;\n transform-origin: 0px 0px;\n}", ":host {\n --bounds-color: #d66;\n}", ".guideline {\n pointer-events: none;\n z-index: 2;\n}", ".line.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}"],
42022
42141
  render: function(moveable, React) {
42023
42142
  var _a3 = moveable.props, customClipPath = _a3.customClipPath, defaultClipPath = _a3.defaultClipPath, clipArea = _a3.clipArea, zoom = _a3.zoom;
42024
- var _b3 = moveable.state, target = _b3.target, width = _b3.width, height = _b3.height, allMatrix = _b3.allMatrix, is3d = _b3.is3d, left = _b3.left, top = _b3.top, pos1 = _b3.pos1, pos2 = _b3.pos2, pos3 = _b3.pos3, pos4 = _b3.pos4, clipPathState = _b3.clipPathState, snapBoundInfos = _b3.snapBoundInfos;
42143
+ var _b3 = moveable.state, target = _b3.target, width = _b3.width, height = _b3.height, allMatrix = _b3.allMatrix, is3d = _b3.is3d, left = _b3.left, top = _b3.top, pos1 = _b3.pos1, pos2 = _b3.pos2, pos3 = _b3.pos3, pos4 = _b3.pos4, clipPathState = _b3.clipPathState, snapBoundInfos = _b3.snapBoundInfos, rotationRad = _b3.rotation;
42025
42144
  if (!target) {
42026
42145
  return [];
42027
42146
  }
@@ -42064,7 +42183,7 @@ var Clippable = {
42064
42183
  className: prefix("control", "clip-control", "snap-control"),
42065
42184
  "data-clip-index": i3,
42066
42185
  style: {
42067
- transform: "translate(" + pos[0] + "px, " + pos[1] + "px) scale(" + zoom + ")"
42186
+ transform: "translate(" + pos[0] + "px, " + pos[1] + "px) rotate(" + rotationRad + "rad) scale(" + zoom + ")"
42068
42187
  }
42069
42188
  });
42070
42189
  });
@@ -42075,7 +42194,7 @@ var Clippable = {
42075
42194
  className: prefix("control", "clip-control", "clip-radius", "snap-control"),
42076
42195
  "data-clip-index": 8 + i3,
42077
42196
  style: {
42078
- transform: "translate(" + pos[0] + "px, " + pos[1] + "px) scale(" + zoom + ")"
42197
+ transform: "translate(" + pos[0] + "px, " + pos[1] + "px) rotate(" + rotationRad + "rad) scale(" + zoom + ")"
42079
42198
  }
42080
42199
  });
42081
42200
  }));
@@ -42113,7 +42232,7 @@ var Clippable = {
42113
42232
  }));
42114
42233
  }
42115
42234
  if (clipArea) {
42116
- var _d2 = getRect(__spreadArrays$1([pos1, pos2, pos3, pos4], poses)), allWidth = _d2.width, allHeight = _d2.height, allLeft_1 = _d2.left, allTop_1 = _d2.top;
42235
+ var _d2 = getRect(__spreadArray([pos1, pos2, pos3, pos4], poses)), allWidth = _d2.width, allHeight = _d2.height, allLeft_1 = _d2.left, allTop_1 = _d2.top;
42117
42236
  if (isPolygon || isRect || isInset) {
42118
42237
  var areaPoses = isInset ? poses.slice(0, 8) : poses;
42119
42238
  controls.push(React.createElement("div", {
@@ -42152,7 +42271,7 @@ var Clippable = {
42152
42271
  }
42153
42272
  });
42154
42273
  }
42155
- return __spreadArrays$1(controls, lines);
42274
+ return __spreadArray(__spreadArray([], controls), lines);
42156
42275
  },
42157
42276
  dragControlCondition: function(moveable, e) {
42158
42277
  return e.inputEvent && (e.inputEvent.target.getAttribute("class") || "").indexOf("clip") > -1;
@@ -42176,7 +42295,7 @@ var Clippable = {
42176
42295
  var _a3 = moveable.props, defaultClipPath = _a3.defaultClipPath, customClipPath = _a3.customClipPath;
42177
42296
  var target = state.target, width = state.width, height = state.height;
42178
42297
  var inputTarget = e.inputEvent ? e.inputEvent.target : null;
42179
- var className = inputTarget ? inputTarget.getAttribute("class") : "";
42298
+ var className = inputTarget && inputTarget.getAttribute("class") || "";
42180
42299
  var datas = e.datas;
42181
42300
  var clipPath = getClipPath(target, width, height, defaultClipPath || "inset", customClipPath);
42182
42301
  if (!clipPath) {
@@ -42194,7 +42313,7 @@ var Clippable = {
42194
42313
  datas.isClipStart = false;
42195
42314
  return false;
42196
42315
  }
42197
- datas.isControl = className.indexOf("clip-control") > -1;
42316
+ datas.isControl = className && className.indexOf("clip-control") > -1;
42198
42317
  datas.isLine = className.indexOf("clip-line") > -1;
42199
42318
  datas.isArea = className.indexOf("clip-area") > -1 || className.indexOf("clip-ellipse") > -1;
42200
42319
  datas.index = inputTarget ? parseInt(inputTarget.getAttribute("data-clip-index"), 10) : -1;
@@ -42205,16 +42324,16 @@ var Clippable = {
42205
42324
  return true;
42206
42325
  },
42207
42326
  dragControl: function(moveable, e) {
42327
+ var _a3;
42208
42328
  var datas = e.datas, originalDatas = e.originalDatas;
42209
42329
  if (!datas.isClipStart) {
42210
42330
  return false;
42211
42331
  }
42212
- var draggableData = originalDatas && originalDatas.draggable || {};
42213
- var _a3 = datas, isControl = _a3.isControl, isLine = _a3.isLine, isArea = _a3.isArea, index = _a3.index, clipPath = _a3.clipPath;
42332
+ var _b3 = datas, isControl = _b3.isControl, isLine = _b3.isLine, isArea = _b3.isArea, index = _b3.index, clipPath = _b3.clipPath;
42214
42333
  if (!clipPath) {
42215
42334
  return false;
42216
42335
  }
42217
- var _b3 = draggableData.isDrag ? draggableData.prevDist : getDragDist(e), distX = _b3[0], distY = _b3[1];
42336
+ var _c3 = getDragDist(e), distX = _c3[0], distY = _c3[1];
42218
42337
  var props = moveable.props;
42219
42338
  var state = moveable.state;
42220
42339
  var width = state.width, height = state.height;
@@ -42233,7 +42352,7 @@ var Clippable = {
42233
42352
  return [0, 0];
42234
42353
  });
42235
42354
  if (isControl && !isAll) {
42236
- var _c3 = clipPoses[index], horizontal = _c3.horizontal, vertical = _c3.vertical;
42355
+ var _d2 = clipPoses[index], horizontal = _d2.horizontal, vertical = _d2.vertical;
42237
42356
  var dist = [distX * Math.abs(horizontal), distY * Math.abs(vertical)];
42238
42357
  dists = moveControlPos(clipPoses, index, dist, isRect);
42239
42358
  } else if (isAll) {
@@ -42244,7 +42363,7 @@ var Clippable = {
42244
42363
  var nextPoses = poses.map(function(pos, i3) {
42245
42364
  return plus(pos, dists[i3]);
42246
42365
  });
42247
- var guidePoses = __spreadArrays$1(nextPoses);
42366
+ var guidePoses = __spreadArray([], nextPoses);
42248
42367
  state.snapBoundInfos = null;
42249
42368
  var isCircle = clipPath.type === "circle";
42250
42369
  var isEllipse = clipPath.type === "ellipse";
@@ -42301,12 +42420,12 @@ var Clippable = {
42301
42420
  }
42302
42421
  var boundDelta = [0, 0];
42303
42422
  var _loop_12 = function(i3) {
42304
- var _a4 = checkSnapBounds(guidelines, props.clipTargetBounds && {
42423
+ var _e = checkSnapBounds(guidelines, props.clipTargetBounds && {
42305
42424
  left: 0,
42306
42425
  top: 0,
42307
42426
  right: width,
42308
42427
  bottom: height
42309
- }, guideXPoses, guideYPoses, 5), horizontalSnapInfo = _a4.horizontal, verticalSnapInfo = _a4.vertical;
42428
+ }, guideXPoses, guideYPoses, 5), horizontalSnapInfo = _e.horizontal, verticalSnapInfo = _e.vertical;
42310
42429
  var snapOffsetY = horizontalSnapInfo.offset;
42311
42430
  var snapOffsetX = verticalSnapInfo.offset;
42312
42431
  if (horizontalSnapInfo.isBound) {
@@ -42379,6 +42498,9 @@ var Clippable = {
42379
42498
  bottom: height
42380
42499
  }, guideXPoses, guideYPoses, 1);
42381
42500
  if (originalDatas.draggable) {
42501
+ var is3d = state.is3d, allMatrix = state.allMatrix;
42502
+ var n = is3d ? 4 : 3;
42503
+ _a3 = multiply(allMatrix, [boundDelta[0], boundDelta[1], 0, 0], n), boundDelta[0] = _a3[0], boundDelta[1] = _a3[1];
42382
42504
  originalDatas.draggable.deltaOffset = boundDelta;
42383
42505
  }
42384
42506
  triggerEvent(moveable, "onClip", fillParams(moveable, e, {
@@ -42793,6 +42915,10 @@ var Roundable = {
42793
42915
  moveable.state.borderRadiusState = "";
42794
42916
  }
42795
42917
  };
42918
+ function isIdentityMatrix(matrix, is3d) {
42919
+ var value = is3d ? "matrix3d(" + createIdentityMatrix(4) : "matrix(" + createIdentityMatrix(3) + ")";
42920
+ return matrix === value || matrix === "matrix(1,0,0,1,0,0)";
42921
+ }
42796
42922
  var BeforeRenderable = {
42797
42923
  isPinch: true,
42798
42924
  name: "beforeRenderable",
@@ -42805,13 +42931,15 @@ var BeforeRenderable = {
42805
42931
  onBeforeRenderGroup: "beforeRenderGroup",
42806
42932
  onBeforeRenderGroupEnd: "beforeRenderGroupEnd"
42807
42933
  },
42934
+ dragRelation: "weak",
42808
42935
  setTransform: function(moveable, e) {
42809
42936
  var _a3 = moveable.state, is3d = _a3.is3d, target = _a3.target, targetMatrix = _a3.targetMatrix;
42810
42937
  var transform = target === null || target === void 0 ? void 0 : target.style.transform;
42811
42938
  var cssMatrix = is3d ? "matrix3d(" + targetMatrix.join(",") + ")" : "matrix(" + convertMatrixtoCSS(targetMatrix, true) + ")";
42812
- e.datas.startTransforms = !transform || transform === "none" ? [cssMatrix] : splitSpace(transform);
42939
+ var startTransform = !transform || transform === "none" ? cssMatrix : transform;
42940
+ e.datas.startTransforms = isIdentityMatrix(startTransform, is3d) ? [] : splitSpace(startTransform);
42813
42941
  },
42814
- resetTransform: function(moveable, e) {
42942
+ resetTransform: function(e) {
42815
42943
  e.datas.nextTransforms = e.datas.startTransforms;
42816
42944
  e.datas.nextTransformAppendedIndexes = [];
42817
42945
  },
@@ -42833,7 +42961,7 @@ var BeforeRenderable = {
42833
42961
  triggerEvent(moveable, "onBeforeRenderStart", this.fillDragStartParams(moveable, e));
42834
42962
  },
42835
42963
  drag: function(moveable, e) {
42836
- this.resetTransform(moveable, e);
42964
+ this.resetTransform(e);
42837
42965
  triggerEvent(moveable, "onBeforeRender", fillParams(moveable, e, {
42838
42966
  isPinch: !!e.isPinch
42839
42967
  }));
@@ -42869,7 +42997,7 @@ var BeforeRenderable = {
42869
42997
  var moveables = moveable.moveables;
42870
42998
  var params = events.map(function(childEvent, i2) {
42871
42999
  var childMoveable = moveables[i2];
42872
- _this.resetTransform(childMoveable, childEvent);
43000
+ _this.resetTransform(childEvent);
42873
43001
  return _this.fillDragParams(childMoveable, childEvent);
42874
43002
  });
42875
43003
  triggerEvent(moveable, "onBeforeRenderGroup", fillParams(moveable, e, {
@@ -42916,21 +43044,22 @@ var Renderable = {
42916
43044
  onRenderGroup: "renderGroup",
42917
43045
  onRenderGroupEnd: "renderGroupEnd"
42918
43046
  },
43047
+ dragRelation: "weak",
42919
43048
  dragStart: function(moveable, e) {
42920
43049
  triggerEvent(moveable, "onRenderStart", fillParams(moveable, e, {
42921
43050
  isPinch: !!e.isPinch
42922
43051
  }));
42923
43052
  },
42924
43053
  drag: function(moveable, e) {
42925
- triggerEvent(moveable, "onRender", fillParams(moveable, e, {
42926
- isPinch: !!e.isPinch
42927
- }));
43054
+ triggerEvent(moveable, "onRender", this.fillDragParams(moveable, e));
43055
+ },
43056
+ dragAfter: function(moveable, e) {
43057
+ if (e.resultCount) {
43058
+ return this.drag(moveable, e);
43059
+ }
42928
43060
  },
42929
43061
  dragEnd: function(moveable, e) {
42930
- triggerEvent(moveable, "onRenderEnd", fillParams(moveable, e, {
42931
- isPinch: !!e.isPinch,
42932
- isDrag: e.isDrag
42933
- }));
43062
+ triggerEvent(moveable, "onRenderEnd", this.fillDragEndParams(moveable, e));
42934
43063
  },
42935
43064
  dragGroupStart: function(moveable, e) {
42936
43065
  triggerEvent(moveable, "onRenderGroupStart", fillParams(moveable, e, {
@@ -42939,16 +43068,33 @@ var Renderable = {
42939
43068
  }));
42940
43069
  },
42941
43070
  dragGroup: function(moveable, e) {
43071
+ var _this = this;
43072
+ var events = fillChildEvents(moveable, "beforeRenderable", e);
43073
+ var moveables = moveable.moveables;
43074
+ var params = events.map(function(childEvent, i2) {
43075
+ var childMoveable = moveables[i2];
43076
+ return _this.fillDragParams(childMoveable, childEvent);
43077
+ });
42942
43078
  triggerEvent(moveable, "onRenderGroup", fillParams(moveable, e, {
42943
43079
  isPinch: !!e.isPinch,
42944
- targets: moveable.props.targets
43080
+ targets: moveable.props.targets,
43081
+ transform: getNextTransformText(e),
43082
+ events: params
42945
43083
  }));
42946
43084
  },
42947
43085
  dragGroupEnd: function(moveable, e) {
43086
+ var _this = this;
43087
+ var events = fillChildEvents(moveable, "beforeRenderable", e);
43088
+ var moveables = moveable.moveables;
43089
+ var params = events.map(function(childEvent, i2) {
43090
+ var childMoveable = moveables[i2];
43091
+ return _this.fillDragEndParams(childMoveable, childEvent);
43092
+ });
42948
43093
  triggerEvent(moveable, "onRenderGroupEnd", fillParams(moveable, e, {
42949
43094
  isPinch: !!e.isPinch,
42950
43095
  isDrag: e.isDrag,
42951
- targets: moveable.props.targets
43096
+ targets: moveable.props.targets,
43097
+ events: params
42952
43098
  }));
42953
43099
  },
42954
43100
  dragControlStart: function(moveable, e) {
@@ -42957,6 +43103,9 @@ var Renderable = {
42957
43103
  dragControl: function(moveable, e) {
42958
43104
  return this.drag(moveable, e);
42959
43105
  },
43106
+ dragControlAfter: function(moveable, e) {
43107
+ return this.dragAfter(moveable, e);
43108
+ },
42960
43109
  dragControlEnd: function(moveable, e) {
42961
43110
  return this.dragEnd(moveable, e);
42962
43111
  },
@@ -42968,6 +43117,18 @@ var Renderable = {
42968
43117
  },
42969
43118
  dragGroupControlEnd: function(moveable, e) {
42970
43119
  return this.dragGroupEnd(moveable, e);
43120
+ },
43121
+ fillDragParams: function(moveable, e) {
43122
+ return fillParams(moveable, e, {
43123
+ isPinch: !!e.isPinch,
43124
+ transform: getNextTransformText(e)
43125
+ });
43126
+ },
43127
+ fillDragEndParams: function(moveable, e) {
43128
+ return fillParams(moveable, e, {
43129
+ isPinch: !!e.isPinch,
43130
+ isDrag: e.isDrag
43131
+ });
42971
43132
  }
42972
43133
  };
42973
43134
  function triggerAble(moveable, ableType, eventOperation, eventAffix, eventType, e, requestInstant) {
@@ -42980,15 +43141,15 @@ function triggerAble(moveable, ableType, eventOperation, eventAffix, eventType,
42980
43141
  var eventName = "" + eventOperation + eventAffix + eventType;
42981
43142
  var conditionName = "" + eventOperation + eventAffix + "Condition";
42982
43143
  var isEnd = eventType === "End";
42983
- var isAfter = eventType.indexOf("After") > -1;
43144
+ var isAfter = eventType === "After";
42984
43145
  var isFirstStart = isStart && (!moveable.targetGesto || !moveable.controlGesto || !moveable.targetGesto.isFlag() || !moveable.controlGesto.isFlag());
42985
43146
  if (isFirstStart) {
42986
43147
  moveable.updateRect(eventType, true, false);
42987
43148
  }
42988
- if (eventType === "" && !isAfter && !isRequest) {
43149
+ if (eventType === "" && !isRequest) {
42989
43150
  convertDragDist(moveable.state, e);
42990
43151
  }
42991
- var ables = __spreadArrays$1([BeforeRenderable], moveable[ableType], [Renderable]);
43152
+ var ables = __spreadArray([], moveable[ableType]);
42992
43153
  if (isRequest) {
42993
43154
  var requestAble_1 = e.requestAble;
42994
43155
  if (!ables.some(function(able) {
@@ -43002,12 +43163,12 @@ function triggerAble(moveable, ableType, eventOperation, eventAffix, eventType,
43002
43163
  if (!ables.length) {
43003
43164
  return false;
43004
43165
  }
43005
- var events = ables.filter(function(able) {
43166
+ var eventAbles = __spreadArray(__spreadArray([BeforeRenderable], ables), [Renderable]).filter(function(able) {
43006
43167
  return able[eventName];
43007
43168
  });
43008
43169
  var datas = e.datas;
43009
43170
  if (isFirstStart) {
43010
- events.forEach(function(able) {
43171
+ eventAbles.forEach(function(able) {
43011
43172
  able.unset && able.unset(moveable);
43012
43173
  });
43013
43174
  }
@@ -43016,23 +43177,44 @@ function triggerAble(moveable, ableType, eventOperation, eventAffix, eventType,
43016
43177
  if (isEnd && inputEvent) {
43017
43178
  inputTarget = document.elementFromPoint(e.clientX, e.clientY) || inputEvent.target;
43018
43179
  }
43019
- var results = events.filter(function(able) {
43180
+ var resultCount = 0;
43181
+ var results = eventAbles.filter(function(able) {
43020
43182
  var ableName = able.name;
43021
43183
  var nextDatas = datas[ableName] || (datas[ableName] = {});
43022
43184
  if (isStart) {
43023
43185
  nextDatas.isEventStart = !able[conditionName] || able[conditionName](moveable, e);
43024
43186
  }
43025
43187
  if (nextDatas.isEventStart) {
43026
- return able[eventName](moveable, __assign$2(__assign$2({}, e), {
43188
+ var result = able[eventName](moveable, __assign$2(__assign$2({}, e), {
43189
+ resultCount,
43027
43190
  datas: nextDatas,
43028
43191
  originalDatas: datas,
43029
43192
  inputTarget
43030
43193
  }));
43194
+ if (isStart && result === false) {
43195
+ nextDatas.isEventStart = false;
43196
+ }
43197
+ resultCount += result ? 1 : 0;
43198
+ return result;
43031
43199
  }
43032
43200
  return false;
43033
43201
  });
43034
43202
  var isUpdate = results.length;
43035
- var isForceEnd = isStart && events.length && !isUpdate;
43203
+ var isForceEnd = false;
43204
+ if (isStart && eventAbles.length && !isUpdate) {
43205
+ isForceEnd = eventAbles.filter(function(able) {
43206
+ var ableName = able.name;
43207
+ var nextDatas = datas[ableName];
43208
+ if (nextDatas.isEventStart) {
43209
+ if (able.dragRelation === "strong") {
43210
+ nextDatas.isEventStart = false;
43211
+ return false;
43212
+ }
43213
+ return true;
43214
+ }
43215
+ return false;
43216
+ }).length === 0;
43217
+ }
43036
43218
  if (isEnd || isForceEnd) {
43037
43219
  moveable.state.gesto = null;
43038
43220
  if (moveable.moveables) {
@@ -43042,15 +43224,18 @@ function triggerAble(moveable, ableType, eventOperation, eventAffix, eventType,
43042
43224
  }
43043
43225
  }
43044
43226
  if (isFirstStart && isForceEnd) {
43045
- events.forEach(function(able) {
43227
+ eventAbles.forEach(function(able) {
43046
43228
  able.unset && able.unset(moveable);
43047
43229
  });
43048
43230
  }
43231
+ if (isStart && !isRequest && isUpdate) {
43232
+ e === null || e === void 0 ? void 0 : e.preventDefault();
43233
+ }
43049
43234
  if (moveable.isUnmounted || isForceEnd) {
43050
43235
  return false;
43051
43236
  }
43052
43237
  if (!isStart && isUpdate && !requestInstant || isEnd) {
43053
- moveable.updateRect(eventType, true, false);
43238
+ moveable.updateRect(isEnd ? eventType : "", true, false);
43054
43239
  moveable.forceUpdate();
43055
43240
  }
43056
43241
  if (!isStart && !isEnd && !isAfter && isUpdate && !requestInstant) {
@@ -43068,7 +43253,7 @@ function getTargetAbleGesto(moveable, moveableTarget, eventAffix) {
43068
43253
  var startFunc = function(e) {
43069
43254
  var eventTarget = e.inputEvent.target;
43070
43255
  var areaElement = moveable.areaElement;
43071
- return eventTarget === areaElement || !moveable.isMoveableElement(eventTarget) || hasClass(eventTarget, "moveable-area") || hasClass(eventTarget, "moveable-padding");
43256
+ return eventTarget === areaElement || !moveable.isMoveableElement(eventTarget) && !moveable.controlBox.getElement().contains(eventTarget) || hasClass(eventTarget, "moveable-area") || hasClass(eventTarget, "moveable-padding");
43072
43257
  };
43073
43258
  return getAbleGesto(moveable, targets, "targetAbles", eventAffix, {
43074
43259
  dragStart: startFunc,
@@ -43081,6 +43266,7 @@ function getAbleGesto(moveable, target, ableType, eventAffix, conditionFunctions
43081
43266
  }
43082
43267
  var _a3 = moveable.props, pinchOutside = _a3.pinchOutside, pinchThreshold = _a3.pinchThreshold;
43083
43268
  var options = {
43269
+ preventDefault: false,
43084
43270
  container: window,
43085
43271
  pinchThreshold,
43086
43272
  pinchOutside
@@ -43155,10 +43341,31 @@ var MoveableManager$1 = /* @__PURE__ */ function(_super) {
43155
43341
  "mouseEnter": null,
43156
43342
  "mouseLeave": null
43157
43343
  };
43344
+ _this._prevTarget = null;
43345
+ _this._prevDragArea = false;
43346
+ _this._observer = null;
43347
+ _this._observerId = 0;
43158
43348
  _this.onPreventClick = function(e) {
43159
43349
  e.stopPropagation();
43160
43350
  removeEvent(window, "click", _this.onPreventClick, true);
43161
43351
  };
43352
+ _this.checkUpdateRect = function() {
43353
+ if (_this.isDragging()) {
43354
+ return;
43355
+ }
43356
+ var parentMoveable = _this.props.parentMoveable;
43357
+ if (parentMoveable) {
43358
+ parentMoveable.checkUpdateRect();
43359
+ return;
43360
+ }
43361
+ cancelAnimationFrame$1(_this._observerId);
43362
+ _this._observerId = requestAnimationFrame$1(function() {
43363
+ if (_this.isDragging()) {
43364
+ return;
43365
+ }
43366
+ _this.updateRect();
43367
+ });
43368
+ };
43162
43369
  return _this;
43163
43370
  }
43164
43371
  var __proto = MoveableManager2.prototype;
@@ -43200,17 +43407,21 @@ var MoveableManager$1 = /* @__PURE__ */ function(_super) {
43200
43407
  this.controlBox.getElement();
43201
43408
  var props = this.props;
43202
43409
  var parentMoveable = props.parentMoveable, container = props.container, wrapperMoveable = props.wrapperMoveable;
43203
- this.updateEvent(props);
43204
- this.updateNativeEvents(props);
43410
+ this._updateTargets();
43411
+ this._updateNativeEvents();
43412
+ this._updateEvents();
43205
43413
  if (!container && !parentMoveable && !wrapperMoveable) {
43206
43414
  this.updateRect("", false, true);
43207
43415
  }
43208
43416
  this.updateCheckInput();
43417
+ this._updateObserver(this.props);
43209
43418
  };
43210
43419
  __proto.componentDidUpdate = function(prevProps) {
43211
- this.updateNativeEvents(prevProps);
43212
- this.updateEvent(prevProps);
43420
+ this._updateNativeEvents();
43421
+ this._updateEvents();
43422
+ this._updateTargets();
43213
43423
  this.updateCheckInput();
43424
+ this._updateObserver(prevProps);
43214
43425
  };
43215
43426
  __proto.componentWillUnmount = function() {
43216
43427
  this.isUnmounted = true;
@@ -43283,77 +43494,6 @@ var MoveableManager$1 = /* @__PURE__ */ function(_super) {
43283
43494
  var rootContainer = parentMoveable ? parentMoveable.props.rootContainer : props.rootContainer;
43284
43495
  this.updateState(getTargetInfo(this.controlBox && this.controlBox.getElement(), target, container, container, rootContainer || container), parentMoveable ? false : isSetState);
43285
43496
  };
43286
- __proto.isTargetChanged = function(prevProps, useDragArea) {
43287
- var props = this.props;
43288
- var target = props.dragTarget || props.target;
43289
- var prevTarget = prevProps.dragTarget || prevProps.target;
43290
- var dragArea = props.dragArea;
43291
- var prevDragArea = prevProps.dragArea;
43292
- var isTargetChanged = !dragArea && prevTarget !== target;
43293
- return isTargetChanged || (useDragArea || dragArea) && prevDragArea !== dragArea;
43294
- };
43295
- __proto.updateNativeEvents = function(prevProps) {
43296
- var _this = this;
43297
- var props = this.props;
43298
- var target = props.dragArea ? this.areaElement : this.state.target;
43299
- var events = this.events;
43300
- var eventKeys = getKeys(events);
43301
- if (this.isTargetChanged(prevProps)) {
43302
- for (var eventName in events) {
43303
- var manager = events[eventName];
43304
- manager && manager.destroy();
43305
- events[eventName] = null;
43306
- }
43307
- }
43308
- if (!target) {
43309
- return;
43310
- }
43311
- var enabledAbles = this.enabledAbles;
43312
- eventKeys.forEach(function(eventName2) {
43313
- var ables = filterAbles(enabledAbles, [eventName2]);
43314
- var hasAbles = ables.length > 0;
43315
- var manager2 = events[eventName2];
43316
- if (!hasAbles) {
43317
- if (manager2) {
43318
- manager2.destroy();
43319
- events[eventName2] = null;
43320
- }
43321
- return;
43322
- }
43323
- if (!manager2) {
43324
- manager2 = new EventManager(target, _this, eventName2);
43325
- events[eventName2] = manager2;
43326
- }
43327
- manager2.setAbles(ables);
43328
- });
43329
- };
43330
- __proto.updateEvent = function(prevProps) {
43331
- var controlBoxElement = this.controlBox.getElement();
43332
- var hasTargetAble = this.targetAbles.length;
43333
- var hasControlAble = this.controlAbles.length;
43334
- var props = this.props;
43335
- var target = props.dragTarget || props.target;
43336
- var isTargetChanged = this.isTargetChanged(prevProps, true);
43337
- var isUnset = !hasTargetAble && this.targetGesto || isTargetChanged;
43338
- if (isUnset) {
43339
- unset(this, "targetGesto");
43340
- this.updateState({
43341
- gesto: null
43342
- });
43343
- }
43344
- if (!hasControlAble) {
43345
- unset(this, "controlGesto");
43346
- }
43347
- if (target && hasTargetAble && !this.targetGesto) {
43348
- this.targetGesto = getTargetAbleGesto(this, target, "");
43349
- }
43350
- if (!this.controlGesto && hasControlAble) {
43351
- this.controlGesto = getAbleGesto(this, controlBoxElement, "controlAbles", "Control");
43352
- }
43353
- if (isUnset) {
43354
- this.unsetAbles();
43355
- }
43356
- };
43357
43497
  __proto.isDragging = function() {
43358
43498
  return (this.targetGesto ? this.targetGesto.isFlag() : false) || (this.controlGesto ? this.controlGesto.isFlag() : false);
43359
43499
  };
@@ -43463,11 +43603,15 @@ var MoveableManager$1 = /* @__PURE__ */ function(_super) {
43463
43603
  if (!isChanged) {
43464
43604
  return;
43465
43605
  }
43606
+ var moveableContainer = container || this.controlBox;
43607
+ if (moveableContainer) {
43608
+ this.unsetAbles();
43609
+ }
43466
43610
  this.updateState({
43467
43611
  target,
43468
43612
  container
43469
43613
  });
43470
- if (!parentMoveable && (container || this.controlBox)) {
43614
+ if (!parentMoveable && moveableContainer) {
43471
43615
  this.updateRect("End", false, false);
43472
43616
  }
43473
43617
  };
@@ -43485,15 +43629,11 @@ var MoveableManager$1 = /* @__PURE__ */ function(_super) {
43485
43629
  };
43486
43630
  __proto.unsetAbles = function() {
43487
43631
  var _this = this;
43488
- if (this.targetAbles.filter(function(able) {
43632
+ this.targetAbles.forEach(function(able) {
43489
43633
  if (able.unset) {
43490
43634
  able.unset(_this);
43491
- return true;
43492
43635
  }
43493
- return false;
43494
- }).length) {
43495
- this.forceUpdate();
43496
- }
43636
+ });
43497
43637
  };
43498
43638
  __proto.updateAbles = function(ables, eventAffix) {
43499
43639
  if (ables === void 0) {
@@ -43505,7 +43645,7 @@ var MoveableManager$1 = /* @__PURE__ */ function(_super) {
43505
43645
  var props = this.props;
43506
43646
  var triggerAblesSimultaneously = props.triggerAblesSimultaneously;
43507
43647
  var enabledAbles = ables.filter(function(able) {
43508
- return able && (able.always || props[able.name]);
43648
+ return able && (able.always && props[able.name] !== false || props[able.name]);
43509
43649
  });
43510
43650
  var dragStart = "drag" + eventAffix + "Start";
43511
43651
  var pinchStart = "pinch" + eventAffix + "Start";
@@ -43555,6 +43695,52 @@ var MoveableManager$1 = /* @__PURE__ */ function(_super) {
43555
43695
  __proto.updateCheckInput = function() {
43556
43696
  this.targetGesto && (this.targetGesto.options.checkInput = this.props.checkInput);
43557
43697
  };
43698
+ __proto._updateObserver = function(prevProps) {
43699
+ var _a3;
43700
+ var props = this.props;
43701
+ var target = props.target;
43702
+ if (!window.ResizeObserver || !target || !props.useResizeObserver) {
43703
+ (_a3 = this._observer) === null || _a3 === void 0 ? void 0 : _a3.disconnect();
43704
+ return;
43705
+ }
43706
+ if (prevProps.target === target && this._observer) {
43707
+ return;
43708
+ }
43709
+ var observer = new ResizeObserver(this.checkUpdateRect);
43710
+ observer.observe(target, {
43711
+ box: "border-box"
43712
+ });
43713
+ this._observer = observer;
43714
+ return;
43715
+ };
43716
+ __proto._updateEvents = function() {
43717
+ var controlBoxElement = this.controlBox.getElement();
43718
+ var hasTargetAble = this.targetAbles.length;
43719
+ var hasControlAble = this.controlAbles.length;
43720
+ var props = this.props;
43721
+ var target = props.dragTarget || props.target;
43722
+ var isUnset = !hasTargetAble && this.targetGesto || this._isTargetChanged(true);
43723
+ if (isUnset) {
43724
+ unset(this, "targetGesto");
43725
+ this.updateState({
43726
+ gesto: null
43727
+ });
43728
+ }
43729
+ if (!hasControlAble) {
43730
+ unset(this, "controlGesto");
43731
+ }
43732
+ if (target && hasTargetAble && !this.targetGesto) {
43733
+ this.targetGesto = getTargetAbleGesto(this, target, "");
43734
+ }
43735
+ if (!this.controlGesto && hasControlAble) {
43736
+ this.controlGesto = getAbleGesto(this, controlBoxElement, "controlAbles", "Control");
43737
+ }
43738
+ };
43739
+ __proto._updateTargets = function() {
43740
+ var props = this.props;
43741
+ this._prevTarget = props.dragTarget || props.target;
43742
+ this._prevDragArea = props.dragArea;
43743
+ };
43558
43744
  __proto._renderLines = function() {
43559
43745
  var props = this.props;
43560
43746
  var edge = props.edge, zoom = props.zoom, hideDefaultLines = props.hideDefaultLines;
@@ -43567,6 +43753,51 @@ var MoveableManager$1 = /* @__PURE__ */ function(_super) {
43567
43753
  };
43568
43754
  return [renderLine(Renderer2, edge ? "n" : "", renderPoses[0], renderPoses[1], zoom, 0), renderLine(Renderer2, edge ? "e" : "", renderPoses[1], renderPoses[3], zoom, 1), renderLine(Renderer2, edge ? "w" : "", renderPoses[0], renderPoses[2], zoom, 2), renderLine(Renderer2, edge ? "s" : "", renderPoses[2], renderPoses[3], zoom, 3)];
43569
43755
  };
43756
+ __proto._isTargetChanged = function(useDragArea) {
43757
+ var props = this.props;
43758
+ var target = props.dragTarget || props.target;
43759
+ var prevTarget = this._prevTarget;
43760
+ var prevDragArea = this._prevDragArea;
43761
+ var dragArea = props.dragArea;
43762
+ var isTargetChanged = !dragArea && prevTarget !== target;
43763
+ var isDragAreaChanged = (useDragArea || dragArea) && prevDragArea !== dragArea;
43764
+ return isTargetChanged || isDragAreaChanged;
43765
+ };
43766
+ __proto._updateNativeEvents = function() {
43767
+ var _this = this;
43768
+ var props = this.props;
43769
+ var target = props.dragArea ? this.areaElement : this.state.target;
43770
+ var events = this.events;
43771
+ var eventKeys = getKeys(events);
43772
+ if (this._isTargetChanged()) {
43773
+ for (var eventName in events) {
43774
+ var manager = events[eventName];
43775
+ manager && manager.destroy();
43776
+ events[eventName] = null;
43777
+ }
43778
+ }
43779
+ if (!target) {
43780
+ return;
43781
+ }
43782
+ var enabledAbles = this.enabledAbles;
43783
+ eventKeys.forEach(function(eventName2) {
43784
+ var ables = filterAbles(enabledAbles, [eventName2]);
43785
+ var hasAbles = ables.length > 0;
43786
+ var manager2 = events[eventName2];
43787
+ if (!hasAbles) {
43788
+ if (manager2) {
43789
+ manager2.destroy();
43790
+ events[eventName2] = null;
43791
+ }
43792
+ return;
43793
+ }
43794
+ if (!manager2) {
43795
+ manager2 = new EventManager(target, _this, eventName2);
43796
+ events[eventName2] = manager2;
43797
+ }
43798
+ manager2.setAbles(ables);
43799
+ });
43800
+ };
43570
43801
  MoveableManager2.defaultProps = {
43571
43802
  target: null,
43572
43803
  dragTarget: null,
@@ -43578,6 +43809,7 @@ var MoveableManager$1 = /* @__PURE__ */ function(_super) {
43578
43809
  wrapperMoveable: null,
43579
43810
  parentPosition: null,
43580
43811
  portalContainer: null,
43812
+ useResizeObserver: false,
43581
43813
  ables: [],
43582
43814
  pinchThreshold: 20,
43583
43815
  dragArea: false,
@@ -43615,14 +43847,16 @@ var Groupable = {
43615
43847
  left,
43616
43848
  top
43617
43849
  };
43850
+ var props = moveable.props;
43618
43851
  return targets.map(function(target, i2) {
43619
43852
  return React.createElement(MoveableManager$1, {
43620
43853
  key: "moveable" + i2,
43621
43854
  ref: refs(moveable, "moveables", i2),
43622
43855
  target,
43623
43856
  origin: false,
43624
- cssStyled: moveable.props.cssStyled,
43625
- customStyledMap: moveable.props.customStyledMap,
43857
+ cssStyled: props.cssStyled,
43858
+ customStyledMap: props.customStyledMap,
43859
+ useResizeObserver: props.useResizeObserver,
43626
43860
  parentMoveable: moveable,
43627
43861
  parentPosition: position
43628
43862
  });
@@ -43630,12 +43864,15 @@ var Groupable = {
43630
43864
  }
43631
43865
  };
43632
43866
  var Clickable = makeAble("clickable", {
43633
- props: {},
43867
+ props: {
43868
+ clickable: Boolean
43869
+ },
43634
43870
  events: {
43635
43871
  onClick: "click",
43636
43872
  onClickGroup: "clickGroup"
43637
43873
  },
43638
43874
  always: true,
43875
+ dragRelation: "weak",
43639
43876
  dragStart: function(moveable, e) {
43640
43877
  if (!e.isRequest) {
43641
43878
  addEvent(window, "click", moveable.onPreventClick, true);
@@ -43653,10 +43890,12 @@ var Clickable = makeAble("clickable", {
43653
43890
  var target = moveable.state.target;
43654
43891
  var inputEvent = e.inputEvent;
43655
43892
  var inputTarget = e.inputTarget;
43656
- if (!e.isDrag) {
43893
+ var isMoveableElement = moveable.isMoveableElement(inputTarget);
43894
+ var containsElement = !isMoveableElement && moveable.controlBox.getElement().contains(inputTarget);
43895
+ if (!e.isDrag || containsElement) {
43657
43896
  this.unset(moveable);
43658
43897
  }
43659
- if (!inputEvent || !inputTarget || e.isDrag || moveable.isMoveableElement(inputTarget)) {
43898
+ if (!inputEvent || !inputTarget || e.isDrag || moveable.isMoveableElement(inputTarget) || containsElement) {
43660
43899
  return;
43661
43900
  }
43662
43901
  var containsTarget = target.contains(inputTarget);
@@ -43693,15 +43932,15 @@ var Clickable = makeAble("clickable", {
43693
43932
  containsTarget
43694
43933
  }));
43695
43934
  },
43696
- dragControlEnd: function(moveable) {
43697
- this.endEvent(moveable);
43935
+ dragControlEnd: function(moveable, e) {
43936
+ this.dragEnd(moveable, e);
43698
43937
  },
43699
- dragGroupControlEnd: function(moveable) {
43700
- this.endEvent(moveable);
43938
+ dragGroupControlEnd: function(moveable, e) {
43939
+ this.dragEnd(moveable, e);
43701
43940
  },
43702
43941
  endEvent: function(moveable) {
43703
43942
  var _this = this;
43704
- requestAnimationFrame(function() {
43943
+ requestAnimationFrame$1(function() {
43705
43944
  _this.unset(moveable);
43706
43945
  });
43707
43946
  },
@@ -43753,7 +43992,7 @@ var edgeDraggable = makeAble("edgeDraggable", {
43753
43992
  return Draggable.dragGroupEnd(moveable, getDraggableEvent(e));
43754
43993
  },
43755
43994
  unset: function(moveable) {
43756
- moveable.state.dragInfo = null;
43995
+ return Draggable.unset(moveable);
43757
43996
  }
43758
43997
  });
43759
43998
  var IndividualGroupable = {
@@ -43851,31 +44090,6 @@ var MoveableGroup = /* @__PURE__ */ function(_super) {
43851
44090
  return _this;
43852
44091
  }
43853
44092
  var __proto = MoveableGroup2.prototype;
43854
- __proto.updateEvent = function(prevProps) {
43855
- var state = this.state;
43856
- var props = this.props;
43857
- var prevTarget = prevProps.dragTarget || state.target;
43858
- var nextTarget = props.dragTarget || this.areaElement;
43859
- if (prevTarget !== nextTarget) {
43860
- unset(this, "targetGesto");
43861
- unset(this, "controlGesto");
43862
- state.target = null;
43863
- }
43864
- if (!state.target) {
43865
- state.target = this.areaElement;
43866
- this.controlBox.getElement().style.display = "block";
43867
- this.targetGesto = getTargetAbleGesto(this, nextTarget, "Group");
43868
- this.controlGesto = getAbleGesto(this, this.controlBox.getElement(), "controlAbles", "GroupControl");
43869
- }
43870
- var isContainerChanged = !equals(prevProps.container, props.container);
43871
- if (isContainerChanged) {
43872
- state.container = props.container;
43873
- }
43874
- var _a3 = this.differ.update(props.targets), added = _a3.added, changed = _a3.changed, removed = _a3.removed;
43875
- if (isContainerChanged || added.length || changed.length || removed.length) {
43876
- this.updateRect();
43877
- }
43878
- };
43879
44093
  __proto.checkUpdate = function() {
43880
44094
  this.updateAbles();
43881
44095
  };
@@ -43942,7 +44156,38 @@ var MoveableGroup = /* @__PURE__ */ function(_super) {
43942
44156
  }
43943
44157
  };
43944
44158
  __proto.updateAbles = function() {
43945
- _super.prototype.updateAbles.call(this, __spreadArrays$1(this.props.ables, [Groupable]), "Group");
44159
+ _super.prototype.updateAbles.call(this, __spreadArray(__spreadArray([], this.props.ables), [Groupable]), "Group");
44160
+ };
44161
+ __proto._updateTargets = function() {
44162
+ _super.prototype._updateTargets.call(this);
44163
+ this._prevTarget = this.props.dragTarget || this.areaElement;
44164
+ };
44165
+ __proto._updateEvents = function() {
44166
+ var state = this.state;
44167
+ var props = this.props;
44168
+ var prevTarget = this._prevTarget;
44169
+ var nextTarget = props.dragTarget || this.areaElement;
44170
+ if (prevTarget !== nextTarget) {
44171
+ unset(this, "targetGesto");
44172
+ unset(this, "controlGesto");
44173
+ state.target = null;
44174
+ }
44175
+ if (!state.target) {
44176
+ state.target = this.areaElement;
44177
+ this.controlBox.getElement().style.display = "block";
44178
+ this.targetGesto = getTargetAbleGesto(this, nextTarget, "Group");
44179
+ this.controlGesto = getAbleGesto(this, this.controlBox.getElement(), "controlAbles", "GroupControl");
44180
+ }
44181
+ var isContainerChanged = !equals(state.container, props.container);
44182
+ if (isContainerChanged) {
44183
+ state.container = props.container;
44184
+ }
44185
+ var _a3 = this.differ.update(props.targets), added = _a3.added, changed = _a3.changed, removed = _a3.removed;
44186
+ if (isContainerChanged || added.length || changed.length || removed.length) {
44187
+ this.updateRect();
44188
+ }
44189
+ };
44190
+ __proto._updateObserver = function() {
43946
44191
  };
43947
44192
  MoveableGroup2.defaultProps = __assign$2(__assign$2({}, MoveableManager$1.defaultProps), {
43948
44193
  transformOrigin: ["50%", "50%"],
@@ -44021,14 +44266,16 @@ var MoveableIndividualGroup = /* @__PURE__ */ function(_super) {
44021
44266
  };
44022
44267
  __proto.updateRenderPoses = function() {
44023
44268
  };
44024
- __proto.updateEvent = function() {
44025
- };
44026
44269
  __proto.checkUpdate = function() {
44027
44270
  };
44028
44271
  __proto.triggerEvent = function() {
44029
44272
  };
44030
44273
  __proto.updateAbles = function() {
44031
44274
  };
44275
+ __proto._updateEvents = function() {
44276
+ };
44277
+ __proto._updateObserver = function() {
44278
+ };
44032
44279
  return MoveableIndividualGroup2;
44033
44280
  }(MoveableManager$1);
44034
44281
  var InitialMoveable = /* @__PURE__ */ function(_super) {
@@ -44056,7 +44303,7 @@ var InitialMoveable = /* @__PURE__ */ function(_super) {
44056
44303
  this.defaultStyled = styled("div", prefixCSS(PREFIX, MOVEABLE_CSS + style));
44057
44304
  };
44058
44305
  InitialMoveable2.getTotalAbles = function() {
44059
- return __spreadArrays$1([Default, Groupable, IndividualGroupable, DragArea], this.defaultAbles);
44306
+ return __spreadArray([Default, Groupable, IndividualGroupable, DragArea], this.defaultAbles);
44060
44307
  };
44061
44308
  __proto.render = function() {
44062
44309
  var moveableContructor = this.constructor;
@@ -44064,12 +44311,11 @@ var InitialMoveable = /* @__PURE__ */ function(_super) {
44064
44311
  moveableContructor.makeStyled();
44065
44312
  }
44066
44313
  var _a3 = this.props, userAbles = _a3.ables, userProps = _a3.props, props = __rest(_a3, ["ables", "props"]);
44067
- var refTargets = getRefTargets(props.target || props.targets);
44314
+ var refTargets = this._updateRefs(true);
44068
44315
  var elementTargets = getElementTargets(refTargets, this.selectorMap);
44069
- this.refTargets = refTargets;
44070
44316
  var isGroup = elementTargets.length > 1;
44071
44317
  var totalAbles = moveableContructor.getTotalAbles();
44072
- var ables = __spreadArrays$1(totalAbles, userAbles || []);
44318
+ var ables = __spreadArray(__spreadArray([], totalAbles), userAbles || []);
44073
44319
  var nextProps = __assign$2(__assign$2(__assign$2({}, props), userProps || {}), {
44074
44320
  ables,
44075
44321
  cssStyled: moveableContructor.defaultStyled,
@@ -44102,15 +44348,20 @@ var InitialMoveable = /* @__PURE__ */ function(_super) {
44102
44348
  }
44103
44349
  };
44104
44350
  __proto.componentDidMount = function() {
44105
- this.updateRefs();
44351
+ this._updateRefs();
44106
44352
  };
44107
44353
  __proto.componentDidUpdate = function() {
44108
- this.updateRefs();
44354
+ this._updateRefs();
44109
44355
  };
44110
- __proto.updateRefs = function(isReset) {
44111
- var refTargets = getRefTargets(this.props.target || this.props.targets);
44112
- var isUpdate = this.refTargets.some(function(target, i2) {
44113
- var nextTarget = refTargets[i2];
44356
+ __proto.getManager = function() {
44357
+ return this.moveable;
44358
+ };
44359
+ __proto._updateRefs = function(isRender) {
44360
+ var prevRefTargets = this.refTargets;
44361
+ var nextRefTargets = getRefTargets(this.props.target || this.props.targets);
44362
+ var isBrowser = typeof document !== "undefined";
44363
+ var isUpdate = prevRefTargets.length !== nextRefTargets.length || prevRefTargets.some(function(target, i2) {
44364
+ var nextTarget = nextRefTargets[i2];
44114
44365
  if (!target && !nextTarget) {
44115
44366
  return false;
44116
44367
  } else if (target !== nextTarget) {
@@ -44118,11 +44369,11 @@ var InitialMoveable = /* @__PURE__ */ function(_super) {
44118
44369
  }
44119
44370
  return false;
44120
44371
  });
44121
- var selectorMap = isReset ? {} : this.selectorMap;
44372
+ var selectorMap = this.selectorMap;
44122
44373
  var nextSelectorMap = {};
44123
44374
  this.refTargets.forEach(function(target) {
44124
44375
  if (isString(target)) {
44125
- if (!selectorMap[target]) {
44376
+ if (!selectorMap[target] && isBrowser) {
44126
44377
  isUpdate = true;
44127
44378
  nextSelectorMap[target] = [].slice.call(document.querySelectorAll(target));
44128
44379
  } else {
@@ -44130,13 +44381,12 @@ var InitialMoveable = /* @__PURE__ */ function(_super) {
44130
44381
  }
44131
44382
  }
44132
44383
  });
44384
+ this.refTargets = nextRefTargets;
44133
44385
  this.selectorMap = nextSelectorMap;
44134
- if (isUpdate) {
44386
+ if (!isRender && isUpdate) {
44135
44387
  this.forceUpdate();
44136
44388
  }
44137
- };
44138
- __proto.getManager = function() {
44139
- return this.moveable;
44389
+ return nextRefTargets;
44140
44390
  };
44141
44391
  InitialMoveable2.defaultAbles = [];
44142
44392
  InitialMoveable2.customStyledMap = {};