@playcanvas/web-components 0.19.0 → 0.21.0
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/app.d.cts +5 -99
- package/dist/app.d.ts +5 -99
- package/dist/asset-binding.d.cts +1 -0
- package/dist/asset-binding.d.ts +1 -0
- package/dist/components/anim-clip.d.cts +8 -10
- package/dist/components/anim-clip.d.ts +8 -10
- package/dist/components/anim-component.d.cts +5 -4
- package/dist/components/anim-component.d.ts +5 -4
- package/dist/components/audio-listener-component.d.cts +5 -4
- package/dist/components/audio-listener-component.d.ts +5 -4
- package/dist/components/button-component.d.cts +14 -9
- package/dist/components/button-component.d.ts +14 -9
- package/dist/components/camera-component.d.cts +5 -4
- package/dist/components/camera-component.d.ts +5 -4
- package/dist/components/collision-component.d.cts +5 -4
- package/dist/components/collision-component.d.ts +5 -4
- package/dist/components/component.d.cts +2 -2
- package/dist/components/component.d.ts +2 -2
- package/dist/components/element-component.d.cts +5 -4
- package/dist/components/element-component.d.ts +5 -4
- package/dist/components/gsplat-component.d.cts +5 -4
- package/dist/components/gsplat-component.d.ts +5 -4
- package/dist/components/joint-component.d.cts +29 -14
- package/dist/components/joint-component.d.ts +29 -14
- package/dist/components/layout-child-component.d.cts +5 -4
- package/dist/components/layout-child-component.d.ts +5 -4
- package/dist/components/layout-group-component.d.cts +5 -4
- package/dist/components/layout-group-component.d.ts +5 -4
- package/dist/components/light-component.d.cts +5 -4
- package/dist/components/light-component.d.ts +5 -4
- package/dist/components/particle-system-component.d.cts +22 -5
- package/dist/components/particle-system-component.d.ts +22 -5
- package/dist/components/render-component.d.cts +5 -4
- package/dist/components/render-component.d.ts +5 -4
- package/dist/components/rigid-body-component.d.cts +5 -4
- package/dist/components/rigid-body-component.d.ts +5 -4
- package/dist/components/screen-component.d.cts +5 -4
- package/dist/components/screen-component.d.ts +5 -4
- package/dist/components/script-component.d.cts +9 -6
- package/dist/components/script-component.d.ts +9 -6
- package/dist/components/script-instance.d.cts +14 -6
- package/dist/components/script-instance.d.ts +14 -6
- package/dist/components/scroll-view-component.d.cts +29 -16
- package/dist/components/scroll-view-component.d.ts +29 -16
- package/dist/components/scrollbar-component.d.cts +11 -7
- package/dist/components/scrollbar-component.d.ts +11 -7
- package/dist/components/sound-component.d.cts +5 -4
- package/dist/components/sound-component.d.ts +5 -4
- package/dist/custom-elements.json +59 -59
- package/dist/entity-reference.d.cts +13 -0
- package/dist/entity-reference.d.ts +13 -0
- package/dist/material.d.cts +8 -6
- package/dist/material.d.ts +8 -6
- package/dist/model.d.cts +8 -9
- package/dist/model.d.ts +8 -9
- package/dist/parse.d.cts +0 -3
- package/dist/parse.d.ts +0 -3
- package/dist/pointer-controller.d.cts +1 -0
- package/dist/pointer-controller.d.ts +1 -0
- package/dist/pwc.cjs +1085 -633
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +1085 -633
- package/dist/pwc.js.map +1 -1
- package/dist/pwc.min.js +1 -1
- package/dist/pwc.min.js.map +1 -1
- package/dist/pwc.min.mjs +1 -1
- package/dist/pwc.min.mjs.map +1 -1
- package/dist/pwc.mjs +1086 -634
- package/dist/pwc.mjs.map +1 -1
- package/dist/sky.d.cts +6 -7
- package/dist/sky.d.ts +6 -7
- package/dist/vscode.html-custom-data.json +10 -10
- package/dist/web-types.json +58 -58
- package/package.json +3 -3
- package/src/app.ts +16 -416
- package/src/asset-binding.ts +141 -0
- package/src/components/anim-clip.ts +22 -45
- package/src/components/anim-component.ts +10 -6
- package/src/components/audio-listener-component.ts +6 -5
- package/src/components/button-component.ts +25 -15
- package/src/components/camera-component.ts +6 -5
- package/src/components/collision-component.ts +6 -5
- package/src/components/component.ts +6 -4
- package/src/components/element-component.ts +6 -5
- package/src/components/gsplat-component.ts +6 -5
- package/src/components/joint-component.ts +36 -20
- package/src/components/layout-child-component.ts +6 -5
- package/src/components/layout-group-component.ts +6 -5
- package/src/components/light-component.ts +6 -5
- package/src/components/particle-system-component.ts +56 -30
- package/src/components/render-component.ts +6 -5
- package/src/components/rigid-body-component.ts +6 -5
- package/src/components/screen-component.ts +6 -5
- package/src/components/script-component.ts +28 -17
- package/src/components/script-instance.ts +14 -6
- package/src/components/scroll-view-component.ts +56 -34
- package/src/components/scrollbar-component.ts +20 -13
- package/src/components/sound-component.ts +6 -5
- package/src/entity-reference.ts +237 -0
- package/src/material.ts +25 -29
- package/src/model.ts +24 -48
- package/src/parse.ts +0 -35
- package/src/pointer-controller.ts +550 -0
- package/src/sky.ts +19 -30
package/dist/app.d.cts
CHANGED
|
@@ -62,25 +62,13 @@ declare class AppElement extends AsyncElement {
|
|
|
62
62
|
* engine scene nodes back to their owning elements by identity - never by name.
|
|
63
63
|
*/
|
|
64
64
|
private _entityElements;
|
|
65
|
-
private _picker;
|
|
66
|
-
private _hoveredEntity;
|
|
67
|
-
private _pickToken;
|
|
68
|
-
private _pointerHandlers;
|
|
69
65
|
/**
|
|
70
|
-
* The
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* which is also what keeps those two canvas listeners attached.
|
|
66
|
+
* The pointer-input subsystem: the picker, the canvas handlers, and the synthesized-event
|
|
67
|
+
* dispatch. The element drives its lifecycle (connect on boot, resize with the drawing
|
|
68
|
+
* buffer, listener syncs, disconnect on teardown) and hands it the two lookups it needs -
|
|
69
|
+
* everything else about pointer input lives in the controller.
|
|
75
70
|
*/
|
|
76
|
-
private
|
|
77
|
-
/** Whether any element in the tree listens for click. Maintained by _syncCanvasListeners. */
|
|
78
|
-
private _clickListened;
|
|
79
|
-
/**
|
|
80
|
-
* The previous click's target, time and count, for chaining successive clicks into the
|
|
81
|
-
* click count that `detail` carries. `null` until a click has fired.
|
|
82
|
-
*/
|
|
83
|
-
private _lastClick;
|
|
71
|
+
private _pointer;
|
|
84
72
|
private _app;
|
|
85
73
|
private _loadProgress;
|
|
86
74
|
/**
|
|
@@ -118,8 +106,6 @@ declare class AppElement extends AsyncElement {
|
|
|
118
106
|
* an XR session presents - the session owns the buffer size.
|
|
119
107
|
*/
|
|
120
108
|
private _syncCanvasSize;
|
|
121
|
-
private _pickerCreate;
|
|
122
|
-
private _pickerDestroy;
|
|
123
109
|
/**
|
|
124
110
|
* Returns the `<pc-entity>`, `<pc-model>` or `<pc-node>` element whose backing entity is
|
|
125
111
|
* `entity`, or `null` if the entity is not fronted by an element of this application - for
|
|
@@ -130,86 +116,6 @@ declare class AppElement extends AsyncElement {
|
|
|
130
116
|
* @returns The element fronting the entity, or `null`.
|
|
131
117
|
*/
|
|
132
118
|
elementFromEntity(entity: Entity): EntityBaseElement | null;
|
|
133
|
-
/**
|
|
134
|
-
* Resolves the element that owns hover for a picked node: the nearest node up the parent
|
|
135
|
-
* chain - starting with the node itself - whose element listens for any of the hover event
|
|
136
|
-
* types. Skipping silent elements matches {@link _elementWithListener}, so a registered
|
|
137
|
-
* element with no hover listeners (a `<pc-model>` host, a plain child entity) is transparent
|
|
138
|
-
* to hover rather than swallowing a listening ancestor's enter/leave pair.
|
|
139
|
-
*
|
|
140
|
-
* @param node - The picked node, or `null`.
|
|
141
|
-
* @returns The hover-owning element, or `null`.
|
|
142
|
-
*/
|
|
143
|
-
private _hoverTarget;
|
|
144
|
-
/**
|
|
145
|
-
* Like {@link _elementFromNode}, but skips elements without a listener for `type`, so a hit
|
|
146
|
-
* on an unlistened child still reaches a listening ancestor.
|
|
147
|
-
*
|
|
148
|
-
* @param node - The picked node, or `null`.
|
|
149
|
-
* @param type - The pointer event type a listener is required for.
|
|
150
|
-
* @returns The nearest listening element, or `null`.
|
|
151
|
-
*/
|
|
152
|
-
private _elementWithListener;
|
|
153
|
-
/**
|
|
154
|
-
* Converts a pointer event's client coordinates into drawing-buffer coordinates - the space
|
|
155
|
-
* the pick buffer and the camera viewports are laid out in. When the canvas has no CSS box
|
|
156
|
-
* to map through (jsdom; a hidden canvas receives no pointer events in a browser), the
|
|
157
|
-
* client coordinates are passed through unmapped and `mapped` is false, so callers know the
|
|
158
|
-
* coordinates correspond to no real geometry.
|
|
159
|
-
*
|
|
160
|
-
* @param event - The pointer event to convert.
|
|
161
|
-
* @param canvas - The canvas the event was dispatched on.
|
|
162
|
-
* @returns The buffer-space coordinates, and whether they were actually mapped.
|
|
163
|
-
*/
|
|
164
|
-
private _getPickerCoordinates;
|
|
165
|
-
/**
|
|
166
|
-
* Whether a camera's viewport contains the point. A camera renders into its normalized
|
|
167
|
-
* `rect`, whose origin is the bottom-left of the canvas while buffer coordinates run from
|
|
168
|
-
* the top-left - so the vertical test flips, as the engine's ElementInput flips it for UI
|
|
169
|
-
* input. The right and bottom edges are exclusive: a viewport rasterizes the half-open
|
|
170
|
-
* pixel range [left, right) x [top, bottom), so a coordinate on a shared edge belongs to
|
|
171
|
-
* the viewport whose first pixel it is - never to the one it just left, whose pick buffer
|
|
172
|
-
* holds nothing there.
|
|
173
|
-
*
|
|
174
|
-
* @param camera - The camera to test.
|
|
175
|
-
* @param x - The x coordinate, in buffer space.
|
|
176
|
-
* @param y - The y coordinate, in buffer space.
|
|
177
|
-
* @param canvas - The canvas the coordinates are relative to.
|
|
178
|
-
* @returns Whether the camera's viewport contains the point.
|
|
179
|
-
*/
|
|
180
|
-
private _cameraContains;
|
|
181
|
-
/**
|
|
182
|
-
* Picks the scene under the pointer and returns the graph node that was hit, or `null`.
|
|
183
|
-
*
|
|
184
|
-
* The camera is resolved the way the engine's ElementInput resolves it for UI input:
|
|
185
|
-
* enabled cameras are tried topmost-first (they render in ascending `priority` order),
|
|
186
|
-
* skipping cameras that render to a texture and cameras whose viewport `rect` does not
|
|
187
|
-
* contain the pointer. A camera that picks nothing ends the search if it clears the color
|
|
188
|
-
* buffer - its background visually owns the pixel - and otherwise cedes to the cameras
|
|
189
|
-
* beneath it, so an overlay camera only intercepts picks where it actually drew something.
|
|
190
|
-
* The pick buffer is prepared per camera, so each camera picks from its own layers.
|
|
191
|
-
*
|
|
192
|
-
* The read back is asynchronous because the synchronous {@link Picker.getSelection} is not
|
|
193
|
-
* supported on WebGPU, where it returns an empty selection rather than failing - which
|
|
194
|
-
* silently disabled every `onpointer*` handler once WebGPU became the resolved backend. The
|
|
195
|
-
* async variant works on both backends and does not block the main thread on a GPU read.
|
|
196
|
-
*
|
|
197
|
-
* @param event - The pointer event to pick under.
|
|
198
|
-
* @returns The graph node under the pointer, or `null` if nothing was hit.
|
|
199
|
-
*/
|
|
200
|
-
private _pickNode;
|
|
201
|
-
private _onPointerMove;
|
|
202
|
-
private _onPointerDown;
|
|
203
|
-
private _onPointerUp;
|
|
204
|
-
/**
|
|
205
|
-
* Attaches exactly the canvas listeners the tree's current element listeners need, and
|
|
206
|
-
* detaches the rest. Recomputed whenever a listener connects or disconnects anywhere under
|
|
207
|
-
* this element: several synthesized types can need the same canvas listener (enter, leave
|
|
208
|
-
* and move all ride the move pick; click rides the down/up pair), so one type's removal
|
|
209
|
-
* must not detach a listener another type still uses. Re-attaching an attached listener is
|
|
210
|
-
* a no-op by EventTarget semantics, so no attach state is kept.
|
|
211
|
-
*/
|
|
212
|
-
private _syncCanvasListeners;
|
|
213
119
|
/**
|
|
214
120
|
* Warns that a graphics option was written too late to have any effect. These options are read
|
|
215
121
|
* once, when the element connects and creates its graphics device, so a later write updates
|
package/dist/app.d.ts
CHANGED
|
@@ -62,25 +62,13 @@ declare class AppElement extends AsyncElement {
|
|
|
62
62
|
* engine scene nodes back to their owning elements by identity - never by name.
|
|
63
63
|
*/
|
|
64
64
|
private _entityElements;
|
|
65
|
-
private _picker;
|
|
66
|
-
private _hoveredEntity;
|
|
67
|
-
private _pickToken;
|
|
68
|
-
private _pointerHandlers;
|
|
69
65
|
/**
|
|
70
|
-
* The
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* which is also what keeps those two canvas listeners attached.
|
|
66
|
+
* The pointer-input subsystem: the picker, the canvas handlers, and the synthesized-event
|
|
67
|
+
* dispatch. The element drives its lifecycle (connect on boot, resize with the drawing
|
|
68
|
+
* buffer, listener syncs, disconnect on teardown) and hands it the two lookups it needs -
|
|
69
|
+
* everything else about pointer input lives in the controller.
|
|
75
70
|
*/
|
|
76
|
-
private
|
|
77
|
-
/** Whether any element in the tree listens for click. Maintained by _syncCanvasListeners. */
|
|
78
|
-
private _clickListened;
|
|
79
|
-
/**
|
|
80
|
-
* The previous click's target, time and count, for chaining successive clicks into the
|
|
81
|
-
* click count that `detail` carries. `null` until a click has fired.
|
|
82
|
-
*/
|
|
83
|
-
private _lastClick;
|
|
71
|
+
private _pointer;
|
|
84
72
|
private _app;
|
|
85
73
|
private _loadProgress;
|
|
86
74
|
/**
|
|
@@ -118,8 +106,6 @@ declare class AppElement extends AsyncElement {
|
|
|
118
106
|
* an XR session presents - the session owns the buffer size.
|
|
119
107
|
*/
|
|
120
108
|
private _syncCanvasSize;
|
|
121
|
-
private _pickerCreate;
|
|
122
|
-
private _pickerDestroy;
|
|
123
109
|
/**
|
|
124
110
|
* Returns the `<pc-entity>`, `<pc-model>` or `<pc-node>` element whose backing entity is
|
|
125
111
|
* `entity`, or `null` if the entity is not fronted by an element of this application - for
|
|
@@ -130,86 +116,6 @@ declare class AppElement extends AsyncElement {
|
|
|
130
116
|
* @returns The element fronting the entity, or `null`.
|
|
131
117
|
*/
|
|
132
118
|
elementFromEntity(entity: Entity): EntityBaseElement | null;
|
|
133
|
-
/**
|
|
134
|
-
* Resolves the element that owns hover for a picked node: the nearest node up the parent
|
|
135
|
-
* chain - starting with the node itself - whose element listens for any of the hover event
|
|
136
|
-
* types. Skipping silent elements matches {@link _elementWithListener}, so a registered
|
|
137
|
-
* element with no hover listeners (a `<pc-model>` host, a plain child entity) is transparent
|
|
138
|
-
* to hover rather than swallowing a listening ancestor's enter/leave pair.
|
|
139
|
-
*
|
|
140
|
-
* @param node - The picked node, or `null`.
|
|
141
|
-
* @returns The hover-owning element, or `null`.
|
|
142
|
-
*/
|
|
143
|
-
private _hoverTarget;
|
|
144
|
-
/**
|
|
145
|
-
* Like {@link _elementFromNode}, but skips elements without a listener for `type`, so a hit
|
|
146
|
-
* on an unlistened child still reaches a listening ancestor.
|
|
147
|
-
*
|
|
148
|
-
* @param node - The picked node, or `null`.
|
|
149
|
-
* @param type - The pointer event type a listener is required for.
|
|
150
|
-
* @returns The nearest listening element, or `null`.
|
|
151
|
-
*/
|
|
152
|
-
private _elementWithListener;
|
|
153
|
-
/**
|
|
154
|
-
* Converts a pointer event's client coordinates into drawing-buffer coordinates - the space
|
|
155
|
-
* the pick buffer and the camera viewports are laid out in. When the canvas has no CSS box
|
|
156
|
-
* to map through (jsdom; a hidden canvas receives no pointer events in a browser), the
|
|
157
|
-
* client coordinates are passed through unmapped and `mapped` is false, so callers know the
|
|
158
|
-
* coordinates correspond to no real geometry.
|
|
159
|
-
*
|
|
160
|
-
* @param event - The pointer event to convert.
|
|
161
|
-
* @param canvas - The canvas the event was dispatched on.
|
|
162
|
-
* @returns The buffer-space coordinates, and whether they were actually mapped.
|
|
163
|
-
*/
|
|
164
|
-
private _getPickerCoordinates;
|
|
165
|
-
/**
|
|
166
|
-
* Whether a camera's viewport contains the point. A camera renders into its normalized
|
|
167
|
-
* `rect`, whose origin is the bottom-left of the canvas while buffer coordinates run from
|
|
168
|
-
* the top-left - so the vertical test flips, as the engine's ElementInput flips it for UI
|
|
169
|
-
* input. The right and bottom edges are exclusive: a viewport rasterizes the half-open
|
|
170
|
-
* pixel range [left, right) x [top, bottom), so a coordinate on a shared edge belongs to
|
|
171
|
-
* the viewport whose first pixel it is - never to the one it just left, whose pick buffer
|
|
172
|
-
* holds nothing there.
|
|
173
|
-
*
|
|
174
|
-
* @param camera - The camera to test.
|
|
175
|
-
* @param x - The x coordinate, in buffer space.
|
|
176
|
-
* @param y - The y coordinate, in buffer space.
|
|
177
|
-
* @param canvas - The canvas the coordinates are relative to.
|
|
178
|
-
* @returns Whether the camera's viewport contains the point.
|
|
179
|
-
*/
|
|
180
|
-
private _cameraContains;
|
|
181
|
-
/**
|
|
182
|
-
* Picks the scene under the pointer and returns the graph node that was hit, or `null`.
|
|
183
|
-
*
|
|
184
|
-
* The camera is resolved the way the engine's ElementInput resolves it for UI input:
|
|
185
|
-
* enabled cameras are tried topmost-first (they render in ascending `priority` order),
|
|
186
|
-
* skipping cameras that render to a texture and cameras whose viewport `rect` does not
|
|
187
|
-
* contain the pointer. A camera that picks nothing ends the search if it clears the color
|
|
188
|
-
* buffer - its background visually owns the pixel - and otherwise cedes to the cameras
|
|
189
|
-
* beneath it, so an overlay camera only intercepts picks where it actually drew something.
|
|
190
|
-
* The pick buffer is prepared per camera, so each camera picks from its own layers.
|
|
191
|
-
*
|
|
192
|
-
* The read back is asynchronous because the synchronous {@link Picker.getSelection} is not
|
|
193
|
-
* supported on WebGPU, where it returns an empty selection rather than failing - which
|
|
194
|
-
* silently disabled every `onpointer*` handler once WebGPU became the resolved backend. The
|
|
195
|
-
* async variant works on both backends and does not block the main thread on a GPU read.
|
|
196
|
-
*
|
|
197
|
-
* @param event - The pointer event to pick under.
|
|
198
|
-
* @returns The graph node under the pointer, or `null` if nothing was hit.
|
|
199
|
-
*/
|
|
200
|
-
private _pickNode;
|
|
201
|
-
private _onPointerMove;
|
|
202
|
-
private _onPointerDown;
|
|
203
|
-
private _onPointerUp;
|
|
204
|
-
/**
|
|
205
|
-
* Attaches exactly the canvas listeners the tree's current element listeners need, and
|
|
206
|
-
* detaches the rest. Recomputed whenever a listener connects or disconnects anywhere under
|
|
207
|
-
* this element: several synthesized types can need the same canvas listener (enter, leave
|
|
208
|
-
* and move all ride the move pick; click rides the down/up pair), so one type's removal
|
|
209
|
-
* must not detach a listener another type still uses. Re-attaching an attached listener is
|
|
210
|
-
* a no-op by EventTarget semantics, so no attach state is kept.
|
|
211
|
-
*/
|
|
212
|
-
private _syncCanvasListeners;
|
|
213
119
|
/**
|
|
214
120
|
* Warns that a graphics option was written too late to have any effect. These options are read
|
|
215
121
|
* once, when the element connects and creates its graphics device, so a later write updates
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -28,6 +28,11 @@ declare class AnimClipElement extends AsyncElement {
|
|
|
28
28
|
*/
|
|
29
29
|
private _animElement;
|
|
30
30
|
private _asset;
|
|
31
|
+
/**
|
|
32
|
+
* Watches the current source asset while it loads. Starting a new resolution or
|
|
33
|
+
* disconnecting cancels it, so a superseded source can never hand its track to the parent.
|
|
34
|
+
*/
|
|
35
|
+
private _binding;
|
|
31
36
|
/**
|
|
32
37
|
* Incremented on every connect and disconnect, and captured by connectedCallback on entry —
|
|
33
38
|
* a resume from an await abandons itself if the value has moved on, so a stale callback can
|
|
@@ -35,19 +40,13 @@ declare class AnimClipElement extends AsyncElement {
|
|
|
35
40
|
* own callback.
|
|
36
41
|
*/
|
|
37
42
|
private _connectionGeneration;
|
|
38
|
-
private _errorHandle;
|
|
39
43
|
/**
|
|
40
44
|
* Incremented on every track resolution and on disconnect, and captured by a resolution when
|
|
41
|
-
* it starts. A resolution that resumes from an await
|
|
42
|
-
*
|
|
45
|
+
* it starts. A resolution that resumes from an await abandons itself if the value has moved
|
|
46
|
+
* on, so a superseded resolution cannot hand a stale track to the parent. The asset
|
|
47
|
+
* subscription itself is guarded by the binding above.
|
|
43
48
|
*/
|
|
44
49
|
private _loadGeneration;
|
|
45
|
-
/**
|
|
46
|
-
* The pending asset subscriptions of the current resolution, if it is waiting for its asset.
|
|
47
|
-
* Held so that whatever supersedes the resolution can detach the handlers from the asset,
|
|
48
|
-
* rather than leave them registered until the asset settles (or forever, if it never does).
|
|
49
|
-
*/
|
|
50
|
-
private _loadHandle;
|
|
51
50
|
private _loop;
|
|
52
51
|
private _name;
|
|
53
52
|
private _speed;
|
|
@@ -64,7 +63,6 @@ declare class AnimClipElement extends AsyncElement {
|
|
|
64
63
|
connectedCallback(): Promise<void>;
|
|
65
64
|
disconnectedCallback(): void;
|
|
66
65
|
protected get animElement(): AnimComponentElement | null;
|
|
67
|
-
private _detachLoadHandlers;
|
|
68
66
|
/**
|
|
69
67
|
* Complains about the clip's source, once per source value — resolutions re-run on host
|
|
70
68
|
* cycles and model reloads, and must not repeat the complaint.
|
|
@@ -28,6 +28,11 @@ declare class AnimClipElement extends AsyncElement {
|
|
|
28
28
|
*/
|
|
29
29
|
private _animElement;
|
|
30
30
|
private _asset;
|
|
31
|
+
/**
|
|
32
|
+
* Watches the current source asset while it loads. Starting a new resolution or
|
|
33
|
+
* disconnecting cancels it, so a superseded source can never hand its track to the parent.
|
|
34
|
+
*/
|
|
35
|
+
private _binding;
|
|
31
36
|
/**
|
|
32
37
|
* Incremented on every connect and disconnect, and captured by connectedCallback on entry —
|
|
33
38
|
* a resume from an await abandons itself if the value has moved on, so a stale callback can
|
|
@@ -35,19 +40,13 @@ declare class AnimClipElement extends AsyncElement {
|
|
|
35
40
|
* own callback.
|
|
36
41
|
*/
|
|
37
42
|
private _connectionGeneration;
|
|
38
|
-
private _errorHandle;
|
|
39
43
|
/**
|
|
40
44
|
* Incremented on every track resolution and on disconnect, and captured by a resolution when
|
|
41
|
-
* it starts. A resolution that resumes from an await
|
|
42
|
-
*
|
|
45
|
+
* it starts. A resolution that resumes from an await abandons itself if the value has moved
|
|
46
|
+
* on, so a superseded resolution cannot hand a stale track to the parent. The asset
|
|
47
|
+
* subscription itself is guarded by the binding above.
|
|
43
48
|
*/
|
|
44
49
|
private _loadGeneration;
|
|
45
|
-
/**
|
|
46
|
-
* The pending asset subscriptions of the current resolution, if it is waiting for its asset.
|
|
47
|
-
* Held so that whatever supersedes the resolution can detach the handlers from the asset,
|
|
48
|
-
* rather than leave them registered until the asset settles (or forever, if it never does).
|
|
49
|
-
*/
|
|
50
|
-
private _loadHandle;
|
|
51
50
|
private _loop;
|
|
52
51
|
private _name;
|
|
53
52
|
private _speed;
|
|
@@ -64,7 +63,6 @@ declare class AnimClipElement extends AsyncElement {
|
|
|
64
63
|
connectedCallback(): Promise<void>;
|
|
65
64
|
disconnectedCallback(): void;
|
|
66
65
|
protected get animElement(): AnimComponentElement | null;
|
|
67
|
-
private _detachLoadHandlers;
|
|
68
66
|
/**
|
|
69
67
|
* Complains about the clip's source, once per source value — resolutions re-run on host
|
|
70
68
|
* cycles and model reloads, and must not repeat the complaint.
|
|
@@ -34,7 +34,7 @@ type ContainerWithAnimations = ContainerResource & {
|
|
|
34
34
|
*
|
|
35
35
|
* @category Components
|
|
36
36
|
*/
|
|
37
|
-
declare class AnimComponentElement extends ComponentElement {
|
|
37
|
+
declare class AnimComponentElement extends ComponentElement<AnimComponent> {
|
|
38
38
|
/**
|
|
39
39
|
* Whether playback starts automatically once a clip is assigned.
|
|
40
40
|
*/
|
|
@@ -179,10 +179,11 @@ declare class AnimComponentElement extends ComponentElement {
|
|
|
179
179
|
*/
|
|
180
180
|
transition(name: string, time?: number): void;
|
|
181
181
|
/**
|
|
182
|
-
* Gets the underlying PlayCanvas anim component.
|
|
183
|
-
*
|
|
182
|
+
* Gets the underlying PlayCanvas anim component. `null` until the element is
|
|
183
|
+
* ready — see {@link ComponentElement.component}.
|
|
184
|
+
* @returns The anim component, or `null`.
|
|
184
185
|
*/
|
|
185
|
-
get component(): AnimComponent;
|
|
186
|
+
get component(): AnimComponent | null;
|
|
186
187
|
/**
|
|
187
188
|
* Gets the names of the assigned clips.
|
|
188
189
|
* @returns The clip names, in assignment order.
|
|
@@ -34,7 +34,7 @@ type ContainerWithAnimations = ContainerResource & {
|
|
|
34
34
|
*
|
|
35
35
|
* @category Components
|
|
36
36
|
*/
|
|
37
|
-
declare class AnimComponentElement extends ComponentElement {
|
|
37
|
+
declare class AnimComponentElement extends ComponentElement<AnimComponent> {
|
|
38
38
|
/**
|
|
39
39
|
* Whether playback starts automatically once a clip is assigned.
|
|
40
40
|
*/
|
|
@@ -179,10 +179,11 @@ declare class AnimComponentElement extends ComponentElement {
|
|
|
179
179
|
*/
|
|
180
180
|
transition(name: string, time?: number): void;
|
|
181
181
|
/**
|
|
182
|
-
* Gets the underlying PlayCanvas anim component.
|
|
183
|
-
*
|
|
182
|
+
* Gets the underlying PlayCanvas anim component. `null` until the element is
|
|
183
|
+
* ready — see {@link ComponentElement.component}.
|
|
184
|
+
* @returns The anim component, or `null`.
|
|
184
185
|
*/
|
|
185
|
-
get component(): AnimComponent;
|
|
186
|
+
get component(): AnimComponent | null;
|
|
186
187
|
/**
|
|
187
188
|
* Gets the names of the assigned clips.
|
|
188
189
|
* @returns The clip names, in assignment order.
|
|
@@ -14,13 +14,14 @@ import { ComponentElement } from './component.cjs';
|
|
|
14
14
|
*
|
|
15
15
|
* @category Components
|
|
16
16
|
*/
|
|
17
|
-
declare class AudioListenerComponentElement extends ComponentElement {
|
|
17
|
+
declare class AudioListenerComponentElement extends ComponentElement<AudioListenerComponent> {
|
|
18
18
|
/** @ignore */
|
|
19
19
|
constructor();
|
|
20
20
|
/**
|
|
21
|
-
* Gets the underlying PlayCanvas audio listener component.
|
|
22
|
-
*
|
|
21
|
+
* Gets the underlying PlayCanvas audio listener component. `null` until the element is
|
|
22
|
+
* ready — see {@link ComponentElement.component}.
|
|
23
|
+
* @returns The audio listener component, or `null`.
|
|
23
24
|
*/
|
|
24
|
-
get component(): AudioListenerComponent;
|
|
25
|
+
get component(): AudioListenerComponent | null;
|
|
25
26
|
}
|
|
26
27
|
export { AudioListenerComponentElement };
|
|
@@ -14,13 +14,14 @@ import { ComponentElement } from './component.js';
|
|
|
14
14
|
*
|
|
15
15
|
* @category Components
|
|
16
16
|
*/
|
|
17
|
-
declare class AudioListenerComponentElement extends ComponentElement {
|
|
17
|
+
declare class AudioListenerComponentElement extends ComponentElement<AudioListenerComponent> {
|
|
18
18
|
/** @ignore */
|
|
19
19
|
constructor();
|
|
20
20
|
/**
|
|
21
|
-
* Gets the underlying PlayCanvas audio listener component.
|
|
22
|
-
*
|
|
21
|
+
* Gets the underlying PlayCanvas audio listener component. `null` until the element is
|
|
22
|
+
* ready — see {@link ComponentElement.component}.
|
|
23
|
+
* @returns The audio listener component, or `null`.
|
|
23
24
|
*/
|
|
24
|
-
get component(): AudioListenerComponent;
|
|
25
|
+
get component(): AudioListenerComponent | null;
|
|
25
26
|
}
|
|
26
27
|
export { AudioListenerComponentElement };
|
|
@@ -16,7 +16,7 @@ import { ComponentElement } from './component.cjs';
|
|
|
16
16
|
*
|
|
17
17
|
* @category Components
|
|
18
18
|
*/
|
|
19
|
-
declare class ButtonComponentElement extends ComponentElement {
|
|
19
|
+
declare class ButtonComponentElement extends ComponentElement<ButtonComponent> {
|
|
20
20
|
private _active;
|
|
21
21
|
private _image;
|
|
22
22
|
private _hitPadding;
|
|
@@ -35,10 +35,11 @@ declare class ButtonComponentElement extends ComponentElement {
|
|
|
35
35
|
constructor();
|
|
36
36
|
protected getInitialComponentData(): Record<string, any>;
|
|
37
37
|
/**
|
|
38
|
-
* Gets the underlying PlayCanvas button component.
|
|
39
|
-
*
|
|
38
|
+
* Gets the underlying PlayCanvas button component. `null` until the element is
|
|
39
|
+
* ready — see {@link ComponentElement.component}.
|
|
40
|
+
* @returns The button component, or `null`.
|
|
40
41
|
*/
|
|
41
|
-
get component(): ButtonComponent;
|
|
42
|
+
get component(): ButtonComponent | null;
|
|
42
43
|
/**
|
|
43
44
|
* Sets whether the button is active and responds to input.
|
|
44
45
|
* @param value - Whether the button is active.
|
|
@@ -50,15 +51,19 @@ declare class ButtonComponentElement extends ComponentElement {
|
|
|
50
51
|
*/
|
|
51
52
|
get active(): boolean;
|
|
52
53
|
/**
|
|
53
|
-
* Sets the reference (
|
|
54
|
-
* element is used for visual transitions.
|
|
55
|
-
*
|
|
56
|
-
*
|
|
54
|
+
* Sets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
|
|
55
|
+
* selector) to the entity whose image element is used for visual transitions. An exact name
|
|
56
|
+
* resolves against the nearest enclosing entity first, then outward, then the document.
|
|
57
|
+
* Defaults to the button's own entity — inside a `<pc-model>`, that is the model's host
|
|
58
|
+
* entity, so supply an explicit reference to target a UI entity instead. A non-empty
|
|
59
|
+
* reference that does not resolve warns and is ignored.
|
|
57
60
|
* @param value - The image entity reference.
|
|
58
61
|
*/
|
|
59
62
|
set image(value: string);
|
|
60
63
|
/**
|
|
61
|
-
* Gets the reference
|
|
64
|
+
* Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
|
|
65
|
+
* selector) to the entity whose image element is used for visual transitions, or empty for
|
|
66
|
+
* the button's own entity.
|
|
62
67
|
* @returns The image entity reference.
|
|
63
68
|
*/
|
|
64
69
|
get image(): string;
|
|
@@ -16,7 +16,7 @@ import { ComponentElement } from './component.js';
|
|
|
16
16
|
*
|
|
17
17
|
* @category Components
|
|
18
18
|
*/
|
|
19
|
-
declare class ButtonComponentElement extends ComponentElement {
|
|
19
|
+
declare class ButtonComponentElement extends ComponentElement<ButtonComponent> {
|
|
20
20
|
private _active;
|
|
21
21
|
private _image;
|
|
22
22
|
private _hitPadding;
|
|
@@ -35,10 +35,11 @@ declare class ButtonComponentElement extends ComponentElement {
|
|
|
35
35
|
constructor();
|
|
36
36
|
protected getInitialComponentData(): Record<string, any>;
|
|
37
37
|
/**
|
|
38
|
-
* Gets the underlying PlayCanvas button component.
|
|
39
|
-
*
|
|
38
|
+
* Gets the underlying PlayCanvas button component. `null` until the element is
|
|
39
|
+
* ready — see {@link ComponentElement.component}.
|
|
40
|
+
* @returns The button component, or `null`.
|
|
40
41
|
*/
|
|
41
|
-
get component(): ButtonComponent;
|
|
42
|
+
get component(): ButtonComponent | null;
|
|
42
43
|
/**
|
|
43
44
|
* Sets whether the button is active and responds to input.
|
|
44
45
|
* @param value - Whether the button is active.
|
|
@@ -50,15 +51,19 @@ declare class ButtonComponentElement extends ComponentElement {
|
|
|
50
51
|
*/
|
|
51
52
|
get active(): boolean;
|
|
52
53
|
/**
|
|
53
|
-
* Sets the reference (
|
|
54
|
-
* element is used for visual transitions.
|
|
55
|
-
*
|
|
56
|
-
*
|
|
54
|
+
* Sets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
|
|
55
|
+
* selector) to the entity whose image element is used for visual transitions. An exact name
|
|
56
|
+
* resolves against the nearest enclosing entity first, then outward, then the document.
|
|
57
|
+
* Defaults to the button's own entity — inside a `<pc-model>`, that is the model's host
|
|
58
|
+
* entity, so supply an explicit reference to target a UI entity instead. A non-empty
|
|
59
|
+
* reference that does not resolve warns and is ignored.
|
|
57
60
|
* @param value - The image entity reference.
|
|
58
61
|
*/
|
|
59
62
|
set image(value: string);
|
|
60
63
|
/**
|
|
61
|
-
* Gets the reference
|
|
64
|
+
* Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
|
|
65
|
+
* selector) to the entity whose image element is used for visual transitions, or empty for
|
|
66
|
+
* the button's own entity.
|
|
62
67
|
* @returns The image entity reference.
|
|
63
68
|
*/
|
|
64
69
|
get image(): string;
|
|
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.cjs';
|
|
|
15
15
|
*
|
|
16
16
|
* @category Components
|
|
17
17
|
*/
|
|
18
|
-
declare class CameraComponentElement extends ComponentElement {
|
|
18
|
+
declare class CameraComponentElement extends ComponentElement<CameraComponent> {
|
|
19
19
|
private _clearColor;
|
|
20
20
|
private _clearColorBuffer;
|
|
21
21
|
private _clearDepth;
|
|
@@ -88,10 +88,11 @@ declare class CameraComponentElement extends ComponentElement {
|
|
|
88
88
|
*/
|
|
89
89
|
endXr(): void;
|
|
90
90
|
/**
|
|
91
|
-
* Gets the underlying PlayCanvas camera component.
|
|
92
|
-
*
|
|
91
|
+
* Gets the underlying PlayCanvas camera component. `null` until the element is
|
|
92
|
+
* ready — see {@link ComponentElement.component}.
|
|
93
|
+
* @returns The camera component, or `null`.
|
|
93
94
|
*/
|
|
94
|
-
get component(): CameraComponent;
|
|
95
|
+
get component(): CameraComponent | null;
|
|
95
96
|
/**
|
|
96
97
|
* Sets the clear color of the camera.
|
|
97
98
|
* @param value - The clear color.
|
|
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.js';
|
|
|
15
15
|
*
|
|
16
16
|
* @category Components
|
|
17
17
|
*/
|
|
18
|
-
declare class CameraComponentElement extends ComponentElement {
|
|
18
|
+
declare class CameraComponentElement extends ComponentElement<CameraComponent> {
|
|
19
19
|
private _clearColor;
|
|
20
20
|
private _clearColorBuffer;
|
|
21
21
|
private _clearDepth;
|
|
@@ -88,10 +88,11 @@ declare class CameraComponentElement extends ComponentElement {
|
|
|
88
88
|
*/
|
|
89
89
|
endXr(): void;
|
|
90
90
|
/**
|
|
91
|
-
* Gets the underlying PlayCanvas camera component.
|
|
92
|
-
*
|
|
91
|
+
* Gets the underlying PlayCanvas camera component. `null` until the element is
|
|
92
|
+
* ready — see {@link ComponentElement.component}.
|
|
93
|
+
* @returns The camera component, or `null`.
|
|
93
94
|
*/
|
|
94
|
-
get component(): CameraComponent;
|
|
95
|
+
get component(): CameraComponent | null;
|
|
95
96
|
/**
|
|
96
97
|
* Sets the clear color of the camera.
|
|
97
98
|
* @param value - The clear color.
|
|
@@ -21,7 +21,7 @@ import { ComponentElement } from './component.cjs';
|
|
|
21
21
|
*
|
|
22
22
|
* @category Components
|
|
23
23
|
*/
|
|
24
|
-
declare class CollisionComponentElement extends ComponentElement {
|
|
24
|
+
declare class CollisionComponentElement extends ComponentElement<CollisionComponent> {
|
|
25
25
|
private _angularOffset;
|
|
26
26
|
private _axis;
|
|
27
27
|
private _convexHull;
|
|
@@ -55,10 +55,11 @@ declare class CollisionComponentElement extends ComponentElement {
|
|
|
55
55
|
*/
|
|
56
56
|
private _applyMeshGeometryDefault;
|
|
57
57
|
/**
|
|
58
|
-
* Gets the underlying PlayCanvas collision component.
|
|
59
|
-
*
|
|
58
|
+
* Gets the underlying PlayCanvas collision component. `null` until the element is
|
|
59
|
+
* ready — see {@link ComponentElement.component}.
|
|
60
|
+
* @returns The collision component, or `null`.
|
|
60
61
|
*/
|
|
61
|
-
get component(): CollisionComponent;
|
|
62
|
+
get component(): CollisionComponent | null;
|
|
62
63
|
set angularOffset(value: Quat);
|
|
63
64
|
get angularOffset(): Quat;
|
|
64
65
|
set axis(value: number);
|
|
@@ -21,7 +21,7 @@ import { ComponentElement } from './component.js';
|
|
|
21
21
|
*
|
|
22
22
|
* @category Components
|
|
23
23
|
*/
|
|
24
|
-
declare class CollisionComponentElement extends ComponentElement {
|
|
24
|
+
declare class CollisionComponentElement extends ComponentElement<CollisionComponent> {
|
|
25
25
|
private _angularOffset;
|
|
26
26
|
private _axis;
|
|
27
27
|
private _convexHull;
|
|
@@ -55,10 +55,11 @@ declare class CollisionComponentElement extends ComponentElement {
|
|
|
55
55
|
*/
|
|
56
56
|
private _applyMeshGeometryDefault;
|
|
57
57
|
/**
|
|
58
|
-
* Gets the underlying PlayCanvas collision component.
|
|
59
|
-
*
|
|
58
|
+
* Gets the underlying PlayCanvas collision component. `null` until the element is
|
|
59
|
+
* ready — see {@link ComponentElement.component}.
|
|
60
|
+
* @returns The collision component, or `null`.
|
|
60
61
|
*/
|
|
61
|
-
get component(): CollisionComponent;
|
|
62
|
+
get component(): CollisionComponent | null;
|
|
62
63
|
set angularOffset(value: Quat);
|
|
63
64
|
get angularOffset(): Quat;
|
|
64
65
|
set axis(value: number);
|