targetj 1.0.240 → 1.0.241

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.
@@ -1,15 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.AnimationUtil = void 0;
7
- var _TargetUtil = require("./TargetUtil.js");
8
- var _TargetData = require("./TargetData.js");
9
- var _TModelUtil = require("./TModelUtil.js");
10
- var _App = require("./App.js");
11
- var _ScheduleUtil = require("./ScheduleUtil.js");
12
- var _TUtil = require("./TUtil.js");
13
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
14
2
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
15
3
  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."); }
@@ -26,11 +14,18 @@ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Can
26
14
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
27
15
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
28
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
29
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // AnimationUtil.js
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
+ // AnimationUtil.js
19
+ import { TargetUtil } from "./TargetUtil.js";
20
+ import { TargetData } from "./TargetData.js";
21
+ import { TModelUtil } from "./TModelUtil.js";
22
+ import { getAnimationManager, getTargetManager } from "./App.js";
23
+ import { ScheduleUtil } from "./ScheduleUtil.js";
24
+ import { TUtil } from "./TUtil.js";
30
25
  /**
31
26
  * It provides helper functions for Animation.
32
27
  */
33
- var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
28
+ var AnimationUtil = /*#__PURE__*/function () {
34
29
  function AnimationUtil() {
35
30
  _classCallCheck(this, AnimationUtil);
36
31
  }
@@ -60,9 +55,9 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
60
55
  var key = keyList[i];
61
56
  needsAnimation = true;
62
57
  var value = valueList[i];
63
- var targetValue = tmodel.targetValues[key] || _TargetUtil.TargetUtil.emptyValue();
64
- var cleanKey = _TargetUtil.TargetUtil.getTargetName(key);
65
- if (_TargetData.TargetData.isTransformKey(cleanKey)) {
58
+ var targetValue = tmodel.targetValues[key] || TargetUtil.emptyValue();
59
+ var cleanKey = TargetUtil.getTargetName(key);
60
+ if (TargetData.isTransformKey(cleanKey)) {
66
61
  tfMap0[cleanKey] = value;
67
62
  tfMap1[cleanKey] = value;
68
63
  } else {
@@ -104,7 +99,7 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
104
99
  keyMap: keyMap,
105
100
  totalDuration: 1
106
101
  };
107
- (0, _App.getAnimationManager)().animate(tmodel, batch, AnimationUtil.getAnimationHooks());
102
+ getAnimationManager().animate(tmodel, batch, AnimationUtil.getAnimationHooks());
108
103
  }
109
104
  }, {
110
105
  key: "fixStyleByAnimation",
@@ -137,7 +132,7 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
137
132
  tmodel.$dom.height(value);
138
133
  } else if (key === 'transform') {
139
134
  tmodel.$dom.transform(value, tmodel.val('transformOrder'));
140
- } else if (!_TargetData.TargetData.transformMap[key]) {
135
+ } else if (!TargetData.transformMap[key]) {
141
136
  tmodel.$dom.style(key, value);
142
137
  tmodel.styleMap[key] = num;
143
138
  }
@@ -156,7 +151,7 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
156
151
  delete out[k];
157
152
  continue;
158
153
  }
159
- if (typeof v === 'number' && _TargetData.TargetData.styleWithUnitMap[k]) {
154
+ if (typeof v === 'number' && TargetData.styleWithUnitMap[k]) {
160
155
  if ((k === 'width' || k === 'height') && v < 0) {
161
156
  v = 0;
162
157
  }
@@ -169,20 +164,20 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
169
164
  value: function getAnimationHooks() {
170
165
  return {
171
166
  morph: function morph(tm, key, from, to, step, steps) {
172
- return _TModelUtil.TModelUtil.easingMorph(tm, key, from, to, step, steps);
167
+ return TModelUtil.easingMorph(tm, key, from, to, step, steps);
173
168
  },
174
169
  fireOnStep: function fireOnStep(tm, key, step) {
175
- return (0, _App.getTargetManager)().fireOnStep(tm, key, step);
170
+ return getTargetManager().fireOnStep(tm, key, step);
176
171
  },
177
172
  fireOnEnd: function fireOnEnd(tm, key) {
178
- return (0, _App.getTargetManager)().fireOnEnd(tm, key);
173
+ return getTargetManager().fireOnEnd(tm, key);
179
174
  }
180
175
  };
181
176
  }
182
177
  }, {
183
178
  key: "addToUpdatingTargets",
184
179
  value: function addToUpdatingTargets(tmodel, originalKeys) {
185
- var recordMap = (0, _App.getAnimationManager)().recordMap;
180
+ var recordMap = getAnimationManager().recordMap;
186
181
  var records = [];
187
182
  var _iterator = _createForOfIteratorHelper(recordMap),
188
183
  _step;
@@ -222,7 +217,7 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
222
217
  }, {
223
218
  key: "addToNODomUpdatingTargets",
224
219
  value: function addToNODomUpdatingTargets(tmodel, originalKeys) {
225
- var recordMap = (0, _App.getAnimationManager)().recordMap;
220
+ var recordMap = getAnimationManager().recordMap;
226
221
  var records = [];
227
222
  var _iterator2 = _createForOfIteratorHelper(recordMap),
228
223
  _step2;
@@ -243,7 +238,7 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
243
238
  } finally {
244
239
  _iterator2.f();
245
240
  }
246
- var now = _TUtil.TUtil.now();
241
+ var now = TUtil.now();
247
242
  for (var _i4 = 0, _records2 = records; _i4 < _records2.length; _i4++) {
248
243
  var record = _records2[_i4];
249
244
  var originalKey = record.originalKey;
@@ -272,7 +267,7 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
272
267
  try {
273
268
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
274
269
  var originalKey = _step5.value;
275
- var cleanKey = _TargetUtil.TargetUtil.getTargetName(originalKey);
270
+ var cleanKey = TargetUtil.getTargetName(originalKey);
276
271
  delete frame.styleMap[cleanKey];
277
272
  delete frame.tfMap[cleanKey];
278
273
  if (frame.keyMeta) {
@@ -295,7 +290,7 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
295
290
  try {
296
291
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
297
292
  var _originalKey = _step4.value;
298
- var _cleanKey = _TargetUtil.TargetUtil.getTargetName(_originalKey);
293
+ var _cleanKey = TargetUtil.getTargetName(_originalKey);
299
294
  delete batch.keyMap[_cleanKey];
300
295
  }
301
296
  } catch (err) {
@@ -326,17 +321,17 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
326
321
  steps = result.steps,
327
322
  cycle = result.cycle,
328
323
  valuePointer = result.valuePointer;
329
- (0, _App.getAnimationManager)().setAt(tmodel, cleanKey, value);
324
+ getAnimationManager().setAt(tmodel, cleanKey, value);
330
325
  tmodel.val(originalKey, value);
331
326
  var targetValue = tmodel.targetValues[originalKey];
332
327
  if (targetValue) {
333
- if (_TUtil.TUtil.isDefined(step) && _TUtil.TUtil.isDefined(steps) && steps > 0) {
328
+ if (TUtil.isDefined(step) && TUtil.isDefined(steps) && steps > 0) {
334
329
  targetValue.step = step;
335
330
  }
336
- if (_TUtil.TUtil.isDefined(valuePointer)) {
331
+ if (TUtil.isDefined(valuePointer)) {
337
332
  targetValue.valuePointer = valuePointer;
338
333
  }
339
- if (_TUtil.TUtil.isDefined(cycle)) {
334
+ if (TUtil.isDefined(cycle)) {
340
335
  targetValue.cycle = cycle;
341
336
  }
342
337
  tmodel.setActual(originalKey, value);
@@ -365,7 +360,7 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
365
360
  if (!ct) {
366
361
  return;
367
362
  }
368
- var p = _TUtil.TUtil.isDefined(ct.progress) ? _TUtil.TUtil.limit(ct.progress, 0, 1) : 1;
363
+ var p = TUtil.isDefined(ct.progress) ? TUtil.limit(ct.progress, 0, 1) : 1;
369
364
  var last = frames.length - 1;
370
365
  var framePointer = 0;
371
366
  if (p <= frames[0].offset) {
@@ -390,10 +385,10 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
390
385
  if (segSpan <= 0) {
391
386
  return;
392
387
  }
393
- var u = _TUtil.TUtil.limit((p - segStart) / segSpan, 0, 1);
394
- var value = _TModelUtil.TModelUtil.morph(originalKey, from, to, u);
388
+ var u = TUtil.limit((p - segStart) / segSpan, 0, 1);
389
+ var value = TModelUtil.morph(originalKey, from, to, u);
395
390
  var remainingSteps = right.steps;
396
- if (!_TUtil.TUtil.isDefined(remainingSteps) || remainingSteps <= 0) {
391
+ if (!TUtil.isDefined(remainingSteps) || remainingSteps <= 0) {
397
392
  var _ref, _right$valuePointer, _ref2, _right$cycle;
398
393
  return {
399
394
  value: value,
@@ -408,10 +403,10 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
408
403
  };
409
404
  }
410
405
  var localStep = Math.round(u * remainingSteps);
411
- localStep = _TUtil.TUtil.limit(localStep, 0, remainingSteps);
406
+ localStep = TUtil.limit(localStep, 0, remainingSteps);
412
407
  var stepOffset = right.stepOffset || 0;
413
408
  var segmentSteps = (_right$segmentSteps = right.segmentSteps) !== null && _right$segmentSteps !== void 0 ? _right$segmentSteps : stepOffset + remainingSteps;
414
- var step = _TUtil.TUtil.limit(stepOffset + localStep, 0, segmentSteps);
409
+ var step = TUtil.limit(stepOffset + localStep, 0, segmentSteps);
415
410
  var status = right.done ? "finished" : "playing";
416
411
  return {
417
412
  value: value,
@@ -427,7 +422,7 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
427
422
  }, {
428
423
  key: "detachAnimationsOnDeleteDom",
429
424
  value: function detachAnimationsOnDeleteDom(tmodel) {
430
- var recordMap = (0, _App.getAnimationManager)().recordMap;
425
+ var recordMap = getAnimationManager().recordMap;
431
426
  var pauseKeys = new Set();
432
427
  var catchupKeys = new Set();
433
428
  var _iterator6 = _createForOfIteratorHelper(recordMap),
@@ -439,7 +434,7 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
439
434
  if (record.tmodel !== tmodel) {
440
435
  continue;
441
436
  }
442
- if (_ScheduleUtil.ScheduleUtil.shouldPauseTarget(tmodel, record.originalKey)) {
437
+ if (ScheduleUtil.shouldPauseTarget(tmodel, record.originalKey)) {
443
438
  pauseKeys.add(record.originalKey);
444
439
  } else {
445
440
  catchupKeys.add(record.originalKey);
@@ -461,7 +456,7 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
461
456
  }, {
462
457
  key: "deleteDetachedRecords",
463
458
  value: function deleteDetachedRecords(tmodel, keys) {
464
- var recordMap = (0, _App.getAnimationManager)().recordMap;
459
+ var recordMap = getAnimationManager().recordMap;
465
460
  var _iterator7 = _createForOfIteratorHelper(recordMap),
466
461
  _step7;
467
462
  try {
@@ -516,11 +511,11 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
516
511
  for (var i = 1; i < batch.frames.length; i++) {
517
512
  var _frame$keyMeta;
518
513
  var frame = batch.frames[i];
519
- if ((0, _App.getAnimationManager)().getAt(frame, cleanKey) === undefined) {
514
+ if (getAnimationManager().getAt(frame, cleanKey) === undefined) {
520
515
  continue;
521
516
  }
522
517
  var meta = (_frame$keyMeta = frame.keyMeta) === null || _frame$keyMeta === void 0 ? void 0 : _frame$keyMeta.get(cleanKey);
523
- if (!meta || !_TUtil.TUtil.isDefined(meta.steps)) {
518
+ if (!meta || !TUtil.isDefined(meta.steps)) {
524
519
  continue;
525
520
  }
526
521
  var oldOffset = meta.stepOffset || 0;
@@ -596,7 +591,7 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
596
591
  timeShift = 0;
597
592
  }
598
593
  }
599
- var isTransform = _TargetData.TargetData.isTransformKey(cleanKey);
594
+ var isTransform = TargetData.isTransformKey(cleanKey);
600
595
  var getFrameAtTime = function getFrameAtTime(t) {
601
596
  var shifted = Math.max(0, t + timeShift);
602
597
  for (var i = 0; i < batch.frames.length; i++) {
@@ -708,4 +703,5 @@ var AnimationUtil = exports.AnimationUtil = /*#__PURE__*/function () {
708
703
  return keyDuration;
709
704
  }
710
705
  }]);
711
- }();
706
+ }();
707
+ export { AnimationUtil };
package/build/App.js CHANGED
@@ -1,24 +1,4 @@
1
- "use strict";
2
-
3
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.tRoot = exports.tApp = exports.isRunning = exports.getVisibles = exports.getTargetManager = exports.getTModelById = exports.getScreenWidth = exports.getScreenHeight = exports.getRunScheduler = exports.getResizeLastUpdate = exports.getPager = exports.getManager = exports.getLocationManager = exports.getLoader = exports.getEvents = exports.getDomTModelById = exports.getAnimationManager = exports.fetchImage = exports.fetch = exports.App = void 0;
8
- var _$Dom = require("./$Dom.js");
9
- var _TModel = require("./TModel.js");
10
- var _EventListener = require("./EventListener.js");
11
- var _LoadingManager = require("./LoadingManager.js");
12
- var _LocationManager = require("./LocationManager.js");
13
- var _PageManager = require("./PageManager.js");
14
- var _TModelManager = require("./TModelManager.js");
15
- var _RunScheduler = require("./RunScheduler.js");
16
- var _TargetManager = require("./TargetManager.js");
17
- var _TargetExecutor = require("./TargetExecutor.js");
18
- var _AnimationManager = require("./AnimationManager.js");
19
- var _TUtil = require("./TUtil.js");
20
- var _DomInit = require("./DomInit.js");
21
- var _SearchUtil = require("./SearchUtil.js");
22
2
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
23
3
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
4
  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; } }
@@ -29,6 +9,20 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
29
9
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
30
10
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
31
11
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
12
+ import { $Dom } from "./$Dom.js";
13
+ import { TModel } from "./TModel.js";
14
+ import { EventListener } from "./EventListener.js";
15
+ import { LoadingManager } from "./LoadingManager.js";
16
+ import { LocationManager } from "./LocationManager.js";
17
+ import { PageManager } from "./PageManager.js";
18
+ import { TModelManager } from "./TModelManager.js";
19
+ import { RunScheduler } from "./RunScheduler.js";
20
+ import { TargetManager } from "./TargetManager.js";
21
+ import { TargetExecutor } from "./TargetExecutor.js";
22
+ import { AnimationManager } from "./AnimationManager.js";
23
+ import { TUtil } from "./TUtil.js";
24
+ import { DomInit } from "./DomInit.js";
25
+ import { SearchUtil } from "./SearchUtil.js";
32
26
  var tApp;
33
27
  var queuedAppCalls = [];
34
28
  var AppFn = function AppFn() {
@@ -38,37 +32,37 @@ var AppFn = function AppFn() {
38
32
  my.runningFlag = false;
39
33
  my.resizeLastUpdate = 0;
40
34
  my.init = function () {
41
- my.$window = new _$Dom.$Dom(window);
42
- my.loader = new _LoadingManager.LoadingManager();
43
- my.pager = new _PageManager.PageManager();
44
- my.events = new _EventListener.EventListener();
45
- my.locationManager = new _LocationManager.LocationManager();
46
- my.targetManager = new _TargetManager.TargetManager();
47
- my.animationManager = new _AnimationManager.AnimationManager();
48
- my.manager = new _TModelManager.TModelManager();
49
- my.runScheduler = new _RunScheduler.RunScheduler();
35
+ my.$window = new $Dom(window);
36
+ my.loader = new LoadingManager();
37
+ my.pager = new PageManager();
38
+ my.events = new EventListener();
39
+ my.locationManager = new LocationManager();
40
+ my.targetManager = new TargetManager();
41
+ my.animationManager = new AnimationManager();
42
+ my.manager = new TModelManager();
43
+ my.runScheduler = new RunScheduler();
50
44
  my.tRootFactory = function () {
51
- var tmodel = new _TModel.TModel('tRoot', {
45
+ var tmodel = new TModel('tRoot', {
52
46
  styling: false,
53
47
  domHolder: true,
54
48
  isVisible: true,
55
49
  screenWidth: function screenWidth() {
56
- var width = _$Dom.$Dom.getScreenWidth();
50
+ var width = $Dom.getScreenWidth();
57
51
  if (width !== tmodel.val('screenWidth')) {
58
- my.resizeLastUpdate = _TUtil.TUtil.now();
52
+ my.resizeLastUpdate = TUtil.now();
59
53
  }
60
54
  return width;
61
55
  },
62
56
  screenHeight: function screenHeight() {
63
- var height = _$Dom.$Dom.getScreenHeight();
57
+ var height = $Dom.getScreenHeight();
64
58
  if (height !== tmodel.val('screenHeight')) {
65
- my.resizeLastUpdate = _TUtil.TUtil.now();
59
+ my.resizeLastUpdate = TUtil.now();
66
60
  }
67
61
  return height;
68
62
  },
69
63
  initPageDom: function initPageDom() {
70
64
  var _this = this;
71
- _DomInit.DomInit.initPageDoms(this.$dom);
65
+ DomInit.initPageDoms(this.$dom);
72
66
  if (queuedAppCalls.length) {
73
67
  queuedAppCalls.forEach(function (child) {
74
68
  return _this.addChild(child);
@@ -77,18 +71,18 @@ var AppFn = function AppFn() {
77
71
  }
78
72
  }
79
73
  });
80
- tmodel.$dom = _$Dom.$Dom.query('#tgjs-root') ? new _$Dom.$Dom('#tgjs-root') : new _$Dom.$Dom('body');
74
+ tmodel.$dom = $Dom.query('#tgjs-root') ? new $Dom('#tgjs-root') : new $Dom('body');
81
75
  if (tmodel.$dom.getTagName() !== 'body') {
82
76
  tmodel.$dom.attr('data-tjno-slot', 'true');
83
77
  }
84
- tmodel.val('screenWidth', _$Dom.$Dom.getScreenWidth());
85
- tmodel.val('screenHeight', _$Dom.$Dom.getScreenHeight());
78
+ tmodel.val('screenWidth', $Dom.getScreenWidth());
79
+ tmodel.val('screenHeight', $Dom.getScreenHeight());
86
80
  if (my.tRoot) {
87
81
  my.tRoot.getChildren().forEach(function (t) {
88
82
  if (t.val('sourceDom')) {
89
83
  return;
90
84
  }
91
- var child = new _TModel.TModel(t.type, t.targets);
85
+ var child = new TModel(t.type, t.targets);
92
86
  tmodel.addChild(child);
93
87
  });
94
88
  }
@@ -102,8 +96,8 @@ var AppFn = function AppFn() {
102
96
  while (1) switch (_context.prev = _context.next) {
103
97
  case 0:
104
98
  my.runningFlag = false;
105
- _TargetExecutor.TargetExecutor.executeDeclarativeTarget(my.tRoot, 'screenWidth');
106
- _TargetExecutor.TargetExecutor.executeDeclarativeTarget(my.tRoot, 'screenHeight');
99
+ TargetExecutor.executeDeclarativeTarget(my.tRoot, 'screenWidth');
100
+ TargetExecutor.executeDeclarativeTarget(my.tRoot, 'screenHeight');
107
101
  my.events.detachAll();
108
102
  my.events.detachWindowEvents();
109
103
  my.events.attachWindowEvents();
@@ -160,7 +154,7 @@ var AppFn = function AppFn() {
160
154
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
161
155
  var _step$value = _slicedToArray(_step.value, 1),
162
156
  key = _step$value[0];
163
- if (_TUtil.TUtil.isDefined(tmodel.val(key))) {
157
+ if (TUtil.isDefined(tmodel.val(key))) {
164
158
  tmodel.addToStyleTargetList(key);
165
159
  }
166
160
  }
@@ -177,7 +171,7 @@ var AppFn = function AppFn() {
177
171
  my.manager.clearAll();
178
172
  my.locationManager.clear();
179
173
  my.loader.clear();
180
- _SearchUtil.SearchUtil.clear();
174
+ SearchUtil.clear();
181
175
  case 7:
182
176
  case "end":
183
177
  return _context3.stop();
@@ -188,7 +182,7 @@ var AppFn = function AppFn() {
188
182
  return my.runningFlag;
189
183
  };
190
184
  my.find = function (oid) {
191
- return _SearchUtil.SearchUtil.find(oid);
185
+ return SearchUtil.find(oid);
192
186
  };
193
187
  return my;
194
188
  };
@@ -199,12 +193,12 @@ var ensureRunning = function ensureRunning() {
199
193
  }
200
194
  runApp();
201
195
  };
202
- var App = exports.App = function App(firstChild) {
196
+ var App = function App(firstChild) {
203
197
  var _tApp2;
204
198
  if (!firstChild) {
205
199
  return;
206
200
  }
207
- var tmodel = firstChild instanceof _TModel.TModel ? firstChild : new _TModel.TModel("App", firstChild);
201
+ var tmodel = firstChild instanceof TModel ? firstChild : new TModel("App", firstChild);
208
202
  if (!((_tApp2 = tApp) !== null && _tApp2 !== void 0 && _tApp2.tRoot)) {
209
203
  if (document.readyState === "loading") {
210
204
  queuedAppCalls.push(tmodel);
@@ -237,7 +231,7 @@ App.unmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime()
237
231
  var _child$$dom2;
238
232
  if (child.val('sourceDom')) {
239
233
  var _child$$dom;
240
- _DomInit.DomInit.restoreDomState((_child$$dom = child.$dom) === null || _child$$dom === void 0 ? void 0 : _child$$dom.element, child.domState);
234
+ DomInit.restoreDomState((_child$$dom = child.$dom) === null || _child$$dom === void 0 ? void 0 : _child$$dom.element, child.domState);
241
235
  return;
242
236
  }
243
237
  if ((_child$$dom2 = child.$dom) !== null && _child$$dom2 !== void 0 && _child$$dom2.attr('tgjs')) {
@@ -254,7 +248,7 @@ App.unmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime()
254
248
  case 14:
255
249
  App.oids = {};
256
250
  App.tmodelIdMap = {};
257
- exports.tApp = tApp = undefined;
251
+ tApp = undefined;
258
252
  case 17:
259
253
  case "end":
260
254
  return _context4.stop();
@@ -265,7 +259,7 @@ App.oids = {};
265
259
  App.tmodelIdMap = {};
266
260
  App.getOid = function (type) {
267
261
  var oids = App.oids;
268
- if (!_TUtil.TUtil.isDefined(oids[type])) {
262
+ if (!TUtil.isDefined(oids[type])) {
269
263
  oids[type] = 0;
270
264
  }
271
265
  var num = oids[type]++;
@@ -274,86 +268,91 @@ App.getOid = function (type) {
274
268
  num: num
275
269
  };
276
270
  };
277
- var isRunning = exports.isRunning = function isRunning() {
271
+ var isRunning = function isRunning() {
278
272
  return tApp ? tApp.runningFlag : false;
279
273
  };
280
- var tRoot = exports.tRoot = function tRoot() {
274
+ var tRoot = function tRoot() {
281
275
  var _tApp3;
282
276
  return (_tApp3 = tApp) === null || _tApp3 === void 0 ? void 0 : _tApp3.tRoot;
283
277
  };
284
- var getEvents = exports.getEvents = function getEvents() {
278
+ var getEvents = function getEvents() {
285
279
  var _tApp4;
286
280
  return (_tApp4 = tApp) === null || _tApp4 === void 0 ? void 0 : _tApp4.events;
287
281
  };
288
- var getPager = exports.getPager = function getPager() {
282
+ var getPager = function getPager() {
289
283
  var _tApp5;
290
284
  return (_tApp5 = tApp) === null || _tApp5 === void 0 ? void 0 : _tApp5.pager;
291
285
  };
292
- var getLoader = exports.getLoader = function getLoader() {
286
+ var getLoader = function getLoader() {
293
287
  var _tApp6;
294
288
  return (_tApp6 = tApp) === null || _tApp6 === void 0 ? void 0 : _tApp6.loader;
295
289
  };
296
- var fetch = exports.fetch = function fetch(tmodel, url, query, cacheId) {
290
+ var fetch = function fetch(tmodel, url, query, cacheId) {
297
291
  var _tApp7;
298
292
  return (_tApp7 = tApp) === null || _tApp7 === void 0 || (_tApp7 = _tApp7.loader) === null || _tApp7 === void 0 ? void 0 : _tApp7.fetch(tmodel, url, query, cacheId);
299
293
  };
300
- var fetchImage = exports.fetchImage = function fetchImage(tmodel, src, cacheId) {
294
+ var fetchImage = function fetchImage(tmodel, src, cacheId) {
301
295
  var _tApp8;
302
296
  return (_tApp8 = tApp) === null || _tApp8 === void 0 || (_tApp8 = _tApp8.loader) === null || _tApp8 === void 0 ? void 0 : _tApp8.fetchImage(tmodel, src, cacheId);
303
297
  };
304
- var getManager = exports.getManager = function getManager() {
298
+ var getManager = function getManager() {
305
299
  var _tApp9;
306
300
  return (_tApp9 = tApp) === null || _tApp9 === void 0 ? void 0 : _tApp9.manager;
307
301
  };
308
- var getTargetManager = exports.getTargetManager = function getTargetManager() {
302
+ var getTargetManager = function getTargetManager() {
309
303
  var _tApp10;
310
304
  return (_tApp10 = tApp) === null || _tApp10 === void 0 ? void 0 : _tApp10.targetManager;
311
305
  };
312
- var getAnimationManager = exports.getAnimationManager = function getAnimationManager() {
306
+ var getAnimationManager = function getAnimationManager() {
313
307
  var _tApp11;
314
308
  return (_tApp11 = tApp) === null || _tApp11 === void 0 ? void 0 : _tApp11.animationManager;
315
309
  };
316
- var getRunScheduler = exports.getRunScheduler = function getRunScheduler() {
310
+ var getRunScheduler = function getRunScheduler() {
317
311
  var _tApp12;
318
312
  return (_tApp12 = tApp) === null || _tApp12 === void 0 ? void 0 : _tApp12.runScheduler;
319
313
  };
320
- var getLocationManager = exports.getLocationManager = function getLocationManager() {
314
+ var getLocationManager = function getLocationManager() {
321
315
  var _tApp13;
322
316
  return (_tApp13 = tApp) === null || _tApp13 === void 0 ? void 0 : _tApp13.locationManager;
323
317
  };
324
- var getScreenWidth = exports.getScreenWidth = function getScreenWidth() {
318
+ var getScreenWidth = function getScreenWidth() {
325
319
  var _tApp$tRoot$val, _tApp14;
326
320
  return (_tApp$tRoot$val = (_tApp14 = tApp) === null || _tApp14 === void 0 || (_tApp14 = _tApp14.tRoot) === null || _tApp14 === void 0 ? void 0 : _tApp14.val('screenWidth')) !== null && _tApp$tRoot$val !== void 0 ? _tApp$tRoot$val : 0;
327
321
  };
328
- var getScreenHeight = exports.getScreenHeight = function getScreenHeight() {
322
+ var getScreenHeight = function getScreenHeight() {
329
323
  var _tApp$tRoot$val2, _tApp15;
330
324
  return (_tApp$tRoot$val2 = (_tApp15 = tApp) === null || _tApp15 === void 0 || (_tApp15 = _tApp15.tRoot) === null || _tApp15 === void 0 ? void 0 : _tApp15.val('screenHeight')) !== null && _tApp$tRoot$val2 !== void 0 ? _tApp$tRoot$val2 : 0;
331
325
  };
332
- var getVisibles = exports.getVisibles = function getVisibles() {
326
+ var getVisibles = function getVisibles() {
333
327
  var _tApp16;
334
328
  return (_tApp16 = tApp) === null || _tApp16 === void 0 || (_tApp16 = _tApp16.manager) === null || _tApp16 === void 0 ? void 0 : _tApp16.getVisibles();
335
329
  };
336
- var getResizeLastUpdate = exports.getResizeLastUpdate = function getResizeLastUpdate() {
330
+ var getResizeLastUpdate = function getResizeLastUpdate() {
337
331
  var _tApp17;
338
332
  return (_tApp17 = tApp) === null || _tApp17 === void 0 ? void 0 : _tApp17.resizeLastUpdate;
339
333
  };
340
- var getTModelById = exports.getTModelById = function getTModelById(id) {
334
+ var getTModelById = function getTModelById(id) {
341
335
  return App.tmodelIdMap[id];
342
336
  };
343
- var getDomTModelById = exports.getDomTModelById = function getDomTModelById(id) {
337
+ var getDomTModelById = function getDomTModelById(id) {
344
338
  var tmodel = App.tmodelIdMap[id];
345
339
  return tmodel && tmodel.targets['sourceDom'] ? tmodel : undefined;
346
340
  };
347
- window.t = window.t || getTModelById;
341
+ if (typeof window !== "undefined") {
342
+ window.t = window.t || getTModelById;
343
+ }
348
344
  var runApp = function runApp() {
349
345
  if (tApp) {
350
346
  return;
351
347
  }
352
- exports.tApp = tApp = AppFn();
348
+ tApp = AppFn();
353
349
  tApp.init().start();
354
350
  };
355
- if (document.readyState === "loading") {
356
- document.addEventListener("DOMContentLoaded", runApp);
357
- } else {
358
- runApp();
359
- }
351
+ if (typeof document !== "undefined") {
352
+ if (document.readyState === "loading") {
353
+ document.addEventListener("DOMContentLoaded", runApp);
354
+ } else {
355
+ runApp();
356
+ }
357
+ }
358
+ export { tApp, App, tRoot, isRunning, getEvents, getPager, getLoader, fetch, fetchImage, getManager, getTargetManager, getAnimationManager, getRunScheduler, getLocationManager, getScreenWidth, getScreenHeight, getVisibles, getResizeLastUpdate, getTModelById, getDomTModelById };