@playcanvas/web-components 0.16.0 → 0.17.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 +14 -13
- package/dist/app.d.ts +14 -13
- package/dist/async-element.d.cts +13 -13
- package/dist/async-element.d.ts +13 -13
- package/dist/components/anim-component.d.cts +33 -5
- package/dist/components/anim-component.d.ts +33 -5
- package/dist/components/{listener-component.d.cts → audio-listener-component.d.cts} +7 -5
- package/dist/components/{listener-component.d.ts → audio-listener-component.d.ts} +7 -5
- package/dist/components/button-component.d.cts +5 -1
- package/dist/components/button-component.d.ts +5 -1
- package/dist/components/camera-component.d.cts +2 -0
- package/dist/components/camera-component.d.ts +2 -0
- package/dist/components/collision-component.d.cts +5 -1
- package/dist/components/collision-component.d.ts +5 -1
- package/dist/components/component.d.cts +3 -2
- package/dist/components/component.d.ts +3 -2
- package/dist/components/element-component.d.cts +7 -0
- package/dist/components/element-component.d.ts +7 -0
- package/dist/components/gsplat-component.d.cts +2 -0
- package/dist/components/gsplat-component.d.ts +2 -0
- package/dist/components/joint-component.d.cts +2 -0
- package/dist/components/joint-component.d.ts +2 -0
- package/dist/components/{layoutchild-component.d.cts → layout-child-component.d.cts} +3 -1
- package/dist/components/{layoutchild-component.d.ts → layout-child-component.d.ts} +3 -1
- package/dist/components/{layoutgroup-component.d.cts → layout-group-component.d.cts} +3 -1
- package/dist/components/{layoutgroup-component.d.ts → layout-group-component.d.ts} +3 -1
- package/dist/components/light-component.d.cts +2 -0
- package/dist/components/light-component.d.ts +2 -0
- package/dist/components/{particlesystem-component.d.cts → particle-system-component.d.cts} +3 -1
- package/dist/components/{particlesystem-component.d.ts → particle-system-component.d.ts} +3 -1
- package/dist/components/render-component.d.cts +2 -0
- package/dist/components/render-component.d.ts +2 -0
- package/dist/components/{rigidbody-component.d.cts → rigid-body-component.d.cts} +3 -1
- package/dist/components/{rigidbody-component.d.ts → rigid-body-component.d.ts} +3 -1
- package/dist/components/screen-component.d.cts +2 -0
- package/dist/components/screen-component.d.ts +2 -0
- package/dist/components/script-component.d.cts +23 -12
- package/dist/components/script-component.d.ts +23 -12
- package/dist/components/{script.d.cts → script-instance.d.cts} +7 -7
- package/dist/components/{script.d.ts → script-instance.d.ts} +7 -7
- package/dist/components/{scrollview-component.d.cts → scroll-view-component.d.cts} +3 -1
- package/dist/components/{scrollview-component.d.ts → scroll-view-component.d.ts} +3 -1
- package/dist/components/scrollbar-component.d.cts +2 -0
- package/dist/components/scrollbar-component.d.ts +2 -0
- package/dist/components/sound-component.d.cts +3 -1
- package/dist/components/sound-component.d.ts +3 -1
- package/dist/components/sound-slot.d.cts +2 -2
- package/dist/components/sound-slot.d.ts +2 -2
- package/dist/custom-elements.json +1603 -986
- package/dist/entity-base.d.cts +6 -5
- package/dist/entity-base.d.ts +6 -5
- package/dist/entity-owner.d.cts +118 -0
- package/dist/entity-owner.d.ts +118 -0
- package/dist/entity.d.cts +8 -101
- package/dist/entity.d.ts +8 -101
- package/dist/index.d.cts +22 -21
- package/dist/index.d.ts +22 -21
- package/dist/model.d.cts +67 -24
- package/dist/model.d.ts +67 -24
- package/dist/pwc.cjs +526 -268
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +526 -268
- 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 +523 -266
- package/dist/pwc.mjs.map +1 -1
- package/dist/vscode.html-custom-data.json +145 -90
- package/dist/{module.d.cts → wasm.d.cts} +6 -6
- package/dist/{module.d.ts → wasm.d.ts} +6 -6
- package/dist/web-types.json +378 -250
- package/package.json +7 -7
- package/src/app.ts +45 -35
- package/src/async-element.ts +14 -14
- package/src/components/anim-component.ts +84 -14
- package/src/components/{listener-component.ts → audio-listener-component.ts} +8 -6
- package/src/components/button-component.ts +5 -1
- package/src/components/camera-component.ts +2 -0
- package/src/components/collision-component.ts +5 -1
- package/src/components/component.ts +4 -3
- package/src/components/element-component.ts +7 -0
- package/src/components/gsplat-component.ts +2 -0
- package/src/components/joint-component.ts +2 -0
- package/src/components/{layoutchild-component.ts → layout-child-component.ts} +4 -2
- package/src/components/{layoutgroup-component.ts → layout-group-component.ts} +4 -2
- package/src/components/light-component.ts +2 -0
- package/src/components/{particlesystem-component.ts → particle-system-component.ts} +4 -2
- package/src/components/render-component.ts +2 -0
- package/src/components/{rigidbody-component.ts → rigid-body-component.ts} +4 -2
- package/src/components/screen-component.ts +2 -0
- package/src/components/script-component.ts +63 -42
- package/src/components/{script.ts → script-instance.ts} +14 -14
- package/src/components/{scrollview-component.ts → scroll-view-component.ts} +4 -2
- package/src/components/scrollbar-component.ts +2 -0
- package/src/components/sound-component.ts +4 -2
- package/src/components/sound-slot.ts +4 -4
- package/src/entity-base.ts +6 -5
- package/src/entity-owner.ts +298 -0
- package/src/entity.ts +15 -270
- package/src/index.ts +26 -24
- package/src/model.ts +159 -72
- package/src/node.ts +9 -5
- package/src/{module.ts → wasm.ts} +8 -8
package/dist/app.d.cts
CHANGED
|
@@ -53,9 +53,9 @@ declare class AppElement extends AsyncElement {
|
|
|
53
53
|
private _bootGeneration;
|
|
54
54
|
/**
|
|
55
55
|
* The elements backing this application's entities, keyed by the entity itself. Registered
|
|
56
|
-
* by
|
|
57
|
-
*
|
|
58
|
-
* identity - never by name.
|
|
56
|
+
* by entity-owning elements at creation (pc-entity, and pc-model for its host) and by
|
|
57
|
+
* NodeElement at binding, and removed when an entity is destroyed or unbound, this joins
|
|
58
|
+
* engine scene nodes back to their owning elements by identity - never by name.
|
|
59
59
|
*/
|
|
60
60
|
private _entityElements;
|
|
61
61
|
private _picker;
|
|
@@ -103,25 +103,26 @@ declare class AppElement extends AsyncElement {
|
|
|
103
103
|
private _pickerCreate;
|
|
104
104
|
private _pickerDestroy;
|
|
105
105
|
/**
|
|
106
|
-
* Returns the `<pc-entity>` or `<pc-node>` element whose backing entity is
|
|
107
|
-
* `null` if the entity is not fronted by an element of this application - for
|
|
108
|
-
* unbound node inside a model's instantiated hierarchy, or an entity created
|
|
109
|
-
* engine API.
|
|
106
|
+
* Returns the `<pc-entity>`, `<pc-model>` or `<pc-node>` element whose backing entity is
|
|
107
|
+
* `entity`, or `null` if the entity is not fronted by an element of this application - for
|
|
108
|
+
* example, an unbound node inside a model's instantiated hierarchy, or an entity created
|
|
109
|
+
* through the engine API.
|
|
110
110
|
*
|
|
111
111
|
* @param entity - The entity to look up.
|
|
112
112
|
* @returns The element fronting the entity, or `null`.
|
|
113
113
|
*/
|
|
114
114
|
elementFromEntity(entity: Entity): EntityBaseElement | null;
|
|
115
115
|
/**
|
|
116
|
-
* Resolves the element that owns a picked node: the nearest node up the parent
|
|
117
|
-
* starting with the node itself -
|
|
118
|
-
*
|
|
119
|
-
*
|
|
116
|
+
* Resolves the element that owns hover for a picked node: the nearest node up the parent
|
|
117
|
+
* chain - starting with the node itself - whose element listens for any of the hover event
|
|
118
|
+
* types. Skipping silent elements matches {@link _elementWithListener}, so a registered
|
|
119
|
+
* element with no hover listeners (a `<pc-model>` host, a plain child entity) is transparent
|
|
120
|
+
* to hover rather than swallowing a listening ancestor's enter/leave pair.
|
|
120
121
|
*
|
|
121
122
|
* @param node - The picked node, or `null`.
|
|
122
|
-
* @returns The owning element, or `null`.
|
|
123
|
+
* @returns The hover-owning element, or `null`.
|
|
123
124
|
*/
|
|
124
|
-
private
|
|
125
|
+
private _hoverTarget;
|
|
125
126
|
/**
|
|
126
127
|
* Like {@link _elementFromNode}, but skips elements without a listener for `type`, so a hit
|
|
127
128
|
* on an unlistened child still reaches a listening ancestor.
|
package/dist/app.d.ts
CHANGED
|
@@ -53,9 +53,9 @@ declare class AppElement extends AsyncElement {
|
|
|
53
53
|
private _bootGeneration;
|
|
54
54
|
/**
|
|
55
55
|
* The elements backing this application's entities, keyed by the entity itself. Registered
|
|
56
|
-
* by
|
|
57
|
-
*
|
|
58
|
-
* identity - never by name.
|
|
56
|
+
* by entity-owning elements at creation (pc-entity, and pc-model for its host) and by
|
|
57
|
+
* NodeElement at binding, and removed when an entity is destroyed or unbound, this joins
|
|
58
|
+
* engine scene nodes back to their owning elements by identity - never by name.
|
|
59
59
|
*/
|
|
60
60
|
private _entityElements;
|
|
61
61
|
private _picker;
|
|
@@ -103,25 +103,26 @@ declare class AppElement extends AsyncElement {
|
|
|
103
103
|
private _pickerCreate;
|
|
104
104
|
private _pickerDestroy;
|
|
105
105
|
/**
|
|
106
|
-
* Returns the `<pc-entity>` or `<pc-node>` element whose backing entity is
|
|
107
|
-
* `null` if the entity is not fronted by an element of this application - for
|
|
108
|
-
* unbound node inside a model's instantiated hierarchy, or an entity created
|
|
109
|
-
* engine API.
|
|
106
|
+
* Returns the `<pc-entity>`, `<pc-model>` or `<pc-node>` element whose backing entity is
|
|
107
|
+
* `entity`, or `null` if the entity is not fronted by an element of this application - for
|
|
108
|
+
* example, an unbound node inside a model's instantiated hierarchy, or an entity created
|
|
109
|
+
* through the engine API.
|
|
110
110
|
*
|
|
111
111
|
* @param entity - The entity to look up.
|
|
112
112
|
* @returns The element fronting the entity, or `null`.
|
|
113
113
|
*/
|
|
114
114
|
elementFromEntity(entity: Entity): EntityBaseElement | null;
|
|
115
115
|
/**
|
|
116
|
-
* Resolves the element that owns a picked node: the nearest node up the parent
|
|
117
|
-
* starting with the node itself -
|
|
118
|
-
*
|
|
119
|
-
*
|
|
116
|
+
* Resolves the element that owns hover for a picked node: the nearest node up the parent
|
|
117
|
+
* chain - starting with the node itself - whose element listens for any of the hover event
|
|
118
|
+
* types. Skipping silent elements matches {@link _elementWithListener}, so a registered
|
|
119
|
+
* element with no hover listeners (a `<pc-model>` host, a plain child entity) is transparent
|
|
120
|
+
* to hover rather than swallowing a listening ancestor's enter/leave pair.
|
|
120
121
|
*
|
|
121
122
|
* @param node - The picked node, or `null`.
|
|
122
|
-
* @returns The owning element, or `null`.
|
|
123
|
+
* @returns The hover-owning element, or `null`.
|
|
123
124
|
*/
|
|
124
|
-
private
|
|
125
|
+
private _hoverTarget;
|
|
125
126
|
/**
|
|
126
127
|
* Like {@link _elementFromNode}, but skips elements without a listener for `type`, so a hit
|
|
127
128
|
* on an unlistened child still reaches a listening ancestor.
|
package/dist/async-element.d.cts
CHANGED
|
@@ -20,9 +20,9 @@ declare class AsyncElement extends HTMLElement {
|
|
|
20
20
|
*/
|
|
21
21
|
get closestApp(): AppElement | null;
|
|
22
22
|
/**
|
|
23
|
-
* The nearest ancestor element that fronts an entity — `<pc-entity
|
|
24
|
-
* `null` if this element has no such ancestor. The search starts at the
|
|
25
|
-
* never resolves to itself.
|
|
23
|
+
* The nearest ancestor element that fronts an entity — `<pc-entity>`, `<pc-model>` or
|
|
24
|
+
* `<pc-node>` — or `null` if this element has no such ancestor. The search starts at the
|
|
25
|
+
* parent, so an element never resolves to itself.
|
|
26
26
|
* @returns The closest entity-fronting element, or `null`.
|
|
27
27
|
*/
|
|
28
28
|
get closestEntity(): EntityBaseElement | null;
|
|
@@ -62,11 +62,11 @@ type AsyncElementTagName = {
|
|
|
62
62
|
}[keyof HTMLElementTagNameMap];
|
|
63
63
|
/**
|
|
64
64
|
* Waits for the first element matching the given tag name to be fully initialized. Note that the
|
|
65
|
-
* promise never settles if the element cannot finish initializing (for example, a `<pc-script>`
|
|
66
|
-
* that is not a direct child of `<pc-
|
|
67
|
-
* device — listen for its `error` event instead). A component element outside
|
|
68
|
-
* the exception: it still becomes ready, but its `component` is `null`. Either way, a
|
|
69
|
-
* element logs a warning naming the parent it requires.
|
|
65
|
+
* promise never settles if the element cannot finish initializing (for example, a `<pc-script-instance>`
|
|
66
|
+
* that is not a direct child of `<pc-script>`, or a `<pc-app>` that could not create a graphics
|
|
67
|
+
* device — listen for its `error` event instead). A component element outside an entity-fronting
|
|
68
|
+
* element is the exception: it still becomes ready, but its `component` is `null`. Either way, a
|
|
69
|
+
* misplaced element logs a warning naming the parent it requires.
|
|
70
70
|
* @param target - The tag name of the element to wait for (e.g. `'pc-app'`).
|
|
71
71
|
* @returns A promise that resolves with the element once it's ready.
|
|
72
72
|
* @example
|
|
@@ -87,11 +87,11 @@ declare function whenReady<K extends AsyncElementTagName>(target: K): Promise<HT
|
|
|
87
87
|
declare function whenReady<T extends AsyncElement>(target: T): Promise<T>;
|
|
88
88
|
/**
|
|
89
89
|
* Waits for the first element matching the given CSS selector to be fully initialized. Note that
|
|
90
|
-
* the promise never settles if the element cannot finish initializing (for example, a `<pc-script>`
|
|
91
|
-
* that is not a direct child of `<pc-
|
|
92
|
-
* device — listen for its `error` event instead). A component element outside
|
|
93
|
-
* the exception: it still becomes ready, but its `component` is `null`. Either way, a
|
|
94
|
-
* element logs a warning naming the parent it requires.
|
|
90
|
+
* the promise never settles if the element cannot finish initializing (for example, a `<pc-script-instance>`
|
|
91
|
+
* that is not a direct child of `<pc-script>`, or a `<pc-app>` that could not create a graphics
|
|
92
|
+
* device — listen for its `error` event instead). A component element outside an entity-fronting
|
|
93
|
+
* element is the exception: it still becomes ready, but its `component` is `null`. Either way, a
|
|
94
|
+
* misplaced element logs a warning naming the parent it requires.
|
|
95
95
|
* @param target - A CSS selector matching the element to wait for (e.g. `'#my-app'`).
|
|
96
96
|
* @returns A promise that resolves with the element once it's ready.
|
|
97
97
|
* @example
|
package/dist/async-element.d.ts
CHANGED
|
@@ -20,9 +20,9 @@ declare class AsyncElement extends HTMLElement {
|
|
|
20
20
|
*/
|
|
21
21
|
get closestApp(): AppElement | null;
|
|
22
22
|
/**
|
|
23
|
-
* The nearest ancestor element that fronts an entity — `<pc-entity
|
|
24
|
-
* `null` if this element has no such ancestor. The search starts at the
|
|
25
|
-
* never resolves to itself.
|
|
23
|
+
* The nearest ancestor element that fronts an entity — `<pc-entity>`, `<pc-model>` or
|
|
24
|
+
* `<pc-node>` — or `null` if this element has no such ancestor. The search starts at the
|
|
25
|
+
* parent, so an element never resolves to itself.
|
|
26
26
|
* @returns The closest entity-fronting element, or `null`.
|
|
27
27
|
*/
|
|
28
28
|
get closestEntity(): EntityBaseElement | null;
|
|
@@ -62,11 +62,11 @@ type AsyncElementTagName = {
|
|
|
62
62
|
}[keyof HTMLElementTagNameMap];
|
|
63
63
|
/**
|
|
64
64
|
* Waits for the first element matching the given tag name to be fully initialized. Note that the
|
|
65
|
-
* promise never settles if the element cannot finish initializing (for example, a `<pc-script>`
|
|
66
|
-
* that is not a direct child of `<pc-
|
|
67
|
-
* device — listen for its `error` event instead). A component element outside
|
|
68
|
-
* the exception: it still becomes ready, but its `component` is `null`. Either way, a
|
|
69
|
-
* element logs a warning naming the parent it requires.
|
|
65
|
+
* promise never settles if the element cannot finish initializing (for example, a `<pc-script-instance>`
|
|
66
|
+
* that is not a direct child of `<pc-script>`, or a `<pc-app>` that could not create a graphics
|
|
67
|
+
* device — listen for its `error` event instead). A component element outside an entity-fronting
|
|
68
|
+
* element is the exception: it still becomes ready, but its `component` is `null`. Either way, a
|
|
69
|
+
* misplaced element logs a warning naming the parent it requires.
|
|
70
70
|
* @param target - The tag name of the element to wait for (e.g. `'pc-app'`).
|
|
71
71
|
* @returns A promise that resolves with the element once it's ready.
|
|
72
72
|
* @example
|
|
@@ -87,11 +87,11 @@ declare function whenReady<K extends AsyncElementTagName>(target: K): Promise<HT
|
|
|
87
87
|
declare function whenReady<T extends AsyncElement>(target: T): Promise<T>;
|
|
88
88
|
/**
|
|
89
89
|
* Waits for the first element matching the given CSS selector to be fully initialized. Note that
|
|
90
|
-
* the promise never settles if the element cannot finish initializing (for example, a `<pc-script>`
|
|
91
|
-
* that is not a direct child of `<pc-
|
|
92
|
-
* device — listen for its `error` event instead). A component element outside
|
|
93
|
-
* the exception: it still becomes ready, but its `component` is `null`. Either way, a
|
|
94
|
-
* element logs a warning naming the parent it requires.
|
|
90
|
+
* the promise never settles if the element cannot finish initializing (for example, a `<pc-script-instance>`
|
|
91
|
+
* that is not a direct child of `<pc-script>`, or a `<pc-app>` that could not create a graphics
|
|
92
|
+
* device — listen for its `error` event instead). A component element outside an entity-fronting
|
|
93
|
+
* element is the exception: it still becomes ready, but its `component` is `null`. Either way, a
|
|
94
|
+
* misplaced element logs a warning naming the parent it requires.
|
|
95
95
|
* @param target - A CSS selector matching the element to wait for (e.g. `'#my-app'`).
|
|
96
96
|
* @returns A promise that resolves with the element once it's ready.
|
|
97
97
|
* @example
|
|
@@ -25,6 +25,8 @@ type ContainerWithAnimations = ContainerResource & {
|
|
|
25
25
|
* the underlying {@link AnimComponent} (via {@link component}) for playback state beyond what
|
|
26
26
|
* this element exposes.
|
|
27
27
|
*
|
|
28
|
+
* Engine component: {@link AnimComponent} (`anim`).
|
|
29
|
+
*
|
|
28
30
|
* @category Components
|
|
29
31
|
*/
|
|
30
32
|
declare class AnimComponentElement extends ComponentElement {
|
|
@@ -46,6 +48,11 @@ declare class AnimComponentElement extends ComponentElement {
|
|
|
46
48
|
* The name of the active clip.
|
|
47
49
|
*/
|
|
48
50
|
private _clip;
|
|
51
|
+
/**
|
|
52
|
+
* The binding root this element last assigned through {@link _applyRootBone}, distinguishing
|
|
53
|
+
* its own writes from a `rootBone` assigned through the engine API — which is left alone.
|
|
54
|
+
*/
|
|
55
|
+
private _managedRootBone;
|
|
49
56
|
/**
|
|
50
57
|
* The element the model-readiness listener is attached to, held so disconnection can detach
|
|
51
58
|
* it after `closestEntity` no longer resolves.
|
|
@@ -71,14 +78,35 @@ declare class AnimComponentElement extends ComponentElement {
|
|
|
71
78
|
*/
|
|
72
79
|
private _warnedClip;
|
|
73
80
|
/**
|
|
74
|
-
* Rebinds when a model
|
|
75
|
-
*
|
|
81
|
+
* Rebinds when a model that is not this component's host announces readiness — a sibling or
|
|
82
|
+
* deeper model whose content changed under the assigned clips. The engine resolves each
|
|
83
|
+
* curve once, at the first tick after assignment, and never retries — and its mesh-instance
|
|
76
84
|
* broadcast fires before an instantiated hierarchy is parented, so a model that loads after
|
|
77
|
-
* the clips were assigned would otherwise stay silently unbound.
|
|
78
|
-
*
|
|
79
|
-
*
|
|
85
|
+
* the clips were assigned would otherwise stay silently unbound. The host model's own cycles
|
|
86
|
+
* are excluded: those re-enter through {@link initComponent}, which refreshes the whole clip
|
|
87
|
+
* set against the new container.
|
|
80
88
|
*/
|
|
81
89
|
private _onModelReady;
|
|
90
|
+
/**
|
|
91
|
+
* The model whose host entity scopes this component's curve binding: the parent `pc-model`,
|
|
92
|
+
* or the sole `pc-model` among the parent's direct children (the arrangement where clips
|
|
93
|
+
* live in a library asset beside the skeleton). `null` when there is no such model, or more
|
|
94
|
+
* than one — an ambiguous skeleton is left to the engine's name-based resolution.
|
|
95
|
+
*/
|
|
96
|
+
private _skeletonSource;
|
|
97
|
+
/**
|
|
98
|
+
* Keeps the component's binding root pointing at the skeleton source's host entity. The host
|
|
99
|
+
* wraps the instantiated content, so left at its default — the component's own entity — the
|
|
100
|
+
* engine binder mis-resolves curves that target the asset's root node: its fallback treats
|
|
101
|
+
* the graph as the asset root once the root is no longer a direct child.
|
|
102
|
+
*
|
|
103
|
+
* Authoritative in both directions for values this element assigned: a source appearing pins
|
|
104
|
+
* its host, and a source dissolving (the model gone, or a second model making the skeleton
|
|
105
|
+
* ambiguous) clears the pin rather than leaving it on a stale host. A root assigned through
|
|
106
|
+
* the engine API is never overwritten — the user's choice outranks the managed default.
|
|
107
|
+
* Writes are skipped while unchanged, because the engine setter itself triggers a rebind.
|
|
108
|
+
*/
|
|
109
|
+
private _applyRootBone;
|
|
82
110
|
/** @ignore */
|
|
83
111
|
constructor();
|
|
84
112
|
protected getInitialComponentData(): {
|
|
@@ -25,6 +25,8 @@ type ContainerWithAnimations = ContainerResource & {
|
|
|
25
25
|
* the underlying {@link AnimComponent} (via {@link component}) for playback state beyond what
|
|
26
26
|
* this element exposes.
|
|
27
27
|
*
|
|
28
|
+
* Engine component: {@link AnimComponent} (`anim`).
|
|
29
|
+
*
|
|
28
30
|
* @category Components
|
|
29
31
|
*/
|
|
30
32
|
declare class AnimComponentElement extends ComponentElement {
|
|
@@ -46,6 +48,11 @@ declare class AnimComponentElement extends ComponentElement {
|
|
|
46
48
|
* The name of the active clip.
|
|
47
49
|
*/
|
|
48
50
|
private _clip;
|
|
51
|
+
/**
|
|
52
|
+
* The binding root this element last assigned through {@link _applyRootBone}, distinguishing
|
|
53
|
+
* its own writes from a `rootBone` assigned through the engine API — which is left alone.
|
|
54
|
+
*/
|
|
55
|
+
private _managedRootBone;
|
|
49
56
|
/**
|
|
50
57
|
* The element the model-readiness listener is attached to, held so disconnection can detach
|
|
51
58
|
* it after `closestEntity` no longer resolves.
|
|
@@ -71,14 +78,35 @@ declare class AnimComponentElement extends ComponentElement {
|
|
|
71
78
|
*/
|
|
72
79
|
private _warnedClip;
|
|
73
80
|
/**
|
|
74
|
-
* Rebinds when a model
|
|
75
|
-
*
|
|
81
|
+
* Rebinds when a model that is not this component's host announces readiness — a sibling or
|
|
82
|
+
* deeper model whose content changed under the assigned clips. The engine resolves each
|
|
83
|
+
* curve once, at the first tick after assignment, and never retries — and its mesh-instance
|
|
76
84
|
* broadcast fires before an instantiated hierarchy is parented, so a model that loads after
|
|
77
|
-
* the clips were assigned would otherwise stay silently unbound.
|
|
78
|
-
*
|
|
79
|
-
*
|
|
85
|
+
* the clips were assigned would otherwise stay silently unbound. The host model's own cycles
|
|
86
|
+
* are excluded: those re-enter through {@link initComponent}, which refreshes the whole clip
|
|
87
|
+
* set against the new container.
|
|
80
88
|
*/
|
|
81
89
|
private _onModelReady;
|
|
90
|
+
/**
|
|
91
|
+
* The model whose host entity scopes this component's curve binding: the parent `pc-model`,
|
|
92
|
+
* or the sole `pc-model` among the parent's direct children (the arrangement where clips
|
|
93
|
+
* live in a library asset beside the skeleton). `null` when there is no such model, or more
|
|
94
|
+
* than one — an ambiguous skeleton is left to the engine's name-based resolution.
|
|
95
|
+
*/
|
|
96
|
+
private _skeletonSource;
|
|
97
|
+
/**
|
|
98
|
+
* Keeps the component's binding root pointing at the skeleton source's host entity. The host
|
|
99
|
+
* wraps the instantiated content, so left at its default — the component's own entity — the
|
|
100
|
+
* engine binder mis-resolves curves that target the asset's root node: its fallback treats
|
|
101
|
+
* the graph as the asset root once the root is no longer a direct child.
|
|
102
|
+
*
|
|
103
|
+
* Authoritative in both directions for values this element assigned: a source appearing pins
|
|
104
|
+
* its host, and a source dissolving (the model gone, or a second model making the skeleton
|
|
105
|
+
* ambiguous) clears the pin rather than leaving it on a stale host. A root assigned through
|
|
106
|
+
* the engine API is never overwritten — the user's choice outranks the managed default.
|
|
107
|
+
* Writes are skipped while unchanged, because the engine setter itself triggers a rebind.
|
|
108
|
+
*/
|
|
109
|
+
private _applyRootBone;
|
|
82
110
|
/** @ignore */
|
|
83
111
|
constructor();
|
|
84
112
|
protected getInitialComponentData(): {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { AudioListenerComponent } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component.cjs';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
5
|
-
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-listener/ | `<pc-listener>`} elements.
|
|
6
|
-
* The
|
|
4
|
+
* The AudioListenerComponentElement interface provides properties and methods for manipulating
|
|
5
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-audio-listener/ | `<pc-audio-listener>`} elements.
|
|
6
|
+
* The AudioListenerComponentElement interface also inherits the properties and methods of the
|
|
7
7
|
* {@link HTMLElement} interface.
|
|
8
8
|
*
|
|
9
|
+
* Engine component: {@link AudioListenerComponent} (`audiolistener`).
|
|
10
|
+
*
|
|
9
11
|
* @category Components
|
|
10
12
|
*/
|
|
11
|
-
declare class
|
|
13
|
+
declare class AudioListenerComponentElement extends ComponentElement {
|
|
12
14
|
/** @ignore */
|
|
13
15
|
constructor();
|
|
14
16
|
/**
|
|
@@ -17,4 +19,4 @@ declare class ListenerComponentElement extends ComponentElement {
|
|
|
17
19
|
*/
|
|
18
20
|
get component(): AudioListenerComponent;
|
|
19
21
|
}
|
|
20
|
-
export {
|
|
22
|
+
export { AudioListenerComponentElement };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { AudioListenerComponent } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component.js';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
5
|
-
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-listener/ | `<pc-listener>`} elements.
|
|
6
|
-
* The
|
|
4
|
+
* The AudioListenerComponentElement interface provides properties and methods for manipulating
|
|
5
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-audio-listener/ | `<pc-audio-listener>`} elements.
|
|
6
|
+
* The AudioListenerComponentElement interface also inherits the properties and methods of the
|
|
7
7
|
* {@link HTMLElement} interface.
|
|
8
8
|
*
|
|
9
|
+
* Engine component: {@link AudioListenerComponent} (`audiolistener`).
|
|
10
|
+
*
|
|
9
11
|
* @category Components
|
|
10
12
|
*/
|
|
11
|
-
declare class
|
|
13
|
+
declare class AudioListenerComponentElement extends ComponentElement {
|
|
12
14
|
/** @ignore */
|
|
13
15
|
constructor();
|
|
14
16
|
/**
|
|
@@ -17,4 +19,4 @@ declare class ListenerComponentElement extends ComponentElement {
|
|
|
17
19
|
*/
|
|
18
20
|
get component(): AudioListenerComponent;
|
|
19
21
|
}
|
|
20
|
-
export {
|
|
22
|
+
export { AudioListenerComponentElement };
|
|
@@ -7,6 +7,8 @@ import { ComponentElement } from './component.cjs';
|
|
|
7
7
|
* The ButtonComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Engine component: {@link ButtonComponent} (`button`).
|
|
11
|
+
*
|
|
10
12
|
* @category Components
|
|
11
13
|
*/
|
|
12
14
|
declare class ButtonComponentElement extends ComponentElement {
|
|
@@ -44,7 +46,9 @@ declare class ButtonComponentElement extends ComponentElement {
|
|
|
44
46
|
get active(): boolean;
|
|
45
47
|
/**
|
|
46
48
|
* Sets the reference (CSS selector, element id or entity name) to the `<pc-entity>` whose image
|
|
47
|
-
* element is used for visual transitions. Defaults to the button's own entity
|
|
49
|
+
* element is used for visual transitions. Defaults to the button's own entity — inside a
|
|
50
|
+
* `<pc-model>`, that is the model's host entity, so supply an explicit reference to target a
|
|
51
|
+
* UI entity instead.
|
|
48
52
|
* @param value - The image entity reference.
|
|
49
53
|
*/
|
|
50
54
|
set image(value: string);
|
|
@@ -7,6 +7,8 @@ import { ComponentElement } from './component.js';
|
|
|
7
7
|
* The ButtonComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Engine component: {@link ButtonComponent} (`button`).
|
|
11
|
+
*
|
|
10
12
|
* @category Components
|
|
11
13
|
*/
|
|
12
14
|
declare class ButtonComponentElement extends ComponentElement {
|
|
@@ -44,7 +46,9 @@ declare class ButtonComponentElement extends ComponentElement {
|
|
|
44
46
|
get active(): boolean;
|
|
45
47
|
/**
|
|
46
48
|
* Sets the reference (CSS selector, element id or entity name) to the `<pc-entity>` whose image
|
|
47
|
-
* element is used for visual transitions. Defaults to the button's own entity
|
|
49
|
+
* element is used for visual transitions. Defaults to the button's own entity — inside a
|
|
50
|
+
* `<pc-model>`, that is the model's host entity, so supply an explicit reference to target a
|
|
51
|
+
* UI entity instead.
|
|
48
52
|
* @param value - The image entity reference.
|
|
49
53
|
*/
|
|
50
54
|
set image(value: string);
|
|
@@ -7,6 +7,8 @@ import { ComponentElement } from './component.cjs';
|
|
|
7
7
|
* The CameraComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Engine component: {@link CameraComponent} (`camera`).
|
|
11
|
+
*
|
|
10
12
|
* @category Components
|
|
11
13
|
*/
|
|
12
14
|
declare class CameraComponentElement extends ComponentElement {
|
|
@@ -7,6 +7,8 @@ import { ComponentElement } from './component.js';
|
|
|
7
7
|
* The CameraComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Engine component: {@link CameraComponent} (`camera`).
|
|
11
|
+
*
|
|
10
12
|
* @category Components
|
|
11
13
|
*/
|
|
12
14
|
declare class CameraComponentElement extends ComponentElement {
|
|
@@ -13,6 +13,8 @@ import { ComponentElement } from './component.cjs';
|
|
|
13
13
|
* retargets or rebinds picks up the new node's geometry. An entity with no asset-backed render
|
|
14
14
|
* component warns, and the collider has no shape.
|
|
15
15
|
*
|
|
16
|
+
* Engine component: {@link CollisionComponent} (`collision`).
|
|
17
|
+
*
|
|
16
18
|
* @category Components
|
|
17
19
|
*/
|
|
18
20
|
declare class CollisionComponentElement extends ComponentElement {
|
|
@@ -43,7 +45,9 @@ declare class CollisionComponentElement extends ComponentElement {
|
|
|
43
45
|
* no attribute to supply it - so the host's visible geometry, the meaning a mesh collider
|
|
44
46
|
* on a glTF node carries, fills the gap. Runs on every application (so a rebound `pc-node`
|
|
45
47
|
* recomputes it) and on a runtime switch to `type="mesh"`; an explicitly assigned
|
|
46
|
-
* `renderAsset` is never overwritten.
|
|
48
|
+
* `renderAsset` is never overwritten. A `pc-model` host entity never carries a render
|
|
49
|
+
* component (the instantiated content beneath it does), so a mesh collider that should take
|
|
50
|
+
* an asset's geometry belongs on a bound `pc-node`.
|
|
47
51
|
*/
|
|
48
52
|
private _applyMeshGeometryDefault;
|
|
49
53
|
/**
|
|
@@ -13,6 +13,8 @@ import { ComponentElement } from './component.js';
|
|
|
13
13
|
* retargets or rebinds picks up the new node's geometry. An entity with no asset-backed render
|
|
14
14
|
* component warns, and the collider has no shape.
|
|
15
15
|
*
|
|
16
|
+
* Engine component: {@link CollisionComponent} (`collision`).
|
|
17
|
+
*
|
|
16
18
|
* @category Components
|
|
17
19
|
*/
|
|
18
20
|
declare class CollisionComponentElement extends ComponentElement {
|
|
@@ -43,7 +45,9 @@ declare class CollisionComponentElement extends ComponentElement {
|
|
|
43
45
|
* no attribute to supply it - so the host's visible geometry, the meaning a mesh collider
|
|
44
46
|
* on a glTF node carries, fills the gap. Runs on every application (so a rebound `pc-node`
|
|
45
47
|
* recomputes it) and on a runtime switch to `type="mesh"`; an explicitly assigned
|
|
46
|
-
* `renderAsset` is never overwritten.
|
|
48
|
+
* `renderAsset` is never overwritten. A `pc-model` host entity never carries a render
|
|
49
|
+
* component (the instantiated content beneath it does), so a mesh collider that should take
|
|
50
|
+
* an asset's geometry belongs on a bound `pc-node`.
|
|
47
51
|
*/
|
|
48
52
|
private _applyMeshGeometryDefault;
|
|
49
53
|
/**
|
|
@@ -61,8 +61,9 @@ declare class ComponentElement extends AsyncElement {
|
|
|
61
61
|
disconnectedCallback(): void;
|
|
62
62
|
/**
|
|
63
63
|
* The PlayCanvas component instance. `null` until the element is ready, and also for an
|
|
64
|
-
* element that is not a descendant of
|
|
65
|
-
* element's `ready()` promise
|
|
64
|
+
* element that is not a descendant of an entity-fronting element (`<pc-entity>`,
|
|
65
|
+
* `<pc-model>` or `<pc-node>`) — await {@link whenReady} or the element's `ready()` promise
|
|
66
|
+
* before accessing it.
|
|
66
67
|
* @returns The component instance, or `null`.
|
|
67
68
|
*/
|
|
68
69
|
get component(): Component | null;
|
|
@@ -61,8 +61,9 @@ declare class ComponentElement extends AsyncElement {
|
|
|
61
61
|
disconnectedCallback(): void;
|
|
62
62
|
/**
|
|
63
63
|
* The PlayCanvas component instance. `null` until the element is ready, and also for an
|
|
64
|
-
* element that is not a descendant of
|
|
65
|
-
* element's `ready()` promise
|
|
64
|
+
* element that is not a descendant of an entity-fronting element (`<pc-entity>`,
|
|
65
|
+
* `<pc-model>` or `<pc-node>`) — await {@link whenReady} or the element's `ready()` promise
|
|
66
|
+
* before accessing it.
|
|
66
67
|
* @returns The component instance, or `null`.
|
|
67
68
|
*/
|
|
68
69
|
get component(): Component | null;
|
|
@@ -7,6 +7,13 @@ import { ComponentElement } from './component.cjs';
|
|
|
7
7
|
* The ElementComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Despite the name, this is not a base class or a generic wrapper: it is the engine's 2D UI
|
|
11
|
+
* component, which gives its host entity a rectangle in a `<pc-screen>` hierarchy that draws
|
|
12
|
+
* either an image, a line of text or nothing (`type="image"`, `"text"` or `"group"`). The tag
|
|
13
|
+
* spells the engine component it adds, as every component element does.
|
|
14
|
+
*
|
|
15
|
+
* Engine component: {@link ElementComponent} (`element`).
|
|
16
|
+
*
|
|
10
17
|
* @category Components
|
|
11
18
|
*/
|
|
12
19
|
declare class ElementComponentElement extends ComponentElement {
|
|
@@ -7,6 +7,13 @@ import { ComponentElement } from './component.js';
|
|
|
7
7
|
* The ElementComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Despite the name, this is not a base class or a generic wrapper: it is the engine's 2D UI
|
|
11
|
+
* component, which gives its host entity a rectangle in a `<pc-screen>` hierarchy that draws
|
|
12
|
+
* either an image, a line of text or nothing (`type="image"`, `"text"` or `"group"`). The tag
|
|
13
|
+
* spells the engine component it adds, as every component element does.
|
|
14
|
+
*
|
|
15
|
+
* Engine component: {@link ElementComponent} (`element`).
|
|
16
|
+
*
|
|
10
17
|
* @category Components
|
|
11
18
|
*/
|
|
12
19
|
declare class ElementComponentElement extends ComponentElement {
|
|
@@ -6,6 +6,8 @@ import { ComponentElement } from './component.cjs';
|
|
|
6
6
|
* The GSplatComponentElement interface also inherits the properties and methods of the
|
|
7
7
|
* {@link HTMLElement} interface.
|
|
8
8
|
*
|
|
9
|
+
* Engine component: {@link GSplatComponent} (`gsplat`).
|
|
10
|
+
*
|
|
9
11
|
* @category Components
|
|
10
12
|
*/
|
|
11
13
|
declare class GSplatComponentElement extends ComponentElement {
|
|
@@ -6,6 +6,8 @@ import { ComponentElement } from './component.js';
|
|
|
6
6
|
* The GSplatComponentElement interface also inherits the properties and methods of the
|
|
7
7
|
* {@link HTMLElement} interface.
|
|
8
8
|
*
|
|
9
|
+
* Engine component: {@link GSplatComponent} (`gsplat`).
|
|
10
|
+
*
|
|
9
11
|
* @category Components
|
|
10
12
|
*/
|
|
11
13
|
declare class GSplatComponentElement extends ComponentElement {
|
|
@@ -20,6 +20,8 @@ type MotionMode = 'locked' | 'limited' | 'free';
|
|
|
20
20
|
* constraint breaks. A broken joint no longer constrains its bodies; calling `refreshFrames()` on
|
|
21
21
|
* the underlying component re-attaches it. Bubbles and is composed.
|
|
22
22
|
*
|
|
23
|
+
* Engine component: {@link JointComponent} (`joint`).
|
|
24
|
+
*
|
|
23
25
|
* @category Components
|
|
24
26
|
*/
|
|
25
27
|
declare class JointComponentElement extends ComponentElement {
|
|
@@ -20,6 +20,8 @@ type MotionMode = 'locked' | 'limited' | 'free';
|
|
|
20
20
|
* constraint breaks. A broken joint no longer constrains its bodies; calling `refreshFrames()` on
|
|
21
21
|
* the underlying component re-attaches it. Bubbles and is composed.
|
|
22
22
|
*
|
|
23
|
+
* Engine component: {@link JointComponent} (`joint`).
|
|
24
|
+
*
|
|
23
25
|
* @category Components
|
|
24
26
|
*/
|
|
25
27
|
declare class JointComponentElement extends ComponentElement {
|
|
@@ -2,10 +2,12 @@ import type { LayoutChildComponent } from 'playcanvas';
|
|
|
2
2
|
import { ComponentElement } from './component.cjs';
|
|
3
3
|
/**
|
|
4
4
|
* The LayoutChildComponentElement interface provides properties and methods for manipulating
|
|
5
|
-
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-
|
|
5
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-layout-child/ | `<pc-layout-child>`} elements.
|
|
6
6
|
* The LayoutChildComponentElement interface also inherits the properties and methods of the
|
|
7
7
|
* {@link HTMLElement} interface.
|
|
8
8
|
*
|
|
9
|
+
* Engine component: {@link LayoutChildComponent} (`layoutchild`).
|
|
10
|
+
*
|
|
9
11
|
* @category Components
|
|
10
12
|
*/
|
|
11
13
|
declare class LayoutChildComponentElement extends ComponentElement {
|
|
@@ -2,10 +2,12 @@ import type { LayoutChildComponent } from 'playcanvas';
|
|
|
2
2
|
import { ComponentElement } from './component.js';
|
|
3
3
|
/**
|
|
4
4
|
* The LayoutChildComponentElement interface provides properties and methods for manipulating
|
|
5
|
-
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-
|
|
5
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-layout-child/ | `<pc-layout-child>`} elements.
|
|
6
6
|
* The LayoutChildComponentElement interface also inherits the properties and methods of the
|
|
7
7
|
* {@link HTMLElement} interface.
|
|
8
8
|
*
|
|
9
|
+
* Engine component: {@link LayoutChildComponent} (`layoutchild`).
|
|
10
|
+
*
|
|
9
11
|
* @category Components
|
|
10
12
|
*/
|
|
11
13
|
declare class LayoutChildComponentElement extends ComponentElement {
|
|
@@ -3,10 +3,12 @@ import { Vec2, Vec4 } from 'playcanvas';
|
|
|
3
3
|
import { ComponentElement } from './component.cjs';
|
|
4
4
|
/**
|
|
5
5
|
* The LayoutGroupComponentElement interface provides properties and methods for manipulating
|
|
6
|
-
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-
|
|
6
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-layout-group/ | `<pc-layout-group>`} elements.
|
|
7
7
|
* The LayoutGroupComponentElement interface also inherits the properties and methods of the
|
|
8
8
|
* {@link HTMLElement} interface.
|
|
9
9
|
*
|
|
10
|
+
* Engine component: {@link LayoutGroupComponent} (`layoutgroup`).
|
|
11
|
+
*
|
|
10
12
|
* @category Components
|
|
11
13
|
*/
|
|
12
14
|
declare class LayoutGroupComponentElement extends ComponentElement {
|