@playcanvas/web-components 0.1.11 → 0.1.13

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 (55) hide show
  1. package/README.md +31 -303
  2. package/dist/app.d.ts +4 -1
  3. package/dist/asset.d.ts +10 -9
  4. package/dist/components/camera-component.d.ts +4 -3
  5. package/dist/components/collision-component.d.ts +4 -3
  6. package/dist/components/element-component.d.ts +84 -3
  7. package/dist/components/light-component.d.ts +4 -3
  8. package/dist/components/listener-component.d.ts +4 -3
  9. package/dist/components/render-component.d.ts +4 -3
  10. package/dist/components/rigidbody-component.d.ts +5 -4
  11. package/dist/components/screen-component.d.ts +4 -3
  12. package/dist/components/script-component.d.ts +4 -3
  13. package/dist/components/sound-component.d.ts +4 -3
  14. package/dist/components/sound-slot.d.ts +2 -2
  15. package/dist/components/splat-component.d.ts +36 -0
  16. package/dist/entity.d.ts +3 -2
  17. package/dist/index.d.ts +2 -2
  18. package/dist/material.d.ts +3 -2
  19. package/dist/model.d.ts +6 -5
  20. package/dist/module.d.ts +3 -2
  21. package/dist/pwc.cjs +252 -79
  22. package/dist/pwc.cjs.map +1 -1
  23. package/dist/pwc.js +252 -79
  24. package/dist/pwc.js.map +1 -1
  25. package/dist/pwc.min.js +1 -1
  26. package/dist/pwc.min.js.map +1 -1
  27. package/dist/pwc.mjs +252 -79
  28. package/dist/pwc.mjs.map +1 -1
  29. package/dist/scene.d.ts +3 -2
  30. package/dist/sky.d.ts +64 -0
  31. package/package.json +24 -24
  32. package/src/app.ts +14 -10
  33. package/src/asset.ts +17 -16
  34. package/src/components/camera-component.ts +4 -3
  35. package/src/components/collision-component.ts +4 -3
  36. package/src/components/element-component.ts +84 -3
  37. package/src/components/light-component.ts +4 -3
  38. package/src/components/listener-component.ts +4 -3
  39. package/src/components/render-component.ts +4 -3
  40. package/src/components/rigidbody-component.ts +5 -4
  41. package/src/components/screen-component.ts +4 -3
  42. package/src/components/script-component.ts +4 -3
  43. package/src/components/sound-component.ts +4 -3
  44. package/src/components/sound-slot.ts +2 -2
  45. package/src/components/{gsplat-component.ts → splat-component.ts} +17 -8
  46. package/src/entity.ts +3 -2
  47. package/src/index.ts +2 -2
  48. package/src/material.ts +6 -5
  49. package/src/model.ts +8 -7
  50. package/src/module.ts +3 -2
  51. package/src/scene.ts +3 -2
  52. package/src/sky.ts +64 -0
  53. package/dist/components/gsplat-component.d.ts +0 -27
  54. package/dist/fog.d.ts +0 -28
  55. package/src/fog.ts +0 -121
package/dist/pwc.cjs CHANGED
@@ -40,8 +40,9 @@ class AsyncElement extends HTMLElement {
40
40
 
41
41
  /**
42
42
  * The ModuleElement interface provides properties and methods for manipulating
43
- * `<pc-module>` elements. The ModuleElement interface also inherits the properties and
44
- * methods of the {@link HTMLElement} interface.
43
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-module/ | `<pc-module>`} elements.
44
+ * The ModuleElement interface also inherits the properties and methods of the
45
+ * {@link HTMLElement} interface.
45
46
  */
46
47
  class ModuleElement extends HTMLElement {
47
48
  /** @ignore */
@@ -79,7 +80,10 @@ class ModuleElement extends HTMLElement {
79
80
  customElements.define('pc-module', ModuleElement);
80
81
 
81
82
  /**
82
- * The main application element.
83
+ * The AppElement interface provides properties and methods for manipulating
84
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-app/ | `<pc-app>`} elements.
85
+ * The AppElement interface also inherits the properties and methods of the
86
+ * {@link HTMLElement} interface.
83
87
  */
84
88
  class AppElement extends AsyncElement {
85
89
  /**
@@ -238,13 +242,14 @@ class AppElement extends AsyncElement {
238
242
  // Get the currently hovered entity by walking up the hierarchy
239
243
  let newHoverEntity = null;
240
244
  if (selection.length > 0) {
241
- let node = selection[0].node;
242
- while (node && !newHoverEntity) {
243
- const entityElement = this.querySelector(`pc-entity[name="${node.name}"]`);
245
+ let currentNode = selection[0].node;
246
+ while (currentNode !== null) {
247
+ const entityElement = this.querySelector(`pc-entity[name="${currentNode.name}"]`);
244
248
  if (entityElement) {
245
249
  newHoverEntity = entityElement;
250
+ break;
246
251
  }
247
- node = node.parent;
252
+ currentNode = currentNode.parent;
248
253
  }
249
254
  }
250
255
  // Handle enter/leave events
@@ -275,14 +280,14 @@ class AppElement extends AsyncElement {
275
280
  this._picker.prepare(camera, this.app.scene);
276
281
  const selection = this._picker.getSelection(x, y);
277
282
  if (selection.length > 0) {
278
- let node = selection[0].node;
279
- while (node) {
280
- const entityElement = this.querySelector(`pc-entity[name="${node.name}"]`);
283
+ let currentNode = selection[0].node;
284
+ while (currentNode !== null) {
285
+ const entityElement = this.querySelector(`pc-entity[name="${currentNode.name}"]`);
281
286
  if (entityElement && entityElement.hasListeners('pointerdown')) {
282
287
  entityElement.dispatchEvent(new PointerEvent('pointerdown', event));
283
288
  break;
284
289
  }
285
- node = node.parent;
290
+ currentNode = currentNode.parent;
286
291
  }
287
292
  }
288
293
  }
@@ -651,8 +656,9 @@ const parseVec4 = (value) => {
651
656
 
652
657
  /**
653
658
  * The EntityElement interface provides properties and methods for manipulating
654
- * `<pc-entity>` elements. The EntityElement interface also inherits the properties and
655
- * methods of the {@link HTMLElement} interface.
659
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-entity/ | `<pc-entity>`} elements.
660
+ * The EntityElement interface also inherits the properties and methods of the
661
+ * {@link HTMLElement} interface.
656
662
  */
657
663
  class EntityElement extends AsyncElement {
658
664
  constructor() {
@@ -990,13 +996,14 @@ const extToType = new Map([
990
996
  ]);
991
997
  /**
992
998
  * The AssetElement interface provides properties and methods for manipulating
993
- * `<pc-asset>` elements. The AssetElement interface also inherits the properties and
994
- * methods of the {@link HTMLElement} interface.
999
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-asset/ | `<pc-asset>`} elements.
1000
+ * The AssetElement interface also inherits the properties and methods of the
1001
+ * {@link HTMLElement} interface.
995
1002
  */
996
1003
  class AssetElement extends HTMLElement {
997
1004
  constructor() {
998
1005
  super(...arguments);
999
- this._preload = false;
1006
+ this._lazy = false;
1000
1007
  /**
1001
1008
  * The asset that is loaded.
1002
1009
  */
@@ -1020,7 +1027,7 @@ class AssetElement extends HTMLElement {
1020
1027
  return;
1021
1028
  }
1022
1029
  this.asset = new playcanvas.Asset(id, type, { url: src });
1023
- this.asset.preload = this.preload;
1030
+ this.asset.preload = !this._lazy;
1024
1031
  }
1025
1032
  destroyAsset() {
1026
1033
  if (this.asset) {
@@ -1029,32 +1036,32 @@ class AssetElement extends HTMLElement {
1029
1036
  }
1030
1037
  }
1031
1038
  /**
1032
- * Sets the preload flag of the asset.
1033
- * @param value - The preload flag.
1039
+ * Sets whether the asset should be loaded lazily.
1040
+ * @param value - The lazy loading flag.
1034
1041
  */
1035
- set preload(value) {
1036
- this._preload = value;
1042
+ set lazy(value) {
1043
+ this._lazy = value;
1037
1044
  if (this.asset) {
1038
- this.asset.preload = value;
1045
+ this.asset.preload = !value;
1039
1046
  }
1040
1047
  }
1041
1048
  /**
1042
- * Gets the preload flag of the asset.
1043
- * @returns The preload flag.
1049
+ * Gets whether the asset should be loaded lazily.
1050
+ * @returns The lazy loading flag.
1044
1051
  */
1045
- get preload() {
1046
- return this._preload;
1052
+ get lazy() {
1053
+ return this._lazy;
1047
1054
  }
1048
1055
  static get(id) {
1049
1056
  const assetElement = document.querySelector(`pc-asset[id="${id}"]`);
1050
1057
  return assetElement === null || assetElement === undefined ? undefined : assetElement.asset;
1051
1058
  }
1052
1059
  static get observedAttributes() {
1053
- return ['preload'];
1060
+ return ['lazy'];
1054
1061
  }
1055
1062
  attributeChangedCallback(name, _oldValue, _newValue) {
1056
- if (name === 'preload') {
1057
- this.preload = this.hasAttribute('preload');
1063
+ if (name === 'lazy') {
1064
+ this.lazy = this.hasAttribute('lazy');
1058
1065
  }
1059
1066
  }
1060
1067
  }
@@ -1140,8 +1147,9 @@ class ComponentElement extends AsyncElement {
1140
1147
 
1141
1148
  /**
1142
1149
  * The ListenerComponentElement interface provides properties and methods for manipulating
1143
- * `<pc-listener>` elements. The ListenerComponentElement interface also inherits the properties
1144
- * and methods of the {@link HTMLElement} interface.
1150
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-listener/ | `<pc-listener>`} elements.
1151
+ * The ListenerComponentElement interface also inherits the properties and methods of the
1152
+ * {@link HTMLElement} interface.
1145
1153
  *
1146
1154
  * @category Components
1147
1155
  */
@@ -1151,7 +1159,7 @@ class ListenerComponentElement extends ComponentElement {
1151
1159
  super('audiolistener');
1152
1160
  }
1153
1161
  /**
1154
- * Gets the audio listener component.
1162
+ * Gets the underlying PlayCanvas audio listener component.
1155
1163
  * @returns The audio listener component.
1156
1164
  */
1157
1165
  get component() {
@@ -1171,8 +1179,9 @@ const tonemaps = new Map([
1171
1179
  ]);
1172
1180
  /**
1173
1181
  * The CameraComponentElement interface provides properties and methods for manipulating
1174
- * `<pc-camera>` elements. The CameraComponentElement interface also inherits the properties and
1175
- * methods of the {@link HTMLElement} interface.
1182
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-camera/ | `<pc-camera>`} elements.
1183
+ * The CameraComponentElement interface also inherits the properties and methods of the
1184
+ * {@link HTMLElement} interface.
1176
1185
  *
1177
1186
  * @category Components
1178
1187
  */
@@ -1242,7 +1251,7 @@ class CameraComponentElement extends ComponentElement {
1242
1251
  }
1243
1252
  }
1244
1253
  /**
1245
- * Gets the camera component.
1254
+ * Gets the underlying PlayCanvas camera component.
1246
1255
  * @returns The camera component.
1247
1256
  */
1248
1257
  get component() {
@@ -1643,8 +1652,9 @@ customElements.define('pc-camera', CameraComponentElement);
1643
1652
 
1644
1653
  /**
1645
1654
  * The CollisionComponentElement interface provides properties and methods for manipulating
1646
- * `<pc-collision>` elements. The CollisionComponentElement interface also inherits the properties
1647
- * and methods of the {@link HTMLElement} interface.
1655
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-collision/ | `<pc-collision>`} elements.
1656
+ * The CollisionComponentElement interface also inherits the properties and methods of the
1657
+ * {@link HTMLElement} interface.
1648
1658
  *
1649
1659
  * @category Components
1650
1660
  */
@@ -1674,7 +1684,7 @@ class CollisionComponentElement extends ComponentElement {
1674
1684
  };
1675
1685
  }
1676
1686
  /**
1677
- * Gets the collision component.
1687
+ * Gets the underlying PlayCanvas collision component.
1678
1688
  * @returns The collision component.
1679
1689
  */
1680
1690
  get component() {
@@ -1789,8 +1799,9 @@ customElements.define('pc-collision', CollisionComponentElement);
1789
1799
 
1790
1800
  /**
1791
1801
  * The ElementComponentElement interface provides properties and methods for manipulating
1792
- * `<pc-element>` elements. The ElementComponentElement interface also inherits the properties and
1793
- * methods of the {@link HTMLElement} interface.
1802
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-element/ | `<pc-element>`} elements.
1803
+ * The ElementComponentElement interface also inherits the properties and methods of the
1804
+ * {@link HTMLElement} interface.
1794
1805
  *
1795
1806
  * @category Components
1796
1807
  */
@@ -1829,21 +1840,33 @@ class ElementComponentElement extends ComponentElement {
1829
1840
  };
1830
1841
  }
1831
1842
  /**
1832
- * Gets the element component.
1843
+ * Gets the underlying PlayCanvas element component.
1833
1844
  * @returns The element component.
1834
1845
  */
1835
1846
  get component() {
1836
1847
  return super.component;
1837
1848
  }
1849
+ /**
1850
+ * Sets the anchor of the element component.
1851
+ * @param value - The anchor.
1852
+ */
1838
1853
  set anchor(value) {
1839
1854
  this._anchor = value;
1840
1855
  if (this.component) {
1841
1856
  this.component.anchor = value;
1842
1857
  }
1843
1858
  }
1859
+ /**
1860
+ * Gets the anchor of the element component.
1861
+ * @returns The anchor.
1862
+ */
1844
1863
  get anchor() {
1845
1864
  return this._anchor;
1846
1865
  }
1866
+ /**
1867
+ * Sets the id of the `pc-asset` to use for the font.
1868
+ * @param value - The asset ID.
1869
+ */
1847
1870
  set asset(value) {
1848
1871
  this._asset = value;
1849
1872
  const asset = AssetElement.get(value);
@@ -1851,60 +1874,112 @@ class ElementComponentElement extends ComponentElement {
1851
1874
  this.component.fontAsset = asset.id;
1852
1875
  }
1853
1876
  }
1877
+ /**
1878
+ * Gets the id of the `pc-asset` to use for the font.
1879
+ * @returns The asset ID.
1880
+ */
1854
1881
  get asset() {
1855
1882
  return this._asset;
1856
1883
  }
1884
+ /**
1885
+ * Sets whether the element component should automatically adjust its width.
1886
+ * @param value - Whether to automatically adjust the width.
1887
+ */
1857
1888
  set autoWidth(value) {
1858
1889
  this._autoWidth = value;
1859
1890
  if (this.component) {
1860
1891
  this.component.autoWidth = value;
1861
1892
  }
1862
1893
  }
1894
+ /**
1895
+ * Gets whether the element component should automatically adjust its width.
1896
+ * @returns Whether to automatically adjust the width.
1897
+ */
1863
1898
  get autoWidth() {
1864
1899
  return this._autoWidth;
1865
1900
  }
1901
+ /**
1902
+ * Sets the color of the element component.
1903
+ * @param value - The color.
1904
+ */
1866
1905
  set color(value) {
1867
1906
  this._color = value;
1868
1907
  if (this.component) {
1869
1908
  this.component.color = value;
1870
1909
  }
1871
1910
  }
1911
+ /**
1912
+ * Gets the color of the element component.
1913
+ * @returns The color.
1914
+ */
1872
1915
  get color() {
1873
1916
  return this._color;
1874
1917
  }
1918
+ /**
1919
+ * Sets the font size of the element component.
1920
+ * @param value - The font size.
1921
+ */
1875
1922
  set fontSize(value) {
1876
1923
  this._fontSize = value;
1877
1924
  if (this.component) {
1878
1925
  this.component.fontSize = value;
1879
1926
  }
1880
1927
  }
1928
+ /**
1929
+ * Gets the font size of the element component.
1930
+ * @returns The font size.
1931
+ */
1881
1932
  get fontSize() {
1882
1933
  return this._fontSize;
1883
1934
  }
1935
+ /**
1936
+ * Sets the line height of the element component.
1937
+ * @param value - The line height.
1938
+ */
1884
1939
  set lineHeight(value) {
1885
1940
  this._lineHeight = value;
1886
1941
  if (this.component) {
1887
1942
  this.component.lineHeight = value;
1888
1943
  }
1889
1944
  }
1945
+ /**
1946
+ * Gets the line height of the element component.
1947
+ * @returns The line height.
1948
+ */
1890
1949
  get lineHeight() {
1891
1950
  return this._lineHeight;
1892
1951
  }
1952
+ /**
1953
+ * Sets the pivot of the element component.
1954
+ * @param value - The pivot.
1955
+ */
1893
1956
  set pivot(value) {
1894
1957
  this._pivot = value;
1895
1958
  if (this.component) {
1896
1959
  this.component.pivot = value;
1897
1960
  }
1898
1961
  }
1962
+ /**
1963
+ * Gets the pivot of the element component.
1964
+ * @returns The pivot.
1965
+ */
1899
1966
  get pivot() {
1900
1967
  return this._pivot;
1901
1968
  }
1969
+ /**
1970
+ * Sets the text of the element component.
1971
+ * @param value - The text.
1972
+ */
1902
1973
  set text(value) {
1903
1974
  this._text = value;
1904
1975
  if (this.component) {
1905
1976
  this.component.text = value;
1906
1977
  }
1907
1978
  }
1979
+ /**
1980
+ * Gets the text of the element component.
1981
+ * @returns The text.
1982
+ */
1908
1983
  get text() {
1909
1984
  return this._text;
1910
1985
  }
@@ -1925,21 +2000,37 @@ class ElementComponentElement extends ComponentElement {
1925
2000
  get type() {
1926
2001
  return this._type;
1927
2002
  }
2003
+ /**
2004
+ * Sets the width of the element component.
2005
+ * @param value - The width.
2006
+ */
1928
2007
  set width(value) {
1929
2008
  this._width = value;
1930
2009
  if (this.component) {
1931
2010
  this.component.width = value;
1932
2011
  }
1933
2012
  }
2013
+ /**
2014
+ * Gets the width of the element component.
2015
+ * @returns The width.
2016
+ */
1934
2017
  get width() {
1935
2018
  return this._width;
1936
2019
  }
2020
+ /**
2021
+ * Sets whether the element component should wrap lines.
2022
+ * @param value - Whether to wrap lines.
2023
+ */
1937
2024
  set wrapLines(value) {
1938
2025
  this._wrapLines = value;
1939
2026
  if (this.component) {
1940
2027
  this.component.wrapLines = value;
1941
2028
  }
1942
2029
  }
2030
+ /**
2031
+ * Gets whether the element component should wrap lines.
2032
+ * @returns Whether to wrap lines.
2033
+ */
1943
2034
  get wrapLines() {
1944
2035
  return this._wrapLines;
1945
2036
  }
@@ -2001,13 +2092,14 @@ class ElementComponentElement extends ComponentElement {
2001
2092
  customElements.define('pc-element', ElementComponentElement);
2002
2093
 
2003
2094
  /**
2004
- * The GSplatComponentElement interface provides properties and methods for manipulating
2005
- * `<pc-splat>` elements. The GSplatComponentElement interface also inherits the properties and
2006
- * methods of the {@link HTMLElement} interface.
2095
+ * The SplatComponentElement interface provides properties and methods for manipulating
2096
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-splat/ | `<pc-splat>`} elements.
2097
+ * The SplatComponentElement interface also inherits the properties and methods of the
2098
+ * {@link HTMLElement} interface.
2007
2099
  *
2008
2100
  * @category Components
2009
2101
  */
2010
- class GSplatComponentElement extends ComponentElement {
2102
+ class SplatComponentElement extends ComponentElement {
2011
2103
  /** @ignore */
2012
2104
  constructor() {
2013
2105
  super('gsplat');
@@ -2019,12 +2111,16 @@ class GSplatComponentElement extends ComponentElement {
2019
2111
  };
2020
2112
  }
2021
2113
  /**
2022
- * Gets the gsplat component.
2023
- * @returns The gsplat component.
2114
+ * Gets the underlying PlayCanvas splat component.
2115
+ * @returns The splat component.
2024
2116
  */
2025
2117
  get component() {
2026
2118
  return super.component;
2027
2119
  }
2120
+ /**
2121
+ * Sets id of the `pc-asset` to use for the splat.
2122
+ * @param value - The asset ID.
2123
+ */
2028
2124
  set asset(value) {
2029
2125
  this._asset = value;
2030
2126
  const asset = AssetElement.get(value);
@@ -2032,6 +2128,10 @@ class GSplatComponentElement extends ComponentElement {
2032
2128
  this.component.asset = asset;
2033
2129
  }
2034
2130
  }
2131
+ /**
2132
+ * Gets the id of the `pc-asset` to use for the splat.
2133
+ * @returns The asset ID.
2134
+ */
2035
2135
  get asset() {
2036
2136
  return this._asset;
2037
2137
  }
@@ -2047,7 +2147,7 @@ class GSplatComponentElement extends ComponentElement {
2047
2147
  }
2048
2148
  }
2049
2149
  }
2050
- customElements.define('pc-splat', GSplatComponentElement);
2150
+ customElements.define('pc-splat', SplatComponentElement);
2051
2151
 
2052
2152
  const shadowTypes = new Map([
2053
2153
  ['pcf1-16f', playcanvas.SHADOW_PCF1_16F],
@@ -2062,8 +2162,9 @@ const shadowTypes = new Map([
2062
2162
  ]);
2063
2163
  /**
2064
2164
  * The LightComponentElement interface provides properties and methods for manipulating
2065
- * `<pc-light>` elements. The LightComponentElement interface also inherits the properties and
2066
- * methods of the {@link HTMLElement} interface.
2165
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-light/ | `<pc-light>`} elements.
2166
+ * The LightComponentElement interface also inherits the properties and methods of the
2167
+ * {@link HTMLElement} interface.
2067
2168
  *
2068
2169
  * @category Components
2069
2170
  */
@@ -2105,7 +2206,7 @@ class LightComponentElement extends ComponentElement {
2105
2206
  };
2106
2207
  }
2107
2208
  /**
2108
- * Gets the light component.
2209
+ * Gets the underlying PlayCanvas light component.
2109
2210
  * @returns The light component.
2110
2211
  */
2111
2212
  get component() {
@@ -2435,8 +2536,9 @@ customElements.define('pc-light', LightComponentElement);
2435
2536
 
2436
2537
  /**
2437
2538
  * The MaterialElement interface provides properties and methods for manipulating
2438
- * `<pc-material>` elements. The MaterialElement interface also inherits the properties and
2439
- * methods of the {@link HTMLElement} interface.
2539
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-material/ | `<pc-material>`} elements.
2540
+ * The MaterialElement interface also inherits the properties and methods of the
2541
+ * {@link HTMLElement} interface.
2440
2542
  */
2441
2543
  class MaterialElement extends HTMLElement {
2442
2544
  constructor() {
@@ -2551,8 +2653,9 @@ customElements.define('pc-material', MaterialElement);
2551
2653
 
2552
2654
  /**
2553
2655
  * The RenderComponentElement interface provides properties and methods for manipulating
2554
- * `<pc-render>` elements. The RenderComponentElement interface also inherits the properties and
2555
- * methods of the {@link HTMLElement} interface.
2656
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-render/ | `<pc-render>`} elements.
2657
+ * The RenderComponentElement interface also inherits the properties and methods of the
2658
+ * {@link HTMLElement} interface.
2556
2659
  *
2557
2660
  * @category Components
2558
2661
  */
@@ -2574,7 +2677,7 @@ class RenderComponentElement extends ComponentElement {
2574
2677
  };
2575
2678
  }
2576
2679
  /**
2577
- * Gets the render component.
2680
+ * Gets the underlying PlayCanvas render component.
2578
2681
  * @returns The render component.
2579
2682
  */
2580
2683
  get component() {
@@ -2673,8 +2776,9 @@ customElements.define('pc-render', RenderComponentElement);
2673
2776
 
2674
2777
  /**
2675
2778
  * The RigidBodyComponentElement interface provides properties and methods for manipulating
2676
- * `<pc-rigidbody>` elements. The RigidBodyComponentElement interface also inherits the properties
2677
- * and methods of the {@link HTMLElement} interface.
2779
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-rigidbody/ | `<pc-rigidbody>`} elements.
2780
+ * The RigidBodyComponentElement interface also inherits the properties and methods of the
2781
+ * {@link HTMLElement} interface.
2678
2782
  *
2679
2783
  * @category Components
2680
2784
  */
@@ -2733,8 +2837,8 @@ class RigidBodyComponentElement extends ComponentElement {
2733
2837
  };
2734
2838
  }
2735
2839
  /**
2736
- * Gets the collision component.
2737
- * @returns The collision component.
2840
+ * Gets the underlying PlayCanvas rigidbody component.
2841
+ * @returns The rigidbody component.
2738
2842
  */
2739
2843
  get component() {
2740
2844
  return super.component;
@@ -2860,8 +2964,9 @@ customElements.define('pc-rigidbody', RigidBodyComponentElement);
2860
2964
 
2861
2965
  /**
2862
2966
  * The ScreenComponentElement interface provides properties and methods for manipulating
2863
- * `<pc-screen>` elements. The ScreenComponentElement interface also inherits the properties and
2864
- * methods of the {@link HTMLElement} interface.
2967
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-screen/ | `<pc-screen>`} elements.
2968
+ * The ScreenComponentElement interface also inherits the properties and methods of the
2969
+ * {@link HTMLElement} interface.
2865
2970
  *
2866
2971
  * @category Components
2867
2972
  */
@@ -2887,7 +2992,7 @@ class ScreenComponentElement extends ComponentElement {
2887
2992
  };
2888
2993
  }
2889
2994
  /**
2890
- * Gets the screen component.
2995
+ * Gets the underlying PlayCanvas screen component.
2891
2996
  * @returns The screen component.
2892
2997
  */
2893
2998
  get component() {
@@ -2986,8 +3091,9 @@ customElements.define('pc-screen', ScreenComponentElement);
2986
3091
 
2987
3092
  /**
2988
3093
  * The ScriptComponentElement interface provides properties and methods for manipulating
2989
- * `<pc-scripts>` elements. The ScriptComponentElement interface also inherits the properties and
2990
- * methods of the {@link HTMLElement} interface.
3094
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-scripts/ | `<pc-scripts>`} elements.
3095
+ * The ScriptComponentElement interface also inherits the properties and methods of the
3096
+ * {@link HTMLElement} interface.
2991
3097
  *
2992
3098
  * @category Components
2993
3099
  */
@@ -3137,7 +3243,7 @@ class ScriptComponentElement extends ComponentElement {
3137
3243
  (_a = super.disconnectedCallback) === null || _a === undefined ? undefined : _a.call(this);
3138
3244
  }
3139
3245
  /**
3140
- * Gets the script component.
3246
+ * Gets the underlying PlayCanvas script component.
3141
3247
  * @returns The script component.
3142
3248
  */
3143
3249
  get component() {
@@ -3229,8 +3335,9 @@ customElements.define('pc-script', ScriptElement);
3229
3335
 
3230
3336
  /**
3231
3337
  * The SoundComponentElement interface provides properties and methods for manipulating
3232
- * `<pc-sounds>` elements. The SoundComponentElement interface also inherits the properties and
3233
- * methods of the {@link HTMLElement} interface.
3338
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-sounds/ | `<pc-sounds>`} elements.
3339
+ * The SoundComponentElement interface also inherits the properties and methods of the
3340
+ * {@link HTMLElement} interface.
3234
3341
  *
3235
3342
  * @category Components
3236
3343
  */
@@ -3258,7 +3365,7 @@ class SoundComponentElement extends ComponentElement {
3258
3365
  };
3259
3366
  }
3260
3367
  /**
3261
- * Gets the sound component.
3368
+ * Gets the underlying PlayCanvas sound component.
3262
3369
  * @returns The sound component.
3263
3370
  */
3264
3371
  get component() {
@@ -3477,7 +3584,7 @@ class SoundSlotElement extends AsyncElement {
3477
3584
  return soundElement;
3478
3585
  }
3479
3586
  /**
3480
- * Sets the asset of the sound slot.
3587
+ * Sets the id of the `pc-asset` to use for the sound slot.
3481
3588
  * @param value - The asset.
3482
3589
  */
3483
3590
  set asset(value) {
@@ -3491,7 +3598,7 @@ class SoundSlotElement extends AsyncElement {
3491
3598
  }
3492
3599
  }
3493
3600
  /**
3494
- * Gets the asset of the sound slot.
3601
+ * Gets the id of the `pc-asset` to use for the sound slot.
3495
3602
  * @returns The asset.
3496
3603
  */
3497
3604
  get asset() {
@@ -3669,8 +3776,9 @@ customElements.define('pc-sound', SoundSlotElement);
3669
3776
 
3670
3777
  /**
3671
3778
  * The ModelElement interface provides properties and methods for manipulating
3672
- * `<pc-model>` elements. The ModelElement interface also inherits the properties and
3673
- * methods of the {@link HTMLElement} interface.
3779
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-model/ | `<pc-model>`} elements.
3780
+ * The ModelElement interface also inherits the properties and methods of the
3781
+ * {@link HTMLElement} interface.
3674
3782
  */
3675
3783
  class ModelElement extends AsyncElement {
3676
3784
  constructor() {
@@ -3733,7 +3841,7 @@ class ModelElement extends AsyncElement {
3733
3841
  this._entity = null;
3734
3842
  }
3735
3843
  /**
3736
- * Sets the asset ID of the model.
3844
+ * Sets the id of the `pc-asset` to use for the model.
3737
3845
  * @param value - The asset ID.
3738
3846
  */
3739
3847
  set asset(value) {
@@ -3743,8 +3851,8 @@ class ModelElement extends AsyncElement {
3743
3851
  }
3744
3852
  }
3745
3853
  /**
3746
- * Gets the source URL of the model.
3747
- * @returns The source URL of the model.
3854
+ * Gets the id of the `pc-asset` to use for the model.
3855
+ * @returns The asset ID.
3748
3856
  */
3749
3857
  get asset() {
3750
3858
  return this._asset;
@@ -3764,8 +3872,9 @@ customElements.define('pc-model', ModelElement);
3764
3872
 
3765
3873
  /**
3766
3874
  * The SceneElement interface provides properties and methods for manipulating
3767
- * `<pc-scene>` elements. The SceneElement interface also inherits the properties and
3768
- * methods of the {@link HTMLElement} interface.
3875
+ * {@link https://developer.playcanvas.com/user-manual/engine/web-components/tags/pc-scene/ | `<pc-scene>`} elements.
3876
+ * The SceneElement interface also inherits the properties and methods of the
3877
+ * {@link HTMLElement} interface.
3769
3878
  */
3770
3879
  class SceneElement extends AsyncElement {
3771
3880
  constructor() {
@@ -4003,66 +4112,126 @@ class SkyElement extends AsyncElement {
4003
4112
  this._scene.envAtlas = null;
4004
4113
  this._scene = null;
4005
4114
  }
4115
+ /**
4116
+ * Sets the id of the `pc-asset` to use for the skybox.
4117
+ * @param value - The asset ID.
4118
+ */
4006
4119
  set asset(value) {
4007
4120
  this._asset = value;
4008
4121
  if (this.isConnected) {
4009
4122
  this._loadSkybox();
4010
4123
  }
4011
4124
  }
4125
+ /**
4126
+ * Gets the id of the `pc-asset` to use for the skybox.
4127
+ * @returns The asset ID.
4128
+ */
4012
4129
  get asset() {
4013
4130
  return this._asset;
4014
4131
  }
4132
+ /**
4133
+ * Sets the center of the skybox.
4134
+ * @param value - The center.
4135
+ */
4015
4136
  set center(value) {
4016
4137
  this._center = value;
4017
4138
  if (this._scene) {
4018
4139
  this._scene.sky.center = this._center;
4019
4140
  }
4020
4141
  }
4142
+ /**
4143
+ * Gets the center of the skybox.
4144
+ * @returns The center.
4145
+ */
4021
4146
  get center() {
4022
4147
  return this._center;
4023
4148
  }
4149
+ /**
4150
+ * Sets the intensity of the skybox.
4151
+ * @param value - The intensity.
4152
+ */
4024
4153
  set intensity(value) {
4025
4154
  this._intensity = value;
4026
4155
  if (this._scene) {
4027
4156
  this._scene.skyboxIntensity = this._intensity;
4028
4157
  }
4029
4158
  }
4159
+ /**
4160
+ * Gets the intensity of the skybox.
4161
+ * @returns The intensity.
4162
+ */
4030
4163
  get intensity() {
4031
4164
  return this._intensity;
4032
4165
  }
4166
+ /**
4167
+ * Sets the mip level of the skybox.
4168
+ * @param value - The mip level.
4169
+ */
4033
4170
  set level(value) {
4034
4171
  this._level = value;
4035
4172
  if (this._scene) {
4036
4173
  this._scene.skyboxMip = this._level;
4037
4174
  }
4038
4175
  }
4176
+ /**
4177
+ * Gets the mip level of the skybox.
4178
+ * @returns The mip level.
4179
+ */
4039
4180
  get level() {
4040
4181
  return this._level;
4041
4182
  }
4183
+ /**
4184
+ * Sets whether the skybox is used as a light source.
4185
+ * @param value - Whether to use lighting.
4186
+ */
4042
4187
  set lighting(value) {
4043
4188
  this._lighting = value;
4044
4189
  }
4190
+ /**
4191
+ * Gets whether the skybox is used as a light source.
4192
+ * @returns Whether to use lighting.
4193
+ */
4045
4194
  get lighting() {
4046
4195
  return this._lighting;
4047
4196
  }
4197
+ /**
4198
+ * Sets the Euler rotation of the skybox.
4199
+ * @param value - The rotation.
4200
+ */
4048
4201
  set rotation(value) {
4049
4202
  this._rotation = value;
4050
4203
  if (this._scene) {
4051
4204
  this._scene.skyboxRotation = new playcanvas.Quat().setFromEulerAngles(value);
4052
4205
  }
4053
4206
  }
4207
+ /**
4208
+ * Gets the Euler rotation of the skybox.
4209
+ * @returns The rotation.
4210
+ */
4054
4211
  get rotation() {
4055
4212
  return this._rotation;
4056
4213
  }
4214
+ /**
4215
+ * Sets the scale of the skybox.
4216
+ * @param value - The scale.
4217
+ */
4057
4218
  set scale(value) {
4058
4219
  this._scale = value;
4059
4220
  if (this._scene) {
4060
4221
  this._scene.sky.node.setLocalScale(this._scale);
4061
4222
  }
4062
4223
  }
4224
+ /**
4225
+ * Gets the scale of the skybox.
4226
+ * @returns The scale.
4227
+ */
4063
4228
  get scale() {
4064
4229
  return this._scale;
4065
4230
  }
4231
+ /**
4232
+ * Sets the type of the skybox.
4233
+ * @param value - The type.
4234
+ */
4066
4235
  set type(value) {
4067
4236
  this._type = value;
4068
4237
  if (this._scene) {
@@ -4073,6 +4242,10 @@ class SkyElement extends AsyncElement {
4073
4242
  }
4074
4243
  }
4075
4244
  }
4245
+ /**
4246
+ * Gets the type of the skybox.
4247
+ * @returns The type.
4248
+ */
4076
4249
  get type() {
4077
4250
  return this._type;
4078
4251
  }
@@ -4118,7 +4291,6 @@ exports.CollisionComponentElement = CollisionComponentElement;
4118
4291
  exports.ComponentElement = ComponentElement;
4119
4292
  exports.ElementComponentElement = ElementComponentElement;
4120
4293
  exports.EntityElement = EntityElement;
4121
- exports.GSplatComponentElement = GSplatComponentElement;
4122
4294
  exports.LightComponentElement = LightComponentElement;
4123
4295
  exports.ListenerComponentElement = ListenerComponentElement;
4124
4296
  exports.MaterialElement = MaterialElement;
@@ -4133,4 +4305,5 @@ exports.ScriptElement = ScriptElement;
4133
4305
  exports.SkyElement = SkyElement;
4134
4306
  exports.SoundComponentElement = SoundComponentElement;
4135
4307
  exports.SoundSlotElement = SoundSlotElement;
4308
+ exports.SplatComponentElement = SplatComponentElement;
4136
4309
  //# sourceMappingURL=pwc.cjs.map