@playcanvas/supersplat-viewer 1.42.1 → 1.43.1

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.
Binary file
package/docs/api.md CHANGED
@@ -49,6 +49,8 @@ renderViewerHtml({
49
49
 
50
50
  `gsafDecoderUrl` is also a `createViewer` option, for a host serving the wasm from elsewhere. It has no URL parameter, since a link could then run any wasm in the page's origin.
51
51
 
52
+ Version 4 `.spz` files, on their own or as the chunks of an `.lcc2` scene, are decompressed by the engine's ZSTD decoder, `zstd-decoder.wasm`, which ships and is fetched the same way: beside `index.js` (and `dist/viewer.js`), only when such a file loads. Its glue is loaded from a `blob:` url, so a page's Content-Security-Policy has to allow `blob:` scripts. `zstdDecoderUrl`, a bootstrap field and `createViewer` option with no URL parameter, points it elsewhere, e.g. a `data:` url for a document with no sibling files.
53
+
52
54
  `html` is still exported as a raw string, but is **deprecated**: its formatting is not part of
53
55
  this package's API and changes between releases, so pattern-matching it is unsupported. `css`
54
56
  and `js` remain exported for serving (or writing) the stylesheet and bundle alongside a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcanvas/supersplat-viewer",
3
- "version": "1.42.1",
3
+ "version": "1.43.1",
4
4
  "author": "PlayCanvas <support@playcanvas.com>",
5
5
  "homepage": "https://github.com/playcanvas/supersplat-viewer#readme",
6
6
  "description": "Viewer for https://superspl.at",
@@ -50,6 +50,7 @@
50
50
  "public/index.js",
51
51
  "public/index.js.map",
52
52
  "public/gsaf-decoder.wasm",
53
+ "public/zstd-decoder.wasm",
53
54
  "docs/api.md",
54
55
  "LICENSE",
55
56
  "THIRD_PARTY_NOTICES.md",
@@ -57,7 +58,7 @@
57
58
  "README.md"
58
59
  ],
59
60
  "peerDependencies": {
60
- "playcanvas": "^2.23.0"
61
+ "playcanvas": "^2.24.0"
61
62
  },
62
63
  "peerDependenciesMeta": {
63
64
  "playcanvas": {
@@ -68,20 +69,20 @@
68
69
  "@playcanvas/eslint-config": "3.0.0",
69
70
  "@rollup/plugin-json": "6.1.0",
70
71
  "@rollup/plugin-node-resolve": "16.0.3",
71
- "@rollup/plugin-typescript": "12.3.0",
72
- "autoprefixer": "10.6.1",
72
+ "@rollup/plugin-typescript": "12.3.1",
73
+ "autoprefixer": "10.6.2",
73
74
  "concurrently": "9.2.5",
74
75
  "eslint": "9.39.5",
75
- "playcanvas": "2.23.3",
76
- "postcss": "8.5.31",
76
+ "playcanvas": "2.24.0",
77
+ "postcss": "8.5.32",
77
78
  "prettier": "3.9.10",
78
79
  "publint": "0.3.25",
79
- "rollup": "4.64.12",
80
+ "rollup": "4.68.2",
80
81
  "rollup-plugin-dts": "6.5.1",
81
82
  "rollup-plugin-scss": "4.0.1",
82
83
  "rollup-plugin-string": "3.0.0",
83
- "sass": "1.106.0",
84
- "serve": "14.2.6",
84
+ "sass": "1.108.1",
85
+ "serve": "14.2.7",
85
86
  "typescript": "5.9.3"
86
87
  },
87
88
  "scripts": {
package/public/index.css CHANGED
@@ -385,8 +385,12 @@
385
385
  display: flex;
386
386
  gap: 8px;
387
387
  }
388
+ .sse-viewer .sse-controlsWrap > .sse-buttonsContainer > .sse-spacer {
389
+ margin-right: -8px;
390
+ }
388
391
  .sse-viewer .sse-controlsWrap > .sse-buttonsContainer .sse-buttonGroup {
389
392
  display: flex;
393
+ min-width: 0;
390
394
  background-color: rgba(0, 0, 0, 0.3);
391
395
  border-radius: 6px;
392
396
  }
@@ -398,7 +402,8 @@
398
402
  }
399
403
  .sse-viewer .sse-controlsWrap > .sse-buttonsContainer .sse-controlButton {
400
404
  width: 34px;
401
- height: 34px;
405
+ min-width: 0;
406
+ aspect-ratio: 1;
402
407
  padding: 0;
403
408
  margin: 0;
404
409
  border: 0;
@@ -415,6 +420,9 @@
415
420
  .sse-viewer .sse-controlsWrap > .sse-buttonsContainer .sse-controlButton > svg {
416
421
  display: block;
417
422
  margin: auto;
423
+ width: 70.5882352941%;
424
+ height: auto;
425
+ aspect-ratio: 1;
418
426
  }
419
427
  .sse-viewer .sse-controlsWrap > .sse-buttonsContainer .sse-controlButton > svg > g.sse-stroke {
420
428
  fill: none;
package/public/index.html CHANGED
@@ -57,6 +57,7 @@
57
57
  const contentUrl = url.searchParams.get('content') ?? bootstrap.contentUrl ?? './scene.compressed.ply';
58
58
  // the bootstrap's alone: a url param would let a link run any wasm in this origin
59
59
  const gsafDecoderUrl = bootstrap.gsafDecoderUrl ?? null;
60
+ const zstdDecoderUrl = bootstrap.zstdDecoderUrl ?? null;
60
61
 
61
62
  // Names the bootstrap's contentUrl when the url itself has no usable name (a data:
62
63
  // uri, say) — the splat format is chosen by the name's extension. Ignored when a
@@ -68,12 +69,18 @@
68
69
  const budgetParam = url.searchParams.get('budget');
69
70
  const budget = budgetParam !== null ? Number(budgetParam) : undefined;
70
71
 
71
- // The engine's octree parser fetches lod-meta.json itself and ignores a prefetched
72
- // response, so starting one here would download the metadata twice. Every other splat
72
+ // The engine's octree and lcc2 parsers fetch lod-meta.json and .lcc2 files themselves
73
+ // and ignore a prefetched response, so starting one here would download the metadata
74
+ // twice, and the spz parser cannot read a prefetched response. Every other splat
73
75
  // parser consumes it, so they keep the head start. `isPrefetchable` in src/index.ts
74
76
  // applies the same rule for embedders that do not pass `contents`.
75
- const contentName = contentFilename ?? new URL(contentUrl, location.href).pathname.split('/').pop() ?? '';
76
- const prefetchContent = contentName.toLowerCase() !== 'lod-meta.json';
77
+ const contentName = (
78
+ contentFilename ??
79
+ new URL(contentUrl, location.href).pathname.split('/').pop() ??
80
+ ''
81
+ ).toLowerCase();
82
+ const prefetchContent =
83
+ contentName !== 'lod-meta.json' && !contentName.endsWith('.lcc2') && !contentName.endsWith('.spz');
77
84
 
78
85
  // createViewer's options, minus the container and the settings. The poster image and
79
86
  // the content fetch start here, before the module bundle has arrived.
@@ -84,6 +91,7 @@
84
91
  skyboxUrl,
85
92
  collisionUrl,
86
93
  gsafDecoderUrl,
94
+ zstdDecoderUrl,
87
95
  poster: posterUrl && createImage(posterUrl),
88
96
  contents: prefetchContent ? fetch(contentUrl) : undefined,
89
97
  ui: !url.searchParams.has('noui'),
@@ -96,7 +104,9 @@
96
104
  ministats: url.searchParams.has('ministats'),
97
105
  colorize: url.searchParams.has('colorize'),
98
106
  renderer,
99
- aa: url.searchParams.has('aa'),
107
+ aa: url.searchParams.has('aa')
108
+ ? ['', '1', 'true', 'enable'].includes(url.searchParams.get('aa'))
109
+ : undefined,
100
110
  stochastic: url.searchParams.has('stochastic')
101
111
  ? url.searchParams.get('stochastic') === 'mobile'
102
112
  ? 'mobile'