@lightningjs/renderer 0.9.1 → 0.9.2
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/dist/exports/index.d.ts +3 -0
- package/dist/{src/core/text-rendering/renderers/SdfTextRenderer/internal/findNearestMultiple.js → exports/index.js} +4 -11
- package/dist/exports/index.js.map +1 -0
- package/dist/src/common/IAnimationController.d.ts +58 -1
- package/dist/src/common/IAnimationController.js +0 -18
- package/dist/src/common/IAnimationController.js.map +1 -1
- package/dist/src/core/CoreTextureManager.js +1 -1
- package/dist/src/core/CoreTextureManager.js.map +1 -1
- package/dist/src/core/animations/CoreAnimation.d.ts +2 -2
- package/dist/src/core/animations/CoreAnimation.js +33 -10
- package/dist/src/core/animations/CoreAnimation.js.map +1 -1
- package/dist/src/core/animations/CoreAnimationController.d.ts +8 -12
- package/dist/src/core/animations/CoreAnimationController.js +42 -46
- package/dist/src/core/animations/CoreAnimationController.js.map +1 -1
- package/dist/src/core/lib/ImageWorker.js +8 -5
- package/dist/src/core/lib/ImageWorker.js.map +1 -1
- package/dist/src/core/textures/ImageTexture.d.ts +5 -1
- package/dist/src/core/textures/ImageTexture.js +14 -6
- package/dist/src/core/textures/ImageTexture.js.map +1 -1
- package/dist/src/core/utils.js +1 -6
- package/dist/src/core/utils.js.map +1 -1
- package/dist/src/main-api/INode.d.ts +1 -1
- package/dist/src/main-api/Renderer.d.ts +297 -0
- package/dist/src/main-api/Renderer.js +370 -0
- package/dist/src/main-api/Renderer.js.map +1 -0
- package/dist/src/main-api/utils.d.ts +2 -0
- package/dist/src/main-api/utils.js +34 -0
- package/dist/src/main-api/utils.js.map +1 -0
- package/dist/src/render-drivers/threadx/ThreadXMainAnimationController.d.ts +8 -4
- package/dist/src/render-drivers/threadx/ThreadXMainAnimationController.js +53 -24
- package/dist/src/render-drivers/threadx/ThreadXMainAnimationController.js.map +1 -1
- package/dist/src/render-drivers/threadx/worker/ThreadXRendererNode.js +6 -0
- package/dist/src/render-drivers/threadx/worker/ThreadXRendererNode.js.map +1 -1
- package/dist/tsconfig.dist.tsbuildinfo +1 -1
- package/{dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/roundUpToMultiple.js → exports/index.ts} +4 -14
- package/package.json +1 -1
- package/src/common/IAnimationController.ts +60 -1
- package/src/core/CoreTextureManager.ts +1 -1
- package/src/core/animations/CoreAnimation.ts +35 -11
- package/src/core/animations/CoreAnimationController.ts +48 -53
- package/src/core/lib/ImageWorker.ts +10 -7
- package/src/core/textures/ImageTexture.ts +19 -6
- package/src/core/utils.ts +1 -7
- package/src/main-api/INode.ts +1 -1
- package/src/render-drivers/threadx/ThreadXMainAnimationController.ts +63 -27
- package/src/render-drivers/threadx/worker/ThreadXRendererNode.ts +6 -0
- package/dist/src/core/lib/WebGlContext.d.ts +0 -414
- package/dist/src/core/lib/WebGlContext.js +0 -640
- package/dist/src/core/lib/WebGlContext.js.map +0 -1
- package/dist/src/core/scene/Scene.d.ts +0 -59
- package/dist/src/core/scene/Scene.js +0 -106
- package/dist/src/core/scene/Scene.js.map +0 -1
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/findNearestMultiple.d.ts +0 -8
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/findNearestMultiple.js.map +0 -1
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2/SdfBufferHelper.d.ts +0 -19
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2/SdfBufferHelper.js +0 -84
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2/SdfBufferHelper.js.map +0 -1
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2/layoutLine.d.ts +0 -8
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2/layoutLine.js +0 -40
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2/layoutLine.js.map +0 -1
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2/layoutText2.d.ts +0 -2
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2/layoutText2.js +0 -41
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2/layoutText2.js.map +0 -1
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2/utils.d.ts +0 -1
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2/utils.js +0 -4
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2/utils.js.map +0 -1
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2.d.ts +0 -1
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2.js +0 -2
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText2.js.map +0 -1
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/makeRenderWindow.d.ts +0 -20
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/makeRenderWindow.js +0 -55
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/makeRenderWindow.js.map +0 -1
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/roundUpToMultiple.d.ts +0 -9
- package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/roundUpToMultiple.js.map +0 -1
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* If not stated otherwise in this file or this component's LICENSE file the
|
|
3
|
+
* following copyright and licenses apply:
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2023 Comcast Cable Communications Management, LLC.
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the License);
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { EventEmitter } from '../common/EventEmitter.js';
|
|
20
|
+
import { Inspector } from './Inspector.js';
|
|
21
|
+
import { santizeCustomDataMap } from './utils.js';
|
|
22
|
+
import { assertTruthy, isProductionEnvironment } from '../utils.js';
|
|
23
|
+
import { Stage, } from '../core/Stage.js';
|
|
24
|
+
import { getNewId } from '../utils.js';
|
|
25
|
+
import { CoreNode } from '../core/CoreNode.js';
|
|
26
|
+
import { CoreTextNode } from '../core/CoreTextNode.js';
|
|
27
|
+
/**
|
|
28
|
+
* The Renderer Main API
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* This is the primary class used to configure and operate the Renderer.
|
|
32
|
+
*
|
|
33
|
+
* It is used to create and destroy Nodes, as well as Texture and Shader
|
|
34
|
+
* references.
|
|
35
|
+
*
|
|
36
|
+
* Example:
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';
|
|
39
|
+
*
|
|
40
|
+
* // Initialize the Renderer
|
|
41
|
+
* const renderer = new RendererMain(
|
|
42
|
+
* {
|
|
43
|
+
* appWidth: 1920,
|
|
44
|
+
* appHeight: 1080
|
|
45
|
+
* },
|
|
46
|
+
* 'app',
|
|
47
|
+
* new MainCoreDriver(),
|
|
48
|
+
* );
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export class RendererMain extends EventEmitter {
|
|
52
|
+
root;
|
|
53
|
+
canvas;
|
|
54
|
+
settings;
|
|
55
|
+
stage;
|
|
56
|
+
inspector = null;
|
|
57
|
+
/**
|
|
58
|
+
* Constructs a new Renderer instance
|
|
59
|
+
*
|
|
60
|
+
* @param settings Renderer settings
|
|
61
|
+
* @param target Element ID or HTMLElement to insert the canvas into
|
|
62
|
+
* @param driver Core Driver to use
|
|
63
|
+
*/
|
|
64
|
+
constructor(settings, target) {
|
|
65
|
+
super();
|
|
66
|
+
const resolvedSettings = {
|
|
67
|
+
appWidth: settings.appWidth || 1920,
|
|
68
|
+
appHeight: settings.appHeight || 1080,
|
|
69
|
+
txMemByteThreshold: settings.txMemByteThreshold || 124e6,
|
|
70
|
+
boundsMargin: settings.boundsMargin || 0,
|
|
71
|
+
deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,
|
|
72
|
+
devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,
|
|
73
|
+
clearColor: settings.clearColor ?? 0x00000000,
|
|
74
|
+
fpsUpdateInterval: settings.fpsUpdateInterval || 0,
|
|
75
|
+
numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,
|
|
76
|
+
enableContextSpy: settings.enableContextSpy ?? false,
|
|
77
|
+
enableInspector: settings.enableInspector ?? false,
|
|
78
|
+
renderMode: settings.renderMode ?? 'webgl',
|
|
79
|
+
};
|
|
80
|
+
this.settings = resolvedSettings;
|
|
81
|
+
const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;
|
|
82
|
+
const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;
|
|
83
|
+
const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;
|
|
84
|
+
const canvas = document.createElement('canvas');
|
|
85
|
+
this.canvas = canvas;
|
|
86
|
+
canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;
|
|
87
|
+
canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;
|
|
88
|
+
canvas.style.width = `${deviceLogicalWidth}px`;
|
|
89
|
+
canvas.style.height = `${deviceLogicalHeight}px`;
|
|
90
|
+
// Initialize the stage
|
|
91
|
+
this.stage = new Stage({
|
|
92
|
+
rootId: getNewId(),
|
|
93
|
+
appWidth: this.settings.appWidth,
|
|
94
|
+
appHeight: this.settings.appHeight,
|
|
95
|
+
boundsMargin: this.settings.boundsMargin,
|
|
96
|
+
clearColor: this.settings.clearColor,
|
|
97
|
+
canvas: this.canvas,
|
|
98
|
+
debug: {
|
|
99
|
+
monitorTextureCache: false,
|
|
100
|
+
},
|
|
101
|
+
deviceLogicalPixelRatio: this.settings.deviceLogicalPixelRatio,
|
|
102
|
+
devicePhysicalPixelRatio: this.settings.devicePhysicalPixelRatio,
|
|
103
|
+
enableContextSpy: this.settings.enableContextSpy,
|
|
104
|
+
fpsUpdateInterval: this.settings.fpsUpdateInterval,
|
|
105
|
+
numImageWorkers: this.settings.numImageWorkers,
|
|
106
|
+
renderMode: this.settings.renderMode,
|
|
107
|
+
txMemByteThreshold: this.settings.txMemByteThreshold,
|
|
108
|
+
});
|
|
109
|
+
// Forward fpsUpdate events from the stage to RendererMain
|
|
110
|
+
this.stage.on('fpsUpdate', ((stage, fpsData) => {
|
|
111
|
+
this.emit('fpsUpdate', fpsData);
|
|
112
|
+
}));
|
|
113
|
+
this.stage.on('frameTick', ((stage, frameTickData) => {
|
|
114
|
+
this.emit('frameTick', frameTickData);
|
|
115
|
+
}));
|
|
116
|
+
this.stage.on('idle', () => {
|
|
117
|
+
this.emit('idle');
|
|
118
|
+
});
|
|
119
|
+
// Extract the root node
|
|
120
|
+
this.root = this.stage.root;
|
|
121
|
+
// Get the target element and attach the canvas to it
|
|
122
|
+
let targetEl;
|
|
123
|
+
if (typeof target === 'string') {
|
|
124
|
+
targetEl = document.getElementById(target);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
targetEl = target;
|
|
128
|
+
}
|
|
129
|
+
if (!targetEl) {
|
|
130
|
+
throw new Error('Could not find target element');
|
|
131
|
+
}
|
|
132
|
+
targetEl.appendChild(canvas);
|
|
133
|
+
// Initialize inspector (if enabled)
|
|
134
|
+
if (enableInspector && !isProductionEnvironment()) {
|
|
135
|
+
this.inspector = new Inspector(canvas, resolvedSettings);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Create a new scene graph node
|
|
140
|
+
*
|
|
141
|
+
* @remarks
|
|
142
|
+
* A node is the main graphical building block of the Renderer scene graph. It
|
|
143
|
+
* can be a container for other nodes, or it can be a leaf node that renders a
|
|
144
|
+
* solid color, gradient, image, or specific texture, using a specific shader.
|
|
145
|
+
*
|
|
146
|
+
* To create a text node, see {@link createTextNode}.
|
|
147
|
+
*
|
|
148
|
+
* See {@link INode} for more details.
|
|
149
|
+
*
|
|
150
|
+
* @param props
|
|
151
|
+
* @returns
|
|
152
|
+
*/
|
|
153
|
+
createNode(props) {
|
|
154
|
+
assertTruthy(this.stage, 'Stage is not initialized');
|
|
155
|
+
const resolvedProps = this.resolveNodeDefaults(props);
|
|
156
|
+
const node = new CoreNode(this.stage, {
|
|
157
|
+
...resolvedProps,
|
|
158
|
+
id: getNewId(),
|
|
159
|
+
shaderProps: null,
|
|
160
|
+
});
|
|
161
|
+
if (this.inspector) {
|
|
162
|
+
return this.inspector.createNode(node, resolvedProps);
|
|
163
|
+
}
|
|
164
|
+
// FIXME onDestroy event? node.once('beforeDestroy'
|
|
165
|
+
// FIXME onCreate event?
|
|
166
|
+
return node;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Create a new scene graph text node
|
|
170
|
+
*
|
|
171
|
+
* @remarks
|
|
172
|
+
* A text node is the second graphical building block of the Renderer scene
|
|
173
|
+
* graph. It renders text using a specific text renderer that is automatically
|
|
174
|
+
* chosen based on the font requested and what type of fonts are installed
|
|
175
|
+
* into an app.
|
|
176
|
+
*
|
|
177
|
+
* See {@link ITextNode} for more details.
|
|
178
|
+
*
|
|
179
|
+
* @param props
|
|
180
|
+
* @returns
|
|
181
|
+
*/
|
|
182
|
+
createTextNode(props) {
|
|
183
|
+
const fontSize = props.fontSize ?? 16;
|
|
184
|
+
const data = {
|
|
185
|
+
...this.resolveNodeDefaults(props),
|
|
186
|
+
id: getNewId(),
|
|
187
|
+
text: props.text ?? '',
|
|
188
|
+
textRendererOverride: props.textRendererOverride ?? null,
|
|
189
|
+
fontSize,
|
|
190
|
+
fontFamily: props.fontFamily ?? 'sans-serif',
|
|
191
|
+
fontStyle: props.fontStyle ?? 'normal',
|
|
192
|
+
fontWeight: props.fontWeight ?? 'normal',
|
|
193
|
+
fontStretch: props.fontStretch ?? 'normal',
|
|
194
|
+
textAlign: props.textAlign ?? 'left',
|
|
195
|
+
contain: props.contain ?? 'none',
|
|
196
|
+
scrollable: props.scrollable ?? false,
|
|
197
|
+
scrollY: props.scrollY ?? 0,
|
|
198
|
+
offsetY: props.offsetY ?? 0,
|
|
199
|
+
letterSpacing: props.letterSpacing ?? 0,
|
|
200
|
+
lineHeight: props.lineHeight,
|
|
201
|
+
maxLines: props.maxLines ?? 0,
|
|
202
|
+
textBaseline: props.textBaseline ?? 'alphabetic',
|
|
203
|
+
verticalAlign: props.verticalAlign ?? 'middle',
|
|
204
|
+
overflowSuffix: props.overflowSuffix ?? '...',
|
|
205
|
+
debug: props.debug ?? {},
|
|
206
|
+
shaderProps: null,
|
|
207
|
+
};
|
|
208
|
+
assertTruthy(this.stage);
|
|
209
|
+
const textNode = new CoreTextNode(this.stage, data);
|
|
210
|
+
if (this.inspector) {
|
|
211
|
+
return this.inspector.createTextNode(textNode, data);
|
|
212
|
+
}
|
|
213
|
+
return textNode;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Resolves the default property values for a Node
|
|
217
|
+
*
|
|
218
|
+
* @remarks
|
|
219
|
+
* This method is used internally by the RendererMain to resolve the default
|
|
220
|
+
* property values for a Node. It is exposed publicly so that it can be used
|
|
221
|
+
* by Core Driver implementations.
|
|
222
|
+
*
|
|
223
|
+
* @param props
|
|
224
|
+
* @returns
|
|
225
|
+
*/
|
|
226
|
+
resolveNodeDefaults(props) {
|
|
227
|
+
const color = props.color ?? 0xffffffff;
|
|
228
|
+
const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;
|
|
229
|
+
const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;
|
|
230
|
+
const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;
|
|
231
|
+
const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;
|
|
232
|
+
const data = santizeCustomDataMap(props.data ?? {});
|
|
233
|
+
return {
|
|
234
|
+
x: props.x ?? 0,
|
|
235
|
+
y: props.y ?? 0,
|
|
236
|
+
width: props.width ?? 0,
|
|
237
|
+
height: props.height ?? 0,
|
|
238
|
+
alpha: props.alpha ?? 1,
|
|
239
|
+
autosize: props.autosize ?? false,
|
|
240
|
+
clipping: props.clipping ?? false,
|
|
241
|
+
color,
|
|
242
|
+
colorTop: props.colorTop ?? color,
|
|
243
|
+
colorBottom: props.colorBottom ?? color,
|
|
244
|
+
colorLeft: props.colorLeft ?? color,
|
|
245
|
+
colorRight: props.colorRight ?? color,
|
|
246
|
+
colorBl,
|
|
247
|
+
colorBr,
|
|
248
|
+
colorTl,
|
|
249
|
+
colorTr,
|
|
250
|
+
zIndex: props.zIndex ?? 0,
|
|
251
|
+
zIndexLocked: props.zIndexLocked ?? 0,
|
|
252
|
+
parent: props.parent ?? null,
|
|
253
|
+
texture: props.texture ?? null,
|
|
254
|
+
textureOptions: props.textureOptions ?? {},
|
|
255
|
+
shader: props.shader ?? null,
|
|
256
|
+
// Since setting the `src` will trigger a texture load, we need to set it after
|
|
257
|
+
// we set the texture. Otherwise, problems happen.
|
|
258
|
+
src: props.src ?? '',
|
|
259
|
+
scale: props.scale ?? null,
|
|
260
|
+
scaleX: props.scaleX ?? props.scale ?? 1,
|
|
261
|
+
scaleY: props.scaleY ?? props.scale ?? 1,
|
|
262
|
+
mount: props.mount ?? 0,
|
|
263
|
+
mountX: props.mountX ?? props.mount ?? 0,
|
|
264
|
+
mountY: props.mountY ?? props.mount ?? 0,
|
|
265
|
+
pivot: props.pivot ?? 0.5,
|
|
266
|
+
pivotX: props.pivotX ?? props.pivot ?? 0.5,
|
|
267
|
+
pivotY: props.pivotY ?? props.pivot ?? 0.5,
|
|
268
|
+
rotation: props.rotation ?? 0,
|
|
269
|
+
rtt: props.rtt ?? false,
|
|
270
|
+
data: data,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Destroy a node
|
|
275
|
+
*
|
|
276
|
+
* @remarks
|
|
277
|
+
* This method destroys a node
|
|
278
|
+
*
|
|
279
|
+
* @param node
|
|
280
|
+
* @returns
|
|
281
|
+
*/
|
|
282
|
+
destroyNode(node) {
|
|
283
|
+
if (this.inspector) {
|
|
284
|
+
this.inspector.destroyNode(node.id);
|
|
285
|
+
}
|
|
286
|
+
return node.destroy();
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Create a new texture reference
|
|
290
|
+
*
|
|
291
|
+
* @remarks
|
|
292
|
+
* This method creates a new reference to a texture. The texture is not
|
|
293
|
+
* loaded until it is used on a node.
|
|
294
|
+
*
|
|
295
|
+
* It can be assigned to a node's `texture` property, or it can be used
|
|
296
|
+
* when creating a SubTexture.
|
|
297
|
+
*
|
|
298
|
+
* @param textureType
|
|
299
|
+
* @param props
|
|
300
|
+
* @param options
|
|
301
|
+
* @returns
|
|
302
|
+
*/
|
|
303
|
+
createTexture(textureType, props) {
|
|
304
|
+
return this.stage.txManager.loadTexture(textureType, props);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Create a new shader reference
|
|
308
|
+
*
|
|
309
|
+
* @remarks
|
|
310
|
+
* This method creates a new reference to a shader. The shader is not
|
|
311
|
+
* loaded until it is used on a Node.
|
|
312
|
+
*
|
|
313
|
+
* It can be assigned to a Node's `shader` property.
|
|
314
|
+
*
|
|
315
|
+
* @param shaderType
|
|
316
|
+
* @param props
|
|
317
|
+
* @returns
|
|
318
|
+
*/
|
|
319
|
+
createShader(shaderType, props) {
|
|
320
|
+
return {
|
|
321
|
+
descType: 'shader',
|
|
322
|
+
shType: shaderType,
|
|
323
|
+
props: props,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Get a Node by its ID
|
|
328
|
+
*
|
|
329
|
+
* @param id
|
|
330
|
+
* @returns
|
|
331
|
+
*/
|
|
332
|
+
getNodeById(id) {
|
|
333
|
+
const root = this.stage?.root;
|
|
334
|
+
if (!root) {
|
|
335
|
+
return null;
|
|
336
|
+
}
|
|
337
|
+
const findNode = (node) => {
|
|
338
|
+
if (node.id === id) {
|
|
339
|
+
return node;
|
|
340
|
+
}
|
|
341
|
+
for (const child of node.children) {
|
|
342
|
+
const found = findNode(child);
|
|
343
|
+
if (found) {
|
|
344
|
+
return found;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
return null;
|
|
348
|
+
};
|
|
349
|
+
return findNode(root);
|
|
350
|
+
}
|
|
351
|
+
toggleFreeze() {
|
|
352
|
+
throw new Error('Not implemented');
|
|
353
|
+
}
|
|
354
|
+
advanceFrame() {
|
|
355
|
+
throw new Error('Not implemented');
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Re-render the current frame without advancing any running animations.
|
|
359
|
+
*
|
|
360
|
+
* @remarks
|
|
361
|
+
* Any state changes will be reflected in the re-rendered frame. Useful for
|
|
362
|
+
* debugging.
|
|
363
|
+
*
|
|
364
|
+
* May not do anything if the render loop is running on a separate worker.
|
|
365
|
+
*/
|
|
366
|
+
rerender() {
|
|
367
|
+
throw new Error('Not implemented');
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
//# sourceMappingURL=Renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Renderer.js","sourceRoot":"","sources":["../../../src/main-api/Renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAgBH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,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;;;;OAKG;IACH,WAAW,CAAC,EAAU;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC;QAC9B,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,IAAI,CAAC;SACb;QAED,MAAM,QAAQ,GAAG,CAAC,IAAc,EAAmB,EAAE;YACnD,IAAI,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE;gBAClB,OAAO,IAAI,CAAC;aACb;YAED,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAC9B,IAAI,KAAK,EAAE;oBACT,OAAO,KAAK,CAAC;iBACd;aACF;YAED,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,YAAY;QACV,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IAED,YAAY;QACV,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ;QACN,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function santizeCustomDataMap(d) {
|
|
2
|
+
const validTypes = {
|
|
3
|
+
boolean: true,
|
|
4
|
+
string: true,
|
|
5
|
+
number: true,
|
|
6
|
+
undefined: true,
|
|
7
|
+
};
|
|
8
|
+
const keys = Object.keys(d);
|
|
9
|
+
for (let i = 0; i < keys.length; i++) {
|
|
10
|
+
const key = keys[i];
|
|
11
|
+
if (!key) {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
const value = d[key];
|
|
15
|
+
const valueType = typeof value;
|
|
16
|
+
// Typescript doesn't understand the above const valueType ¯\_(ツ)_/¯
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
18
|
+
// @ts-ignore-next-line
|
|
19
|
+
if (valueType === 'string' && value.length > 2048) {
|
|
20
|
+
console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);
|
|
21
|
+
// same here, see above comment, this can only be a string at this point
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23
|
+
// @ts-ignore-next-line
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
|
25
|
+
d[key] = value.substring(0, 2048);
|
|
26
|
+
}
|
|
27
|
+
if (!validTypes[valueType]) {
|
|
28
|
+
console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);
|
|
29
|
+
delete d[key];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return d;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/main-api/utils.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,oBAAoB,CAAC,CAAgB;IACnD,MAAM,UAAU,GAAG;QACjB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,IAAI;KAChB,CAAC;IAEF,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,GAAG,EAAE;YACR,SAAS;SACV;QAED,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACrB,MAAM,SAAS,GAAG,OAAO,KAAK,CAAC;QAE/B,oEAAoE;QACpE,6DAA6D;QAC7D,uBAAuB;QACvB,IAAI,SAAS,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI,EAAE;YACjD,OAAO,CAAC,IAAI,CACV,yBAAyB,GAAG,uDAAuD,CACpF,CAAC;YAEF,wEAAwE;YACxE,6DAA6D;YAC7D,uBAAuB;YACvB,sGAAsG;YACtG,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;SACnC;QAED,IAAI,CAAC,UAAU,CAAC,SAAoC,CAAC,EAAE;YACrD,OAAO,CAAC,IAAI,CACV,yBAAyB,GAAG,0DAA0D,CACvF,CAAC;YACF,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;SACf;KACF;IAED,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
+
import { EventEmitter } from '../../common/EventEmitter.js';
|
|
1
2
|
import type { AnimationControllerState, IAnimationController } from '../../common/IAnimationController.js';
|
|
2
3
|
import type { ThreadXMainNode } from './ThreadXMainNode.js';
|
|
3
|
-
export declare class ThreadXMainAnimationController implements IAnimationController {
|
|
4
|
+
export declare class ThreadXMainAnimationController extends EventEmitter implements IAnimationController {
|
|
4
5
|
private node;
|
|
5
6
|
private id;
|
|
6
|
-
stoppedPromise: Promise<void
|
|
7
|
+
stoppedPromise: Promise<void>;
|
|
7
8
|
/**
|
|
8
9
|
* If this is null, then the animation is in a finished / stopped state.
|
|
9
10
|
*/
|
|
10
11
|
stoppedResolve: (() => void) | null;
|
|
11
|
-
constructor(node: ThreadXMainNode, id: number);
|
|
12
12
|
state: AnimationControllerState;
|
|
13
|
+
constructor(node: ThreadXMainNode, id: number);
|
|
13
14
|
start(): IAnimationController;
|
|
14
15
|
stop(): IAnimationController;
|
|
15
16
|
pause(): IAnimationController;
|
|
16
17
|
restore(): IAnimationController;
|
|
17
18
|
waitUntilStopped(): Promise<void>;
|
|
18
|
-
private
|
|
19
|
+
private sendStart;
|
|
20
|
+
private sendStop;
|
|
19
21
|
private makeStoppedPromise;
|
|
22
|
+
private onFinished;
|
|
23
|
+
private onAnimating;
|
|
20
24
|
}
|
|
@@ -16,38 +16,47 @@
|
|
|
16
16
|
* See the License for the specific language governing permissions and
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
|
+
/* eslint-disable @typescript-eslint/unbound-method */
|
|
20
|
+
import { EventEmitter } from '../../common/EventEmitter.js';
|
|
19
21
|
import { assertTruthy } from '../../utils.js';
|
|
20
|
-
export class ThreadXMainAnimationController {
|
|
22
|
+
export class ThreadXMainAnimationController extends EventEmitter {
|
|
21
23
|
node;
|
|
22
24
|
id;
|
|
23
|
-
stoppedPromise
|
|
25
|
+
stoppedPromise;
|
|
24
26
|
/**
|
|
25
27
|
* If this is null, then the animation is in a finished / stopped state.
|
|
26
28
|
*/
|
|
27
29
|
stoppedResolve = null;
|
|
30
|
+
state;
|
|
28
31
|
constructor(node, id) {
|
|
32
|
+
super();
|
|
29
33
|
this.node = node;
|
|
30
34
|
this.id = id;
|
|
31
|
-
this.onAnimationFinished = this.onAnimationFinished.bind(this);
|
|
32
35
|
this.state = 'stopped';
|
|
36
|
+
// Initial stopped promise is resolved (since the animation is stopped)
|
|
37
|
+
this.stoppedPromise = Promise.resolve();
|
|
38
|
+
// Bind event handlers
|
|
39
|
+
this.onAnimating = this.onAnimating.bind(this);
|
|
40
|
+
this.onFinished = this.onFinished.bind(this);
|
|
33
41
|
}
|
|
34
|
-
state;
|
|
35
42
|
start() {
|
|
36
|
-
if (this.
|
|
43
|
+
if (this.state !== 'running') {
|
|
37
44
|
this.makeStoppedPromise();
|
|
38
|
-
this.
|
|
45
|
+
this.sendStart();
|
|
46
|
+
this.state = 'running';
|
|
39
47
|
}
|
|
40
|
-
this.state = 'running';
|
|
41
|
-
this.node.emit('startAnimation', { id: this.id });
|
|
42
48
|
return this;
|
|
43
49
|
}
|
|
44
50
|
stop() {
|
|
45
|
-
this.
|
|
46
|
-
|
|
47
|
-
if (this.stoppedResolve !== null) {
|
|
48
|
-
this.stoppedResolve();
|
|
49
|
-
this.stoppedResolve = null;
|
|
51
|
+
if (this.state === 'stopped') {
|
|
52
|
+
return this;
|
|
50
53
|
}
|
|
54
|
+
this.sendStop();
|
|
55
|
+
// if (this.stoppedResolve !== null) {
|
|
56
|
+
// this.stoppedResolve();
|
|
57
|
+
// this.stoppedResolve = null;
|
|
58
|
+
// this.emit('stopped', this);
|
|
59
|
+
// }
|
|
51
60
|
this.state = 'stopped';
|
|
52
61
|
return this;
|
|
53
62
|
}
|
|
@@ -60,18 +69,21 @@ export class ThreadXMainAnimationController {
|
|
|
60
69
|
return this;
|
|
61
70
|
}
|
|
62
71
|
waitUntilStopped() {
|
|
63
|
-
this.
|
|
64
|
-
const promise = this.stoppedPromise;
|
|
65
|
-
assertTruthy(promise);
|
|
66
|
-
return promise;
|
|
72
|
+
return this.stoppedPromise;
|
|
67
73
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
sendStart() {
|
|
75
|
+
// Hook up event listeners
|
|
76
|
+
this.node.on('animationFinished', this.onFinished);
|
|
77
|
+
this.node.on('animationAnimating', this.onAnimating);
|
|
78
|
+
// Then register the animation
|
|
79
|
+
this.node.emit('startAnimation', { id: this.id });
|
|
80
|
+
}
|
|
81
|
+
sendStop() {
|
|
82
|
+
// First unregister the animation
|
|
83
|
+
this.node.emit('stopAnimation', { id: this.id });
|
|
84
|
+
// Then unhook event listeners
|
|
85
|
+
this.node.off('animationFinished', this.onFinished);
|
|
86
|
+
this.node.off('animationAnimating', this.onAnimating);
|
|
75
87
|
}
|
|
76
88
|
makeStoppedPromise() {
|
|
77
89
|
if (this.stoppedResolve === null) {
|
|
@@ -80,5 +92,22 @@ export class ThreadXMainAnimationController {
|
|
|
80
92
|
});
|
|
81
93
|
}
|
|
82
94
|
}
|
|
95
|
+
onFinished(target, { id }) {
|
|
96
|
+
if (id === this.id) {
|
|
97
|
+
assertTruthy(this.stoppedResolve);
|
|
98
|
+
this.node.off('animationFinished', this.onFinished);
|
|
99
|
+
this.node.off('animationAnimating', this.onAnimating);
|
|
100
|
+
// resolve promise
|
|
101
|
+
this.stoppedResolve();
|
|
102
|
+
this.stoppedResolve = null;
|
|
103
|
+
this.emit('stopped', this);
|
|
104
|
+
this.state = 'stopped';
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
onAnimating(target, { id }) {
|
|
108
|
+
if (id === this.id) {
|
|
109
|
+
this.emit('animating', this);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
83
112
|
}
|
|
84
113
|
//# sourceMappingURL=ThreadXMainAnimationController.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadXMainAnimationController.js","sourceRoot":"","sources":["../../../../src/render-drivers/threadx/ThreadXMainAnimationController.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"ThreadXMainAnimationController.js","sourceRoot":"","sources":["../../../../src/render-drivers/threadx/ThreadXMainAnimationController.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,sDAAsD;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAK5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,OAAO,8BACX,SAAQ,YAAY;IAUA;IAA+B;IAPnD,cAAc,CAAgB;IAC9B;;OAEG;IACH,cAAc,GAAwB,IAAI,CAAC;IAC3C,KAAK,CAA2B;IAEhC,YAAoB,IAAqB,EAAU,EAAU;QAC3D,KAAK,EAAE,CAAC;QADU,SAAI,GAAJ,IAAI,CAAiB;QAAU,OAAE,GAAF,EAAE,CAAQ;QAE3D,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QAEvB,uEAAuE;QACvE,IAAI,CAAC,cAAc,G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W,CAAC,MAAuB,EAAE,EAAE,EAAE,EAAkB;QACjE,IAAI,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;SAC9B;IACH,CAAC;CACF"}
|
|
@@ -52,6 +52,12 @@ export class ThreadXRendererNode extends SharedNode {
|
|
|
52
52
|
// TOOD: Make sure event listeners are removed when the node is destroyed.
|
|
53
53
|
this.on('createAnimation', (target, { id, props, settings }) => {
|
|
54
54
|
const animation = new CoreAnimation(this.coreNode, props, settings);
|
|
55
|
+
animation.on('animating', () => {
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
57
|
+
this.emit('animationAnimating', {
|
|
58
|
+
id: id,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
55
61
|
animation.on('finished', () => {
|
|
56
62
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
57
63
|
this.emit('animationFinished', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadXRendererNode.js","sourceRoot":"","sources":["../../../../../src/render-drivers/threadx/worker/ThreadXRendererNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAE9F,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AASrD,MAAM,OAAO,mBAAoB,SAAQ,UAAU;IASvC;IARA,QAAQ,CAAW;IACnB,OAAO,GAA+B,IAAI,CAAC;IAC3C,SAAS,GAA0B,EAAE,CAAC;IAChD,OAAO,GAA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AC3C,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,IAAI;YACjB,OAAO,EAAE,IAAI;YACb,cAAc,EAAE,IAAI;YAEpB,yBAAyB;YACzB,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"ThreadXRendererNode.js","sourceRoot":"","sources":["../../../../../src/render-drivers/threadx/worker/ThreadXRendererNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAE9F,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AASrD,MAAM,OAAO,mBAAoB,SAAQ,UAAU;IASvC;IARA,QAAQ,CAAW;IACnB,OAAO,GAA+B,IAAI,CAAC;IAC3C,SAAS,GAA0B,EAAE,CAAC;IAChD,OAAO,GAAmB,IAAI,CAAC;IAEvB,oBAAoB,GAAG,IAAI,GAAG,EAAgC,CAAC;IAEvE,YACU,KAAY,EACpB,gBAA4B,EAC5B,QAAmB,EACnB,gBAA0C;QAE1C,KAAK,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;QALlC,UAAK,GAAL,KAAK,CAAO;QAMpB,qEAAqE;QACrE,+CAA+C;QAC/C,iDAAiD;QACjD,IAAI,CAAC,QAAQ,GAAG,IAAI,KAAK,CACvB,QAAQ,IAAI,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,gBAAgB,CAAC,EACxD;YACE,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;gB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