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.
Files changed (50) hide show
  1. package/dist/{Browser-LCX3F2VY.js → Browser-UHT6QSUN.js} +16 -16
  2. package/dist/{Calculator-ZCDSQCRN.js → Calculator-ZG5RX2HX.js} +22 -22
  3. package/dist/{CurrencyConverter-ZLHZOLYE.js → CurrencyConverter-AHGYTGKM.js} +9 -9
  4. package/dist/{Files-TMEV736Q.js → Files-4HJWEYDE.js} +49 -49
  5. package/dist/{Notepad-EWLJWILB.js → Notepad-GXKGVTNG.js} +8 -8
  6. package/dist/{PomodoroTimer-DIIU6KRF.js → PomodoroTimer-GN2OSLJ6.js} +65 -65
  7. package/dist/{Preview-CG2KGNSM.js → Preview-EN4YCUH5.js} +9 -9
  8. package/dist/Sidebar-JJ35JBFL.js +44 -0
  9. package/dist/{Stock-VW2AUUD6.js → Stock-44BSCZOL.js} +4 -4
  10. package/dist/{Weather-ZGQHMHNW.js → Weather-GNGUF6A4.js} +20 -20
  11. package/dist/{WorldClock-GYRJWYQM.js → WorldClock-EBZJRH5F.js} +7 -7
  12. package/dist/apps/index.js +1 -1
  13. package/dist/bin/browser-check.js +1 -1
  14. package/dist/bin/media-host-check.js +1 -1
  15. package/dist/bin/ui-check.js +1 -1
  16. package/dist/chunk-2NHYLLHO.js +15 -0
  17. package/dist/{chunk-JIHDUZJZ.js → chunk-4BB5DHFX.js} +2 -2
  18. package/dist/{chunk-IXGJTYOG.js → chunk-DX24Q5OR.js} +3 -3
  19. package/dist/chunk-EJTAPBGB.js +89 -0
  20. package/dist/{chunk-HHGSWUGI.js → chunk-H6JJAVYL.js} +1 -1
  21. package/dist/{chunk-UJ5772FB.js → chunk-HOTIZZXC.js} +1 -1
  22. package/dist/{chunk-3UCJ6SGP.js → chunk-MS6IZF6E.js} +1 -1
  23. package/dist/{chunk-5MJO7RMB.js → chunk-N7EZ2BFE.js} +3 -3
  24. package/dist/chunk-OHC6Q4QD.js +1 -0
  25. package/dist/{chunk-KGRJSTPM.js → chunk-ST6FPYJ7.js} +9 -9
  26. package/dist/chunk-VIPNHDD3.js +1 -0
  27. package/dist/{chunk-CUNYWXUT.js → chunk-WAUD3BFJ.js} +1 -1
  28. package/dist/{chunk-QD7IODP2.js → chunk-WD3S3ATX.js} +1 -1
  29. package/dist/chunk-YVXF7L66.js +1 -0
  30. package/dist/engine-4U3WOFMO.js +1 -0
  31. package/dist/forms/MediaLibrary.js +1 -1
  32. package/dist/index.js +80 -80
  33. package/dist/model-stage/index.d.ts +69 -5
  34. package/dist/model-stage/index.js +3 -3
  35. package/dist/routine-index.json +1 -1
  36. package/dist/shell/HelpCenter.d.ts +7 -0
  37. package/dist/shell/HelpCenter.js +1 -1
  38. package/dist/shell/SidebarNav.js +1 -1
  39. package/dist/telemetry/index.js +1 -1
  40. package/dist/ui/index.js +1 -1
  41. package/dist/value-index.json +1 -1
  42. package/dist/version.js +1 -1
  43. package/package.json +1 -1
  44. package/dist/Sidebar-ZSVEL4ZU.js +0 -44
  45. package/dist/chunk-4LXCCZDM.js +0 -1
  46. package/dist/chunk-4MYFHXU7.js +0 -1
  47. package/dist/chunk-KT57MRN4.js +0 -1
  48. package/dist/chunk-RBOGLXMV.js +0 -21
  49. package/dist/chunk-S5JX4IAP.js +0 -89
  50. 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-KT57MRN4.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 o}from"react";import{jsxs as c,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,scene:h,initialOrbit:p,interactive:b=!0,selectMode:C=!1,turntable:v=!1,onPickSurface:S,onCameraChange:O,onStatusChange:w,className:k},y){const j=r().modelViewer,x=n(null),M=n(null),N=n(null),[T,E]=i("loading"),[L,P]=i(!1),R=n({onPickSurface:S,onCameraChange:O,onStatusChange:w,selectMode:C,initialOrbit:p});R.current={onPickSurface:S,onCameraChange:O,onStatusChange:w,selectMode:C,initialOrbit:p};const K=n(/* @__PURE__ */new Set);a(()=>{R.current.onStatusChange?.(T)},[T]),o(y,()=>({goTo(e,r=!0){N.current?.goTo(e,r)},renderImage:(e,r)=>N.current?N.current.renderImage(e,Boolean(r?.transparent)):Promise.reject(new Error(j.loading))}),[j.loading]),a(()=>{if(!e())return void E("still");let r=!0,t=null;return import("../engine-T4D3AZOO.js").then(({StageEngine:e})=>{r&&M.current&&(t=new e(M.current),t.onCameraChange=e=>R.current.onCameraChange?.(e),N.current=t,P(!0))}).catch(()=>{r&&E("failed")}),()=>{r=!1,t?.dispose(),N.current=null}},[]),a(()=>{const e=x.current;if(!L||!e)return;const r=()=>N.current?.resize(e.clientWidth,e.clientHeight);r();const t=new ResizeObserver(r);return t.observe(e),()=>t.disconnect()},[L]),a(()=>{const e=N.current;if(!L||!e)return;let r=!0;return E("loading"),e.load(t,u).then(()=>{r&&(e.goTo(R.current.initialOrbit,!1),E("ready"))}).catch(()=>{r&&E("failed")}),()=>{r=!1}},[L,t,u]),a(()=>{L&&N.current?.setLayers(f,m,g??K.current)},[L,T,f,m,g]),a(()=>{L&&N.current?.setScene(h)},[L,T,h]),a(()=>{L&&N.current?.setInteractive(b)},[L,b]),a(()=>{L&&N.current?.setTurntable(v)},[L,v]),a(()=>{const e=M.current;if(!L||!e)return;let r=null;const t=e=>{r={x:e.clientX,y:e.clientY}},n=e=>{if(!r||!R.current.selectMode)return;const t=Math.hypot(e.clientX-r.x,e.clientY-r.y);r=null,t>4||R.current.onPickSurface?.(N.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)}},[L]);const X="still"===T||"failed"===T;/* @__PURE__ */
3
- return c("div",{ref:x,className:s("relative overflow-hidden",k),"data-model-stage":T,children:[
4
- /* @__PURE__ */l("canvas",{ref:M,role:"img","aria-label":d,className:s("absolute inset-0 h-full w-full",C?"cursor-crosshair":b&&"cursor-grab"),hidden:X}),"loading"===T&&/* @__PURE__ */l("p",{role:"status",className:"sr-only",children:j.loading}),X&&/* @__PURE__ */l("p",{className:"absolute inset-0 grid place-items-center p-4 text-center text-sm text-ink-faint",children:"still"===T?j.noWebgl:j.failed})]})});export{u as ModelStage};
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};