targetj 1.0.246 → 1.0.248

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.
@@ -77,7 +77,6 @@ var AnimationManager = /*#__PURE__*/function () {
77
77
  return;
78
78
  }
79
79
  var el = tmodel.$dom.getElement();
80
- this.cancelElementAnimationsForKeys(el, Object.keys(batch.keyMap));
81
80
  var totalDuration = Math.max(batch.totalDuration, 1);
82
81
  var originalKeys = _toConsumableArray(new Set(Object.values(batch.keyMap).flatMap(function (set) {
83
82
  return _toConsumableArray(set);
@@ -149,7 +148,7 @@ var AnimationManager = /*#__PURE__*/function () {
149
148
  var targetValue = tmodel.targetValues[_originalKey];
150
149
  if (targetValue) {
151
150
  tmodel.addToAnimatingMap(_originalKey);
152
- targetValue.status = !targetValue.snapAnimation ? 'updating' : targetValue.status;
151
+ targetValue.status = !targetValue.snapAnimation ? 'updating' : 'done';
153
152
  }
154
153
  this.recordMap.set(recId, rec);
155
154
  }
@@ -612,7 +611,8 @@ var AnimationManager = /*#__PURE__*/function () {
612
611
  }()
613
612
  }, {
614
613
  key: "fillCutFrameFromRecords",
615
- value: function fillCutFrameFromRecords(tmodel, cutFrame) {
614
+ value: function fillCutFrameFromRecords(tmodel, cutFrame, cutTime, totalDuration) {
615
+ var progress = totalDuration > 0 ? TUtil.limit(cutTime / totalDuration, 0, 1) : 1;
616
616
  var _iterator11 = _createForOfIteratorHelper(this.recordMap),
617
617
  _step11;
618
618
  try {
@@ -626,7 +626,7 @@ var AnimationManager = /*#__PURE__*/function () {
626
626
  if (record.status === 'canceled' || record.status === 'detached') {
627
627
  continue;
628
628
  }
629
- var result = AnimationUtil.getValueFromAnim(record);
629
+ var result = AnimationUtil.getValueFromFrames(record, progress);
630
630
  if (!result) {
631
631
  continue;
632
632
  }
@@ -643,6 +643,15 @@ var AnimationManager = /*#__PURE__*/function () {
643
643
  cycle: result.cycle,
644
644
  done: result.status === 'finished'
645
645
  });
646
+ this.setAt(tmodel, cleanKey, result.value);
647
+ tmodel.val(originalKey, result.value);
648
+ if (targetValue) {
649
+ targetValue.value = result.value;
650
+ targetValue.step = result.step;
651
+ targetValue.valuePointer = result.valuePointer;
652
+ targetValue.cycle = result.cycle;
653
+ tmodel.setActual(originalKey, result.value);
654
+ }
646
655
  }
647
656
  } catch (err) {
648
657
  _iterator11.e(err);
@@ -657,6 +666,7 @@ var AnimationManager = /*#__PURE__*/function () {
657
666
  while (i < batch.frames.length && batch.frames[i].keyTime <= cutTime) {
658
667
  i++;
659
668
  }
669
+ var originalDuration = batch.totalDuration;
660
670
  var needsInsert = i < batch.frames.length && cutTime !== batch.frames[i].keyTime;
661
671
  if (needsInsert) {
662
672
  var cutFrame = {
@@ -666,7 +676,7 @@ var AnimationManager = /*#__PURE__*/function () {
666
676
  keyMeta: new Map()
667
677
  };
668
678
  batch.frames.splice(i, 0, cutFrame);
669
- this.fillCutFrameFromRecords(tmodel, cutFrame);
679
+ this.fillCutFrameFromRecords(tmodel, cutFrame, cutTime, originalDuration);
670
680
  var originalKeys = _toConsumableArray(new Set(Object.values(batch.keyMap).flatMap(function (set) {
671
681
  return _toConsumableArray(set);
672
682
  })));
@@ -852,48 +862,24 @@ var AnimationManager = /*#__PURE__*/function () {
852
862
  return filtered;
853
863
  }
854
864
  }, {
855
- key: "cancelElementAnimationsForKeys",
856
- value: function cancelElementAnimationsForKeys(el, cleanKeys) {
857
- if (!el.getAnimations) {
858
- return;
865
+ key: "rebaseAutoLayoutTransform",
866
+ value: function rebaseAutoLayoutTransform(tmodel, tfUpdates) {
867
+ if (!tmodel.lastBatch) {
868
+ return false;
859
869
  }
860
- var keySet = new Set(cleanKeys);
861
- var _iterator18 = _createForOfIteratorHelper(el.getAnimations()),
870
+ var cutTime = Math.min(TUtil.now() - tmodel.lastBatch.startTime, tmodel.lastBatch.totalDuration);
871
+ var batch = this.cutLastBatch(tmodel, tmodel.lastBatch, cutTime);
872
+ AnimationUtil.rebaseCutBatchMeta(tmodel, batch);
873
+ var _iterator18 = _createForOfIteratorHelper(batch.frames),
862
874
  _step18;
863
875
  try {
864
876
  for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
865
- var anim = _step18.value;
866
- var effect = anim.effect;
867
- if (!(effect !== null && effect !== void 0 && effect.getKeyframes)) {
868
- continue;
869
- }
870
- var kfs = effect.getKeyframes();
871
- var touches = false;
872
- var _iterator19 = _createForOfIteratorHelper(kfs),
873
- _step19;
874
- try {
875
- for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
876
- var kf = _step19.value;
877
- for (var _i6 = 0, _Object$keys2 = Object.keys(kf); _i6 < _Object$keys2.length; _i6++) {
878
- var k = _Object$keys2[_i6];
879
- if (keySet.has(k)) {
880
- touches = true;
881
- break;
882
- }
883
- }
884
- if (touches) {
885
- break;
886
- }
887
- }
888
- } catch (err) {
889
- _iterator19.e(err);
890
- } finally {
891
- _iterator19.f();
892
- }
893
- if (touches) {
894
- try {
895
- anim.cancel();
896
- } catch (_unused) {}
877
+ var frame = _step18.value;
878
+ for (var _i7 = 0, _Object$entries3 = Object.entries(tfUpdates); _i7 < _Object$entries3.length; _i7++) {
879
+ var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i7], 2),
880
+ _key2 = _Object$entries3$_i[0],
881
+ _value = _Object$entries3$_i[1];
882
+ frame.tfMap[_key2] = _value;
897
883
  }
898
884
  }
899
885
  } catch (err) {
@@ -901,6 +887,17 @@ var AnimationManager = /*#__PURE__*/function () {
901
887
  } finally {
902
888
  _iterator18.f();
903
889
  }
890
+ for (var _i6 = 0, _Object$entries2 = Object.entries(tfUpdates); _i6 < _Object$entries2.length; _i6++) {
891
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i6], 2),
892
+ key = _Object$entries2$_i[0],
893
+ value = _Object$entries2$_i[1];
894
+ tmodel.tfMap[key] = value;
895
+ tmodel.val(key, value);
896
+ tmodel.actualValues[key] = value;
897
+ }
898
+ this.deleteAnimation(tmodel);
899
+ this.animate(tmodel, batch, AnimationUtil.getAnimationHooks());
900
+ return true;
904
901
  }
905
902
  }]);
906
903
  }();
@@ -349,18 +349,24 @@ var AnimationUtil = /*#__PURE__*/function () {
349
349
  }, {
350
350
  key: "getValueFromAnim",
351
351
  value: function getValueFromAnim(record) {
352
- var _anim$effect, _anim$effect$getCompu, _right$segmentSteps, _ref3, _right$valuePointer2, _ref4, _right$cycle2;
353
- var originalKey = record.originalKey,
354
- anim = record.anim,
355
- frames = record.frames;
356
- if (!frames) {
352
+ var _record$anim$effect, _record$anim$effect$g;
353
+ var ct = (_record$anim$effect = record.anim.effect) === null || _record$anim$effect === void 0 || (_record$anim$effect$g = _record$anim$effect.getComputedTiming) === null || _record$anim$effect$g === void 0 ? void 0 : _record$anim$effect$g.call(_record$anim$effect);
354
+ if (!ct) {
357
355
  return;
358
356
  }
359
- var ct = (_anim$effect = anim.effect) === null || _anim$effect === void 0 || (_anim$effect$getCompu = _anim$effect.getComputedTiming) === null || _anim$effect$getCompu === void 0 ? void 0 : _anim$effect$getCompu.call(_anim$effect);
360
- if (!ct) {
357
+ var progress = TUtil.isDefined(ct.progress) ? TUtil.limit(ct.progress, 0, 1) : 1;
358
+ return AnimationUtil.getValueFromFrames(record, progress);
359
+ }
360
+ }, {
361
+ key: "getValueFromFrames",
362
+ value: function getValueFromFrames(record, progress) {
363
+ var _right$segmentSteps, _ref3, _right$valuePointer2, _ref4, _right$cycle2;
364
+ var originalKey = record.originalKey,
365
+ frames = record.frames;
366
+ if (!frames || frames.length < 2) {
361
367
  return;
362
368
  }
363
- var p = TUtil.isDefined(ct.progress) ? TUtil.limit(ct.progress, 0, 1) : 1;
369
+ var p = TUtil.limit(progress, 0, 1);
364
370
  var last = frames.length - 1;
365
371
  var framePointer = 0;
366
372
  if (p <= frames[0].offset) {
@@ -407,7 +413,6 @@ var AnimationUtil = /*#__PURE__*/function () {
407
413
  var stepOffset = right.stepOffset || 0;
408
414
  var segmentSteps = (_right$segmentSteps = right.segmentSteps) !== null && _right$segmentSteps !== void 0 ? _right$segmentSteps : stepOffset + remainingSteps;
409
415
  var step = TUtil.limit(stepOffset + localStep, 0, segmentSteps);
410
- var status = right.done ? "finished" : "playing";
411
416
  return {
412
417
  value: value,
413
418
  step: step,
@@ -416,7 +421,7 @@ var AnimationUtil = /*#__PURE__*/function () {
416
421
  cycle: (_ref4 = (_right$cycle2 = right.cycle) !== null && _right$cycle2 !== void 0 ? _right$cycle2 : left.cycle) !== null && _ref4 !== void 0 ? _ref4 : 0,
417
422
  from: from,
418
423
  to: to,
419
- status: status
424
+ status: right.done ? "finished" : "playing"
420
425
  };
421
426
  }
422
427
  }, {
package/build/App.js CHANGED
@@ -145,8 +145,6 @@ var AppFn = function AppFn() {
145
145
  case 0:
146
146
  my.manager.getVisibles().forEach(function (tmodel) {
147
147
  var _tmodel$allStyleTarge;
148
- tmodel.tfMap = {};
149
- tmodel.styleMap = {};
150
148
  if ((_tmodel$allStyleTarge = tmodel.allStyleTargetMap) !== null && _tmodel$allStyleTarge !== void 0 && _tmodel$allStyleTarge.size) {
151
149
  var _iterator = _createForOfIteratorHelper(tmodel.allStyleTargetMap),
152
150
  _step;
@@ -246,10 +244,11 @@ App.unmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime()
246
244
  _context4.next = 14;
247
245
  return tApp.reset();
248
246
  case 14:
247
+ tApp.loader.clearAll();
249
248
  App.oids = {};
250
249
  App.tmodelIdMap = {};
251
250
  tApp = undefined;
252
- case 17:
251
+ case 18:
253
252
  case "end":
254
253
  return _context4.stop();
255
254
  }
@@ -1118,6 +1118,11 @@ var BaseModel = /*#__PURE__*/function () {
1118
1118
  this.animatingMap.set(key, true);
1119
1119
  (_this$getParent8 = this.getParent()) === null || _this$getParent8 === void 0 || _this$getParent8.addToAnimatingChildren(this);
1120
1120
  }
1121
+ }, {
1122
+ key: "getAnimatingTargets",
1123
+ value: function getAnimatingTargets() {
1124
+ return this.animatingMap ? _toConsumableArray(this.animatingMap.keys()) : [];
1125
+ }
1121
1126
  }, {
1122
1127
  key: "isKeyAnimating",
1123
1128
  value: function isKeyAnimating(key) {
@@ -60,6 +60,7 @@ var EventListener = /*#__PURE__*/function () {
60
60
  this.currentKey = '';
61
61
  this.currentHandlers = {
62
62
  touch: null,
63
+ click: null,
63
64
  scrollLeft: null,
64
65
  scrollTop: null,
65
66
  swipe: null,
@@ -311,20 +312,48 @@ var EventListener = /*#__PURE__*/function () {
311
312
  if (this.canFindHandlers && !lastEvent.synthetic) {
312
313
  this.findEventHandlers(lastEvent);
313
314
  }
314
- if (lastEvent.eventType === 'end' || lastEvent.eventType === 'click') {
315
- if (lastEvent.eventType === 'end') {
316
- var _this$currentHandlers;
317
- this.currentHandlers.end = this.currentHandlers.start;
318
- (_this$currentHandlers = this.currentHandlers.end) === null || _this$currentHandlers === void 0 || _this$currentHandlers.markLayoutDirty('end-event');
319
- this.currentHandlers.start = undefined;
320
- }
321
- this.canFindHandlers = true;
315
+ if (lastEvent.eventType === 'end') {
316
+ this.currentHandlers.end = this.currentHandlers.start;
317
+ this.currentHandlers.start = undefined;
322
318
  }
323
319
  this.currentEventName = lastEvent.eventName;
324
320
  this.currentEventType = lastEvent.eventType;
325
321
  this.currentEventTModel = lastEvent.tmodel;
326
322
  this.currentOriginalEvent = lastEvent.originalEvent;
327
323
  this.currentTouch.key = '';
324
+ this.markCapturedEventDirty(lastEvent);
325
+ if (lastEvent.eventType === 'end' || lastEvent.eventType === 'click') {
326
+ this.canFindHandlers = true;
327
+ }
328
+ }
329
+ }, {
330
+ key: "markCapturedEventDirty",
331
+ value: function markCapturedEventDirty(lastEvent) {
332
+ var mark = function mark(tmodel, reason) {
333
+ if (!tmodel) {
334
+ return;
335
+ }
336
+ tmodel.markEventDirty();
337
+ tmodel.markLayoutDirty(reason);
338
+ };
339
+ mark(lastEvent.tmodel, "".concat(lastEvent.eventType, "-event"));
340
+ switch (lastEvent.eventType) {
341
+ case "click":
342
+ mark(this.currentHandlers.click, "click-event");
343
+ break;
344
+ case "start":
345
+ mark(this.currentHandlers.start, "start-event");
346
+ break;
347
+ case "end":
348
+ mark(this.currentHandlers.end, "end-event");
349
+ break;
350
+ case "move":
351
+ mark(this.currentHandlers.swipe, "swipe-event");
352
+ mark(this.currentHandlers.scrollLeft, "scrollleft-event");
353
+ mark(this.currentHandlers.scrollTop, "scrolltop-event");
354
+ mark(this.currentHandlers.pinch, "pinch-event");
355
+ break;
356
+ }
328
357
  }
329
358
  }, {
330
359
  key: "handleDocEvent",
@@ -342,12 +371,12 @@ var EventListener = /*#__PURE__*/function () {
342
371
  var _this$lastEvent,
343
372
  _tmodel,
344
373
  _tmodel2,
374
+ _this$currentHandlers,
345
375
  _this$currentHandlers2,
346
376
  _this$currentHandlers3,
347
377
  _this$currentHandlers4,
348
- _this$currentHandlers5,
378
+ _this$currentHandlers6,
349
379
  _this$currentHandlers7,
350
- _this$currentHandlers8,
351
380
  _this7 = this,
352
381
  _tmodel3;
353
382
  if (!event) {
@@ -435,8 +464,8 @@ var EventListener = /*#__PURE__*/function () {
435
464
  this.currentHandlers.start = tmodel;
436
465
  this.findEventHandlers(newEvent);
437
466
  this.canFindHandlers = false;
438
- this.swipeStartX = this.start0.x - ((_this$currentHandlers2 = (_this$currentHandlers3 = this.currentHandlers.swipe) === null || _this$currentHandlers3 === void 0 ? void 0 : _this$currentHandlers3.getX()) !== null && _this$currentHandlers2 !== void 0 ? _this$currentHandlers2 : 0);
439
- this.swipeStartY = this.start0.y - ((_this$currentHandlers4 = (_this$currentHandlers5 = this.currentHandlers.swipe) === null || _this$currentHandlers5 === void 0 ? void 0 : _this$currentHandlers5.getY()) !== null && _this$currentHandlers4 !== void 0 ? _this$currentHandlers4 : 0);
467
+ this.swipeStartX = this.start0.x - ((_this$currentHandlers = (_this$currentHandlers2 = this.currentHandlers.swipe) === null || _this$currentHandlers2 === void 0 ? void 0 : _this$currentHandlers2.getX()) !== null && _this$currentHandlers !== void 0 ? _this$currentHandlers : 0);
468
+ this.swipeStartY = this.start0.y - ((_this$currentHandlers3 = (_this$currentHandlers4 = this.currentHandlers.swipe) === null || _this$currentHandlers4 === void 0 ? void 0 : _this$currentHandlers4.getY()) !== null && _this$currentHandlers3 !== void 0 ? _this$currentHandlers3 : 0);
440
469
  event.stopPropagation();
441
470
  this.detachDocumentEvents('documentDragEvents');
442
471
  this.attachDocumentEvents('documentDragEvents');
@@ -451,12 +480,12 @@ var EventListener = /*#__PURE__*/function () {
451
480
  event.preventDefault();
452
481
  }
453
482
  if (this.touchCount > 0) {
454
- var _this$currentHandlers6;
483
+ var _this$currentHandlers5;
455
484
  this.scrollEndTimeStamp.x = 0;
456
485
  this.scrollEndTimeStamp.y = 0;
457
486
  this.move(event);
458
487
  event.stopPropagation();
459
- (_this$currentHandlers6 = this.currentHandlers.swipe) === null || _this$currentHandlers6 === void 0 || _this$currentHandlers6.markLayoutDirty('swipe-event');
488
+ (_this$currentHandlers5 = this.currentHandlers.swipe) === null || _this$currentHandlers5 === void 0 || _this$currentHandlers5.markLayoutDirty('swipe-event');
460
489
  } else if (this.isCurrentSource('wheel')) {
461
490
  this.clearTouch();
462
491
  }
@@ -482,8 +511,6 @@ var EventListener = /*#__PURE__*/function () {
482
511
  var clickHandler = SearchUtil.findFirstClickHandler(tmodel);
483
512
  var canAcceptClick = !this.start0 || clickHandler === this.currentHandlers.click && (clickHandler !== this.currentHandlers.swipe || this.getSwipeDistance() < 5);
484
513
  if (clickHandler && canAcceptClick) {
485
- clickHandler.markEventDirty();
486
- clickHandler.markLayoutDirty('event');
487
514
  this.eventQueue.length = 0;
488
515
  this.eventQueue.push({
489
516
  eventName: eventName,
@@ -533,11 +560,11 @@ var EventListener = /*#__PURE__*/function () {
533
560
  break;
534
561
  case 'key':
535
562
  this.currentTouch.key = event.which || event.keyCode;
536
- (_this$currentHandlers7 = this.currentHandlers.focus) === null || _this$currentHandlers7 === void 0 || _this$currentHandlers7.markLayoutDirty('key-event');
563
+ (_this$currentHandlers6 = this.currentHandlers.focus) === null || _this$currentHandlers6 === void 0 || _this$currentHandlers6.markLayoutDirty('key-event');
537
564
  break;
538
565
  case 'keydown':
539
566
  this.currentTouch.key = event.which || event.keyCode;
540
- (_this$currentHandlers8 = this.currentHandlers.focus) === null || _this$currentHandlers8 === void 0 || _this$currentHandlers8.markLayoutDirty('keydown-event');
567
+ (_this$currentHandlers7 = this.currentHandlers.focus) === null || _this$currentHandlers7 === void 0 || _this$currentHandlers7.markLayoutDirty('keydown-event');
541
568
  break;
542
569
  case 'resize':
543
570
  this.windowEpoch++;
@@ -699,6 +726,22 @@ var EventListener = /*#__PURE__*/function () {
699
726
  this.windowScrollEndTimer = 0;
700
727
  this.scrollEndTimeStamp.x = 0;
701
728
  this.scrollEndTimeStamp.y = 0;
729
+ this.currentHandlers = {
730
+ touch: null,
731
+ click: null,
732
+ scrollLeft: null,
733
+ scrollTop: null,
734
+ swipe: null,
735
+ pinch: null,
736
+ focus: null,
737
+ justFocused: null,
738
+ blur: null,
739
+ leave: null,
740
+ enter: null,
741
+ start: null,
742
+ end: null,
743
+ hover: null
744
+ };
702
745
  }
703
746
  }, {
704
747
  key: "deltaX",
@@ -31,20 +31,48 @@ var LoadingManager = /*#__PURE__*/function () {
31
31
  this.tmodelKeyMap = {};
32
32
  this.fetchingAPIMap = {};
33
33
  this.fetchingImageMap = {};
34
+ this.targetPageKeyMap = new WeakMap();
34
35
  this.fetchSeq = 0;
35
36
  }
36
37
  return _createClass(LoadingManager, [{
37
38
  key: "clear",
38
39
  value: function clear() {
40
+ this.fetchingAPIMap = {};
41
+ this.fetchingImageMap = {};
42
+ }
43
+ }, {
44
+ key: "clearAll",
45
+ value: function clearAll() {
46
+ this.cacheMap = {};
39
47
  this.tmodelKeyMap = {};
40
48
  this.fetchingAPIMap = {};
41
49
  this.fetchingImageMap = {};
50
+ this.targetPageKeyMap = new WeakMap();
42
51
  this.fetchSeq = 0;
43
52
  }
53
+ }, {
54
+ key: "setTargetPageKey",
55
+ value: function setTargetPageKey(tmodel, targetName, pageKey) {
56
+ var map = this.targetPageKeyMap.get(tmodel);
57
+ if (!map) {
58
+ map = new Map();
59
+ this.targetPageKeyMap.set(tmodel, map);
60
+ }
61
+ map.set(targetName, pageKey);
62
+ }
63
+ }, {
64
+ key: "getTargetPageKey",
65
+ value: function getTargetPageKey(tmodel, targetName) {
66
+ var _this$targetPageKeyMa, _this$targetPageKeyMa2;
67
+ return (_this$targetPageKeyMa = (_this$targetPageKeyMa2 = this.targetPageKeyMap.get(tmodel)) === null || _this$targetPageKeyMa2 === void 0 ? void 0 : _this$targetPageKeyMa2.get(targetName)) !== null && _this$targetPageKeyMa !== void 0 ? _this$targetPageKeyMa : document.URL;
68
+ }
44
69
  }, {
45
70
  key: "fetchCommon",
46
71
  value: function fetchCommon(fetchId, cacheId, tmodel, fetchMap, fetchFn) {
47
72
  TargetUtil.markFetchAction(tmodel);
73
+ var pageKey = document.URL;
74
+ var targetName = tmodel.key;
75
+ this.setTargetPageKey(tmodel, targetName, pageKey);
48
76
  if (!this.isFetched(cacheId)) {
49
77
  if (!fetchMap[fetchId]) {
50
78
  fetchMap[fetchId] = {
@@ -71,7 +99,7 @@ var LoadingManager = /*#__PURE__*/function () {
71
99
  fetchMap: fetchMap
72
100
  };
73
101
  }
74
- this.addToTModelKeyMap(tmodel, tmodel.key, fetchId, cacheId);
102
+ this.addToTModelKeyMap(tmodel, tmodel.key, fetchId, cacheId, fetchMap);
75
103
  return fetchId;
76
104
  }
77
105
  }, {
@@ -120,11 +148,12 @@ var LoadingManager = /*#__PURE__*/function () {
120
148
  }, {
121
149
  key: "getTModelKey",
122
150
  value: function getTModelKey(tmodel, targetName) {
123
- return "".concat(document.URL, "_").concat(tmodel.oid, "_").concat(targetName);
151
+ var pageKey = this.getTargetPageKey(tmodel, targetName);
152
+ return "".concat(pageKey, "_").concat(tmodel.oid, "_").concat(targetName);
124
153
  }
125
154
  }, {
126
155
  key: "addToTModelKeyMap",
127
- value: function addToTModelKeyMap(tmodel, targetName, fetchId, cacheId) {
156
+ value: function addToTModelKeyMap(tmodel, targetName, fetchId, cacheId, fetchMap) {
128
157
  var key = this.getTModelKey(tmodel, targetName);
129
158
  var loadTargetName = TUtil.getLoadTargetName(targetName);
130
159
  var loadingComplete = this.isLoadingComplete(tmodel, targetName);
@@ -149,8 +178,8 @@ var LoadingManager = /*#__PURE__*/function () {
149
178
  this.tmodelKeyMap[key].entryCount++;
150
179
  tmodel.val(loadTargetName).push(undefined);
151
180
  if (cacheId && this.isFetched(cacheId)) {
152
- this.fetchingAPIMap[fetchId].startTime = TUtil.now();
153
- this.handleSuccess(this.fetchingAPIMap[fetchId], this.cacheMap[cacheId].result);
181
+ fetchMap[fetchId].startTime = TUtil.now();
182
+ this.handleSuccess(fetchMap[fetchId], this.cacheMap[cacheId].result);
154
183
  }
155
184
  }
156
185
  }, {
@@ -23,9 +23,8 @@ import { TargetUtil } from "./TargetUtil.js";
23
23
  import { TargetData } from "./TargetData.js";
24
24
  import { TModelUtil } from "./TModelUtil.js";
25
25
  import { ScheduleUtil } from "./ScheduleUtil.js";
26
- import { AnimationUtil } from "./AnimationUtil.js";
27
26
  import { TargetExecutor } from "./TargetExecutor.js";
28
- import { getTargetManager, tRoot, getEvents } from "./App.js";
27
+ import { getTargetManager, tRoot, getEvents, getAnimationManager } from "./App.js";
29
28
 
30
29
  /*
31
30
  * It calculates the locations and dimensions of all objects and triggers the calculation of all targets.
@@ -247,8 +246,8 @@ var LocationManager = /*#__PURE__*/function () {
247
246
  viewport.setLocation();
248
247
  child.markLayoutDirty('overflow');
249
248
  }
250
- var prevX = child.actualValues.x;
251
- var prevY = child.actualValues.y;
249
+ var prevX = Math.floor(child.actualValues.x);
250
+ var prevY = Math.floor(child.actualValues.y);
252
251
  if (child.isIncluded()) {
253
252
  _this.calculateTargets(child);
254
253
  }
@@ -626,20 +625,17 @@ var LocationManager = /*#__PURE__*/function () {
626
625
  key: "fixLocation",
627
626
  value: function fixLocation(tmodel, prevX, prevY) {
628
627
  if (tmodel.hasValidAnimation()) {
629
- var keysToSnap = [];
630
- var valuesToSnap = [];
631
- var xChanged = tmodel.actualValues.x !== prevX;
632
- var yChanged = tmodel.actualValues.y !== prevY;
628
+ var xChanged = Math.floor(tmodel.actualValues.x) !== prevX;
629
+ var yChanged = Math.floor(tmodel.actualValues.y) !== prevY;
630
+ var autoTfUpdates = {};
633
631
  if (xChanged && tmodel.getTargetStatus(tmodel.allTargetMap['x']) !== 'updating') {
634
- keysToSnap.push('x');
635
- valuesToSnap.push(tmodel.val('x'));
632
+ autoTfUpdates.x = tmodel.actualValues.x;
636
633
  }
637
634
  if (yChanged && tmodel.getTargetStatus(tmodel.allTargetMap['y']) !== 'updating') {
638
- keysToSnap.push('y');
639
- valuesToSnap.push(tmodel.val('y'));
635
+ autoTfUpdates.y = tmodel.actualValues.y;
640
636
  }
641
- if (keysToSnap.length > 0) {
642
- AnimationUtil.overrideAnimatedKeyWithSnap(tmodel, keysToSnap, valuesToSnap);
637
+ if (Object.keys(autoTfUpdates).length) {
638
+ getAnimationManager().rebaseAutoLayoutTransform(tmodel, autoTfUpdates);
643
639
  return;
644
640
  }
645
641
  }
@@ -85,7 +85,7 @@ var PageManager = /*#__PURE__*/function () {
85
85
  _context.next = 16;
86
86
  return tApp.start();
87
87
  case 16:
88
- _context.next = 34;
88
+ _context.next = 35;
89
89
  break;
90
90
  case 18:
91
91
  tApp.tRoot = this.pageCache[link].tRoot;
@@ -101,17 +101,20 @@ var PageManager = /*#__PURE__*/function () {
101
101
  tApp.manager.activatePendingTargetsAfterDom(visibles, {
102
102
  restoredDoneTargets: true
103
103
  });
104
+ tApp.manager.activatePendingTargetsAfterDom(newVisibles, {
105
+ restoredDoneTargets: true
106
+ });
104
107
  tApp.manager.visibleOidMap = _objectSpread({}, this.pageCache[link].visibleOidMap);
105
108
  newVisibles.forEach(function (visible) {
106
109
  tApp.manager.visibleOidMap[visible.oid] = visible;
107
110
  });
108
111
  window.scrollTo(this.pageCache[link].scrollLeft, this.pageCache[link].scrollTop);
109
112
  this.lastLink = link;
110
- _context.next = 33;
113
+ _context.next = 34;
111
114
  return tApp.start();
112
- case 33:
113
- getRunScheduler().restoreSnapshot(this.pageCache[link].runSnapshot);
114
115
  case 34:
116
+ getRunScheduler().restoreSnapshot(this.pageCache[link].runSnapshot);
117
+ case 35:
115
118
  case "end":
116
119
  return _context.stop();
117
120
  }
package/build/TModel.js CHANGED
@@ -571,11 +571,17 @@ var TModel = /*#__PURE__*/function (_BaseModel) {
571
571
  value: function debug() {
572
572
  var _this6 = this;
573
573
  return [{
574
+ oid: this.oid
575
+ }, {
574
576
  visible: this.isVisible()
575
577
  }, {
576
578
  visibilityStatus: this.visibilityStatus
577
579
  }, {
578
580
  hasDom: this.hasDom()
581
+ }, {
582
+ shouldCalculateChildren: this.shouldCalculateChildren()
583
+ }, {
584
+ dirtyLayout: this.getDirtyLayout()
579
585
  }, {
580
586
  x: this.getX()
581
587
  }, {
@@ -590,6 +596,8 @@ var TModel = /*#__PURE__*/function (_BaseModel) {
590
596
  targets: this.originalTargetNames
591
597
  }, {
592
598
  activeTargetList: this.activeTargetList
599
+ }, {
600
+ activatedTargets: this.activatedTargets
593
601
  }, {
594
602
  updatingTargetList: this.updatingTargetList
595
603
  }, {
@@ -505,7 +505,7 @@ var TModelManager = /*#__PURE__*/function () {
505
505
  value: function activatePendingTargetsAfterDom(tmodels) {
506
506
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
507
507
  _ref$restoredDoneTarg = _ref.restoredDoneTargets,
508
- restoredDoneTargets = _ref$restoredDoneTarg === void 0 ? false : _ref$restoredDoneTarg;
508
+ restoredDoneTargets = _ref$restoredDoneTarg === void 0 ? true : _ref$restoredDoneTarg;
509
509
  var _iterator8 = _createForOfIteratorHelper(tmodels),
510
510
  _step8;
511
511
  try {
@@ -522,19 +522,20 @@ var TModelManager = /*#__PURE__*/function () {
522
522
  tmodel.noDomUpdatingTargets = undefined;
523
523
  }
524
524
  var pending = tmodel.pendingTargets;
525
+ var visited = new Set();
525
526
  if (pending) {
526
527
  for (var _i2 = 0, _arr2 = _toConsumableArray(pending); _i2 < _arr2.length; _i2++) {
527
528
  var key = _arr2[_i2];
529
+ visited.add(key);
528
530
  TargetUtil.cleanupTarget(tmodel, key);
529
531
  TargetUtil.shouldActivateNextTarget(tmodel, key);
530
532
  }
531
- tmodel.pendingTargets = undefined;
532
533
  }
533
534
  if (restoredDoneTargets) {
534
535
  for (var _i3 = 0, _Object$keys = Object.keys(tmodel.targetValues); _i3 < _Object$keys.length; _i3++) {
535
536
  var _key = _Object$keys[_i3];
536
537
  var targetValue = tmodel.targetValues[_key];
537
- if (targetValue.status !== 'done') {
538
+ if (targetValue.status !== 'done' || visited.has(_key)) {
538
539
  continue;
539
540
  }
540
541
  if (tmodel.isTargetInLoop(_key) || tmodel.isTargetPassiveLoop(_key)) {
@@ -217,7 +217,6 @@ var TargetUtil = /*#__PURE__*/function () {
217
217
  }
218
218
  } else if (isEndTrigger) {
219
219
  if (prevOk === true) {
220
- tmodel.removeFromActiveTargets(nextTarget);
221
220
  TargetUtil.activateTarget(tmodel, nextTarget);
222
221
  nextTargetActivated = true;
223
222
  TargetUtil.clearPendingTargetsForNextTarget(tmodel, nextTarget);