targetj 1.0.260 → 1.1.1

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.
@@ -14,7 +14,6 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
14
14
  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; }
15
15
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16
16
  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); }
17
- import { TargetData } from "./TargetData.js";
18
17
  import { TargetParser } from "./TargetParser.js";
19
18
  import { TargetUtil } from "./TargetUtil.js";
20
19
  import { TUtil } from "./TUtil.js";
@@ -23,35 +22,34 @@ var ParticleUtil = /*#__PURE__*/function () {
23
22
  _classCallCheck(this, ParticleUtil);
24
23
  }
25
24
  return _createClass(ParticleUtil, null, [{
26
- key: "isGpuChildrenTarget",
27
- value: function isGpuChildrenTarget(key) {
28
- return ParticleUtil.gpuChildrenTargets.has(TargetUtil.getTargetName(key));
25
+ key: "affectsChildLayout",
26
+ value: function affectsChildLayout(key) {
27
+ return ["x", "y", "width", "height"].includes(ParticleUtil.getTargetName(key));
29
28
  }
30
29
  }, {
31
- key: "getGpuRenderTargetName",
32
- value: function getGpuRenderTargetName(key) {
33
- var cleanKey = TargetUtil.getTargetName(key);
34
- return ParticleUtil.gpuRenderAliases[cleanKey] || cleanKey;
30
+ key: "affectsChildFlowLayout",
31
+ value: function affectsChildFlowLayout(key) {
32
+ return ["width", "height"].includes(ParticleUtil.getTargetName(key));
35
33
  }
36
34
  }, {
37
- key: "isGpuRenderTarget",
38
- value: function isGpuRenderTarget(key) {
39
- return ParticleUtil.gpuRenderTargets.has(ParticleUtil.getGpuRenderTargetName(key));
35
+ key: "isChildrenTarget",
36
+ value: function isChildrenTarget(key) {
37
+ return ParticleUtil.childrenTargets.has(TargetUtil.getTargetName(key));
40
38
  }
41
39
  }, {
42
- key: "isIgnoredGpuStyleTarget",
43
- value: function isIgnoredGpuStyleTarget(key) {
40
+ key: "getTargetName",
41
+ value: function getTargetName(key) {
44
42
  var cleanKey = TargetUtil.getTargetName(key);
45
- return TargetData.styleSet.has(cleanKey) && !ParticleUtil.isGpuRenderTarget(cleanKey);
43
+ return ParticleUtil.gpuRenderAliases[cleanKey] || cleanKey;
46
44
  }
47
45
  }, {
48
- key: "affectsChildLayout",
49
- value: function affectsChildLayout(key) {
50
- return ParticleUtil.childLayoutTargets.has(ParticleUtil.getGpuRenderTargetName(key));
46
+ key: "isGpuTarget",
47
+ value: function isGpuTarget(key) {
48
+ return ParticleUtil.gpuRenderTargets.has(ParticleUtil.getTargetName(key));
51
49
  }
52
50
  }, {
53
- key: "getGpuTargetMode",
54
- value: function getGpuTargetMode(key) {
51
+ key: "getTargetMode",
52
+ value: function getTargetMode(key) {
55
53
  if (key.endsWith("$$")) {
56
54
  return "deferred";
57
55
  }
@@ -60,55 +58,40 @@ var ParticleUtil = /*#__PURE__*/function () {
60
58
  }
61
59
  return "immediate";
62
60
  }
63
- }, {
64
- key: "classifyGpuChildTarget",
65
- value: function classifyGpuChildTarget(key, value) {
66
- /*
67
- * Interval is a property of the target definition, not the target name.
68
- * Check it before render/style classification.
69
- */
70
- if (TargetParser.isIntervalTarget(value)) {
71
- return "interval";
72
- }
73
- if (ParticleUtil.isGpuRenderTarget(key)) {
74
- return "render";
75
- }
76
- if (ParticleUtil.isIgnoredGpuStyleTarget(key)) {
77
- return "ignoredStyle";
78
- }
79
- return "runtime";
80
- }
81
61
  }, {
82
62
  key: "isTransientRuntimeField",
83
63
  value: function isTransientRuntimeField(key) {
84
64
  return ParticleUtil.transientRuntimeFields.has(key);
85
65
  }
86
66
  }, {
87
- key: "isFunctionBasedGpuValue",
88
- value: function isFunctionBasedGpuValue(value) {
89
- if (typeof value === "function") {
67
+ key: "isFunctionBasedTarget",
68
+ value: function isFunctionBasedTarget(target) {
69
+ if (typeof target === "function") {
90
70
  return true;
91
71
  }
92
- return TargetParser.isTargetSpecObject(value) && typeof value.value === "function";
72
+ return TargetParser.isTargetSpecObject(target) && typeof target.value === "function";
93
73
  }
94
74
  }, {
95
- key: "resolveGpuRenderValue",
96
- value: function resolveGpuRenderValue(value, child) {
97
- if (typeof value === "function") {
98
- return value.call(child);
75
+ key: "resolveValue",
76
+ value: function resolveValue(target, child) {
77
+ if (typeof target === "function") {
78
+ return ParticleUtil.resolveValue(target.call(child), child);
99
79
  }
100
- if (!TargetParser.isTargetSpecObject(value)) {
101
- return value;
80
+ if (!TargetParser.isTargetSpecObject(target)) {
81
+ return target;
102
82
  }
103
- var resolved = _objectSpread({}, value);
83
+ var resolved = _objectSpread({}, target);
104
84
  if (typeof resolved.value === "function") {
105
- resolved.value = resolved.value.call(child);
85
+ resolved.value = ParticleUtil.resolveValue(resolved.value.call(child), child);
106
86
  }
107
87
  return resolved;
108
88
  }
109
89
  }, {
110
- key: "getGpuInitialRenderValue",
111
- value: function getGpuInitialRenderValue(value) {
90
+ key: "getInitialValue",
91
+ value: function getInitialValue(value) {
92
+ if (TargetParser.isValueStepsCycleArray(value)) {
93
+ return value[0];
94
+ }
112
95
  if (!TargetParser.isTargetSpecObject(value)) {
113
96
  return value;
114
97
  }
@@ -118,113 +101,56 @@ var ParticleUtil = /*#__PURE__*/function () {
118
101
  return value.value;
119
102
  }
120
103
  }, {
121
- key: "setGpuInitialChildValue",
122
- value: function setGpuInitialChildValue(child, key, value) {
104
+ key: "setInitialValue",
105
+ value: function setInitialValue(child, key, value) {
123
106
  if (!child || !TUtil.isDefined(value)) {
124
107
  return;
125
108
  }
126
109
  child.val(key, value);
127
110
  }
128
111
  }, {
129
- key: "createGpuRuntimeTarget",
130
- value: function createGpuRuntimeTarget(key, value) {
131
- return {
132
- key: key,
133
- targetName: ParticleUtil.getGpuRenderTargetName(key),
134
- kind: ParticleUtil.classifyGpuChildTarget(key, value),
135
- mode: ParticleUtil.getGpuTargetMode(key),
136
- target: TargetParser.isTargetSpecObject(value) ? _objectSpread({}, value) : {
137
- value: value
138
- }
139
- };
140
- }
141
- }, {
142
- key: "requiresGpuChildRuntime",
143
- value: function requiresGpuChildRuntime(key, value) {
144
- var mode = ParticleUtil.getGpuTargetMode(key);
145
- var kind = ParticleUtil.classifyGpuChildTarget(key, value);
146
- if (kind === "interval" || kind === "runtime") {
112
+ key: "requiresRuntime",
113
+ value: function requiresRuntime(key, target) {
114
+ var mode = ParticleUtil.getTargetMode(key);
115
+ if (!ParticleUtil.isGpuTarget(key) || TargetParser.isIntervalTarget(target)) {
147
116
  return true;
148
117
  }
149
118
  if (mode !== "immediate") {
150
119
  return true;
151
120
  }
152
- if (!ParticleUtil.isGpuRenderTarget(key)) {
153
- return false;
121
+ if (TargetParser.isValueStepsCycleArray(target)) {
122
+ return true;
154
123
  }
155
-
156
- /*
157
- * A plain render function such as x() or backgroundColor() can simply
158
- * be resolved immediately. It does not require an animation runtime.
159
- */
160
- if (typeof value === "function") {
124
+ if (!TargetParser.isTargetSpecObject(target)) {
161
125
  return false;
162
126
  }
163
- if (!TargetParser.isTargetSpecObject(value)) {
164
- return false;
165
- }
166
-
167
- /*
168
- * Simple GPU transitions such as:
169
- *
170
- * x: {
171
- * value: [0, 500],
172
- * steps: 100
173
- * }
174
- *
175
- * can continue using the existing bulk GPU transition path.
176
- *
177
- * Targets with their own execution timing or function-valued value
178
- * require the lightweight child runtime.
179
- */
180
- return typeof value.value === "function" || TUtil.isDefined(value.interval) || TUtil.isDefined(value.easing) || TUtil.isDefined(value.cycles) || TUtil.isDefined(value.loop);
127
+ return typeof target.value === "function" || typeof target.steps === "function" || TUtil.isDefined(target.interval) || TUtil.isDefined(target.easing) || TUtil.isDefined(target.cycles) || TUtil.isDefined(target.loop) || TUtil.isDefined(target.pauseOn);
181
128
  }
182
129
  }, {
183
- key: "compileGpuChildDefinition",
184
- value: function compileGpuChildDefinition(child, definition) {
130
+ key: "compileChildDefinition",
131
+ value: function compileChildDefinition(child, definition) {
185
132
  var renderDefinition = {};
186
133
  var runtimeTargets = [];
187
- var ignoredStyles = [];
188
- var layoutFunctions = [];
189
134
  var entries = Object.entries(definition).map(function (_ref) {
190
135
  var _ref2 = _slicedToArray(_ref, 2),
191
136
  key = _ref2[0],
192
- value = _ref2[1];
137
+ target = _ref2[1];
193
138
  return {
194
139
  key: key,
195
- value: value,
196
- kind: ParticleUtil.classifyGpuChildTarget(key, value),
197
- mode: ParticleUtil.getGpuTargetMode(key),
198
- targetName: ParticleUtil.getGpuRenderTargetName(key),
199
- requiresRuntime: ParticleUtil.requiresGpuChildRuntime(key, value)
140
+ target: target,
141
+ mode: ParticleUtil.getTargetMode(key),
142
+ targetName: ParticleUtil.getTargetName(key),
143
+ requiresRuntime: ParticleUtil.requiresRuntime(key, target)
200
144
  };
201
145
  });
202
-
203
- /*
204
- * Resolve ordinary immediate non-function render values first.
205
- *
206
- * This seeds width/height/etc. before x() and other functions execute.
207
- */
208
146
  var _iterator = _createForOfIteratorHelper(entries),
209
147
  _step;
210
148
  try {
211
149
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
212
150
  var entry = _step.value;
213
- if (entry.kind !== "render" || entry.mode !== "immediate" || entry.requiresRuntime || ParticleUtil.isFunctionBasedGpuValue(entry.value)) {
214
- continue;
215
- }
216
- var resolved = ParticleUtil.resolveGpuRenderValue(entry.value, child);
217
- renderDefinition[entry.targetName] = resolved;
218
- ParticleUtil.setGpuInitialChildValue(child, entry.targetName, ParticleUtil.getGpuInitialRenderValue(resolved));
151
+ var cleanKey = TargetUtil.getTargetName(entry.key);
152
+ child.allTargetMap[cleanKey] = entry.key;
219
153
  }
220
-
221
- /*
222
- * Resolve plain immediate function-valued render targets after
223
- * static dimensions have been initialized.
224
- *
225
- * Keep layout functions so they can be recalculated after the
226
- * parent's first layout.
227
- */
228
154
  } catch (err) {
229
155
  _iterator.e(err);
230
156
  } finally {
@@ -235,24 +161,16 @@ var ParticleUtil = /*#__PURE__*/function () {
235
161
  try {
236
162
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
237
163
  var _entry = _step2.value;
238
- if (_entry.kind !== "render" || _entry.mode !== "immediate" || _entry.requiresRuntime || !ParticleUtil.isFunctionBasedGpuValue(_entry.value)) {
164
+ if (_entry.mode !== "immediate" || ParticleUtil.isFunctionBasedTarget(_entry.target)) {
239
165
  continue;
240
166
  }
241
- var _resolved = ParticleUtil.resolveGpuRenderValue(_entry.value, child);
242
- renderDefinition[_entry.targetName] = _resolved;
243
- ParticleUtil.setGpuInitialChildValue(child, _entry.targetName, ParticleUtil.getGpuInitialRenderValue(_resolved));
244
- if (ParticleUtil.affectsChildLayout(_entry.targetName)) {
245
- layoutFunctions.push({
246
- key: _entry.key,
247
- targetName: _entry.targetName,
248
- value: _entry.value
249
- });
167
+ var resolved = ParticleUtil.resolveValue(_entry.target, child);
168
+ var initialValue = ParticleUtil.getInitialValue(resolved);
169
+ ParticleUtil.setInitialValue(child, _entry.targetName, initialValue);
170
+ if (ParticleUtil.isGpuTarget(_entry.key) && !_entry.requiresRuntime) {
171
+ renderDefinition[_entry.targetName] = resolved;
250
172
  }
251
173
  }
252
-
253
- /*
254
- * Preserve runtime targets in their original code order.
255
- */
256
174
  } catch (err) {
257
175
  _iterator2.e(err);
258
176
  } finally {
@@ -263,34 +181,34 @@ var ParticleUtil = /*#__PURE__*/function () {
263
181
  try {
264
182
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
265
183
  var _entry2 = _step3.value;
266
- if (_entry2.kind === "ignoredStyle") {
267
- ignoredStyles.push(_entry2.key);
184
+ if (_entry2.mode !== "immediate" || !ParticleUtil.isGpuTarget(_entry2.key) || !ParticleUtil.isFunctionBasedTarget(_entry2.target)) {
268
185
  continue;
269
186
  }
270
- if (!_entry2.requiresRuntime) {
187
+ var _resolved = ParticleUtil.resolveValue(_entry2.target, child);
188
+ _entry2.requiresRuntime = ParticleUtil.requiresRuntime(_entry2.key, _resolved);
189
+ if (_entry2.requiresRuntime) {
190
+ var _initialValue = ParticleUtil.getInitialValue(_resolved);
191
+ if (TUtil.isDefined(_initialValue)) {
192
+ renderDefinition[_entry2.targetName] = _initialValue;
193
+ ParticleUtil.setInitialValue(child, _entry2.targetName, _initialValue);
194
+ }
271
195
  continue;
272
196
  }
273
- runtimeTargets.push(ParticleUtil.createGpuRuntimeTarget(_entry2.key, _entry2.value));
274
-
275
- /*
276
- * An immediate animated render target needs an initial GPU-visible
277
- * value, but the animation itself belongs to childRuntimePrograms.
278
- *
279
- * Example:
280
- *
281
- * y: {
282
- * value() { return [0, 500]; },
283
- * steps: 30,
284
- * interval: 20
285
- * }
286
- *
287
- * renderDefinition gets y: 0.
288
- */
289
- if (_entry2.kind === "render" && _entry2.mode === "immediate") {
290
- var _resolved2 = ParticleUtil.resolveGpuRenderValue(_entry2.value, child);
291
- var initialValue = ParticleUtil.getGpuInitialRenderValue(_resolved2);
292
- renderDefinition[_entry2.targetName] = initialValue;
293
- ParticleUtil.setGpuInitialChildValue(child, _entry2.targetName, initialValue);
197
+ renderDefinition[_entry2.targetName] = _resolved;
198
+ ParticleUtil.setInitialValue(child, _entry2.targetName, ParticleUtil.getInitialValue(_resolved));
199
+ var resolvedValue = TargetParser.isTargetSpecObject(_resolved) ? _resolved.value : _resolved;
200
+ if (ParticleUtil.affectsChildLayout(_entry2.targetName) && !Array.isArray(resolvedValue)) {
201
+ runtimeTargets.push({
202
+ key: _entry2.key,
203
+ targetName: _entry2.targetName,
204
+ mode: _entry2.mode,
205
+ target: TargetParser.isTargetSpecObject(_entry2.target) ? _objectSpread({}, _entry2.target) : {
206
+ value: _entry2.target
207
+ },
208
+ requiresRuntime: false,
209
+ requiresInitialResolution: false,
210
+ renderable: true
211
+ });
294
212
  }
295
213
  }
296
214
  } catch (err) {
@@ -298,20 +216,50 @@ var ParticleUtil = /*#__PURE__*/function () {
298
216
  } finally {
299
217
  _iterator3.f();
300
218
  }
219
+ var _iterator4 = _createForOfIteratorHelper(entries),
220
+ _step4;
221
+ try {
222
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
223
+ var _entry3 = _step4.value;
224
+ if (!_entry3.requiresRuntime) {
225
+ continue;
226
+ }
227
+ var requiresInitialResolution = _entry3.mode === "immediate" && ParticleUtil.isGpuTarget(_entry3.key) && ParticleUtil.isFunctionBasedTarget(_entry3.target);
228
+ var runtimeTarget = {
229
+ key: _entry3.key,
230
+ targetName: _entry3.targetName,
231
+ mode: _entry3.mode,
232
+ target: TargetParser.isTargetSpecObject(_entry3.target) ? _objectSpread({}, _entry3.target) : {
233
+ value: _entry3.target
234
+ },
235
+ requiresRuntime: true,
236
+ requiresInitialResolution: requiresInitialResolution,
237
+ renderable: ParticleUtil.isGpuTarget(_entry3.key)
238
+ };
239
+ runtimeTargets.push(runtimeTarget);
240
+ if (ParticleUtil.isGpuTarget(_entry3.key) && _entry3.mode === "immediate" && !ParticleUtil.isFunctionBasedTarget(_entry3.target)) {
241
+ var _resolved2 = ParticleUtil.resolveValue(_entry3.target, child);
242
+ var _initialValue2 = ParticleUtil.getInitialValue(_resolved2);
243
+ renderDefinition[_entry3.targetName] = _initialValue2;
244
+ ParticleUtil.setInitialValue(child, _entry3.targetName, _initialValue2);
245
+ }
246
+ }
247
+ } catch (err) {
248
+ _iterator4.e(err);
249
+ } finally {
250
+ _iterator4.f();
251
+ }
301
252
  return {
302
253
  renderDefinition: renderDefinition,
303
- runtimeTargets: runtimeTargets,
304
- ignoredStyles: ignoredStyles,
305
- layoutFunctions: layoutFunctions
254
+ runtimeTargets: runtimeTargets
306
255
  };
307
256
  }
308
257
  }]);
309
258
  }();
310
- _defineProperty(ParticleUtil, "gpuRenderTargets", new Set(["x", "y", "width", "height", "borderRadius", "backgroundColor", "rotate"]));
259
+ _defineProperty(ParticleUtil, "gpuRenderTargets", new Set(["x", "y", "width", "height", "borderRadius", "backgroundColor", "rotate", "opacity", "scale", "image"]));
311
260
  _defineProperty(ParticleUtil, "gpuRenderAliases", {
312
261
  background: "backgroundColor"
313
262
  });
314
- _defineProperty(ParticleUtil, "childLayoutTargets", new Set(["x", "y", "width", "height"]));
315
- _defineProperty(ParticleUtil, "gpuChildrenTargets", new Set(["addChildren", "children"]));
316
- _defineProperty(ParticleUtil, "transientRuntimeFields", new Set(["particleRenderer", "childHandles", "particleValuesDirty", "particleRenderRequested", "pendingGpuChildren", "layoutEpoch", "completeLayoutEpoch", "completeChildrenLayoutState", "layoutCompleteWaiters", "particleSyncPromise", "restoringParticleRuntime"]));
263
+ _defineProperty(ParticleUtil, "childrenTargets", new Set(["addChildren", "children"]));
264
+ _defineProperty(ParticleUtil, "transientRuntimeFields", new Set(["particleRenderer", "childHandles", "particleValuesDirty", "particleRenderRequested", "pendingGpuChildren", "explodeCapturePromise", "layoutEpoch", "completeLayoutEpoch", "completeLayoutState", "layoutCompleteWaiters", "particleSyncPromise", "restoringParticleRuntime"]));
317
265
  export { ParticleUtil };
@@ -77,10 +77,15 @@ var RunScheduler = /*#__PURE__*/function () {
77
77
  }, {
78
78
  key: "scheduleOnlyIfEarlier",
79
79
  value: function scheduleOnlyIfEarlier(delay, runId) {
80
- var _this$runStartTime;
81
- var base = this.runningFlag ? (_this$runStartTime = this.runStartTime) !== null && _this$runStartTime !== void 0 ? _this$runStartTime : TUtil.now() : TUtil.now();
82
- var runTime = base + (delay !== null && delay !== void 0 ? delay : 0);
83
- if (this.delayProcess && runTime >= this.delayProcess.runTime) {
80
+ var _this$delayProcess$ru, _this$delayProcess;
81
+ if (!tApp.isRunning() || this.resetting) {
82
+ return;
83
+ }
84
+ var effectiveDelay = tApp.throttle === 0 ? Math.max(0, delay !== null && delay !== void 0 ? delay : 0) : tApp.throttle;
85
+ var requestedTime = TUtil.now() + effectiveDelay;
86
+ var activeTime = (_this$delayProcess$ru = (_this$delayProcess = this.delayProcess) === null || _this$delayProcess === void 0 ? void 0 : _this$delayProcess.runTime) !== null && _this$delayProcess$ru !== void 0 ? _this$delayProcess$ru : Infinity;
87
+ var queuedTime = this.nextRuns.length ? this.nextRuns[0].insertTime + this.nextRuns[0].delay : Infinity;
88
+ if (Math.min(activeTime, queuedTime) <= requestedTime) {
84
89
  return;
85
90
  }
86
91
  this.schedule(delay, runId);
@@ -99,7 +104,7 @@ var RunScheduler = /*#__PURE__*/function () {
99
104
  key: "run",
100
105
  value: function () {
101
106
  var _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(delay, runId) {
102
- var handedOff, _this$delayProcess, capturedEvent, type, activatedStep;
107
+ var handedOff, _this$delayProcess2, capturedEvent, type, activatedStep;
103
108
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
104
109
  while (1) switch (_context2.prev = _context2.next) {
105
110
  case 0:
@@ -124,7 +129,7 @@ var RunScheduler = /*#__PURE__*/function () {
124
129
  this.runStartTime = TUtil.now();
125
130
  handedOff = false;
126
131
  if (tApp.debugLevel === 1) {
127
- TUtil.log(true)("Request from: ".concat(runId, " delay: ").concat(delay, " runningStep:").concat(this.runningStep, " dom:").concat(this.domProcessing, " runs:").concat(this.nextRuns.length, " D:").concat((_this$delayProcess = this.delayProcess) === null || _this$delayProcess === void 0 ? void 0 : _this$delayProcess.delay, " events:").concat(getEvents().eventQueue.length));
132
+ TUtil.log(true)("Request from: ".concat(runId, " delay: ").concat(delay, " runningStep:").concat(this.runningStep, " dom:").concat(this.domProcessing, " runs:").concat(this.nextRuns.length, " D:").concat((_this$delayProcess2 = this.delayProcess) === null || _this$delayProcess2 === void 0 ? void 0 : _this$delayProcess2.delay, " events:").concat(getEvents().eventQueue.length));
128
133
  }
129
134
  _context2.prev = 11;
130
135
  if (!(this.phase === 0)) {
@@ -249,9 +254,11 @@ var RunScheduler = /*#__PURE__*/function () {
249
254
  var newDelay = this.nextRuns.length > 0 ? this.nextRuns[0].delay - (TUtil.now() - this.nextRuns[0].insertTime) : undefined;
250
255
  var manager = getManager();
251
256
  var hasImmediateWork = manager.lists.restyle.length > 0 || manager.lists.reasyncStyle.length > 0 || getLocationManager().activatedList.length > 0;
252
- if (newDelay === undefined || manager.lists.activeTModels.length > 0 || manager.lists.updatingTModels.length > 0 || hasImmediateWork) {
257
+ var hasNoDomVisibilityWork = manager.lists.noDomVisibilityTModels.length > 0;
258
+ if (newDelay === undefined || manager.lists.activeTModels.length > 0 || manager.lists.updatingTModels.length > 0 || hasImmediateWork || hasNoDomVisibilityWork) {
253
259
  if (manager.lists.updatingTModels.length > 0) {
254
260
  this.schedule(1, "getManager-needsRerun-updatingTModels");
261
+ return;
255
262
  } else if (manager.lists.activeTModels.length > 0) {
256
263
  var activeTModel = manager.lists.activeTModels.find(function (tmodel) {
257
264
  return tmodel.targetExecutionCount === 0 || tmodel.activeTargetList.filter(function (target) {
@@ -264,10 +271,15 @@ var RunScheduler = /*#__PURE__*/function () {
264
271
  var delay = !this.activeStartTime || TUtil.now() - this.activeStartTime > 15 ? 1 : 15;
265
272
  this.activeStartTime = TUtil.now();
266
273
  this.schedule(delay, "getManager-needsRerun-".concat(activeTModel.oid, "-").concat(activeTModel.activeTargetList));
274
+ return;
267
275
  }
268
- } else if (hasImmediateWork) {
276
+ }
277
+ if (hasImmediateWork) {
269
278
  this.schedule(1, 'needsRerun-dom-work');
270
279
  }
280
+ if (hasNoDomVisibilityWork) {
281
+ this.schedule(15, "needsRerun-noDomVisibility");
282
+ }
271
283
  }
272
284
  }
273
285
  this.executeNextRun();
@@ -314,8 +326,8 @@ var RunScheduler = /*#__PURE__*/function () {
314
326
  }, {
315
327
  key: "clearDelayProcess",
316
328
  value: function clearDelayProcess() {
317
- var _this$delayProcess2;
318
- if ((_this$delayProcess2 = this.delayProcess) !== null && _this$delayProcess2 !== void 0 && _this$delayProcess2.timeoutId) {
329
+ var _this$delayProcess3;
330
+ if ((_this$delayProcess3 = this.delayProcess) !== null && _this$delayProcess3 !== void 0 && _this$delayProcess3.timeoutId) {
319
331
  clearTimeout(this.delayProcess.timeoutId);
320
332
  this.delayProcess.timeoutId = undefined;
321
333
  }
@@ -402,7 +414,7 @@ var RunScheduler = /*#__PURE__*/function () {
402
414
  if (runToExecute) {
403
415
  this.setDelayProcess(runToExecute.runId, runToExecute.insertTime, runToExecute.delay, TUtil.now(), 0);
404
416
  } else if (this.nextRuns.length > 0) {
405
- var nextValidRun = this.nextRuns[0];
417
+ var nextValidRun = this.nextRuns.shift();
406
418
  var _now = TUtil.now();
407
419
  var _newDelay = Math.max(0, nextValidRun.delay - (_now - nextValidRun.insertTime));
408
420
  this.setDelayProcess(nextValidRun.runId, nextValidRun.insertTime, nextValidRun.delay, _now + _newDelay, _newDelay);