three-live 1.3.2 → 1.4.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.
- package/README.md +4 -1
- package/dist/index.d.ts +190 -0
- package/dist/three-author-engine.js +171 -163
- package/dist/three-author.cjs +145 -163
- package/dist/three-author.d.ts +190 -0
- package/dist/three-author.js +145 -163
- package/dist/three-convert.cjs +142 -160
- package/dist/three-convert.d.ts +190 -0
- package/dist/three-convert.js +142 -160
- package/dist/three-live-ai.cjs +41 -0
- package/dist/three-live-ai.d.ts +759 -0
- package/dist/three-live-ai.js +41 -0
- package/dist/three-live-ai.min.js +41 -0
- package/dist/three-live-animation.cjs +6 -6
- package/dist/three-live-animation.d.ts +190 -0
- package/dist/three-live-animation.js +5 -5
- package/dist/three-live-animation.min.js +5 -5
- package/dist/three-live-cad.cjs +2 -2
- package/dist/three-live-cad.d.ts +190 -0
- package/dist/three-live-cad.js +2 -2
- package/dist/three-live-cad.min.js +2 -2
- package/dist/three-live-element.cjs +50 -85
- package/dist/three-live-element.d.ts +190 -0
- package/dist/three-live-element.js +50 -85
- package/dist/three-live-full.cjs +907 -189
- package/dist/three-live-full.js +907 -189
- package/dist/three-live-full.min.js +907 -189
- package/dist/three-live-procedural.cjs +16 -0
- package/dist/three-live-procedural.d.ts +759 -0
- package/dist/three-live-procedural.js +16 -0
- package/dist/three-live-procedural.min.js +16 -0
- package/dist/three-live-sandbox.html +11 -1
- package/dist/three-live-studio.cjs +72 -17
- package/dist/three-live-studio.d.ts +190 -0
- package/dist/three-live-studio.js +72 -17
- package/dist/three-live-studio.min.js +73 -18
- package/dist/three-live-tsl.cjs +103 -0
- package/dist/three-live-tsl.d.ts +759 -0
- package/dist/three-live-tsl.js +103 -0
- package/dist/three-live-tsl.min.js +103 -0
- package/dist/three-live-viewer.cjs +50 -85
- package/dist/three-live-viewer.d.ts +190 -0
- package/dist/three-live-viewer.js +50 -85
- package/dist/three-live-viewer.min.js +50 -85
- package/dist/three-live-webgpu.cjs +585 -0
- package/dist/three-live-webgpu.d.ts +759 -0
- package/dist/three-live-webgpu.js +585 -0
- package/dist/three-live-webgpu.min.js +585 -0
- package/dist/three-live.cjs +147 -165
- package/dist/three-live.js +147 -165
- package/dist/three-live.min.js +147 -165
- package/dist/three-view.cjs +49 -84
- package/dist/three-view.d.ts +190 -0
- package/dist/three-view.js +50 -85
- package/dist/three-xr.cjs +141 -159
- package/dist/three-xr.d.ts +190 -0
- package/dist/three-xr.js +140 -158
- package/package.json +21 -1
package/README.md
CHANGED
|
@@ -48,8 +48,11 @@ display existing models only, use the viewer-only build:
|
|
|
48
48
|
| `dist/three-live.min.js` | Standard: viewer + sandboxed `<script type="text/three">` + AR handoff |
|
|
49
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
|
+
| `dist/three-live-procedural.min.js` | Add-on: `Box3`/`Sphere`, `CanvasTexture`, `Noise`, `ProceduralTexture`, `Sprite`, 2D curves, scene helpers |
|
|
51
52
|
| `dist/three-live-animation.min.js` | Add-on: 64-joint skinning, morph targets, keyframe cross-fading, 2-bone/FABRIK `IKSolver` |
|
|
52
|
-
| `dist/three-live-
|
|
53
|
+
| `dist/three-live-ai.min.js` | Add-on: bring-your-own-LLM scene editing (`editScene()`, `undoEdit()`) & Tap & Speak voice |
|
|
54
|
+
| `dist/three-live-webgpu.min.js` | Add-on: WebGPU `GPURenderBundle` scene accelerator (`renderer="auto\|webgpu\|webgl2"`) |
|
|
55
|
+
| `dist/three-live-full.min.js` | Standard + all plugins (`studio`, `cad`, `procedural`, `animation`, `ai`, `webgpu`) |
|
|
53
56
|
<!-- mdformat on -->
|
|
54
57
|
|
|
55
58
|
ES module and CommonJS builds are available through the package `exports`.
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
import type {
|
|
22
22
|
CameraState,
|
|
23
|
+
ShadowMapsMode,
|
|
23
24
|
ThreeLiveElement,
|
|
24
25
|
} from './three-live/src/three-live-element';
|
|
25
26
|
import type {
|
|
@@ -118,6 +119,27 @@ export {
|
|
|
118
119
|
postprocessingPlugin,
|
|
119
120
|
resolveViewerBloom,
|
|
120
121
|
} from './three-live/src/plugins/postprocessing';
|
|
122
|
+
export {
|
|
123
|
+
installProceduralExtension,
|
|
124
|
+
proceduralPlugin,
|
|
125
|
+
} from './three-live/src/plugins/procedural';
|
|
126
|
+
export {
|
|
127
|
+
computeWorldSceneBounds,
|
|
128
|
+
doesMeshCastShadow,
|
|
129
|
+
doesMeshReceiveShadow,
|
|
130
|
+
fitDirectionalShadowMatrix,
|
|
131
|
+
fitSpotShadowMatrix,
|
|
132
|
+
getShadowMapStats,
|
|
133
|
+
MAX_SHADOW_LIGHTS,
|
|
134
|
+
normalizeShadowMapsMode,
|
|
135
|
+
resolveActiveShadowLights,
|
|
136
|
+
SHADOW_MAP_TEXTURE_UNIT,
|
|
137
|
+
shadowMapsPlugin,
|
|
138
|
+
type ResolvedShadowPlan,
|
|
139
|
+
type ResolvedShadowSlice,
|
|
140
|
+
type ShadowMapStats,
|
|
141
|
+
type WorldSceneBounds,
|
|
142
|
+
} from './three-live/src/plugins/shadow-maps';
|
|
121
143
|
export {
|
|
122
144
|
extractMaterialVariants,
|
|
123
145
|
extractPrimitiveVariantMappings,
|
|
@@ -143,10 +165,144 @@ export {
|
|
|
143
165
|
type XRProfile,
|
|
144
166
|
type XRSimulatorRoom,
|
|
145
167
|
} from './xr-live/src/xr-live-element';
|
|
168
|
+
/** Opt-in bring-your-own-LLM scene editing (`three-live/ai`, `three-live-ai.min.js`). */
|
|
169
|
+
export {
|
|
170
|
+
aiPlugin,
|
|
171
|
+
createAIChatProvider,
|
|
172
|
+
editScene,
|
|
173
|
+
extractScript,
|
|
174
|
+
undoEdit,
|
|
175
|
+
} from './three-live/src/plugins/ai';
|
|
176
|
+
export type {
|
|
177
|
+
AIChatContentPart,
|
|
178
|
+
AIChatMessage,
|
|
179
|
+
AIChatProviderOptions,
|
|
180
|
+
EditSceneOptions,
|
|
181
|
+
EditSceneResult,
|
|
182
|
+
ThreeLiveAIProvider,
|
|
183
|
+
} from './three-live/src/plugins/ai';
|
|
184
|
+
export {
|
|
185
|
+
buildImageMessages,
|
|
186
|
+
buildImageUserText,
|
|
187
|
+
compileFromImage,
|
|
188
|
+
detectImageMime,
|
|
189
|
+
formatSpatialPriors,
|
|
190
|
+
IMAGE_SYSTEM_PROMPT,
|
|
191
|
+
imageRepairMessage,
|
|
192
|
+
isAllowedImageUrl,
|
|
193
|
+
normalizeImageInput,
|
|
194
|
+
} from './three-live/src/plugins/ai-image';
|
|
195
|
+
export type {
|
|
196
|
+
AIImageInput,
|
|
197
|
+
AISpatialCamera,
|
|
198
|
+
AISpatialObject,
|
|
199
|
+
AISpatialPlane,
|
|
200
|
+
AISpatialPriors,
|
|
201
|
+
CompileFromImageOptions,
|
|
202
|
+
} from './three-live/src/plugins/ai-image';
|
|
203
|
+
/** AI PBR textures: texture packs and image providers (part of `three-live-ai.min.js`). */
|
|
204
|
+
export {
|
|
205
|
+
browserImageCodec,
|
|
206
|
+
createAIImageProvider,
|
|
207
|
+
indexedDbTextureCache,
|
|
208
|
+
parseTexturePack,
|
|
209
|
+
prepareAlbedo,
|
|
210
|
+
serializeTexturePack,
|
|
211
|
+
TEXTURE_PROMPT_SUFFIX,
|
|
212
|
+
textureRequests,
|
|
213
|
+
} from './three-live/src/plugins/ai-texture';
|
|
214
|
+
export type {
|
|
215
|
+
AIImageProviderOptions,
|
|
216
|
+
AITextureSpec,
|
|
217
|
+
GenerateTexturesOptions,
|
|
218
|
+
GenerateTexturesResult,
|
|
219
|
+
TextureCache,
|
|
220
|
+
TextureCacheRecord,
|
|
221
|
+
TextureImageCodec,
|
|
222
|
+
TextureMiss,
|
|
223
|
+
TexturePackEntry,
|
|
224
|
+
TexturePackJSON,
|
|
225
|
+
ThreeLiveImageProvider,
|
|
226
|
+
} from './three-live/src/plugins/ai-texture';
|
|
227
|
+
/** "Tap & Speak" voice editing (part of `three-live-ai.min.js`). */
|
|
228
|
+
export {
|
|
229
|
+
hideSelectionChips,
|
|
230
|
+
showSelectionChips,
|
|
231
|
+
} from './three-live/src/plugins/ai-select-chips';
|
|
232
|
+
export type {AISelectChipsState} from './three-live/src/plugins/ai-select-chips';
|
|
233
|
+
export {
|
|
234
|
+
AIVoiceSession,
|
|
235
|
+
connectVoice,
|
|
236
|
+
createWebSpeechRecognizer,
|
|
237
|
+
describeEditResult,
|
|
238
|
+
describeVoiceSelection,
|
|
239
|
+
geminiLiveAdapter,
|
|
240
|
+
realtimeAdapter,
|
|
241
|
+
selectByVoice,
|
|
242
|
+
selectNamesByVoice,
|
|
243
|
+
setSelectOnTap,
|
|
244
|
+
speakableName,
|
|
245
|
+
startVoiceEdit,
|
|
246
|
+
} from './three-live/src/plugins/ai-voice';
|
|
247
|
+
/** Multi-select for Tap & Speak / Talk-to-Select (part of `three-live-ai.min.js`). */
|
|
248
|
+
export {
|
|
249
|
+
describeSelection,
|
|
250
|
+
getSelection,
|
|
251
|
+
parseSelectReply,
|
|
252
|
+
resolveSelection,
|
|
253
|
+
resolveSelectionWithModel,
|
|
254
|
+
sceneSelectEntries,
|
|
255
|
+
selectCamera,
|
|
256
|
+
selectMessages,
|
|
257
|
+
setSelection,
|
|
258
|
+
} from './three-live/src/plugins/ai-select';
|
|
259
|
+
export type {
|
|
260
|
+
AIModelSelection,
|
|
261
|
+
AISelectProvider,
|
|
262
|
+
} from './three-live/src/plugins/ai-select';
|
|
263
|
+
/** Talk-to-Select tier-1 matcher and push-to-talk grammar (mirrors the Rust core). */
|
|
264
|
+
export type {
|
|
265
|
+
AISelectionEventDetail,
|
|
266
|
+
AISelectionMode,
|
|
267
|
+
AISelectionSource,
|
|
268
|
+
} from './three-live/src/plugins/ai-select';
|
|
269
|
+
export {
|
|
270
|
+
buildSelectIndex,
|
|
271
|
+
matchSelection,
|
|
272
|
+
parseVoiceCommand,
|
|
273
|
+
} from './three-live/src/plugins/ai-select-match';
|
|
274
|
+
export type {
|
|
275
|
+
SelectCamera,
|
|
276
|
+
SelectConfidence,
|
|
277
|
+
SelectIndexEntry,
|
|
278
|
+
SelectMatch,
|
|
279
|
+
SelectRawEntry,
|
|
280
|
+
VoiceCommand,
|
|
281
|
+
} from './three-live/src/plugins/ai-select-match';
|
|
282
|
+
export type {
|
|
283
|
+
AIAudioSink,
|
|
284
|
+
AIMicrophoneSource,
|
|
285
|
+
AISpeechRecognizer,
|
|
286
|
+
AIVoiceAdapter,
|
|
287
|
+
AIVoiceEditOptions,
|
|
288
|
+
AIVoiceEditResult,
|
|
289
|
+
AIVoiceEventDetail,
|
|
290
|
+
AIVoiceProviderName,
|
|
291
|
+
AIVoiceSelection,
|
|
292
|
+
AIVoiceSessionOptions,
|
|
293
|
+
AIVoiceState,
|
|
294
|
+
AIVoiceTransport,
|
|
295
|
+
} from './three-live/src/plugins/ai-voice';
|
|
146
296
|
/** Optional spatial plugins (`xr-live/spatial`, `xr-live-spatial.min.js`). */
|
|
147
297
|
export * from './xr-live/src/plugins/index';
|
|
148
298
|
/** Optional simulation plugins (`xr-live/sim`, `xr-live-sim.min.js`). */
|
|
149
299
|
export * from './xr-live/src/sim/index';
|
|
300
|
+
/** Optional WebGPU Gaussian Splatting compute & render accelerator (`xr-live/webgpu`, `xr-live-webgpu.min.js`). */
|
|
301
|
+
export * from './xr-live/src/webgpu';
|
|
302
|
+
/** Optional WebGPU `GPURenderBundle` scene accelerator (`three-live/webgpu`, `three-live-webgpu.min.js`). */
|
|
303
|
+
export * from './three-live/src/webgpu';
|
|
304
|
+
/** Optional Loop-Free `THREE.TSL` & `MeshStandardNodeMaterial` compiler (`three-live/tsl`, `three-live-tsl.min.js`). */
|
|
305
|
+
export * from './three-live/src/tsl';
|
|
150
306
|
|
|
151
307
|
/**
|
|
152
308
|
* Declarative JSX / HTML attributes supported by the <three-live> custom element.
|
|
@@ -235,6 +391,40 @@ export interface ThreeLiveAttributes {
|
|
|
235
391
|
* Server-generated scripts (`script-src`) are enabled by default.
|
|
236
392
|
*/
|
|
237
393
|
'allow-client-scripts'?: boolean | string;
|
|
394
|
+
/** `three-live-ai`: Chat Completions-compatible endpoint (your proxy or a local model) for `editScene()`. */
|
|
395
|
+
'ai-endpoint'?: string;
|
|
396
|
+
/** `three-live-ai`: model name sent to `ai-endpoint`. */
|
|
397
|
+
'ai-model'?: string;
|
|
398
|
+
/** `three-live-ai`: provider protocol for `ai-endpoint` (`'ai-chat'`, the default). */
|
|
399
|
+
'ai-provider'?: 'ai-chat';
|
|
400
|
+
/** `three-live-ai`: OpenAI-compatible Images endpoint (`/v1/images/generations`) for AI textures (`userData.xr.material.prompt`). */
|
|
401
|
+
'ai-image-endpoint'?: string;
|
|
402
|
+
/** `three-live-ai`: model name sent to `ai-image-endpoint`. */
|
|
403
|
+
'ai-image-model'?: string;
|
|
404
|
+
/** `three-live-ai`: `'auto'` (default) generates missing AI textures when an image endpoint is configured; `'manual'` waits for `el.generateTextures()`. */
|
|
405
|
+
'ai-textures'?: 'auto' | 'manual';
|
|
406
|
+
/** `three-live-ai`: URL of a texture pack (`scene.textures.json`) for AI textures. */
|
|
407
|
+
'texture-pack'?: string;
|
|
408
|
+
/** `three-live-webgpu`: scene rendering backend (`'auto'`, `'webgpu'`, or `'webgl2'`). */
|
|
409
|
+
renderer?: 'auto' | 'webgpu' | 'webgl2' | string;
|
|
410
|
+
/** `three-live-studio` / `shadowMapsPlugin`: multi-light depth shadow maps (`'auto'`, `'pcf'`, or `'off'`). */
|
|
411
|
+
'shadow-maps'?: ShadowMapsMode | string;
|
|
412
|
+
/** `xr-live-webgpu`: Gaussian splatting backend (`'auto'`, `'webgpu'`, `'hybrid'`, or `'webgl2'`). */
|
|
413
|
+
'splat-renderer'?: 'auto' | 'webgpu' | 'hybrid' | 'webgl2' | string;
|
|
414
|
+
/** `xr-live-spatial` / `xr-live-webgpu`: Spherical Harmonics view-dependent color quality (`'normal'` or `'high'`). */
|
|
415
|
+
'splat-quality'?: 'normal' | 'high' | string;
|
|
416
|
+
/** Allow cross-origin `.splat` / `.spz` URLs on `userData.xr.splatUrl`. */
|
|
417
|
+
'allow-remote-splats'?: boolean | string;
|
|
418
|
+
/** `three-live-ai`: tapping a mesh selects it (tap again to clear; Shift/Ctrl/Cmd-tap or long-press adds to `el.selectedMeshes`). */
|
|
419
|
+
'ai-select-on-tap'?: boolean | string;
|
|
420
|
+
/** `three-live-ai`: show a mic button (push-to-talk, or a realtime session when `ai-voice-url` is set). */
|
|
421
|
+
'ai-voice-button'?: boolean | string;
|
|
422
|
+
/** `three-live-ai`: `wss://` realtime voice endpoint (your proxy or an ephemeral-token URL) for the mic button. */
|
|
423
|
+
'ai-voice-url'?: string;
|
|
424
|
+
/** `three-live-ai`: realtime voice protocol for `ai-voice-url` (`'ai-realtime'`, the default, or `'gemini-live'`). */
|
|
425
|
+
'ai-voice-provider'?: 'ai-realtime' | 'gemini-live';
|
|
426
|
+
/** `three-live-ai`: model name sent in the realtime session setup. */
|
|
427
|
+
'ai-voice-model'?: string;
|
|
238
428
|
|
|
239
429
|
// React 19 / JSX Event Listeners
|
|
240
430
|
onload?: (e: CustomEvent<{model: GLBData}>) => void;
|