@1agh/maude 2.0.6 → 2.0.8
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/apps/studio/access/closure.ts +156 -16
- package/apps/studio/access/filters.ts +27 -0
- package/apps/studio/actions/agents.ts +54 -0
- package/apps/studio/actions/ctx.ts +3 -0
- package/apps/studio/actions/defs/sync.ts +13 -0
- package/apps/studio/actions/defs/view.ts +59 -3
- package/apps/studio/actions/keymap.gen.ts +35 -0
- package/apps/studio/actions/menu.ts +2 -0
- package/apps/studio/actions/types.ts +3 -1
- package/apps/studio/actions.manifest.json +136 -1
- package/apps/studio/actions.parity.json +25 -1
- package/apps/studio/annotations/ui/ai-seen.tsx +4 -3
- package/apps/studio/annotations/ui/ride.ts +2 -1
- package/apps/studio/annotations-context-toolbar.tsx +5 -4
- package/apps/studio/annotations-layer.tsx +4 -3
- package/apps/studio/api.ts +383 -128
- package/apps/studio/artboard-activity-overlay.tsx +4 -4
- package/apps/studio/artboard-ai-copies.tsx +4 -4
- package/apps/studio/artboard-freeze.ts +108 -0
- package/apps/studio/artboard-live-gate.tsx +414 -45
- package/apps/studio/artboard-live.ts +526 -31
- package/apps/studio/artboard-placeholder.ts +197 -0
- package/apps/studio/artboard-still-raster.ts +485 -0
- package/apps/studio/artboard-still-warmup.ts +221 -0
- package/apps/studio/artboard-still.ts +1188 -0
- package/apps/studio/artboard-webgl.ts +2 -1
- package/apps/studio/asset-placeholder.tsx +237 -132
- package/apps/studio/asset-upload-bars.tsx +4 -4
- package/apps/studio/bin/_perf-probe-open.mjs +364 -0
- package/apps/studio/bin/_perf-shared.mjs +12 -7
- package/apps/studio/bin/_pw-launch.mjs +26 -1
- package/apps/studio/bin/perf.sh +19 -0
- package/apps/studio/bridge/dgn-protocol.ts +35 -0
- package/apps/studio/canvas-build-sandbox.ts +69 -13
- package/apps/studio/canvas-camera.ts +90 -0
- package/apps/studio/canvas-comment-mount.tsx +9 -9
- package/apps/studio/canvas-lib.tsx +160 -34
- package/apps/studio/canvas-pages-view.tsx +465 -0
- package/apps/studio/canvas-pages.ts +305 -0
- package/apps/studio/canvas-rows.ts +62 -0
- package/apps/studio/canvas-shell.tsx +62 -16
- package/apps/studio/canvas-theme-icons.tsx +41 -0
- package/apps/studio/canvas-theme-pill.tsx +15 -6
- package/apps/studio/canvas-theme.ts +12 -11
- package/apps/studio/client/app.jsx +7 -0
- package/apps/studio/client/canvas-url.js +23 -1
- package/apps/studio/client/hooks/canvas-origin-probe.js +34 -0
- package/apps/studio/client/hooks/use-action-keys.jsx +3 -1
- package/apps/studio/client/hooks/use-canvas-bridge.jsx +1 -1
- package/apps/studio/client/hooks/use-palette-and-panels.jsx +23 -6
- package/apps/studio/client/hooks/use-photo-and-timeline.jsx +16 -8
- package/apps/studio/client/hooks/use-project-data.jsx +11 -2
- package/apps/studio/client/hooks/use-shell-core.jsx +19 -9
- package/apps/studio/client/index-loader.ts +41 -21
- package/apps/studio/client/inspector/inspector-panel.jsx +35 -14
- package/apps/studio/client/shell/viewport.jsx +32 -16
- package/apps/studio/client/tree/tree.jsx +17 -0
- package/apps/studio/client/v2/canvases/canvases-panel.jsx +24 -0
- package/apps/studio/client/v2/canvases/use-canvas-index.js +24 -1
- package/apps/studio/client/v2/code/canvas-error-card.jsx +14 -2
- package/apps/studio/client/v2/code/canvas-imports-card.jsx +7 -3
- package/apps/studio/client/v2/code/canvas-imports-words.js +16 -0
- package/apps/studio/client/v2/code/canvas-waiting-card.jsx +59 -5
- package/apps/studio/client/v2/code/canvas-waiting.js +18 -1
- package/apps/studio/client/v2/code/code-consent-sheet.jsx +87 -0
- package/apps/studio/client/v2/code/code-consent.js +67 -0
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +62 -10
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +314 -5
- package/apps/studio/client/v2/layers/artboard-layers.jsx +24 -5
- package/apps/studio/client/v2/layers/layers-request.js +49 -0
- package/apps/studio/client/v2/left-panel/canvases-pinned.jsx +93 -3
- package/apps/studio/client/v2/left-panel/ds-boards.js +39 -0
- package/apps/studio/client/v2/left-panel/left-panel-model.js +13 -0
- package/apps/studio/client/v2/left-panel/left-panel.css +24 -0
- package/apps/studio/client/v2/shell/canvas-crash-guard.js +40 -5
- package/apps/studio/client/v2/shell/canvas-mode.js +17 -1
- package/apps/studio/client/v2/shell/floating-panels.css +37 -1
- package/apps/studio/client/v2/shell/mode-switch.jsx +14 -3
- package/apps/studio/client/v2/shell/opening-skeleton.js +118 -0
- package/apps/studio/client/v2/shell/opening-skeleton.jsx +103 -0
- package/apps/studio/client/v2/shell/pages-pick.js +49 -0
- package/apps/studio/client/v2/shell/project-menu-model.js +3 -0
- package/apps/studio/client/v2/shell/share-cluster-host.jsx +3 -1
- package/apps/studio/client/v2/shell/shell-parity.json +8 -0
- package/apps/studio/client/v2/shell/use-canvas-mode-lane.js +30 -0
- package/apps/studio/comments-overlay.tsx +12 -11
- package/apps/studio/config-reload-wire.ts +4 -1
- package/apps/studio/config.schema.json +6 -0
- package/apps/studio/context.ts +37 -1
- package/apps/studio/dist/client.bundle.js +720 -720
- package/apps/studio/dist/comment-mount.js +2 -2
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/ds/board/board.css +6 -0
- package/apps/studio/ds/board/ds-bar.tsx +21 -3
- package/apps/studio/ds/board/specimen.tsx +6 -3
- package/apps/studio/ds/board/template.ts +39 -19
- package/apps/studio/ds/cli.ts +7 -1
- package/apps/studio/ds/component-list.ts +2 -1
- package/apps/studio/ds/default.ts +6 -1
- package/apps/studio/ds/ds-resolver.ts +58 -8
- package/apps/studio/ds/engine.ts +3 -1
- package/apps/studio/ds/folder-systems.ts +199 -0
- package/apps/studio/ds/pairing-css.ts +2 -1
- package/apps/studio/ds/rename.ts +10 -3
- package/apps/studio/ds/shell-fallbacks.ts +2 -1
- package/apps/studio/ds/upgrade-stage.ts +6 -2
- package/apps/studio/editing/ai-point-ring.tsx +4 -4
- package/apps/studio/editing/ai-scope-outline.tsx +4 -4
- package/apps/studio/editing/align-bar.tsx +4 -4
- package/apps/studio/editing/anchor-report.ts +3 -2
- package/apps/studio/editing/artboard-handles.tsx +4 -4
- package/apps/studio/editing/corner-dots.tsx +4 -4
- package/apps/studio/editing/crop-mode.tsx +4 -4
- package/apps/studio/editing/drop-chip.tsx +4 -4
- package/apps/studio/editing/empty-report.ts +3 -2
- package/apps/studio/editing/focus-model.tsx +4 -4
- package/apps/studio/editing/gap-bands.tsx +3 -3
- package/apps/studio/editing/hold-rings.tsx +4 -4
- package/apps/studio/editing/lock-badge.tsx +3 -3
- package/apps/studio/editing/long-page.ts +23 -1
- package/apps/studio/editing/nudge.tsx +2 -2
- package/apps/studio/editing/page-activity.ts +4 -3
- package/apps/studio/editing/paste-bar.tsx +4 -4
- package/apps/studio/editing/pen/overlay.tsx +4 -3
- package/apps/studio/editing/place-freely.tsx +3 -3
- package/apps/studio/editing/reorder-slot.tsx +3 -3
- package/apps/studio/editing/selection.tsx +4 -4
- package/apps/studio/editing/size-ghost.tsx +4 -4
- package/apps/studio/editing/tab-order.tsx +4 -4
- package/apps/studio/editing/text-in-place.tsx +4 -4
- package/apps/studio/editing/undo-preview.tsx +3 -3
- package/apps/studio/equal-spacing-handles.tsx +3 -3
- package/apps/studio/frame-clock.ts +89 -0
- package/apps/studio/http.ts +66 -32
- package/apps/studio/index/ds-usage.ts +4 -1
- package/apps/studio/index-cache.ts +272 -0
- package/apps/studio/inspect-overlay.tsx +4 -3
- package/apps/studio/inspect.ts +7 -2
- package/apps/studio/link-chip-overlay.tsx +4 -3
- package/apps/studio/measure-overlay.tsx +4 -3
- package/apps/studio/present/pointer-dot.tsx +3 -2
- package/apps/studio/present/present-media.ts +6 -2
- package/apps/studio/present/present-stage.tsx +3 -2
- package/apps/studio/preview/preview-camera.tsx +3 -2
- package/apps/studio/routes/sync.ts +176 -0
- package/apps/studio/safe-zones-overlay.tsx +3 -2
- package/apps/studio/skip-dirs.ts +103 -47
- package/apps/studio/studio-page-host.ts +70 -0
- package/apps/studio/sync/code-module-consent.ts +86 -0
- package/apps/studio/sync/file-ledger.ts +24 -0
- package/apps/studio/sync/file-plane.ts +458 -53
- package/apps/studio/sync/held-deletes.ts +230 -0
- package/apps/studio/sync/hubs-config.ts +59 -2
- package/apps/studio/sync/index.ts +99 -15
- package/apps/studio/sync/seed-progress.ts +92 -2
- package/apps/studio/sync/settings.ts +36 -1
- package/apps/studio/sync/status.ts +15 -1
- package/apps/studio/sync/writer-registry.ts +5 -0
- package/apps/studio/text-caret.ts +5 -3
- package/apps/studio/toolbars/toolbar-rect.ts +3 -2
- package/apps/studio/use-annotation-resize.tsx +4 -3
- package/apps/studio/use-artboard-drag.tsx +3 -2
- package/apps/studio/use-element-resize.tsx +7 -6
- package/apps/studio/use-grid-track-handles.tsx +5 -4
- package/apps/studio/use-selection-set.tsx +64 -4
- package/apps/studio/use-spacing-handles.tsx +7 -6
- package/apps/studio/video-comp.tsx +55 -42
- package/apps/studio/video-play-overlay.tsx +4 -3
- package/apps/studio/whats-new.json +27 -0
- package/cli/commands/design.mjs +5 -2
- package/cli/commands/hub.mjs +10 -1
- package/cli/lib/bash-guard.mjs +14 -0
- package/cli/lib/design-help.gen.mjs +1 -1
- package/cli/lib/design-link.mjs +42 -17
- package/cli/lib/hub-purge.mjs +183 -0
- package/package.json +8 -8
- package/plugins/design/templates/_shell.html +164 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// client/v2/shell/opening-skeleton.jsx — 2.0.7 (B1): the artboards of a canvas that is opening, drawn at once
|
|
2
|
+
// at their final place and size (opening-skeleton.js holds the rules). The studio draws them over the frame and
|
|
3
|
+
// drops them when the canvas reports `canvas-rendered`; the frame itself never draws a skeleton, so captures and
|
|
4
|
+
// exports cannot show one. Until the layout is known — or when it cannot be known before the canvas runs — the
|
|
5
|
+
// caller's card shows instead.
|
|
6
|
+
|
|
7
|
+
import { useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
8
|
+
import { SkeletonArtboard } from '../empty/skeleton.jsx';
|
|
9
|
+
import { useIndexSnapshotNow } from '../canvases/use-canvas-index.js';
|
|
10
|
+
import { insetsNow } from './insets-now.js';
|
|
11
|
+
import { indexRowOf, screenBoards, skeletonBoards, skeletonCamera } from './opening-skeleton.js';
|
|
12
|
+
|
|
13
|
+
/** The canvas's meta (layout + the person's viewport), as the frame reads it. undefined while asked, null: none. */
|
|
14
|
+
function useCanvasMeta(path, fetchImpl) {
|
|
15
|
+
const [meta, setMeta] = useState(undefined);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
let alive = true;
|
|
18
|
+
setMeta(undefined);
|
|
19
|
+
const f = fetchImpl || ((...a) => fetch(...a));
|
|
20
|
+
Promise.resolve()
|
|
21
|
+
.then(() =>
|
|
22
|
+
f(`/_api/canvas-meta?file=${encodeURIComponent(path)}`, {
|
|
23
|
+
headers: { 'Cache-Control': 'no-store' },
|
|
24
|
+
})
|
|
25
|
+
)
|
|
26
|
+
.then((r) => (r?.ok ? r.json() : null))
|
|
27
|
+
.then((j) => alive && setMeta(j && typeof j === 'object' ? j : null))
|
|
28
|
+
.catch(() => alive && setMeta(null));
|
|
29
|
+
return () => {
|
|
30
|
+
alive = false;
|
|
31
|
+
};
|
|
32
|
+
}, [path, fetchImpl]);
|
|
33
|
+
return meta;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function useBoxSize(ref) {
|
|
37
|
+
const [size, setSize] = useState({ w: 0, h: 0 });
|
|
38
|
+
useLayoutEffect(() => {
|
|
39
|
+
const el = ref.current;
|
|
40
|
+
if (!el) return undefined;
|
|
41
|
+
const measure = () => setSize({ w: el.clientWidth, h: el.clientHeight });
|
|
42
|
+
measure();
|
|
43
|
+
if (typeof ResizeObserver !== 'function') return undefined;
|
|
44
|
+
const ro = new ResizeObserver(measure);
|
|
45
|
+
ro.observe(el);
|
|
46
|
+
return () => ro.disconnect();
|
|
47
|
+
}, [ref]);
|
|
48
|
+
return size;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @param {{ path: string, fallback: import('react').ReactNode, note?: string | null, fetchImpl?: typeof fetch }} props
|
|
53
|
+
* path the opening canvas (repo-relative, e.g. `<designRoot>/ui/Home.tsx`)
|
|
54
|
+
* fallback what shows while the layout is not known (the "Opening …" card)
|
|
55
|
+
* note a line over the skeletons once opening is slow (the card's own hint)
|
|
56
|
+
*/
|
|
57
|
+
export function OpeningSkeleton({ path, fallback, note = null, fetchImpl }) {
|
|
58
|
+
const ref = useRef(null);
|
|
59
|
+
const snapshot = useIndexSnapshotNow();
|
|
60
|
+
const meta = useCanvasMeta(path, fetchImpl);
|
|
61
|
+
const insets = useSyncExternalStore(insetsNow.subscribe, insetsNow.get, insetsNow.get);
|
|
62
|
+
const size = useBoxSize(ref);
|
|
63
|
+
const boards =
|
|
64
|
+
meta === undefined ? null : skeletonBoards({ row: indexRowOf(snapshot, path), meta });
|
|
65
|
+
const cam =
|
|
66
|
+
boards && size.w && size.h
|
|
67
|
+
? skeletonCamera({
|
|
68
|
+
boards,
|
|
69
|
+
width: size.w,
|
|
70
|
+
height: size.h,
|
|
71
|
+
insets,
|
|
72
|
+
viewport: meta?.viewport,
|
|
73
|
+
})
|
|
74
|
+
: null;
|
|
75
|
+
const shown = cam ? screenBoards(boards, cam, size.w, size.h) : null;
|
|
76
|
+
return (
|
|
77
|
+
<div
|
|
78
|
+
ref={ref}
|
|
79
|
+
className="sh-opening-skel"
|
|
80
|
+
data-testid="canvas-skeleton"
|
|
81
|
+
data-ready={shown ? 'true' : 'false'}
|
|
82
|
+
>
|
|
83
|
+
{shown && note ? (
|
|
84
|
+
<p className="sh-opening-note" data-testid="canvas-skeleton-note">
|
|
85
|
+
{note}
|
|
86
|
+
</p>
|
|
87
|
+
) : null}
|
|
88
|
+
{shown
|
|
89
|
+
? shown.map((b) => (
|
|
90
|
+
<SkeletonArtboard
|
|
91
|
+
key={b.id}
|
|
92
|
+
label={b.named ? b.label : ''}
|
|
93
|
+
kind={b.kind}
|
|
94
|
+
x={b.left}
|
|
95
|
+
y={b.top}
|
|
96
|
+
w={b.sw}
|
|
97
|
+
h={b.sh}
|
|
98
|
+
/>
|
|
99
|
+
))
|
|
100
|
+
: fallback}
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// client/v2/shell/pages-pick.js — 2.0.7 B2: the shell remembers the canvas's Canvas | Pages and Light | Dark picks.
|
|
2
|
+
//
|
|
3
|
+
// The canvas owns the view (canvas-pages.ts) but writes nothing: the canvas origin may PATCH only `layout` and
|
|
4
|
+
// `viewport` of `/_api/canvas-meta` (routes/canvas-origin.ts), and Pages adds no lane there. When a person switches,
|
|
5
|
+
// the active canvas says `pages-pick` and the shell — on the main origin, for the canvas IT has open — writes
|
|
6
|
+
// `canvasView` into the view file (`_canvas-state/<slug>.view.json`, per Mac, DDR-115), never the versioned meta.
|
|
7
|
+
|
|
8
|
+
import { normalizeOpenPath } from '../../share-link.js';
|
|
9
|
+
|
|
10
|
+
/** The `/_api/canvas-meta` body `{ file, patch: { [key]: value } }` for the open canvas, or null when there is none. */
|
|
11
|
+
function pickBody(activePath, designRel, key, value) {
|
|
12
|
+
const root = typeof designRel === 'string' && designRel ? designRel : '.design';
|
|
13
|
+
const rel = normalizeOpenPath(activePath, root);
|
|
14
|
+
if (!rel || !/\.(tsx|jsx)$/.test(rel)) return null;
|
|
15
|
+
return {
|
|
16
|
+
file: `${root.replace(/^\.\//, '').replace(/\/$/, '')}/${rel}`,
|
|
17
|
+
patch: { [key]: value },
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Canvas | Pages: `{ canvasView }`, or null. */
|
|
22
|
+
export function pagesPickBody(activePath, designRel, view) {
|
|
23
|
+
if (view !== 'canvas' && view !== 'pages') return null;
|
|
24
|
+
return pickBody(activePath, designRel, 'canvasView', view);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Light | Dark (canvas-theme.ts): `{ canvasTheme }`, or null. */
|
|
28
|
+
export function themePickBody(activePath, designRel, theme) {
|
|
29
|
+
if (theme !== 'light' && theme !== 'dark') return null;
|
|
30
|
+
return pickBody(activePath, designRel, 'canvasTheme', theme);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Write a pick (best-effort, like the camera: a refused write leaves the view as it is for this session). */
|
|
34
|
+
function save(body, doFetch) {
|
|
35
|
+
if (!body || typeof doFetch !== 'function') return null;
|
|
36
|
+
return Promise.resolve(
|
|
37
|
+
doFetch('/_api/canvas-meta', {
|
|
38
|
+
method: 'PATCH',
|
|
39
|
+
headers: { 'content-type': 'application/json' },
|
|
40
|
+
body: JSON.stringify(body),
|
|
41
|
+
})
|
|
42
|
+
).catch(() => null);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const savePagesPick = (activePath, designRel, view, doFetch = globalThis.fetch) =>
|
|
46
|
+
save(pagesPickBody(activePath, designRel, view), doFetch);
|
|
47
|
+
|
|
48
|
+
export const saveThemePick = (activePath, designRel, theme, doFetch = globalThis.fetch) =>
|
|
49
|
+
save(themePickBody(activePath, designRel, theme), doFetch);
|
|
@@ -193,8 +193,11 @@ export function menuCtx({
|
|
|
193
193
|
online = true,
|
|
194
194
|
// p8-v1-drop — a design system here is below Conformant (client/v2/ds/upgrade-offers.js)
|
|
195
195
|
dsUpgradeOffered = false,
|
|
196
|
+
// 2.0.7 B2 — the active canvas shows Pages: Preview and Present grey out, Next / Previous page come on
|
|
197
|
+
pagesView = false,
|
|
196
198
|
} = {}) {
|
|
197
199
|
const facts = new Set();
|
|
200
|
+
if (pagesView) facts.add('pagesView');
|
|
198
201
|
if (dsUpgradeOffered) facts.add('dsUpgradeOffered');
|
|
199
202
|
if (native) facts.add('native');
|
|
200
203
|
// S3.7b — a desktop project linked to a cloud hub (Copy presentation link is enabled there).
|
|
@@ -258,8 +258,9 @@ export function ShellShareCluster() {
|
|
|
258
258
|
readOnly: !!viewerMode,
|
|
259
259
|
observer: role === 'observer',
|
|
260
260
|
canvasOpen,
|
|
261
|
+
pagesView: lane.pages,
|
|
261
262
|
}),
|
|
262
|
-
[viewerMode, canvasOpen, role]
|
|
263
|
+
[viewerMode, canvasOpen, role, lane.pages]
|
|
263
264
|
);
|
|
264
265
|
|
|
265
266
|
// S3.2a — the first Present row names the artboard a click would start from: the labels come from the
|
|
@@ -497,6 +498,7 @@ export function ShellShareCluster() {
|
|
|
497
498
|
presenterView={presenterView}
|
|
498
499
|
onPresenterView={() => menuRunner.run('present.presenter-view')}
|
|
499
500
|
canPresent={canvasOpen}
|
|
501
|
+
pages={lane.pages}
|
|
500
502
|
/>
|
|
501
503
|
}
|
|
502
504
|
/>
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"view.inspector-on-select",
|
|
96
96
|
"view.layers-panel",
|
|
97
97
|
"view.minimap",
|
|
98
|
+
"view.pages",
|
|
98
99
|
"view.panels",
|
|
99
100
|
"view.pin-panels",
|
|
100
101
|
"view.print-guides",
|
|
@@ -145,6 +146,7 @@
|
|
|
145
146
|
"view.assets": ["view"],
|
|
146
147
|
"view.exports": ["view"],
|
|
147
148
|
"view.annotations": ["view"],
|
|
149
|
+
"view.pages": ["view"],
|
|
148
150
|
"mode.preview": ["view"],
|
|
149
151
|
"present.from-selection": ["view"],
|
|
150
152
|
"present.from-start": ["view"],
|
|
@@ -280,6 +282,7 @@
|
|
|
280
282
|
"view.assets",
|
|
281
283
|
"view.exports",
|
|
282
284
|
"view.annotations",
|
|
285
|
+
"view.pages",
|
|
283
286
|
"mode.preview",
|
|
284
287
|
"present.from-selection",
|
|
285
288
|
"present.from-start",
|
|
@@ -663,6 +666,7 @@
|
|
|
663
666
|
"view.assets",
|
|
664
667
|
"view.exports",
|
|
665
668
|
"view.annotations",
|
|
669
|
+
"view.pages",
|
|
666
670
|
"mode.preview",
|
|
667
671
|
"present.from-selection",
|
|
668
672
|
"present.from-start",
|
|
@@ -1049,6 +1053,7 @@
|
|
|
1049
1053
|
"view.assets",
|
|
1050
1054
|
"view.exports",
|
|
1051
1055
|
"view.annotations",
|
|
1056
|
+
"view.pages",
|
|
1052
1057
|
"mode.preview",
|
|
1053
1058
|
"present.from-selection",
|
|
1054
1059
|
"present.from-start",
|
|
@@ -1317,6 +1322,7 @@
|
|
|
1317
1322
|
"view.assets",
|
|
1318
1323
|
"view.exports",
|
|
1319
1324
|
"view.annotations",
|
|
1325
|
+
"view.pages",
|
|
1320
1326
|
"mode.preview",
|
|
1321
1327
|
"present.from-selection",
|
|
1322
1328
|
"present.from-start",
|
|
@@ -1570,6 +1576,7 @@
|
|
|
1570
1576
|
"view.assets",
|
|
1571
1577
|
"view.exports",
|
|
1572
1578
|
"view.annotations",
|
|
1579
|
+
"view.pages",
|
|
1573
1580
|
"mode.preview",
|
|
1574
1581
|
"present.from-selection",
|
|
1575
1582
|
"present.from-start",
|
|
@@ -1828,6 +1835,7 @@
|
|
|
1828
1835
|
"view.assets",
|
|
1829
1836
|
"view.exports",
|
|
1830
1837
|
"view.annotations",
|
|
1838
|
+
"view.pages",
|
|
1831
1839
|
"mode.preview",
|
|
1832
1840
|
"present.from-selection",
|
|
1833
1841
|
"present.from-start",
|
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
shellEscDecision,
|
|
41
41
|
} from './canvas-mode.js';
|
|
42
42
|
import { SEED_LADDER_MS } from './occlusion-insets.js';
|
|
43
|
+
import { savePagesPick, saveThemePick } from './pages-pick.js';
|
|
43
44
|
import { appOnlyFor, ROLE_DENIAL, showRoleDenial } from './role-denial.js';
|
|
44
45
|
import { insetsLane } from './use-occluded-insets.js';
|
|
45
46
|
import { panelLayout, usePanelLayout } from './use-panel-layout.js';
|
|
@@ -124,6 +125,21 @@ export function usePresentMode() {
|
|
|
124
125
|
return [presentMode, useCallback(setPresenting, [])];
|
|
125
126
|
}
|
|
126
127
|
|
|
128
|
+
const pagesNow = () => shellMode.get().pages === true;
|
|
129
|
+
|
|
130
|
+
/** 2.0.7 B2 — does the active canvas show Pages? (Preview and Present are off meanwhile.) */
|
|
131
|
+
export function usePagesView() {
|
|
132
|
+
return useSyncExternalStore(shellMode.subscribe, pagesNow, pagesNow);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const pagesAtNow = () =>
|
|
136
|
+
shellMode.get().pages === true ? (shellMode.get().pagesAt ?? null) : null;
|
|
137
|
+
|
|
138
|
+
/** 2.0.7 polish — the artboard on the active canvas's page while it shows Pages, else null. */
|
|
139
|
+
export function usePagesArtboard() {
|
|
140
|
+
return useSyncExternalStore(shellMode.subscribe, pagesAtNow, pagesAtNow);
|
|
141
|
+
}
|
|
142
|
+
|
|
127
143
|
// S3.2b — the shell's own controls (and the keys the shell hears) step the presenting canvas through the
|
|
128
144
|
// lane the mounted hook owns; there is one lane per window, so one registered stepper.
|
|
129
145
|
let presentStepper = null;
|
|
@@ -268,6 +284,8 @@ export function useCanvasModeLane({ activePath, iframesRef, cfg, canEdit, role }
|
|
|
268
284
|
// biome-ignore lint/correctness/useExhaustiveDependencies: activePath is the trigger
|
|
269
285
|
useEffect(() => {
|
|
270
286
|
setPeers([]);
|
|
287
|
+
// 2.0.7 B2 — Pages is the canvas's own: a newly active canvas says again (it answers the seed below)
|
|
288
|
+
shellMode.pages(false);
|
|
271
289
|
const win = activeWin();
|
|
272
290
|
if (win) lane.seed(win, seedOf());
|
|
273
291
|
}, [activePath, lane]);
|
|
@@ -300,6 +318,16 @@ export function useCanvasModeLane({ activePath, iframesRef, cfg, canEdit, role }
|
|
|
300
318
|
if (!m) return;
|
|
301
319
|
if (m.dgn === 'peers') {
|
|
302
320
|
setPeers(m.peers);
|
|
321
|
+
} else if (m.dgn === 'pages-view') {
|
|
322
|
+
// 2.0.7 B2 — the active canvas shows Pages (or stopped): Preview and Present follow (canvas-mode.js);
|
|
323
|
+
// 2.0.7 polish — with the artboard on the page, which the left panel marks
|
|
324
|
+
shellMode.pages(m.on, m.id);
|
|
325
|
+
} else if (m.dgn === 'pages-pick') {
|
|
326
|
+
// 2.0.7 B2 — the person switched Canvas | Pages: remember it for the canvas the shell has open
|
|
327
|
+
void savePagesPick(L.activePath, L.cfg?.designRel, m.view);
|
|
328
|
+
} else if (m.dgn === 'theme-pick') {
|
|
329
|
+
// the Light | Dark pick, the same way (the canvas origin has no lane for it)
|
|
330
|
+
void saveThemePick(L.activePath, L.cfg?.designRel, m.theme);
|
|
303
331
|
} else if (m.dgn === 'present-position') {
|
|
304
332
|
// Present · Artboards moved on (S3.2a's stage echoes every step); the canvas's own hold
|
|
305
333
|
// (_shell.html) lands its held write on the same move. Active canvas only (the table's gate).
|
|
@@ -354,6 +382,8 @@ export function useCanvasModeLane({ activePath, iframesRef, cfg, canEdit, role }
|
|
|
354
382
|
return {
|
|
355
383
|
mode,
|
|
356
384
|
caps,
|
|
385
|
+
/** 2.0.7 B2 — the active canvas shows Pages: the switch greys Preview and Present with the reason. */
|
|
386
|
+
pages: snap.pages === true,
|
|
357
387
|
/** The Present spec while presenting (Artboards · Canvas), else null. */
|
|
358
388
|
presentSpec: snap.present,
|
|
359
389
|
peers,
|
|
@@ -73,6 +73,7 @@ import { mineIdsOf, restampMine, viewerFor } from './comments/mine-stamp.ts';
|
|
|
73
73
|
import { committerRows, type MentionRow } from './comments/people.ts';
|
|
74
74
|
import { mmAtArtboardPx, trimOfPrint, videoPinVisible, whereOf } from './comments/where.ts';
|
|
75
75
|
import { resolveByDomPath } from './dom-selection.ts';
|
|
76
|
+
import { frameCaf, frameRaf } from './frame-clock.ts';
|
|
76
77
|
import { toneColor } from './presence/tones.ts';
|
|
77
78
|
import {
|
|
78
79
|
COMMENTS_PAUSED_REASON,
|
|
@@ -1195,7 +1196,7 @@ function MentionAwareTextarea({
|
|
|
1195
1196
|
setToken(null);
|
|
1196
1197
|
// Restore caret just past the inserted token + trailing space.
|
|
1197
1198
|
const newCaret = token.start + tag.length + 1;
|
|
1198
|
-
|
|
1199
|
+
frameRaf(() => {
|
|
1199
1200
|
ta.focus();
|
|
1200
1201
|
ta.setSelectionRange(newCaret, newCaret);
|
|
1201
1202
|
});
|
|
@@ -1384,7 +1385,7 @@ function CommentPin({
|
|
|
1384
1385
|
}
|
|
1385
1386
|
if (!pos) {
|
|
1386
1387
|
pin.style.display = 'none';
|
|
1387
|
-
rafRef.current =
|
|
1388
|
+
rafRef.current = frameRaf(tick);
|
|
1388
1389
|
return;
|
|
1389
1390
|
}
|
|
1390
1391
|
pin.style.display = 'grid';
|
|
@@ -1394,11 +1395,11 @@ function CommentPin({
|
|
|
1394
1395
|
const top = Math.round(pos.y - 14);
|
|
1395
1396
|
pin.style.left = `${left}px`;
|
|
1396
1397
|
pin.style.top = `${top}px`;
|
|
1397
|
-
rafRef.current =
|
|
1398
|
+
rafRef.current = frameRaf(tick);
|
|
1398
1399
|
};
|
|
1399
|
-
rafRef.current =
|
|
1400
|
+
rafRef.current = frameRaf(tick);
|
|
1400
1401
|
return () => {
|
|
1401
|
-
if (rafRef.current != null)
|
|
1402
|
+
if (rafRef.current != null) frameCaf(rafRef.current);
|
|
1402
1403
|
};
|
|
1403
1404
|
}, [comment]);
|
|
1404
1405
|
|
|
@@ -1482,11 +1483,11 @@ export function CommentComposer({
|
|
|
1482
1483
|
const placed = placeNearPoint(anchor, { w: node.offsetWidth, h: node.offsetHeight });
|
|
1483
1484
|
node.style.left = `${Math.round(placed.x)}px`;
|
|
1484
1485
|
node.style.top = `${Math.round(placed.y)}px`;
|
|
1485
|
-
rafRef.current =
|
|
1486
|
+
rafRef.current = frameRaf(tick);
|
|
1486
1487
|
};
|
|
1487
|
-
rafRef.current =
|
|
1488
|
+
rafRef.current = frameRaf(tick);
|
|
1488
1489
|
return () => {
|
|
1489
|
-
if (rafRef.current != null)
|
|
1490
|
+
if (rafRef.current != null) frameCaf(rafRef.current);
|
|
1490
1491
|
};
|
|
1491
1492
|
}, [state]);
|
|
1492
1493
|
|
|
@@ -1727,11 +1728,11 @@ export function CommentThread({
|
|
|
1727
1728
|
const placed = placeNearPoint(anchor, { w: node.offsetWidth, h: node.offsetHeight });
|
|
1728
1729
|
node.style.left = `${Math.round(placed.x)}px`;
|
|
1729
1730
|
node.style.top = `${Math.round(placed.y)}px`;
|
|
1730
|
-
rafRef.current =
|
|
1731
|
+
rafRef.current = frameRaf(tick);
|
|
1731
1732
|
};
|
|
1732
|
-
rafRef.current =
|
|
1733
|
+
rafRef.current = frameRaf(tick);
|
|
1733
1734
|
return () => {
|
|
1734
|
-
if (rafRef.current != null)
|
|
1735
|
+
if (rafRef.current != null) frameCaf(rafRef.current);
|
|
1735
1736
|
};
|
|
1736
1737
|
}, [comment]);
|
|
1737
1738
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
// event plus a heal event) for the same write reloads once.
|
|
14
14
|
|
|
15
15
|
import { type Context, reloadConfig } from './context.ts';
|
|
16
|
+
import { isFolderSystemFile } from './ds/folder-systems.ts';
|
|
16
17
|
|
|
17
18
|
export const CONFIG_RELOAD_DEBOUNCE_MS = 150;
|
|
18
19
|
|
|
@@ -32,7 +33,9 @@ export function wireConfigReload(
|
|
|
32
33
|
const debounceMs = opts.debounceMs ?? CONFIG_RELOAD_DEBOUNCE_MS;
|
|
33
34
|
let timer: ReturnType<typeof setTimeout> | null = null;
|
|
34
35
|
const onEvent = (rel: unknown) => {
|
|
35
|
-
|
|
36
|
+
// 2.0.7 — a system folder's Design system canvas (or its tokens) arriving, going or changing
|
|
37
|
+
// adds, drops or rethemes a folder-owned system in the merged list (ds/folder-systems.ts)
|
|
38
|
+
if (!isConfigJson(rel) && !isFolderSystemFile(rel)) return;
|
|
36
39
|
if (timer) clearTimeout(timer);
|
|
37
40
|
timer = setTimeout(() => {
|
|
38
41
|
timer = null;
|
|
@@ -276,6 +276,12 @@
|
|
|
276
276
|
"default": true,
|
|
277
277
|
"description": "Sync v2 — the journal-driven file plane (Plane B): the downward project-file pull AND the widened upward sweep. Default ON; set false to fall back to the pre-Sync-v2 reach (binary media under assets/ only). Settable from the Sync panel's Settings section."
|
|
278
278
|
},
|
|
279
|
+
"ignoreFolders": {
|
|
280
|
+
"type": "array",
|
|
281
|
+
"items": { "type": "string", "minLength": 1, "maxLength": 1024 },
|
|
282
|
+
"uniqueItems": true,
|
|
283
|
+
"description": "Issue #207 — design-root-relative folders this project does not sync (Sync details › Don't sync this folder). Nothing under them moves in either direction and what the workspace already holds stays there; the file plane reports their files as ignored, never as waiting. Absolute and '..' entries are dropped. Read at the start of every file-plane pass."
|
|
284
|
+
},
|
|
279
285
|
"propagateDeletes": {
|
|
280
286
|
"type": "boolean",
|
|
281
287
|
"default": true,
|
package/apps/studio/context.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { existsSync, readFileSync } from 'node:fs';
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
|
|
9
|
+
import { folderOwnedSystems } from './ds/folder-systems.ts';
|
|
9
10
|
import { linkConsent } from './sync/link-consent.ts';
|
|
10
11
|
|
|
11
12
|
export type ConfigSource = '.design/config.json' | 'defaults' | 'defaults (config invalid)';
|
|
@@ -27,6 +28,8 @@ export interface DesignSystemEntry {
|
|
|
27
28
|
newComponentDir?: string;
|
|
28
29
|
/** V2-1.13 §5.4 — conforms to design-system schema v1 (written only when ds-check exits 0). */
|
|
29
30
|
schema?: 1;
|
|
31
|
+
/** 2.0.7 — not in config.json: `system/<name>/` holds its own Design system canvas (ds/folder-systems.ts). */
|
|
32
|
+
folderOwned?: true;
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
export interface LinkedHub {
|
|
@@ -66,6 +69,12 @@ export interface LinkedHub {
|
|
|
66
69
|
* asset lanes run regardless.
|
|
67
70
|
*/
|
|
68
71
|
syncFiles?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Issue #207 — design-root-relative folders this project does not sync (Sync details › Don't
|
|
74
|
+
* sync this folder). Nothing under them moves in either direction; what the workspace already
|
|
75
|
+
* holds stays there. Absent = sync every folder.
|
|
76
|
+
*/
|
|
77
|
+
ignoreFolders?: string[];
|
|
69
78
|
/**
|
|
70
79
|
* Sync v2 Increment 6 — does a deletion here become a deletion everywhere?
|
|
71
80
|
*
|
|
@@ -572,6 +581,27 @@ function withProjectConfig(cfg: DevServerConfig, repoRoot: string): DevServerCon
|
|
|
572
581
|
};
|
|
573
582
|
}
|
|
574
583
|
|
|
584
|
+
/**
|
|
585
|
+
* 2.0.7 — the folder-owned systems join the list, after every configured (and adopted) one, so the
|
|
586
|
+
* default never moves while the config lists a system. A cell's config.json never syncs, so a system
|
|
587
|
+
* converted on a desktop can be on the cell as files only (ds/folder-systems.ts). The list is for
|
|
588
|
+
* reading: every config.json writer reads the file itself.
|
|
589
|
+
*/
|
|
590
|
+
function withFolderSystems(cfg: DevServerConfig, repoRoot: string): DevServerConfig {
|
|
591
|
+
const designRel = String(cfg.designRoot ?? '.design').replace(/^\/+|\/+$/g, '');
|
|
592
|
+
const configured = (cfg.designSystems ?? []).map((d) => ({
|
|
593
|
+
name: d.name,
|
|
594
|
+
path: String(d.path ?? '').replace(/^\/+|\/+$/g, ''),
|
|
595
|
+
}));
|
|
596
|
+
const folders = folderOwnedSystems(path.join(repoRoot, designRel), configured);
|
|
597
|
+
if (!folders.length) return cfg;
|
|
598
|
+
// DesignSystemEntry types themeDefault as the studio's two app themes (as for an adopted system)
|
|
599
|
+
const entries: DesignSystemEntry[] = folders.map(({ themeDefault, ...d }) =>
|
|
600
|
+
themeDefault === 'dark' || themeDefault === 'light' ? { ...d, themeDefault } : d
|
|
601
|
+
);
|
|
602
|
+
return { ...cfg, designSystems: [...(cfg.designSystems ?? []), ...entries] };
|
|
603
|
+
}
|
|
604
|
+
|
|
575
605
|
export function loadConfig(repoRoot: string): DevServerConfig {
|
|
576
606
|
const configPath = path.join(repoRoot, '.design', 'config.json');
|
|
577
607
|
let raw: string;
|
|
@@ -583,7 +613,13 @@ export function loadConfig(repoRoot: string): DevServerConfig {
|
|
|
583
613
|
try {
|
|
584
614
|
const parsed = JSON.parse(raw);
|
|
585
615
|
return normalizeConfig(
|
|
586
|
-
|
|
616
|
+
withFolderSystems(
|
|
617
|
+
withProjectConfig(
|
|
618
|
+
{ ...DEFAULT_CONFIG, ...parsed, _source: '.design/config.json' },
|
|
619
|
+
repoRoot
|
|
620
|
+
),
|
|
621
|
+
repoRoot
|
|
622
|
+
)
|
|
587
623
|
);
|
|
588
624
|
} catch (e) {
|
|
589
625
|
const msg = e instanceof Error ? e.message : String(e);
|