@stacksjs/defaults 0.75.525 → 0.75.527

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.
@@ -106,6 +106,28 @@ authority over amounts, ownership and payment completion. Utility/composable
106
106
  re-exports have their own signatures in utils/ and composables/; read the native
107
107
  composable skill instead of copying another fixed inventory of globals.
108
108
 
109
+ ## On-demand 3D model inspection
110
+
111
+ Import `createModelViewer`, `modelTransform` and the `ModelScene` type from
112
+ `@stacksjs/browser/model-viewer`. This narrow module has no boot side effect or
113
+ external renderer. It renders binary STL, boxes, square tubes and hollow/solid
114
+ cylinders through native WebGL. Node transforms use millimeters (or one consistent
115
+ caller unit), column-major matrices and Euler degrees. STL URLs must be same-origin.
116
+ The renderer owns pointer orbit, pinch/wheel zoom, keyboard controls, responsive
117
+ canvas sizing, one GPU buffer and abortable STL loads. Call `dispose()` on teardown.
118
+ Source/format/context failures report through `onStatus`; provide a fallback.
119
+
120
+ `<ModelViewer :scene="scene()" label="Frame inspection" poster="/drawing.png" />`
121
+ is the corresponding native STX component. Its scene prop is reactive. It includes
122
+ camera presets, loading/error states and accessible keyboard instructions. Theme
123
+ through inherited `--model-surface`, `--model-ink`, `--model-line`, `--model-height`
124
+ and `--model-mobile-height`. It does not perform CAD booleans, generate print files,
125
+ validate structural strength or prescribe mechanical settings. Keep manufacturing
126
+ geometry, export provenance and domain checks in the application.
127
+
128
+ Evidence: `core/browser/src/model-viewer.ts`, its retained geometry/parser tests,
129
+ and `tests/unit/model-viewer-component.test.ts` for live STX prop delivery.
130
+
109
131
  ## Source and evidence
110
132
 
111
133
  `storage/framework/core/browser/src/index.ts`, auto-init.ts, model-loader.ts,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: stacks-dashboard
3
- description: Use when building or customizing the Stacks admin dashboard, including dashboard pages, model management views, analytics widgets, commerce dashboards, content management, settings panels, deployment monitoring, job/queue management, or the 415 built-in dashboard components. Covers the dashboard system at storage/framework/defaults/.
3
+ description: Use when building or customizing the Stacks admin dashboard, including dashboard pages, model management views, analytics widgets, commerce dashboards, content management, settings panels, deployment monitoring, job/queue management, or the 416 built-in dashboard components. Covers the dashboard system at storage/framework/defaults/.
4
4
  license: MIT
5
5
  compatibility: Bun >= 1.3.0, TypeScript
6
6
  allowed-tools: Read Edit Write Bash Grep Glob
@@ -8,7 +8,7 @@ allowed-tools: Read Edit Write Bash Grep Glob
8
8
 
9
9
  # Stacks Dashboard
10
10
 
11
- The Stacks admin dashboard provides a full-featured admin panel with 100+ route views, 415 components, and a multi-section layout.
11
+ The Stacks admin dashboard provides a full-featured admin panel with 100+ route views, 416 components, and a multi-section layout.
12
12
 
13
13
  ## Key Paths
14
14
  - Dashboard components: `storage/framework/defaults/resources/components/Dashboard/`
@@ -19,7 +19,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
19
19
  | `@stacksjs/arrays` | [`stacks-arrays`](../stacks-arrays/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/arrays/src/index.ts) | 12 |
20
20
  | `@stacksjs/audio` | [`stacks-audio`](../stacks-audio/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/audio/src/index.ts) | 3 |
21
21
  | `@stacksjs/auth` | [`stacks-auth`](../stacks-auth/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/index.ts) | 131 |
22
- | `@stacksjs/browser` | [`stacks-browser`](../stacks-browser/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/index.ts) | 9 |
22
+ | `@stacksjs/browser` | [`stacks-browser`](../stacks-browser/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/index.ts) | 10 |
23
23
  | `@stacksjs/browser-extension` | [`stacks-browser-extension`](../stacks-browser-extension/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser-extension/src/index.ts) | 9 |
24
24
  | `@stacksjs/buddy` | [`stacks-buddy`](../stacks-buddy/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/index.ts) | 185 |
25
25
  | `@stacksjs/build` | [`stacks-build`](../stacks-build/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/build/src/index.ts) | 7 |
@@ -199,7 +199,7 @@ Declared runtime exports: `BrowserQueryBuilder`, `BrowserQueryError`, `browserAu
199
199
 
200
200
  Local source modules: [src/auto-init.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/auto-init.ts), [src/composables/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/composables/index.ts), [src/model-loader.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/model-loader.ts), [src/types/globals.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/types/globals.ts), [src/utils/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/utils/index.ts).
201
201
 
202
- Evidence directory: [9 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
202
+ Evidence directory: [10 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
203
203
 
204
204
  ### @stacksjs/browser-extension
205
205
 
@@ -100,6 +100,16 @@ native input event, without an additional custom event.
100
100
  Validate quantities again on the server. Multiple selectors keep independent
101
101
  state and do not install global click handlers.
102
102
 
103
+ ## Native 3D viewer
104
+
105
+ `<ModelViewer :scene="scene()" label="Model inspection" poster="/drawing.png" />`
106
+ renders a reactive `ModelScene` from `@stacksjs/browser/model-viewer`, using native
107
+ WebGL without a third-party 3D library. Camera presets, orbit, pinch/wheel zoom,
108
+ keyboard input, responsive backing resolution and drawing fallback are built in.
109
+ Bind `:label` and `:poster` when switching models; both react with the scene so
110
+ the accessible canvas description and fallback drawing keep the selected context.
111
+ See `stacks-browser` for units, geometry, source limits and cleanup contracts.
112
+
103
113
  ## Gotchas
104
114
 
105
115
  - `config/ui.ts` configures STX topology; `config/css.ts` configures utilities.
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.75.525",
5
+ "version": "0.75.527",
6
6
  "description": "Stacks, built into VS Code: stx templates, pickier linting and formatting, encrypted env files, the dev server preview and every buddy command. No other extensions required.",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/chrisbbreuer",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/defaults",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.525",
5
+ "version": "0.75.527",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/stacksjs/stacks.git",
@@ -45,10 +45,10 @@
45
45
  "dependencies": {
46
46
  "@iconify-json/f7": "^1.2.2",
47
47
  "@iconify-json/hugeicons": "^1.2.35",
48
- "@stacksjs/mobile": "0.75.525",
48
+ "@stacksjs/mobile": "0.75.527",
49
49
  "@stacksjs/sanitizer": "0.2.807",
50
50
  "@stacksjs/stx": "0.2.807",
51
- "@stacksjs/strings": "0.75.525",
51
+ "@stacksjs/strings": "0.75.527",
52
52
  "@xterm/addon-fit": "^0.11.0",
53
53
  "@xterm/xterm": "^6.0.0",
54
54
  "ts-qr-codes": "^0.1.8"
@@ -0,0 +1,65 @@
1
+ <script server>
2
+ export const className = $props.className || ''
3
+ </script>
4
+ <script client>
5
+ import type { ModelScene, ModelViewerController } from '@stacksjs/browser/model-viewer'
6
+ import { createModelViewer } from '@stacksjs/browser/model-viewer'
7
+
8
+ const scene = useReactiveProp('scene', { nodes: [] } as ModelScene)
9
+ const modelLabel = useReactiveProp('label', 'Interactive 3D model')
10
+ const modelPoster = useReactiveProp('poster', '')
11
+ const canvas = useRef('modelCanvas')
12
+ const status = state('loading')
13
+ const message = state('')
14
+ let viewer: ModelViewerController | undefined
15
+ onMount(() => {
16
+ try {
17
+ viewer = createModelViewer(canvas.current as HTMLCanvasElement, { onStatus: (next, detail) => { status.set(next); message.set(detail || '') } })
18
+ void viewer.setScene(scene())
19
+ }
20
+ catch (error) { status.set('error'); message.set(error instanceof Error ? error.message : 'Interactive 3D could not start.') }
21
+ })
22
+ effect(() => { const next = scene(); if (viewer) void viewer.setScene(next) })
23
+ onDestroy(() => viewer?.dispose())
24
+ </script>
25
+
26
+ <div class="stx-model-viewer {{ className }}" :data-model-status="status()" data-stx-model-viewer>
27
+ <div class="stx-model-viewer-toolbar" role="group" aria-label="Model camera">
28
+ <button type="button" @click="viewer?.view('home')" :disabled="status() !== 'ready'" aria-label="Reset 3D view">Reset view</button>
29
+ <button type="button" @click="viewer?.view('front')" :disabled="status() !== 'ready'">Front</button>
30
+ <button type="button" @click="viewer?.view('side')" :disabled="status() !== 'ready'">Side</button>
31
+ <button type="button" @click="viewer?.view('top')" :disabled="status() !== 'ready'">Top</button>
32
+ <span class="stx-model-viewer-zoom">
33
+ <button type="button" @click="viewer?.zoom(0.85)" :disabled="status() !== 'ready'" aria-label="Zoom in">+</button>
34
+ <button type="button" @click="viewer?.zoom(1.15)" :disabled="status() !== 'ready'" aria-label="Zoom out">−</button>
35
+ </span>
36
+ </div>
37
+ <div class="stx-model-viewer-stage">
38
+ <canvas ref="modelCanvas" class="stx-model-viewer-canvas" tabindex="0" role="img" :aria-label="modelLabel() + '. Drag to rotate, scroll or pinch to zoom. Arrow keys rotate, plus and minus zoom, Home resets.'">Interactive 3D requires a browser with WebGL. Use the drawing and downloads below.</canvas>
39
+ <div class="stx-model-viewer-loading" :if="status() === 'loading'" role="status">Preparing the model…</div>
40
+ <div class="stx-model-viewer-fallback" :if="status() === 'error'">
41
+ <img :if="modelPoster()" :src="modelPoster()" :alt="modelLabel() + ' drawing'" width="1400" height="1000">
42
+ <p role="status">{{ message() }}</p>
43
+ </div>
44
+ </div>
45
+ <p class="stx-model-viewer-hint">Drag to orbit. Scroll or pinch to zoom. Keyboard: arrows, +, −, Home.</p>
46
+ </div>
47
+
48
+ <style>
49
+ .stx-model-viewer{--model-surface:#eef0e9;--model-ink:#213e30;--model-line:#cbd3c7;position:relative;border-radius:16px;overflow:hidden;background:var(--model-surface);color:var(--model-ink)}
50
+ .stx-model-viewer-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:4px;padding:14px 16px;border-bottom:1px solid var(--model-line)}
51
+ .stx-model-viewer-toolbar button{background:transparent;border:1px solid transparent;border-radius:8px;padding:8px 12px;min-height:42px;color:inherit;font:inherit;font-size:.8rem;cursor:pointer}
52
+ .stx-model-viewer-toolbar button:hover{background:var(--model-line)}
53
+ .stx-model-viewer-toolbar button:focus-visible,.stx-model-viewer-canvas:focus-visible{outline:2px solid currentColor;outline-offset:-3px}
54
+ .stx-model-viewer-toolbar button:disabled{opacity:.45;cursor:default}
55
+ .stx-model-viewer-zoom{display:flex;margin-left:auto}
56
+ .stx-model-viewer-stage{position:relative;height:var(--model-height,520px)}
57
+ .stx-model-viewer-canvas{display:block;width:100%;height:100%;touch-action:none;cursor:grab}
58
+ .stx-model-viewer-canvas:active{cursor:grabbing}
59
+ .stx-model-viewer-loading,.stx-model-viewer-fallback{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:24px;text-align:center;background:var(--model-surface);font-size:.875rem}
60
+ .stx-model-viewer-loading{pointer-events:none;background:transparent;justify-content:flex-end}
61
+ .stx-model-viewer-fallback img{max-width:100%;max-height:80%;object-fit:contain;mix-blend-mode:multiply}
62
+ .stx-model-viewer-fallback p{max-width:420px}
63
+ .stx-model-viewer-hint{margin:0;padding:12px 20px;font-size:.75rem;border-top:1px solid var(--model-line)}
64
+ @media(max-width:600px){.stx-model-viewer-stage{height:var(--model-mobile-height,340px)}.stx-model-viewer-toolbar{padding:8px}.stx-model-viewer-toolbar button{padding:7px 9px}.stx-model-viewer-hint{padding:12px;font-size:.7rem}}
65
+ </style>