targetj 1.0.239 → 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.
- package/Export.js +28 -5
- package/build/$Dom.js +21 -25
- package/build/AnimationManager.js +39 -44
- package/build/AnimationUtil.js +41 -45
- package/build/App.js +73 -74
- package/build/BaseModel.js +86 -90
- package/build/Bracket.js +7 -11
- package/build/BracketGenerator.js +15 -19
- package/build/ColorUtil.js +3 -8
- package/build/DomInit.js +34 -38
- package/build/Easing.js +3 -8
- package/build/EventListener.js +63 -67
- package/build/LoadingManager.js +34 -38
- package/build/LocationManager.js +52 -56
- package/build/Moves.js +17 -21
- package/build/PageManager.js +64 -68
- package/build/RunScheduler.js +46 -50
- package/build/ScheduleUtil.js +20 -24
- package/build/SearchUtil.js +16 -20
- package/build/TModel.js +52 -56
- package/build/TModelManager.js +37 -41
- package/build/TModelUtil.js +47 -50
- package/build/TUtil.js +16 -20
- package/build/TargetData.js +35 -40
- package/build/TargetExecutor.js +72 -76
- package/build/TargetManager.js +49 -52
- package/build/TargetParser.js +35 -39
- package/build/TargetUtil.js +25 -29
- package/build/Viewport.js +6 -10
- package/build/VisibilityUtil.js +11 -15
- package/build/index.js +20 -225
- package/dist/targetjs.js +1 -1
- package/dist/targetjs.js.gz +0 -0
- package/package.json +13 -7
package/build/PageManager.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PageManager = void 0;
|
|
7
|
-
var _TUtil = require("./TUtil.js");
|
|
8
|
-
var _App = require("./App.js");
|
|
9
|
-
var _DomInit = require("./DomInit.js");
|
|
10
|
-
var _$Dom = require("./$Dom.js");
|
|
11
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); }
|
|
12
2
|
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; }
|
|
13
3
|
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; }
|
|
@@ -20,14 +10,19 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
20
10
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
21
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
12
|
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); }
|
|
13
|
+
import { TUtil } from "./TUtil.js";
|
|
14
|
+
import { tApp, App, getRunScheduler, getLocationManager, getEvents } from "./App.js";
|
|
15
|
+
import { DomInit } from "./DomInit.js";
|
|
16
|
+
import { $Dom } from "./$Dom.js";
|
|
17
|
+
|
|
23
18
|
/**
|
|
24
19
|
* It enables opening new pages and managing history. It alo provide page caching.
|
|
25
20
|
* It is used to provide a single page app experience.
|
|
26
21
|
*/
|
|
27
|
-
var PageManager =
|
|
22
|
+
var PageManager = /*#__PURE__*/function () {
|
|
28
23
|
function PageManager() {
|
|
29
24
|
_classCallCheck(this, PageManager);
|
|
30
|
-
this.lastLink =
|
|
25
|
+
this.lastLink = TUtil.getFullLink(document.URL);
|
|
31
26
|
this.lastCachedLink = undefined;
|
|
32
27
|
this.pageCache = {};
|
|
33
28
|
this.initHistory();
|
|
@@ -35,7 +30,7 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
35
30
|
return _createClass(PageManager, [{
|
|
36
31
|
key: "initHistory",
|
|
37
32
|
value: function initHistory() {
|
|
38
|
-
var link =
|
|
33
|
+
var link = TUtil.getFullLink(document.URL);
|
|
39
34
|
var st = history.state;
|
|
40
35
|
if (!st || !st.link && !st.browserUrl) {
|
|
41
36
|
history.replaceState({
|
|
@@ -47,12 +42,12 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
47
42
|
}, {
|
|
48
43
|
key: "initPage",
|
|
49
44
|
value: function initPage(html) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (
|
|
53
|
-
|
|
45
|
+
tApp.tRoot.$dom.outerHTML(html);
|
|
46
|
+
tApp.tRoot.$dom = $Dom.query('#tgjs-root') ? new $Dom('#tgjs-root') : new $Dom('body');
|
|
47
|
+
if (tApp.tRoot.$dom.getTagName() !== 'body') {
|
|
48
|
+
tApp.tRoot.$dom.attr('data-tj-no-slot', 'true');
|
|
54
49
|
}
|
|
55
|
-
|
|
50
|
+
DomInit.initPageDoms(tApp.tRoot.$dom);
|
|
56
51
|
}
|
|
57
52
|
}, {
|
|
58
53
|
key: "openPage",
|
|
@@ -71,51 +66,51 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
71
66
|
break;
|
|
72
67
|
}
|
|
73
68
|
_context.next = 4;
|
|
74
|
-
return
|
|
69
|
+
return tApp.stop();
|
|
75
70
|
case 4:
|
|
76
|
-
|
|
71
|
+
getLocationManager().cancelCurrentCalculation();
|
|
77
72
|
_context.next = 7;
|
|
78
|
-
return
|
|
73
|
+
return tApp.reset();
|
|
79
74
|
case 7:
|
|
80
|
-
link =
|
|
75
|
+
link = TUtil.getFullLink(link);
|
|
81
76
|
if (this.pageCache[link]) {
|
|
82
77
|
_context.next = 18;
|
|
83
78
|
break;
|
|
84
79
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
tApp.tRoot.$dom.innerHTML("");
|
|
81
|
+
App.oids = {};
|
|
82
|
+
App.tmodelIdMap = {};
|
|
83
|
+
tApp.tRoot = tApp.tRootFactory();
|
|
89
84
|
this.lastLink = link;
|
|
90
85
|
_context.next = 16;
|
|
91
|
-
return
|
|
86
|
+
return tApp.start();
|
|
92
87
|
case 16:
|
|
93
88
|
_context.next = 34;
|
|
94
89
|
break;
|
|
95
90
|
case 18:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
91
|
+
tApp.tRoot = this.pageCache[link].tRoot;
|
|
92
|
+
App.oids = this.pageCache[link].oids;
|
|
93
|
+
App.tmodelIdMap = this.pageCache[link].tmodelIdMap;
|
|
94
|
+
tApp.tRoot.$dom = $Dom.query('#tgjs-root') ? new $Dom('#tgjs-root') : new $Dom('body');
|
|
95
|
+
tApp.tRoot.$dom.innerHTML(this.pageCache[link].html);
|
|
101
96
|
visibles = Object.values(this.pageCache[link].visibleOidMap);
|
|
102
|
-
newVisibles =
|
|
97
|
+
newVisibles = DomInit.initCacheDoms(visibles);
|
|
103
98
|
visibles.forEach(function (tmodel) {
|
|
104
99
|
tmodel.visibilityStatus = undefined;
|
|
105
100
|
});
|
|
106
|
-
|
|
101
|
+
tApp.manager.activatePendingTargetsAfterDom(visibles, {
|
|
107
102
|
restoredDoneTargets: true
|
|
108
103
|
});
|
|
109
|
-
|
|
104
|
+
tApp.manager.visibleOidMap = _objectSpread({}, this.pageCache[link].visibleOidMap);
|
|
110
105
|
newVisibles.forEach(function (visible) {
|
|
111
|
-
|
|
106
|
+
tApp.manager.visibleOidMap[visible.oid] = visible;
|
|
112
107
|
});
|
|
113
108
|
window.scrollTo(this.pageCache[link].scrollLeft, this.pageCache[link].scrollTop);
|
|
114
109
|
this.lastLink = link;
|
|
115
110
|
_context.next = 33;
|
|
116
|
-
return
|
|
111
|
+
return tApp.start();
|
|
117
112
|
case 33:
|
|
118
|
-
|
|
113
|
+
getRunScheduler().restoreSnapshot(this.pageCache[link].runSnapshot);
|
|
119
114
|
case 34:
|
|
120
115
|
case "end":
|
|
121
116
|
return _context.stop();
|
|
@@ -163,10 +158,10 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
163
158
|
}, {
|
|
164
159
|
key: "onPageClose",
|
|
165
160
|
value: function onPageClose() {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
161
|
+
tApp.resizeLastUpdate = TUtil.now();
|
|
162
|
+
getEvents().resizeRoot();
|
|
163
|
+
tApp.manager.getAvailableDoms().forEach(function (tmodel) {
|
|
164
|
+
getLocationManager().runEventTargets(tmodel, ['onPageClose']);
|
|
170
165
|
});
|
|
171
166
|
}
|
|
172
167
|
}, {
|
|
@@ -181,33 +176,33 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
181
176
|
while (1) switch (_context3.prev = _context3.next) {
|
|
182
177
|
case 0:
|
|
183
178
|
updateHistory = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : true;
|
|
184
|
-
link =
|
|
179
|
+
link = TUtil.getFullLink(link);
|
|
185
180
|
if (!this.lastLink) {
|
|
186
181
|
_context3.next = 14;
|
|
187
182
|
break;
|
|
188
183
|
}
|
|
189
|
-
runSnapshot =
|
|
184
|
+
runSnapshot = getRunScheduler().getSnapshot();
|
|
190
185
|
_context3.next = 6;
|
|
191
|
-
return
|
|
186
|
+
return tApp.stop();
|
|
192
187
|
case 6:
|
|
193
|
-
|
|
188
|
+
getLocationManager().cancelCurrentCalculation();
|
|
194
189
|
this.onPageClose();
|
|
195
|
-
|
|
196
|
-
html =
|
|
190
|
+
tApp.tRoot.$dom = $Dom.query('#tgjs-root') ? new $Dom('#tgjs-root') : new $Dom('body');
|
|
191
|
+
html = tApp.tRoot.$dom.innerHTML();
|
|
197
192
|
this.pageCache[this.lastLink] = {
|
|
198
193
|
link: this.lastLink,
|
|
199
194
|
html: html,
|
|
200
|
-
oids: _objectSpread({},
|
|
201
|
-
tmodelIdMap: _objectSpread({},
|
|
202
|
-
visibleOidMap: _objectSpread({},
|
|
203
|
-
scrollLeft:
|
|
204
|
-
scrollTop:
|
|
205
|
-
tRoot:
|
|
195
|
+
oids: _objectSpread({}, App.oids),
|
|
196
|
+
tmodelIdMap: _objectSpread({}, App.tmodelIdMap),
|
|
197
|
+
visibleOidMap: _objectSpread({}, tApp.manager.visibleOidMap),
|
|
198
|
+
scrollLeft: $Dom.getWindowScrollLeft() || 0,
|
|
199
|
+
scrollTop: $Dom.getWindowScrollTop() || 0,
|
|
200
|
+
tRoot: tApp.tRoot,
|
|
206
201
|
runSnapshot: runSnapshot
|
|
207
202
|
};
|
|
208
203
|
this.lastCachedLink = this.lastLink;
|
|
209
204
|
_context3.next = 14;
|
|
210
|
-
return
|
|
205
|
+
return tApp.reset();
|
|
211
206
|
case 14:
|
|
212
207
|
if (updateHistory) {
|
|
213
208
|
history.pushState({
|
|
@@ -217,7 +212,7 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
217
212
|
_context3.next = 17;
|
|
218
213
|
return this.openPage(link, false);
|
|
219
214
|
case 17:
|
|
220
|
-
|
|
215
|
+
getRunScheduler().schedule(0, "pagemanager-processOpenLink");
|
|
221
216
|
case 18:
|
|
222
217
|
case "end":
|
|
223
218
|
return _context3.stop();
|
|
@@ -232,17 +227,17 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
232
227
|
}, {
|
|
233
228
|
key: "updateBrowserUrl",
|
|
234
229
|
value: function updateBrowserUrl(link, updateHistory) {
|
|
235
|
-
|
|
230
|
+
tApp.tRoot.$dom = $Dom.query('#tgjs-root') ? new $Dom('#tgjs-root') : new $Dom('body');
|
|
236
231
|
this.pageCache[document.URL] = {
|
|
237
232
|
link: document.URL,
|
|
238
|
-
html:
|
|
239
|
-
oids: _objectSpread({},
|
|
240
|
-
tmodelIdMap: _objectSpread({},
|
|
241
|
-
visibleOidMap: _objectSpread({},
|
|
242
|
-
scrollLeft:
|
|
243
|
-
scrollTop:
|
|
244
|
-
tRoot:
|
|
245
|
-
runSnapshot:
|
|
233
|
+
html: tApp.tRoot.$dom.innerHTML(),
|
|
234
|
+
oids: _objectSpread({}, App.oids),
|
|
235
|
+
tmodelIdMap: _objectSpread({}, App.tmodelIdMap),
|
|
236
|
+
visibleOidMap: _objectSpread({}, tApp.manager.visibleOidMap),
|
|
237
|
+
scrollLeft: $Dom.getWindowScrollLeft() || 0,
|
|
238
|
+
scrollTop: $Dom.getWindowScrollTop() || 0,
|
|
239
|
+
tRoot: tApp.tRoot,
|
|
240
|
+
runSnapshot: getRunScheduler().getSnapshot()
|
|
246
241
|
};
|
|
247
242
|
if (updateHistory) {
|
|
248
243
|
history.pushState({
|
|
@@ -253,7 +248,7 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
253
248
|
browserUrl: link
|
|
254
249
|
}, "", link);
|
|
255
250
|
}
|
|
256
|
-
|
|
251
|
+
getRunScheduler().schedule(0, "pagemanager-processUpdateBrowserUrl");
|
|
257
252
|
}
|
|
258
253
|
}, {
|
|
259
254
|
key: "back",
|
|
@@ -267,7 +262,7 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
267
262
|
if (!link) {
|
|
268
263
|
return undefined;
|
|
269
264
|
}
|
|
270
|
-
link =
|
|
265
|
+
link = TUtil.getFullLink(link);
|
|
271
266
|
return this.pageCache[link];
|
|
272
267
|
}
|
|
273
268
|
}, {
|
|
@@ -279,4 +274,5 @@ var PageManager = exports.PageManager = /*#__PURE__*/function () {
|
|
|
279
274
|
return page === null || page === void 0 || (_page$tmodelIdMap = page.tmodelIdMap) === null || _page$tmodelIdMap === void 0 ? void 0 : _page$tmodelIdMap[id];
|
|
280
275
|
}
|
|
281
276
|
}]);
|
|
282
|
-
}();
|
|
277
|
+
}();
|
|
278
|
+
export { PageManager };
|
package/build/RunScheduler.js
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.RunScheduler = void 0;
|
|
7
|
-
var _TUtil = require("./TUtil.js");
|
|
8
|
-
var _App = require("./App.js");
|
|
9
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); }
|
|
10
2
|
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; }
|
|
11
3
|
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); }
|
|
@@ -16,13 +8,16 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
16
8
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
9
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
10
|
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); }
|
|
11
|
+
import { TUtil } from "./TUtil.js";
|
|
12
|
+
import { tApp, getEvents, getManager, getLocationManager, tRoot } from "./App.js";
|
|
13
|
+
|
|
19
14
|
/**
|
|
20
15
|
* It is responsible for scheduling and managing the execution of TargetJ process cycle.
|
|
21
16
|
* It tracks execution timing and maintains statistics for each cycle.
|
|
22
17
|
*/
|
|
23
18
|
|
|
24
19
|
var FRAME_BUDGET_MS = 20;
|
|
25
|
-
var RunScheduler =
|
|
20
|
+
var RunScheduler = /*#__PURE__*/function () {
|
|
26
21
|
function RunScheduler() {
|
|
27
22
|
_classCallCheck(this, RunScheduler);
|
|
28
23
|
this.nextRuns = [];
|
|
@@ -81,7 +76,7 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
81
76
|
key: "scheduleOnlyIfEarlier",
|
|
82
77
|
value: function scheduleOnlyIfEarlier(delay, runId) {
|
|
83
78
|
var _this$runStartTime;
|
|
84
|
-
var base = this.runningFlag ? (_this$runStartTime = this.runStartTime) !== null && _this$runStartTime !== void 0 ? _this$runStartTime :
|
|
79
|
+
var base = this.runningFlag ? (_this$runStartTime = this.runStartTime) !== null && _this$runStartTime !== void 0 ? _this$runStartTime : TUtil.now() : TUtil.now();
|
|
85
80
|
var runTime = base + (delay !== null && delay !== void 0 ? delay : 0);
|
|
86
81
|
if (this.delayProcess && runTime >= this.delayProcess.runTime) {
|
|
87
82
|
return;
|
|
@@ -91,11 +86,11 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
91
86
|
}, {
|
|
92
87
|
key: "schedule",
|
|
93
88
|
value: function schedule(delay, runId) {
|
|
94
|
-
if (!
|
|
89
|
+
if (!tApp.isRunning() || this.resetting) {
|
|
95
90
|
return;
|
|
96
91
|
}
|
|
97
|
-
var effectiveDelay =
|
|
98
|
-
var insertTime =
|
|
92
|
+
var effectiveDelay = tApp.throttle === 0 ? delay !== null && delay !== void 0 ? delay : 0 : tApp.throttle;
|
|
93
|
+
var insertTime = TUtil.now();
|
|
99
94
|
this.delayRun(effectiveDelay, runId, insertTime);
|
|
100
95
|
}
|
|
101
96
|
}, {
|
|
@@ -106,7 +101,7 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
106
101
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
107
102
|
while (1) switch (_context2.prev = _context2.next) {
|
|
108
103
|
case 0:
|
|
109
|
-
if (!(!
|
|
104
|
+
if (!(!tApp.isRunning() || this.resetting)) {
|
|
110
105
|
_context2.next = 2;
|
|
111
106
|
break;
|
|
112
107
|
}
|
|
@@ -124,21 +119,21 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
124
119
|
this.rerunId = '';
|
|
125
120
|
this.runId = runId;
|
|
126
121
|
this.runningFlag = true;
|
|
127
|
-
this.runStartTime =
|
|
122
|
+
this.runStartTime = TUtil.now();
|
|
128
123
|
handedOff = false;
|
|
129
124
|
_context2.prev = 10;
|
|
130
125
|
if (!(this.phase === 0)) {
|
|
131
126
|
_context2.next = 17;
|
|
132
127
|
break;
|
|
133
128
|
}
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
getEvents().captureEvents();
|
|
130
|
+
tApp.targetManager.applyTargetValues(tRoot());
|
|
136
131
|
_context2.next = 16;
|
|
137
|
-
return
|
|
132
|
+
return getLocationManager().calculateAll();
|
|
138
133
|
case 16:
|
|
139
134
|
this.phase = 1;
|
|
140
135
|
case 17:
|
|
141
|
-
if (!(
|
|
136
|
+
if (!(TUtil.now() - this.runStartTime > FRAME_BUDGET_MS)) {
|
|
142
137
|
_context2.next = 21;
|
|
143
138
|
break;
|
|
144
139
|
}
|
|
@@ -147,10 +142,10 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
147
142
|
return _context2.abrupt("return");
|
|
148
143
|
case 21:
|
|
149
144
|
if (this.phase === 1) {
|
|
150
|
-
this.runningStep =
|
|
145
|
+
this.runningStep = tApp.manager.analyze();
|
|
151
146
|
this.phase = 2;
|
|
152
147
|
}
|
|
153
|
-
if (!(
|
|
148
|
+
if (!(TUtil.now() - this.runStartTime > FRAME_BUDGET_MS)) {
|
|
154
149
|
_context2.next = 26;
|
|
155
150
|
break;
|
|
156
151
|
}
|
|
@@ -159,11 +154,11 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
159
154
|
return _context2.abrupt("return");
|
|
160
155
|
case 26:
|
|
161
156
|
if (this.phase === 2) {
|
|
162
|
-
|
|
163
|
-
|
|
157
|
+
getLocationManager().calculateActivated();
|
|
158
|
+
tApp.events.resetEventsOnTimeout();
|
|
164
159
|
this.phase = 3;
|
|
165
160
|
}
|
|
166
|
-
if (!(
|
|
161
|
+
if (!(TUtil.now() - this.runStartTime > FRAME_BUDGET_MS)) {
|
|
167
162
|
_context2.next = 31;
|
|
168
163
|
break;
|
|
169
164
|
}
|
|
@@ -182,7 +177,7 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
182
177
|
}
|
|
183
178
|
this.phase = 4;
|
|
184
179
|
}
|
|
185
|
-
this.runDuration =
|
|
180
|
+
this.runDuration = TUtil.now() - this.runStartTime;
|
|
186
181
|
if (this.domProcessing === 0) {
|
|
187
182
|
this.needsRerun();
|
|
188
183
|
}
|
|
@@ -233,15 +228,15 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
233
228
|
var id = this.rerunId;
|
|
234
229
|
this.rerunId = '';
|
|
235
230
|
this.schedule(0, "rerun-".concat(id));
|
|
236
|
-
} else if (
|
|
237
|
-
this.schedule(0, "events-".concat(
|
|
231
|
+
} else if (getEvents().eventQueue.length > 0) {
|
|
232
|
+
this.schedule(0, "events-".concat(getEvents().eventQueue.length));
|
|
238
233
|
} else {
|
|
239
|
-
var newDelay = this.nextRuns.length > 0 ? this.nextRuns[0].delay - (
|
|
240
|
-
if (newDelay === undefined ||
|
|
241
|
-
if (
|
|
234
|
+
var newDelay = this.nextRuns.length > 0 ? this.nextRuns[0].delay - (TUtil.now() - this.nextRuns[0].insertTime) : undefined;
|
|
235
|
+
if (newDelay === undefined || getManager().lists.activeTModels.length > 0 || getManager().lists.updatingTModels.length > 0 || getManager().lists.restyle.length > 0 || getManager().lists.reasyncStyle.length > 0 || getEvents().eventQueue.length > 0 || getLocationManager().activatedList.length > 0) {
|
|
236
|
+
if (getManager().lists.updatingTModels.length > 0) {
|
|
242
237
|
this.schedule(1, "getManager-needsRerun-updatingTModels");
|
|
243
|
-
} else if (
|
|
244
|
-
var activeTModel =
|
|
238
|
+
} else if (getManager().lists.activeTModels.length > 0) {
|
|
239
|
+
var activeTModel = getManager().lists.activeTModels.find(function (tmodel) {
|
|
245
240
|
return tmodel.targetExecutionCount === 0 || tmodel.activeTargetList.filter(function (target) {
|
|
246
241
|
return !tmodel.isScheduledPending(target);
|
|
247
242
|
}).some(function (target) {
|
|
@@ -249,8 +244,8 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
249
244
|
});
|
|
250
245
|
});
|
|
251
246
|
if (activeTModel) {
|
|
252
|
-
var delay = !this.activeStartTime ||
|
|
253
|
-
this.activeStartTime =
|
|
247
|
+
var delay = !this.activeStartTime || TUtil.now() - this.activeStartTime > 15 ? 1 : 15;
|
|
248
|
+
this.activeStartTime = TUtil.now();
|
|
254
249
|
this.schedule(delay, "getManager-needsRerun-".concat(activeTModel.oid, "-").concat(activeTModel.activeTargetList));
|
|
255
250
|
}
|
|
256
251
|
}
|
|
@@ -272,7 +267,7 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
272
267
|
}).map(function (step) {
|
|
273
268
|
return Promise.resolve().then(step);
|
|
274
269
|
})).then(function () {
|
|
275
|
-
if (
|
|
270
|
+
if (getManager().lists.restyle.length) {
|
|
276
271
|
_this2.domFixStyles();
|
|
277
272
|
return;
|
|
278
273
|
}
|
|
@@ -290,7 +285,7 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
290
285
|
this.domProcessing = 2;
|
|
291
286
|
requestAnimationFrame(function () {
|
|
292
287
|
try {
|
|
293
|
-
|
|
288
|
+
getManager().fixStyles();
|
|
294
289
|
} finally {
|
|
295
290
|
_this3.domProcessing = 0;
|
|
296
291
|
_this3.needsRerun();
|
|
@@ -363,8 +358,8 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
363
358
|
var nextRunTime = nextRun.insertTime + nextRun.delay;
|
|
364
359
|
if (nextRunTime < this.delayProcess.runTime) {
|
|
365
360
|
clearTimeout(this.delayProcess.timeoutId);
|
|
366
|
-
var remaining = Math.max(0, this.delayProcess.runTime -
|
|
367
|
-
this.insertRun(this.delayProcess.runId,
|
|
361
|
+
var remaining = Math.max(0, this.delayProcess.runTime - TUtil.now());
|
|
362
|
+
this.insertRun(this.delayProcess.runId, TUtil.now(), remaining);
|
|
368
363
|
this.delayProcess = undefined;
|
|
369
364
|
} else {
|
|
370
365
|
return;
|
|
@@ -376,7 +371,7 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
376
371
|
var runToExecute = null;
|
|
377
372
|
while (this.nextRuns.length > 0) {
|
|
378
373
|
var _nextRun = this.nextRuns.shift();
|
|
379
|
-
var now =
|
|
374
|
+
var now = TUtil.now();
|
|
380
375
|
var newDelay = _nextRun.delay - (now - _nextRun.insertTime);
|
|
381
376
|
if (newDelay <= 0) {
|
|
382
377
|
runToExecute = _nextRun;
|
|
@@ -386,10 +381,10 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
386
381
|
}
|
|
387
382
|
}
|
|
388
383
|
if (runToExecute) {
|
|
389
|
-
this.setDelayProcess(runToExecute.runId, runToExecute.insertTime, runToExecute.delay,
|
|
384
|
+
this.setDelayProcess(runToExecute.runId, runToExecute.insertTime, runToExecute.delay, TUtil.now(), 0);
|
|
390
385
|
} else if (this.nextRuns.length > 0) {
|
|
391
386
|
var nextValidRun = this.nextRuns[0];
|
|
392
|
-
var _now =
|
|
387
|
+
var _now = TUtil.now();
|
|
393
388
|
var _newDelay = Math.max(0, nextValidRun.delay - (_now - nextValidRun.insertTime));
|
|
394
389
|
this.setDelayProcess(nextValidRun.runId, nextValidRun.insertTime, nextValidRun.delay, _now + _newDelay, _newDelay);
|
|
395
390
|
} else {
|
|
@@ -444,13 +439,13 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
444
439
|
}, {
|
|
445
440
|
key: "getSnapshot",
|
|
446
441
|
value: function getSnapshot() {
|
|
447
|
-
var now =
|
|
442
|
+
var now = TUtil.now();
|
|
448
443
|
var runs = [];
|
|
449
444
|
var addRun = function addRun(run) {
|
|
450
445
|
if (!run) {
|
|
451
446
|
return;
|
|
452
447
|
}
|
|
453
|
-
var runTime =
|
|
448
|
+
var runTime = TUtil.isDefined(run.runTime) ? run.runTime : run.insertTime + run.delay;
|
|
454
449
|
runs.push({
|
|
455
450
|
runId: run.runId,
|
|
456
451
|
delay: Math.max(0, runTime - now)
|
|
@@ -490,15 +485,16 @@ var RunScheduler = exports.RunScheduler = /*#__PURE__*/function () {
|
|
|
490
485
|
}]);
|
|
491
486
|
}();
|
|
492
487
|
_defineProperty(RunScheduler, "domSteps", [function () {
|
|
493
|
-
return
|
|
488
|
+
return getManager().createDoms();
|
|
494
489
|
}, function () {
|
|
495
|
-
return
|
|
490
|
+
return getManager().reattachTModels();
|
|
496
491
|
}, function () {
|
|
497
|
-
return
|
|
492
|
+
return getManager().relocateTModels();
|
|
498
493
|
}, function () {
|
|
499
|
-
return
|
|
494
|
+
return getManager().renderTModels();
|
|
500
495
|
}, function () {
|
|
501
|
-
return
|
|
496
|
+
return getManager().fixAsyncStyles();
|
|
502
497
|
}, function () {
|
|
503
|
-
return
|
|
504
|
-
}]);
|
|
498
|
+
return getManager().deleteDoms();
|
|
499
|
+
}]);
|
|
500
|
+
export { RunScheduler };
|