@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
@@ -6490,9 +6490,9 @@
6490
6490
  "kind": "field",
6491
6491
  "name": "component",
6492
6492
  "type": {
6493
- "text": "Component | null"
6493
+ "text": "AnimComponent | null"
6494
6494
  },
6495
- "description": "Gets the underlying PlayCanvas anim component.",
6495
+ "description": "Gets the underlying PlayCanvas anim component. `null` until the element is\nready — see ComponentElement.component.",
6496
6496
  "return": {
6497
6497
  "type": {
6498
6498
  "text": ""
@@ -6761,9 +6761,9 @@
6761
6761
  "kind": "field",
6762
6762
  "name": "component",
6763
6763
  "type": {
6764
- "text": "Component | null"
6764
+ "text": "AudioListenerComponent | null"
6765
6765
  },
6766
- "description": "Gets the underlying PlayCanvas audio listener component.",
6766
+ "description": "Gets the underlying PlayCanvas audio listener component. `null` until the element is\nready — see ComponentElement.component.",
6767
6767
  "return": {
6768
6768
  "type": {
6769
6769
  "text": ""
@@ -6931,9 +6931,9 @@
6931
6931
  "kind": "field",
6932
6932
  "name": "component",
6933
6933
  "type": {
6934
- "text": "Component | null"
6934
+ "text": "ButtonComponent | null"
6935
6935
  },
6936
- "description": "Gets the underlying PlayCanvas button component.",
6936
+ "description": "Gets the underlying PlayCanvas button component. `null` until the element is\nready — see ComponentElement.component.",
6937
6937
  "return": {
6938
6938
  "type": {
6939
6939
  "text": ""
@@ -7048,7 +7048,7 @@
7048
7048
  {
7049
7049
  "kind": "field",
7050
7050
  "name": "image",
7051
- "description": "Gets the reference to the `<pc-entity>` whose image element is used for visual transitions.",
7051
+ "description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the entity whose image element is used for visual transitions, or empty for\nthe button's own entity.",
7052
7052
  "parameters": [
7053
7053
  {
7054
7054
  "description": "The image entity reference.",
@@ -7261,7 +7261,7 @@
7261
7261
  "text": "string"
7262
7262
  },
7263
7263
  "fieldName": "image",
7264
- "description": "The reference to the `<pc-entity>` whose image element is used for visual transitions."
7264
+ "description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the entity whose image element is used for visual transitions, or empty for the button's own entity."
7265
7265
  },
7266
7266
  {
7267
7267
  "name": "inactive-sprite-asset",
@@ -7524,9 +7524,9 @@
7524
7524
  "kind": "field",
7525
7525
  "name": "component",
7526
7526
  "type": {
7527
- "text": "Component | null"
7527
+ "text": "CameraComponent | null"
7528
7528
  },
7529
- "description": "Gets the underlying PlayCanvas camera component.",
7529
+ "description": "Gets the underlying PlayCanvas camera component. `null` until the element is\nready — see ComponentElement.component.",
7530
7530
  "return": {
7531
7531
  "type": {
7532
7532
  "text": ""
@@ -8157,9 +8157,9 @@
8157
8157
  "kind": "field",
8158
8158
  "name": "component",
8159
8159
  "type": {
8160
- "text": "Component | null"
8160
+ "text": "CollisionComponent | null"
8161
8161
  },
8162
- "description": "Gets the underlying PlayCanvas collision component.",
8162
+ "description": "Gets the underlying PlayCanvas collision component. `null` until the element is\nready — see ComponentElement.component.",
8163
8163
  "return": {
8164
8164
  "type": {
8165
8165
  "text": ""
@@ -8629,9 +8629,9 @@
8629
8629
  "kind": "field",
8630
8630
  "name": "component",
8631
8631
  "type": {
8632
- "text": "Component | null"
8632
+ "text": "ElementComponent | null"
8633
8633
  },
8634
- "description": "Gets the underlying PlayCanvas element component.",
8634
+ "description": "Gets the underlying PlayCanvas element component. `null` until the element is\nready — see ComponentElement.component.",
8635
8635
  "return": {
8636
8636
  "type": {
8637
8637
  "text": ""
@@ -9366,9 +9366,9 @@
9366
9366
  "kind": "field",
9367
9367
  "name": "component",
9368
9368
  "type": {
9369
- "text": "Component | null"
9369
+ "text": "GSplatComponent | null"
9370
9370
  },
9371
- "description": "Gets the underlying PlayCanvas gsplat component.",
9371
+ "description": "Gets the underlying PlayCanvas gsplat component. `null` until the element is\nready — see ComponentElement.component.",
9372
9372
  "return": {
9373
9373
  "type": {
9374
9374
  "text": ""
@@ -9594,7 +9594,7 @@
9594
9594
  "declarations": [
9595
9595
  {
9596
9596
  "kind": "class",
9597
- "description": "The JointComponentElement interface provides properties and methods for manipulating\n[`<pc-joint>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-joint/) elements.\nThe JointComponentElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe entity holding the joint is not itself constrained. Its world transform defines the joint\nframe — the anchor point and axes the constraint operates about — with the local X axis as the\nprimary axis: a hinge rotates about it, a slider translates along it and a ball joint twists\nabout it. The constrained bodies are referenced by `entity-a` and `entity-b`, both of which need\na rigid body component; leaving `entity-b` empty constrains `entity-a` to a fixed point in world\nspace. The underlying engine component is in alpha, so its API may change.\n",
9597
+ "description": "The JointComponentElement interface provides properties and methods for manipulating\n[`<pc-joint>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-joint/) elements.\nThe JointComponentElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe entity holding the joint is not itself constrained. Its world transform defines the joint\nframe — the anchor point and axes the constraint operates about — with the local X axis as the\nprimary axis: a hinge rotates about it, a slider translates along it and a ball joint twists\nabout it. The constrained bodies are referenced by `entity-a` and `entity-b`, both of which need\na rigid body component; leaving `entity-b` empty constrains `entity-a` to a fixed point in world\nspace. A reference can name any entity-fronting element — `<pc-entity>`, `<pc-model>` or\n`<pc-node>`, so a ragdoll can join a model's own skeleton nodes by name — and a name resolves\nagainst the nearest enclosing entity first, then outward through the entity hierarchy, then the\ndocument, while a `#` selector resolves document-wide. A `<template>` prefab with one\nentity-fronting root can therefore wire its joints by name and stay self-contained when cloned.\nThe underlying engine component is in alpha, so its API may change.\n",
9598
9598
  "name": "JointComponentElement",
9599
9599
  "members": [
9600
9600
  {
@@ -9797,9 +9797,9 @@
9797
9797
  "kind": "field",
9798
9798
  "name": "component",
9799
9799
  "type": {
9800
- "text": "Component | null"
9800
+ "text": "JointComponent | null"
9801
9801
  },
9802
- "description": "Gets the underlying PlayCanvas joint component.",
9802
+ "description": "Gets the underlying PlayCanvas joint component. `null` until the element is\nready — see ComponentElement.component.",
9803
9803
  "return": {
9804
9804
  "type": {
9805
9805
  "text": ""
@@ -9866,7 +9866,7 @@
9866
9866
  {
9867
9867
  "kind": "field",
9868
9868
  "name": "entityA",
9869
- "description": "Gets the reference to the `<pc-entity>` providing the first constrained body.",
9869
+ "description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the element providing the first constrained body.",
9870
9870
  "parameters": [
9871
9871
  {
9872
9872
  "description": "The first body's entity reference.",
@@ -9882,7 +9882,7 @@
9882
9882
  {
9883
9883
  "kind": "field",
9884
9884
  "name": "entityB",
9885
- "description": "Gets the reference to the `<pc-entity>` providing the second constrained body.",
9885
+ "description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the element providing the second constrained body, or empty for the\nworld-space case.",
9886
9886
  "parameters": [
9887
9887
  {
9888
9888
  "description": "The second body's entity reference.",
@@ -10314,7 +10314,7 @@
10314
10314
  "text": "string"
10315
10315
  },
10316
10316
  "fieldName": "entityA",
10317
- "description": "The reference to the `<pc-entity>` providing the first constrained body."
10317
+ "description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the element providing the first constrained body."
10318
10318
  },
10319
10319
  {
10320
10320
  "name": "entity-b",
@@ -10322,7 +10322,7 @@
10322
10322
  "text": "string"
10323
10323
  },
10324
10324
  "fieldName": "entityB",
10325
- "description": "The reference to the `<pc-entity>` providing the second constrained body."
10325
+ "description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the element providing the second constrained body, or empty for the world-space case."
10326
10326
  },
10327
10327
  {
10328
10328
  "name": "limits",
@@ -10546,9 +10546,9 @@
10546
10546
  "kind": "field",
10547
10547
  "name": "component",
10548
10548
  "type": {
10549
- "text": "Component | null"
10549
+ "text": "LayoutChildComponent | null"
10550
10550
  },
10551
- "description": "Gets the underlying PlayCanvas layout child component.",
10551
+ "description": "Gets the underlying PlayCanvas layout child component. `null` until the element is\nready — see ComponentElement.component.",
10552
10552
  "return": {
10553
10553
  "type": {
10554
10554
  "text": ""
@@ -10889,9 +10889,9 @@
10889
10889
  "kind": "field",
10890
10890
  "name": "component",
10891
10891
  "type": {
10892
- "text": "Component | null"
10892
+ "text": "LayoutGroupComponent | null"
10893
10893
  },
10894
- "description": "Gets the underlying PlayCanvas layout group component.",
10894
+ "description": "Gets the underlying PlayCanvas layout group component. `null` until the element is\nready — see ComponentElement.component.",
10895
10895
  "return": {
10896
10896
  "type": {
10897
10897
  "text": ""
@@ -11316,9 +11316,9 @@
11316
11316
  "kind": "field",
11317
11317
  "name": "component",
11318
11318
  "type": {
11319
- "text": "Component | null"
11319
+ "text": "LightComponent | null"
11320
11320
  },
11321
- "description": "Gets the underlying PlayCanvas light component.",
11321
+ "description": "Gets the underlying PlayCanvas light component. `null` until the element is\nready — see ComponentElement.component.",
11322
11322
  "return": {
11323
11323
  "type": {
11324
11324
  "text": ""
@@ -11975,9 +11975,9 @@
11975
11975
  "kind": "field",
11976
11976
  "name": "component",
11977
11977
  "type": {
11978
- "text": "Component | null"
11978
+ "text": "ParticleSystemComponent | null"
11979
11979
  },
11980
- "description": "Gets the underlying PlayCanvas particle system component.",
11980
+ "description": "Gets the underlying PlayCanvas particle system component. `null` until the element is\nready — see ComponentElement.component.",
11981
11981
  "return": {
11982
11982
  "type": {
11983
11983
  "text": ""
@@ -12176,9 +12176,9 @@
12176
12176
  "kind": "field",
12177
12177
  "name": "component",
12178
12178
  "type": {
12179
- "text": "Component | null"
12179
+ "text": "RenderComponent | null"
12180
12180
  },
12181
- "description": "Gets the underlying PlayCanvas render component.",
12181
+ "description": "Gets the underlying PlayCanvas render component. `null` until the element is\nready — see ComponentElement.component.",
12182
12182
  "return": {
12183
12183
  "type": {
12184
12184
  "text": ""
@@ -12427,9 +12427,9 @@
12427
12427
  "kind": "field",
12428
12428
  "name": "component",
12429
12429
  "type": {
12430
- "text": "Component | null"
12430
+ "text": "RigidBodyComponent | null"
12431
12431
  },
12432
- "description": "Gets the underlying PlayCanvas rigidbody component.",
12432
+ "description": "Gets the underlying PlayCanvas rigidbody component. `null` until the element is\nready — see ComponentElement.component.",
12433
12433
  "return": {
12434
12434
  "type": {
12435
12435
  "text": ""
@@ -12683,9 +12683,9 @@
12683
12683
  "kind": "field",
12684
12684
  "name": "component",
12685
12685
  "type": {
12686
- "text": "Component | null"
12686
+ "text": "ScreenComponent | null"
12687
12687
  },
12688
- "description": "Gets the underlying PlayCanvas screen component.",
12688
+ "description": "Gets the underlying PlayCanvas screen component. `null` until the element is\nready — see ComponentElement.component.",
12689
12689
  "return": {
12690
12690
  "type": {
12691
12691
  "text": ""
@@ -12937,9 +12937,9 @@
12937
12937
  "kind": "field",
12938
12938
  "name": "component",
12939
12939
  "type": {
12940
- "text": "Component | null"
12940
+ "text": "ScriptComponent | null"
12941
12941
  },
12942
- "description": "Gets the underlying PlayCanvas script component.",
12942
+ "description": "Gets the underlying PlayCanvas script component. `null` until the element is\nready — see ComponentElement.component.",
12943
12943
  "return": {
12944
12944
  "type": {
12945
12945
  "text": ""
@@ -13048,7 +13048,7 @@
13048
13048
  "declarations": [
13049
13049
  {
13050
13050
  "kind": "class",
13051
- "description": "The ScriptInstanceElement interface provides properties and methods for manipulating\n`<pc-script-instance>` elements. The ScriptInstanceElement interface also inherits the properties and\nmethods of the AsyncElement interface.\n\nScript attributes can be supplied through two channels:\n\n- **Per-property attributes**: any non-reserved attribute on the element maps to the script\n attribute of the same name (kebab-case to camelCase, e.g. `focus-point` → `focusPoint`).\n Values are parsed according to the type of the attribute's current value — initially the\n script's declared default (numbers, booleans, strings, Vec2/3/4, Color, Quat as Euler\n angles) — and the `asset:`/`entity:`/`vec2:`/`vec3:`/`vec4:`/`color:` prefixes may be used\n to be explicit.\n- **The `attributes` JSON attribute**: an object supporting nested structures and attribute\n names that collide with reserved HTML attribute names (e.g. `title`).\n\nWhen both specify the same attribute, the per-property attribute wins — at creation and\nwhenever either channel changes at runtime. The element's own `name` and `enabled`\nattributes configure the element itself and are not script attributes.\n\nChanging `name` on a live element destroys the old-name script instance and creates the\nnew-name one, re-applying both attribute channels to it.\n\nThe element becomes ready once its script instance has been created by the parent\n`<pc-script>` element.\n",
13051
+ "description": "The ScriptInstanceElement interface provides properties and methods for manipulating\n`<pc-script-instance>` elements. The ScriptInstanceElement interface also inherits the properties and\nmethods of the AsyncElement interface.\n\nScript attributes can be supplied through two channels:\n\n- **Per-property attributes**: any non-reserved attribute on the element maps to the script\n attribute of the same name (kebab-case to camelCase, e.g. `focus-point` → `focusPoint`).\n Values are parsed according to the type of the attribute's current value — initially the\n script's declared default (numbers, booleans, strings, Vec2/3/4, Color, Quat as Euler\n angles) — and the `asset:`/`entity:`/`vec2:`/`vec3:`/`vec4:`/`color:` prefixes may be used\n to be explicit. An `entity:` reference is an entity name — resolved against the nearest\n enclosing entity first, then outward, then the document — or a document-wide `#` selector\n (`entity:#id`); a bare value is always a name, never an element id.\n- **The `attributes` JSON attribute**: an object supporting nested structures and attribute\n names that collide with reserved HTML attribute names (e.g. `title`).\n\nWhen both specify the same attribute, the per-property attribute wins — at creation and\nwhenever either channel changes at runtime. The element's own `name` and `enabled`\nattributes configure the element itself and are not script attributes.\n\nChanging `name` on a live element destroys the old-name script instance and creates the\nnew-name one, re-applying both attribute channels to it.\n\nThe element becomes ready once its script instance has been created by the parent\n`<pc-script>` element.\n",
13052
13052
  "name": "ScriptInstanceElement",
13053
13053
  "members": [
13054
13054
  {
@@ -13150,7 +13150,7 @@
13150
13150
  {
13151
13151
  "kind": "field",
13152
13152
  "name": "scriptAttributes",
13153
- "description": "Gets the attributes of the script.",
13153
+ "description": "Gets the attributes of the script as an object whose `asset:`, `entity:`, `vec2:`, `vec3:`,\n`vec4:` and `color:` prefixed values are resolved when applied — an `entity:` value being\nan entity name (nearest enclosing entity first, then outward, then the document) or a\ndocument-wide `#` selector (`entity:#id`), never a bare element id.",
13154
13154
  "parameters": [
13155
13155
  {
13156
13156
  "description": "The attributes of the script.",
@@ -13208,7 +13208,7 @@
13208
13208
  "text": "string"
13209
13209
  },
13210
13210
  "fieldName": "scriptAttributes",
13211
- "description": "The attributes of the script."
13211
+ "description": "The attributes of the script as an object whose `asset:`, `entity:`, `vec2:`, `vec3:`, `vec4:` and `color:` prefixed values are resolved when applied — an `entity:` value being an entity name (nearest enclosing entity first, then outward, then the document) or a document-wide `#` selector (`entity:#id`), never a bare element id."
13212
13212
  },
13213
13213
  {
13214
13214
  "name": "enabled",
@@ -13232,7 +13232,7 @@
13232
13232
  "name": "AsyncElement",
13233
13233
  "module": "/src/async-element"
13234
13234
  },
13235
- "summary": "The `<pc-script-instance>` element attaches one script class, named by `name`, to\nthe entity of its parent `<pc-script>`. Its other attributes set script attributes of the same\nname, and `attributes` takes a JSON object instead. Must be a direct child of `<pc-script>`.\n",
13235
+ "summary": "The `<pc-script-instance>` element attaches one script class, named by `name`, to\nthe entity of its parent `<pc-script>`. Its other attributes set script attributes of the same\nname, and `attributes` takes a JSON object instead. An `entity:` value is an entity name —\nwrite `entity:#id` for an element id. Must be a direct child of `<pc-script>`.\n",
13236
13236
  "tagName": "pc-script-instance",
13237
13237
  "customElement": true
13238
13238
  }
@@ -13321,9 +13321,9 @@
13321
13321
  "kind": "field",
13322
13322
  "name": "component",
13323
13323
  "type": {
13324
- "text": "Component | null"
13324
+ "text": "ScrollViewComponent | null"
13325
13325
  },
13326
- "description": "Gets the underlying PlayCanvas scroll view component.",
13326
+ "description": "Gets the underlying PlayCanvas scroll view component. `null` until the element is\nready — see ComponentElement.component.",
13327
13327
  "return": {
13328
13328
  "type": {
13329
13329
  "text": ""
@@ -13338,7 +13338,7 @@
13338
13338
  {
13339
13339
  "kind": "field",
13340
13340
  "name": "content",
13341
- "description": "Gets the reference to the `<pc-entity>` used as the content.",
13341
+ "description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the entity used as the content.",
13342
13342
  "parameters": [
13343
13343
  {
13344
13344
  "description": "The content entity reference.",
@@ -13406,7 +13406,7 @@
13406
13406
  {
13407
13407
  "kind": "field",
13408
13408
  "name": "horizontalScrollbar",
13409
- "description": "Gets the reference to the `<pc-entity>` containing the horizontal scrollbar.",
13409
+ "description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the entity containing the horizontal scrollbar.",
13410
13410
  "parameters": [
13411
13411
  {
13412
13412
  "description": "The horizontal scrollbar entity reference.",
@@ -13516,7 +13516,7 @@
13516
13516
  {
13517
13517
  "kind": "field",
13518
13518
  "name": "verticalScrollbar",
13519
- "description": "Gets the reference to the `<pc-entity>` containing the vertical scrollbar.",
13519
+ "description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the entity containing the vertical scrollbar.",
13520
13520
  "parameters": [
13521
13521
  {
13522
13522
  "description": "The vertical scrollbar entity reference.",
@@ -13548,7 +13548,7 @@
13548
13548
  {
13549
13549
  "kind": "field",
13550
13550
  "name": "viewport",
13551
- "description": "Gets the reference to the `<pc-entity>` used as the viewport.",
13551
+ "description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the entity used as the viewport.",
13552
13552
  "parameters": [
13553
13553
  {
13554
13554
  "description": "The viewport entity reference.",
@@ -13578,7 +13578,7 @@
13578
13578
  "text": "string"
13579
13579
  },
13580
13580
  "fieldName": "content",
13581
- "description": "The reference to the `<pc-entity>` used as the content."
13581
+ "description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the entity used as the content."
13582
13582
  },
13583
13583
  {
13584
13584
  "name": "enabled",
@@ -13617,7 +13617,7 @@
13617
13617
  "text": "string"
13618
13618
  },
13619
13619
  "fieldName": "horizontalScrollbar",
13620
- "description": "The reference to the `<pc-entity>` containing the horizontal scrollbar."
13620
+ "description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the entity containing the horizontal scrollbar."
13621
13621
  },
13622
13622
  {
13623
13623
  "name": "horizontal-scrollbar-visibility",
@@ -13670,7 +13670,7 @@
13670
13670
  "text": "string"
13671
13671
  },
13672
13672
  "fieldName": "verticalScrollbar",
13673
- "description": "The reference to the `<pc-entity>` containing the vertical scrollbar."
13673
+ "description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the entity containing the vertical scrollbar."
13674
13674
  },
13675
13675
  {
13676
13676
  "name": "vertical-scrollbar-visibility",
@@ -13687,7 +13687,7 @@
13687
13687
  "text": "string"
13688
13688
  },
13689
13689
  "fieldName": "viewport",
13690
- "description": "The reference to the `<pc-entity>` used as the viewport."
13690
+ "description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the entity used as the viewport."
13691
13691
  }
13692
13692
  ],
13693
13693
  "superclass": {
@@ -13780,9 +13780,9 @@
13780
13780
  "kind": "field",
13781
13781
  "name": "component",
13782
13782
  "type": {
13783
- "text": "Component | null"
13783
+ "text": "ScrollbarComponent | null"
13784
13784
  },
13785
- "description": "Gets the underlying PlayCanvas scrollbar component.",
13785
+ "description": "Gets the underlying PlayCanvas scrollbar component. `null` until the element is\nready — see ComponentElement.component.",
13786
13786
  "return": {
13787
13787
  "type": {
13788
13788
  "text": ""
@@ -13817,7 +13817,7 @@
13817
13817
  {
13818
13818
  "kind": "field",
13819
13819
  "name": "handle",
13820
- "description": "Gets the reference to the `<pc-entity>` used as the scrollbar handle.",
13820
+ "description": "Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`\nselector) to the entity used as the scrollbar handle.",
13821
13821
  "parameters": [
13822
13822
  {
13823
13823
  "description": "The handle entity reference.",
@@ -13913,7 +13913,7 @@
13913
13913
  "text": "string"
13914
13914
  },
13915
13915
  "fieldName": "handle",
13916
- "description": "The reference to the `<pc-entity>` used as the scrollbar handle."
13916
+ "description": "The reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#` selector) to the entity used as the scrollbar handle."
13917
13917
  },
13918
13918
  {
13919
13919
  "name": "handle-size",
@@ -14033,9 +14033,9 @@
14033
14033
  "kind": "field",
14034
14034
  "name": "component",
14035
14035
  "type": {
14036
- "text": "Component | null"
14036
+ "text": "SoundComponent | null"
14037
14037
  },
14038
- "description": "Gets the underlying PlayCanvas sound component.",
14038
+ "description": "Gets the underlying PlayCanvas sound component. `null` until the element is\nready — see ComponentElement.component.",
14039
14039
  "return": {
14040
14040
  "type": {
14041
14041
  "text": ""
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Resolves entity reference strings against the document. A reference beginning with `#` is a
3
+ * document-wide selector (an element id, or any selector rooted in one); anything else is an
4
+ * entity name, resolved lexically through the entity hierarchy first and against the document
5
+ * after — never as a selector or an id.
6
+ *
7
+ * Unlike the attribute parsers in `parse.ts`, these helpers touch the DOM, and `findEntityElement`
8
+ * and `getEntity` return `null` instead of falling back to a default. They also do not warn -
9
+ * what an unresolved reference means depends on the element holding it - so elements report
10
+ * through `resolveEntity`, which takes that meaning as parameters, and `pc-script` builds its own
11
+ * message from the lower-level pieces.
12
+ */
13
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Resolves entity reference strings against the document. A reference beginning with `#` is a
3
+ * document-wide selector (an element id, or any selector rooted in one); anything else is an
4
+ * entity name, resolved lexically through the entity hierarchy first and against the document
5
+ * after — never as a selector or an id.
6
+ *
7
+ * Unlike the attribute parsers in `parse.ts`, these helpers touch the DOM, and `findEntityElement`
8
+ * and `getEntity` return `null` instead of falling back to a default. They also do not warn -
9
+ * what an unresolved reference means depends on the element holding it - so elements report
10
+ * through `resolveEntity`, which takes that meaning as parameters, and `pc-script` builds its own
11
+ * message from the lower-level pieces.
12
+ */
13
+ export {};
@@ -130,11 +130,12 @@ declare class MaterialElement extends HTMLElement {
130
130
  private _useSkybox;
131
131
  private _useTonemap;
132
132
  /**
133
- * Pending `load` handlers, one per texture slot. A slot's handler is torn down when the slot is
134
- * reassigned or the element disconnects, so a late-arriving asset can never write a texture the
135
- * element no longer wants.
133
+ * One asset binding per texture slot, created on first use and kept for the element's
134
+ * lifetime. A slot's binding is superseded when the slot is reassigned and cancelled when the
135
+ * element disconnects, so a late-arriving asset can never write a texture the element no
136
+ * longer wants.
136
137
  */
137
- private _mapHandles;
138
+ private _mapBindings;
138
139
  private _updateScheduled;
139
140
  private _glossConflictWarned;
140
141
  /**
@@ -163,8 +164,9 @@ declare class MaterialElement extends HTMLElement {
163
164
  */
164
165
  private _warnGlossConflict;
165
166
  /**
166
- * Points a texture slot at the resource of a `pc-asset`, waiting for the asset to load when it
167
- * has not already. An empty id clears the slot.
167
+ * Points a texture slot at the resource of a `pc-asset`, waiting for the asset to load when
168
+ * it has not already. An empty id clears the slot; a slot keeps its current texture while
169
+ * the new asset loads, and also across a failed load - a later reload can still deliver.
168
170
  *
169
171
  * @param id - The id of the `pc-asset`, or an empty string to clear the slot.
170
172
  * @param slot - The material property to write.
@@ -130,11 +130,12 @@ declare class MaterialElement extends HTMLElement {
130
130
  private _useSkybox;
131
131
  private _useTonemap;
132
132
  /**
133
- * Pending `load` handlers, one per texture slot. A slot's handler is torn down when the slot is
134
- * reassigned or the element disconnects, so a late-arriving asset can never write a texture the
135
- * element no longer wants.
133
+ * One asset binding per texture slot, created on first use and kept for the element's
134
+ * lifetime. A slot's binding is superseded when the slot is reassigned and cancelled when the
135
+ * element disconnects, so a late-arriving asset can never write a texture the element no
136
+ * longer wants.
136
137
  */
137
- private _mapHandles;
138
+ private _mapBindings;
138
139
  private _updateScheduled;
139
140
  private _glossConflictWarned;
140
141
  /**
@@ -163,8 +164,9 @@ declare class MaterialElement extends HTMLElement {
163
164
  */
164
165
  private _warnGlossConflict;
165
166
  /**
166
- * Points a texture slot at the resource of a `pc-asset`, waiting for the asset to load when it
167
- * has not already. An empty id clears the slot.
167
+ * Points a texture slot at the resource of a `pc-asset`, waiting for the asset to load when
168
+ * it has not already. An empty id clears the slot; a slot keeps its current texture while
169
+ * the new asset loads, and also across a failed load - a later reload can still deliver.
168
170
  *
169
171
  * @param id - The id of the `pc-asset`, or an empty string to clear the slot.
170
172
  * @param slot - The material property to write.
package/dist/model.d.cts CHANGED
@@ -120,18 +120,18 @@ declare class ModelElement extends EntityOwnerElement {
120
120
  private _contentEntity;
121
121
  /**
122
122
  * Incremented on every new load, on disconnect, and when the host entity dies, and captured
123
- * by a load when it starts. A load that resumes from an await or a load callback abandons
124
- * itself if the value has moved on, so a superseded load can neither instantiate a second
125
- * content root nor parent one under a host a newer cycle has already replaced.
123
+ * by a load when it starts. A load that resumes from an await abandons itself if the value
124
+ * has moved on, so a superseded load can neither instantiate a second content root nor
125
+ * parent one under a host a newer cycle has already replaced. The asset subscription itself
126
+ * is guarded by the binding below.
126
127
  */
127
128
  private _loadGeneration;
128
129
  /**
129
- * The pending asset subscriptions of the current load, if it is waiting for its asset. Held
130
- * so that whatever supersedes the load can detach the handlers from the asset, rather than
131
- * leave them registered until the asset settles (or forever, if it never does).
130
+ * The subscription to the current container asset while it is loading. Whatever supersedes
131
+ * the load a newer load, a disconnect, the host dying — cancels it, so the asset settling
132
+ * later cannot deliver to a load that no longer owns the element.
132
133
  */
133
- private _loadHandle;
134
- private _errorHandle;
134
+ private _binding;
135
135
  /**
136
136
  * The root entity of the instantiated model content, parented beneath the host entity.
137
137
  * `null` until the container asset has loaded and been instantiated, after a failed load,
@@ -170,7 +170,6 @@ declare class ModelElement extends EntityOwnerElement {
170
170
  * @param entity - The host entity that was destroyed.
171
171
  */
172
172
  protected _onEntityDestroy(entity: Entity): void;
173
- private _detachLoadHandlers;
174
173
  /**
175
174
  * Resolves readiness and dispatches the `load` event. Called once the instantiated content
176
175
  * has been parented beneath the host — the host itself is already in the scene graph by
package/dist/model.d.ts CHANGED
@@ -120,18 +120,18 @@ declare class ModelElement extends EntityOwnerElement {
120
120
  private _contentEntity;
121
121
  /**
122
122
  * Incremented on every new load, on disconnect, and when the host entity dies, and captured
123
- * by a load when it starts. A load that resumes from an await or a load callback abandons
124
- * itself if the value has moved on, so a superseded load can neither instantiate a second
125
- * content root nor parent one under a host a newer cycle has already replaced.
123
+ * by a load when it starts. A load that resumes from an await abandons itself if the value
124
+ * has moved on, so a superseded load can neither instantiate a second content root nor
125
+ * parent one under a host a newer cycle has already replaced. The asset subscription itself
126
+ * is guarded by the binding below.
126
127
  */
127
128
  private _loadGeneration;
128
129
  /**
129
- * The pending asset subscriptions of the current load, if it is waiting for its asset. Held
130
- * so that whatever supersedes the load can detach the handlers from the asset, rather than
131
- * leave them registered until the asset settles (or forever, if it never does).
130
+ * The subscription to the current container asset while it is loading. Whatever supersedes
131
+ * the load a newer load, a disconnect, the host dying — cancels it, so the asset settling
132
+ * later cannot deliver to a load that no longer owns the element.
132
133
  */
133
- private _loadHandle;
134
- private _errorHandle;
134
+ private _binding;
135
135
  /**
136
136
  * The root entity of the instantiated model content, parented beneath the host entity.
137
137
  * `null` until the container asset has loaded and been instantiated, after a failed load,
@@ -170,7 +170,6 @@ declare class ModelElement extends EntityOwnerElement {
170
170
  * @param entity - The host entity that was destroyed.
171
171
  */
172
172
  protected _onEntityDestroy(entity: Entity): void;
173
- private _detachLoadHandlers;
174
173
  /**
175
174
  * Resolves readiness and dispatches the `load` event. Called once the instantiated content
176
175
  * has been parented beneath the host — the host itself is already in the scene graph by
package/dist/parse.d.cts CHANGED
@@ -11,8 +11,5 @@
11
11
  * shared frozen constants (`Vec3.ZERO`, `Color.WHITE`) as defaults.
12
12
  * - `parseBool` and `parseTags` take no attribute name, because every value is valid for them and
13
13
  * so they never warn.
14
- *
15
- * `getEntity` is the exception: it resolves a reference to a live entity rather than parsing a
16
- * literal, and returns `null` instead of falling back to a default.
17
14
  */
18
15
  export {};
package/dist/parse.d.ts CHANGED
@@ -11,8 +11,5 @@
11
11
  * shared frozen constants (`Vec3.ZERO`, `Color.WHITE`) as defaults.
12
12
  * - `parseBool` and `parseTags` take no attribute name, because every value is valid for them and
13
13
  * so they never warn.
14
- *
15
- * `getEntity` is the exception: it resolves a reference to a live entity rather than parsing a
16
- * literal, and returns `null` instead of falling back to a default.
17
14
  */
18
15
  export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};