@1agh/maude 0.15.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/LICENSE +21 -0
- package/README.md +166 -0
- package/cli/bin/maude.exe +15 -0
- package/cli/bin/maude.mjs +45 -0
- package/cli/bin/mdcc.exe +10 -0
- package/cli/bin/mdcc.mjs +7 -0
- package/cli/cli-wrapper.cjs +67 -0
- package/cli/commands/config.mjs +94 -0
- package/cli/commands/design.mjs +386 -0
- package/cli/commands/help.mjs +57 -0
- package/cli/commands/init.mjs +178 -0
- package/cli/commands/version.mjs +7 -0
- package/cli/install.cjs +113 -0
- package/cli/lib/argv.mjs +37 -0
- package/cli/lib/argv.test.mjs +46 -0
- package/cli/lib/copy-tree.mjs +78 -0
- package/package.json +94 -0
- package/plugins/design/dev-server/annotations-context-toolbar.tsx +397 -0
- package/plugins/design/dev-server/annotations-layer.tsx +1717 -0
- package/plugins/design/dev-server/api.ts +674 -0
- package/plugins/design/dev-server/bin/_screenshot-playwright.mjs +50 -0
- package/plugins/design/dev-server/bin/bootstrap-check.sh +83 -0
- package/plugins/design/dev-server/bin/canvas-edit.sh +48 -0
- package/plugins/design/dev-server/bin/handoff.sh +27 -0
- package/plugins/design/dev-server/bin/screenshot.sh +232 -0
- package/plugins/design/dev-server/bin/server-up.sh +135 -0
- package/plugins/design/dev-server/bin/slug.sh +22 -0
- package/plugins/design/dev-server/bin/smoke.sh +272 -0
- package/plugins/design/dev-server/build.ts +267 -0
- package/plugins/design/dev-server/canvas-build.ts +219 -0
- package/plugins/design/dev-server/canvas-edit.ts +388 -0
- package/plugins/design/dev-server/canvas-header.ts +165 -0
- package/plugins/design/dev-server/canvas-icons.tsx +131 -0
- package/plugins/design/dev-server/canvas-lib-inline.ts +260 -0
- package/plugins/design/dev-server/canvas-lib-resolver.ts +85 -0
- package/plugins/design/dev-server/canvas-lib.tsx +1995 -0
- package/plugins/design/dev-server/canvas-meta.schema.json +181 -0
- package/plugins/design/dev-server/canvas-pipeline.ts +270 -0
- package/plugins/design/dev-server/canvas-shell.tsx +813 -0
- package/plugins/design/dev-server/client/app.jsx +2027 -0
- package/plugins/design/dev-server/client/hmr.mjs +85 -0
- package/plugins/design/dev-server/client/iframe-lazy.mjs +121 -0
- package/plugins/design/dev-server/client/index.html +15 -0
- package/plugins/design/dev-server/client/styles/0-reset.css +18 -0
- package/plugins/design/dev-server/client/styles/1-tokens.css +297 -0
- package/plugins/design/dev-server/client/styles/2-layout.css +35 -0
- package/plugins/design/dev-server/client/styles/3-shell.css +906 -0
- package/plugins/design/dev-server/client/styles/4-components.css +1268 -0
- package/plugins/design/dev-server/client/styles/5-utilities.css +4 -0
- package/plugins/design/dev-server/client/styles/_index.css +24 -0
- package/plugins/design/dev-server/client/styles.css +1419 -0
- package/plugins/design/dev-server/config.schema.json +147 -0
- package/plugins/design/dev-server/context-menu.tsx +343 -0
- package/plugins/design/dev-server/context.ts +173 -0
- package/plugins/design/dev-server/dist/client.bundle.js +20323 -0
- package/plugins/design/dev-server/dist/styles.css +2875 -0
- package/plugins/design/dev-server/examples/README.md +9 -0
- package/plugins/design/dev-server/examples/perf-100-artboards.tsx +113 -0
- package/plugins/design/dev-server/fs-watch.ts +63 -0
- package/plugins/design/dev-server/handoff.ts +721 -0
- package/plugins/design/dev-server/history.ts +125 -0
- package/plugins/design/dev-server/hmr-broadcast.ts +114 -0
- package/plugins/design/dev-server/http.ts +413 -0
- package/plugins/design/dev-server/input-router.tsx +485 -0
- package/plugins/design/dev-server/inspect.ts +365 -0
- package/plugins/design/dev-server/locator.ts +159 -0
- package/plugins/design/dev-server/mem.ts +97 -0
- package/plugins/design/dev-server/runtime-bundle.ts +235 -0
- package/plugins/design/dev-server/server.mjs +1246 -0
- package/plugins/design/dev-server/server.ts +131 -0
- package/plugins/design/dev-server/test/_helpers.ts +81 -0
- package/plugins/design/dev-server/test/active-state.test.ts +145 -0
- package/plugins/design/dev-server/test/annotations-api.test.ts +146 -0
- package/plugins/design/dev-server/test/annotations-layer.test.ts +419 -0
- package/plugins/design/dev-server/test/binary-smoke.test.ts +47 -0
- package/plugins/design/dev-server/test/bundle-smoke.test.ts +29 -0
- package/plugins/design/dev-server/test/canvas-build.test.ts +78 -0
- package/plugins/design/dev-server/test/canvas-edit.test.ts +139 -0
- package/plugins/design/dev-server/test/canvas-header.test.ts +127 -0
- package/plugins/design/dev-server/test/canvas-lib-inline.test.ts +146 -0
- package/plugins/design/dev-server/test/canvas-lib-resolver.test.ts +112 -0
- package/plugins/design/dev-server/test/canvas-meta-api.test.ts +236 -0
- package/plugins/design/dev-server/test/canvas-pipeline.test.ts +180 -0
- package/plugins/design/dev-server/test/canvas-route.test.ts +176 -0
- package/plugins/design/dev-server/test/fs-watch.test.ts +41 -0
- package/plugins/design/dev-server/test/handoff-static-frames.test.ts +215 -0
- package/plugins/design/dev-server/test/handoff.test.ts +281 -0
- package/plugins/design/dev-server/test/history-rollback.test.ts +62 -0
- package/plugins/design/dev-server/test/hmr-broadcast.test.ts +108 -0
- package/plugins/design/dev-server/test/input-router.test.ts +316 -0
- package/plugins/design/dev-server/test/locator.test.ts +214 -0
- package/plugins/design/dev-server/test/perf-harness.ts +193 -0
- package/plugins/design/dev-server/test/phase-3.6-smoke.test.ts +77 -0
- package/plugins/design/dev-server/test/runtime-bundle.test.ts +69 -0
- package/plugins/design/dev-server/test/server-lifecycle.test.ts +28 -0
- package/plugins/design/dev-server/test/tool-palette.test.tsx +55 -0
- package/plugins/design/dev-server/test/use-annotation-selection.test.tsx +77 -0
- package/plugins/design/dev-server/test/use-artboard-drag.test.ts +325 -0
- package/plugins/design/dev-server/test/use-selection-set.test.tsx +166 -0
- package/plugins/design/dev-server/test/use-snap-guides.test.ts +190 -0
- package/plugins/design/dev-server/test/use-tool-mode.test.tsx +93 -0
- package/plugins/design/dev-server/test/ws-handshake.test.ts +33 -0
- package/plugins/design/dev-server/tool-palette.tsx +278 -0
- package/plugins/design/dev-server/tsconfig.json +26 -0
- package/plugins/design/dev-server/use-annotation-selection.tsx +92 -0
- package/plugins/design/dev-server/use-annotations-visibility.tsx +43 -0
- package/plugins/design/dev-server/use-artboard-drag.tsx +445 -0
- package/plugins/design/dev-server/use-selection-set.tsx +224 -0
- package/plugins/design/dev-server/use-snap-guides.tsx +215 -0
- package/plugins/design/dev-server/use-tool-mode.tsx +114 -0
- package/plugins/design/dev-server/ws.ts +90 -0
- package/plugins/design/templates/_shell.html +177 -0
- package/plugins/design/templates/canvas.tsx.template +54 -0
- package/plugins/design/templates/design-system-inspiration/_MAPPING.md +277 -0
- package/plugins/design/templates/design-system-inspiration/_README.md +71 -0
- package/plugins/design/templates/design-system-inspiration/audience-consumer/components-banner.html +68 -0
- package/plugins/design/templates/design-system-inspiration/audience-consumer/components-empty-state-generous.html +39 -0
- package/plugins/design/templates/design-system-inspiration/audience-consumer/components-feature-grid.html +62 -0
- package/plugins/design/templates/design-system-inspiration/audience-consumer/components-marketing-card.html +63 -0
- package/plugins/design/templates/design-system-inspiration/audience-consumer/components-testimonial.html +80 -0
- package/plugins/design/templates/design-system-inspiration/audience-developer/components-code-block.html +71 -0
- package/plugins/design/templates/design-system-inspiration/audience-developer/components-diff-view.html +65 -0
- package/plugins/design/templates/design-system-inspiration/audience-developer/components-log-stream.html +62 -0
- package/plugins/design/templates/design-system-inspiration/audience-developer/components-monospace-table.html +57 -0
- package/plugins/design/templates/design-system-inspiration/audience-developer/components-terminal-pane.html +67 -0
- package/plugins/design/templates/design-system-inspiration/audience-developer/type-mono.html +57 -0
- package/plugins/design/templates/design-system-inspiration/audience-pro/colors-presence.html +74 -0
- package/plugins/design/templates/design-system-inspiration/audience-pro/components-command-palette.html +90 -0
- package/plugins/design/templates/design-system-inspiration/audience-pro/components-keyboard.html +51 -0
- package/plugins/design/templates/design-system-inspiration/audience-pro/components-list.html +89 -0
- package/plugins/design/templates/design-system-inspiration/audience-pro/components-shortcuts-overlay.html +85 -0
- package/plugins/design/templates/design-system-inspiration/audience-pro/components-toast-menu.html +80 -0
- package/plugins/design/templates/design-system-inspiration/core/INDEX.md.tpl +25 -0
- package/plugins/design/templates/design-system-inspiration/core/README.orchestration.md.tpl +71 -0
- package/plugins/design/templates/design-system-inspiration/core/README.philosophy.md.tpl +77 -0
- package/plugins/design/templates/design-system-inspiration/core/SKILL.md.tpl +50 -0
- package/plugins/design/templates/design-system-inspiration/core/colors_and_type.css.tpl +111 -0
- package/plugins/design/templates/design-system-inspiration/core/config.json.tpl +28 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/_layout.css +113 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/colors-accent.html +48 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/colors-surfaces.html +49 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/colors-text.html +52 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/components-buttons.html +83 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/components-cards.html +79 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/components-inputs.html +82 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/motion.html +66 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/spacing-scale.html +53 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/type-scale.html +62 -0
- package/plugins/design/templates/design-system-inspiration/foundations/borders.html +39 -0
- package/plugins/design/templates/design-system-inspiration/foundations/elevation.html +46 -0
- package/plugins/design/templates/design-system-inspiration/foundations/focus.html +48 -0
- package/plugins/design/templates/design-system-inspiration/foundations/grid.html +51 -0
- package/plugins/design/templates/design-system-inspiration/foundations/iconography.html +73 -0
- package/plugins/design/templates/design-system-inspiration/foundations/opacity.html +45 -0
- package/plugins/design/templates/design-system-inspiration/foundations/radii.html +40 -0
- package/plugins/design/templates/design-system-inspiration/foundations/selection.html +45 -0
- package/plugins/design/templates/design-system-inspiration/meta/accessibility.html +62 -0
- package/plugins/design/templates/design-system-inspiration/meta/i18n.html +73 -0
- package/plugins/design/templates/design-system-inspiration/meta/presence-multiplayer.html +71 -0
- package/plugins/design/templates/design-system-inspiration/meta/tokens-index.html +80 -0
- package/plugins/design/templates/design-system-inspiration/patterns/patterns-auth.html +78 -0
- package/plugins/design/templates/design-system-inspiration/patterns/patterns-data-density.html +61 -0
- package/plugins/design/templates/design-system-inspiration/patterns/patterns-error-pages.html +70 -0
- package/plugins/design/templates/design-system-inspiration/patterns/patterns-form-layouts.html +70 -0
- package/plugins/design/templates/design-system-inspiration/patterns/patterns-onboarding.html +71 -0
- package/plugins/design/templates/design-system-inspiration/patterns/patterns-pricing.html +83 -0
- package/plugins/design/templates/design-system-inspiration/platform-desktop/components-resize-panels.html +63 -0
- package/plugins/design/templates/design-system-inspiration/platform-desktop/ui_kits-desktop-index.html +55 -0
- package/plugins/design/templates/design-system-inspiration/platform-desktop/ui_kits-desktop-showcase.html +302 -0
- package/plugins/design/templates/design-system-inspiration/platform-mobile/components-bottom-sheet.html +63 -0
- package/plugins/design/templates/design-system-inspiration/platform-mobile/components-pull-to-refresh.html +74 -0
- package/plugins/design/templates/design-system-inspiration/platform-mobile/components-segmented-control.html +51 -0
- package/plugins/design/templates/design-system-inspiration/platform-mobile/components-tab-bar.html +57 -0
- package/plugins/design/templates/design-system-inspiration/platform-mobile/ui_kits-mobile-index.html +58 -0
- package/plugins/design/templates/design-system-inspiration/platform-mobile/ui_kits-mobile-showcase.html +237 -0
- package/plugins/design/templates/design-system-inspiration/status/colors-status.html +49 -0
- package/plugins/design/templates/design-system-inspiration/status/components-status.html +63 -0
- package/plugins/design/templates/design-system-inspiration/status/skeletons.html +74 -0
- package/plugins/design/templates/design-system-inspiration/theme-both/colors-themes-side-by-side.html +59 -0
- package/plugins/design/templates/design-system-inspiration/universal/components-callout.html +74 -0
- package/plugins/design/templates/design-system-inspiration/universal/components-dialogs.html +81 -0
- package/plugins/design/templates/design-system-inspiration/universal/components-tables.html +101 -0
- package/plugins/design/templates/design-system-inspiration/universal/components-toggles.html +74 -0
- package/plugins/design/templates/design-system-inspiration/universal/components-tooltips.html +74 -0
- package/plugins/design/templates/design-system-inspiration/universal/empty-state.html.tpl +34 -0
- package/plugins/design/templates/design-system-inspiration/universal/logo.html +42 -0
- package/plugins/design/templates/ds-specimen.tsx.template +59 -0
- package/plugins/flow/.claude-plugin/config.schema.json +398 -0
- package/plugins/flow/README.md +45 -0
- package/plugins/flow/templates/ai-skeleton/INDEX.md +50 -0
- package/plugins/flow/templates/ai-skeleton/README.md +46 -0
- package/plugins/flow/templates/ai-skeleton/browser/har/.gitkeep +0 -0
- package/plugins/flow/templates/ai-skeleton/browser/snapshots/.gitkeep +0 -0
- package/plugins/flow/templates/ai-skeleton/business/README.md +12 -0
- package/plugins/flow/templates/ai-skeleton/context/README.md +12 -0
- package/plugins/flow/templates/ai-skeleton/decisions/README.md +20 -0
- package/plugins/flow/templates/ai-skeleton/design-import/.gitkeep +0 -0
- package/plugins/flow/templates/ai-skeleton/dev-logs/.gitkeep +0 -0
- package/plugins/flow/templates/ai-skeleton/device/.gitkeep +0 -0
- package/plugins/flow/templates/ai-skeleton/docs/README.md +5 -0
- package/plugins/flow/templates/ai-skeleton/logs/.gitkeep +0 -0
- package/plugins/flow/templates/ai-skeleton/logs/README.md +13 -0
- package/plugins/flow/templates/ai-skeleton/plans/README.md +16 -0
- package/plugins/flow/templates/ai-skeleton/plans/archive/.gitkeep +0 -0
- package/plugins/flow/templates/ai-skeleton/release-guide.md +35 -0
- package/plugins/flow/templates/ai-skeleton/reviews/README.md +15 -0
- package/plugins/flow/templates/ai-skeleton/scenarios/README.md +26 -0
- package/plugins/flow/templates/ai-skeleton/scenarios/_lib/.gitkeep +0 -0
- package/plugins/flow/templates/ai-skeleton/state/STATE.md +25 -0
- package/plugins/flow/templates/ai-skeleton/templates/HANDOFF.md +32 -0
- package/plugins/flow/templates/ai-skeleton/workflows.config.json +74 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Custom HMR client — runs in the dev-server shell only.
|
|
2
|
+
//
|
|
3
|
+
// Subscribes to the inspector WebSocket and reacts to `hmr` / `css-update` /
|
|
4
|
+
// `module-update` events emitted by `build.ts --watch` (or by the server's
|
|
5
|
+
// own fs-watch when authoring CSS direct under client/styles/).
|
|
6
|
+
//
|
|
7
|
+
// CSS path is zero-risk: refresh the <link> with a cache-busting query string,
|
|
8
|
+
// browser swaps stylesheet in-place, no React state lost.
|
|
9
|
+
//
|
|
10
|
+
// JSX path is intentionally LEFT as full-page reload for now (plan Task 9
|
|
11
|
+
// Gotcha 2 — land CSS-only HMR first; JSX patching arrives in Phase 3.5 once
|
|
12
|
+
// react-refresh-runtime is wired through Bun.build).
|
|
13
|
+
//
|
|
14
|
+
// Iframes opt out — never trigger a parent reload; they get a postMessage
|
|
15
|
+
// to the iframe itself.
|
|
16
|
+
|
|
17
|
+
const STYLE_SELECTOR = 'link[rel="stylesheet"][href*="/_client/styles.css"]';
|
|
18
|
+
|
|
19
|
+
function bumpStylesheet() {
|
|
20
|
+
const link = document.querySelector(STYLE_SELECTOR);
|
|
21
|
+
if (!link) return false;
|
|
22
|
+
const next = link.cloneNode();
|
|
23
|
+
const url = new URL(link.href, location.href);
|
|
24
|
+
url.searchParams.set('v', String(Date.now()));
|
|
25
|
+
next.href = url.toString();
|
|
26
|
+
// Swap once the new sheet has loaded; never leave the document briefly
|
|
27
|
+
// unstyled.
|
|
28
|
+
next.addEventListener('load', () => link.remove(), { once: true });
|
|
29
|
+
link.after(next);
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let reloadDebounce = 0;
|
|
34
|
+
function scheduleReload() {
|
|
35
|
+
if (reloadDebounce) return;
|
|
36
|
+
reloadDebounce = window.setTimeout(() => location.reload(), 80);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function handle(evt) {
|
|
40
|
+
if (!evt || typeof evt !== 'object') return;
|
|
41
|
+
if (evt.type === 'css-update' || evt.type === 'fs:css') {
|
|
42
|
+
if (!bumpStylesheet()) scheduleReload();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (evt.type === 'module-update') {
|
|
46
|
+
// No JSX-patching runtime yet; reload the page. State loss is acceptable
|
|
47
|
+
// for the shell — the iframes (selected element, scroll) survive because
|
|
48
|
+
// each iframe owns its own document and is not re-mounted on reload until
|
|
49
|
+
// the parent re-renders it.
|
|
50
|
+
scheduleReload();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (evt.type === 'fs:html') {
|
|
54
|
+
// The orchestrator (or the user via /design:edit) writes HTML files inside
|
|
55
|
+
// designRoot. We don't reload the shell, but we DO post a hint to the
|
|
56
|
+
// active iframe so it can refresh itself if it owns the changed canvas.
|
|
57
|
+
const iframes = document.querySelectorAll('iframe[data-canvas-path]');
|
|
58
|
+
for (const f of iframes) {
|
|
59
|
+
if (f.dataset.canvasPath && evt.file && evt.file.endsWith(f.dataset.canvasPath)) {
|
|
60
|
+
try {
|
|
61
|
+
// Trip a re-load on the iframe without disturbing the parent.
|
|
62
|
+
f.contentWindow?.location.reload();
|
|
63
|
+
} catch {
|
|
64
|
+
/* cross-origin / detached — ignore */
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function attachHmr(ws) {
|
|
72
|
+
if (!ws) return;
|
|
73
|
+
ws.addEventListener('message', (e) => {
|
|
74
|
+
let msg;
|
|
75
|
+
try {
|
|
76
|
+
msg = JSON.parse(e.data);
|
|
77
|
+
} catch {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
handle(msg);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Auto-attach when imported as a side-effect (build.ts wires it into the
|
|
85
|
+
// shell bundle, so `attachHmr` is called from app.jsx after the WS is open).
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// IntersectionObserver-driven lazy iframe mount.
|
|
2
|
+
//
|
|
3
|
+
// mountLazy(host, src) wraps the iframe in a `content-visibility: auto`
|
|
4
|
+
// container and only sets its `src` when the wrapper intersects the viewport.
|
|
5
|
+
// When the wrapper has been off-screen for > 30 s, the src is cleared and the
|
|
6
|
+
// iframe's last known state is stashed against the wrapper id so re-mount can
|
|
7
|
+
// hint the inspector to restore selection/scroll.
|
|
8
|
+
//
|
|
9
|
+
// Saves ~80 % initial render work on a 10-canvas page (plan Task 10 + web.dev
|
|
10
|
+
// iframe-lazy-loading + debugbear content-visibility).
|
|
11
|
+
|
|
12
|
+
const DEFAULT_IDLE_MS = 30_000;
|
|
13
|
+
const DEFAULT_ROOT_MARGIN = '200px 0px';
|
|
14
|
+
|
|
15
|
+
const stateById = new Map();
|
|
16
|
+
const observers = new WeakMap();
|
|
17
|
+
|
|
18
|
+
function makeWrapper() {
|
|
19
|
+
const wrap = document.createElement('div');
|
|
20
|
+
wrap.className = 'iframe-lazy-wrap';
|
|
21
|
+
wrap.style.cssText =
|
|
22
|
+
'contain: layout style paint; content-visibility: auto; contain-intrinsic-size: 1280px 720px;';
|
|
23
|
+
return wrap;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function attachIframe(wrap, src) {
|
|
27
|
+
let f = wrap.querySelector('iframe');
|
|
28
|
+
if (!f) {
|
|
29
|
+
f = document.createElement('iframe');
|
|
30
|
+
f.setAttribute('loading', 'lazy');
|
|
31
|
+
f.setAttribute('referrerpolicy', 'no-referrer-when-downgrade');
|
|
32
|
+
f.style.cssText = 'width: 100%; height: 100%; border: 0; display: block;';
|
|
33
|
+
wrap.appendChild(f);
|
|
34
|
+
}
|
|
35
|
+
if (f.dataset.src !== src) {
|
|
36
|
+
f.dataset.src = src;
|
|
37
|
+
f.src = src;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function detachIframe(wrap, id) {
|
|
42
|
+
const f = wrap.querySelector('iframe');
|
|
43
|
+
if (!f) return;
|
|
44
|
+
// Snapshot whatever cheap state we can reach before clearing.
|
|
45
|
+
try {
|
|
46
|
+
stateById.set(id, {
|
|
47
|
+
ts: Date.now(),
|
|
48
|
+
src: f.dataset.src,
|
|
49
|
+
scroll: { x: f.contentWindow?.scrollX, y: f.contentWindow?.scrollY },
|
|
50
|
+
});
|
|
51
|
+
} catch {
|
|
52
|
+
stateById.set(id, { ts: Date.now(), src: f.dataset.src });
|
|
53
|
+
}
|
|
54
|
+
f.removeAttribute('src');
|
|
55
|
+
f.src = 'about:blank';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Mount a lazy iframe into `host` with the given `src` + stable `id`.
|
|
60
|
+
* - Initial intersection sets the src.
|
|
61
|
+
* - When the wrapper leaves viewport for > idleMs, the iframe is detached.
|
|
62
|
+
* - State stashed in `stateById` is restored via `data-restore-*` on remount.
|
|
63
|
+
*/
|
|
64
|
+
export function mountLazy(host, src, id, opts = {}) {
|
|
65
|
+
const idleMs = opts.idleMs ?? DEFAULT_IDLE_MS;
|
|
66
|
+
const rootMargin = opts.rootMargin ?? DEFAULT_ROOT_MARGIN;
|
|
67
|
+
|
|
68
|
+
let wrap = host.querySelector('.iframe-lazy-wrap');
|
|
69
|
+
if (!wrap) {
|
|
70
|
+
wrap = makeWrapper();
|
|
71
|
+
wrap.dataset.lazyId = id;
|
|
72
|
+
wrap.dataset.canvasPath = src;
|
|
73
|
+
host.appendChild(wrap);
|
|
74
|
+
}
|
|
75
|
+
// Re-apply restore hints if we have any.
|
|
76
|
+
const prior = stateById.get(id);
|
|
77
|
+
if (prior) {
|
|
78
|
+
wrap.dataset.restoreScrollX = String(prior.scroll?.x ?? 0);
|
|
79
|
+
wrap.dataset.restoreScrollY = String(prior.scroll?.y ?? 0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const exitedAt = new WeakMap();
|
|
83
|
+
|
|
84
|
+
const io = new IntersectionObserver(
|
|
85
|
+
(entries) => {
|
|
86
|
+
for (const entry of entries) {
|
|
87
|
+
const w = entry.target;
|
|
88
|
+
if (entry.isIntersecting) {
|
|
89
|
+
exitedAt.delete(w);
|
|
90
|
+
attachIframe(w, src);
|
|
91
|
+
} else {
|
|
92
|
+
exitedAt.set(w, Date.now());
|
|
93
|
+
// Schedule a deferred detach; if it comes back into view before idleMs we cancel.
|
|
94
|
+
setTimeout(() => {
|
|
95
|
+
const exited = exitedAt.get(w);
|
|
96
|
+
if (!exited) return;
|
|
97
|
+
if (Date.now() - exited >= idleMs) detachIframe(w, id);
|
|
98
|
+
}, idleMs + 100);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{ rootMargin, threshold: 0.01 },
|
|
103
|
+
);
|
|
104
|
+
io.observe(wrap);
|
|
105
|
+
observers.set(wrap, io);
|
|
106
|
+
return wrap;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function unmountLazy(host) {
|
|
110
|
+
const wraps = host.querySelectorAll('.iframe-lazy-wrap');
|
|
111
|
+
for (const wrap of wraps) {
|
|
112
|
+
const io = observers.get(wrap);
|
|
113
|
+
io?.disconnect();
|
|
114
|
+
observers.delete(wrap);
|
|
115
|
+
wrap.remove();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function _resetState() {
|
|
120
|
+
stateById.clear();
|
|
121
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html data-theme="dark">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>Design — local browser</title>
|
|
6
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
7
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
8
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap">
|
|
9
|
+
<link rel="stylesheet" href="/_client/styles.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="root"></div>
|
|
13
|
+
<script type="module" src="/_client/client.bundle.js"></script>
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* @layer reset — minimal base reset. */
|
|
2
|
+
@layer reset {
|
|
3
|
+
* { box-sizing: border-box; }
|
|
4
|
+
|
|
5
|
+
html, body {
|
|
6
|
+
margin: 0; padding: 0; height: 100%;
|
|
7
|
+
background: var(--u-bg-0);
|
|
8
|
+
color: var(--u-fg-0);
|
|
9
|
+
font-family: var(--u-font-sans);
|
|
10
|
+
font-size: 13px;
|
|
11
|
+
line-height: 1.45;
|
|
12
|
+
-webkit-font-smoothing: antialiased;
|
|
13
|
+
-moz-osx-font-smoothing: grayscale;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
button { font: inherit; }
|
|
17
|
+
::selection { background: var(--u-accent-bg); color: var(--u-fg-0); }
|
|
18
|
+
}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/* @layer tokens — project DS bridge for the dev-server shell.
|
|
2
|
+
*
|
|
3
|
+
* Source of truth: .design/system/project/colors_and_type.css (MDCC-DSN/01).
|
|
4
|
+
* The OKLCH ladders below are pasted in so the dev-server bundle stays
|
|
5
|
+
* self-contained (a relative `@import` would have to cross from
|
|
6
|
+
* plugins/design/dev-server/ into the repo's .design/ folder — fragile
|
|
7
|
+
* once installed centrally). If the DS evolves, re-sync this file
|
|
8
|
+
* manually and keep the values verbatim.
|
|
9
|
+
*
|
|
10
|
+
* Two themes — both first-class, both equal:
|
|
11
|
+
* :root + [data-theme="light"] — paper-light (cream + ink)
|
|
12
|
+
* [data-theme="dark"] — phosphor-dark (default for dev-server)
|
|
13
|
+
*
|
|
14
|
+
* Legacy `--u-*` aliases keep existing chrome rules in 3-shell.css and
|
|
15
|
+
* 4-components.css compiling without a mass rename in this single task.
|
|
16
|
+
* Sibling-token roles (per CLAUDE.md "design token discipline" memory)
|
|
17
|
+
* audited at the alias boundary, not blindly renamed.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
@layer tokens {
|
|
21
|
+
|
|
22
|
+
/* ============================================================
|
|
23
|
+
Project DS — paper-light (default for marketplace surfaces,
|
|
24
|
+
also the fallback when no data-theme is set)
|
|
25
|
+
============================================================ */
|
|
26
|
+
:root,
|
|
27
|
+
:root[data-theme="light"] {
|
|
28
|
+
/* Surfaces — paper ladder */
|
|
29
|
+
--bg-0: oklch(97.5% 0.008 78);
|
|
30
|
+
--bg-1: oklch(95.5% 0.010 78);
|
|
31
|
+
--bg-2: oklch(93.0% 0.012 78);
|
|
32
|
+
--bg-3: oklch(89.5% 0.014 78);
|
|
33
|
+
--bg-4: oklch(85.0% 0.016 78);
|
|
34
|
+
|
|
35
|
+
/* Borders — 1px ink hairlines */
|
|
36
|
+
--border-subtle: oklch(86% 0.014 70);
|
|
37
|
+
--border-default: oklch(74% 0.016 65);
|
|
38
|
+
--border-strong: oklch(48% 0.022 60);
|
|
39
|
+
|
|
40
|
+
/* Text — ink ladder */
|
|
41
|
+
--fg-0: oklch(20% 0.020 50);
|
|
42
|
+
--fg-1: oklch(38% 0.018 50);
|
|
43
|
+
--fg-2: oklch(52% 0.015 50);
|
|
44
|
+
--fg-3: oklch(68% 0.012 50);
|
|
45
|
+
|
|
46
|
+
/* Accent — amber-rust catalog stamp */
|
|
47
|
+
--accent: oklch(56% 0.170 50);
|
|
48
|
+
--accent-hover: oklch(50% 0.170 50);
|
|
49
|
+
--accent-active: oklch(44% 0.170 50);
|
|
50
|
+
--accent-fg: oklch(98% 0.008 78);
|
|
51
|
+
--accent-tint: oklch(92% 0.040 55);
|
|
52
|
+
|
|
53
|
+
/* Status — always-on family */
|
|
54
|
+
--status-success: oklch(48% 0.14 145);
|
|
55
|
+
--status-warn: oklch(64% 0.16 88);
|
|
56
|
+
--status-error: oklch(50% 0.20 25);
|
|
57
|
+
--status-info: oklch(50% 0.13 230);
|
|
58
|
+
|
|
59
|
+
/* Mono cell helpers (inline code, DS view, comment chips) */
|
|
60
|
+
--mono-cell-bg: oklch(95% 0.010 78);
|
|
61
|
+
--mono-cell-fg: oklch(28% 0.020 30);
|
|
62
|
+
--mono-rule: oklch(82% 0.014 65);
|
|
63
|
+
|
|
64
|
+
color-scheme: light;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* ============================================================
|
|
68
|
+
Project DS — phosphor-dark (dev-server default canvas)
|
|
69
|
+
============================================================ */
|
|
70
|
+
[data-theme="dark"] {
|
|
71
|
+
--bg-0: oklch(13% 0.012 60);
|
|
72
|
+
--bg-1: oklch(17% 0.014 60);
|
|
73
|
+
--bg-2: oklch(20% 0.016 60);
|
|
74
|
+
--bg-3: oklch(24% 0.018 60);
|
|
75
|
+
--bg-4: oklch(28% 0.020 60);
|
|
76
|
+
|
|
77
|
+
--border-subtle: oklch(28% 0.018 60);
|
|
78
|
+
--border-default: oklch(40% 0.022 60);
|
|
79
|
+
--border-strong: oklch(58% 0.026 60);
|
|
80
|
+
|
|
81
|
+
--fg-0: oklch(94% 0.014 80);
|
|
82
|
+
--fg-1: oklch(78% 0.014 80);
|
|
83
|
+
--fg-2: oklch(60% 0.012 80);
|
|
84
|
+
--fg-3: oklch(44% 0.010 80);
|
|
85
|
+
|
|
86
|
+
--accent: oklch(72% 0.160 55);
|
|
87
|
+
--accent-hover: oklch(78% 0.160 55);
|
|
88
|
+
--accent-active: oklch(84% 0.160 55);
|
|
89
|
+
--accent-fg: oklch(14% 0.020 50);
|
|
90
|
+
--accent-tint: oklch(28% 0.060 55);
|
|
91
|
+
|
|
92
|
+
--status-success: oklch(72% 0.16 145);
|
|
93
|
+
--status-warn: oklch(80% 0.16 88);
|
|
94
|
+
--status-error: oklch(68% 0.20 25);
|
|
95
|
+
--status-info: oklch(72% 0.13 230);
|
|
96
|
+
|
|
97
|
+
--mono-cell-bg: oklch(20% 0.016 60);
|
|
98
|
+
--mono-cell-fg: oklch(88% 0.014 60);
|
|
99
|
+
--mono-rule: oklch(32% 0.020 60);
|
|
100
|
+
|
|
101
|
+
color-scheme: dark;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* ============================================================
|
|
105
|
+
Theme-invariant tokens (shared between paper + phosphor)
|
|
106
|
+
============================================================ */
|
|
107
|
+
:root {
|
|
108
|
+
/* Radii — hard-edges: 0 / 2 / 4 only */
|
|
109
|
+
--radius-xs: 0;
|
|
110
|
+
--radius-sm: 2px;
|
|
111
|
+
--radius-md: 4px;
|
|
112
|
+
--radius-lg: 4px;
|
|
113
|
+
--radius-xl: 4px;
|
|
114
|
+
--radius-pill: 0;
|
|
115
|
+
|
|
116
|
+
/* Spacing — 4 px base */
|
|
117
|
+
--space-0: 0;
|
|
118
|
+
--space-1: 2px;
|
|
119
|
+
--space-2: 4px;
|
|
120
|
+
--space-3: 8px;
|
|
121
|
+
--space-4: 12px;
|
|
122
|
+
--space-5: 16px;
|
|
123
|
+
--space-6: 24px;
|
|
124
|
+
--space-7: 32px;
|
|
125
|
+
--space-8: 48px;
|
|
126
|
+
--space-9: 64px;
|
|
127
|
+
|
|
128
|
+
/* Typography — Berkeley Mono everywhere (fall back through JetBrains Mono → ui-monospace) */
|
|
129
|
+
--font-display: 'Berkeley Mono', 'TX-02', 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
130
|
+
--font-body: 'Berkeley Mono', 'TX-02', 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
131
|
+
--font-mono: 'Berkeley Mono', 'TX-02', 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
132
|
+
|
|
133
|
+
/* 8-step type scale */
|
|
134
|
+
--type-xs: 11px; --lh-xs: 16px;
|
|
135
|
+
--type-sm: 12px; --lh-sm: 18px;
|
|
136
|
+
--type-base: 13px; --lh-base: 20px;
|
|
137
|
+
--type-md: 15px; --lh-md: 24px;
|
|
138
|
+
--type-lg: 18px; --lh-lg: 28px;
|
|
139
|
+
--type-xl: 22px; --lh-xl: 30px;
|
|
140
|
+
--type-2xl: 28px; --lh-2xl: 36px;
|
|
141
|
+
--type-3xl: 40px; --lh-3xl: 48px;
|
|
142
|
+
|
|
143
|
+
/* Tracking */
|
|
144
|
+
--tracking-tight: -0.01em;
|
|
145
|
+
--tracking-normal: 0;
|
|
146
|
+
--tracking-wide: 0.04em;
|
|
147
|
+
--tracking-sku: 0.12em;
|
|
148
|
+
--tracking-eyebrow: 0.18em;
|
|
149
|
+
|
|
150
|
+
/* Motion */
|
|
151
|
+
--dur-flip: 90ms;
|
|
152
|
+
--dur-panel: 140ms;
|
|
153
|
+
--dur-route: 1ms;
|
|
154
|
+
--dur-soft: 180ms;
|
|
155
|
+
--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
|
|
156
|
+
--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
|
|
157
|
+
|
|
158
|
+
/* Hairline rules — signature treatment */
|
|
159
|
+
--rule-thin: 1px solid var(--border-default);
|
|
160
|
+
--rule-strong: 1px solid var(--border-strong);
|
|
161
|
+
--rule-accent: 1px solid var(--accent);
|
|
162
|
+
|
|
163
|
+
/* Shadows — none. Project DS rejects blur; use hairlines instead. */
|
|
164
|
+
--shadow-sm: none;
|
|
165
|
+
--shadow-md: none;
|
|
166
|
+
--shadow-lg: none;
|
|
167
|
+
--shadow-focus: 0 0 0 2px var(--accent);
|
|
168
|
+
|
|
169
|
+
/* ─────────────────────────────────────────────────────────
|
|
170
|
+
Legacy `--u-*` alias bridge (Phase 3.5 alias-layer).
|
|
171
|
+
Pre-existing chrome rules in 3-shell.css and 4-components.css
|
|
172
|
+
consume these names. Each alias points at the project DS
|
|
173
|
+
token whose ROLE (not just numeric value) matches.
|
|
174
|
+
───────────────────────────────────────────────────────── */
|
|
175
|
+
|
|
176
|
+
/* Surfaces — direct ladder mirror */
|
|
177
|
+
--u-bg-0: var(--bg-0);
|
|
178
|
+
--u-bg-1: var(--bg-1);
|
|
179
|
+
--u-bg-2: var(--bg-2);
|
|
180
|
+
--u-bg-3: var(--bg-3);
|
|
181
|
+
--u-bg-4: var(--bg-4);
|
|
182
|
+
|
|
183
|
+
/* State surfaces — project DS uses surface STEPS for state
|
|
184
|
+
(hover = next surface up) instead of alpha-on-color overlays.
|
|
185
|
+
Selected uses the accent wash, which is theme-aware. */
|
|
186
|
+
--u-bg-hover: var(--bg-2);
|
|
187
|
+
--u-bg-active: var(--bg-3);
|
|
188
|
+
--u-bg-selected: var(--accent-tint);
|
|
189
|
+
|
|
190
|
+
/* Text */
|
|
191
|
+
--u-fg-0: var(--fg-0);
|
|
192
|
+
--u-fg-1: var(--fg-1);
|
|
193
|
+
--u-fg-2: var(--fg-2);
|
|
194
|
+
--u-fg-3: var(--fg-3);
|
|
195
|
+
|
|
196
|
+
/* Borders */
|
|
197
|
+
--u-border: var(--border-default);
|
|
198
|
+
--u-border-subtle: var(--border-subtle);
|
|
199
|
+
--u-border-strong: var(--border-strong);
|
|
200
|
+
|
|
201
|
+
/* Accent — sibling roles preserved:
|
|
202
|
+
--u-accent = brand-fill identity (catalog stamp)
|
|
203
|
+
--u-accent-strong = pressed / focus-active stroke
|
|
204
|
+
--u-accent-line = 1px boundary stroke on accent surfaces
|
|
205
|
+
--u-accent-bg = soft accent wash for cells
|
|
206
|
+
--u-accent-fg = text on a saturated accent fill */
|
|
207
|
+
--u-accent: var(--accent);
|
|
208
|
+
--u-accent-bg: var(--accent-tint);
|
|
209
|
+
--u-accent-line: var(--accent-hover);
|
|
210
|
+
--u-accent-strong: var(--accent-active);
|
|
211
|
+
--u-accent-fg: var(--accent-fg);
|
|
212
|
+
|
|
213
|
+
/* Status */
|
|
214
|
+
--u-status-success: var(--status-success);
|
|
215
|
+
--u-status-warn: var(--status-warn);
|
|
216
|
+
--u-status-error: var(--status-error);
|
|
217
|
+
--u-status-info: var(--status-info);
|
|
218
|
+
--u-status-live: var(--status-error);
|
|
219
|
+
|
|
220
|
+
/* Radii — collapse legacy ladder onto 0 / 2 / 4 (chrome chips
|
|
221
|
+
keep --radius-md to remain readable; --u-r-pill no longer
|
|
222
|
+
produces full pills, by design). */
|
|
223
|
+
--u-r-xs: var(--radius-xs);
|
|
224
|
+
--u-r-sm: var(--radius-sm);
|
|
225
|
+
--u-r-md: var(--radius-md);
|
|
226
|
+
--u-r-lg: var(--radius-md);
|
|
227
|
+
--u-r-pill: var(--radius-md);
|
|
228
|
+
|
|
229
|
+
/* Spacing — legacy 5-step → project DS 4 px base */
|
|
230
|
+
--u-s-1: var(--space-2); /* 4 px */
|
|
231
|
+
--u-s-2: var(--space-3); /* 8 px */
|
|
232
|
+
--u-s-3: var(--space-4); /* 12 px */
|
|
233
|
+
--u-s-4: var(--space-5); /* 16 px */
|
|
234
|
+
--u-s-5: var(--space-6); /* 24 px */
|
|
235
|
+
|
|
236
|
+
/* Fonts — sans family collapses; everything is mono now */
|
|
237
|
+
--u-font-display: var(--font-display);
|
|
238
|
+
--u-font-body: var(--font-body);
|
|
239
|
+
--u-font-sans: var(--font-body);
|
|
240
|
+
--u-font-mono: var(--font-mono);
|
|
241
|
+
|
|
242
|
+
/* Mono cell helpers */
|
|
243
|
+
--u-mono-cell-bg: var(--mono-cell-bg);
|
|
244
|
+
--u-mono-cell-fg: var(--mono-cell-fg);
|
|
245
|
+
--u-mono-rule: var(--mono-rule);
|
|
246
|
+
|
|
247
|
+
/* Layout dims — theme-invariant chrome geometry */
|
|
248
|
+
--u-sidebar-w: 320px;
|
|
249
|
+
--u-rsidebar-w: 360px;
|
|
250
|
+
--u-header-h: 44px;
|
|
251
|
+
--u-status-h: 28px;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* When no data-theme attr is set AND the OS prefers dark, mirror the
|
|
255
|
+
dark block onto :root so the dev-server still looks right when the
|
|
256
|
+
<html data-theme> attribute hasn't been written by JS yet. */
|
|
257
|
+
@media (prefers-color-scheme: dark) {
|
|
258
|
+
:root:not([data-theme]) {
|
|
259
|
+
--bg-0: oklch(13% 0.012 60);
|
|
260
|
+
--bg-1: oklch(17% 0.014 60);
|
|
261
|
+
--bg-2: oklch(20% 0.016 60);
|
|
262
|
+
--bg-3: oklch(24% 0.018 60);
|
|
263
|
+
--bg-4: oklch(28% 0.020 60);
|
|
264
|
+
--border-subtle: oklch(28% 0.018 60);
|
|
265
|
+
--border-default: oklch(40% 0.022 60);
|
|
266
|
+
--border-strong: oklch(58% 0.026 60);
|
|
267
|
+
--fg-0: oklch(94% 0.014 80);
|
|
268
|
+
--fg-1: oklch(78% 0.014 80);
|
|
269
|
+
--fg-2: oklch(60% 0.012 80);
|
|
270
|
+
--fg-3: oklch(44% 0.010 80);
|
|
271
|
+
--accent: oklch(72% 0.160 55);
|
|
272
|
+
--accent-hover: oklch(78% 0.160 55);
|
|
273
|
+
--accent-active: oklch(84% 0.160 55);
|
|
274
|
+
--accent-fg: oklch(14% 0.020 50);
|
|
275
|
+
--accent-tint: oklch(28% 0.060 55);
|
|
276
|
+
--status-success: oklch(72% 0.16 145);
|
|
277
|
+
--status-warn: oklch(80% 0.16 88);
|
|
278
|
+
--status-error: oklch(68% 0.20 25);
|
|
279
|
+
--status-info: oklch(72% 0.13 230);
|
|
280
|
+
--mono-cell-bg: oklch(20% 0.016 60);
|
|
281
|
+
--mono-cell-fg: oklch(88% 0.014 60);
|
|
282
|
+
--mono-rule: oklch(32% 0.020 60);
|
|
283
|
+
color-scheme: dark;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* Reduced-motion guard — collapses every transition to ~instant. */
|
|
288
|
+
@media (prefers-reduced-motion: reduce) {
|
|
289
|
+
:root {
|
|
290
|
+
--dur-flip: 1ms;
|
|
291
|
+
--dur-panel: 1ms;
|
|
292
|
+
--dur-route: 1ms;
|
|
293
|
+
--dur-soft: 1ms;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* @layer layout — top-level grid only. */
|
|
2
|
+
@layer layout {
|
|
3
|
+
/* ----- App shell -----
|
|
4
|
+
`minmax(0, 1fr)` on the .main column is load-bearing: without it, a long
|
|
5
|
+
selector string in the statusbar's .sb-sel-text would grow the grid track
|
|
6
|
+
wider than 100vw and trigger horizontal body scroll. `1fr` defaults to
|
|
7
|
+
`minmax(auto, 1fr)`, and `auto` = `min-content`, which for an unbreakable
|
|
8
|
+
selector string is the string's full width. Clamping to `minmax(0, 1fr)`
|
|
9
|
+
lets the column shrink below content min-size and lets the inner overflow
|
|
10
|
+
rules (statusbar text-overflow: ellipsis, menubar overflow: hidden) win. */
|
|
11
|
+
.app {
|
|
12
|
+
display: grid;
|
|
13
|
+
grid-template-columns: var(--u-sidebar-w) minmax(0, 1fr);
|
|
14
|
+
width: 100vw;
|
|
15
|
+
height: 100vh;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
.app.with-rsidebar {
|
|
19
|
+
grid-template-columns: var(--u-sidebar-w) minmax(0, 1fr) var(--u-rsidebar-w);
|
|
20
|
+
}
|
|
21
|
+
/* Project tree closed (View > Project Tree off) — collapse the sidebar
|
|
22
|
+
column entirely so the main viewport gets the full width. We hide instead
|
|
23
|
+
of `display: none` on the .sidebar so its state (search input value, etc.)
|
|
24
|
+
isn't lost on toggle. */
|
|
25
|
+
.app.no-sidebar {
|
|
26
|
+
grid-template-columns: 0 minmax(0, 1fr);
|
|
27
|
+
}
|
|
28
|
+
.app.no-sidebar.with-rsidebar {
|
|
29
|
+
grid-template-columns: 0 minmax(0, 1fr) var(--u-rsidebar-w);
|
|
30
|
+
}
|
|
31
|
+
.app.no-sidebar > .sidebar {
|
|
32
|
+
visibility: hidden;
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
}
|
|
35
|
+
}
|