@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
@@ -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-layoutchild/ | `<pc-layoutchild>`} elements.
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-layoutchild/ | `<pc-layoutchild>`} elements.
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-layoutgroup/ | `<pc-layoutgroup>`} elements.
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 {
@@ -3,10 +3,12 @@ import { Vec2, Vec4 } from 'playcanvas';
3
3
  import { ComponentElement } from './component.js';
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-layoutgroup/ | `<pc-layoutgroup>`} elements.
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 {
@@ -7,6 +7,8 @@ import { ComponentElement } from './component.cjs';
7
7
  * The LightComponentElement interface also inherits the properties and methods of the
8
8
  * {@link HTMLElement} interface.
9
9
  *
10
+ * Engine component: {@link LightComponent} (`light`).
11
+ *
10
12
  * @category Components
11
13
  */
12
14
  declare class LightComponentElement extends ComponentElement {
@@ -7,6 +7,8 @@ import { ComponentElement } from './component.js';
7
7
  * The LightComponentElement interface also inherits the properties and methods of the
8
8
  * {@link HTMLElement} interface.
9
9
  *
10
+ * Engine component: {@link LightComponent} (`light`).
11
+ *
10
12
  * @category Components
11
13
  */
12
14
  declare class LightComponentElement extends ComponentElement {
@@ -2,10 +2,12 @@ import type { ParticleSystemComponent } from 'playcanvas';
2
2
  import { ComponentElement } from './component.cjs';
3
3
  /**
4
4
  * The ParticleSystemComponentElement interface provides properties and methods for manipulating
5
- * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-particles/ | `<pc-particles>`} elements.
5
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-particle-system/ | `<pc-particle-system>`} elements.
6
6
  * The ParticleSystemComponentElement interface also inherits the properties and methods of the
7
7
  * {@link HTMLElement} interface.
8
8
  *
9
+ * Engine component: {@link ParticleSystemComponent} (`particlesystem`).
10
+ *
9
11
  * @category Components
10
12
  */
11
13
  declare class ParticleSystemComponentElement extends ComponentElement {
@@ -2,10 +2,12 @@ import type { ParticleSystemComponent } from 'playcanvas';
2
2
  import { ComponentElement } from './component.js';
3
3
  /**
4
4
  * The ParticleSystemComponentElement interface provides properties and methods for manipulating
5
- * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-particles/ | `<pc-particles>`} elements.
5
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-particle-system/ | `<pc-particle-system>`} elements.
6
6
  * The ParticleSystemComponentElement interface also inherits the properties and methods of the
7
7
  * {@link HTMLElement} interface.
8
8
  *
9
+ * Engine component: {@link ParticleSystemComponent} (`particlesystem`).
10
+ *
9
11
  * @category Components
10
12
  */
11
13
  declare class ParticleSystemComponentElement extends ComponentElement {
@@ -10,6 +10,8 @@ import { ComponentElement } from './component.cjs';
10
10
  * to `box`). It does not cover the engine's `asset` render type, since there is no way to supply
11
11
  * a render asset here — use `pc-model` for glTF content instead.
12
12
  *
13
+ * Engine component: {@link RenderComponent} (`render`).
14
+ *
13
15
  * @category Components
14
16
  */
15
17
  declare class RenderComponentElement extends ComponentElement {
@@ -10,6 +10,8 @@ import { ComponentElement } from './component.js';
10
10
  * to `box`). It does not cover the engine's `asset` render type, since there is no way to supply
11
11
  * a render asset here — use `pc-model` for glTF content instead.
12
12
  *
13
+ * Engine component: {@link RenderComponent} (`render`).
14
+ *
13
15
  * @category Components
14
16
  */
15
17
  declare class RenderComponentElement extends ComponentElement {
@@ -3,10 +3,12 @@ import { Vec3 } from 'playcanvas';
3
3
  import { ComponentElement } from './component.cjs';
4
4
  /**
5
5
  * The RigidBodyComponentElement interface provides properties and methods for manipulating
6
- * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-rigidbody/ | `<pc-rigidbody>`} elements.
6
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-rigid-body/ | `<pc-rigid-body>`} elements.
7
7
  * The RigidBodyComponentElement interface also inherits the properties and methods of the
8
8
  * {@link HTMLElement} interface.
9
9
  *
10
+ * Engine component: {@link RigidBodyComponent} (`rigidbody`).
11
+ *
10
12
  * @category Components
11
13
  */
12
14
  declare class RigidBodyComponentElement extends ComponentElement {
@@ -3,10 +3,12 @@ import { Vec3 } from 'playcanvas';
3
3
  import { ComponentElement } from './component.js';
4
4
  /**
5
5
  * The RigidBodyComponentElement interface provides properties and methods for manipulating
6
- * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-rigidbody/ | `<pc-rigidbody>`} elements.
6
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-rigid-body/ | `<pc-rigid-body>`} elements.
7
7
  * The RigidBodyComponentElement interface also inherits the properties and methods of the
8
8
  * {@link HTMLElement} interface.
9
9
  *
10
+ * Engine component: {@link RigidBodyComponent} (`rigidbody`).
11
+ *
10
12
  * @category Components
11
13
  */
12
14
  declare class RigidBodyComponentElement extends ComponentElement {
@@ -7,6 +7,8 @@ import { ComponentElement } from './component.cjs';
7
7
  * The ScreenComponentElement interface also inherits the properties and methods of the
8
8
  * {@link HTMLElement} interface.
9
9
  *
10
+ * Engine component: {@link ScreenComponent} (`screen`).
11
+ *
10
12
  * @category Components
11
13
  */
12
14
  declare class ScreenComponentElement extends ComponentElement {
@@ -7,6 +7,8 @@ import { ComponentElement } from './component.js';
7
7
  * The ScreenComponentElement interface also inherits the properties and methods of the
8
8
  * {@link HTMLElement} interface.
9
9
  *
10
+ * Engine component: {@link ScreenComponent} (`screen`).
11
+ *
10
12
  * @category Components
11
13
  */
12
14
  declare class ScreenComponentElement extends ComponentElement {
@@ -18,10 +18,12 @@ export type ScriptNameChangeEvent = {
18
18
  } & CustomEvent;
19
19
  /**
20
20
  * The ScriptComponentElement interface provides properties and methods for manipulating
21
- * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-scripts/ | `<pc-scripts>`} elements.
21
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-script/ | `<pc-script>`} elements.
22
22
  * The ScriptComponentElement interface also inherits the properties and methods of the
23
23
  * {@link HTMLElement} interface.
24
24
  *
25
+ * Engine component: {@link ScriptComponent} (`script`).
26
+ *
25
27
  * @category Components
26
28
  */
27
29
  declare class ScriptComponentElement extends ComponentElement {
@@ -84,24 +86,24 @@ declare class ScriptComponentElement extends ComponentElement {
84
86
  */
85
87
  private applyAttributes;
86
88
  /**
87
- * Returns the camelCase keys of the per-property attributes present on a `pc-script`
89
+ * Returns the camelCase keys of the per-property attributes present on a `pc-script-instance`
88
90
  * element.
89
- * @param scriptElement - The `pc-script` element.
91
+ * @param scriptElement - The `pc-script-instance` element.
90
92
  * @returns The camelCase keys.
91
93
  */
92
94
  private inlineKeys;
93
95
  /**
94
- * Resolves the script instance owned by a `pc-script` element. Returns `null` when the
96
+ * Resolves the script instance owned by a `pc-script-instance` element. Returns `null` when the
95
97
  * element has no created script, or when its name resolves to a script created by a
96
98
  * different element (e.g. a duplicate-named sibling).
97
- * @param scriptElement - The `pc-script` element.
99
+ * @param scriptElement - The `pc-script-instance` element.
98
100
  * @returns The owned script, or `null`.
99
101
  */
100
102
  private scriptFor;
101
103
  private handleScriptAttributesChange;
102
104
  private handleScriptEnableChange;
103
105
  /**
104
- * Handles a runtime `name` change on a child `pc-script`, swapping the engine script instance
106
+ * Handles a runtime `name` change on a child `pc-script-instance`, swapping the engine script instance
105
107
  * to match. Without this the element would keep pointing at the old-name instance: the old
106
108
  * script would go on running while every subsequent update (attribute changes, enable
107
109
  * changes, destruction on removal) resolved the new name and silently no-opped.
@@ -112,28 +114,37 @@ declare class ScriptComponentElement extends ComponentElement {
112
114
  */
113
115
  private handleScriptNameChange;
114
116
  /**
115
- * Creates the script instance for a `pc-script` element. The instance is created disabled,
117
+ * Creates the script instance for a `pc-script-instance` element. The instance is created disabled,
116
118
  * the element's converted attributes are merged over the instance's defaults (which is what
117
119
  * allows plain numeric arrays to be typed against those defaults), and only then is the
118
120
  * declared enabled state applied — so `initialize()` runs with every attribute in place.
119
- * @param scriptElement - The `pc-script` element to create the script instance for.
121
+ * @param scriptElement - The `pc-script-instance` element to create the script instance for.
120
122
  * @returns The created script, or `null`.
121
123
  */
122
124
  private createScript;
123
125
  /**
124
- * Applies the per-property attributes present on a `pc-script` element any attribute that
126
+ * Applies a `pc-script-instance` element's declared state to a script instance: the `attributes` JSON
127
+ * first with per-property-shadowed keys stripped, then the per-property attributes — each
128
+ * property is written exactly once and individual attributes win — and finally the declared
129
+ * enabled state, so `initialize()` runs with every attribute in place.
130
+ * @param script - The script instance.
131
+ * @param scriptElement - The `pc-script-instance` element holding the declared state.
132
+ */
133
+ private applyDeclaredState;
134
+ /**
135
+ * Applies the per-property attributes present on a `pc-script-instance` element — any attribute that
125
136
  * is not part of the element's own API or a reserved HTML attribute name. These are applied
126
137
  * after the `attributes` JSON, so an individual attribute always takes precedence over the
127
138
  * blob.
128
139
  * @param script - The script to apply the attributes to.
129
- * @param scriptElement - The `pc-script` element holding the attributes.
140
+ * @param scriptElement - The `pc-script-instance` element holding the attributes.
130
141
  */
131
142
  private applyInlineAttributes;
132
143
  /**
133
- * Applies a single per-property attribute change to the script of a `pc-script` element.
144
+ * Applies a single per-property attribute change to the script of a `pc-script-instance` element.
134
145
  * When the attribute has been removed, the value from the `attributes` JSON (if any) takes
135
146
  * effect again.
136
- * @param scriptElement - The `pc-script` element whose attribute changed.
147
+ * @param scriptElement - The `pc-script-instance` element whose attribute changed.
137
148
  * @param attributeName - The name of the changed attribute.
138
149
  */
139
150
  private applyScriptProperty;
@@ -18,10 +18,12 @@ export type ScriptNameChangeEvent = {
18
18
  } & CustomEvent;
19
19
  /**
20
20
  * The ScriptComponentElement interface provides properties and methods for manipulating
21
- * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-scripts/ | `<pc-scripts>`} elements.
21
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-script/ | `<pc-script>`} elements.
22
22
  * The ScriptComponentElement interface also inherits the properties and methods of the
23
23
  * {@link HTMLElement} interface.
24
24
  *
25
+ * Engine component: {@link ScriptComponent} (`script`).
26
+ *
25
27
  * @category Components
26
28
  */
27
29
  declare class ScriptComponentElement extends ComponentElement {
@@ -84,24 +86,24 @@ declare class ScriptComponentElement extends ComponentElement {
84
86
  */
85
87
  private applyAttributes;
86
88
  /**
87
- * Returns the camelCase keys of the per-property attributes present on a `pc-script`
89
+ * Returns the camelCase keys of the per-property attributes present on a `pc-script-instance`
88
90
  * element.
89
- * @param scriptElement - The `pc-script` element.
91
+ * @param scriptElement - The `pc-script-instance` element.
90
92
  * @returns The camelCase keys.
91
93
  */
92
94
  private inlineKeys;
93
95
  /**
94
- * Resolves the script instance owned by a `pc-script` element. Returns `null` when the
96
+ * Resolves the script instance owned by a `pc-script-instance` element. Returns `null` when the
95
97
  * element has no created script, or when its name resolves to a script created by a
96
98
  * different element (e.g. a duplicate-named sibling).
97
- * @param scriptElement - The `pc-script` element.
99
+ * @param scriptElement - The `pc-script-instance` element.
98
100
  * @returns The owned script, or `null`.
99
101
  */
100
102
  private scriptFor;
101
103
  private handleScriptAttributesChange;
102
104
  private handleScriptEnableChange;
103
105
  /**
104
- * Handles a runtime `name` change on a child `pc-script`, swapping the engine script instance
106
+ * Handles a runtime `name` change on a child `pc-script-instance`, swapping the engine script instance
105
107
  * to match. Without this the element would keep pointing at the old-name instance: the old
106
108
  * script would go on running while every subsequent update (attribute changes, enable
107
109
  * changes, destruction on removal) resolved the new name and silently no-opped.
@@ -112,28 +114,37 @@ declare class ScriptComponentElement extends ComponentElement {
112
114
  */
113
115
  private handleScriptNameChange;
114
116
  /**
115
- * Creates the script instance for a `pc-script` element. The instance is created disabled,
117
+ * Creates the script instance for a `pc-script-instance` element. The instance is created disabled,
116
118
  * the element's converted attributes are merged over the instance's defaults (which is what
117
119
  * allows plain numeric arrays to be typed against those defaults), and only then is the
118
120
  * declared enabled state applied — so `initialize()` runs with every attribute in place.
119
- * @param scriptElement - The `pc-script` element to create the script instance for.
121
+ * @param scriptElement - The `pc-script-instance` element to create the script instance for.
120
122
  * @returns The created script, or `null`.
121
123
  */
122
124
  private createScript;
123
125
  /**
124
- * Applies the per-property attributes present on a `pc-script` element any attribute that
126
+ * Applies a `pc-script-instance` element's declared state to a script instance: the `attributes` JSON
127
+ * first with per-property-shadowed keys stripped, then the per-property attributes — each
128
+ * property is written exactly once and individual attributes win — and finally the declared
129
+ * enabled state, so `initialize()` runs with every attribute in place.
130
+ * @param script - The script instance.
131
+ * @param scriptElement - The `pc-script-instance` element holding the declared state.
132
+ */
133
+ private applyDeclaredState;
134
+ /**
135
+ * Applies the per-property attributes present on a `pc-script-instance` element — any attribute that
125
136
  * is not part of the element's own API or a reserved HTML attribute name. These are applied
126
137
  * after the `attributes` JSON, so an individual attribute always takes precedence over the
127
138
  * blob.
128
139
  * @param script - The script to apply the attributes to.
129
- * @param scriptElement - The `pc-script` element holding the attributes.
140
+ * @param scriptElement - The `pc-script-instance` element holding the attributes.
130
141
  */
131
142
  private applyInlineAttributes;
132
143
  /**
133
- * Applies a single per-property attribute change to the script of a `pc-script` element.
144
+ * Applies a single per-property attribute change to the script of a `pc-script-instance` element.
134
145
  * When the attribute has been removed, the value from the `attributes` JSON (if any) takes
135
146
  * effect again.
136
- * @param scriptElement - The `pc-script` element whose attribute changed.
147
+ * @param scriptElement - The `pc-script-instance` element whose attribute changed.
137
148
  * @param attributeName - The name of the changed attribute.
138
149
  */
139
150
  private applyScriptProperty;
@@ -1,8 +1,8 @@
1
1
  import type { Script } from 'playcanvas';
2
2
  import { AsyncElement } from '../async-element.cjs';
3
3
  /**
4
- * The ScriptElement interface provides properties and methods for manipulating
5
- * `<pc-script>` elements. The ScriptElement interface also inherits the properties and
4
+ * The ScriptInstanceElement interface provides properties and methods for manipulating
5
+ * `<pc-script-instance>` elements. The ScriptInstanceElement interface also inherits the properties and
6
6
  * methods of the {@link AsyncElement} interface.
7
7
  *
8
8
  * Script attributes can be supplied through two channels:
@@ -24,7 +24,7 @@ import { AsyncElement } from '../async-element.cjs';
24
24
  * new-name one, re-applying both attribute channels to it.
25
25
  *
26
26
  * The element becomes ready once its script instance has been created by the parent
27
- * `<pc-scripts>` element.
27
+ * `<pc-script>` element.
28
28
  *
29
29
  * @fires {CustomEvent} scriptattributeschange - Fired when the script's attributes change. The
30
30
  * `detail` carries the new `attributes` object. Bubbles.
@@ -33,7 +33,7 @@ import { AsyncElement } from '../async-element.cjs';
33
33
  * @fires {CustomEvent} scriptnamechange - Fired when the script is renamed on a live element. The
34
34
  * `detail` carries `oldName` and `newName`. Bubbles.
35
35
  */
36
- declare class ScriptElement extends AsyncElement {
36
+ declare class ScriptInstanceElement extends AsyncElement {
37
37
  private _attributes;
38
38
  private _enabled;
39
39
  /**
@@ -62,11 +62,11 @@ declare class ScriptElement extends AsyncElement {
62
62
  get enabled(): boolean;
63
63
  /**
64
64
  * Sets the name of the script to create. The `name` attribute is the single source of truth
65
- * (it is what the parent `<pc-scripts>` element reads when creating the instance), so the
65
+ * (it is what the parent `<pc-script>` element reads when creating the instance), so the
66
66
  * property writes through to it — assigning before insertion works as expected:
67
67
  *
68
68
  * ```js
69
- * const script = document.createElement('pc-script');
69
+ * const script = document.createElement('pc-script-instance');
70
70
  * script.name = 'rotate';
71
71
  * scriptsElement.appendChild(script);
72
72
  * await script.ready();
@@ -91,4 +91,4 @@ declare class ScriptElement extends AsyncElement {
91
91
  static get observedAttributes(): string[];
92
92
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
93
93
  }
94
- export { ScriptElement };
94
+ export { ScriptInstanceElement };
@@ -1,8 +1,8 @@
1
1
  import type { Script } from 'playcanvas';
2
2
  import { AsyncElement } from '../async-element.js';
3
3
  /**
4
- * The ScriptElement interface provides properties and methods for manipulating
5
- * `<pc-script>` elements. The ScriptElement interface also inherits the properties and
4
+ * The ScriptInstanceElement interface provides properties and methods for manipulating
5
+ * `<pc-script-instance>` elements. The ScriptInstanceElement interface also inherits the properties and
6
6
  * methods of the {@link AsyncElement} interface.
7
7
  *
8
8
  * Script attributes can be supplied through two channels:
@@ -24,7 +24,7 @@ import { AsyncElement } from '../async-element.js';
24
24
  * new-name one, re-applying both attribute channels to it.
25
25
  *
26
26
  * The element becomes ready once its script instance has been created by the parent
27
- * `<pc-scripts>` element.
27
+ * `<pc-script>` element.
28
28
  *
29
29
  * @fires {CustomEvent} scriptattributeschange - Fired when the script's attributes change. The
30
30
  * `detail` carries the new `attributes` object. Bubbles.
@@ -33,7 +33,7 @@ import { AsyncElement } from '../async-element.js';
33
33
  * @fires {CustomEvent} scriptnamechange - Fired when the script is renamed on a live element. The
34
34
  * `detail` carries `oldName` and `newName`. Bubbles.
35
35
  */
36
- declare class ScriptElement extends AsyncElement {
36
+ declare class ScriptInstanceElement extends AsyncElement {
37
37
  private _attributes;
38
38
  private _enabled;
39
39
  /**
@@ -62,11 +62,11 @@ declare class ScriptElement extends AsyncElement {
62
62
  get enabled(): boolean;
63
63
  /**
64
64
  * Sets the name of the script to create. The `name` attribute is the single source of truth
65
- * (it is what the parent `<pc-scripts>` element reads when creating the instance), so the
65
+ * (it is what the parent `<pc-script>` element reads when creating the instance), so the
66
66
  * property writes through to it — assigning before insertion works as expected:
67
67
  *
68
68
  * ```js
69
- * const script = document.createElement('pc-script');
69
+ * const script = document.createElement('pc-script-instance');
70
70
  * script.name = 'rotate';
71
71
  * scriptsElement.appendChild(script);
72
72
  * await script.ready();
@@ -91,4 +91,4 @@ declare class ScriptElement extends AsyncElement {
91
91
  static get observedAttributes(): string[];
92
92
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
93
93
  }
94
- export { ScriptElement };
94
+ export { ScriptInstanceElement };
@@ -3,10 +3,12 @@ import { Vec2 } from 'playcanvas';
3
3
  import { ComponentElement } from './component.cjs';
4
4
  /**
5
5
  * The ScrollViewComponentElement interface provides properties and methods for manipulating
6
- * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-scrollview/ | `<pc-scrollview>`} elements.
6
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-scroll-view/ | `<pc-scroll-view>`} elements.
7
7
  * The ScrollViewComponentElement interface also inherits the properties and methods of the
8
8
  * {@link HTMLElement} interface.
9
9
  *
10
+ * Engine component: {@link ScrollViewComponent} (`scrollview`).
11
+ *
10
12
  * @category Components
11
13
  */
12
14
  declare class ScrollViewComponentElement extends ComponentElement {
@@ -3,10 +3,12 @@ import { Vec2 } from 'playcanvas';
3
3
  import { ComponentElement } from './component.js';
4
4
  /**
5
5
  * The ScrollViewComponentElement interface provides properties and methods for manipulating
6
- * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-scrollview/ | `<pc-scrollview>`} elements.
6
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-scroll-view/ | `<pc-scroll-view>`} elements.
7
7
  * The ScrollViewComponentElement interface also inherits the properties and methods of the
8
8
  * {@link HTMLElement} interface.
9
9
  *
10
+ * Engine component: {@link ScrollViewComponent} (`scrollview`).
11
+ *
10
12
  * @category Components
11
13
  */
12
14
  declare class ScrollViewComponentElement extends ComponentElement {
@@ -6,6 +6,8 @@ import { ComponentElement } from './component.cjs';
6
6
  * The ScrollbarComponentElement interface also inherits the properties and methods of the
7
7
  * {@link HTMLElement} interface.
8
8
  *
9
+ * Engine component: {@link ScrollbarComponent} (`scrollbar`).
10
+ *
9
11
  * @category Components
10
12
  */
11
13
  declare class ScrollbarComponentElement extends ComponentElement {
@@ -6,6 +6,8 @@ import { ComponentElement } from './component.js';
6
6
  * The ScrollbarComponentElement interface also inherits the properties and methods of the
7
7
  * {@link HTMLElement} interface.
8
8
  *
9
+ * Engine component: {@link ScrollbarComponent} (`scrollbar`).
10
+ *
9
11
  * @category Components
10
12
  */
11
13
  declare class ScrollbarComponentElement extends ComponentElement {
@@ -2,10 +2,12 @@ import type { SoundComponent } from 'playcanvas';
2
2
  import { ComponentElement } from './component.cjs';
3
3
  /**
4
4
  * The SoundComponentElement interface provides properties and methods for manipulating
5
- * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-sounds/ | `<pc-sounds>`} elements.
5
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-sound/ | `<pc-sound>`} elements.
6
6
  * The SoundComponentElement interface also inherits the properties and methods of the
7
7
  * {@link HTMLElement} interface.
8
8
  *
9
+ * Engine component: {@link SoundComponent} (`sound`).
10
+ *
9
11
  * @category Components
10
12
  */
11
13
  declare class SoundComponentElement extends ComponentElement {
@@ -2,10 +2,12 @@ import type { SoundComponent } from 'playcanvas';
2
2
  import { ComponentElement } from './component.js';
3
3
  /**
4
4
  * The SoundComponentElement interface provides properties and methods for manipulating
5
- * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-sounds/ | `<pc-sounds>`} elements.
5
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-sound/ | `<pc-sound>`} elements.
6
6
  * The SoundComponentElement interface also inherits the properties and methods of the
7
7
  * {@link HTMLElement} interface.
8
8
  *
9
+ * Engine component: {@link SoundComponent} (`sound`).
10
+ *
9
11
  * @category Components
10
12
  */
11
13
  declare class SoundComponentElement extends ComponentElement {
@@ -3,7 +3,7 @@ import { AsyncElement } from '../async-element.cjs';
3
3
  import { SoundComponentElement } from './sound-component.cjs';
4
4
  /**
5
5
  * The SoundSlotElement interface provides properties and methods for manipulating
6
- * `<pc-sound>` elements. The SoundSlotElement interface also inherits the properties and
6
+ * `<pc-sound-slot>` elements. The SoundSlotElement interface also inherits the properties and
7
7
  * methods of the {@link AsyncElement} interface.
8
8
  */
9
9
  declare class SoundSlotElement extends AsyncElement {
@@ -17,7 +17,7 @@ declare class SoundSlotElement extends AsyncElement {
17
17
  private _startTime;
18
18
  private _volume;
19
19
  /**
20
- * The `<pc-sounds>` this slot was added to, captured at connect time.
20
+ * The `<pc-sound>` this slot was added to, captured at connect time.
21
21
  *
22
22
  * `disconnectedCallback` cannot rediscover it: by the time the element is disconnected its
23
23
  * `parentElement` is already `null`, so a lookup would both fail to find the component and
@@ -3,7 +3,7 @@ import { AsyncElement } from '../async-element.js';
3
3
  import { SoundComponentElement } from './sound-component.js';
4
4
  /**
5
5
  * The SoundSlotElement interface provides properties and methods for manipulating
6
- * `<pc-sound>` elements. The SoundSlotElement interface also inherits the properties and
6
+ * `<pc-sound-slot>` elements. The SoundSlotElement interface also inherits the properties and
7
7
  * methods of the {@link AsyncElement} interface.
8
8
  */
9
9
  declare class SoundSlotElement extends AsyncElement {
@@ -17,7 +17,7 @@ declare class SoundSlotElement extends AsyncElement {
17
17
  private _startTime;
18
18
  private _volume;
19
19
  /**
20
- * The `<pc-sounds>` this slot was added to, captured at connect time.
20
+ * The `<pc-sound>` this slot was added to, captured at connect time.
21
21
  *
22
22
  * `disconnectedCallback` cannot rediscover it: by the time the element is disconnected its
23
23
  * `parentElement` is already `null`, so a lookup would both fail to find the component and