@1agh/maude 2.0.3 → 2.0.6
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/README.md +6 -5
- package/apps/hub/src/project-transactions/kernel.mjs +10 -1
- package/apps/studio/access/filters.ts +12 -5
- package/apps/studio/access/known-canvases.ts +24 -1
- package/apps/studio/access/refused-inputs.ts +89 -0
- package/apps/studio/access/request.ts +0 -1
- package/apps/studio/acp/adapter-stderr.ts +43 -13
- package/apps/studio/acp/background-tasks.ts +155 -0
- package/apps/studio/acp/bridge.ts +44 -5
- package/apps/studio/acp/connected-fact.ts +15 -4
- package/apps/studio/acp/index.ts +14 -5
- package/apps/studio/actions/agents.ts +10 -0
- package/apps/studio/actions/defs/app.ts +12 -0
- package/apps/studio/actions/defs/view.ts +12 -0
- package/apps/studio/actions.manifest.json +25 -1
- package/apps/studio/actions.parity.json +13 -1
- package/apps/studio/annotations/ui/element-node.tsx +139 -54
- package/apps/studio/annotations/ui/lod.tsx +1 -1
- package/apps/studio/annotations/ui/text-style.ts +1 -1
- package/apps/studio/annotations-layer.tsx +0 -12
- package/apps/studio/api.ts +73 -24
- package/apps/studio/artboard-live-gate.tsx +267 -0
- package/apps/studio/artboard-live.ts +336 -0
- package/apps/studio/artboard-webgl.ts +668 -0
- package/apps/studio/bin/_agent-browser-bin.mjs +8 -0
- package/apps/studio/bin/_agent-browser-safe.mjs +2 -1
- package/apps/studio/bin/_canvas-reasons.mjs +34 -0
- package/apps/studio/bin/_ds-check-live.mjs +37 -0
- package/apps/studio/bin/_ds-check.mjs +4 -1
- package/apps/studio/bin/_ds-prove-judge.mjs +167 -0
- package/apps/studio/bin/_ds-prove-playwright.mjs +183 -105
- package/apps/studio/bin/_import-asset.mjs +2 -1
- package/apps/studio/bin/_perf-probe.mjs +2 -1
- package/apps/studio/bin/_png-playwright.mjs +10 -1
- package/apps/studio/bin/_pw-launch.mjs +14 -0
- package/apps/studio/bin/_studio-verb.mjs +24 -3
- package/apps/studio/bin/_thumb-blank.mjs +70 -0
- package/apps/studio/bin/_thumb-cover.mjs +35 -0
- package/apps/studio/bin/_thumbs-playwright.mjs +93 -13
- package/apps/studio/bin/ds-check.sh +5 -1
- package/apps/studio/bin/perf.sh +11 -1
- package/apps/studio/bin/server-up.sh +7 -2
- package/apps/studio/bin/smoke.sh +19 -0
- package/apps/studio/boot-progress.ts +31 -0
- package/apps/studio/canvas-build-sandbox.ts +275 -42
- package/apps/studio/canvas-build-worker.ts +10 -0
- package/apps/studio/canvas-create.ts +24 -0
- package/apps/studio/canvas-lib.tsx +131 -12
- package/apps/studio/canvas-module-cache.ts +93 -0
- package/apps/studio/canvas-source/errors.ts +39 -0
- package/apps/studio/canvas-source/waiting.ts +290 -0
- package/apps/studio/client/actions/shell-key-handlers.js +5 -0
- package/apps/studio/client/app.jsx +19 -9
- package/apps/studio/client/canvas-url.js +13 -0
- package/apps/studio/client/github.js +23 -3
- package/apps/studio/client/home/HomeAccounts.jsx +262 -0
- package/apps/studio/client/home/Shelves.jsx +4 -3
- package/apps/studio/client/home/home-accounts-model.js +121 -0
- package/apps/studio/client/home/home-api.js +36 -19
- package/apps/studio/client/home/home-app.jsx +141 -40
- package/apps/studio/client/home/home-model.js +172 -6
- package/apps/studio/client/home/home.css +169 -5
- package/apps/studio/client/home/shell-mode.js +8 -1
- package/apps/studio/client/hooks/use-git-actions.jsx +2 -1
- package/apps/studio/client/hooks/use-project-data.jsx +2 -0
- package/apps/studio/client/hooks/use-shell-core.jsx +3 -0
- package/apps/studio/client/hooks/use-tabs.jsx +64 -35
- package/apps/studio/client/index-loader.ts +23 -3
- package/apps/studio/client/panels/ChatPanel.jsx +49 -57
- package/apps/studio/client/panels/CreateProject.jsx +19 -5
- package/apps/studio/client/panels/DiffView.jsx +314 -248
- package/apps/studio/client/panels/TeamProjects.jsx +119 -69
- package/apps/studio/client/panels/acp-runtime.js +25 -0
- package/apps/studio/client/panels/caps-cache.js +46 -0
- package/apps/studio/client/panels/chat-finish.js +66 -0
- package/apps/studio/client/shell/frame-cap.js +53 -0
- package/apps/studio/client/shell/viewport.jsx +45 -8
- package/apps/studio/client/styles/_index.css +2 -0
- package/apps/studio/client/tree/tree.jsx +48 -21
- package/apps/studio/client/v2/access/access-client.js +2 -0
- package/apps/studio/client/v2/access/access-host.jsx +12 -1
- package/apps/studio/client/v2/access/trashed-banner.jsx +6 -3
- package/apps/studio/client/v2/ai/Advanced.jsx +12 -0
- package/apps/studio/client/v2/ai/BackgroundStrip.jsx +120 -0
- package/apps/studio/client/v2/ai/Composer.jsx +27 -10
- package/apps/studio/client/v2/ai/StoppedDivider.jsx +2 -1
- package/apps/studio/client/v2/ai/ai-run.css +87 -3
- package/apps/studio/client/v2/ai/background-model.js +113 -0
- package/apps/studio/client/v2/ai/needs-you-store.js +2 -1
- package/apps/studio/client/v2/ai/run-api.js +7 -3
- package/apps/studio/client/v2/ai/runs-store.js +2 -1
- package/apps/studio/client/v2/annotations/vote-store.js +11 -5
- package/apps/studio/client/v2/assets/asset-state-lane.js +6 -3
- package/apps/studio/client/v2/assets/assets-bus.js +10 -8
- package/apps/studio/client/v2/assets/browse-view.jsx +2 -0
- package/apps/studio/client/v2/assets/ds-library-view.jsx +47 -0
- package/apps/studio/client/v2/assets/spotlight-model.js +75 -0
- package/apps/studio/client/v2/assets/spotlight.css +153 -0
- package/apps/studio/client/v2/assets/spotlight.jsx +199 -0
- package/apps/studio/client/v2/assets/tile-menu.jsx +3 -1
- package/apps/studio/client/v2/assets/tile.jsx +3 -0
- package/apps/studio/client/v2/assets/use-assets.js +2 -1
- package/apps/studio/client/v2/canvases/canvases-panel.jsx +13 -2
- package/apps/studio/client/v2/canvases/covers.js +11 -5
- package/apps/studio/client/v2/canvases/folder-ask.js +139 -0
- package/apps/studio/client/v2/canvases/folder-dialogs.jsx +150 -0
- package/apps/studio/client/v2/canvases/trash-canvas.js +10 -2
- package/apps/studio/client/v2/canvases/trash-queue.js +152 -0
- package/apps/studio/client/v2/canvases/use-canvas-index.js +42 -18
- package/apps/studio/client/v2/canvases/use-pins.js +2 -1
- package/apps/studio/client/v2/code/canvas-error-card.jsx +70 -5
- package/apps/studio/client/v2/code/canvas-imports-card.jsx +15 -14
- package/apps/studio/client/v2/code/canvas-imports-words.js +44 -0
- package/apps/studio/client/v2/code/canvas-waiting-card.jsx +128 -0
- package/apps/studio/client/v2/code/canvas-waiting.js +164 -0
- package/apps/studio/client/v2/code/code-bus.js +5 -0
- package/apps/studio/client/v2/code/code.css +67 -0
- package/apps/studio/client/v2/code/use-canvas-source.js +19 -4
- package/apps/studio/client/v2/create/NameDialog.jsx +4 -2
- package/apps/studio/client/v2/create/name-dialog.css +10 -0
- package/apps/studio/client/v2/ds/advanced-host.jsx +11 -23
- package/apps/studio/client/v2/ds/ds-refresh.js +161 -0
- package/apps/studio/client/v2/ds/library-host.jsx +45 -45
- package/apps/studio/client/v2/ds/make-host.jsx +13 -12
- package/apps/studio/client/v2/ds/off-system-host.jsx +18 -16
- package/apps/studio/client/v2/ds/review-host.jsx +7 -1
- package/apps/studio/client/v2/ds/truth-host.jsx +15 -14
- package/apps/studio/client/v2/ds/upgrade-host.jsx +26 -10
- package/apps/studio/client/v2/empty/arriving.jsx +29 -12
- package/apps/studio/client/v2/empty/empty-host.jsx +8 -2
- package/apps/studio/client/v2/empty/not-local.jsx +31 -1
- package/apps/studio/client/v2/empty/use-empty-canvas.js +10 -1
- package/apps/studio/client/v2/export/last-finished.js +2 -1
- package/apps/studio/client/v2/history/branch-actions.js +13 -9
- package/apps/studio/client/v2/history/git-advanced.jsx +8 -1
- package/apps/studio/client/v2/history/git-model.js +21 -5
- package/apps/studio/client/v2/history/git-parts.jsx +76 -43
- package/apps/studio/client/v2/history/history.css +6 -0
- package/apps/studio/client/v2/left-panel/assets-panel.jsx +87 -10
- package/apps/studio/client/v2/left-panel/use-trash.js +2 -1
- package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +100 -33
- package/apps/studio/client/v2/onboarding/HubSheet.jsx +51 -83
- package/apps/studio/client/v2/onboarding/onboarding-model.js +10 -6
- package/apps/studio/client/v2/presence/faces.jsx +42 -14
- package/apps/studio/client/v2/present/order-notes-artboards.js +2 -1
- package/apps/studio/client/v2/search/search-recent.js +3 -1
- package/apps/studio/client/v2/search/search-remote.js +6 -4
- package/apps/studio/client/v2/settings/connections-model.js +1 -1
- package/apps/studio/client/v2/shell/account-card.jsx +10 -4
- package/apps/studio/client/v2/shell/canvas-crash-guard.js +137 -0
- package/apps/studio/client/v2/shell/github-signin-host.jsx +42 -0
- package/apps/studio/client/v2/shell/menu-runner.js +12 -0
- package/apps/studio/client/v2/shell/occlusion-insets.js +14 -2
- package/apps/studio/client/v2/shell/project-account-card.jsx +203 -0
- package/apps/studio/client/v2/shell/project-account-model.js +182 -0
- package/apps/studio/client/v2/shell/recovery-store.js +2 -1
- package/apps/studio/client/v2/shell/served-routes.js +120 -0
- package/apps/studio/client/v2/shell/share-cluster-host.jsx +139 -11
- package/apps/studio/client/v2/shell/share-cluster.css +58 -0
- package/apps/studio/client/v2/shell/share-cluster.jsx +26 -7
- package/apps/studio/client/v2/shell/shell-activity.js +19 -0
- package/apps/studio/client/v2/shell/team-switch.js +94 -0
- package/apps/studio/client/v2/shell/too-heavy-card.jsx +38 -0
- package/apps/studio/client/v2/shell/use-account.js +8 -1
- package/apps/studio/client/v2/shell/use-occluded-insets.js +3 -0
- package/apps/studio/client/v2/sync-states/conflict-card.jsx +7 -2
- package/apps/studio/client/v2/undo/use-undo-projection.jsx +3 -1
- package/apps/studio/cloud/endpoints.ts +23 -1
- package/apps/studio/collab/persistence.ts +9 -1
- package/apps/studio/collab/registry.ts +32 -0
- package/apps/studio/collab/room.ts +8 -0
- package/apps/studio/config-reload-wire.ts +53 -0
- package/apps/studio/dist/client.bundle.js +1098 -1102
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/ds/board/specimen.tsx +12 -1
- package/apps/studio/ds/canvas-cli.ts +58 -2
- package/apps/studio/ds/check.ts +26 -1
- package/apps/studio/ds/cli.ts +7 -3
- package/apps/studio/ds/convert.ts +34 -6
- package/apps/studio/ds/ds-verb.ts +13 -0
- package/apps/studio/ds/post-build.ts +38 -0
- package/apps/studio/ds/upgrade-apply.ts +27 -5
- package/apps/studio/ds/upgrade-cli.ts +22 -2
- package/apps/studio/ds/upgrade-prove.ts +198 -15
- package/apps/studio/ds/upgrade-stage.ts +4 -1
- package/apps/studio/editing/minimap-context.tsx +3 -3
- package/apps/studio/editing/page-activity.ts +251 -0
- package/apps/studio/editing/rotate-handle.tsx +9 -5
- package/apps/studio/editing/sticky-name.tsx +4 -4
- package/apps/studio/history/restore-artboard-action.ts +40 -0
- package/apps/studio/history/trash.ts +6 -0
- package/apps/studio/home/accounts.ts +87 -0
- package/apps/studio/home/hub.ts +77 -175
- package/apps/studio/home/index-reader.ts +24 -2
- package/apps/studio/home/routes.ts +66 -8
- package/apps/studio/http.ts +131 -68
- package/apps/studio/index-flight.ts +40 -0
- package/apps/studio/managed-projects.ts +52 -24
- package/apps/studio/migrate/hub.ts +7 -1
- package/apps/studio/routes/canvas-source.ts +44 -2
- package/apps/studio/routes/ds-convert.ts +18 -0
- package/apps/studio/routes/history.ts +28 -5
- package/apps/studio/routes/hub-signin.ts +115 -0
- package/apps/studio/routes/index.ts +4 -0
- package/apps/studio/routes/table.ts +7 -0
- package/apps/studio/routes/trash.ts +19 -1
- package/apps/studio/server.ts +19 -10
- package/apps/studio/sync/accepted-cold-start.ts +54 -16
- package/apps/studio/sync/accepted-link.ts +9 -4
- package/apps/studio/sync/asset-push.ts +146 -23
- package/apps/studio/sync/asset-state.ts +3 -2
- package/apps/studio/sync/code-module-consent.ts +74 -0
- package/apps/studio/sync/file-ledger.ts +35 -0
- package/apps/studio/sync/file-membership.ts +28 -3
- package/apps/studio/sync/file-plane.ts +483 -86
- package/apps/studio/sync/file-pull.ts +304 -33
- package/apps/studio/sync/hub-browser-signin.ts +377 -0
- package/apps/studio/sync/hub-link.ts +1 -2
- package/apps/studio/sync/hub-text-undo.ts +30 -10
- package/apps/studio/sync/index.ts +381 -161
- package/apps/studio/sync/journal-client.ts +94 -5
- package/apps/studio/sync/pending-deletes.ts +100 -0
- package/apps/studio/sync/projection.ts +121 -14
- package/apps/studio/sync/pull-pacer.ts +160 -0
- package/apps/studio/sync/pull-priority.ts +119 -0
- package/apps/studio/sync/seed-progress.ts +58 -3
- package/apps/studio/sync/status.ts +3 -1
- package/apps/studio/sync/transaction-client.ts +71 -6
- package/apps/studio/sync/workspace-signin.ts +6 -256
- package/apps/studio/sync/writer-registry.ts +5 -1
- package/apps/studio/thumbs/service.ts +12 -2
- package/apps/studio/thumbs/validate.ts +7 -0
- package/apps/studio/ui-prefs-migrate.ts +4 -0
- package/apps/studio/video-comp.tsx +23 -0
- package/apps/studio/video-links-overlay.tsx +3 -2
- package/apps/studio/whats-new.json +126 -0
- package/cli/lib/bash-guard.mjs +13 -1
- package/cli/lib/design-help.gen.mjs +1 -1
- package/cli/lib/design-hook.mjs +20 -0
- package/cli/lib/studio-locate.mjs +35 -10
- package/cli/lib/workspace-plan.mjs +14 -0
- package/package.json +8 -8
|
@@ -115,6 +115,12 @@ import {
|
|
|
115
115
|
type GuideDefinitions,
|
|
116
116
|
type OverlayVisibility,
|
|
117
117
|
} from './artboard-guides-overlay.tsx';
|
|
118
|
+
import {
|
|
119
|
+
ARTBOARD_LIVE_CSS,
|
|
120
|
+
ArtboardLiveFeed,
|
|
121
|
+
ArtboardLiveGate,
|
|
122
|
+
holdAllLive,
|
|
123
|
+
} from './artboard-live-gate.tsx';
|
|
118
124
|
import { ArtboardNewSection, useNewSection } from './artboard-new-section.tsx';
|
|
119
125
|
import {
|
|
120
126
|
ArtboardWarnMark,
|
|
@@ -215,6 +221,9 @@ import { UndoStackProvider, useUndoSinks, useUndoStackOptional } from './use-und
|
|
|
215
221
|
import { VideoComp } from './video-comp.tsx';
|
|
216
222
|
import { VideoPlayLayer } from './video-play-overlay.tsx';
|
|
217
223
|
|
|
224
|
+
// 2.0.5 — is this artboard running live (near the viewport, not zoomed out to the overview)? Gate a render
|
|
225
|
+
// loop, a simulation or an expensive first mount on it. Always true in captures and exports.
|
|
226
|
+
export { useArtboardActive, useArtboardSeen } from './artboard-live-gate.tsx';
|
|
218
227
|
export type { CompSnapshot, VideoCompMeta, VideoCompProps } from './video-comp.tsx';
|
|
219
228
|
// S7.5 — the comp vocabulary (V2-1.10 §5.3): literal-prop components; the build injects their
|
|
220
229
|
// derived data (`__words`, `__speech`, video/inject.ts). A 1.x build lacks these exports, so a
|
|
@@ -343,6 +352,8 @@ type DcPerfCounters = {
|
|
|
343
352
|
annotationRenders: number;
|
|
344
353
|
/** Annotation element nodes (re-)rendered — a drag should touch only what moves. */
|
|
345
354
|
annotationNodeRenders?: number;
|
|
355
|
+
/** Section title chips (re-)rendered — a pan/zoom gesture should render none (2.0.5 W2). */
|
|
356
|
+
sectionChipRenders?: number;
|
|
346
357
|
instrumented?: boolean;
|
|
347
358
|
};
|
|
348
359
|
|
|
@@ -522,6 +533,7 @@ const ENGINE_CSS = `
|
|
|
522
533
|
/* S3.14 - Present draws the work only (04 md-present-*): the editor chrome list is present/present-stage.tsx
|
|
523
534
|
PRESENT_HIDES, keyed on the root attribute the stage sets while any Present is on. */
|
|
524
535
|
${presentHidesCss()}
|
|
536
|
+
${ARTBOARD_LIVE_CSS}
|
|
525
537
|
.dc-canvas .dc-artboard-label {
|
|
526
538
|
flex-shrink: 0;
|
|
527
539
|
background: var(--maude-chrome-bg-2, #e8e3d8);
|
|
@@ -638,7 +650,8 @@ input.dc-artboard-rename {
|
|
|
638
650
|
/* V2-8.8 (WebKit M7) - on the WebKit scale path (transform, see writeTransform) the name and the video badge get
|
|
639
651
|
their OWN compositor layer. They are re-sized every zoom frame by the counter-scale above and paint outside the
|
|
640
652
|
frame, so inside the board's layer (will-change, the per-board raster freeze) they moved its bounds every frame
|
|
641
|
-
and WebKit re-rastered every board on every zoom frame. Blink (CSS zoom) relayouts the world anyway;
|
|
653
|
+
and WebKit re-rastered every board on every zoom frame. Settled Blink (CSS zoom) relayouts the world anyway;
|
|
654
|
+
during a Blink zoom gesture the world is on the transform path too (2.0.5 W2, writeTransform flips the flag). */
|
|
642
655
|
.dc-world[data-dc-scale='transform'] .dc-artboard.dc-positioned > .dc-artboard-label,
|
|
643
656
|
.dc-world[data-dc-scale='transform'] .dc-artboard.dc-positioned > .dc-artboard-video-badge {
|
|
644
657
|
will-change: transform;
|
|
@@ -1243,6 +1256,35 @@ export function getLiveViewport(): ViewportState | null {
|
|
|
1243
1256
|
return liveViewport ? { ...liveViewport } : null;
|
|
1244
1257
|
}
|
|
1245
1258
|
|
|
1259
|
+
/**
|
|
1260
|
+
* 2.0.5 W2 — counter-scaled chrome that sits BELOW a `--dc-zoom` reset. The annotation scene stops the
|
|
1261
|
+
* world's `--dc-zoom` (a custom property inherits, so a zoom frame would otherwise restyle every element
|
|
1262
|
+
* of the board), but a section's title chip still has to hold its screen size, and drawing it from
|
|
1263
|
+
* `useLiveViewport()` re-rendered every chip at ~20 Hz through a gesture. A node given this ref gets
|
|
1264
|
+
* `--dc-zoom` written straight onto it with every camera write (writeTransform), so its CSS
|
|
1265
|
+
* (`scale(calc(1 / var(--dc-zoom, 1)))`) tracks the live zoom with no React work and no inheritance
|
|
1266
|
+
* through the scene. Node → the world it sits in (only that world's writes feed it).
|
|
1267
|
+
*/
|
|
1268
|
+
const screenSizedNodes = new Map<HTMLElement, HTMLElement | null>();
|
|
1269
|
+
/**
|
|
1270
|
+
* True on Blink, where CSS-counter-scaled chrome (`screenSizedRef`) is used. WebKit (Safari + the WKWebView
|
|
1271
|
+
* desktop app) keeps sizing that chrome from `useLiveViewport()`: the per-frame transform was not shown to be
|
|
1272
|
+
* free there, and the desktop app must not regress (2.0.5 W2).
|
|
1273
|
+
*/
|
|
1274
|
+
export function cssCounterScaledChrome(): boolean {
|
|
1275
|
+
return !IS_WEBKIT;
|
|
1276
|
+
}
|
|
1277
|
+
export function screenSizedRef(node: HTMLElement | null): (() => void) | undefined {
|
|
1278
|
+
if (!node) return undefined;
|
|
1279
|
+
const world = node.closest<HTMLElement>('.dc-world');
|
|
1280
|
+
screenSizedNodes.set(node, world);
|
|
1281
|
+
const z = world?.style.getPropertyValue('--dc-zoom');
|
|
1282
|
+
if (z) node.style.setProperty('--dc-zoom', z);
|
|
1283
|
+
return () => {
|
|
1284
|
+
screenSizedNodes.delete(node);
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1246
1288
|
/**
|
|
1247
1289
|
* Viewport for the few consumers that must track a gesture AS IT HAPPENS —
|
|
1248
1290
|
* the minimap indicator and the zoom % readout. Everything else reads the
|
|
@@ -1400,6 +1442,18 @@ export function useViewportController(opts: ViewportControllerOptions): Viewport
|
|
|
1400
1442
|
const el = worldRef.current;
|
|
1401
1443
|
if (!el) return;
|
|
1402
1444
|
const z = v.zoom || 1;
|
|
1445
|
+
// 2.0.5 W2 — a Blink ZOOM gesture scales the already-promoted world layer with `transform` instead:
|
|
1446
|
+
// CSS `zoom` re-laid-out the whole world on every zoom frame (~2.4k layout objects on a 714-element
|
|
1447
|
+
// board, zoom p95 33 ms). The CSS `zoom` the gesture started at is HELD and only the residual scale
|
|
1448
|
+
// (z / held) goes on the transform, so the gesture's first scaling frame lays out nothing either —
|
|
1449
|
+
// dropping `zoom` to '' there re-laid-out the whole world at 1x (and again when a symmetric gesture
|
|
1450
|
+
// came back to its start scale): two full-layout frames inside every zoom, which is the zoom p95.
|
|
1451
|
+
// Only while a burst is changing scale and the write is not the settle one — the settle (`crisp`,
|
|
1452
|
+
// from markInteracting's quiet timer) writes the final CSS `zoom`, so text re-rasters crisp and every
|
|
1453
|
+
// reader of a settled camera (export shims, screenshot, canvas-rects) sees CSS `zoom` exactly as
|
|
1454
|
+
// before. A pure pan (scale unchanged) never leaves CSS `zoom`. WebKit is untouched.
|
|
1455
|
+
const blinkGestureScale =
|
|
1456
|
+
!IS_WEBKIT && !opts?.crisp && interactingRef.current && z !== zoomAtInteractStartRef.current;
|
|
1403
1457
|
if (IS_WEBKIT) {
|
|
1404
1458
|
el.style.zoom = '';
|
|
1405
1459
|
el.style.transformOrigin = '0 0';
|
|
@@ -1408,10 +1462,20 @@ export function useViewportController(opts: ViewportControllerOptions): Viewport
|
|
|
1408
1462
|
// WebKit re-paints text crisp at the new scale instead of upscaling the
|
|
1409
1463
|
// cached bitmap.
|
|
1410
1464
|
el.style.willChange = opts?.crisp ? 'auto' : 'transform';
|
|
1465
|
+
} else if (blinkGestureScale) {
|
|
1466
|
+
// under `zoom: held` the transform is in pre-zoom px: screen = held·(t + s·world) = x + z·world
|
|
1467
|
+
const held = Number.parseFloat(el.style.zoom) || 1;
|
|
1468
|
+
el.style.transformOrigin = '0 0';
|
|
1469
|
+
el.style.transform = `translate(${v.x / held}px, ${v.y / held}px) scale(${z / held})`;
|
|
1411
1470
|
} else {
|
|
1471
|
+
el.style.transformOrigin = '';
|
|
1412
1472
|
el.style.transform = `translate(${v.x / z}px, ${v.y / z}px)`;
|
|
1413
1473
|
el.style.zoom = String(z);
|
|
1414
1474
|
}
|
|
1475
|
+
// The scale path the world is on RIGHT NOW (CSS keys off it — `[data-dc-scale='transform']`). The JSX
|
|
1476
|
+
// seeds the engine default; on Blink it flips for the length of a zoom gesture.
|
|
1477
|
+
const scaleMode = IS_WEBKIT || blinkGestureScale ? 'transform' : 'zoom';
|
|
1478
|
+
if (el.dataset.dcScale !== scaleMode) el.dataset.dcScale = scaleMode;
|
|
1415
1479
|
// Live zoom for counter-scaled chrome (section labels, connector dots,
|
|
1416
1480
|
// selection bboxes — anything that must stay a constant number of SCREEN px
|
|
1417
1481
|
// while the world scales). It has to be written per frame, right here: the
|
|
@@ -1419,7 +1483,11 @@ export function useViewportController(opts: ViewportControllerOptions): Viewport
|
|
|
1419
1483
|
// would scale with the world through a pinch and snap back at the end —
|
|
1420
1484
|
// reintroducing exactly the fidelity-pop that was removed once already
|
|
1421
1485
|
// (RCA addendum: the LOD toggle was reverted for visible flicker).
|
|
1422
|
-
|
|
1486
|
+
const zs = String(z);
|
|
1487
|
+
el.style.setProperty('--dc-zoom', zs);
|
|
1488
|
+
for (const [node, world] of screenSizedNodes) {
|
|
1489
|
+
if (world === el) node.style.setProperty('--dc-zoom', zs);
|
|
1490
|
+
}
|
|
1423
1491
|
el.style.visibility = 'visible';
|
|
1424
1492
|
runtimeWorldStyle.set(el, worldStyleKey(el));
|
|
1425
1493
|
}, []);
|
|
@@ -1734,18 +1802,44 @@ export function useViewportController(opts: ViewportControllerOptions): Viewport
|
|
|
1734
1802
|
// pinch doesn't double-apply (WebKit may emit both event streams).
|
|
1735
1803
|
const gesture = { active: false, lastScale: 1 };
|
|
1736
1804
|
|
|
1805
|
+
// 2.0.5 W2 — the host's box, cached. A wheel event right after a camera write used to read
|
|
1806
|
+
// `getBoundingClientRect()` + `clientWidth`/`clientHeight` here, forcing a synchronous style + layout
|
|
1807
|
+
// of the whole world inside the input handler, every event. Measured at mount and from a
|
|
1808
|
+
// ResizeObserver (delivered after layout, so its read is free); a window resize or scroll can move the
|
|
1809
|
+
// host without resizing it, so those only mark the box stale and the next wheel measures once.
|
|
1810
|
+
const hostBox = { left: 0, top: 0, width: 0, height: 0, fresh: false };
|
|
1811
|
+
const measureHost = () => {
|
|
1812
|
+
const r = host.getBoundingClientRect();
|
|
1813
|
+
hostBox.left = r.left;
|
|
1814
|
+
hostBox.top = r.top;
|
|
1815
|
+
hostBox.width = host.clientWidth;
|
|
1816
|
+
hostBox.height = host.clientHeight;
|
|
1817
|
+
// no observer = nothing tells us it changed: keep the old read-per-event behaviour
|
|
1818
|
+
hostBox.fresh = typeof ResizeObserver !== 'undefined';
|
|
1819
|
+
};
|
|
1820
|
+
const hostGeom = () => {
|
|
1821
|
+
if (!hostBox.fresh) measureHost();
|
|
1822
|
+
return hostBox;
|
|
1823
|
+
};
|
|
1824
|
+
const markHostStale = () => {
|
|
1825
|
+
hostBox.fresh = false;
|
|
1826
|
+
};
|
|
1827
|
+
measureHost();
|
|
1828
|
+
const hostRo = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(measureHost) : null;
|
|
1829
|
+
hostRo?.observe(host);
|
|
1830
|
+
|
|
1737
1831
|
const onWheel = (e: WheelEvent) => {
|
|
1738
1832
|
e.preventDefault();
|
|
1739
|
-
const
|
|
1740
|
-
const cx = e.clientX -
|
|
1741
|
-
const cy = e.clientY -
|
|
1833
|
+
const box = hostGeom();
|
|
1834
|
+
const cx = e.clientX - box.left;
|
|
1835
|
+
const cy = e.clientY - box.top;
|
|
1742
1836
|
// Normalize line/page-mode deltas to pixels before anything below
|
|
1743
1837
|
// reads them — see `wheelDeltaToPixels` (issue #94). Zoom's own
|
|
1744
1838
|
// [-50, 50] clamp already absorbed this for the pinch/ctrl+wheel path,
|
|
1745
1839
|
// but pan had no such clamp so a line-mode mouse wheel panned at only
|
|
1746
1840
|
// a few px per notch.
|
|
1747
|
-
const dx = wheelDeltaToPixels(e.deltaX, e.deltaMode,
|
|
1748
|
-
const dy = wheelDeltaToPixels(e.deltaY, e.deltaMode,
|
|
1841
|
+
const dx = wheelDeltaToPixels(e.deltaX, e.deltaMode, box.width);
|
|
1842
|
+
const dy = wheelDeltaToPixels(e.deltaY, e.deltaMode, box.height);
|
|
1749
1843
|
// Mac trackpad pinch fires wheel with ctrlKey:true automatically, even
|
|
1750
1844
|
// without a physical Ctrl press — so the same branch covers both
|
|
1751
1845
|
// Ctrl+wheel (mouse) and pinch-zoom (trackpad).
|
|
@@ -1794,9 +1888,9 @@ export function useViewportController(opts: ViewportControllerOptions): Viewport
|
|
|
1794
1888
|
ev.preventDefault();
|
|
1795
1889
|
if (!gesture.active) return;
|
|
1796
1890
|
const e = ev as SafariGestureEvent;
|
|
1797
|
-
const
|
|
1798
|
-
const cx = e.clientX -
|
|
1799
|
-
const cy = e.clientY -
|
|
1891
|
+
const box = hostGeom();
|
|
1892
|
+
const cx = e.clientX - box.left;
|
|
1893
|
+
const cy = e.clientY - box.top;
|
|
1800
1894
|
const s = e.scale || 1;
|
|
1801
1895
|
const factor = gesture.lastScale > 0 ? s / gesture.lastScale : 1;
|
|
1802
1896
|
gesture.lastScale = s;
|
|
@@ -1939,8 +2033,14 @@ export function useViewportController(opts: ViewportControllerOptions): Viewport
|
|
|
1939
2033
|
host.addEventListener('gesturestart', onGestureStart, { passive: false });
|
|
1940
2034
|
host.addEventListener('gesturechange', onGestureChange, { passive: false });
|
|
1941
2035
|
host.addEventListener('gestureend', onGestureEnd, { passive: false });
|
|
2036
|
+
const win = doc.defaultView;
|
|
2037
|
+
win?.addEventListener('resize', markHostStale);
|
|
2038
|
+
win?.addEventListener('scroll', markHostStale, { capture: true, passive: true });
|
|
1942
2039
|
|
|
1943
2040
|
return () => {
|
|
2041
|
+
hostRo?.disconnect();
|
|
2042
|
+
win?.removeEventListener('resize', markHostStale);
|
|
2043
|
+
win?.removeEventListener('scroll', markHostStale, { capture: true } as EventListenerOptions);
|
|
1944
2044
|
doc.removeEventListener('wheel', captureWheel, { capture: true } as EventListenerOptions);
|
|
1945
2045
|
doc.removeEventListener('keydown', captureKeyDown, { capture: true } as EventListenerOptions);
|
|
1946
2046
|
doc.removeEventListener('keyup', captureKeyUp, { capture: true } as EventListenerOptions);
|
|
@@ -2200,6 +2300,8 @@ function useExportCaptureBridge() {
|
|
|
2200
2300
|
? m.artboardIds.filter((s): s is string => typeof s === 'string')
|
|
2201
2301
|
: null;
|
|
2202
2302
|
void (async () => {
|
|
2303
|
+
// 2.0.5 — a capture renders every artboard live: wake the sleeping ones for the whole batch.
|
|
2304
|
+
const releaseLive = await holdAllLive();
|
|
2203
2305
|
const savedWorld = resetWorldPlane();
|
|
2204
2306
|
// Hold the chrome suppression across the WHOLE batch. `svgForElement`
|
|
2205
2307
|
// applies it per target too (ref-counted), but a 10-artboard deck would
|
|
@@ -2252,6 +2354,7 @@ function useExportCaptureBridge() {
|
|
|
2252
2354
|
});
|
|
2253
2355
|
} finally {
|
|
2254
2356
|
releaseChrome();
|
|
2357
|
+
releaseLive();
|
|
2255
2358
|
restoreWorldPlane(savedWorld);
|
|
2256
2359
|
busy = false;
|
|
2257
2360
|
}
|
|
@@ -2728,6 +2831,7 @@ function DesignCanvasInner({ children, controls }: DesignCanvasProps) {
|
|
|
2728
2831
|
MORE than the mock — fit + actual-size — so no capability is lost. */}
|
|
2729
2832
|
{showZoom ? <DCZoomToolbar /> : null}
|
|
2730
2833
|
<ViewportZoomReporter />
|
|
2834
|
+
<ArtboardLiveFeed zoom={controller.viewport.zoom} interacting={!!controller.isInteracting} />
|
|
2731
2835
|
{/* ── S8.19 (L1) placeholder frames ── "Waiting for Jonas's Mac" / Missing over a picture
|
|
2732
2836
|
that failed to load; driven only by the shell's dgn `asset-state` (asset-placeholder.tsx). */}
|
|
2733
2837
|
<AssetPlaceholderLayer />
|
|
@@ -3110,7 +3214,14 @@ function DCArtboardBody({
|
|
|
3110
3214
|
>
|
|
3111
3215
|
<header className="dc-artboard-label sku">{label}</header>
|
|
3112
3216
|
<div className="dc-artboard-body" ref={bodyRef} style={bodyStyle}>
|
|
3113
|
-
|
|
3217
|
+
<ArtboardLiveGate
|
|
3218
|
+
id={id}
|
|
3219
|
+
articleRef={articleRef}
|
|
3220
|
+
bodyRef={bodyRef}
|
|
3221
|
+
heightFloor={heightFloor}
|
|
3222
|
+
>
|
|
3223
|
+
{children}
|
|
3224
|
+
</ArtboardLiveGate>
|
|
3114
3225
|
</div>
|
|
3115
3226
|
</article>
|
|
3116
3227
|
);
|
|
@@ -3284,7 +3395,15 @@ function DCArtboardBody({
|
|
|
3284
3395
|
containIntrinsicSize: `${rect.w}px ${rect.h}px`,
|
|
3285
3396
|
}}
|
|
3286
3397
|
>
|
|
3287
|
-
{
|
|
3398
|
+
{/* 2.0.5 — offscreen / zoomed-out artboards sleep (artboard-live.ts); captures run everything live */}
|
|
3399
|
+
<ArtboardLiveGate
|
|
3400
|
+
id={id}
|
|
3401
|
+
articleRef={articleRef}
|
|
3402
|
+
bodyRef={bodyRef}
|
|
3403
|
+
heightFloor={heightFloor}
|
|
3404
|
+
>
|
|
3405
|
+
{children}
|
|
3406
|
+
</ArtboardLiveGate>
|
|
3288
3407
|
</div>
|
|
3289
3408
|
</article>
|
|
3290
3409
|
{showActivity ? (
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// A byte-bounded LRU for built canvas modules (issue #204).
|
|
2
|
+
//
|
|
3
|
+
// A canvas module BUNDLES the shared chrome (canvas-lib and everything it pulls in), so every built
|
|
4
|
+
// canvas is ~2 MB of JavaScript however small its own source is — measured 2.1 MB on the first-sync
|
|
5
|
+
// bench's canvases. The module route kept one per canvas path for the life of the process, with no
|
|
6
|
+
// bound: a project's server builds every canvas once just to render its cover (thumbs
|
|
7
|
+
// `bootCovers`), so after a first sync of 111 canvases it held ~230 MB of module text, which a JS
|
|
8
|
+
// string with any non-Latin-1 character stores at two bytes a character — ~460 MB of heap that was
|
|
9
|
+
// never released (the reported `[mem] rss > warn … heapUsed ~317 MB` on an idle synced desktop),
|
|
10
|
+
// and ~1.3 GB on a 311-canvas cell. Modules are kept here as UTF-8 bytes (half the size, and off
|
|
11
|
+
// the JS heap) under a byte budget; a miss only costs a rebuild, which the route already handles.
|
|
12
|
+
|
|
13
|
+
/** What a cached module costs. */
|
|
14
|
+
export interface Sized {
|
|
15
|
+
/** Bytes this entry holds — what the budget counts. */
|
|
16
|
+
readonly bytes: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ModuleCache<V extends Sized> {
|
|
20
|
+
get(key: string): V | undefined;
|
|
21
|
+
/** Insert or replace `key`, then evict least-recently-used entries until the budget holds.
|
|
22
|
+
* The entry just set is never evicted by its own insert, even when it alone is over budget —
|
|
23
|
+
* the request that built it is about to serve it. */
|
|
24
|
+
set(key: string, value: V): void;
|
|
25
|
+
delete(key: string): void;
|
|
26
|
+
clear(): void;
|
|
27
|
+
readonly size: number;
|
|
28
|
+
/** Total `bytes` of what is held now. */
|
|
29
|
+
readonly bytes: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ModuleCacheOptions {
|
|
33
|
+
maxBytes: number;
|
|
34
|
+
/** An additional count bound (the historical-version cache keeps its old one). */
|
|
35
|
+
maxEntries?: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function createModuleCache<V extends Sized>(o: ModuleCacheOptions): ModuleCache<V> {
|
|
39
|
+
const map = new Map<string, V>();
|
|
40
|
+
let total = 0;
|
|
41
|
+
const maxEntries = o.maxEntries ?? Number.POSITIVE_INFINITY;
|
|
42
|
+
|
|
43
|
+
function drop(key: string): void {
|
|
44
|
+
const v = map.get(key);
|
|
45
|
+
if (v === undefined) return;
|
|
46
|
+
total -= v.bytes;
|
|
47
|
+
map.delete(key);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
get(key) {
|
|
52
|
+
const v = map.get(key);
|
|
53
|
+
if (v === undefined) return undefined;
|
|
54
|
+
// Most recently used goes last: Map iteration order is insertion order.
|
|
55
|
+
map.delete(key);
|
|
56
|
+
map.set(key, v);
|
|
57
|
+
return v;
|
|
58
|
+
},
|
|
59
|
+
set(key, value) {
|
|
60
|
+
drop(key);
|
|
61
|
+
map.set(key, value);
|
|
62
|
+
total += value.bytes;
|
|
63
|
+
for (const oldest of map.keys()) {
|
|
64
|
+
if (total <= o.maxBytes && map.size <= maxEntries) break;
|
|
65
|
+
if (oldest === key) break;
|
|
66
|
+
drop(oldest);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
delete: drop,
|
|
70
|
+
clear() {
|
|
71
|
+
map.clear();
|
|
72
|
+
total = 0;
|
|
73
|
+
},
|
|
74
|
+
get size() {
|
|
75
|
+
return map.size;
|
|
76
|
+
},
|
|
77
|
+
get bytes() {
|
|
78
|
+
return total;
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** UTF-8 bytes of a built module, the form the caches keep it in. */
|
|
84
|
+
export function moduleBytes(js: string): Uint8Array<ArrayBuffer> {
|
|
85
|
+
return new TextEncoder().encode(js) as Uint8Array<ArrayBuffer>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** The env knob, in MB, with a floor so a typo cannot turn the cache off entirely. */
|
|
89
|
+
export function budgetFromEnv(name: string, defaultMb: number): number {
|
|
90
|
+
const raw = Number(process.env[name]);
|
|
91
|
+
const mb = Number.isFinite(raw) && raw >= 4 ? raw : defaultMb;
|
|
92
|
+
return mb * 1024 * 1024;
|
|
93
|
+
}
|
|
@@ -291,6 +291,7 @@ const recorded = new Map<string, { sig: string; error: CanvasError }>();
|
|
|
291
291
|
*/
|
|
292
292
|
export function recordCanvasBuild(absPath: string, sig: string, error: CanvasError | null): void {
|
|
293
293
|
recorded.delete(absPath);
|
|
294
|
+
failures.delete(absPath);
|
|
294
295
|
if (!error) return;
|
|
295
296
|
recorded.set(absPath, { sig, error });
|
|
296
297
|
if (recorded.size > MAX_RECORDED) {
|
|
@@ -307,6 +308,44 @@ export function recalledCanvasError(absPath: string, sig: string): CanvasError |
|
|
|
307
308
|
|
|
308
309
|
export function forgetCanvasErrors(): void {
|
|
309
310
|
recorded.clear();
|
|
311
|
+
failures.clear();
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* #189 — a build that stopped for a reason that is NOT in the canvas's code, as a class WE chose
|
|
316
|
+
* from the host's own control flow (the sandbox's kind, the worker's stage, a refusal COUNT) — never
|
|
317
|
+
* read out of an error string. gate-b-c4m holds: no message, path or specifier rides here, so the
|
|
318
|
+
* card can say why without handing a frame (or a person) build internals.
|
|
319
|
+
*
|
|
320
|
+
* engine the build engine could not start or load (a missing module in the sandbox, no result)
|
|
321
|
+
* timed-out it ran past the wall-clock ceiling and was stopped
|
|
322
|
+
* memory it ran past the memory ceiling and was stopped
|
|
323
|
+
* imports-refused the import allowlist refused `count` imports
|
|
324
|
+
*/
|
|
325
|
+
export type BuildFailureClass = 'engine' | 'timed-out' | 'memory' | 'imports-refused';
|
|
326
|
+
export interface BuildFailure {
|
|
327
|
+
class: BuildFailureClass;
|
|
328
|
+
/** `imports-refused` only: how many. */
|
|
329
|
+
count?: number;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
const failures = new Map<string, { sig: string; failure: BuildFailure }>();
|
|
333
|
+
|
|
334
|
+
/** Record why the live build of `absPath` (source signature `sig`) stopped outside its code. */
|
|
335
|
+
export function recordBuildFailure(absPath: string, sig: string, failure: BuildFailure): void {
|
|
336
|
+
recorded.delete(absPath);
|
|
337
|
+
failures.delete(absPath);
|
|
338
|
+
failures.set(absPath, { sig, failure });
|
|
339
|
+
if (failures.size > MAX_RECORDED) {
|
|
340
|
+
const oldest = failures.keys().next().value;
|
|
341
|
+
if (oldest !== undefined) failures.delete(oldest);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/** The recorded build failure of `absPath`, only while its source is still the one that failed. */
|
|
346
|
+
export function recalledBuildFailure(absPath: string, sig: string): BuildFailure | null {
|
|
347
|
+
const hit = failures.get(absPath);
|
|
348
|
+
return hit && hit.sig === sig ? hit.failure : null;
|
|
310
349
|
}
|
|
311
350
|
|
|
312
351
|
/** The signature a recorded error is keyed on: the source's own bytes. */
|