targetj 1.0.235 → 1.0.237

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/Export.js CHANGED
@@ -35,6 +35,7 @@ import * as Easing from './build/Easing.js';
35
35
  import * as TargetExecutor from './build/TargetExecutor.js';
36
36
  import * as AnimationManager from './build/AnimationManager.js';
37
37
  import * as AnimationUtil from './build/AnimationUtil.js';
38
+ import * as VisibilityUtil from './build/VisibilityUtil.js';
38
39
 
39
40
  const TargetJS = {
40
41
  ...App,
@@ -53,7 +54,8 @@ const TargetJS = {
53
54
  ...Easing,
54
55
  ...TargetExecutor,
55
56
  ...AnimationManager,
56
- ...AnimationUtil
57
+ ...AnimationUtil,
58
+ ...VisibilityUtil
57
59
  };
58
60
 
59
61
  if (typeof window !== 'undefined') {
@@ -649,9 +649,37 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
649
649
  }, {
650
650
  key: "isScheduledPending",
651
651
  value: function isScheduledPending(key) {
652
+ var remainingTime = this.getScheduleRemainingTime(key);
653
+ if (_TUtil.TUtil.isDefined(remainingTime)) {
654
+ return remainingTime > 0;
655
+ }
652
656
  var lastScheduledTime = this.getScheduleTimeStamp(key);
653
657
  var interval = this.getTargetInterval(key);
654
- return lastScheduledTime && lastScheduledTime + interval > _TUtil.TUtil.now();
658
+ return _TUtil.TUtil.isDefined(lastScheduledTime) && lastScheduledTime + interval > _TUtil.TUtil.now();
659
+ }
660
+ }, {
661
+ key: "getScheduleRemainingTime",
662
+ value: function getScheduleRemainingTime(key) {
663
+ var _this$targetValues$ke8;
664
+ return (_this$targetValues$ke8 = this.targetValues[key]) === null || _this$targetValues$ke8 === void 0 ? void 0 : _this$targetValues$ke8.scheduleRemainingTime;
665
+ }
666
+ }, {
667
+ key: "setScheduleRemainingTime",
668
+ value: function setScheduleRemainingTime(key, remainingTime) {
669
+ var targetValue = this.targetValues[key];
670
+ if (!targetValue) {
671
+ return;
672
+ }
673
+ targetValue.scheduleRemainingTime = remainingTime;
674
+ }
675
+ }, {
676
+ key: "resetScheduleRemainingTime",
677
+ value: function resetScheduleRemainingTime(key) {
678
+ var targetValue = this.targetValues[key];
679
+ if (!targetValue) {
680
+ return;
681
+ }
682
+ delete targetValue.scheduleRemainingTime;
655
683
  }
656
684
  }, {
657
685
  key: "isTargetInLoop",
@@ -685,14 +713,14 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
685
713
  }, {
686
714
  key: "getTargetInitialValue",
687
715
  value: function getTargetInitialValue(key) {
688
- var _this$targetValues$ke8;
689
- return (_this$targetValues$ke8 = this.targetValues[key]) === null || _this$targetValues$ke8 === void 0 ? void 0 : _this$targetValues$ke8.initialValue;
716
+ var _this$targetValues$ke9;
717
+ return (_this$targetValues$ke9 = this.targetValues[key]) === null || _this$targetValues$ke9 === void 0 ? void 0 : _this$targetValues$ke9.initialValue;
690
718
  }
691
719
  }, {
692
720
  key: "getLastUpdate",
693
721
  value: function getLastUpdate(key) {
694
- var _this$targetValues$ke9;
695
- return (_this$targetValues$ke9 = this.targetValues[key]) === null || _this$targetValues$ke9 === void 0 ? void 0 : _this$targetValues$ke9.lastUpdate;
722
+ var _this$targetValues$ke10;
723
+ return (_this$targetValues$ke10 = this.targetValues[key]) === null || _this$targetValues$ke10 === void 0 ? void 0 : _this$targetValues$ke10.lastUpdate;
696
724
  }
697
725
  }, {
698
726
  key: "getDimLastUpdate",
@@ -703,8 +731,8 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
703
731
  }, {
704
732
  key: "getTargetActivationTime",
705
733
  value: function getTargetActivationTime(key) {
706
- var _this$targetValues$ke10, _this$targetValues$ke11;
707
- return (_this$targetValues$ke10 = (_this$targetValues$ke11 = this.targetValues[key]) === null || _this$targetValues$ke11 === void 0 ? void 0 : _this$targetValues$ke11.activationTime) !== null && _this$targetValues$ke10 !== void 0 ? _this$targetValues$ke10 : 0;
734
+ var _this$targetValues$ke11, _this$targetValues$ke12;
735
+ return (_this$targetValues$ke11 = (_this$targetValues$ke12 = this.targetValues[key]) === null || _this$targetValues$ke12 === void 0 ? void 0 : _this$targetValues$ke12.activationTime) !== null && _this$targetValues$ke11 !== void 0 ? _this$targetValues$ke11 : 0;
708
736
  }
709
737
  }, {
710
738
  key: "getTargetCreationTime",
@@ -727,8 +755,8 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
727
755
  }, {
728
756
  key: "getTargetEasing",
729
757
  value: function getTargetEasing(key) {
730
- var _this$targetValues$ke12;
731
- var easing = (_this$targetValues$ke12 = this.targetValues[key]) === null || _this$targetValues$ke12 === void 0 ? void 0 : _this$targetValues$ke12.easing;
758
+ var _this$targetValues$ke13;
759
+ var easing = (_this$targetValues$ke13 = this.targetValues[key]) === null || _this$targetValues$ke13 === void 0 ? void 0 : _this$targetValues$ke13.easing;
732
760
  var target = this.targets[key];
733
761
  if (!target) {
734
762
  return easing;
@@ -738,8 +766,8 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
738
766
  }, {
739
767
  key: "getTargetInterval",
740
768
  value: function getTargetInterval(key) {
741
- var _this$targetValues$ke13, _this$targetValues$ke14;
742
- var interval = (_this$targetValues$ke13 = (_this$targetValues$ke14 = this.targetValues[key]) === null || _this$targetValues$ke14 === void 0 ? void 0 : _this$targetValues$ke14.interval) !== null && _this$targetValues$ke13 !== void 0 ? _this$targetValues$ke13 : 0;
769
+ var _this$targetValues$ke14, _this$targetValues$ke15;
770
+ var interval = (_this$targetValues$ke14 = (_this$targetValues$ke15 = this.targetValues[key]) === null || _this$targetValues$ke15 === void 0 ? void 0 : _this$targetValues$ke15.interval) !== null && _this$targetValues$ke14 !== void 0 ? _this$targetValues$ke14 : 0;
743
771
  var target = this.targets[key];
744
772
  if (!target) {
745
773
  return interval;
@@ -749,8 +777,8 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
749
777
  }, {
750
778
  key: "getTargetSteps",
751
779
  value: function getTargetSteps(key) {
752
- var _this$targetValues$ke15, _this$targetValues$ke16;
753
- var steps = (_this$targetValues$ke15 = (_this$targetValues$ke16 = this.targetValues[key]) === null || _this$targetValues$ke16 === void 0 ? void 0 : _this$targetValues$ke16.steps) !== null && _this$targetValues$ke15 !== void 0 ? _this$targetValues$ke15 : 0;
780
+ var _this$targetValues$ke16, _this$targetValues$ke17;
781
+ var steps = (_this$targetValues$ke16 = (_this$targetValues$ke17 = this.targetValues[key]) === null || _this$targetValues$ke17 === void 0 ? void 0 : _this$targetValues$ke17.steps) !== null && _this$targetValues$ke16 !== void 0 ? _this$targetValues$ke16 : 0;
754
782
  var target = this.targets[key];
755
783
  if (!target) {
756
784
  return steps;
@@ -760,8 +788,8 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
760
788
  }, {
761
789
  key: "getTargetCycles",
762
790
  value: function getTargetCycles(key) {
763
- var _this$targetValues$ke17, _this$targetValues$ke18;
764
- var cycles = (_this$targetValues$ke17 = (_this$targetValues$ke18 = this.targetValues[key]) === null || _this$targetValues$ke18 === void 0 ? void 0 : _this$targetValues$ke18.cycles) !== null && _this$targetValues$ke17 !== void 0 ? _this$targetValues$ke17 : 1;
791
+ var _this$targetValues$ke18, _this$targetValues$ke19;
792
+ var cycles = (_this$targetValues$ke18 = (_this$targetValues$ke19 = this.targetValues[key]) === null || _this$targetValues$ke19 === void 0 ? void 0 : _this$targetValues$ke19.cycles) !== null && _this$targetValues$ke18 !== void 0 ? _this$targetValues$ke18 : 1;
765
793
  var target = this.targets[key];
766
794
  if (!target) {
767
795
  return cycles;
@@ -771,14 +799,14 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
771
799
  }, {
772
800
  key: "getTargetCycle",
773
801
  value: function getTargetCycle(key) {
774
- var _this$targetValues$ke19, _this$targetValues$ke20;
775
- return (_this$targetValues$ke19 = (_this$targetValues$ke20 = this.targetValues[key]) === null || _this$targetValues$ke20 === void 0 ? void 0 : _this$targetValues$ke20.cycle) !== null && _this$targetValues$ke19 !== void 0 ? _this$targetValues$ke19 : 0;
802
+ var _this$targetValues$ke20, _this$targetValues$ke21;
803
+ return (_this$targetValues$ke20 = (_this$targetValues$ke21 = this.targetValues[key]) === null || _this$targetValues$ke21 === void 0 ? void 0 : _this$targetValues$ke21.cycle) !== null && _this$targetValues$ke20 !== void 0 ? _this$targetValues$ke20 : 0;
776
804
  }
777
805
  }, {
778
806
  key: "getValueListPointer",
779
807
  value: function getValueListPointer(key) {
780
- var _this$targetValues$ke21, _this$targetValues$ke22;
781
- return (_this$targetValues$ke21 = (_this$targetValues$ke22 = this.targetValues[key]) === null || _this$targetValues$ke22 === void 0 ? void 0 : _this$targetValues$ke22.valuePointer) !== null && _this$targetValues$ke21 !== void 0 ? _this$targetValues$ke21 : 0;
808
+ var _this$targetValues$ke22, _this$targetValues$ke23;
809
+ return (_this$targetValues$ke22 = (_this$targetValues$ke23 = this.targetValues[key]) === null || _this$targetValues$ke23 === void 0 ? void 0 : _this$targetValues$ke23.valuePointer) !== null && _this$targetValues$ke22 !== void 0 ? _this$targetValues$ke22 : 0;
782
810
  }
783
811
  }, {
784
812
  key: "incrementTargetCycle",
@@ -1000,9 +1028,9 @@ var BaseModel = exports.BaseModel = /*#__PURE__*/function () {
1000
1028
  }, {
1001
1029
  key: "addToAnimatingMap",
1002
1030
  value: function addToAnimatingMap(key) {
1003
- var _this$targetValues$ke23, _this$getParent7;
1031
+ var _this$targetValues$ke24, _this$getParent7;
1004
1032
  var record = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1005
- if ((_this$targetValues$ke23 = this.targetValues[key]) !== null && _this$targetValues$ke23 !== void 0 && _this$targetValues$ke23.snapAnimation) {
1033
+ if ((_this$targetValues$ke24 = this.targetValues[key]) !== null && _this$targetValues$ke24 !== void 0 && _this$targetValues$ke24.snapAnimation) {
1006
1034
  return;
1007
1035
  }
1008
1036
  this.animatingMap || (this.animatingMap = new Map());
package/build/Bracket.js CHANGED
@@ -159,6 +159,10 @@ var Bracket = exports.Bracket = /*#__PURE__*/function (_TModel) {
159
159
  key: "shouldCalculateChildren",
160
160
  value: function shouldCalculateChildren() {
161
161
  var nowVisible = this.isVisible();
162
+ var hasEventDirty = this.hasEventDirty();
163
+ if (hasEventDirty) {
164
+ return true;
165
+ }
162
166
  if (this.currentBrakcetStatus >= 1 || this.isNowVisible || this.isNowInvisible) {
163
167
  this.currentBrakcetStatus = Math.max(0, this.currentBrakcetStatus - 1);
164
168
  return true;
@@ -174,7 +178,8 @@ var Bracket = exports.Bracket = /*#__PURE__*/function (_TModel) {
174
178
  }, {
175
179
  key: "getDirtyLayout",
176
180
  value: function getDirtyLayout() {
177
- return this.getRealParent().managesOwnScroll() ? this.getRealParent().backupDirtyLayout : this.dirtyLayout;
181
+ var parentDirty = this.getRealParent().managesOwnScroll() ? this.getRealParent().backupDirtyLayout : false;
182
+ return this.dirtyLayout || parentDirty || false;
178
183
  }
179
184
  }, {
180
185
  key: "validateVisibilityInParent",
@@ -486,6 +486,8 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
486
486
  var clickHandler = _SearchUtil.SearchUtil.findFirstClickHandler(tmodel);
487
487
  var canAcceptClick = !this.start0 || clickHandler === this.currentHandlers.click && (clickHandler !== this.currentHandlers.swipe || this.getSwipeDistance() < 5);
488
488
  if (clickHandler && canAcceptClick) {
489
+ clickHandler.markEventDirty();
490
+ clickHandler.markLayoutDirty('event');
489
491
  this.eventQueue.length = 0;
490
492
  this.eventQueue.push({
491
493
  eventName: eventName,
@@ -498,6 +500,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
498
500
  });
499
501
  }
500
502
  this.clearEnd();
503
+ this.clearStart();
501
504
  this.touchCount = 0;
502
505
  event.stopPropagation();
503
506
  break;
@@ -543,7 +546,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
543
546
  case 'resize':
544
547
  this.windowEpoch++;
545
548
  this.resizeRoot();
546
- (0, _App.getManager)().getVisibles().forEach(function (t) {
549
+ (0, _App.getManager)().getAvailableDoms().forEach(function (t) {
547
550
  if (t.targets['onResize']) {
548
551
  t.markLayoutDirty('resize-event');
549
552
  }
@@ -1078,7 +1081,7 @@ var EventListener = exports.EventListener = /*#__PURE__*/function () {
1078
1081
  this.currentTouch.prevDeltaY += deltaY;
1079
1082
  this.currentTouch.deltaX = this.currentTouch.prevDeltaX;
1080
1083
  this.currentTouch.deltaY = this.currentTouch.prevDeltaY;
1081
- if (this.scrollEndTimeStamp.x > 0 || this.scrollEndTimeStamp.y > 0) {
1084
+ if (endDelay && (this.scrollEndTimeStamp.x > 0 || this.scrollEndTimeStamp.y > 0)) {
1082
1085
  (0, _App.getRunScheduler)().schedule(endDelay, 'scroll-end-check');
1083
1086
  }
1084
1087
  }
@@ -18,7 +18,11 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur
18
18
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
19
19
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
20
20
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
21
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
22
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
21
23
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
24
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
25
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
22
26
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
23
27
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
28
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -495,9 +499,61 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
495
499
  }
496
500
  if (tmodel.isNowInvisible) {
497
501
  this.addToLocationList(tmodel);
502
+ this.pauseSchedules(tmodel);
503
+ }
504
+ if (tmodel.isNowVisible) {
505
+ this.resumeSchedules(tmodel);
498
506
  }
499
507
  tmodel.addToParentVisibleChildren();
500
508
  }
509
+ }, {
510
+ key: "pauseSchedules",
511
+ value: function pauseSchedules(tmodel) {
512
+ if (tmodel.type === 'BI') {
513
+ return;
514
+ }
515
+ var keys = new Set([].concat(_toConsumableArray(tmodel.activeTargetList), _toConsumableArray(tmodel.updatingTargetList)));
516
+ var _iterator = _createForOfIteratorHelper(keys),
517
+ _step;
518
+ try {
519
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
520
+ var key = _step.value;
521
+ var target = tmodel.targets[key];
522
+ if (_TUtil.TUtil.isDefined(tmodel.getScheduleTimeStamp(key)) && (target === null || target === void 0 ? void 0 : target.pauseOn) === 'hidden') {
523
+ _TUtil.TUtil.pauseSchedule(tmodel, key);
524
+ }
525
+ }
526
+ } catch (err) {
527
+ _iterator.e(err);
528
+ } finally {
529
+ _iterator.f();
530
+ }
531
+ }
532
+ }, {
533
+ key: "resumeSchedules",
534
+ value: function resumeSchedules(tmodel) {
535
+ if (tmodel.type === 'BI') {
536
+ return;
537
+ }
538
+ var keys = new Set([].concat(_toConsumableArray(tmodel.activeTargetList), _toConsumableArray(tmodel.updatingTargetList)));
539
+ var _iterator2 = _createForOfIteratorHelper(keys),
540
+ _step2;
541
+ try {
542
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
543
+ var key = _step2.value;
544
+ var target = tmodel.targets[key];
545
+ var remaining = tmodel.getScheduleRemainingTime(key);
546
+ if (_TUtil.TUtil.isDefined(remaining) && (target === null || target === void 0 ? void 0 : target.pauseOn) === 'hidden') {
547
+ _TUtil.TUtil.resumeSchedule(tmodel, key);
548
+ (0, _App.getRunScheduler)().schedule(remaining, 'resume-' + tmodel.oid + '-' + key);
549
+ }
550
+ }
551
+ } catch (err) {
552
+ _iterator2.e(err);
553
+ } finally {
554
+ _iterator2.f();
555
+ }
556
+ }
501
557
  }, {
502
558
  key: "calculateTargets",
503
559
  value: function calculateTargets(tmodel) {
@@ -512,17 +568,17 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
512
568
  while (tmodel.activatedTargets.length && guard++ < 50) {
513
569
  var batch = tmodel.activatedTargets.slice(0);
514
570
  tmodel.activatedTargets.length = 0;
515
- var _iterator = _createForOfIteratorHelper(batch),
516
- _step;
571
+ var _iterator3 = _createForOfIteratorHelper(batch),
572
+ _step3;
517
573
  try {
518
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
519
- var key = _step.value;
574
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
575
+ var key = _step3.value;
520
576
  (0, _App.getTargetManager)().applyTargetValue(tmodel, key);
521
577
  }
522
578
  } catch (err) {
523
- _iterator.e(err);
579
+ _iterator3.e(err);
524
580
  } finally {
525
- _iterator.f();
581
+ _iterator3.f();
526
582
  }
527
583
  }
528
584
  (0, _App.getTargetManager)().applyTargetValues(tmodel);
@@ -561,11 +617,11 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
561
617
  var list = _this2.resumePausedList.slice();
562
618
  _this2.resumePausedList.length = 0;
563
619
  _this2.resumePausedMap = {};
564
- var _iterator2 = _createForOfIteratorHelper(list),
565
- _step2;
620
+ var _iterator4 = _createForOfIteratorHelper(list),
621
+ _step4;
566
622
  try {
567
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
568
- var tmodel = _step2.value;
623
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
624
+ var tmodel = _step4.value;
569
625
  var batch = tmodel.pausedBatch;
570
626
  if (!batch || !tmodel.hasDom()) {
571
627
  continue;
@@ -577,9 +633,9 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
577
633
  }
578
634
  }
579
635
  } catch (err) {
580
- _iterator2.e(err);
636
+ _iterator4.e(err);
581
637
  } finally {
582
- _iterator2.f();
638
+ _iterator4.f();
583
639
  }
584
640
  });
585
641
  });
@@ -591,20 +647,20 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
591
647
  if ((externalEventMap === null || externalEventMap === void 0 ? void 0 : externalEventMap.size) > 0) {
592
648
  var eventTargets = [];
593
649
  var eventMap = _TargetData.TargetData.allEventMap;
594
- var _iterator3 = _createForOfIteratorHelper(externalEventMap),
595
- _step3;
650
+ var _iterator5 = _createForOfIteratorHelper(externalEventMap),
651
+ _step5;
596
652
  try {
597
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
598
- var _step3$value = _slicedToArray(_step3.value, 1),
599
- targetName = _step3$value[0];
653
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
654
+ var _step5$value = _slicedToArray(_step5.value, 1),
655
+ targetName = _step5$value[0];
600
656
  if (eventMap[targetName](tmodel)) {
601
657
  eventTargets.push(tmodel.allTargetMap[targetName]);
602
658
  }
603
659
  }
604
660
  } catch (err) {
605
- _iterator3.e(err);
661
+ _iterator5.e(err);
606
662
  } finally {
607
- _iterator3.f();
663
+ _iterator5.f();
608
664
  }
609
665
  this.runEventTargets(tmodel, eventTargets);
610
666
  }
@@ -616,20 +672,20 @@ var LocationManager = exports.LocationManager = /*#__PURE__*/function () {
616
672
  var eventMap = _TargetData.TargetData.internalEventMap;
617
673
  var internalEventMap = tmodel.internalEventMap;
618
674
  if ((internalEventMap === null || internalEventMap === void 0 ? void 0 : internalEventMap.size) > 0) {
619
- var _iterator4 = _createForOfIteratorHelper(internalEventMap),
620
- _step4;
675
+ var _iterator6 = _createForOfIteratorHelper(internalEventMap),
676
+ _step6;
621
677
  try {
622
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
623
- var _step4$value = _slicedToArray(_step4.value, 1),
624
- targetName = _step4$value[0];
678
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
679
+ var _step6$value = _slicedToArray(_step6.value, 1),
680
+ targetName = _step6$value[0];
625
681
  if (eventMap[targetName](tmodel)) {
626
682
  eventTargets.push(tmodel.allTargetMap[targetName]);
627
683
  }
628
684
  }
629
685
  } catch (err) {
630
- _iterator4.e(err);
686
+ _iterator6.e(err);
631
687
  } finally {
632
- _iterator4.f();
688
+ _iterator6.f();
633
689
  }
634
690
  }
635
691
  this.runEventTargets(tmodel, eventTargets);
package/build/Moves.js CHANGED
@@ -131,25 +131,30 @@ var Moves = exports.Moves = /*#__PURE__*/function () {
131
131
  }, {
132
132
  key: "shake",
133
133
  value: function shake(tmodel) {
134
- var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : tmodel.getWidth();
135
- var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : tmodel.getHeight();
136
- var _ref3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
134
+ var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
135
+ _ref3$xStart = _ref3.xStart,
136
+ xStart = _ref3$xStart === void 0 ? undefined : _ref3$xStart,
137
+ _ref3$width = _ref3.width,
138
+ width = _ref3$width === void 0 ? undefined : _ref3$width,
139
+ _ref3$height = _ref3.height,
140
+ height = _ref3$height === void 0 ? undefined : _ref3$height,
137
141
  _ref3$bFactor = _ref3.bFactor,
138
142
  bFactor = _ref3$bFactor === void 0 ? 0.6 : _ref3$bFactor,
139
143
  _ref3$cFactor = _ref3.cFactor,
140
144
  cFactor = _ref3$cFactor === void 0 ? 0.3 : _ref3$cFactor,
141
145
  _ref3$strength = _ref3.strength,
142
146
  strength = _ref3$strength === void 0 ? 20 : _ref3$strength;
143
- var xStart = (tmodel.getParentValue('width') - width) / 2;
147
+ var widthStart = _TUtil.TUtil.isDefined(width) ? width : tmodel.getWidth();
148
+ var heightStart = _TUtil.TUtil.isDefined(height) ? height : tmodel.getHeight();
149
+ var resolvedXStart = _TUtil.TUtil.isDefined(xStart) ? xStart : tmodel.getX();
144
150
  var yStart = tmodel.getY();
145
- var widthStart = width;
146
- var heightStart = height;
147
151
  var bounce = Moves.bounce(yStart - strength, yStart, {
148
- xStart: xStart,
152
+ xStart: resolvedXStart,
149
153
  widthStart: widthStart,
150
154
  heightStart: heightStart,
151
155
  bFactor: bFactor,
152
- cFactor: cFactor
156
+ cFactor: cFactor,
157
+ rIncrement: 0
153
158
  });
154
159
  return {
155
160
  x: bounce.x,
@@ -162,7 +162,7 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
162
162
  value: function onPageClose() {
163
163
  _App.tApp.resizeLastUpdate = _TUtil.TUtil.now();
164
164
  (0, _App.getEvents)().resizeRoot();
165
- _App.tApp.manager.getVisibles().forEach(function (tmodel) {
165
+ _App.tApp.manager.getAvailableDoms().forEach(function (tmodel) {
166
166
  (0, _App.getLocationManager)().runEventTargets(tmodel, ['onPageClose']);
167
167
  });
168
168
  }
package/build/TModel.js CHANGED
@@ -8,6 +8,7 @@ var _BaseModel2 = require("./BaseModel.js");
8
8
  var _App = require("./App.js");
9
9
  var _Viewport = require("./Viewport.js");
10
10
  var _TUtil = require("./TUtil.js");
11
+ var _VisibilityUtil = require("./VisibilityUtil.js");
11
12
  var _TargetData = require("./TargetData.js");
12
13
  var _SearchUtil = require("./SearchUtil.js");
13
14
  var _TargetUtil = require("./TargetUtil.js");
@@ -166,10 +167,11 @@ var TModel = exports.TModel = /*#__PURE__*/function (_BaseModel) {
166
167
  var foundKey = Object.keys(this.actualValues).find(function (key) {
167
168
  return _this2.actualValues[key] === child;
168
169
  });
170
+ var childDefinition = _TUtil.TUtil.cloneTargetDefinition(child);
169
171
  if (foundKey) {
170
- child = new TModel(child.id || foundKey, child);
172
+ child = new TModel(childDefinition.id || foundKey, childDefinition);
171
173
  } else {
172
- child = new TModel("".concat(this.oid, "_"), child);
174
+ child = new TModel("".concat(this.oid, "_"), childDefinition);
173
175
  }
174
176
  }
175
177
  if (!child.toDiscard) {
@@ -347,6 +349,9 @@ var TModel = exports.TModel = /*#__PURE__*/function (_BaseModel) {
347
349
  key: "markEventDirty",
348
350
  value: function markEventDirty() {
349
351
  this.eventDirtyEpoch = (0, _App.getEvents)().eventEpoch;
352
+ if (this.bracket) {
353
+ this.bracket.markEventDirty();
354
+ }
350
355
  if (this.parent) {
351
356
  this.parent.markEventDirty();
352
357
  }
@@ -644,7 +649,7 @@ var TModel = exports.TModel = /*#__PURE__*/function (_BaseModel) {
644
649
  }, {
645
650
  key: "calcVisibility",
646
651
  value: function calcVisibility() {
647
- return _TUtil.TUtil.calcVisibility(this);
652
+ return _VisibilityUtil.VisibilityUtil.calcVisibility(this);
648
653
  }
649
654
  }, {
650
655
  key: "validateVisibilityInParent",