efficient-shell 16.4.1 → 16.6.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/dist/{Browser-LCX3F2VY.js → Browser-UHT6QSUN.js} +16 -16
- package/dist/{Calculator-ZCDSQCRN.js → Calculator-ZG5RX2HX.js} +22 -22
- package/dist/{CurrencyConverter-ZLHZOLYE.js → CurrencyConverter-AHGYTGKM.js} +9 -9
- package/dist/{Files-TMEV736Q.js → Files-4HJWEYDE.js} +49 -49
- package/dist/{Notepad-EWLJWILB.js → Notepad-GXKGVTNG.js} +8 -8
- package/dist/{PomodoroTimer-DIIU6KRF.js → PomodoroTimer-GN2OSLJ6.js} +65 -65
- package/dist/{Preview-CG2KGNSM.js → Preview-EN4YCUH5.js} +9 -9
- package/dist/Sidebar-JJ35JBFL.js +44 -0
- package/dist/{Stock-VW2AUUD6.js → Stock-44BSCZOL.js} +4 -4
- package/dist/{Weather-ZGQHMHNW.js → Weather-GNGUF6A4.js} +20 -20
- package/dist/{WorldClock-GYRJWYQM.js → WorldClock-EBZJRH5F.js} +7 -7
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/chunk-2NHYLLHO.js +15 -0
- package/dist/{chunk-JIHDUZJZ.js → chunk-4BB5DHFX.js} +2 -2
- package/dist/{chunk-IXGJTYOG.js → chunk-DX24Q5OR.js} +3 -3
- package/dist/chunk-EJTAPBGB.js +89 -0
- package/dist/{chunk-HHGSWUGI.js → chunk-H6JJAVYL.js} +1 -1
- package/dist/{chunk-UJ5772FB.js → chunk-HOTIZZXC.js} +1 -1
- package/dist/{chunk-3UCJ6SGP.js → chunk-MS6IZF6E.js} +1 -1
- package/dist/{chunk-5MJO7RMB.js → chunk-N7EZ2BFE.js} +3 -3
- package/dist/chunk-OHC6Q4QD.js +1 -0
- package/dist/{chunk-KGRJSTPM.js → chunk-ST6FPYJ7.js} +9 -9
- package/dist/chunk-VIPNHDD3.js +1 -0
- package/dist/{chunk-CUNYWXUT.js → chunk-WAUD3BFJ.js} +1 -1
- package/dist/{chunk-QD7IODP2.js → chunk-WD3S3ATX.js} +1 -1
- package/dist/chunk-YVXF7L66.js +1 -0
- package/dist/engine-4U3WOFMO.js +1 -0
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/index.js +80 -80
- package/dist/model-stage/index.d.ts +69 -5
- package/dist/model-stage/index.js +3 -3
- package/dist/routine-index.json +1 -1
- package/dist/shell/HelpCenter.d.ts +7 -0
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/value-index.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Sidebar-ZSVEL4ZU.js +0 -44
- package/dist/chunk-4LXCCZDM.js +0 -1
- package/dist/chunk-4MYFHXU7.js +0 -1
- package/dist/chunk-KT57MRN4.js +0 -1
- package/dist/chunk-RBOGLXMV.js +0 -21
- package/dist/chunk-S5JX4IAP.js +0 -89
- package/dist/engine-T4D3AZOO.js +0 -1
|
@@ -34,8 +34,15 @@ declare function shortestOrbit(from: Orbit, to: Orbit): Orbit;
|
|
|
34
34
|
* types never reach three.js (an optional peer a host may not have types for).
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
+
/** The procedural light rooms the stage can always draw: the default, what
|
|
38
|
+
* shows while an HDR loads, and the fallback when one fails. */
|
|
37
39
|
type StageEnvironment = 'studio' | 'daylight' | 'showroom' | 'garage';
|
|
38
|
-
type StageBackground = 'white' | 'light' | 'mid' | 'dark' | 'transparent';
|
|
40
|
+
type StageBackground = 'white' | 'light' | 'mid' | 'dark' | 'black' | 'transparent';
|
|
41
|
+
/** What is drawn behind the subject. */
|
|
42
|
+
type StageBackgroundMode = 'colour' | 'environment' | 'backplate';
|
|
43
|
+
/** Procedural surface textures (drawn as bump maps, no files). */
|
|
44
|
+
type StageBump = 'none' | 'sandblast' | 'brushed' | 'radial' | 'knurl' | 'hammered' | 'carbon' | 'grain';
|
|
45
|
+
type StageFlakes = 'none' | 'fine' | 'coarse';
|
|
39
46
|
/** One layer's look, already resolved to PBR numbers by the host. */
|
|
40
47
|
interface StageMaterial {
|
|
41
48
|
color: string;
|
|
@@ -43,24 +50,55 @@ interface StageMaterial {
|
|
|
43
50
|
roughness: number;
|
|
44
51
|
clearcoat?: number;
|
|
45
52
|
clearcoatRoughness?: number;
|
|
53
|
+
/** False hides the layer's surfaces (a host's show/hide toggle). Default true. */
|
|
54
|
+
visible?: boolean;
|
|
55
|
+
/** A surface texture. `radial` is brushed round the wheel's axis. */
|
|
56
|
+
bump?: StageBump;
|
|
57
|
+
/** 0–1. */
|
|
58
|
+
bumpDepth?: number;
|
|
59
|
+
/** Metallic flake under the clear coat. */
|
|
60
|
+
flakes?: StageFlakes;
|
|
46
61
|
}
|
|
47
62
|
interface StageScene {
|
|
63
|
+
/** The procedural room: the light when `environmentUrl` is unset, and
|
|
64
|
+
* while it loads or if it fails. */
|
|
48
65
|
environment: StageEnvironment;
|
|
66
|
+
/** A same-origin equirectangular Radiance `.hdr` to light with. */
|
|
67
|
+
environmentUrl?: string | null;
|
|
49
68
|
/** Degrees, 0–359. */
|
|
50
69
|
environmentRotation: number;
|
|
51
70
|
/** Percent, 50–150. */
|
|
52
71
|
brightness: number;
|
|
72
|
+
/** Percent, 50–150: the key light against the environment. Default 100. */
|
|
73
|
+
contrast?: number;
|
|
74
|
+
/** Default `colour`. */
|
|
75
|
+
backgroundMode?: StageBackgroundMode;
|
|
76
|
+
/** The colour, for `colour` mode. */
|
|
53
77
|
background: StageBackground;
|
|
78
|
+
/** Percent, 0–100: how soft the environment looks behind the subject. */
|
|
79
|
+
backgroundBlur?: number;
|
|
80
|
+
/** An image URL (same-origin or `blob:`) for `backplate` mode. */
|
|
81
|
+
backplateUrl?: string | null;
|
|
82
|
+
/** Default `fill` (cover the frame); `fit` shows it whole. */
|
|
83
|
+
backplateFit?: 'fill' | 'fit';
|
|
54
84
|
groundShadow: boolean;
|
|
55
85
|
/** Percent, 0–100. */
|
|
56
86
|
shadowSoftness: number;
|
|
87
|
+
/** Percent, 0–100. Default 35. */
|
|
88
|
+
shadowDarkness?: number;
|
|
57
89
|
groundReflection: boolean;
|
|
90
|
+
/** Soft darkening where parts meet (screen-space). Default off. */
|
|
91
|
+
ambientOcclusion?: boolean;
|
|
58
92
|
/** 35 mm-equivalent focal length, mm. */
|
|
59
93
|
focalLength: number;
|
|
60
94
|
}
|
|
61
95
|
interface StageCamera extends Orbit {
|
|
62
96
|
userInteraction: boolean;
|
|
63
97
|
}
|
|
98
|
+
/** One object (body) of the model: the surface ids it is made of. */
|
|
99
|
+
interface StageObject {
|
|
100
|
+
surfaces: readonly number[];
|
|
101
|
+
}
|
|
64
102
|
|
|
65
103
|
/** Where a stage is: fetching three.js or the model, drawing it, or showing
|
|
66
104
|
* its fallback (no WebGL, or the model failed to load). */
|
|
@@ -78,13 +116,20 @@ interface ModelStageProps {
|
|
|
78
116
|
layers: readonly (readonly number[])[];
|
|
79
117
|
/** One look per layer, same order. */
|
|
80
118
|
materials: readonly StageMaterial[];
|
|
81
|
-
/** Surfaces drawn highlighted (a selection in progress
|
|
119
|
+
/** Surfaces drawn highlighted (a selection in progress, or an object a
|
|
120
|
+
* person points at). */
|
|
82
121
|
selected?: ReadonlySet<number>;
|
|
122
|
+
/** Surfaces left out entirely — neither drawn nor picked (a hidden
|
|
123
|
+
* object). Pass a new set when it changes. */
|
|
124
|
+
hidden?: ReadonlySet<number>;
|
|
83
125
|
scene: StageScene;
|
|
84
126
|
/** The camera's starting orbit. */
|
|
85
127
|
initialOrbit: Orbit;
|
|
86
128
|
/** Drag to turn and scroll to zoom; off, only `goTo` moves the camera. */
|
|
87
129
|
interactive?: boolean;
|
|
130
|
+
/** With `interactive`, a right-click or two-finger drag also slides the
|
|
131
|
+
* subject in the frame; `goTo` centres it again. Off by default. */
|
|
132
|
+
pan?: boolean;
|
|
88
133
|
/** Click picks surfaces (`onPickSurface`) instead of nothing. */
|
|
89
134
|
selectMode?: boolean;
|
|
90
135
|
/** Turn slowly, round and round. */
|
|
@@ -114,6 +159,24 @@ interface ModelStageHandle {
|
|
|
114
159
|
*/
|
|
115
160
|
declare const ModelStage: react.ForwardRefExoticComponent<ModelStageProps & react.RefAttributes<ModelStageHandle>>;
|
|
116
161
|
|
|
162
|
+
/**
|
|
163
|
+
* Procedural surface textures for the model stage, drawn on a canvas so no
|
|
164
|
+
* texture file ships or is fetched: a grey height map per bump (the engine
|
|
165
|
+
* uses it as `bumpMap`), a normal map for metallic flake, and the frame a
|
|
166
|
+
* backplate is drawn into (filled or fitted to the view's aspect).
|
|
167
|
+
*
|
|
168
|
+
* Seeded, so every stage draws the same texture.
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
/** Where to draw an image of `iw`×`ih` into a `w`×`h` frame: `fill` covers
|
|
172
|
+
* it (cropping), `fit` shows it whole (bands of `pad` round it). Pure. */
|
|
173
|
+
declare function placeImage(iw: number, ih: number, w: number, h: number, fit: 'fill' | 'fit'): {
|
|
174
|
+
x: number;
|
|
175
|
+
y: number;
|
|
176
|
+
w: number;
|
|
177
|
+
h: number;
|
|
178
|
+
};
|
|
179
|
+
|
|
117
180
|
/**
|
|
118
181
|
* Turning a surface model's per-vertex surface ids into draw groups: one
|
|
119
182
|
* group per (layer, selected) pair, so the whole wheel is one geometry drawn
|
|
@@ -144,11 +207,12 @@ interface DrawGroup {
|
|
|
144
207
|
/**
|
|
145
208
|
* The index buffer reordered so each (layer, selected) run is contiguous,
|
|
146
209
|
* and the groups over it. `index` null = a non-indexed geometry (vertex
|
|
147
|
-
* `3t, 3t+1, 3t+2` per triangle).
|
|
210
|
+
* `3t, 3t+1, 3t+2` per triangle). Triangles of a `hidden` surface (an
|
|
211
|
+
* object a person hid) are left out, so they are neither drawn nor picked.
|
|
148
212
|
*/
|
|
149
|
-
declare function buildDrawGroups(index: ArrayLike<number> | null, triSurface: Int32Array, layerOfSurface: Int32Array, selected: ReadonlySet<number>, layerCount: number): {
|
|
213
|
+
declare function buildDrawGroups(index: ArrayLike<number> | null, triSurface: Int32Array, layerOfSurface: Int32Array, selected: ReadonlySet<number>, layerCount: number, hidden?: ReadonlySet<number>): {
|
|
150
214
|
index: Uint32Array;
|
|
151
215
|
groups: DrawGroup[];
|
|
152
216
|
};
|
|
153
217
|
|
|
154
|
-
export { type DrawGroup, ModelStage, type ModelStageHandle, type ModelStageProps, type ModelStageStatus, type Orbit, type StageBackground, type StageCamera, type StageEnvironment, type StageMaterial, type StageScene, buildDrawGroups, framingDistance, layerOfSurfaces, orbitOf, orbitOffset, shortestOrbit, triangleSurfaces, wrapTurn };
|
|
218
|
+
export { type DrawGroup, ModelStage, type ModelStageHandle, type ModelStageProps, type ModelStageStatus, type Orbit, type StageBackground, type StageBackgroundMode, type StageBump, type StageCamera, type StageEnvironment, type StageFlakes, type StageMaterial, type StageObject, type StageScene, buildDrawGroups, framingDistance, layerOfSurfaces, orbitOf, orbitOffset, placeImage, shortestOrbit, triangleSurfaces, wrapTurn };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{buildDrawGroups,framingDistance,layerOfSurfaces,orbitOf,orbitOffset,shortestOrbit,triangleSurfaces,wrapTurn}from"../chunk-
|
|
3
|
-
return
|
|
4
|
-
/* @__PURE__ */l("canvas",{ref:
|
|
2
|
+
export{buildDrawGroups,framingDistance,layerOfSurfaces,orbitOf,orbitOffset,placeImage,shortestOrbit,triangleSurfaces,wrapTurn}from"../chunk-OHC6Q4QD.js";import{webglAvailable as e}from"../chunk-WS4C6Z22.js";export{fieldOfViewFor}from"../chunk-4N24K3UX.js";import{useShellStrings as r}from"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";import{forwardRef as t,useRef as n,useState as i,useEffect as a,useImperativeHandle as c}from"react";import{jsxs as o,jsx as l}from"react/jsx-runtime";var s=(...e)=>e.filter(Boolean).join(" "),u=t(function({src:t,surfaceCount:u,alt:d,layers:f,materials:m,selected:g,hidden:h,scene:p,initialOrbit:C,interactive:b=!0,pan:v=!1,selectMode:S=!1,turntable:O=!1,onPickSurface:w,onCameraChange:k,onStatusChange:y,className:j},x){const M=r().modelViewer,N=n(null),E=n(null),P=n(null),[H,L]=i("loading"),[T,I]=i(!1),Q=n({onPickSurface:w,onCameraChange:k,onStatusChange:y,selectMode:S,initialOrbit:C});Q.current={onPickSurface:w,onCameraChange:k,onStatusChange:y,selectMode:S,initialOrbit:C};const R=n(/* @__PURE__ */new Set);a(()=>{Q.current.onStatusChange?.(H)},[H]),c(x,()=>({goTo(e,r=!0){P.current?.goTo(e,r)},renderImage:(e,r)=>P.current?P.current.renderImage(e,Boolean(r?.transparent)):Promise.reject(new Error(M.loading))}),[M.loading]),a(()=>{if(!e())return void L("still");let r=!0,t=null;return import("../engine-4U3WOFMO.js").then(({StageEngine:e})=>{r&&E.current&&(t=new e(E.current),t.onCameraChange=e=>Q.current.onCameraChange?.(e),P.current=t,I(!0))}).catch(()=>{r&&L("failed")}),()=>{r=!1,t?.dispose(),P.current=null}},[]),a(()=>{const e=N.current;if(!T||!e)return;const r=()=>P.current?.resize(e.clientWidth,e.clientHeight);r();const t=new ResizeObserver(r);return t.observe(e),()=>t.disconnect()},[T]),a(()=>{const e=P.current;if(!T||!e)return;let r=!0;return L("loading"),e.load(t,u).then(()=>{r&&(e.goTo(Q.current.initialOrbit,!1),L("ready"))}).catch(()=>{r&&L("failed")}),()=>{r=!1}},[T,t,u]),a(()=>{T&&P.current?.setLayers(f,m,g??R.current)},[T,H,f,m,g]),a(()=>{T&&P.current?.setHidden(h??R.current)},[T,H,h]),a(()=>{T&&P.current?.setScene(p)},[T,H,p]),a(()=>{T&&P.current?.setInteractive(b)},[T,b]),a(()=>{T&&P.current?.setTurntable(O)},[T,O]),a(()=>{T&&P.current?.setPan(v)},[T,v]),a(()=>{const e=E.current;if(!T||!e)return;let r=null;const t=e=>{r={x:e.clientX,y:e.clientY}},n=e=>{if(!r||!Q.current.selectMode)return;const t=Math.hypot(e.clientX-r.x,e.clientY-r.y);r=null,t>4||Q.current.onPickSurface?.(P.current?.pick(e.clientX,e.clientY)??null,{shiftKey:e.shiftKey})};return e.addEventListener("pointerdown",t),e.addEventListener("pointerup",n),()=>{e.removeEventListener("pointerdown",t),e.removeEventListener("pointerup",n)}},[T]);const W="still"===H||"failed"===H;/* @__PURE__ */
|
|
3
|
+
return o("div",{ref:N,className:s("relative overflow-hidden",j),"data-model-stage":H,children:[
|
|
4
|
+
/* @__PURE__ */l("canvas",{ref:E,role:"img","aria-label":d,className:s("absolute inset-0 h-full w-full",S?"cursor-crosshair":b&&"cursor-grab"),hidden:W}),"loading"===H&&/* @__PURE__ */l("p",{role:"status",className:"sr-only",children:M.loading}),W&&/* @__PURE__ */l("p",{className:"absolute inset-0 grid place-items-center p-4 text-center text-sm text-ink-faint",children:"still"===H?M.noWebgl:M.failed})]})});export{u as ModelStage};
|