three-live 1.2.4 → 1.3.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.
Files changed (42) hide show
  1. package/README.md +2 -2
  2. package/dist/index.d.ts +58 -0
  3. package/dist/three-author-engine.js +89 -63
  4. package/dist/three-author.cjs +88 -62
  5. package/dist/three-author.d.ts +58 -0
  6. package/dist/three-author.js +87 -61
  7. package/dist/three-convert.cjs +81 -59
  8. package/dist/three-convert.d.ts +58 -0
  9. package/dist/three-convert.js +80 -58
  10. package/dist/three-live-animation.cjs +8 -9
  11. package/dist/three-live-animation.d.ts +58 -0
  12. package/dist/three-live-animation.js +7 -8
  13. package/dist/three-live-animation.min.js +6 -7
  14. package/dist/three-live-cad.cjs +3 -4
  15. package/dist/three-live-cad.d.ts +58 -0
  16. package/dist/three-live-cad.js +2 -3
  17. package/dist/three-live-cad.min.js +3 -4
  18. package/dist/three-live-cli.js +231 -0
  19. package/dist/three-live-element.cjs +20 -21
  20. package/dist/three-live-element.d.ts +58 -0
  21. package/dist/three-live-element.js +19 -20
  22. package/dist/three-live-full.cjs +113 -87
  23. package/dist/three-live-full.js +110 -84
  24. package/dist/three-live-full.min.js +113 -87
  25. package/dist/three-live-studio.cjs +19 -20
  26. package/dist/three-live-studio.d.ts +58 -0
  27. package/dist/three-live-studio.js +18 -19
  28. package/dist/three-live-studio.min.js +18 -19
  29. package/dist/three-live-viewer.cjs +20 -21
  30. package/dist/three-live-viewer.d.ts +58 -0
  31. package/dist/three-live-viewer.js +19 -20
  32. package/dist/three-live-viewer.min.js +20 -21
  33. package/dist/three-live.cjs +90 -64
  34. package/dist/three-live.js +89 -63
  35. package/dist/three-live.min.js +89 -63
  36. package/dist/three-view.cjs +18 -19
  37. package/dist/three-view.d.ts +58 -0
  38. package/dist/three-view.js +19 -20
  39. package/dist/three-xr.cjs +81 -59
  40. package/dist/three-xr.d.ts +58 -0
  41. package/dist/three-xr.js +80 -58
  42. package/package.json +7 -1
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Lightweight `<three-live>` web component for 3D, AR, and sandboxed procedural
4
4
  Three.js. Part of [Three-Live](https://github.com/google/three-live).
5
5
 
6
- > Developer Preview. APIs may change before a stable release.
6
+ > Status: **Beta**. Minor API details may evolve before General Availability (GA).
7
7
 
8
8
  ## Install
9
9
 
@@ -46,7 +46,7 @@ display existing models only, use the viewer-only build:
46
46
  | :--- | :--- |
47
47
  | `dist/three-live-viewer.min.js` | Viewer only: `.glb` display, PBR, orbit controls, animation |
48
48
  | `dist/three-live.min.js` | Standard: viewer + sandboxed `<script type="text/three">` + AR handoff |
49
- | `dist/three-live-studio.min.js` | Add-on: PBR Next, HDRI/SH, `bloom`/`outline`, `KHR_materials_variants`, `EXT_meshopt_compression`, `KHR_interactivity` VM, hotspots |
49
+ | `dist/three-live-studio.min.js` | Add-on: PBR Next, HDRI/SH, `bloom`/`outline`, `KHR_materials_variants`, `EXT_meshopt_compression`, `KHR_interactivity` VM, `lod` (`THREE.LOD` / `MSFT_lod`), hotspots |
50
50
  | `dist/three-live-cad.min.js` | Add-on: 2D `Path`/`Shape`, `ExtrudeGeometry`, 3D `CSG` Booleans, stroke-font `TextGeometry` |
51
51
  | `dist/three-live-animation.min.js` | Add-on: 64-joint skinning, morph targets, keyframe cross-fading, 2-bone/FABRIK `IKSolver` |
52
52
  | `dist/three-live-full.min.js` | Standard + all plugins (`studio`, `cad`, `animation`) |
package/dist/index.d.ts CHANGED
@@ -87,6 +87,20 @@ export {
87
87
  type InteractivityValueSocket,
88
88
  type InteractivityVariableDef,
89
89
  } from './three-live/src/plugins/interactivity';
90
+ export {
91
+ decimateGeometry,
92
+ getLodController,
93
+ installLodExtension,
94
+ LOD,
95
+ LodController,
96
+ lodPlugin,
97
+ materializeLodGeometry,
98
+ parseLod,
99
+ selectLodLevelIndex,
100
+ type LodGroupState,
101
+ type LodLevel,
102
+ type LodOptions,
103
+ } from './three-live/src/plugins/lod';
90
104
  export {
91
105
  applyMeshoptFilter,
92
106
  decodeMeshoptBuffer,
@@ -130,6 +144,8 @@ export {
130
144
  } from './xr-live/src/xr-live-element';
131
145
  /** Optional spatial plugins (`xr-live/spatial`, `xr-live-spatial.min.js`). */
132
146
  export * from './xr-live/src/plugins/index';
147
+ /** Optional simulation plugins (`xr-live/sim`, `xr-live-sim.min.js`). */
148
+ export * from './xr-live/src/sim/index';
133
149
 
134
150
  /**
135
151
  * Declarative JSX / HTML attributes supported by the <three-live> custom element.
@@ -169,6 +185,18 @@ export interface ThreeLiveAttributes {
169
185
  'shadow-softness'?: number | string;
170
186
  /** Tone mapping mode ("neutral", "aces", "agx", "reinhard", "none"). */
171
187
  'tone-mapping'?: string;
188
+ /** Dual-Kawase bloom intensity (0.0 to 5.0). */
189
+ 'bloom'?: number | string;
190
+ /** Luminance threshold for bloom extraction (default: 0.8). */
191
+ 'bloom-threshold'?: number | string;
192
+ /** Blur radius multiplier for bloom passes (default: 0.5). */
193
+ 'bloom-radius'?: number | string;
194
+ /** Declarative silhouette outline toggle or config. */
195
+ 'outline'?: boolean | string;
196
+ /** Highlight the currently `selected-mesh` with a silhouette outline. */
197
+ 'outline-selected'?: boolean | string;
198
+ /** Silhouette outline CSS hex color (default: "#38bdf8"). */
199
+ 'outline-color'?: string;
172
200
  /** Enable or disable interactive camera orbit/pan/zoom controls (default: true). */
173
201
  'camera-controls'?: boolean | string;
174
202
  /** Automatically start keyframe animation playback. */
@@ -210,6 +238,16 @@ export interface ThreeLiveAttributes {
210
238
  // React 19 / JSX Event Listeners
211
239
  onload?: (e: CustomEvent<{model: GLBData}>) => void;
212
240
  onerror?: (e: CustomEvent<{error: any}>) => void;
241
+ 'onthree-load'?: (
242
+ e: CustomEvent<{model: GLBData; source?: 'src' | 'model'}>,
243
+ ) => void;
244
+ 'onthree-error'?: (
245
+ e: CustomEvent<{error: any; message: string; stage: string}>,
246
+ ) => void;
247
+ 'onthree-context-lost'?: (e: CustomEvent<{originalEvent?: Event}>) => void;
248
+ 'onthree-context-restored'?: (
249
+ e: CustomEvent<{originalEvent?: Event}>,
250
+ ) => void;
213
251
  onmeshclick?: (e: CustomEvent<HitDetail>) => void;
214
252
  'oncamera-change'?: (e: CustomEvent<CameraDetail>) => void;
215
253
  'onvariant-applied'?: (e: CustomEvent<{variantName: string | null}>) => void;
@@ -427,7 +465,27 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
427
465
  sdpMLineIndex: number | null;
428
466
  }>,
429
467
  ) => void;
468
+ onxraudioplay?: (
469
+ e: CustomEvent<{
470
+ node: string;
471
+ meshIndex: number;
472
+ preset: string | null;
473
+ src: string | null;
474
+ gain: number;
475
+ pan: number;
476
+ triggerCount: number;
477
+ }>,
478
+ ) => void;
430
479
  /** xr-live-sim events. */
480
+ onxrcollision?: (
481
+ e: CustomEvent<{
482
+ nodeId: string;
483
+ otherId: string;
484
+ normal: [number, number, number];
485
+ impactSpeed: number;
486
+ }>,
487
+ ) => void;
488
+ onxrsleep?: (e: CustomEvent<{nodeId: string}>) => void;
431
489
  oncharacterjump?: (
432
490
  e: CustomEvent<{nodeId: string; position: [number, number, number]}>,
433
491
  ) => void;