@playcanvas/web-components 0.2.3 → 0.2.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcanvas/web-components",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "author": "PlayCanvas <support@playcanvas.com>",
5
5
  "homepage": "https://playcanvas.com",
6
6
  "description": "Web Components for the PlayCanvas Engine",
@@ -40,24 +40,24 @@
40
40
  "@mediapipe/tasks-vision": "0.10.21",
41
41
  "@playcanvas/eslint-config": "2.0.9",
42
42
  "@rollup/plugin-commonjs": "28.0.3",
43
- "@rollup/plugin-node-resolve": "16.0.0",
43
+ "@rollup/plugin-node-resolve": "16.0.1",
44
44
  "@rollup/plugin-terser": "0.4.4",
45
45
  "@rollup/plugin-typescript": "12.1.2",
46
46
  "@tweenjs/tween.js": "25.0.0",
47
- "@typescript-eslint/eslint-plugin": "8.26.1",
48
- "@typescript-eslint/parser": "8.26.1",
47
+ "@typescript-eslint/eslint-plugin": "8.28.0",
48
+ "@typescript-eslint/parser": "8.28.0",
49
49
  "concurrently": "9.1.2",
50
50
  "earcut": "3.0.1",
51
- "eslint": "9.22.0",
52
- "eslint-import-resolver-typescript": "3.8.4",
51
+ "eslint": "9.23.0",
52
+ "eslint-import-resolver-typescript": "4.2.2",
53
53
  "globals": "16.0.0",
54
54
  "mp4-muxer": "5.2.0",
55
55
  "opentype.js": "1.3.4",
56
- "playcanvas": "2.5.1",
57
- "rollup": "4.35.0",
56
+ "playcanvas": "2.6.0",
57
+ "rollup": "4.37.0",
58
58
  "serve": "14.2.4",
59
59
  "tslib": "2.8.1",
60
- "typedoc": "0.27.9",
60
+ "typedoc": "0.28.1",
61
61
  "typedoc-plugin-mdn-links": "5.0.1",
62
62
  "typescript": "5.8.2"
63
63
  }
package/src/asset.ts CHANGED
@@ -28,7 +28,7 @@ const extToType = new Map([
28
28
  const processBufferView = (
29
29
  gltfBuffer: any,
30
30
  buffers: Array<any>,
31
- continuation: (err: string, result: any) => void
31
+ continuation: (err: string | null, result: any) => void
32
32
  ) => {
33
33
  if (gltfBuffer.extensions && gltfBuffer.extensions.EXT_meshopt_compression) {
34
34
  const extensionDef = gltfBuffer.extensions.EXT_meshopt_compression;
@@ -52,6 +52,8 @@ class LightComponentElement extends ComponentElement {
52
52
 
53
53
  private _vsmBias = 0.01;
54
54
 
55
+ private _vsmBlurSize = 11;
56
+
55
57
  /** @ignore */
56
58
  constructor() {
57
59
  super('light');
@@ -72,7 +74,8 @@ class LightComponentElement extends ComponentElement {
72
74
  shadowResolution: this._shadowResolution,
73
75
  shadowType: shadowTypes.get(this._shadowType),
74
76
  type: this._type,
75
- vsmBias: this._vsmBias
77
+ vsmBias: this._vsmBias,
78
+ vsmBlurSize: this._vsmBlurSize
76
79
  };
77
80
  }
78
81
 
@@ -365,6 +368,25 @@ class LightComponentElement extends ComponentElement {
365
368
  return this._vsmBias;
366
369
  }
367
370
 
371
+ /**
372
+ * Sets the VSM blur size of the light. Minimum is 1, maximum is 25. Default is 11.
373
+ * @param value - The VSM blur size.
374
+ */
375
+ set vsmBlurSize(value: number) {
376
+ this._vsmBlurSize = value;
377
+ if (this.component) {
378
+ this.component.vsmBlurSize = value;
379
+ }
380
+ }
381
+
382
+ /**
383
+ * Gets the VSM blur size of the light.
384
+ * @returns The VSM blur size.
385
+ */
386
+ get vsmBlurSize() {
387
+ return this._vsmBlurSize;
388
+ }
389
+
368
390
  static get observedAttributes() {
369
391
  return [
370
392
  ...super.observedAttributes,
@@ -381,7 +403,8 @@ class LightComponentElement extends ComponentElement {
381
403
  'shadow-resolution',
382
404
  'shadow-type',
383
405
  'type',
384
- 'vsm-bias'
406
+ 'vsm-bias',
407
+ 'vsm-blur-size'
385
408
  ];
386
409
  }
387
410
 
@@ -431,6 +454,9 @@ class LightComponentElement extends ComponentElement {
431
454
  case 'vsm-bias':
432
455
  this.vsmBias = Number(newValue);
433
456
  break;
457
+ case 'vsm-blur-size':
458
+ this.vsmBlurSize = Number(newValue);
459
+ break;
434
460
  }
435
461
  }
436
462
  }
@@ -50,7 +50,6 @@ class SoundSlotElement extends AsyncElement {
50
50
 
51
51
  this.soundSlot = this.soundElement!.component!.addSlot(this._name, options);
52
52
  this.asset = this._asset;
53
- this.soundSlot!.play();
54
53
 
55
54
  this._onReady();
56
55
  }
@@ -245,7 +244,7 @@ class SoundSlotElement extends AsyncElement {
245
244
  }
246
245
 
247
246
  static get observedAttributes() {
248
- return ['asset', 'autoPlay', 'duration', 'loop', 'name', 'overlap', 'pitch', 'startTime', 'volume'];
247
+ return ['asset', 'auto-play', 'duration', 'loop', 'name', 'overlap', 'pitch', 'start-time', 'volume'];
249
248
  }
250
249
 
251
250
  attributeChangedCallback(name: string, _oldValue: string, newValue: string) {
@@ -253,6 +252,9 @@ class SoundSlotElement extends AsyncElement {
253
252
  case 'asset':
254
253
  this.asset = newValue;
255
254
  break;
255
+ case 'auto-play':
256
+ this.autoPlay = this.hasAttribute('auto-play');
257
+ break;
256
258
  case 'duration':
257
259
  this.duration = parseFloat(newValue);
258
260
  break;
@@ -268,7 +270,7 @@ class SoundSlotElement extends AsyncElement {
268
270
  case 'pitch':
269
271
  this.pitch = parseFloat(newValue);
270
272
  break;
271
- case 'startTime':
273
+ case 'start-time':
272
274
  this.startTime = parseFloat(newValue);
273
275
  break;
274
276
  case 'volume':
package/src/sky.ts CHANGED
@@ -61,6 +61,7 @@ class SkyElement extends AsyncElement {
61
61
  this._scene.sky.node.setLocalScale(this._scale);
62
62
  this._scene.sky.center = this._center;
63
63
  this._scene.skyboxIntensity = this._intensity;
64
+ this._scene.skyboxMip = this._level;
64
65
  }
65
66
 
66
67
  private async _loadSkybox() {