@playcanvas/web-components 0.15.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.
Files changed (108) hide show
  1. package/dist/app.d.cts +14 -13
  2. package/dist/app.d.ts +14 -13
  3. package/dist/async-element.d.cts +13 -13
  4. package/dist/async-element.d.ts +13 -13
  5. package/dist/components/anim-clip.d.cts +127 -0
  6. package/dist/components/anim-clip.d.ts +127 -0
  7. package/dist/components/anim-component.d.cts +235 -0
  8. package/dist/components/anim-component.d.ts +235 -0
  9. package/dist/components/{listener-component.d.cts → audio-listener-component.d.cts} +7 -5
  10. package/dist/components/{listener-component.d.ts → audio-listener-component.d.ts} +7 -5
  11. package/dist/components/button-component.d.cts +5 -1
  12. package/dist/components/button-component.d.ts +5 -1
  13. package/dist/components/camera-component.d.cts +2 -0
  14. package/dist/components/camera-component.d.ts +2 -0
  15. package/dist/components/collision-component.d.cts +5 -1
  16. package/dist/components/collision-component.d.ts +5 -1
  17. package/dist/components/component.d.cts +3 -2
  18. package/dist/components/component.d.ts +3 -2
  19. package/dist/components/element-component.d.cts +7 -0
  20. package/dist/components/element-component.d.ts +7 -0
  21. package/dist/components/gsplat-component.d.cts +2 -0
  22. package/dist/components/gsplat-component.d.ts +2 -0
  23. package/dist/components/joint-component.d.cts +2 -0
  24. package/dist/components/joint-component.d.ts +2 -0
  25. package/dist/components/{layoutchild-component.d.cts → layout-child-component.d.cts} +3 -1
  26. package/dist/components/{layoutchild-component.d.ts → layout-child-component.d.ts} +3 -1
  27. package/dist/components/{layoutgroup-component.d.cts → layout-group-component.d.cts} +3 -1
  28. package/dist/components/{layoutgroup-component.d.ts → layout-group-component.d.ts} +3 -1
  29. package/dist/components/light-component.d.cts +2 -0
  30. package/dist/components/light-component.d.ts +2 -0
  31. package/dist/components/{particlesystem-component.d.cts → particle-system-component.d.cts} +3 -1
  32. package/dist/components/{particlesystem-component.d.ts → particle-system-component.d.ts} +3 -1
  33. package/dist/components/render-component.d.cts +2 -0
  34. package/dist/components/render-component.d.ts +2 -0
  35. package/dist/components/{rigidbody-component.d.cts → rigid-body-component.d.cts} +3 -1
  36. package/dist/components/{rigidbody-component.d.ts → rigid-body-component.d.ts} +3 -1
  37. package/dist/components/screen-component.d.cts +2 -0
  38. package/dist/components/screen-component.d.ts +2 -0
  39. package/dist/components/script-component.d.cts +23 -12
  40. package/dist/components/script-component.d.ts +23 -12
  41. package/dist/components/{script.d.cts → script-instance.d.cts} +7 -7
  42. package/dist/components/{script.d.ts → script-instance.d.ts} +7 -7
  43. package/dist/components/{scrollview-component.d.cts → scroll-view-component.d.cts} +3 -1
  44. package/dist/components/{scrollview-component.d.ts → scroll-view-component.d.ts} +3 -1
  45. package/dist/components/scrollbar-component.d.cts +2 -0
  46. package/dist/components/scrollbar-component.d.ts +2 -0
  47. package/dist/components/sound-component.d.cts +3 -1
  48. package/dist/components/sound-component.d.ts +3 -1
  49. package/dist/components/sound-slot.d.cts +2 -2
  50. package/dist/components/sound-slot.d.ts +2 -2
  51. package/dist/custom-elements.json +3154 -2005
  52. package/dist/entity-base.d.cts +6 -5
  53. package/dist/entity-base.d.ts +6 -5
  54. package/dist/entity-owner.d.cts +118 -0
  55. package/dist/entity-owner.d.ts +118 -0
  56. package/dist/entity.d.cts +8 -101
  57. package/dist/entity.d.ts +8 -101
  58. package/dist/index.d.cts +26 -21
  59. package/dist/index.d.ts +26 -21
  60. package/dist/model.d.cts +67 -24
  61. package/dist/model.d.ts +67 -24
  62. package/dist/pwc.cjs +1766 -619
  63. package/dist/pwc.cjs.map +1 -1
  64. package/dist/pwc.js +1766 -619
  65. package/dist/pwc.js.map +1 -1
  66. package/dist/pwc.min.js +1 -1
  67. package/dist/pwc.min.js.map +1 -1
  68. package/dist/pwc.min.mjs +1 -1
  69. package/dist/pwc.min.mjs.map +1 -1
  70. package/dist/pwc.mjs +1762 -618
  71. package/dist/pwc.mjs.map +1 -1
  72. package/dist/vscode.html-custom-data.json +203 -89
  73. package/dist/{module.d.cts → wasm.d.cts} +6 -6
  74. package/dist/{module.d.ts → wasm.d.ts} +6 -6
  75. package/dist/web-types.json +556 -273
  76. package/package.json +7 -7
  77. package/src/app.ts +45 -35
  78. package/src/async-element.ts +14 -14
  79. package/src/components/anim-clip.ts +395 -0
  80. package/src/components/anim-component.ts +719 -0
  81. package/src/components/{listener-component.ts → audio-listener-component.ts} +8 -6
  82. package/src/components/button-component.ts +5 -1
  83. package/src/components/camera-component.ts +2 -0
  84. package/src/components/collision-component.ts +5 -1
  85. package/src/components/component.ts +4 -3
  86. package/src/components/element-component.ts +7 -0
  87. package/src/components/gsplat-component.ts +2 -0
  88. package/src/components/joint-component.ts +2 -0
  89. package/src/components/{layoutchild-component.ts → layout-child-component.ts} +4 -2
  90. package/src/components/{layoutgroup-component.ts → layout-group-component.ts} +4 -2
  91. package/src/components/light-component.ts +2 -0
  92. package/src/components/{particlesystem-component.ts → particle-system-component.ts} +4 -2
  93. package/src/components/render-component.ts +2 -0
  94. package/src/components/{rigidbody-component.ts → rigid-body-component.ts} +4 -2
  95. package/src/components/screen-component.ts +2 -0
  96. package/src/components/script-component.ts +63 -42
  97. package/src/components/{script.ts → script-instance.ts} +14 -14
  98. package/src/components/{scrollview-component.ts → scroll-view-component.ts} +4 -2
  99. package/src/components/scrollbar-component.ts +2 -0
  100. package/src/components/sound-component.ts +4 -2
  101. package/src/components/sound-slot.ts +4 -4
  102. package/src/entity-base.ts +6 -5
  103. package/src/entity-owner.ts +298 -0
  104. package/src/entity.ts +15 -270
  105. package/src/index.ts +32 -24
  106. package/src/model.ts +159 -79
  107. package/src/node.ts +9 -5
  108. package/src/{module.ts → wasm.ts} +8 -8
@@ -2,11 +2,12 @@ import type { Entity } from 'playcanvas';
2
2
  import type { AppElement } from './app.cjs';
3
3
  import { AsyncElement } from './async-element.cjs';
4
4
  /**
5
- * The base class for elements that front an engine {@link Entity}: `<pc-entity>`, which creates
6
- * one, and `<pc-node>`, which binds to one inside a model's instantiated hierarchy. It carries
7
- * what both need — the `entity` contract, registration with the owning application (which joins
8
- * picked scene nodes back to elements by identity, never by name), and the pointer listener
9
- * bookkeeping that lets the application lazily attach its canvas handlers.
5
+ * The base class for elements that front an engine {@link Entity}: `<pc-entity>` and
6
+ * `<pc-model>`, which create one, and `<pc-node>`, which binds to one inside a model's
7
+ * instantiated hierarchy. It carries what all of them need — the `entity` contract, registration
8
+ * with the owning application (which joins picked scene nodes back to elements by identity,
9
+ * never by name), and the pointer listener bookkeeping that lets the application lazily attach
10
+ * its canvas handlers.
10
11
  */
11
12
  declare class EntityBaseElement extends AsyncElement {
12
13
  protected _entity: Entity | null;
@@ -2,11 +2,12 @@ import type { Entity } from 'playcanvas';
2
2
  import type { AppElement } from './app.js';
3
3
  import { AsyncElement } from './async-element.js';
4
4
  /**
5
- * The base class for elements that front an engine {@link Entity}: `<pc-entity>`, which creates
6
- * one, and `<pc-node>`, which binds to one inside a model's instantiated hierarchy. It carries
7
- * what both need — the `entity` contract, registration with the owning application (which joins
8
- * picked scene nodes back to elements by identity, never by name), and the pointer listener
9
- * bookkeeping that lets the application lazily attach its canvas handlers.
5
+ * The base class for elements that front an engine {@link Entity}: `<pc-entity>` and
6
+ * `<pc-model>`, which create one, and `<pc-node>`, which binds to one inside a model's
7
+ * instantiated hierarchy. It carries what all of them need — the `entity` contract, registration
8
+ * with the owning application (which joins picked scene nodes back to elements by identity,
9
+ * never by name), and the pointer listener bookkeeping that lets the application lazily attach
10
+ * its canvas handlers.
10
11
  */
11
12
  declare class EntityBaseElement extends AsyncElement {
12
13
  protected _entity: Entity | null;
@@ -0,0 +1,118 @@
1
+ import { Entity, Vec3 } from 'playcanvas';
2
+ import { EntityBaseElement } from './entity-base.cjs';
3
+ /**
4
+ * The base class for elements that create and own their backing entity: `<pc-entity>` and
5
+ * `<pc-model>`, whose host entity carries the same authored properties. It carries the cached
6
+ * property state, entity creation and parenting, and the reset that follows the entity's
7
+ * destruction. `<pc-node>` sits outside this class: it borrows an entity a model instantiated,
8
+ * and its properties are nullable overrides rather than owned values.
9
+ */
10
+ declare class EntityOwnerElement extends EntityBaseElement {
11
+ /**
12
+ * Whether the entity is enabled.
13
+ */
14
+ private _enabled;
15
+ /**
16
+ * The name of the entity.
17
+ */
18
+ private _name;
19
+ /**
20
+ * The position of the entity.
21
+ */
22
+ private _position;
23
+ /**
24
+ * The rotation of the entity.
25
+ */
26
+ private _rotation;
27
+ /**
28
+ * The scale of the entity.
29
+ */
30
+ private _scale;
31
+ /**
32
+ * The tags of the entity.
33
+ */
34
+ private _tags;
35
+ /**
36
+ * Whether the hierarchy has been built for this entity — set once {@link _buildHierarchy} has
37
+ * parented it. Read by subclasses that gate work on the entity being in the scene graph.
38
+ */
39
+ protected _built: boolean;
40
+ /**
41
+ * Handles the destruction of the backing entity. Resets the element so a later re-insertion
42
+ * starts clean: `_built` must be cleared alongside `_entity`, or _buildHierarchy would bail
43
+ * and a re-created entity would never be parented. Readiness is re-armed for the same
44
+ * reason — with the entity gone, a resolved ready promise would resume its awaiters against
45
+ * a null `entity`.
46
+ *
47
+ * @param entity - The entity that was destroyed.
48
+ */
49
+ protected _onEntityDestroy(entity: Entity): void;
50
+ /**
51
+ * Called by {@link _buildHierarchy} once the backing entity has been parented — exactly once
52
+ * per build cycle. The default announces readiness, which is what a parented `<pc-entity>`
53
+ * means; `<pc-model>` overrides it to start loading content instead, because its readiness
54
+ * tracks the content settling rather than the host entering the scene graph.
55
+ */
56
+ protected _onBuilt(): void;
57
+ /**
58
+ * Sets the enabled state of the entity.
59
+ * @param value - Whether the entity is enabled.
60
+ */
61
+ set enabled(value: boolean);
62
+ /**
63
+ * Gets the enabled state of the entity.
64
+ * @returns Whether the entity is enabled.
65
+ */
66
+ get enabled(): boolean;
67
+ /**
68
+ * Sets the name of the entity.
69
+ * @param value - The name of the entity.
70
+ */
71
+ set name(value: string);
72
+ /**
73
+ * Gets the name of the entity.
74
+ * @returns The name of the entity.
75
+ */
76
+ get name(): string;
77
+ /**
78
+ * Sets the position of the entity.
79
+ * @param value - The position of the entity.
80
+ */
81
+ set position(value: Vec3);
82
+ /**
83
+ * Gets the position of the entity.
84
+ * @returns The position of the entity.
85
+ */
86
+ get position(): Vec3;
87
+ /**
88
+ * Sets the rotation of the entity.
89
+ * @param value - The rotation of the entity.
90
+ */
91
+ set rotation(value: Vec3);
92
+ /**
93
+ * Gets the rotation of the entity.
94
+ * @returns The rotation of the entity.
95
+ */
96
+ get rotation(): Vec3;
97
+ /**
98
+ * Sets the scale of the entity.
99
+ * @param value - The scale of the entity.
100
+ */
101
+ set scale(value: Vec3);
102
+ /**
103
+ * Gets the scale of the entity.
104
+ * @returns The scale of the entity.
105
+ */
106
+ get scale(): Vec3;
107
+ /**
108
+ * Sets the tags of the entity.
109
+ * @param value - The tags of the entity.
110
+ */
111
+ set tags(value: string[]);
112
+ /**
113
+ * Gets the tags of the entity.
114
+ * @returns The tags of the entity.
115
+ */
116
+ get tags(): string[];
117
+ }
118
+ export { EntityOwnerElement };
@@ -0,0 +1,118 @@
1
+ import { Entity, Vec3 } from 'playcanvas';
2
+ import { EntityBaseElement } from './entity-base.js';
3
+ /**
4
+ * The base class for elements that create and own their backing entity: `<pc-entity>` and
5
+ * `<pc-model>`, whose host entity carries the same authored properties. It carries the cached
6
+ * property state, entity creation and parenting, and the reset that follows the entity's
7
+ * destruction. `<pc-node>` sits outside this class: it borrows an entity a model instantiated,
8
+ * and its properties are nullable overrides rather than owned values.
9
+ */
10
+ declare class EntityOwnerElement extends EntityBaseElement {
11
+ /**
12
+ * Whether the entity is enabled.
13
+ */
14
+ private _enabled;
15
+ /**
16
+ * The name of the entity.
17
+ */
18
+ private _name;
19
+ /**
20
+ * The position of the entity.
21
+ */
22
+ private _position;
23
+ /**
24
+ * The rotation of the entity.
25
+ */
26
+ private _rotation;
27
+ /**
28
+ * The scale of the entity.
29
+ */
30
+ private _scale;
31
+ /**
32
+ * The tags of the entity.
33
+ */
34
+ private _tags;
35
+ /**
36
+ * Whether the hierarchy has been built for this entity — set once {@link _buildHierarchy} has
37
+ * parented it. Read by subclasses that gate work on the entity being in the scene graph.
38
+ */
39
+ protected _built: boolean;
40
+ /**
41
+ * Handles the destruction of the backing entity. Resets the element so a later re-insertion
42
+ * starts clean: `_built` must be cleared alongside `_entity`, or _buildHierarchy would bail
43
+ * and a re-created entity would never be parented. Readiness is re-armed for the same
44
+ * reason — with the entity gone, a resolved ready promise would resume its awaiters against
45
+ * a null `entity`.
46
+ *
47
+ * @param entity - The entity that was destroyed.
48
+ */
49
+ protected _onEntityDestroy(entity: Entity): void;
50
+ /**
51
+ * Called by {@link _buildHierarchy} once the backing entity has been parented — exactly once
52
+ * per build cycle. The default announces readiness, which is what a parented `<pc-entity>`
53
+ * means; `<pc-model>` overrides it to start loading content instead, because its readiness
54
+ * tracks the content settling rather than the host entering the scene graph.
55
+ */
56
+ protected _onBuilt(): void;
57
+ /**
58
+ * Sets the enabled state of the entity.
59
+ * @param value - Whether the entity is enabled.
60
+ */
61
+ set enabled(value: boolean);
62
+ /**
63
+ * Gets the enabled state of the entity.
64
+ * @returns Whether the entity is enabled.
65
+ */
66
+ get enabled(): boolean;
67
+ /**
68
+ * Sets the name of the entity.
69
+ * @param value - The name of the entity.
70
+ */
71
+ set name(value: string);
72
+ /**
73
+ * Gets the name of the entity.
74
+ * @returns The name of the entity.
75
+ */
76
+ get name(): string;
77
+ /**
78
+ * Sets the position of the entity.
79
+ * @param value - The position of the entity.
80
+ */
81
+ set position(value: Vec3);
82
+ /**
83
+ * Gets the position of the entity.
84
+ * @returns The position of the entity.
85
+ */
86
+ get position(): Vec3;
87
+ /**
88
+ * Sets the rotation of the entity.
89
+ * @param value - The rotation of the entity.
90
+ */
91
+ set rotation(value: Vec3);
92
+ /**
93
+ * Gets the rotation of the entity.
94
+ * @returns The rotation of the entity.
95
+ */
96
+ get rotation(): Vec3;
97
+ /**
98
+ * Sets the scale of the entity.
99
+ * @param value - The scale of the entity.
100
+ */
101
+ set scale(value: Vec3);
102
+ /**
103
+ * Gets the scale of the entity.
104
+ * @returns The scale of the entity.
105
+ */
106
+ get scale(): Vec3;
107
+ /**
108
+ * Sets the tags of the entity.
109
+ * @param value - The tags of the entity.
110
+ */
111
+ set tags(value: string[]);
112
+ /**
113
+ * Gets the tags of the entity.
114
+ * @returns The tags of the entity.
115
+ */
116
+ get tags(): string[];
117
+ }
118
+ export { EntityOwnerElement };
package/dist/entity.d.cts CHANGED
@@ -1,5 +1,4 @@
1
- import { Vec3 } from 'playcanvas';
2
- import { EntityBaseElement } from './entity-base.cjs';
1
+ import { EntityOwnerElement } from './entity-owner.cjs';
3
2
  /**
4
3
  * The EntityElement interface provides properties and methods for manipulating
5
4
  * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-entity/ | `<pc-entity>`} elements.
@@ -11,6 +10,12 @@ import { EntityBaseElement } from './entity-base.cjs';
11
10
  * them, registered either with {@link addEventListener} or with the matching inline `onpointer*`
12
11
  * attribute.
13
12
  *
13
+ * @attribute {boolean} enabled - The enabled state of the entity.
14
+ * @attribute {string} name - The name of the entity.
15
+ * @attribute {string} position - The position of the entity.
16
+ * @attribute {string} rotation - The rotation of the entity.
17
+ * @attribute {string} scale - The scale of the entity.
18
+ * @attribute {string} tags - The tags of the entity.
14
19
  * @attribute {string} onpointerenter - Script to run when the pointer moves onto the entity.
15
20
  * @attribute {string} onpointerleave - Script to run when the pointer moves off the entity.
16
21
  * @attribute {string} onpointermove - Script to run when the pointer moves over the entity.
@@ -24,107 +29,9 @@ import { EntityBaseElement } from './entity-base.cjs';
24
29
  * @fires {PointerEvent} pointerdown - Fired when a pointer button is pressed over the entity.
25
30
  * @fires {PointerEvent} pointerup - Fired when a pointer button is released over the entity.
26
31
  */
27
- declare class EntityElement extends EntityBaseElement {
28
- /**
29
- * Whether the entity is enabled.
30
- */
31
- private _enabled;
32
- /**
33
- * The name of the entity.
34
- */
35
- private _name;
36
- /**
37
- * The position of the entity.
38
- */
39
- private _position;
40
- /**
41
- * The rotation of the entity.
42
- */
43
- private _rotation;
44
- /**
45
- * The scale of the entity.
46
- */
47
- private _scale;
48
- /**
49
- * The tags of the entity.
50
- */
51
- private _tags;
52
- /**
53
- * Whether the hierarchy has been built for this entity.
54
- */
55
- private _built;
56
- /**
57
- * Handles the destruction of the backing entity. Resets the element so a later re-insertion
58
- * starts clean: `_built` must be cleared alongside `_entity`, or _buildHierarchy would bail
59
- * and a re-created entity would never be parented. Readiness is re-armed for the same
60
- * reason — with the entity gone, a resolved ready promise would resume its awaiters against
61
- * a null `entity`.
62
- *
63
- * @param entity - The entity that was destroyed.
64
- */
65
- private _onEntityDestroy;
32
+ declare class EntityElement extends EntityOwnerElement {
66
33
  connectedCallback(): void;
67
34
  disconnectedCallback(): void;
68
- /**
69
- * Sets the enabled state of the entity.
70
- * @param value - Whether the entity is enabled.
71
- */
72
- set enabled(value: boolean);
73
- /**
74
- * Gets the enabled state of the entity.
75
- * @returns Whether the entity is enabled.
76
- */
77
- get enabled(): boolean;
78
- /**
79
- * Sets the name of the entity.
80
- * @param value - The name of the entity.
81
- */
82
- set name(value: string);
83
- /**
84
- * Gets the name of the entity.
85
- * @returns The name of the entity.
86
- */
87
- get name(): string;
88
- /**
89
- * Sets the position of the entity.
90
- * @param value - The position of the entity.
91
- */
92
- set position(value: Vec3);
93
- /**
94
- * Gets the position of the entity.
95
- * @returns The position of the entity.
96
- */
97
- get position(): Vec3;
98
- /**
99
- * Sets the rotation of the entity.
100
- * @param value - The rotation of the entity.
101
- */
102
- set rotation(value: Vec3);
103
- /**
104
- * Gets the rotation of the entity.
105
- * @returns The rotation of the entity.
106
- */
107
- get rotation(): Vec3;
108
- /**
109
- * Sets the scale of the entity.
110
- * @param value - The scale of the entity.
111
- */
112
- set scale(value: Vec3);
113
- /**
114
- * Gets the scale of the entity.
115
- * @returns The scale of the entity.
116
- */
117
- get scale(): Vec3;
118
- /**
119
- * Sets the tags of the entity.
120
- * @param value - The tags of the entity.
121
- */
122
- set tags(value: string[]);
123
- /**
124
- * Gets the tags of the entity.
125
- * @returns The tags of the entity.
126
- */
127
- get tags(): string[];
128
35
  static get observedAttributes(): string[];
129
36
  attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
130
37
  }
package/dist/entity.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { Vec3 } from 'playcanvas';
2
- import { EntityBaseElement } from './entity-base.js';
1
+ import { EntityOwnerElement } from './entity-owner.js';
3
2
  /**
4
3
  * The EntityElement interface provides properties and methods for manipulating
5
4
  * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-entity/ | `<pc-entity>`} elements.
@@ -11,6 +10,12 @@ import { EntityBaseElement } from './entity-base.js';
11
10
  * them, registered either with {@link addEventListener} or with the matching inline `onpointer*`
12
11
  * attribute.
13
12
  *
13
+ * @attribute {boolean} enabled - The enabled state of the entity.
14
+ * @attribute {string} name - The name of the entity.
15
+ * @attribute {string} position - The position of the entity.
16
+ * @attribute {string} rotation - The rotation of the entity.
17
+ * @attribute {string} scale - The scale of the entity.
18
+ * @attribute {string} tags - The tags of the entity.
14
19
  * @attribute {string} onpointerenter - Script to run when the pointer moves onto the entity.
15
20
  * @attribute {string} onpointerleave - Script to run when the pointer moves off the entity.
16
21
  * @attribute {string} onpointermove - Script to run when the pointer moves over the entity.
@@ -24,107 +29,9 @@ import { EntityBaseElement } from './entity-base.js';
24
29
  * @fires {PointerEvent} pointerdown - Fired when a pointer button is pressed over the entity.
25
30
  * @fires {PointerEvent} pointerup - Fired when a pointer button is released over the entity.
26
31
  */
27
- declare class EntityElement extends EntityBaseElement {
28
- /**
29
- * Whether the entity is enabled.
30
- */
31
- private _enabled;
32
- /**
33
- * The name of the entity.
34
- */
35
- private _name;
36
- /**
37
- * The position of the entity.
38
- */
39
- private _position;
40
- /**
41
- * The rotation of the entity.
42
- */
43
- private _rotation;
44
- /**
45
- * The scale of the entity.
46
- */
47
- private _scale;
48
- /**
49
- * The tags of the entity.
50
- */
51
- private _tags;
52
- /**
53
- * Whether the hierarchy has been built for this entity.
54
- */
55
- private _built;
56
- /**
57
- * Handles the destruction of the backing entity. Resets the element so a later re-insertion
58
- * starts clean: `_built` must be cleared alongside `_entity`, or _buildHierarchy would bail
59
- * and a re-created entity would never be parented. Readiness is re-armed for the same
60
- * reason — with the entity gone, a resolved ready promise would resume its awaiters against
61
- * a null `entity`.
62
- *
63
- * @param entity - The entity that was destroyed.
64
- */
65
- private _onEntityDestroy;
32
+ declare class EntityElement extends EntityOwnerElement {
66
33
  connectedCallback(): void;
67
34
  disconnectedCallback(): void;
68
- /**
69
- * Sets the enabled state of the entity.
70
- * @param value - Whether the entity is enabled.
71
- */
72
- set enabled(value: boolean);
73
- /**
74
- * Gets the enabled state of the entity.
75
- * @returns Whether the entity is enabled.
76
- */
77
- get enabled(): boolean;
78
- /**
79
- * Sets the name of the entity.
80
- * @param value - The name of the entity.
81
- */
82
- set name(value: string);
83
- /**
84
- * Gets the name of the entity.
85
- * @returns The name of the entity.
86
- */
87
- get name(): string;
88
- /**
89
- * Sets the position of the entity.
90
- * @param value - The position of the entity.
91
- */
92
- set position(value: Vec3);
93
- /**
94
- * Gets the position of the entity.
95
- * @returns The position of the entity.
96
- */
97
- get position(): Vec3;
98
- /**
99
- * Sets the rotation of the entity.
100
- * @param value - The rotation of the entity.
101
- */
102
- set rotation(value: Vec3);
103
- /**
104
- * Gets the rotation of the entity.
105
- * @returns The rotation of the entity.
106
- */
107
- get rotation(): Vec3;
108
- /**
109
- * Sets the scale of the entity.
110
- * @param value - The scale of the entity.
111
- */
112
- set scale(value: Vec3);
113
- /**
114
- * Gets the scale of the entity.
115
- * @returns The scale of the entity.
116
- */
117
- get scale(): Vec3;
118
- /**
119
- * Sets the tags of the entity.
120
- * @param value - The tags of the entity.
121
- */
122
- set tags(value: string[]);
123
- /**
124
- * Gets the tags of the entity.
125
- * @returns The tags of the entity.
126
- */
127
- get tags(): string[];
128
35
  static get observedAttributes(): string[];
129
36
  attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
130
37
  }
package/dist/index.d.cts CHANGED
@@ -7,34 +7,37 @@
7
7
  * @module EngineWebComponents
8
8
  */
9
9
  import { AsyncElement, whenReady } from './async-element.cjs';
10
- import { ModuleElement } from './module.cjs';
10
+ import { WasmElement } from './wasm.cjs';
11
11
  import { AppElement } from './app.cjs';
12
12
  import { EntityElement } from './entity.cjs';
13
+ import { ModelElement } from './model.cjs';
13
14
  import { AssetElement } from './asset.cjs';
14
- import { ListenerComponentElement } from './components/listener-component.cjs';
15
+ import { AnimComponentElement } from './components/anim-component.cjs';
16
+ import { AnimClipElement } from './components/anim-clip.cjs';
17
+ import { AudioListenerComponentElement } from './components/audio-listener-component.cjs';
15
18
  import { ButtonComponentElement } from './components/button-component.cjs';
16
19
  import { CameraComponentElement } from './components/camera-component.cjs';
17
20
  import { CollisionComponentElement } from './components/collision-component.cjs';
18
21
  import { ComponentElement } from './components/component.cjs';
19
22
  import { ElementComponentElement } from './components/element-component.cjs';
20
23
  import { JointComponentElement } from './components/joint-component.cjs';
21
- import { LayoutChildComponentElement } from './components/layoutchild-component.cjs';
22
- import { LayoutGroupComponentElement } from './components/layoutgroup-component.cjs';
24
+ import { LayoutChildComponentElement } from './components/layout-child-component.cjs';
25
+ import { LayoutGroupComponentElement } from './components/layout-group-component.cjs';
23
26
  import { LightComponentElement } from './components/light-component.cjs';
24
- import { ParticleSystemComponentElement } from './components/particlesystem-component.cjs';
27
+ import { ParticleSystemComponentElement } from './components/particle-system-component.cjs';
25
28
  import { RenderComponentElement } from './components/render-component.cjs';
26
- import { RigidBodyComponentElement } from './components/rigidbody-component.cjs';
29
+ import { RigidBodyComponentElement } from './components/rigid-body-component.cjs';
27
30
  import { ScreenComponentElement } from './components/screen-component.cjs';
28
31
  import { ScrollbarComponentElement } from './components/scrollbar-component.cjs';
29
- import { ScrollViewComponentElement } from './components/scrollview-component.cjs';
32
+ import { ScrollViewComponentElement } from './components/scroll-view-component.cjs';
30
33
  import { ScriptComponentElement } from './components/script-component.cjs';
31
- import { ScriptElement } from './components/script.cjs';
34
+ import { ScriptInstanceElement } from './components/script-instance.cjs';
32
35
  import { SoundComponentElement } from './components/sound-component.cjs';
33
36
  import { SoundSlotElement } from './components/sound-slot.cjs';
34
37
  import { GSplatComponentElement } from './components/gsplat-component.cjs';
35
38
  import { EntityBaseElement } from './entity-base.cjs';
39
+ import { EntityOwnerElement } from './entity-owner.cjs';
36
40
  import { MaterialElement } from './material.cjs';
37
- import { ModelElement } from './model.cjs';
38
41
  import { NodeElement } from './node.cjs';
39
42
  import { SceneElement } from './scene.cjs';
40
43
  import { SkyElement } from './sky.cjs';
@@ -47,6 +50,8 @@ declare global {
47
50
  scriptnamechange: ScriptNameChangeEvent;
48
51
  }
49
52
  interface HTMLElementTagNameMap {
53
+ 'pc-anim': AnimComponentElement;
54
+ 'pc-anim-clip': AnimClipElement;
50
55
  'pc-app': AppElement;
51
56
  'pc-asset': AssetElement;
52
57
  'pc-button': ButtonComponentElement;
@@ -56,29 +61,29 @@ declare global {
56
61
  'pc-entity': EntityElement;
57
62
  'pc-gsplat': GSplatComponentElement;
58
63
  'pc-joint': JointComponentElement;
59
- 'pc-layoutchild': LayoutChildComponentElement;
60
- 'pc-layoutgroup': LayoutGroupComponentElement;
64
+ 'pc-layout-child': LayoutChildComponentElement;
65
+ 'pc-layout-group': LayoutGroupComponentElement;
61
66
  'pc-light': LightComponentElement;
62
- 'pc-listener': ListenerComponentElement;
67
+ 'pc-audio-listener': AudioListenerComponentElement;
63
68
  'pc-material': MaterialElement;
64
69
  'pc-model': ModelElement;
65
- 'pc-module': ModuleElement;
70
+ 'pc-wasm': WasmElement;
66
71
  'pc-node': NodeElement;
67
- 'pc-particles': ParticleSystemComponentElement;
72
+ 'pc-particle-system': ParticleSystemComponentElement;
68
73
  'pc-render': RenderComponentElement;
69
- 'pc-rigidbody': RigidBodyComponentElement;
74
+ 'pc-rigid-body': RigidBodyComponentElement;
70
75
  'pc-scene': SceneElement;
71
76
  'pc-screen': ScreenComponentElement;
72
- 'pc-script': ScriptElement;
73
- 'pc-scripts': ScriptComponentElement;
77
+ 'pc-script-instance': ScriptInstanceElement;
78
+ 'pc-script': ScriptComponentElement;
74
79
  'pc-scrollbar': ScrollbarComponentElement;
75
- 'pc-scrollview': ScrollViewComponentElement;
80
+ 'pc-scroll-view': ScrollViewComponentElement;
76
81
  'pc-sky': SkyElement;
77
- 'pc-sound': SoundSlotElement;
78
- 'pc-sounds': SoundComponentElement;
82
+ 'pc-sound-slot': SoundSlotElement;
83
+ 'pc-sound': SoundComponentElement;
79
84
  }
80
85
  }
81
- export { AsyncElement, ModuleElement, AppElement, EntityElement, AssetElement, ButtonComponentElement, CameraComponentElement, CollisionComponentElement, ComponentElement, ElementComponentElement, JointComponentElement, LayoutChildComponentElement, LayoutGroupComponentElement, ParticleSystemComponentElement, LightComponentElement, ListenerComponentElement, RenderComponentElement, RigidBodyComponentElement, ScreenComponentElement, ScrollbarComponentElement, ScrollViewComponentElement, ScriptComponentElement, ScriptElement, SoundComponentElement, SoundSlotElement, GSplatComponentElement, EntityBaseElement, MaterialElement, ModelElement, NodeElement, SceneElement, SkyElement, whenReady };
86
+ export { AsyncElement, WasmElement, AppElement, EntityElement, AssetElement, AnimComponentElement, AnimClipElement, ButtonComponentElement, CameraComponentElement, CollisionComponentElement, ComponentElement, ElementComponentElement, JointComponentElement, LayoutChildComponentElement, LayoutGroupComponentElement, ParticleSystemComponentElement, LightComponentElement, AudioListenerComponentElement, RenderComponentElement, RigidBodyComponentElement, ScreenComponentElement, ScrollbarComponentElement, ScrollViewComponentElement, ScriptComponentElement, ScriptInstanceElement, SoundComponentElement, SoundSlotElement, GSplatComponentElement, EntityBaseElement, EntityOwnerElement, MaterialElement, ModelElement, NodeElement, SceneElement, SkyElement, whenReady };
82
87
  export type { AsyncElementTagName } from './async-element.cjs';
83
88
  export type { HierarchyMaterial, HierarchyNode } from './model.cjs';
84
89
  export type { MaterialOverrides } from './node.cjs';