@playcanvas/web-components 0.19.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/app.d.cts +5 -99
  2. package/dist/app.d.ts +5 -99
  3. package/dist/asset-binding.d.cts +1 -0
  4. package/dist/asset-binding.d.ts +1 -0
  5. package/dist/components/anim-clip.d.cts +8 -10
  6. package/dist/components/anim-clip.d.ts +8 -10
  7. package/dist/components/anim-component.d.cts +5 -4
  8. package/dist/components/anim-component.d.ts +5 -4
  9. package/dist/components/audio-listener-component.d.cts +5 -4
  10. package/dist/components/audio-listener-component.d.ts +5 -4
  11. package/dist/components/button-component.d.cts +14 -9
  12. package/dist/components/button-component.d.ts +14 -9
  13. package/dist/components/camera-component.d.cts +5 -4
  14. package/dist/components/camera-component.d.ts +5 -4
  15. package/dist/components/collision-component.d.cts +5 -4
  16. package/dist/components/collision-component.d.ts +5 -4
  17. package/dist/components/component.d.cts +2 -2
  18. package/dist/components/component.d.ts +2 -2
  19. package/dist/components/element-component.d.cts +5 -4
  20. package/dist/components/element-component.d.ts +5 -4
  21. package/dist/components/gsplat-component.d.cts +5 -4
  22. package/dist/components/gsplat-component.d.ts +5 -4
  23. package/dist/components/joint-component.d.cts +29 -14
  24. package/dist/components/joint-component.d.ts +29 -14
  25. package/dist/components/layout-child-component.d.cts +5 -4
  26. package/dist/components/layout-child-component.d.ts +5 -4
  27. package/dist/components/layout-group-component.d.cts +5 -4
  28. package/dist/components/layout-group-component.d.ts +5 -4
  29. package/dist/components/light-component.d.cts +5 -4
  30. package/dist/components/light-component.d.ts +5 -4
  31. package/dist/components/particle-system-component.d.cts +22 -5
  32. package/dist/components/particle-system-component.d.ts +22 -5
  33. package/dist/components/render-component.d.cts +5 -4
  34. package/dist/components/render-component.d.ts +5 -4
  35. package/dist/components/rigid-body-component.d.cts +5 -4
  36. package/dist/components/rigid-body-component.d.ts +5 -4
  37. package/dist/components/screen-component.d.cts +5 -4
  38. package/dist/components/screen-component.d.ts +5 -4
  39. package/dist/components/script-component.d.cts +9 -6
  40. package/dist/components/script-component.d.ts +9 -6
  41. package/dist/components/script-instance.d.cts +14 -6
  42. package/dist/components/script-instance.d.ts +14 -6
  43. package/dist/components/scroll-view-component.d.cts +29 -16
  44. package/dist/components/scroll-view-component.d.ts +29 -16
  45. package/dist/components/scrollbar-component.d.cts +11 -7
  46. package/dist/components/scrollbar-component.d.ts +11 -7
  47. package/dist/components/sound-component.d.cts +5 -4
  48. package/dist/components/sound-component.d.ts +5 -4
  49. package/dist/custom-elements.json +59 -59
  50. package/dist/entity-reference.d.cts +13 -0
  51. package/dist/entity-reference.d.ts +13 -0
  52. package/dist/material.d.cts +8 -6
  53. package/dist/material.d.ts +8 -6
  54. package/dist/model.d.cts +8 -9
  55. package/dist/model.d.ts +8 -9
  56. package/dist/parse.d.cts +0 -3
  57. package/dist/parse.d.ts +0 -3
  58. package/dist/pointer-controller.d.cts +1 -0
  59. package/dist/pointer-controller.d.ts +1 -0
  60. package/dist/pwc.cjs +1085 -633
  61. package/dist/pwc.cjs.map +1 -1
  62. package/dist/pwc.js +1085 -633
  63. package/dist/pwc.js.map +1 -1
  64. package/dist/pwc.min.js +1 -1
  65. package/dist/pwc.min.js.map +1 -1
  66. package/dist/pwc.min.mjs +1 -1
  67. package/dist/pwc.min.mjs.map +1 -1
  68. package/dist/pwc.mjs +1086 -634
  69. package/dist/pwc.mjs.map +1 -1
  70. package/dist/sky.d.cts +6 -7
  71. package/dist/sky.d.ts +6 -7
  72. package/dist/vscode.html-custom-data.json +10 -10
  73. package/dist/web-types.json +58 -58
  74. package/package.json +3 -3
  75. package/src/app.ts +16 -416
  76. package/src/asset-binding.ts +141 -0
  77. package/src/components/anim-clip.ts +22 -45
  78. package/src/components/anim-component.ts +10 -6
  79. package/src/components/audio-listener-component.ts +6 -5
  80. package/src/components/button-component.ts +25 -15
  81. package/src/components/camera-component.ts +6 -5
  82. package/src/components/collision-component.ts +6 -5
  83. package/src/components/component.ts +6 -4
  84. package/src/components/element-component.ts +6 -5
  85. package/src/components/gsplat-component.ts +6 -5
  86. package/src/components/joint-component.ts +36 -20
  87. package/src/components/layout-child-component.ts +6 -5
  88. package/src/components/layout-group-component.ts +6 -5
  89. package/src/components/light-component.ts +6 -5
  90. package/src/components/particle-system-component.ts +56 -30
  91. package/src/components/render-component.ts +6 -5
  92. package/src/components/rigid-body-component.ts +6 -5
  93. package/src/components/screen-component.ts +6 -5
  94. package/src/components/script-component.ts +28 -17
  95. package/src/components/script-instance.ts +14 -6
  96. package/src/components/scroll-view-component.ts +56 -34
  97. package/src/components/scrollbar-component.ts +20 -13
  98. package/src/components/sound-component.ts +6 -5
  99. package/src/entity-reference.ts +237 -0
  100. package/src/material.ts +25 -29
  101. package/src/model.ts +24 -48
  102. package/src/parse.ts +0 -35
  103. package/src/pointer-controller.ts +550 -0
  104. package/src/sky.ts +19 -30
@@ -5,7 +5,7 @@ import { AsyncElement } from '../async-element.cjs';
5
5
  *
6
6
  * @category Components
7
7
  */
8
- declare class ComponentElement extends AsyncElement {
8
+ declare class ComponentElement<T extends Component = Component> extends AsyncElement {
9
9
  private _componentName;
10
10
  private _enabled;
11
11
  private _component;
@@ -66,7 +66,7 @@ declare class ComponentElement extends AsyncElement {
66
66
  * before accessing it.
67
67
  * @returns The component instance, or `null`.
68
68
  */
69
- get component(): Component | null;
69
+ get component(): T | null;
70
70
  /**
71
71
  * Sets the enabled state of the component.
72
72
  * @param value - The enabled state of the component.
@@ -5,7 +5,7 @@ import { AsyncElement } from '../async-element.js';
5
5
  *
6
6
  * @category Components
7
7
  */
8
- declare class ComponentElement extends AsyncElement {
8
+ declare class ComponentElement<T extends Component = Component> extends AsyncElement {
9
9
  private _componentName;
10
10
  private _enabled;
11
11
  private _component;
@@ -66,7 +66,7 @@ declare class ComponentElement extends AsyncElement {
66
66
  * before accessing it.
67
67
  * @returns The component instance, or `null`.
68
68
  */
69
- get component(): Component | null;
69
+ get component(): T | null;
70
70
  /**
71
71
  * Sets the enabled state of the component.
72
72
  * @param value - The enabled state of the component.
@@ -20,7 +20,7 @@ import { ComponentElement } from './component.cjs';
20
20
  *
21
21
  * @category Components
22
22
  */
23
- declare class ElementComponentElement extends ComponentElement {
23
+ declare class ElementComponentElement extends ComponentElement<ElementComponent> {
24
24
  private _anchor;
25
25
  private _autoWidth;
26
26
  private _autoHeight;
@@ -52,10 +52,11 @@ declare class ElementComponentElement extends ComponentElement {
52
52
  protected initComponent(): void;
53
53
  protected getInitialComponentData(): Record<string, any>;
54
54
  /**
55
- * Gets the underlying PlayCanvas element component.
56
- * @returns The element component.
55
+ * Gets the underlying PlayCanvas element component. `null` until the element is
56
+ * ready see {@link ComponentElement.component}.
57
+ * @returns The element component, or `null`.
57
58
  */
58
- get component(): ElementComponent;
59
+ get component(): ElementComponent | null;
59
60
  /**
60
61
  * Sets the anchor of the element component.
61
62
  * @param value - The anchor.
@@ -20,7 +20,7 @@ import { ComponentElement } from './component.js';
20
20
  *
21
21
  * @category Components
22
22
  */
23
- declare class ElementComponentElement extends ComponentElement {
23
+ declare class ElementComponentElement extends ComponentElement<ElementComponent> {
24
24
  private _anchor;
25
25
  private _autoWidth;
26
26
  private _autoHeight;
@@ -52,10 +52,11 @@ declare class ElementComponentElement extends ComponentElement {
52
52
  protected initComponent(): void;
53
53
  protected getInitialComponentData(): Record<string, any>;
54
54
  /**
55
- * Gets the underlying PlayCanvas element component.
56
- * @returns The element component.
55
+ * Gets the underlying PlayCanvas element component. `null` until the element is
56
+ * ready see {@link ComponentElement.component}.
57
+ * @returns The element component, or `null`.
57
58
  */
58
- get component(): ElementComponent;
59
+ get component(): ElementComponent | null;
59
60
  /**
60
61
  * Sets the anchor of the element component.
61
62
  * @param value - The anchor.
@@ -14,7 +14,7 @@ import { ComponentElement } from './component.cjs';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class GSplatComponentElement extends ComponentElement {
17
+ declare class GSplatComponentElement extends ComponentElement<GSplatComponent> {
18
18
  private _asset;
19
19
  private _castShadows;
20
20
  private _lodBaseDistance;
@@ -32,10 +32,11 @@ declare class GSplatComponentElement extends ComponentElement {
32
32
  lodRangeMax: number;
33
33
  };
34
34
  /**
35
- * Gets the underlying PlayCanvas gsplat component.
36
- * @returns The gsplat component.
35
+ * Gets the underlying PlayCanvas gsplat component. `null` until the element is
36
+ * ready see {@link ComponentElement.component}.
37
+ * @returns The gsplat component, or `null`.
37
38
  */
38
- get component(): GSplatComponent;
39
+ get component(): GSplatComponent | null;
39
40
  /**
40
41
  * Sets id of the `pc-asset` to use for the splat.
41
42
  * @param value - The asset ID.
@@ -14,7 +14,7 @@ import { ComponentElement } from './component.js';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class GSplatComponentElement extends ComponentElement {
17
+ declare class GSplatComponentElement extends ComponentElement<GSplatComponent> {
18
18
  private _asset;
19
19
  private _castShadows;
20
20
  private _lodBaseDistance;
@@ -32,10 +32,11 @@ declare class GSplatComponentElement extends ComponentElement {
32
32
  lodRangeMax: number;
33
33
  };
34
34
  /**
35
- * Gets the underlying PlayCanvas gsplat component.
36
- * @returns The gsplat component.
35
+ * Gets the underlying PlayCanvas gsplat component. `null` until the element is
36
+ * ready see {@link ComponentElement.component}.
37
+ * @returns The gsplat component, or `null`.
37
38
  */
38
- get component(): GSplatComponent;
39
+ get component(): GSplatComponent | null;
39
40
  /**
40
41
  * Sets id of the `pc-asset` to use for the splat.
41
42
  * @param value - The asset ID.
@@ -19,7 +19,12 @@ export type MotionMode = 'locked' | 'limited' | 'free';
19
19
  * primary axis: a hinge rotates about it, a slider translates along it and a ball joint twists
20
20
  * about it. The constrained bodies are referenced by `entity-a` and `entity-b`, both of which need
21
21
  * a rigid body component; leaving `entity-b` empty constrains `entity-a` to a fixed point in world
22
- * space. The underlying engine component is in alpha, so its API may change.
22
+ * space. A reference can name any entity-fronting element `<pc-entity>`, `<pc-model>` or
23
+ * `<pc-node>`, so a ragdoll can join a model's own skeleton nodes by name — and a name resolves
24
+ * against the nearest enclosing entity first, then outward through the entity hierarchy, then the
25
+ * document, while a `#` selector resolves document-wide. A `<template>` prefab with one
26
+ * entity-fronting root can therefore wire its joints by name and stay self-contained when cloned.
27
+ * The underlying engine component is in alpha, so its API may change.
23
28
  *
24
29
  * @elementSummary The `<pc-joint>` element constrains two rigid bodies to each other — a hinged
25
30
  * door, a swinging chain, a sliding drawer. Its entity's transform is the joint frame, and
@@ -34,7 +39,7 @@ export type MotionMode = 'locked' | 'limited' | 'free';
34
39
  *
35
40
  * @category Components
36
41
  */
37
- declare class JointComponentElement extends ComponentElement {
42
+ declare class JointComponentElement extends ComponentElement<JointComponent> {
38
43
  /**
39
44
  * The spring damping of the joint per angular axis.
40
45
  */
@@ -192,10 +197,11 @@ declare class JointComponentElement extends ComponentElement {
192
197
  private _onBreak;
193
198
  protected initComponent(): void;
194
199
  /**
195
- * Gets the underlying PlayCanvas joint component.
196
- * @returns The joint component.
200
+ * Gets the underlying PlayCanvas joint component. `null` until the element is
201
+ * ready see {@link ComponentElement.component}.
202
+ * @returns The joint component, or `null`.
197
203
  */
198
- get component(): JointComponent;
204
+ get component(): JointComponent | null;
199
205
  /**
200
206
  * Sets the spring damping of a 6dof joint per angular axis, used on axes with a non-zero
201
207
  * angular-stiffness.
@@ -327,27 +333,36 @@ declare class JointComponentElement extends ComponentElement {
327
333
  */
328
334
  get enableLimits(): boolean;
329
335
  /**
330
- * Sets the reference (CSS selector, element id or entity name) to the `<pc-entity>` providing
331
- * the first constrained body. The reference resolves when it is set, so an entity created
332
- * later is picked up by setting the attribute again.
336
+ * Sets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
337
+ * selector) to the element providing the first constrained body. An exact name resolves
338
+ * against the nearest enclosing entity first, then outward, then the document. The reference
339
+ * resolves when it is set, so an entity created later is picked up by setting the attribute
340
+ * again. A non-empty reference that does not resolve warns, naming which of the two causes it
341
+ * hit.
333
342
  * @param value - The first body's entity reference.
334
343
  */
335
344
  set entityA(value: string);
336
345
  /**
337
- * Gets the reference to the `<pc-entity>` providing the first constrained body.
346
+ * Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
347
+ * selector) to the element providing the first constrained body.
338
348
  * @returns The first body's entity reference.
339
349
  */
340
350
  get entityA(): string;
341
351
  /**
342
- * Sets the reference (CSS selector, element id or entity name) to the `<pc-entity>` providing
343
- * the second constrained body, or empty to constrain the first body to a fixed point in world
344
- * space. The reference resolves when it is set, so an entity created later is picked up by
345
- * setting the attribute again.
352
+ * Sets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
353
+ * selector) to the element providing the second constrained body, or empty to constrain the
354
+ * first body to a fixed point in world space. An exact name resolves against the nearest
355
+ * enclosing entity first, then outward, then the document. The reference resolves when it is
356
+ * set, so an entity created later is picked up by setting the attribute again. A non-empty
357
+ * reference that does not resolve warns; an empty one is the documented world-space case and
358
+ * stays silent.
346
359
  * @param value - The second body's entity reference.
347
360
  */
348
361
  set entityB(value: string);
349
362
  /**
350
- * Gets the reference to the `<pc-entity>` providing the second constrained body.
363
+ * Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
364
+ * selector) to the element providing the second constrained body, or empty for the
365
+ * world-space case.
351
366
  * @returns The second body's entity reference.
352
367
  */
353
368
  get entityB(): string;
@@ -19,7 +19,12 @@ export type MotionMode = 'locked' | 'limited' | 'free';
19
19
  * primary axis: a hinge rotates about it, a slider translates along it and a ball joint twists
20
20
  * about it. The constrained bodies are referenced by `entity-a` and `entity-b`, both of which need
21
21
  * a rigid body component; leaving `entity-b` empty constrains `entity-a` to a fixed point in world
22
- * space. The underlying engine component is in alpha, so its API may change.
22
+ * space. A reference can name any entity-fronting element `<pc-entity>`, `<pc-model>` or
23
+ * `<pc-node>`, so a ragdoll can join a model's own skeleton nodes by name — and a name resolves
24
+ * against the nearest enclosing entity first, then outward through the entity hierarchy, then the
25
+ * document, while a `#` selector resolves document-wide. A `<template>` prefab with one
26
+ * entity-fronting root can therefore wire its joints by name and stay self-contained when cloned.
27
+ * The underlying engine component is in alpha, so its API may change.
23
28
  *
24
29
  * @elementSummary The `<pc-joint>` element constrains two rigid bodies to each other — a hinged
25
30
  * door, a swinging chain, a sliding drawer. Its entity's transform is the joint frame, and
@@ -34,7 +39,7 @@ export type MotionMode = 'locked' | 'limited' | 'free';
34
39
  *
35
40
  * @category Components
36
41
  */
37
- declare class JointComponentElement extends ComponentElement {
42
+ declare class JointComponentElement extends ComponentElement<JointComponent> {
38
43
  /**
39
44
  * The spring damping of the joint per angular axis.
40
45
  */
@@ -192,10 +197,11 @@ declare class JointComponentElement extends ComponentElement {
192
197
  private _onBreak;
193
198
  protected initComponent(): void;
194
199
  /**
195
- * Gets the underlying PlayCanvas joint component.
196
- * @returns The joint component.
200
+ * Gets the underlying PlayCanvas joint component. `null` until the element is
201
+ * ready see {@link ComponentElement.component}.
202
+ * @returns The joint component, or `null`.
197
203
  */
198
- get component(): JointComponent;
204
+ get component(): JointComponent | null;
199
205
  /**
200
206
  * Sets the spring damping of a 6dof joint per angular axis, used on axes with a non-zero
201
207
  * angular-stiffness.
@@ -327,27 +333,36 @@ declare class JointComponentElement extends ComponentElement {
327
333
  */
328
334
  get enableLimits(): boolean;
329
335
  /**
330
- * Sets the reference (CSS selector, element id or entity name) to the `<pc-entity>` providing
331
- * the first constrained body. The reference resolves when it is set, so an entity created
332
- * later is picked up by setting the attribute again.
336
+ * Sets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
337
+ * selector) to the element providing the first constrained body. An exact name resolves
338
+ * against the nearest enclosing entity first, then outward, then the document. The reference
339
+ * resolves when it is set, so an entity created later is picked up by setting the attribute
340
+ * again. A non-empty reference that does not resolve warns, naming which of the two causes it
341
+ * hit.
333
342
  * @param value - The first body's entity reference.
334
343
  */
335
344
  set entityA(value: string);
336
345
  /**
337
- * Gets the reference to the `<pc-entity>` providing the first constrained body.
346
+ * Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
347
+ * selector) to the element providing the first constrained body.
338
348
  * @returns The first body's entity reference.
339
349
  */
340
350
  get entityA(): string;
341
351
  /**
342
- * Sets the reference (CSS selector, element id or entity name) to the `<pc-entity>` providing
343
- * the second constrained body, or empty to constrain the first body to a fixed point in world
344
- * space. The reference resolves when it is set, so an entity created later is picked up by
345
- * setting the attribute again.
352
+ * Sets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
353
+ * selector) to the element providing the second constrained body, or empty to constrain the
354
+ * first body to a fixed point in world space. An exact name resolves against the nearest
355
+ * enclosing entity first, then outward, then the document. The reference resolves when it is
356
+ * set, so an entity created later is picked up by setting the attribute again. A non-empty
357
+ * reference that does not resolve warns; an empty one is the documented world-space case and
358
+ * stays silent.
346
359
  * @param value - The second body's entity reference.
347
360
  */
348
361
  set entityB(value: string);
349
362
  /**
350
- * Gets the reference to the `<pc-entity>` providing the second constrained body.
363
+ * Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
364
+ * selector) to the element providing the second constrained body, or empty for the
365
+ * world-space case.
351
366
  * @returns The second body's entity reference.
352
367
  */
353
368
  get entityB(): string;
@@ -14,7 +14,7 @@ import { ComponentElement } from './component.cjs';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class LayoutChildComponentElement extends ComponentElement {
17
+ declare class LayoutChildComponentElement extends ComponentElement<LayoutChildComponent> {
18
18
  private _minWidth;
19
19
  private _minHeight;
20
20
  private _maxWidth;
@@ -34,10 +34,11 @@ declare class LayoutChildComponentElement extends ComponentElement {
34
34
  excludeFromLayout: boolean;
35
35
  };
36
36
  /**
37
- * Gets the underlying PlayCanvas layout child component.
38
- * @returns The layout child component.
37
+ * Gets the underlying PlayCanvas layout child component. `null` until the element is
38
+ * ready see {@link ComponentElement.component}.
39
+ * @returns The layout child component, or `null`.
39
40
  */
40
- get component(): LayoutChildComponent;
41
+ get component(): LayoutChildComponent | null;
41
42
  /**
42
43
  * Sets the minimum width the element should be laid out with.
43
44
  * @param value - The minimum width.
@@ -14,7 +14,7 @@ import { ComponentElement } from './component.js';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class LayoutChildComponentElement extends ComponentElement {
17
+ declare class LayoutChildComponentElement extends ComponentElement<LayoutChildComponent> {
18
18
  private _minWidth;
19
19
  private _minHeight;
20
20
  private _maxWidth;
@@ -34,10 +34,11 @@ declare class LayoutChildComponentElement extends ComponentElement {
34
34
  excludeFromLayout: boolean;
35
35
  };
36
36
  /**
37
- * Gets the underlying PlayCanvas layout child component.
38
- * @returns The layout child component.
37
+ * Gets the underlying PlayCanvas layout child component. `null` until the element is
38
+ * ready see {@link ComponentElement.component}.
39
+ * @returns The layout child component, or `null`.
39
40
  */
40
- get component(): LayoutChildComponent;
41
+ get component(): LayoutChildComponent | null;
41
42
  /**
42
43
  * Sets the minimum width the element should be laid out with.
43
44
  * @param value - The minimum width.
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.cjs';
15
15
  *
16
16
  * @category Components
17
17
  */
18
- declare class LayoutGroupComponentElement extends ComponentElement {
18
+ declare class LayoutGroupComponentElement extends ComponentElement<LayoutGroupComponent> {
19
19
  private _orientation;
20
20
  private _reverseX;
21
21
  private _reverseY;
@@ -39,10 +39,11 @@ declare class LayoutGroupComponentElement extends ComponentElement {
39
39
  wrap: boolean;
40
40
  };
41
41
  /**
42
- * Gets the underlying PlayCanvas layout group component.
43
- * @returns The layout group component.
42
+ * Gets the underlying PlayCanvas layout group component. `null` until the element is
43
+ * ready see {@link ComponentElement.component}.
44
+ * @returns The layout group component, or `null`.
44
45
  */
45
- get component(): LayoutGroupComponent;
46
+ get component(): LayoutGroupComponent | null;
46
47
  /**
47
48
  * Sets the orientation of the layout group. Can be `horizontal` or `vertical`. Defaults to
48
49
  * `horizontal`.
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.js';
15
15
  *
16
16
  * @category Components
17
17
  */
18
- declare class LayoutGroupComponentElement extends ComponentElement {
18
+ declare class LayoutGroupComponentElement extends ComponentElement<LayoutGroupComponent> {
19
19
  private _orientation;
20
20
  private _reverseX;
21
21
  private _reverseY;
@@ -39,10 +39,11 @@ declare class LayoutGroupComponentElement extends ComponentElement {
39
39
  wrap: boolean;
40
40
  };
41
41
  /**
42
- * Gets the underlying PlayCanvas layout group component.
43
- * @returns The layout group component.
42
+ * Gets the underlying PlayCanvas layout group component. `null` until the element is
43
+ * ready see {@link ComponentElement.component}.
44
+ * @returns The layout group component, or `null`.
44
45
  */
45
- get component(): LayoutGroupComponent;
46
+ get component(): LayoutGroupComponent | null;
46
47
  /**
47
48
  * Sets the orientation of the layout group. Can be `horizontal` or `vertical`. Defaults to
48
49
  * `horizontal`.
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.cjs';
15
15
  *
16
16
  * @category Components
17
17
  */
18
- declare class LightComponentElement extends ComponentElement {
18
+ declare class LightComponentElement extends ComponentElement<LightComponent> {
19
19
  private _cascadeBlend;
20
20
  private _cascadeDistribution;
21
21
  private _castShadows;
@@ -65,10 +65,11 @@ declare class LightComponentElement extends ComponentElement {
65
65
  vsmBlurSize: number;
66
66
  };
67
67
  /**
68
- * Gets the underlying PlayCanvas light component.
69
- * @returns The light component.
68
+ * Gets the underlying PlayCanvas light component. `null` until the element is
69
+ * ready see {@link ComponentElement.component}.
70
+ * @returns The light component, or `null`.
70
71
  */
71
- get component(): LightComponent;
72
+ get component(): LightComponent | null;
72
73
  /**
73
74
  * Sets the fraction of each shadow cascade that is blended into the next one, from 0 (no
74
75
  * blending) to 1, which applies only to `directional` lights with `num-cascades` greater than
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.js';
15
15
  *
16
16
  * @category Components
17
17
  */
18
- declare class LightComponentElement extends ComponentElement {
18
+ declare class LightComponentElement extends ComponentElement<LightComponent> {
19
19
  private _cascadeBlend;
20
20
  private _cascadeDistribution;
21
21
  private _castShadows;
@@ -65,10 +65,11 @@ declare class LightComponentElement extends ComponentElement {
65
65
  vsmBlurSize: number;
66
66
  };
67
67
  /**
68
- * Gets the underlying PlayCanvas light component.
69
- * @returns The light component.
68
+ * Gets the underlying PlayCanvas light component. `null` until the element is
69
+ * ready see {@link ComponentElement.component}.
70
+ * @returns The light component, or `null`.
70
71
  */
71
- get component(): LightComponent;
72
+ get component(): LightComponent | null;
72
73
  /**
73
74
  * Sets the fraction of each shadow cascade that is blended into the next one, from 0 (no
74
75
  * blending) to 1, which applies only to `directional` lights with `num-cascades` greater than
@@ -14,18 +14,35 @@ import { ComponentElement } from './component.cjs';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class ParticleSystemComponentElement extends ComponentElement {
17
+ declare class ParticleSystemComponentElement extends ComponentElement<ParticleSystemComponent> {
18
18
  private _asset;
19
+ /**
20
+ * The subscription to the current config asset while its load is in flight. Rebinding
21
+ * supersedes it and disconnect cancels it, so a superseded config — an earlier asset that
22
+ * finishes loading after its replacement, or a callback left behind by a previous
23
+ * connection — can never configure the component.
24
+ */
25
+ private _binding;
19
26
  /** @ignore */
20
27
  constructor();
21
28
  protected getInitialComponentData(): object;
29
+ protected initComponent(): void;
30
+ disconnectedCallback(): void;
31
+ /**
32
+ * Gets the underlying PlayCanvas particle system component. `null` until the element is
33
+ * ready — see {@link ComponentElement.component}.
34
+ * @returns The particle system component, or `null`.
35
+ */
36
+ get component(): ParticleSystemComponent | null;
22
37
  /**
23
- * Gets the underlying PlayCanvas particle system component.
24
- * @returns The particle system component.
38
+ * Rewrites the config's `colorMapAsset` from the `pc-asset` id it is authored with to the
39
+ * engine asset id the component resolves, starting the texture's load if it is lazy. The
40
+ * rewrite is in place, so a config applied again — a host cycle, a reconnection — is already
41
+ * resolved and passes through unchanged.
25
42
  */
26
- get component(): ParticleSystemComponent;
43
+ private _resolveColorMap;
27
44
  private applyConfig;
28
- private _loadAsset;
45
+ private _bindConfig;
29
46
  /**
30
47
  * Sets the id of the `pc-asset` to use for the model.
31
48
  * @param value - The asset ID.
@@ -14,18 +14,35 @@ import { ComponentElement } from './component.js';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class ParticleSystemComponentElement extends ComponentElement {
17
+ declare class ParticleSystemComponentElement extends ComponentElement<ParticleSystemComponent> {
18
18
  private _asset;
19
+ /**
20
+ * The subscription to the current config asset while its load is in flight. Rebinding
21
+ * supersedes it and disconnect cancels it, so a superseded config — an earlier asset that
22
+ * finishes loading after its replacement, or a callback left behind by a previous
23
+ * connection — can never configure the component.
24
+ */
25
+ private _binding;
19
26
  /** @ignore */
20
27
  constructor();
21
28
  protected getInitialComponentData(): object;
29
+ protected initComponent(): void;
30
+ disconnectedCallback(): void;
31
+ /**
32
+ * Gets the underlying PlayCanvas particle system component. `null` until the element is
33
+ * ready — see {@link ComponentElement.component}.
34
+ * @returns The particle system component, or `null`.
35
+ */
36
+ get component(): ParticleSystemComponent | null;
22
37
  /**
23
- * Gets the underlying PlayCanvas particle system component.
24
- * @returns The particle system component.
38
+ * Rewrites the config's `colorMapAsset` from the `pc-asset` id it is authored with to the
39
+ * engine asset id the component resolves, starting the texture's load if it is lazy. The
40
+ * rewrite is in place, so a config applied again — a host cycle, a reconnection — is already
41
+ * resolved and passes through unchanged.
25
42
  */
26
- get component(): ParticleSystemComponent;
43
+ private _resolveColorMap;
27
44
  private applyConfig;
28
- private _loadAsset;
45
+ private _bindConfig;
29
46
  /**
30
47
  * Sets the id of the `pc-asset` to use for the model.
31
48
  * @param value - The asset ID.
@@ -19,7 +19,7 @@ import { ComponentElement } from './component.cjs';
19
19
  *
20
20
  * @category Components
21
21
  */
22
- declare class RenderComponentElement extends ComponentElement {
22
+ declare class RenderComponentElement extends ComponentElement<RenderComponent> {
23
23
  private _castShadows;
24
24
  private _material;
25
25
  private _receiveShadows;
@@ -33,10 +33,11 @@ declare class RenderComponentElement extends ComponentElement {
33
33
  receiveShadows: boolean;
34
34
  };
35
35
  /**
36
- * Gets the underlying PlayCanvas render component.
37
- * @returns The render component.
36
+ * Gets the underlying PlayCanvas render component. `null` until the element is
37
+ * ready see {@link ComponentElement.component}.
38
+ * @returns The render component, or `null`.
38
39
  */
39
- get component(): RenderComponent;
40
+ get component(): RenderComponent | null;
40
41
  /**
41
42
  * Sets the type of the render component.
42
43
  * @param value - The type.
@@ -19,7 +19,7 @@ import { ComponentElement } from './component.js';
19
19
  *
20
20
  * @category Components
21
21
  */
22
- declare class RenderComponentElement extends ComponentElement {
22
+ declare class RenderComponentElement extends ComponentElement<RenderComponent> {
23
23
  private _castShadows;
24
24
  private _material;
25
25
  private _receiveShadows;
@@ -33,10 +33,11 @@ declare class RenderComponentElement extends ComponentElement {
33
33
  receiveShadows: boolean;
34
34
  };
35
35
  /**
36
- * Gets the underlying PlayCanvas render component.
37
- * @returns The render component.
36
+ * Gets the underlying PlayCanvas render component. `null` until the element is
37
+ * ready see {@link ComponentElement.component}.
38
+ * @returns The render component, or `null`.
38
39
  */
39
- get component(): RenderComponent;
40
+ get component(): RenderComponent | null;
40
41
  /**
41
42
  * Sets the type of the render component.
42
43
  * @param value - The type.
@@ -16,7 +16,7 @@ import { ComponentElement } from './component.cjs';
16
16
  *
17
17
  * @category Components
18
18
  */
19
- declare class RigidBodyComponentElement extends ComponentElement {
19
+ declare class RigidBodyComponentElement extends ComponentElement<RigidBodyComponent> {
20
20
  /**
21
21
  * The angular damping of the rigidbody.
22
22
  */
@@ -67,10 +67,11 @@ declare class RigidBodyComponentElement extends ComponentElement {
67
67
  type: "static" | "dynamic" | "kinematic";
68
68
  };
69
69
  /**
70
- * Gets the underlying PlayCanvas rigidbody component.
71
- * @returns The rigidbody component.
70
+ * Gets the underlying PlayCanvas rigidbody component. `null` until the element is
71
+ * ready see {@link ComponentElement.component}.
72
+ * @returns The rigidbody component, or `null`.
72
73
  */
73
- get component(): RigidBodyComponent;
74
+ get component(): RigidBodyComponent | null;
74
75
  set angularDamping(value: number);
75
76
  get angularDamping(): number;
76
77
  set angularFactor(value: Vec3);
@@ -16,7 +16,7 @@ import { ComponentElement } from './component.js';
16
16
  *
17
17
  * @category Components
18
18
  */
19
- declare class RigidBodyComponentElement extends ComponentElement {
19
+ declare class RigidBodyComponentElement extends ComponentElement<RigidBodyComponent> {
20
20
  /**
21
21
  * The angular damping of the rigidbody.
22
22
  */
@@ -67,10 +67,11 @@ declare class RigidBodyComponentElement extends ComponentElement {
67
67
  type: "static" | "dynamic" | "kinematic";
68
68
  };
69
69
  /**
70
- * Gets the underlying PlayCanvas rigidbody component.
71
- * @returns The rigidbody component.
70
+ * Gets the underlying PlayCanvas rigidbody component. `null` until the element is
71
+ * ready see {@link ComponentElement.component}.
72
+ * @returns The rigidbody component, or `null`.
72
73
  */
73
- get component(): RigidBodyComponent;
74
+ get component(): RigidBodyComponent | null;
74
75
  set angularDamping(value: number);
75
76
  get angularDamping(): number;
76
77
  set angularFactor(value: Vec3);