@auscera/design-labs 0.0.0-stage → 0.1.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 (57) hide show
  1. package/apps/workspace/.skills/design-labs/SKILL.md +63 -0
  2. package/apps/workspace/.skills/design-labs/references/commands.md +38 -0
  3. package/apps/workspace/AGENTS.md +9 -0
  4. package/apps/workspace/app/(lab)/compare/page.tsx +2 -0
  5. package/apps/workspace/app/(lab)/lab.css +412 -0
  6. package/apps/workspace/app/(lab)/layout.tsx +21 -0
  7. package/apps/workspace/app/(lab)/page.tsx +2 -0
  8. package/apps/workspace/app/api/annotations/route.ts +94 -0
  9. package/apps/workspace/app/api/versions/events/route.ts +63 -0
  10. package/apps/workspace/app/api/versions/route.ts +7 -0
  11. package/apps/workspace/components/animated-icons.tsx +72 -0
  12. package/apps/workspace/components/dotmatrix-loader.css +1228 -0
  13. package/apps/workspace/components/glass-controls.tsx +47 -0
  14. package/apps/workspace/components/lab-providers.tsx +17 -0
  15. package/apps/workspace/components/molecules/brand-lockup.tsx +13 -0
  16. package/apps/workspace/components/molecules/pane-url-popover.css +92 -0
  17. package/apps/workspace/components/molecules/pane-url-popover.tsx +191 -0
  18. package/apps/workspace/components/pane-preferences.tsx +75 -0
  19. package/apps/workspace/components/pane-viewport.css +34 -0
  20. package/apps/workspace/components/pane-viewport.tsx +199 -0
  21. package/apps/workspace/components/preview-pane.css +293 -0
  22. package/apps/workspace/components/preview-pane.tsx +662 -0
  23. package/apps/workspace/components/ui/dotm-triangle-11.tsx +170 -0
  24. package/apps/workspace/components/ui/dotmatrix-core.tsx +1649 -0
  25. package/apps/workspace/components/ui/dotmatrix-hooks.ts +224 -0
  26. package/apps/workspace/components/version-select.tsx +220 -0
  27. package/apps/workspace/components/workspace.tsx +313 -0
  28. package/apps/workspace/eslint.config.mjs +3 -0
  29. package/apps/workspace/lab.config.json +1 -0
  30. package/apps/workspace/lib/annotation-export.ts +28 -0
  31. package/apps/workspace/lib/annotation-types.ts +38 -0
  32. package/apps/workspace/lib/device-presets.ts +103 -0
  33. package/apps/workspace/lib/use-annotation-bridge.ts +130 -0
  34. package/apps/workspace/lib/version-types.ts +12 -0
  35. package/apps/workspace/lib/website-url.ts +78 -0
  36. package/apps/workspace/next-env.d.ts +6 -0
  37. package/apps/workspace/next.config.mjs +1 -0
  38. package/apps/workspace/package.json +35 -0
  39. package/apps/workspace/public/apple-touch-icon.png +0 -0
  40. package/apps/workspace/public/brand/design-labs-script.LICENSE.txt +93 -0
  41. package/apps/workspace/public/brand/design-labs-script.woff2 +0 -0
  42. package/apps/workspace/public/brand/logo.webp +0 -0
  43. package/apps/workspace/public/brand/wordmark.css +42 -0
  44. package/apps/workspace/public/favicon.ico +0 -0
  45. package/apps/workspace/public/icon-192.png +0 -0
  46. package/apps/workspace/public/icon-512.png +0 -0
  47. package/apps/workspace/public/preview-bridge.js +411 -0
  48. package/apps/workspace/public/site.webmanifest +1 -0
  49. package/apps/workspace/scripts/annotation-store.mjs +308 -0
  50. package/apps/workspace/scripts/lab.mjs +414 -0
  51. package/apps/workspace/scripts/migrate.mjs +2 -0
  52. package/apps/workspace/scripts/prepare-preview.mjs +203 -0
  53. package/apps/workspace/tsconfig.json +24 -0
  54. package/package.json +9 -3
  55. package/scripts/install.mjs +67 -0
  56. package/scripts/update.mjs +204 -0
  57. package/README.md +0 -3
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: design-labs
3
+ description: Install Design Labs into Next.js projects, snapshot landing or dashboard frontends, duplicate UI versions, select production, review and transfer approved source, and maintain version history and previews.
4
+ ---
5
+
6
+ # Design Labs
7
+
8
+ ## Install
9
+
10
+ Inspect host instructions and workspace layout. Run `node <Design-Labs>/scripts/install.mjs <host>`; it detects monorepos and installs only the empty workspace. Install dependencies with the host package manager. Do not replace existing Labs automatically. Existing installations require a verified backup and migration of platform files only, retaining source archives and routes. Do not deploy or publish.
11
+
12
+ ## Setup and version workflow
13
+
14
+ In the installed workspace run `node scripts/lab.mjs doctor`. See [commands](references/commands.md). Snapshot a Next.js frontend as production by default, or use the user's chosen version name. Snapshot source bytes and manifests; do not copy dependencies, builds, secrets or symlink targets. Verify source hashes. Additional snapshots and duplicates are independent editable folders, never hardlinked.
15
+
16
+ New snapshots have isolated Next.js runtime ports. Prepare dependencies using the original package manager/lockfile in the snapshot or a separate preview adapter. Workspace package imports require explicit resolution; never silently strip them or upgrade versions. Use copied adapters and fixtures for auth/API-bound dashboards. Do not launch backend services or request production credentials. Review Next.js rewrites, server actions and middleware for frontend-only preview integration. Preserve subpages and root-relative navigation inside that preview origin. Only mark runnable after actual browser checks; missing dependencies must remain visible as needs-setup.
17
+
18
+ Use `dev` for one managed command running workspace, prepared previews and content tracking. Do not start duplicate servers. No-op saves/build output must not update change times. Offline edits have detected timestamps, not invented edit dates.
19
+
20
+ ## Production and source transfer
21
+
22
+ Production selection changes only approval metadata. Before transfer, run diff, review file actions (including deletions), resolve origin drift without overwriting unreviewed work, then apply with that exact review token. Apply saves a checkpoint. Verify destination hashes and run its normal checks. If transfer fails, stop and restore/reconcile from the checkpoint; do not blindly repeat. Copy source back only when the user requests it.
23
+
24
+ ## Maintenance and synchronization
25
+
26
+ The maintained product repository owns implementation. Its `.skills/design-labs` mirrors the Agent OS `design-labs` bundle. Run `node scripts/sync-skill.mjs check`; review divergence before explicit `push` or `pull` (prior destination is backed up). Installed bundles are copies, not symlinks into the builder's registry.
27
+
28
+ Update task.md and walkthrough.md after verified work. Do not claim a screenshot is a functional website or that differing dependency environments execute in one runtime. Branding is generic Design Labs, official silver D, black token-based workspace. Marketing code, builder records and user snapshots never ship in the empty installation.
29
+
30
+ ## /update and /fix
31
+
32
+ Obtain a reviewed release checkout (local owner repository or pinned GitHub ref). Stop the installed Lab before updating. Run `node <release>/scripts/update.mjs plan <installed-lab>` (or `fix` to audit/repair). Review changed platform files and local conflicts, then `apply <installed-lab> <token>`. Only use `--accept-local` after reviewing deliberate overwrites. The updater backs up source and metadata, updates allowlisted platform files, preserves preview route groups and versions, and migrates old folders with hash checks. Reinstall dependencies, run types/build and browser tests before accepting. On failure use `rollback <installed-lab> <backup>`. Package upgrades may require agent compatibility resolution; never silently downgrade or remove project-specific dependencies.
33
+
34
+ Installed source layout is `versions/landing/<version>/source` and `versions/dashboard/<version>/source`. Production is an approved version identity. IDs and existing preview URLs remain stable across folder migrations. Existing source apps are touched only by the reviewed source-transfer workflow.
35
+
36
+ ## BWA integration
37
+
38
+ BWA's design-lab-architecture entry only routes agents to this maintained project skill. It contains no dashboard template and no alternative installer. Keep executable installer/distribution tools in this project's scripts and runtime workflow tools in apps/workspace/scripts. Do not copy application code back into BWA. Installed workspaces and the synchronized Agent OS skill bundle remain expected distribution copies.
39
+
40
+
41
+ ## Responsive review and annotations
42
+
43
+ Each compare pane has independent responsive sizing and annotation controls. Responsive previews change the iframe's CSS viewport with grouped presets or explicit dimensions; fit scaling is visual only. This does not emulate device hardware, browser engines, user agents or DPR. Do not introduce device bezel images.
44
+
45
+ Entering annotation tools opens the floating toolbar without intercepting website clicks. Annotate explicitly starts element selection. Saved annotations live outside version source at `annotations/<version-key-sha256>.json`; preserve this folder in updates and never ship it in an empty install. Comments include version, route, viewport, bounded sanitized rendered HTML, selector and selected computed styles. Component/source hints are included only when the DOM explicitly provides them. These are rendered DOM references, not guaranteed original JSX paths. Never export input values, auth tokens or scripts. Users can edit, select/copy, download Markdown/JSON and delete comments. Missing or changed DOM targets remain visible in review instead of moving pins to unrelated elements.
46
+
47
+ Same-origin embedded previews receive a temporary bridge at runtime; original source remains untouched. Separate-origin previews need a reviewed frontend adapter. Run `node scripts/prepare-preview.mjs VERSION_KEY` to copy the source into a separate adapter with bridge wiring and dependency access. Review middleware, root layout, fixture/auth/data and CSP behavior, then browser-test before marking runnable. The managed launcher passes the exact Lab origin through NEXT_PUBLIC_DESIGN_LABS_ORIGIN. If launching an adapter manually, provide that variable before starting Next.js. Origins must match the actual browser hostname and port.
48
+
49
+ After source changes, run `node scripts/prepare-preview.mjs refresh VERSION_KEY`. It preflights source and adapter hashes, refuses overlaps with local mock edits and unsupported root structure/config changes, and publishes through a staged swap. Review conflicts manually; never force-overwrite fixtures or copy generated bridge files back to production. The adapter remains a preview integration, while original source archives and source-transfer workflows remain authoritative.
50
+
51
+
52
+ ## Pane URL references
53
+
54
+ Users can compare arbitrary HTTP(S) addresses without snapshotting them: use the Link2 pane action or Website URL in the source selector. URLs are transient per-pane UI state, independent of the remembered saved version. Split copies the active source; subsequent edits remain independent. Empty workspaces allow Add pane for URL-only comparisons. Do not register a URL as a source archive or alter the host project to preview it.
55
+
56
+ Responsive controls occupy the selector's left toolbar slot while active; exiting restores its previous version/URL. URL sources follow browser embedding and same-origin restrictions. Do not proxy around embedding restrictions or claim remote HTML annotation access; offer the existing new-tab action. Annotation capture stays available through saved, bridged Design Labs versions. Existing cards and stored annotations remain unchanged by this workflow.
57
+
58
+
59
+ ## Compare layout state and icons
60
+
61
+ Landing and dashboard retain separate pane trees, maximized pane, selected versions, URLs, responsive dimensions and drafts in browser local storage for that origin. Switching categories restores each saved layout; refreshes and server restarts on the same origin restore the last layout. Clearing browser site storage resets layout state. Saved annotations remain in the installed workspace `annotations/` files and are not deleted by clearing browser storage. Browser storage is separate per browser and origin, including port.
62
+
63
+ Workspace button icons use `@animateicons/react` via `components/animated-icons.tsx`. Preserve accessible button names and respect reduced motion. Installer/update dependencies include the package; do not inject platform icons into archived websites.
@@ -0,0 +1,38 @@
1
+ ---
2
+ title: "Deterministic commands"
3
+ date: "2026-11-16"
4
+ status: "active"
5
+ ---
6
+
7
+ # Commands
8
+
9
+ Run from installed Lab root:
10
+
11
+ ```bash
12
+ node scripts/lab.mjs snapshot /absolute/frontend website landing production
13
+ node scripts/lab.mjs snapshot /absolute/dashboard website dashboard production
14
+ node scripts/lab.mjs duplicate website/landing/production version1
15
+ node scripts/lab.mjs production website/landing/version1
16
+ node scripts/lab.mjs scan
17
+ node scripts/lab.mjs doctor
18
+ node scripts/lab.mjs diff website/landing/version1
19
+ node scripts/lab.mjs apply website/landing/version1 <review-token>
20
+ node scripts/lab.mjs dev
21
+ ```
22
+
23
+ Diff prints a content-bound token plus changed file actions and origin drift. Never apply a token before reviewing those actions. Snapshots exclude environments/builds; original source and file hashes are retained. The `adapter` metadata field may point to a separately copied frontend preview app; source remains unchanged. Runtime port is per version. Set status runnable only after setup checks. Existing embedded snapshots retain their route paths and independent root layouts.
24
+
25
+ ```mermaid
26
+ flowchart LR
27
+ Source --> Snapshot --> Duplicate --> Compare --> SelectProduction --> Diff --> Apply
28
+ ```
29
+
30
+
31
+ ## Preview inspection adapter
32
+
33
+ ```bash
34
+ node scripts/prepare-preview.mjs website/landing/production
35
+ node scripts/prepare-preview.mjs refresh website/landing/production
36
+ ```
37
+
38
+ Preparation and refresh preserve original source and exclude environments. Review runtime compatibility and frontend fixtures before launch. Embedded same-origin previews require neither command. Annotations are persisted separately from sources and retained by updates; the empty installer does not include review data.
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: "Installed workspace agent contract"
3
+ date: "2026-11-16"
4
+ status: "active"
5
+ ---
6
+
7
+ # Installed workspace agent contract
8
+
9
+ Read .skills/design-labs/SKILL.md before install/setup/snapshot/version/production/transfer operations. Preserve host project instructions. Full previews contain website UI only. The workspace uses a black canvas and official silver logo. Do not distribute marketing or builder files. CLI: node scripts/lab.mjs doctor. Snapshot and transfer operations must be verified with hashes and reviewed diff. Do not declare an unprepared preview runnable. Dependencies/auth/backend integration require separate frontend adapters with local fixtures. Never copy .env or auto-run backend services.
@@ -0,0 +1,2 @@
1
+ import Workspace from "../../../components/workspace";
2
+ export default function Page(){return <Workspace compare/>;}
@@ -0,0 +1,412 @@
1
+ :root {
2
+ color-scheme: dark;
3
+ --lab-canvas: #000;
4
+ --lab-panel: #080808;
5
+ --lab-line: #242424;
6
+ --lab-text: #fafafa;
7
+ --lab-muted: #a3a3a3;
8
+ --lab-accent: #fff;
9
+ }
10
+ * {
11
+ box-sizing: border-box;
12
+ }
13
+ body {
14
+ margin: 0;
15
+ background: var(--lab-canvas);
16
+ color: var(--lab-text);
17
+ font:
18
+ 14px/1.55 ui-sans-serif,
19
+ system-ui,
20
+ sans-serif;
21
+ }
22
+ a {
23
+ color: inherit;
24
+ text-decoration: none;
25
+ }
26
+ button,
27
+ select {
28
+ font: inherit;
29
+ }
30
+ :focus-visible {
31
+ outline: 2px solid white;
32
+ outline-offset: 5px;
33
+ }
34
+ .lab-shell {
35
+ width: min(1800px, calc(100% - 64px));
36
+ margin: auto;
37
+ padding: 24px 0 48px;
38
+ }
39
+ .lab-header {
40
+ display: flex;
41
+ align-items: center;
42
+ gap: 24px;
43
+ min-height: 56px;
44
+ padding-bottom: 20px;
45
+ border-bottom: 1px solid var(--lab-line);
46
+ }
47
+ .lab-header > :last-child {
48
+ margin-left: auto;
49
+ }
50
+ .lab-header h1,
51
+ .brand {
52
+ margin: 0;
53
+ font-size: 24px;
54
+ font-weight: 650;
55
+ letter-spacing: -0.9px;
56
+ }
57
+ .brand-dot {
58
+ color: #888;
59
+ }
60
+ .button {
61
+ display: inline-flex;
62
+ align-items: center;
63
+ justify-content: center;
64
+ min-height: 40px;
65
+ padding: 9px 16px;
66
+ border: 1px solid #333;
67
+ border-radius: 9px;
68
+ background: #111;
69
+ color: white;
70
+ font-weight: 550;
71
+ cursor: pointer;
72
+ }
73
+ .button:hover {
74
+ background: #1a1a1a;
75
+ border-color: #666;
76
+ }
77
+ .text-link {
78
+ color: #ccc;
79
+ font-size: 13px;
80
+ }
81
+ .text-link:hover {
82
+ color: white;
83
+ }
84
+ .lab-intro {
85
+ padding: 40px 0 28px;
86
+ }
87
+ .lab-intro h2 {
88
+ margin: 0 0 8px;
89
+ font-size: clamp(24px, 3vw, 36px);
90
+ font-weight: 550;
91
+ letter-spacing: -1.3px;
92
+ }
93
+ .lab-intro p {
94
+ margin: 0;
95
+ color: var(--lab-muted);
96
+ }
97
+ .version-grid {
98
+ display: grid;
99
+ grid-template-columns: repeat(3, minmax(0, 1fr));
100
+ gap: 22px;
101
+ }
102
+ .version-card {
103
+ overflow: hidden;
104
+ border: 1px solid var(--lab-line);
105
+ border-radius: 14px;
106
+ background: var(--lab-panel);
107
+ }
108
+ .website-preview {
109
+ display: block;
110
+ position: relative;
111
+ overflow: hidden;
112
+ aspect-ratio: 1.44;
113
+ background: white;
114
+ border-bottom: 1px solid var(--lab-line);
115
+ }
116
+ .preview-canvas {
117
+ container-type: inline-size;
118
+ position: absolute;
119
+ inset: 0;
120
+ overflow: hidden;
121
+ pointer-events: none;
122
+ }
123
+ .preview-canvas iframe {
124
+ display: block;
125
+ width: 1440px;
126
+ height: 1000px;
127
+ border: 0;
128
+ transform-origin: top left;
129
+ transform: scale(calc(100cqw / 1440px));
130
+ background: white;
131
+ }
132
+ .preview-open {
133
+ position: absolute;
134
+ bottom: 12px;
135
+ right: 12px;
136
+ border: 1px solid #444;
137
+ border-radius: 8px;
138
+ padding: 7px 11px;
139
+ background: #000;
140
+ color: white;
141
+ font-size: 12px;
142
+ opacity: 0;
143
+ transition: opacity 0.15s;
144
+ }
145
+ .website-preview:hover .preview-open,
146
+ .website-preview:focus-visible .preview-open {
147
+ opacity: 1;
148
+ }
149
+ .version-details {
150
+ padding: 20px;
151
+ }
152
+ .version-meta {
153
+ display: flex;
154
+ justify-content: space-between;
155
+ gap: 12px;
156
+ align-items: center;
157
+ color: var(--lab-muted);
158
+ font-size: 11px;
159
+ text-transform: uppercase;
160
+ letter-spacing: 0.06em;
161
+ }
162
+ .status {
163
+ font-size: 10px;
164
+ border: 1px solid #333;
165
+ padding: 3px 7px;
166
+ border-radius: 5px;
167
+ white-space: nowrap;
168
+ }
169
+ .status-runnable {
170
+ color: #8ed8b5;
171
+ }
172
+ .status-reconstruction {
173
+ color: #eac47e;
174
+ }
175
+ .status-visual-reference {
176
+ color: #c3b5e8;
177
+ }
178
+ .version-details h3 {
179
+ margin: 16px 0 10px;
180
+ font-size: 20px;
181
+ font-weight: 550;
182
+ letter-spacing: -0.5px;
183
+ }
184
+ .version-details > p {
185
+ margin: 0;
186
+ color: var(--lab-muted);
187
+ min-height: 66px;
188
+ }
189
+ .version-details details {
190
+ margin-top: 16px;
191
+ font-size: 12px;
192
+ color: var(--lab-muted);
193
+ }
194
+ .version-details summary {
195
+ cursor: pointer;
196
+ }
197
+ .version-details code {
198
+ overflow-wrap: anywhere;
199
+ }
200
+ .card-actions {
201
+ display: flex;
202
+ gap: 18px;
203
+ align-items: center;
204
+ margin-top: 22px;
205
+ }
206
+ .compare-shell {
207
+ --compare-inset: 20px;
208
+ width: calc(100% - 2 * var(--compare-inset));
209
+ height: 100dvh;
210
+ padding: var(--compare-inset) 0;
211
+ display: flex;
212
+ flex-direction: column;
213
+ gap: 12px;
214
+ }
215
+ .compare-shell .lab-header { flex: none; padding-bottom: 0; }
216
+ .compare-shell > [role="alert"] { flex: none; margin: 0; }
217
+ .lab-header h1.compare-title {
218
+ font-size: 14px;
219
+ letter-spacing: 0;
220
+ color: var(--lab-muted);
221
+ font-weight: 400;
222
+ }
223
+ .compare-controls {
224
+ display: grid;
225
+ grid-template-columns: 1fr 1fr auto;
226
+ align-items: end;
227
+ gap: 16px;
228
+ padding: 20px 0;
229
+ }
230
+ .compare-controls label {
231
+ display: grid;
232
+ gap: 6px;
233
+ font-size: 12px;
234
+ color: var(--lab-muted);
235
+ }
236
+ .compare-controls select {
237
+ min-width: 0;
238
+ width: 100%;
239
+ min-height: 40px;
240
+ padding: 8px 12px;
241
+ border: 1px solid #333;
242
+ border-radius: 9px;
243
+ background: #080808;
244
+ color: white;
245
+ }
246
+ .compare-grid {
247
+ display: grid;
248
+ grid-template-columns: repeat(2, minmax(0, 1fr));
249
+ gap: 16px;
250
+ }
251
+ .comparison-frame {
252
+ min-width: 0;
253
+ overflow: hidden;
254
+ border: 1px solid var(--lab-line);
255
+ border-radius: 12px;
256
+ }
257
+ .frame-toolbar {
258
+ display: flex;
259
+ align-items: center;
260
+ justify-content: space-between;
261
+ gap: 12px;
262
+ min-height: 44px;
263
+ padding: 10px 14px;
264
+ }
265
+ .frame-toolbar h2 {
266
+ margin: 0;
267
+ font-size: 13px;
268
+ font-weight: 550;
269
+ }
270
+ .frame-toolbar a {
271
+ padding: 0 6px;
272
+ font-size: 18px;
273
+ }
274
+ .comparison-frame > iframe {
275
+ display: block;
276
+ width: 100%;
277
+ height: calc(100dvh - 230px);
278
+ min-height: 500px;
279
+ background: white;
280
+ border: 0;
281
+ }
282
+ .frame-caption {
283
+ padding: 12px 14px;
284
+ border-top: 1px solid var(--lab-line);
285
+ }
286
+ .frame-caption p {
287
+ margin: 8px 0 0;
288
+ font-size: 12px;
289
+ color: var(--lab-muted);
290
+ }
291
+ .empty-state {
292
+ padding: 64px 0;
293
+ color: var(--lab-muted);
294
+ }
295
+ @media (max-width: 1000px) {
296
+ .version-grid {
297
+ grid-template-columns: repeat(2, minmax(0, 1fr));
298
+ }
299
+ }
300
+ @media (max-width: 640px) {
301
+ .lab-shell,
302
+ .compare-shell {
303
+ width: calc(100% - 28px);
304
+ }
305
+ .version-grid,
306
+ .compare-grid {
307
+ grid-template-columns: 1fr;
308
+ }
309
+ .compare-controls {
310
+ grid-template-columns: 1fr 1fr;
311
+ }
312
+ .compare-controls button {
313
+ grid-column: 1 / -1;
314
+ }
315
+ .lab-header {
316
+ gap: 12px;
317
+ }
318
+ .lab-header .button {
319
+ font-size: 12px;
320
+ }
321
+ .brand {
322
+ font-size: 20px;
323
+ }
324
+ }
325
+ @media (prefers-reduced-motion: reduce) {
326
+ * {
327
+ transition: none !important;
328
+ }
329
+ }
330
+ /* Pane workspace uses the existing black Design Lab tokens. */
331
+ .brand{display:flex;align-items:center;gap:10px}
332
+ .category-tabs{display:flex;gap:8px;padding:20px 0}
333
+ .category-tabs button,.pane-actions button,.pane-actions a{background:var(--lab-panel);color:var(--lab-muted);border:1px solid var(--lab-line);border-radius:6px;cursor:pointer;padding:8px}
334
+ .category-tabs button[aria-pressed=true]{color:var(--lab-text);border-color:var(--lab-muted)}
335
+ .pane-workspace{display:flex;flex:1;min-height:0;min-width:0}
336
+ .pane-split{display:flex;gap:12px;min-width:0;min-height:0;height:auto;flex:1}
337
+ .split-column{flex-direction:column}
338
+ .workspace-pane{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;border:1px solid var(--lab-line);border-radius:10px;overflow:hidden;background:var(--lab-panel)}
339
+ .pane-toolbar{display:flex;align-items:center;gap:8px;padding:8px;border-bottom:1px solid var(--lab-line);flex-wrap:wrap}
340
+ .pane-toolbar select{flex:1;min-width:100px;width:0;background:var(--lab-panel);color:var(--lab-text);border:1px solid var(--lab-line);border-radius:6px;padding:8px}
341
+ .pane-actions{display:flex;gap:4px;margin-left:auto}
342
+ .pane-actions button,.pane-actions a{display:inline-flex;padding:7px}
343
+ .pane-actions button:hover,.pane-actions a:hover{color:var(--lab-text)}
344
+ .workspace-pane iframe{display:block;flex:1;height:0;min-height:0;width:100%;border:0;background:white}
345
+ .maximized{position:fixed;inset:0;height:100dvh;z-index:100;background:var(--lab-canvas)}
346
+ .changed{font-size:12px;color:var(--lab-muted);margin-top:16px!important;min-height:0}
347
+ .exact-time{display:block;font-size:11px;margin-top:4px}
348
+ .version-details h2{font-size:20px;font-weight:550;letter-spacing:-.5px}
349
+ .preview-placeholder{aspect-ratio:1.44;display:grid;place-items:center;color:var(--lab-muted)}
350
+ @media(max-width:640px){.split-row{flex-direction:column}.maximized{height:100dvh}.pane-toolbar select{font-size:12px}.pane-split{gap:8px}}
351
+ /* Monochrome adaptation of CleoBench/Scaleo action pills and spring track. */
352
+ :root{--lab-pill-from:#1a1a1a;--lab-pill-to:#0d0d0d;--lab-pill-hover:#222;--lab-pill-border:rgba(255,255,255,.1);--lab-pill-bevel:rgba(255,255,255,.12)}
353
+ .button,.pane-actions button,.pane-actions a,.pane-toolbar select{border-radius:9999px;background:linear-gradient(to bottom,var(--lab-pill-from),var(--lab-pill-to));border:1px solid var(--lab-pill-border);box-shadow:inset 0 1px 0 var(--lab-pill-bevel),0 4px 10px rgba(0,0,0,.5);backdrop-filter:blur(20px);transition:transform 150ms,background 150ms,border-color 150ms}
354
+ .button:hover,.pane-actions button:hover,.pane-actions a:hover{background:linear-gradient(to bottom,var(--lab-pill-hover),#121212);border-color:rgba(255,255,255,.18)}
355
+ .button:active,.pane-actions button:active,.pane-actions a:active,.glass-toggle button:active{transform:scale(.95)}
356
+ .lab-header{border-bottom:0;display:grid;grid-template-columns:1fr auto 1fr;padding-bottom:12px}
357
+ .lab-header>:last-child{justify-self:end}
358
+ .glass-toggle{padding:4px;gap:0;border-radius:9999px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);box-shadow:inset 0 1px 0 rgba(255,255,255,.05);backdrop-filter:blur(20px)}
359
+ .glass-toggle button{position:relative;border:0;background:none!important;box-shadow:none;border-radius:9999px;padding:8px 14px;transition:transform 150ms,color 150ms;white-space:nowrap}
360
+ .glass-toggle-thumb{position:absolute;inset:0;border-radius:9999px;background:linear-gradient(to bottom,#181818,#0d0d0d);border:1px solid var(--lab-pill-bevel);box-shadow:inset 0 1px 0 var(--lab-pill-bevel),0 4px 12px rgba(0,0,0,.6)}
361
+ .glass-toggle-label{position:relative;z-index:1}
362
+ .centered-empty{min-height:calc(100dvh - 220px);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:20px;padding:32px}
363
+ .pane-workspace>.centered-empty{flex:1;min-height:0;height:auto}
364
+ .empty-animation{color:var(--lab-muted)}
365
+ @media(max-width:760px){.lab-header{grid-template-columns:1fr auto}.glass-toggle{grid-row:2;grid-column:1/-1;justify-self:center}.brand{font-size:20px}.lab-header>.button{grid-column:2;grid-row:1}}
366
+ @media(prefers-reduced-motion:reduce){.button:active,.pane-actions button:active,.pane-actions a:active,.glass-toggle button:active{transform:none}}
367
+
368
+
369
+ /* A single pane and every nested split share the same bounded viewport. */
370
+ @media(max-width:640px){.compare-shell{--compare-inset:14px}}
371
+ .version-card{display:flex;flex-direction:column}
372
+ .version-card>.website-preview,.version-card>.preview-placeholder{flex:none;width:100%}
373
+ .version-details{flex:1;display:grid;grid-template-rows:auto auto 1fr auto auto;gap:14px}
374
+ .version-details h2{margin:0}
375
+ .version-details>p{min-height:0;margin:0}
376
+ .version-details .changed{min-height:44px;margin:0!important}
377
+ .version-details .card-actions{margin:0;align-self:end;flex-wrap:wrap;gap:10px}
378
+ /* Portalled listbox: same monochrome glass tokens as the action pills. */
379
+ .version-select{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:0 1 auto;min-width:0;width:max-content;max-width:100%;padding:8px 12px;color:var(--lab-text);cursor:pointer;border-radius:9999px;background:linear-gradient(to bottom,var(--lab-pill-from),var(--lab-pill-to));border:1px solid var(--lab-pill-border);box-shadow:inset 0 1px 0 var(--lab-pill-bevel),0 4px 10px rgba(0,0,0,.5);transition:transform 150ms}
380
+ .version-select>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
381
+ .version-select>svg{flex:none}
382
+ .version-select:active{transform:scale(.95)}
383
+ .version-menu{position:fixed;z-index:300;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;-ms-overflow-style:none;overscroll-behavior:contain;padding:5px;border:1px solid var(--lab-pill-border);border-radius:18px;background:var(--lab-panel);background:linear-gradient(to bottom,var(--lab-pill-from),var(--lab-panel));color:var(--lab-text);box-shadow:inset 0 1px 0 var(--lab-pill-bevel),0 12px 30px rgba(0,0,0,.6);backdrop-filter:blur(20px)}
384
+ .version-option{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:40px;padding:9px 12px;border-radius:9999px;cursor:pointer;font-size:13px;color:var(--lab-text)}
385
+ .version-option>span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
386
+ .version-option>svg{flex:none}
387
+ .version-option.is-active{background:var(--lab-pill-hover);box-shadow:inset 0 1px 0 var(--lab-pill-bevel)}
388
+ @media(prefers-reduced-motion:reduce){.version-select:active{transform:none}}
389
+
390
+ .version-menu::-webkit-scrollbar{display:none;width:0;height:0}
391
+
392
+ /* Shared script identity; dashboard controls keep their own layout and sans type. */
393
+ .brand.dl-brand-lockup {
394
+ --brand-wordmark-size: 32px;
395
+ --brand-logo-size: 40px;
396
+ --brand-lockup-gap: 8px;
397
+ --brand-lockup-width: 280px;
398
+ min-width: 0;
399
+ justify-self: start;
400
+ }
401
+ @media (max-width: 760px) {
402
+ .lab-header { column-gap: 12px; }
403
+ .brand.dl-brand-lockup {
404
+ --brand-wordmark-size: clamp(20px, 6vw, 30px);
405
+ --brand-logo-size: clamp(24px, 8vw, 36px);
406
+ --brand-lockup-gap: 6px;
407
+ --brand-lockup-width: 100%;
408
+ }
409
+ }
410
+ @media (max-width: 360px) {
411
+ .lab-header > .button { padding-inline: 10px; font-size: 11px; }
412
+ }
@@ -0,0 +1,21 @@
1
+ import "./lab.css";
2
+ import "../../public/brand/wordmark.css";
3
+ import {LabProviders} from "../../components/lab-providers";
4
+
5
+ export const metadata = {
6
+ title: "Design Labs",
7
+ icons: {icon: "/favicon.ico", apple: "/apple-touch-icon.png"},
8
+ manifest: "/site.webmanifest",
9
+ robots: { index: false, follow: false },
10
+ };
11
+
12
+ export default function LabLayout({
13
+ children,
14
+ }: Readonly<{ children: React.ReactNode }>) {
15
+ return (
16
+ <html lang="en">
17
+ <head><link rel="preload" href="/brand/design-labs-script.woff2" as="font" type="font/woff2" crossOrigin="anonymous" /></head>
18
+ <body><LabProviders>{children}</LabProviders></body>
19
+ </html>
20
+ );
21
+ }
@@ -0,0 +1,2 @@
1
+ import Workspace from "../../components/workspace";
2
+ export default function Page(){return <Workspace/>;}
@@ -0,0 +1,94 @@
1
+ import {
2
+ AnnotationError,
3
+ checkWriteOrigin,
4
+ listAnnotations,
5
+ upsertAnnotation,
6
+ deleteAnnotations,
7
+ } from "../../../scripts/annotation-store.mjs";
8
+ import process from "node:process";
9
+ export const dynamic = "force-dynamic";
10
+ export const runtime = "nodejs";
11
+ const headers = { "Cache-Control": "no-store" };
12
+ function failure(error: unknown) {
13
+ if (error instanceof AnnotationError)
14
+ return Response.json(
15
+ { error: error.message },
16
+ { status: error.status, headers },
17
+ );
18
+ return Response.json(
19
+ {
20
+ error:
21
+ "Could not read or save annotations. Existing data has been preserved.",
22
+ },
23
+ { status: 500, headers },
24
+ );
25
+ }
26
+ async function body(request: Request): Promise<unknown> {
27
+ checkWriteOrigin(request);
28
+ if (
29
+ request.headers.get("content-type")?.split(";")[0].trim().toLowerCase() !==
30
+ "application/json"
31
+ )
32
+ throw new AnnotationError("Expected JSON annotation data", 415);
33
+ const limit = 96000;
34
+ if (Number(request.headers.get("content-length")) > limit)
35
+ throw new AnnotationError("Annotation payload is too large", 413);
36
+ const reader = request.body?.getReader();
37
+ if (!reader) throw new AnnotationError("Missing annotation data");
38
+ const decoder = new TextDecoder();
39
+ let raw = "";
40
+ let length = 0;
41
+ try {
42
+ while (true) {
43
+ const chunk = await reader.read();
44
+ if (chunk.done) break;
45
+ length += chunk.value.byteLength;
46
+ if (length > limit) {
47
+ await reader.cancel();
48
+ throw new AnnotationError("Annotation payload is too large", 413);
49
+ }
50
+ raw += decoder.decode(chunk.value, { stream: true });
51
+ }
52
+ raw += decoder.decode();
53
+ } finally {
54
+ reader.releaseLock();
55
+ }
56
+ try {
57
+ return JSON.parse(raw);
58
+ } catch {
59
+ throw new AnnotationError("Invalid JSON annotation data");
60
+ }
61
+ }
62
+ export async function GET(request: Request) {
63
+ try {
64
+ return Response.json(
65
+ await listAnnotations(
66
+ process.cwd(),
67
+ new URL(request.url).searchParams.get("versionKey"),
68
+ ),
69
+ { headers },
70
+ );
71
+ } catch (error) {
72
+ return failure(error);
73
+ }
74
+ }
75
+ export async function PUT(request: Request) {
76
+ try {
77
+ return Response.json(
78
+ await upsertAnnotation(process.cwd(), await body(request)),
79
+ { headers },
80
+ );
81
+ } catch (error) {
82
+ return failure(error);
83
+ }
84
+ }
85
+ export async function DELETE(request: Request) {
86
+ try {
87
+ return Response.json(
88
+ await deleteAnnotations(process.cwd(), await body(request)),
89
+ { headers },
90
+ );
91
+ } catch (error) {
92
+ return failure(error);
93
+ }
94
+ }