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.
- package/Export.js +3 -0
- package/build/AnimationManager.js +221 -153
- package/build/AnimationUtil.js +0 -1
- package/build/App.js +82 -34
- package/build/BaseModel.js +51 -15
- package/build/Bracket.js +7 -1
- package/build/Easing.js +5 -0
- package/build/EventListener.js +37 -8
- package/build/HtmlToCanvas.js +411 -0
- package/build/LocationManager.js +167 -46
- package/build/PageManager.js +67 -115
- package/build/ParticleChild.js +576 -0
- package/build/ParticleExplode.js +360 -0
- package/build/ParticleRenderer.js +821 -159
- package/build/ParticleRuntime.js +1529 -381
- package/build/ParticleTModel.js +864 -293
- package/build/ParticleUtil.js +120 -172
- package/build/RunScheduler.js +23 -11
- package/build/StateManager.js +206 -57
- package/build/StateUtil.js +141 -82
- package/build/TModel.js +172 -73
- package/build/TModelManager.js +155 -132
- package/build/TModelUtil.js +232 -142
- package/build/TUtil.js +55 -50
- package/build/TargetData.js +26 -12
- package/build/TargetExecutor.js +48 -17
- package/build/TargetManager.js +47 -39
- package/build/TargetParser.js +57 -4
- package/build/TargetUtil.js +211 -129
- package/build/VisibilityUtil.js +4 -2
- package/build/index.js +1 -0
- package/dist/targetjs.js +1 -1
- package/dist/targetjs.js.gz +0 -0
- package/package.json +1 -1
package/build/ParticleUtil.js
CHANGED
|
@@ -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: "
|
|
27
|
-
value: function
|
|
28
|
-
return
|
|
25
|
+
key: "affectsChildLayout",
|
|
26
|
+
value: function affectsChildLayout(key) {
|
|
27
|
+
return ["x", "y", "width", "height"].includes(ParticleUtil.getTargetName(key));
|
|
29
28
|
}
|
|
30
29
|
}, {
|
|
31
|
-
key: "
|
|
32
|
-
value: function
|
|
33
|
-
|
|
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: "
|
|
38
|
-
value: function
|
|
39
|
-
return ParticleUtil.
|
|
35
|
+
key: "isChildrenTarget",
|
|
36
|
+
value: function isChildrenTarget(key) {
|
|
37
|
+
return ParticleUtil.childrenTargets.has(TargetUtil.getTargetName(key));
|
|
40
38
|
}
|
|
41
39
|
}, {
|
|
42
|
-
key: "
|
|
43
|
-
value: function
|
|
40
|
+
key: "getTargetName",
|
|
41
|
+
value: function getTargetName(key) {
|
|
44
42
|
var cleanKey = TargetUtil.getTargetName(key);
|
|
45
|
-
return
|
|
43
|
+
return ParticleUtil.gpuRenderAliases[cleanKey] || cleanKey;
|
|
46
44
|
}
|
|
47
45
|
}, {
|
|
48
|
-
key: "
|
|
49
|
-
value: function
|
|
50
|
-
return ParticleUtil.
|
|
46
|
+
key: "isGpuTarget",
|
|
47
|
+
value: function isGpuTarget(key) {
|
|
48
|
+
return ParticleUtil.gpuRenderTargets.has(ParticleUtil.getTargetName(key));
|
|
51
49
|
}
|
|
52
50
|
}, {
|
|
53
|
-
key: "
|
|
54
|
-
value: function
|
|
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: "
|
|
88
|
-
value: function
|
|
89
|
-
if (typeof
|
|
67
|
+
key: "isFunctionBasedTarget",
|
|
68
|
+
value: function isFunctionBasedTarget(target) {
|
|
69
|
+
if (typeof target === "function") {
|
|
90
70
|
return true;
|
|
91
71
|
}
|
|
92
|
-
return TargetParser.isTargetSpecObject(
|
|
72
|
+
return TargetParser.isTargetSpecObject(target) && typeof target.value === "function";
|
|
93
73
|
}
|
|
94
74
|
}, {
|
|
95
|
-
key: "
|
|
96
|
-
value: function
|
|
97
|
-
if (typeof
|
|
98
|
-
return
|
|
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(
|
|
101
|
-
return
|
|
80
|
+
if (!TargetParser.isTargetSpecObject(target)) {
|
|
81
|
+
return target;
|
|
102
82
|
}
|
|
103
|
-
var resolved = _objectSpread({},
|
|
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: "
|
|
111
|
-
value: function
|
|
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: "
|
|
122
|
-
value: function
|
|
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: "
|
|
130
|
-
value: function
|
|
131
|
-
|
|
132
|
-
|
|
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 (
|
|
153
|
-
return
|
|
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
|
-
|
|
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: "
|
|
184
|
-
value: function
|
|
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
|
-
|
|
137
|
+
target = _ref2[1];
|
|
193
138
|
return {
|
|
194
139
|
key: key,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
214
|
-
|
|
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.
|
|
164
|
+
if (_entry.mode !== "immediate" || ParticleUtil.isFunctionBasedTarget(_entry.target)) {
|
|
239
165
|
continue;
|
|
240
166
|
}
|
|
241
|
-
var
|
|
242
|
-
|
|
243
|
-
ParticleUtil.
|
|
244
|
-
if (ParticleUtil.
|
|
245
|
-
|
|
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.
|
|
267
|
-
ignoredStyles.push(_entry2.key);
|
|
184
|
+
if (_entry2.mode !== "immediate" || !ParticleUtil.isGpuTarget(_entry2.key) || !ParticleUtil.isFunctionBasedTarget(_entry2.target)) {
|
|
268
185
|
continue;
|
|
269
186
|
}
|
|
270
|
-
|
|
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
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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, "
|
|
315
|
-
_defineProperty(ParticleUtil, "
|
|
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 };
|
package/build/RunScheduler.js
CHANGED
|
@@ -77,10 +77,15 @@ var RunScheduler = /*#__PURE__*/function () {
|
|
|
77
77
|
}, {
|
|
78
78
|
key: "scheduleOnlyIfEarlier",
|
|
79
79
|
value: function scheduleOnlyIfEarlier(delay, runId) {
|
|
80
|
-
var _this$
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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$
|
|
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$
|
|
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
|
-
|
|
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
|
-
}
|
|
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$
|
|
318
|
-
if ((_this$
|
|
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
|
|
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);
|