@1agh/maude 2.0.4 → 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/hub/src/project-transactions/kernel.mjs +10 -1
- package/apps/studio/access/closure.ts +156 -16
- package/apps/studio/access/filters.ts +39 -5
- package/apps/studio/access/known-canvases.ts +24 -1
- package/apps/studio/access/refused-inputs.ts +89 -0
- package/apps/studio/actions/agents.ts +59 -0
- package/apps/studio/actions/ctx.ts +3 -0
- package/apps/studio/actions/defs/app.ts +12 -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 +148 -1
- package/apps/studio/actions.parity.json +31 -1
- package/apps/studio/annotations/ui/ai-seen.tsx +4 -3
- package/apps/studio/annotations/ui/element-node.tsx +139 -54
- package/apps/studio/annotations/ui/lod.tsx +1 -1
- package/apps/studio/annotations/ui/ride.ts +2 -1
- package/apps/studio/annotations/ui/text-style.ts +1 -1
- package/apps/studio/annotations-context-toolbar.tsx +5 -4
- package/apps/studio/annotations-layer.tsx +4 -15
- package/apps/studio/api.ts +425 -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 +636 -0
- package/apps/studio/artboard-live.ts +831 -0
- 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 +669 -0
- package/apps/studio/asset-placeholder.tsx +237 -132
- package/apps/studio/asset-upload-bars.tsx +4 -4
- 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-open.mjs +364 -0
- package/apps/studio/bin/_perf-probe.mjs +2 -1
- package/apps/studio/bin/_perf-shared.mjs +12 -7
- package/apps/studio/bin/_pw-launch.mjs +26 -1
- 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 +89 -12
- package/apps/studio/bin/ds-check.sh +5 -1
- package/apps/studio/bin/perf.sh +30 -1
- package/apps/studio/bin/server-up.sh +7 -2
- package/apps/studio/bin/smoke.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 +289 -44
- 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 +36 -1
- 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 +6 -0
- 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/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 +13 -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/panels/ChatPanel.jsx +27 -20
- package/apps/studio/client/panels/CreateProject.jsx +19 -5
- package/apps/studio/client/panels/caps-cache.js +46 -0
- package/apps/studio/client/shell/viewport.jsx +66 -22
- package/apps/studio/client/tree/tree.jsx +17 -0
- 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/Composer.jsx +27 -10
- 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 +19 -14
- package/apps/studio/client/v2/code/canvas-imports-words.js +60 -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-bus.js +5 -0
- 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/ds/advanced-host.jsx +11 -26
- 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 -15
- package/apps/studio/client/v2/ds/off-system-host.jsx +18 -19
- package/apps/studio/client/v2/ds/review-host.jsx +7 -1
- package/apps/studio/client/v2/ds/truth-host.jsx +15 -17
- package/apps/studio/client/v2/ds/upgrade-host.jsx +26 -10
- 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 +3 -1
- package/apps/studio/client/v2/history/git-parts.jsx +16 -1
- 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/presence/faces.jsx +42 -14
- package/apps/studio/client/v2/shell/account-card.jsx +10 -4
- package/apps/studio/client/v2/shell/canvas-crash-guard.js +172 -0
- 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/github-signin-host.jsx +42 -0
- package/apps/studio/client/v2/shell/menu-runner.js +11 -0
- 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-account-card.jsx +203 -0
- package/apps/studio/client/v2/shell/project-account-model.js +182 -0
- package/apps/studio/client/v2/shell/project-menu-model.js +3 -0
- package/apps/studio/client/v2/shell/share-cluster-host.jsx +140 -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-parity.json +8 -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-canvas-mode-lane.js +30 -0
- 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/comments-overlay.tsx +12 -11
- package/apps/studio/config-reload-wire.ts +56 -0
- package/apps/studio/config.schema.json +6 -0
- package/apps/studio/context.ts +37 -1
- package/apps/studio/dist/client.bundle.js +1198 -1198
- 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 +16 -2
- package/apps/studio/ds/board/template.ts +39 -19
- package/apps/studio/ds/canvas-cli.ts +58 -2
- package/apps/studio/ds/check.ts +26 -1
- package/apps/studio/ds/cli.ts +14 -4
- package/apps/studio/ds/component-list.ts +2 -1
- package/apps/studio/ds/convert.ts +34 -6
- package/apps/studio/ds/default.ts +6 -1
- package/apps/studio/ds/ds-resolver.ts +58 -8
- package/apps/studio/ds/ds-verb.ts +13 -0
- 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/post-build.ts +38 -0
- package/apps/studio/ds/rename.ts +10 -3
- package/apps/studio/ds/shell-fallbacks.ts +2 -1
- 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 +10 -3
- 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/history/trash.ts +6 -0
- package/apps/studio/home/accounts.ts +87 -0
- package/apps/studio/home/index-reader.ts +24 -2
- package/apps/studio/home/routes.ts +19 -0
- package/apps/studio/http.ts +80 -34
- 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/ds-convert.ts +18 -0
- package/apps/studio/routes/sync.ts +176 -0
- package/apps/studio/routes/trash.ts +16 -1
- package/apps/studio/safe-zones-overlay.tsx +3 -2
- package/apps/studio/server.ts +8 -10
- package/apps/studio/skip-dirs.ts +103 -47
- package/apps/studio/studio-page-host.ts +70 -0
- package/apps/studio/sync/accepted-cold-start.ts +28 -13
- 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 +86 -0
- package/apps/studio/sync/file-ledger.ts +24 -0
- package/apps/studio/sync/file-membership.ts +28 -3
- package/apps/studio/sync/file-plane.ts +497 -61
- package/apps/studio/sync/file-pull.ts +304 -33
- package/apps/studio/sync/held-deletes.ts +230 -0
- package/apps/studio/sync/hub-link.ts +1 -2
- package/apps/studio/sync/hubs-config.ts +59 -2
- package/apps/studio/sync/index.ts +405 -163
- package/apps/studio/sync/journal-client.ts +94 -5
- package/apps/studio/sync/pending-deletes.ts +100 -0
- package/apps/studio/sync/projection.ts +77 -12
- package/apps/studio/sync/seed-progress.ts +104 -3
- package/apps/studio/sync/settings.ts +36 -1
- package/apps/studio/sync/status.ts +17 -1
- package/apps/studio/sync/writer-registry.ts +5 -0
- package/apps/studio/text-caret.ts +5 -3
- package/apps/studio/thumbs/service.ts +12 -2
- package/apps/studio/thumbs/validate.ts +7 -0
- package/apps/studio/toolbars/toolbar-rect.ts +3 -2
- package/apps/studio/ui-prefs-migrate.ts +4 -0
- 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 +75 -39
- package/apps/studio/video-play-overlay.tsx +4 -3
- package/apps/studio/whats-new.json +99 -0
- package/cli/commands/design.mjs +5 -2
- package/cli/commands/hub.mjs +10 -1
- package/cli/lib/bash-guard.mjs +27 -1
- package/cli/lib/design-help.gen.mjs +1 -1
- package/cli/lib/design-hook.mjs +20 -0
- package/cli/lib/design-link.mjs +42 -17
- package/cli/lib/hub-purge.mjs +183 -0
- package/cli/lib/studio-locate.mjs +35 -10
- package/package.json +8 -8
- package/plugins/design/templates/_shell.html +164 -1
|
@@ -165,12 +165,20 @@ export interface FilePlaneStatus {
|
|
|
165
165
|
| 'reanchor'
|
|
166
166
|
| 'code-held'
|
|
167
167
|
| 'hub-older'
|
|
168
|
-
| 'hub-refused'
|
|
168
|
+
| 'hub-refused'
|
|
169
|
+
/** 2.0.5: files the legacy (v1) pull could not save here; retried later, less often. */
|
|
170
|
+
| 'pull-failed'
|
|
171
|
+
/** fix/207: shared code this Mac holds until the person allows it (Allow shared code…). */
|
|
172
|
+
| 'code-consent';
|
|
169
173
|
count: number;
|
|
170
174
|
paths: string[];
|
|
175
|
+
/** Issue #207 (7b) — `delete-out`: the folders the held deletes sit in, largest first. */
|
|
176
|
+
folders?: { folder: string; count: number }[];
|
|
171
177
|
/** One sentence, in the user's terms, about what is waiting and why. */
|
|
172
178
|
detail: string;
|
|
173
179
|
}[];
|
|
180
|
+
/** Issue #207 (7b) — the owner's purge of held deletes, while it runs (or the reason it stopped). */
|
|
181
|
+
deletePurge?: { total: number; done: number; running: boolean; error?: string };
|
|
174
182
|
/**
|
|
175
183
|
* Files this lane could NOT move on the last pass — issue #109.
|
|
176
184
|
*
|
|
@@ -199,6 +207,14 @@ export interface FilePlaneStatus {
|
|
|
199
207
|
unmeasured: number;
|
|
200
208
|
byClass: Record<string, { files: number; bytes: number }>;
|
|
201
209
|
};
|
|
210
|
+
/**
|
|
211
|
+
* Issue #207 — folders with a long run of pictures still going up (a render sequence). Not a
|
|
212
|
+
* fault: they sync like everything else. Sync details names them and offers "Don't sync this
|
|
213
|
+
* folder". Absent when there are none.
|
|
214
|
+
*/
|
|
215
|
+
largeSequences?: { folder: string; files: number; bytes: number }[];
|
|
216
|
+
/** Issue #207 — the folders this project does not sync (`linkedHub.ignoreFolders`). */
|
|
217
|
+
ignoreFolders?: string[];
|
|
202
218
|
/**
|
|
203
219
|
* The hub asked us to slow down and the WHOLE LANE is paused until `until`.
|
|
204
220
|
*
|
|
@@ -539,6 +539,11 @@ export const WRITER_REGISTRY: Record<string, WriterEntry> = {
|
|
|
539
539
|
// gate-b-sec4 — Connect a committed link this Mac never made: a per-Mac record + a sync restart
|
|
540
540
|
'/_api/sync/link': { class: 'read' },
|
|
541
541
|
'/_api/sync/link/confirm': { class: 'local', rows: 'X16' },
|
|
542
|
+
// fix/207 — this Mac's shared-code consent: a per-Mac answer in the profile's hubs.json
|
|
543
|
+
'/_api/sync/code-consent': { class: 'read' },
|
|
544
|
+
'/_api/sync/code-consent/set': { class: 'local', rows: 'X16' },
|
|
545
|
+
// 2.0.7 #7b — the answer to held local deletes: this Mac's ledger (Keep) or the hub's own doors (Delete)
|
|
546
|
+
'/_api/sync/held-deletes': { class: 'local', rows: 'X16' },
|
|
542
547
|
// S11.17 — Retry lands the canvas writes a full disk held; each then travels like any studio write
|
|
543
548
|
'/_api/diagnostics/disk-retry': { class: 'local' },
|
|
544
549
|
// p8-a1-save-hold — the closing page lands the saves held behind an AI call; each then travels like any studio write
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
* while typing/moving).
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
+
import { frameCafOn, frameRafOn } from './frame-clock.ts';
|
|
29
|
+
|
|
28
30
|
/**
|
|
29
31
|
* Place a collapsed caret inside a contentEditable at a viewport point —
|
|
30
32
|
* `caretRangeFromPoint` (WebKit/Chromium), `caretPositionFromPoint`
|
|
@@ -264,13 +266,13 @@ export function mountCaret(editable: HTMLElement, win: Window): () => void {
|
|
|
264
266
|
let raf = 0;
|
|
265
267
|
const tick = (): void => {
|
|
266
268
|
position();
|
|
267
|
-
raf = win
|
|
269
|
+
raf = frameRafOn(win, tick);
|
|
268
270
|
};
|
|
269
271
|
position();
|
|
270
|
-
raf = win
|
|
272
|
+
raf = frameRafOn(win, tick);
|
|
271
273
|
|
|
272
274
|
return () => {
|
|
273
|
-
win
|
|
275
|
+
frameCafOn(win, raf);
|
|
274
276
|
doc.removeEventListener('selectionchange', onUpdate);
|
|
275
277
|
editable.removeEventListener('input', onUpdate);
|
|
276
278
|
editable.removeEventListener('keyup', onUpdate);
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
versionLaneHashes,
|
|
45
45
|
} from './keys.ts';
|
|
46
46
|
import { hasThumb, pruneThumbs, readThumb, writeThumb } from './store.ts';
|
|
47
|
-
import { checkJpeg, jpegSize } from './validate.ts';
|
|
47
|
+
import { checkJpeg, coverWorthy, jpegSize } from './validate.ts';
|
|
48
48
|
|
|
49
49
|
export type ThumbAt = 'now' | { rev: number } | { sha: string };
|
|
50
50
|
export interface ThumbRequest {
|
|
@@ -517,11 +517,18 @@ export function createThumbService(o: ThumbServiceOptions): ThumbService {
|
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
+
/** A canvas's whole-canvas picture (its Home cover) — what W5's blank / sliver checks are for. */
|
|
521
|
+
const isCover = (job: Job, t: Target): boolean => job.kind === 'canvas' && t.artboard === null;
|
|
522
|
+
|
|
520
523
|
function store(job: Job, t: Target, b64: unknown): boolean {
|
|
521
524
|
if (typeof b64 !== 'string' || b64.length > 2 * 1024 * 1024) return false;
|
|
522
525
|
const bytes = Uint8Array.from(Buffer.from(b64, 'base64'));
|
|
523
526
|
const check = checkJpeg(bytes, t.px);
|
|
524
527
|
if (!check.ok) return false;
|
|
528
|
+
// W5: a cover is shown at ~16:10 on Home — a sliver (a header strip, a 3320 x 200 artboard) or a
|
|
529
|
+
// thumbnail under the floor is not a cover. Not stored; Home keeps its placeholder. A canvas COVER
|
|
530
|
+
// only: an asset tile (also artboard-less) is the picture itself, whatever its shape.
|
|
531
|
+
if (isCover(job, t) && !coverWorthy(check.w, check.h)) return false;
|
|
525
532
|
writeThumb(o.pid, t.key, bytes);
|
|
526
533
|
dims.set(t.key, { w: check.w, h: check.h });
|
|
527
534
|
reference(t.key);
|
|
@@ -626,7 +633,10 @@ export function createThumbService(o: ThumbServiceOptions): ThumbService {
|
|
|
626
633
|
noArtboard.add(t.key);
|
|
627
634
|
continue;
|
|
628
635
|
}
|
|
629
|
-
|
|
636
|
+
// W5: a flat-colour cover (the renderer looked at its pixels) is a miss like any other failure —
|
|
637
|
+
// a canvas cover only; a tile of a flat picture is that picture
|
|
638
|
+
if (!shot || (isCover(job, t) && shot.blank === true) || !store(job, t, shot.jpeg))
|
|
639
|
+
fail(t.key);
|
|
630
640
|
else if (shot.partial === true) partial = true;
|
|
631
641
|
}
|
|
632
642
|
if (partial && !job.retryOfPartial)
|
|
@@ -60,3 +60,10 @@ export function checkJpeg(b: Uint8Array | null | undefined, px: number): JpegChe
|
|
|
60
60
|
if (size.w > px + 1 || size.h > px + 1) return { ok: false, reason: 'too-big' };
|
|
61
61
|
return { ok: true, ...size };
|
|
62
62
|
}
|
|
63
|
+
|
|
64
|
+
/** The smallest side and the longest aspect a stored COVER may have (W5): below 48 px or more than 10 : 1
|
|
65
|
+
* it is a strip of a header, not a picture of the canvas. Applies to cover targets only. */
|
|
66
|
+
export const MIN_COVER_PX = 48;
|
|
67
|
+
export const MAX_COVER_ASPECT = 10;
|
|
68
|
+
export const coverWorthy = (w: number, h: number): boolean =>
|
|
69
|
+
Math.min(w, h) >= MIN_COVER_PX && Math.max(w, h) / Math.min(w, h) <= MAX_COVER_ASPECT;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// Pure (the clock and the post are injected) so the throttle is a unit test, not a timing test.
|
|
9
9
|
|
|
10
10
|
import type { CanvasModeV2 } from '../bridge/canvas-modes.ts';
|
|
11
|
+
import { frameCaf, frameRaf } from '../frame-clock.ts';
|
|
11
12
|
|
|
12
13
|
export interface ToolbarRect {
|
|
13
14
|
x: number;
|
|
@@ -53,12 +54,12 @@ export function createRectPoster(deps: RectPosterDeps): RectPoster {
|
|
|
53
54
|
deps.raf ??
|
|
54
55
|
((fn: () => void) =>
|
|
55
56
|
typeof requestAnimationFrame === 'function'
|
|
56
|
-
?
|
|
57
|
+
? frameRaf(fn)
|
|
57
58
|
: (setTimeout(fn, 16) as unknown as number));
|
|
58
59
|
const caf =
|
|
59
60
|
deps.caf ??
|
|
60
61
|
((id: number) =>
|
|
61
|
-
typeof cancelAnimationFrame === 'function' ?
|
|
62
|
+
typeof cancelAnimationFrame === 'function' ? frameCaf(id) : clearTimeout(id));
|
|
62
63
|
let pending: number | null = null;
|
|
63
64
|
let last = '';
|
|
64
65
|
return {
|
|
@@ -186,6 +186,10 @@ export const KEY_CLASS: Readonly<Record<string, KeyRule>> = {
|
|
|
186
186
|
class: 'v2-new',
|
|
187
187
|
note: 'v2 (S8.5b): Advanced › Where it renders › Video, per Mac; new in v2, nothing to migrate.',
|
|
188
188
|
},
|
|
189
|
+
'maude-acp-caps': {
|
|
190
|
+
class: 'v2-new',
|
|
191
|
+
note: '2.0.5 (client/panels/caps-cache.js, `maude-acp-caps:<project>`): the last AI capability set, a per-Mac UI cache so the Advanced fold draws without starting Claude; never synced, new in v2, nothing to migrate.',
|
|
192
|
+
},
|
|
189
193
|
'maude-ds-upgrade-': {
|
|
190
194
|
class: 'v2-new',
|
|
191
195
|
note: 'Not a storage key: ds/upgrade-stage.ts STAGE_PREFIX names the staged-copy temp dirs; the scanner reads any *_PREFIX const.',
|
|
@@ -44,6 +44,7 @@ import {
|
|
|
44
44
|
strokeRotation,
|
|
45
45
|
} from './annotations-layer.tsx';
|
|
46
46
|
import { getLiveViewport, useViewportControllerContext } from './canvas-lib.tsx';
|
|
47
|
+
import { frameCaf, frameRaf } from './frame-clock.ts';
|
|
47
48
|
import { useAnnotationSelection } from './use-annotation-selection.tsx';
|
|
48
49
|
|
|
49
50
|
const RESIZE_CSS = `
|
|
@@ -691,11 +692,11 @@ export function AnnotationResizeOverlay({ store }: { store: StrokesStoreValue |
|
|
|
691
692
|
handle.style.top = `${Math.round(sy - halfH)}px`;
|
|
692
693
|
handle.dataset.corner = pos.corner;
|
|
693
694
|
}
|
|
694
|
-
rafRef.current =
|
|
695
|
+
rafRef.current = frameRaf(tick);
|
|
695
696
|
};
|
|
696
|
-
rafRef.current =
|
|
697
|
+
rafRef.current = frameRaf(tick);
|
|
697
698
|
return () => {
|
|
698
|
-
if (rafRef.current != null)
|
|
699
|
+
if (rafRef.current != null) frameCaf(rafRef.current);
|
|
699
700
|
};
|
|
700
701
|
}, [selectedStroke, vp]);
|
|
701
702
|
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
useRef,
|
|
36
36
|
useState,
|
|
37
37
|
} from 'react';
|
|
38
|
+
import { frameCaf, frameRaf } from './frame-clock.ts';
|
|
38
39
|
|
|
39
40
|
import { DRAG_THRESHOLD_PX as INPUT_DRAG_THRESHOLD_PX, isPageHit } from './input-router.tsx';
|
|
40
41
|
import type { Selection } from './use-selection-set.tsx';
|
|
@@ -514,7 +515,7 @@ export function useArtboardDrag(opts: UseArtboardDragOptions): UseArtboardDragHa
|
|
|
514
515
|
const frameLoop = useMemo(() => {
|
|
515
516
|
const cancel = () => {
|
|
516
517
|
if (rafRef.current !== null && typeof cancelAnimationFrame === 'function')
|
|
517
|
-
|
|
518
|
+
frameCaf(rafRef.current);
|
|
518
519
|
rafRef.current = null;
|
|
519
520
|
};
|
|
520
521
|
const flush = () => {
|
|
@@ -527,7 +528,7 @@ export function useArtboardDrag(opts: UseArtboardDragOptions): UseArtboardDragHa
|
|
|
527
528
|
const schedule = () => {
|
|
528
529
|
if (rafRef.current !== null) return;
|
|
529
530
|
if (typeof requestAnimationFrame !== 'function') flush();
|
|
530
|
-
else rafRef.current =
|
|
531
|
+
else rafRef.current = frameRaf(flush);
|
|
531
532
|
};
|
|
532
533
|
return { cancel, schedule };
|
|
533
534
|
}, [emit]);
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
import { type ReactNode, useCallback, useEffect, useRef } from 'react';
|
|
30
30
|
import { globalCdOccurrence, resolveSelectionEl } from './dom-selection.ts';
|
|
31
31
|
import { isElementDragActive } from './drag-state.ts';
|
|
32
|
+
import { frameCaf, frameRaf } from './frame-clock.ts';
|
|
32
33
|
import { useSelectionSet } from './use-selection-set.tsx';
|
|
33
34
|
import { useToolMode } from './use-tool-mode.tsx';
|
|
34
35
|
|
|
@@ -451,20 +452,20 @@ export function ElementResizeOverlay(): ReactNode {
|
|
|
451
452
|
// doesn't compound the jank ("hrozně zavaší ten toolbar").
|
|
452
453
|
if (isElementDragActive()) {
|
|
453
454
|
hideAll();
|
|
454
|
-
rafRef.current =
|
|
455
|
+
rafRef.current = frameRaf(tick);
|
|
455
456
|
return;
|
|
456
457
|
}
|
|
457
458
|
const el = resolveSelectionEl(document, one) as HTMLElement | null;
|
|
458
459
|
// Skip inline text runs where width/height are meaningless (no explicit box).
|
|
459
460
|
if (!el) {
|
|
460
461
|
hideAll();
|
|
461
|
-
rafRef.current =
|
|
462
|
+
rafRef.current = frameRaf(tick);
|
|
462
463
|
return;
|
|
463
464
|
}
|
|
464
465
|
const r = el.getBoundingClientRect();
|
|
465
466
|
if (r.width <= 0 && r.height <= 0) {
|
|
466
467
|
hideAll();
|
|
467
|
-
rafRef.current =
|
|
468
|
+
rafRef.current = frameRaf(tick);
|
|
468
469
|
return;
|
|
469
470
|
}
|
|
470
471
|
// Stage D4 — an artboard gets growth-only handles (E/S/SE) and NO rotate
|
|
@@ -554,11 +555,11 @@ export function ElementResizeOverlay(): ReactNode {
|
|
|
554
555
|
readout.style.opacity = '0';
|
|
555
556
|
}
|
|
556
557
|
|
|
557
|
-
rafRef.current =
|
|
558
|
+
rafRef.current = frameRaf(tick);
|
|
558
559
|
};
|
|
559
|
-
rafRef.current =
|
|
560
|
+
rafRef.current = frameRaf(tick);
|
|
560
561
|
return () => {
|
|
561
|
-
if (rafRef.current != null)
|
|
562
|
+
if (rafRef.current != null) frameCaf(rafRef.current);
|
|
562
563
|
};
|
|
563
564
|
}, [active, one, artboardOnly]);
|
|
564
565
|
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
import { type ReactNode, useCallback, useEffect, useRef } from 'react';
|
|
28
28
|
import { globalCdOccurrence, resolveSelectionEl } from './dom-selection.ts';
|
|
29
29
|
import { isElementDragActive } from './drag-state.ts';
|
|
30
|
+
import { frameCaf, frameRaf } from './frame-clock.ts';
|
|
30
31
|
import {
|
|
31
32
|
computeGutterLines,
|
|
32
33
|
computeTrackDrag,
|
|
@@ -150,7 +151,7 @@ export function GridTrackHandlesOverlay(): ReactNode {
|
|
|
150
151
|
const tick = () => {
|
|
151
152
|
rafRef.current = null;
|
|
152
153
|
const reschedule = () => {
|
|
153
|
-
rafRef.current =
|
|
154
|
+
rafRef.current = frameRaf(tick);
|
|
154
155
|
};
|
|
155
156
|
const bail = () => {
|
|
156
157
|
hideAll();
|
|
@@ -226,11 +227,11 @@ export function GridTrackHandlesOverlay(): ReactNode {
|
|
|
226
227
|
i++;
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
|
-
rafRef.current =
|
|
230
|
+
rafRef.current = frameRaf(tick);
|
|
230
231
|
};
|
|
231
|
-
rafRef.current =
|
|
232
|
+
rafRef.current = frameRaf(tick);
|
|
232
233
|
return () => {
|
|
233
|
-
if (rafRef.current != null)
|
|
234
|
+
if (rafRef.current != null) frameCaf(rafRef.current);
|
|
234
235
|
};
|
|
235
236
|
}, [active, one]);
|
|
236
237
|
|
|
@@ -137,6 +137,14 @@ interface SelectionSetValue {
|
|
|
137
137
|
*/
|
|
138
138
|
replaceFromShell: (s: Selection | Selection[]) => boolean;
|
|
139
139
|
addFromShell: (s: Selection | Selection[]) => boolean;
|
|
140
|
+
/** The selection as of the last change — `selected` lags a render (read it in a store listener). */
|
|
141
|
+
peek: () => Selection[];
|
|
142
|
+
/**
|
|
143
|
+
* 2.0.7 (decision `v2-207-pages-stale-selection`) — keep only what `keep` passes (Pages turned away from the
|
|
144
|
+
* artboard the rest was on). Not a pick: a pick from the shell right after still lands; only a replay of exactly
|
|
145
|
+
* what was dropped (a restore rung queued before the shell heard) yields, for RESTORE_YIELD_MS.
|
|
146
|
+
*/
|
|
147
|
+
drop: (keep: (s: Selection) => boolean) => void;
|
|
140
148
|
}
|
|
141
149
|
|
|
142
150
|
const SelectionSetContext = createContext<SelectionSetValue | null>(null);
|
|
@@ -188,6 +196,21 @@ export function yieldsToLocalPick(
|
|
|
188
196
|
return now - localAt < RESTORE_YIELD_MS && !sameKeys(next, current);
|
|
189
197
|
}
|
|
190
198
|
|
|
199
|
+
/**
|
|
200
|
+
* 2.0.7 — a selection the shell sends that only brings back what a page turn just dropped (every item was among the
|
|
201
|
+
* dropped, `RESTORE_YIELD_MS` ago or less) is a restore rung queued before the shell heard → it yields. Anything
|
|
202
|
+
* else — a Layers pick of another layer, of the artboard itself — lands at once.
|
|
203
|
+
*/
|
|
204
|
+
export function replaysDroppedSelection(
|
|
205
|
+
dropped: { at: number; sel: Selection[] },
|
|
206
|
+
incoming: Selection[],
|
|
207
|
+
now = Date.now()
|
|
208
|
+
): boolean {
|
|
209
|
+
if (now - dropped.at >= RESTORE_YIELD_MS || incoming.length === 0) return false;
|
|
210
|
+
const gone = new Set(dropped.sel.map(selectionKey));
|
|
211
|
+
return incoming.every((s) => gone.has(selectionKey(s)));
|
|
212
|
+
}
|
|
213
|
+
|
|
191
214
|
/**
|
|
192
215
|
* S2.1 (S2-edit-ops.md §7) — `editing/selection.tsx` adds `refs` / `crumbs` / `kind` to every
|
|
193
216
|
* `select-set` post. A registry (not an import) so this leaf provider never imports the editing
|
|
@@ -219,6 +242,11 @@ export function SelectionSetProvider({
|
|
|
219
242
|
// the selection as of the last change (state lags a render) and when the canvas itself last changed it
|
|
220
243
|
const currentRef = useRef<Selection[]>([]);
|
|
221
244
|
const localAtRef = useRef(Number.NEGATIVE_INFINITY);
|
|
245
|
+
// what `drop` took away last, and when (a replay of it inside the yield window is a stale restore)
|
|
246
|
+
const droppedRef = useRef<{ at: number; sel: Selection[] }>({
|
|
247
|
+
at: Number.NEGATIVE_INFINITY,
|
|
248
|
+
sel: [],
|
|
249
|
+
});
|
|
222
250
|
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
223
251
|
const pendingPostRef = useRef<(() => void) | null>(null);
|
|
224
252
|
|
|
@@ -275,23 +303,44 @@ export function SelectionSetProvider({
|
|
|
275
303
|
[apply]
|
|
276
304
|
);
|
|
277
305
|
|
|
306
|
+
const replaysDropped = useCallback(
|
|
307
|
+
(incoming: Selection[]) => replaysDroppedSelection(droppedRef.current, incoming),
|
|
308
|
+
[]
|
|
309
|
+
);
|
|
310
|
+
|
|
278
311
|
const replaceFromShell = useCallback(
|
|
279
312
|
(s: Selection | Selection[]) => {
|
|
280
313
|
const next = dedupe(Array.isArray(s) ? s : [s]);
|
|
281
314
|
if (yieldsToLocalPick(localAtRef.current, currentRef.current, next)) return false;
|
|
315
|
+
if (replaysDropped(next)) return false;
|
|
282
316
|
apply(next);
|
|
283
317
|
return true;
|
|
284
318
|
},
|
|
285
|
-
[apply]
|
|
319
|
+
[apply, replaysDropped]
|
|
286
320
|
);
|
|
287
321
|
|
|
288
322
|
const addFromShell = useCallback(
|
|
289
323
|
(s: Selection | Selection[]) => {
|
|
290
|
-
const
|
|
324
|
+
const incoming = Array.isArray(s) ? s : [s];
|
|
325
|
+
const next = dedupe([...currentRef.current, ...incoming]);
|
|
291
326
|
if (yieldsToLocalPick(localAtRef.current, currentRef.current, next)) return false;
|
|
327
|
+
if (replaysDropped(incoming)) return false;
|
|
292
328
|
apply(next);
|
|
293
329
|
return true;
|
|
294
330
|
},
|
|
331
|
+
[apply, replaysDropped]
|
|
332
|
+
);
|
|
333
|
+
|
|
334
|
+
const peek = useCallback(() => currentRef.current, []);
|
|
335
|
+
|
|
336
|
+
const drop = useCallback(
|
|
337
|
+
(keep: (s: Selection) => boolean) => {
|
|
338
|
+
const cur = currentRef.current;
|
|
339
|
+
const next = cur.filter(keep);
|
|
340
|
+
if (next.length === cur.length) return;
|
|
341
|
+
droppedRef.current = { at: Date.now(), sel: cur.filter((s) => !keep(s)) };
|
|
342
|
+
apply(next);
|
|
343
|
+
},
|
|
295
344
|
[apply]
|
|
296
345
|
);
|
|
297
346
|
|
|
@@ -345,8 +394,19 @@ export function SelectionSetProvider({
|
|
|
345
394
|
}, [apply]);
|
|
346
395
|
|
|
347
396
|
const value = useMemo<SelectionSetValue>(
|
|
348
|
-
() => ({
|
|
349
|
-
|
|
397
|
+
() => ({
|
|
398
|
+
selected,
|
|
399
|
+
replace,
|
|
400
|
+
add,
|
|
401
|
+
remove,
|
|
402
|
+
toggle,
|
|
403
|
+
clear,
|
|
404
|
+
replaceFromShell,
|
|
405
|
+
addFromShell,
|
|
406
|
+
peek,
|
|
407
|
+
drop,
|
|
408
|
+
}),
|
|
409
|
+
[selected, replace, add, remove, toggle, clear, replaceFromShell, addFromShell, peek, drop]
|
|
350
410
|
);
|
|
351
411
|
|
|
352
412
|
return <SelectionSetContext.Provider value={value}>{children}</SelectionSetContext.Provider>;
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
spaceTokenFor,
|
|
29
29
|
tokenRuler,
|
|
30
30
|
} from './editing/token-ruler.tsx';
|
|
31
|
+
import { frameCaf, frameRaf } from './frame-clock.ts';
|
|
31
32
|
import {
|
|
32
33
|
computeGapDrag,
|
|
33
34
|
computeGapMidpoints,
|
|
@@ -179,19 +180,19 @@ export function SpacingHandlesOverlay(): ReactNode {
|
|
|
179
180
|
// irrelevant mid-drag anyway — the drag has its own live-preview chrome).
|
|
180
181
|
if (isElementDragActive()) {
|
|
181
182
|
hideAll();
|
|
182
|
-
rafRef.current =
|
|
183
|
+
rafRef.current = frameRaf(tick);
|
|
183
184
|
return;
|
|
184
185
|
}
|
|
185
186
|
const el = resolveSelectionEl(document, one) as HTMLElement | null;
|
|
186
187
|
if (!el) {
|
|
187
188
|
hideAll();
|
|
188
|
-
rafRef.current =
|
|
189
|
+
rafRef.current = frameRaf(tick);
|
|
189
190
|
return;
|
|
190
191
|
}
|
|
191
192
|
const r = el.getBoundingClientRect();
|
|
192
193
|
if (r.width <= 0 && r.height <= 0) {
|
|
193
194
|
hideAll();
|
|
194
|
-
rafRef.current =
|
|
195
|
+
rafRef.current = frameRaf(tick);
|
|
195
196
|
return;
|
|
196
197
|
}
|
|
197
198
|
const cs = getComputedStyle(el);
|
|
@@ -249,11 +250,11 @@ export function SpacingHandlesOverlay(): ReactNode {
|
|
|
249
250
|
h.style.top = `${Math.round(pt.y)}px`;
|
|
250
251
|
i++;
|
|
251
252
|
}
|
|
252
|
-
rafRef.current =
|
|
253
|
+
rafRef.current = frameRaf(tick);
|
|
253
254
|
};
|
|
254
|
-
rafRef.current =
|
|
255
|
+
rafRef.current = frameRaf(tick);
|
|
255
256
|
return () => {
|
|
256
|
-
if (rafRef.current != null)
|
|
257
|
+
if (rafRef.current != null) frameCaf(rafRef.current);
|
|
257
258
|
};
|
|
258
259
|
}, [active, one]);
|
|
259
260
|
|
|
@@ -29,8 +29,10 @@ import {
|
|
|
29
29
|
useState,
|
|
30
30
|
useSyncExternalStore,
|
|
31
31
|
} from 'react';
|
|
32
|
+
import { useArtboardActive, useArtboardMedia } from './artboard-live-gate.tsx';
|
|
32
33
|
import { canvasModeStore } from './bridge/canvas-mode-store.ts';
|
|
33
34
|
import { videoLabelTail } from './editing/video-label.ts';
|
|
35
|
+
import { frameRaf } from './frame-clock.ts';
|
|
34
36
|
import { resolvedPoster } from './kinds/meta.ts';
|
|
35
37
|
import { VideoPlayChrome } from './video-play-chrome.tsx';
|
|
36
38
|
|
|
@@ -277,7 +279,7 @@ function clamp(n: number, lo: number, hi: number): number {
|
|
|
277
279
|
function afterPaint(): Promise<void> {
|
|
278
280
|
if (typeof requestAnimationFrame !== 'function') return Promise.resolve();
|
|
279
281
|
return new Promise((resolve) => {
|
|
280
|
-
|
|
282
|
+
frameRaf(() => frameRaf(() => resolve()));
|
|
281
283
|
});
|
|
282
284
|
}
|
|
283
285
|
|
|
@@ -581,6 +583,33 @@ export function VideoComp({
|
|
|
581
583
|
? 0
|
|
582
584
|
: clamp(liveTimelineFrame.get(compId) ?? posterFrame, 0, maxFrame);
|
|
583
585
|
|
|
586
|
+
// 2.0.5 — a comp in a sleeping artboard (offscreen, or the canvas zoomed out to its overview) stops
|
|
587
|
+
// decoding: pause it, and play it again on wake only if WE paused it. Never in a capture (always live).
|
|
588
|
+
const live = useArtboardActive();
|
|
589
|
+
// 2.0.7 — a video artboard is mounted wherever it is, so this comp registers (the link glyph, the Timeline's
|
|
590
|
+
// shared count and Present's format switch read the registry). Its Player — and so its <video preload="auto">,
|
|
591
|
+
// which fetches the whole file and decodes a frame — mounts only while the artboard is in the mount ring
|
|
592
|
+
// (`useArtboardMedia`), as the artboard itself did before. A capture always has it.
|
|
593
|
+
const media = useArtboardMedia() || capturing;
|
|
594
|
+
const pausedAsleep = useRef(false);
|
|
595
|
+
useEffect(() => {
|
|
596
|
+
const p = ref.current;
|
|
597
|
+
if (!media || !p) return; // far: no Player yet
|
|
598
|
+
try {
|
|
599
|
+
if (!live) {
|
|
600
|
+
if (p.isPlaying()) {
|
|
601
|
+
p.pause();
|
|
602
|
+
pausedAsleep.current = true;
|
|
603
|
+
}
|
|
604
|
+
} else if (pausedAsleep.current) {
|
|
605
|
+
pausedAsleep.current = false;
|
|
606
|
+
p.play();
|
|
607
|
+
}
|
|
608
|
+
} catch {
|
|
609
|
+
/* Player transitional — the next change settles it */
|
|
610
|
+
}
|
|
611
|
+
}, [live, media]);
|
|
612
|
+
|
|
584
613
|
// Register with the seek bridge for the lifetime of this mount.
|
|
585
614
|
useEffect(() => {
|
|
586
615
|
installMaudeSeekBridge();
|
|
@@ -673,7 +702,7 @@ export function VideoComp({
|
|
|
673
702
|
// iframe → shell: mirror the playhead so the Timeline panel tracks preview.
|
|
674
703
|
useEffect(() => {
|
|
675
704
|
const p = ref.current;
|
|
676
|
-
if (!p) return;
|
|
705
|
+
if (!media || !p) return;
|
|
677
706
|
const onFrame = () => {
|
|
678
707
|
try {
|
|
679
708
|
const f = p.getCurrentFrame();
|
|
@@ -692,14 +721,14 @@ export function VideoComp({
|
|
|
692
721
|
/* ignore */
|
|
693
722
|
}
|
|
694
723
|
};
|
|
695
|
-
}, [compId]);
|
|
724
|
+
}, [compId, media]);
|
|
696
725
|
|
|
697
726
|
// S7.8 — the poster moved (set from the timeline, or by a peer): a video nobody has played or scrubbed
|
|
698
727
|
// rests on the new picture; one whose playhead was moved keeps its place. The poster is keyed by the
|
|
699
728
|
// enclosing artboard's id (the `<VideoComp id>` when it matches), so it is looked up once mounted too.
|
|
700
729
|
const resting = useRef<number | null>(null);
|
|
701
730
|
useEffect(() => {
|
|
702
|
-
if (typeof document === 'undefined' || capturing) return undefined;
|
|
731
|
+
if (typeof document === 'undefined' || capturing || !media) return undefined;
|
|
703
732
|
const rest = () => {
|
|
704
733
|
const p = ref.current;
|
|
705
734
|
if (!p) return;
|
|
@@ -726,13 +755,13 @@ export function VideoComp({
|
|
|
726
755
|
rest();
|
|
727
756
|
document.addEventListener('maude:meta-refreshed', rest);
|
|
728
757
|
return () => document.removeEventListener('maude:meta-refreshed', rest);
|
|
729
|
-
}, [compId, durationInFrames, capturing]);
|
|
758
|
+
}, [compId, durationInFrames, capturing, media]);
|
|
730
759
|
|
|
731
760
|
// S7.8 — the Player is the truth about playing: tell the shell on every play / pause, so a click on the
|
|
732
761
|
// artboard's own button and the Timeline's Space or button can never disagree.
|
|
733
762
|
useEffect(() => {
|
|
734
763
|
const p = ref.current;
|
|
735
|
-
if (!p || capturing) return undefined;
|
|
764
|
+
if (!media || !p || capturing) return undefined;
|
|
736
765
|
const tell = (playing: boolean) => () =>
|
|
737
766
|
postToShell({ dgn: 'timeline-playing', id: compId, playing });
|
|
738
767
|
const onPlay = tell(true);
|
|
@@ -747,7 +776,7 @@ export function VideoComp({
|
|
|
747
776
|
/* unmounted */
|
|
748
777
|
}
|
|
749
778
|
};
|
|
750
|
-
}, [compId, capturing]);
|
|
779
|
+
}, [compId, capturing, media]);
|
|
751
780
|
|
|
752
781
|
// iframe → shell: with loop off (now the default), the Player stops itself
|
|
753
782
|
// at the last frame — nothing else tells the Timeline panel's Play/Pause
|
|
@@ -756,7 +785,7 @@ export function VideoComp({
|
|
|
756
785
|
// artboard-loop-defaults-on).
|
|
757
786
|
useEffect(() => {
|
|
758
787
|
const p = ref.current;
|
|
759
|
-
if (!p) return;
|
|
788
|
+
if (!media || !p) return;
|
|
760
789
|
const onEnded = () => postToShell({ dgn: 'timeline-ended', id: compId });
|
|
761
790
|
p.addEventListener('ended', onEnded);
|
|
762
791
|
return () => {
|
|
@@ -766,7 +795,7 @@ export function VideoComp({
|
|
|
766
795
|
/* ignore */
|
|
767
796
|
}
|
|
768
797
|
};
|
|
769
|
-
}, [compId]);
|
|
798
|
+
}, [compId, media]);
|
|
770
799
|
|
|
771
800
|
const style = useMemo(() => ({ width: '100%', height: '100%', display: 'block' as const }), []);
|
|
772
801
|
|
|
@@ -777,36 +806,43 @@ export function VideoComp({
|
|
|
777
806
|
data-comp-id={compId}
|
|
778
807
|
style={{ width, height, maxWidth: '100%', position: 'relative' }}
|
|
779
808
|
>
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
809
|
+
{media ? (
|
|
810
|
+
<>
|
|
811
|
+
<Player
|
|
812
|
+
ref={ref}
|
|
813
|
+
component={component}
|
|
814
|
+
durationInFrames={Math.max(1, Math.round(durationInFrames))}
|
|
815
|
+
fps={fps}
|
|
816
|
+
compositionWidth={width}
|
|
817
|
+
compositionHeight={height}
|
|
818
|
+
inputProps={inputProps ?? {}}
|
|
819
|
+
controls={showControls}
|
|
820
|
+
loop={loopFor(loopState, presenting)}
|
|
821
|
+
autoPlay={play}
|
|
822
|
+
initialFrame={initialFrame}
|
|
823
|
+
// Clicking the artboard must NOT toggle playback — it selects elements
|
|
824
|
+
// for editing (the whole point of a canvas). Play only via the explicit
|
|
825
|
+
// transport button (Player controls / Timeline panel). Same for the
|
|
826
|
+
// spacebar, which is the canvas pan chord. (DDR-148 feedback #2.)
|
|
827
|
+
clickToPlay={false}
|
|
828
|
+
spaceKeyToPlayOrPause={false}
|
|
829
|
+
doubleClickToFullscreen={false}
|
|
830
|
+
// We ship Remotion in-house and disclose the license (DDR-148); ack in
|
|
831
|
+
// code so the Player never nags/watermarks the preview.
|
|
832
|
+
acknowledgeRemotionLicense
|
|
833
|
+
style={style}
|
|
834
|
+
/>
|
|
835
|
+
{capturing || presenting ? null : (
|
|
836
|
+
<VideoPlayChrome
|
|
837
|
+
playerRef={ref}
|
|
838
|
+
fps={fps}
|
|
839
|
+
durationInFrames={Math.max(1, Math.round(durationInFrames))}
|
|
840
|
+
/>
|
|
841
|
+
)}
|
|
842
|
+
</>
|
|
843
|
+
) : (
|
|
844
|
+
// far from the viewport: same size, nothing fetched, nothing decoded
|
|
845
|
+
<div data-dc-video-resting="" aria-hidden="true" style={style} />
|
|
810
846
|
)}
|
|
811
847
|
</div>
|
|
812
848
|
);
|