@1agh/maude 2.0.2 → 2.0.4
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/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 +5 -0
- package/apps/studio/actions/defs/view.ts +12 -0
- package/apps/studio/actions.manifest.json +13 -1
- package/apps/studio/actions.parity.json +7 -1
- package/apps/studio/api.ts +31 -24
- package/apps/studio/asset-placeholder.tsx +157 -62
- package/apps/studio/bin/_png-playwright.mjs +10 -1
- package/apps/studio/bin/_pw-launch.mjs +14 -0
- package/apps/studio/bin/_thumbs-playwright.mjs +4 -1
- package/apps/studio/boot-progress.ts +31 -0
- package/apps/studio/bridge/dgn-protocol.ts +34 -4
- 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-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 +22 -9
- package/apps/studio/client/github.js +23 -3
- package/apps/studio/client/home/home-api.js +30 -19
- package/apps/studio/client/hooks/use-git-actions.jsx +2 -1
- 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 +22 -37
- 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/chat-finish.js +66 -0
- package/apps/studio/client/shell/frame-cap.js +53 -0
- package/apps/studio/client/shell/viewport.jsx +9 -0
- package/apps/studio/client/styles/_index.css +2 -0
- package/apps/studio/client/tree/tree.jsx +48 -21
- package/apps/studio/client/v2/ai/BackgroundStrip.jsx +120 -0
- 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 +176 -8
- 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/missing-frame.jsx +8 -4
- 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-waiting-card.jsx +128 -0
- package/apps/studio/client/v2/code/canvas-waiting.js +164 -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 +5 -2
- package/apps/studio/client/v2/ds/make-host.jsx +5 -2
- package/apps/studio/client/v2/ds/off-system-host.jsx +5 -2
- package/apps/studio/client/v2/ds/truth-host.jsx +5 -2
- 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/export/native-save.js +44 -0
- package/apps/studio/client/v2/history/git-model.js +18 -4
- package/apps/studio/client/v2/history/git-parts.jsx +60 -42
- 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/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/menu-runner.js +1 -0
- package/apps/studio/client/v2/shell/occlusion-insets.js +14 -2
- 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 +2 -1
- package/apps/studio/client/v2/shell/shell-activity.js +19 -0
- 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/dist/client.bundle.js +798 -801
- package/apps/studio/dist/comment-mount.js +2 -2
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/ds-assets.ts +138 -48
- 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/home/hub.ts +77 -175
- package/apps/studio/home/routes.ts +47 -8
- package/apps/studio/http.ts +117 -66
- 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/asset-state.ts +12 -0
- package/apps/studio/routes/canvas-source.ts +44 -2
- package/apps/studio/routes/ds-assets.ts +8 -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 +3 -0
- package/apps/studio/server.ts +11 -0
- package/apps/studio/sync/accepted-cold-start.ts +26 -3
- package/apps/studio/sync/accepted-link.ts +9 -4
- package/apps/studio/sync/asset-push.ts +8 -1
- package/apps/studio/sync/asset-state.ts +27 -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-plane.ts +479 -84
- package/apps/studio/sync/hub-browser-signin.ts +377 -0
- package/apps/studio/sync/hub-text-undo.ts +30 -10
- package/apps/studio/sync/index.ts +73 -11
- package/apps/studio/sync/lfs-pointer.ts +137 -0
- package/apps/studio/sync/projection.ts +44 -2
- 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 +47 -3
- 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/video-links-overlay.tsx +3 -2
- package/apps/studio/whats-new.json +63 -0
- package/cli/lib/design-help.gen.mjs +1 -1
- package/cli/lib/workspace-plan.mjs +14 -0
- package/package.json +8 -8
|
@@ -14,10 +14,23 @@
|
|
|
14
14
|
// heard (origin + source gate). The canvas's string is only ever MATCHED against this lane's own
|
|
15
15
|
// answer for that canvas (S8.19c): a rel the studio did not say is missing is dropped, so a canvas
|
|
16
16
|
// cannot make the shell open a relink for a path of its choosing. `onRelink` gets the studio's rel.
|
|
17
|
+
//
|
|
18
|
+
// 2.0.3 — a Git LFS placeholder (`lfs-pointer`: the file is here, but it is a pointer, the project was
|
|
19
|
+
// cloned without `git lfs pull`). Where the AI chat exists (`lfsActions`, the desktop app) the frame
|
|
20
|
+
// offers "Fix with AI" (`asset-lfs-fix-request`) and "Copy prompt" (`asset-lfs-copy-request`). Same
|
|
21
|
+
// gate as Relink: the active canvas only, and only a rel this lane's own answer calls `lfs-pointer`.
|
|
22
|
+
// The prompt is built HERE from that answer (`lfsRepairPrompt`), never from canvas text. Fix with AI
|
|
23
|
+
// pre-fills the AI chat (the error card's "Ask AI" path, never sent); Copy prompt writes the clipboard
|
|
24
|
+
// here (the canvas iframe has no clipboard rights) and answers the frame `asset-lfs-copied {rel, ok}`
|
|
25
|
+
// so its button can say "Copied".
|
|
17
26
|
|
|
18
27
|
import { useEffect, useRef, useSyncExternalStore } from 'react';
|
|
19
28
|
import { acceptFromCanvas } from '../../../bridge/dgn-protocol.ts';
|
|
20
29
|
import { INDEX_CHANGED_EVENT } from '../canvases/use-canvas-index.js';
|
|
30
|
+
import { nativeSave } from '../export/native-save.js';
|
|
31
|
+
import { dispatchCanvasOp } from '../left-panel/left-panel-bus.js';
|
|
32
|
+
import { ASK_AI_MAX } from '../search/search-env.js';
|
|
33
|
+
import { fetchIfServed } from '../shell/served-routes.js';
|
|
21
34
|
|
|
22
35
|
/** canvas file → (rel → item): what the studio last said about each canvas. The relink gate and the
|
|
23
36
|
* Inspector's absent-picture box read it; nothing else does. */
|
|
@@ -78,6 +91,96 @@ export function useAssetAnswers() {
|
|
|
78
91
|
return useSyncExternalStore(subscribeAssetAnswers, assetAnswersVersion, assetAnswersVersion);
|
|
79
92
|
}
|
|
80
93
|
|
|
94
|
+
/** The prompt lists at most this many paths, then "and N more". */
|
|
95
|
+
export const LFS_PROMPT_MAX_PATHS = 50;
|
|
96
|
+
const LFS_SPEC = 'version https://git-lfs.github.com/spec/v1';
|
|
97
|
+
|
|
98
|
+
/** `2026-11-04` in local time (the backup folder's name). */
|
|
99
|
+
function dayStamp(d) {
|
|
100
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
101
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The repair prompt for a canvas's Git LFS placeholders. Built from the STUDIO's answer only: `items`
|
|
106
|
+
* are this lane's own items for the canvas; anything not `lfs-pointer` is ignored. Pure.
|
|
107
|
+
*
|
|
108
|
+
* It fits `maxChars` (default ASK_AI_MAX): Fix with AI pre-fills the chat through `sendToAskAI`, which
|
|
109
|
+
* keeps only that many chars, so a long path list would push the steps off the end. Paths are listed
|
|
110
|
+
* while they fit (at most LFS_PROMPT_MAX_PATHS); the rest are "…and N more", with how to find them.
|
|
111
|
+
*
|
|
112
|
+
* The restore goes through `git lfs` only (2.0.3 e2e): the design plugin's Bash guard refuses a `cp`
|
|
113
|
+
* into the design root and Write cannot put binary bytes back, so a prompt that said "copy the object
|
|
114
|
+
* over the placeholder" stopped after the backup. `git lfs checkout` restores a local object offline.
|
|
115
|
+
*
|
|
116
|
+
* @param {{ items: Iterable<any>, designRel?: string, date?: Date, maxChars?: number }} o
|
|
117
|
+
*/
|
|
118
|
+
export function lfsRepairPrompt({
|
|
119
|
+
items,
|
|
120
|
+
designRel = '.design',
|
|
121
|
+
date = new Date(),
|
|
122
|
+
maxChars = ASK_AI_MAX,
|
|
123
|
+
}) {
|
|
124
|
+
const root = String(designRel || '')
|
|
125
|
+
.replace(/^\/+|\/+$/g, '')
|
|
126
|
+
.replace(/^\.\/?$/, '');
|
|
127
|
+
const inRoot = (rel) => (root ? `${root}/${rel}` : rel);
|
|
128
|
+
const ptrs = [];
|
|
129
|
+
for (const it of items) {
|
|
130
|
+
// a path is shown in backticks: one with a backtick or a line break is not listed
|
|
131
|
+
if (it?.state === 'lfs-pointer' && typeof it.rel === 'string' && !/[`\r\n]/.test(it.rel))
|
|
132
|
+
ptrs.push(it);
|
|
133
|
+
}
|
|
134
|
+
const backup = inRoot(`_trash/lfs-pointers-${dayStamp(date)}`);
|
|
135
|
+
const lineOf = (it) =>
|
|
136
|
+
`- \`${inRoot(it.rel)}\`${it.localObject ? ' (its object is already in .git/lfs/objects)' : ''}`;
|
|
137
|
+
const moreLine = (n) =>
|
|
138
|
+
`- …and ${n} more. Find the rest: every file of at most 1 KB under \`${root || '.'}/\` whose first line is exactly \`${LFS_SPEC}\`.`;
|
|
139
|
+
const head = [
|
|
140
|
+
'Some pictures and videos in this project are Git LFS placeholders: small text files that stand where the real media should be (the project was cloned without `git lfs pull`). Please put the real files back.',
|
|
141
|
+
'',
|
|
142
|
+
'The placeholder files, from the project root:',
|
|
143
|
+
];
|
|
144
|
+
const steps = [
|
|
145
|
+
'',
|
|
146
|
+
'Do this, step by step:',
|
|
147
|
+
`1. Back up the placeholder files first. Copy each one, keeping its path, into \`${backup}/\` (for example \`${inRoot('assets/a.png')}\` goes to \`${backup}/assets/a.png\`). That folder is ignored by git and never syncs.`,
|
|
148
|
+
'2. Restore them with Git LFS. Check it is installed with `git lfs version`; if it is not, say so (it installs with `brew install git-lfs`, then `git lfs install`) and stop. A file whose object is already in `.git/lfs/objects/<oid[0:2]>/<oid[2:4]>/<oid>` (the `oid sha256:<oid>` line of its pointer) comes back with `git lfs checkout <its path>`, with no network. For the ones left, run `git lfs pull --include "<their paths, comma-separated>"`; if that fails, say why. Do not copy or write the media files any other way.',
|
|
149
|
+
'3. Check each restored file: its sha256 must equal the oid, and its size must equal the `size <n>` line of its pointer. If one does not match, write its placeholder text back from the backup and tell me which file.',
|
|
150
|
+
'4. Do not commit anything, and do not change any other file.',
|
|
151
|
+
'5. Leave the restored files where they are. Maude uploads them by itself; there is nothing else to do.',
|
|
152
|
+
];
|
|
153
|
+
// +1 per line for the joining '\n'
|
|
154
|
+
const len = (lines) => lines.reduce((n, l) => n + l.length + 1, -1);
|
|
155
|
+
const fixed = len([...head, ...steps]) + 1;
|
|
156
|
+
const lines = [];
|
|
157
|
+
let used = fixed;
|
|
158
|
+
for (const it of ptrs.slice(0, LFS_PROMPT_MAX_PATHS)) {
|
|
159
|
+
const line = lineOf(it);
|
|
160
|
+
const rest = ptrs.length - lines.length - 1;
|
|
161
|
+
// room for this line, and for the "…and N more" line if any are left after it
|
|
162
|
+
const need = line.length + 1 + (rest > 0 ? moreLine(rest).length + 1 : 0);
|
|
163
|
+
if (used + need > maxChars) break;
|
|
164
|
+
lines.push(line);
|
|
165
|
+
used += line.length + 1;
|
|
166
|
+
}
|
|
167
|
+
const more = ptrs.length - lines.length;
|
|
168
|
+
if (more > 0) lines.push(moreLine(more));
|
|
169
|
+
return [...head, ...lines, ...steps].join('\n');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Copy `text` from the shell; false when it was refused. The click was inside the canvas iframe, so the shell
|
|
174
|
+
* has no user activation: `navigator.clipboard` is tried briefly, then the desktop's `clipboard_write_text`.
|
|
175
|
+
*/
|
|
176
|
+
async function shellCopyText(text) {
|
|
177
|
+
try {
|
|
178
|
+
return (await nativeSave().copyText(String(text))).ok === true;
|
|
179
|
+
} catch {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
81
184
|
const FRAME = 'iframe[data-testid="canvas-frame"]';
|
|
82
185
|
export const ASSET_STATE_POLL_MS = 60_000;
|
|
83
186
|
/** While something of this Mac's is still going up, ask again soon: the bar moves and goes away when the last byte lands. */
|
|
@@ -94,6 +197,11 @@ const pathOf = (frame) => frame?.getAttribute?.('data-path') || frame?.dataset?.
|
|
|
94
197
|
* @param {() => Window | null} [deps.activeWindow] — the active canvas window (relink gate)
|
|
95
198
|
* @param {() => string} deps.canvasOrigin
|
|
96
199
|
* @param {(rel: string, canvas: string) => void} [deps.onRelink]
|
|
200
|
+
* @param {() => boolean} [deps.lfsActions] — this shell can repair an LFS placeholder (the AI chat exists)
|
|
201
|
+
* @param {() => string} [deps.designRel] — the design root, project-relative (the prompt's paths)
|
|
202
|
+
* @param {(prompt: string, canvas: string) => void} [deps.onLfsFix] — open the AI chat, pre-filled
|
|
203
|
+
* @param {(text: string) => Promise<boolean>} [deps.copyText]
|
|
204
|
+
* @param {() => Date} [deps.now]
|
|
97
205
|
* @param {Window} [deps.win]
|
|
98
206
|
* @param {(fn: () => void, ms: number) => unknown} [deps.setTimer]
|
|
99
207
|
* @param {(t: unknown) => void} [deps.clearTimer]
|
|
@@ -105,6 +213,8 @@ export function createAssetStateLane(deps) {
|
|
|
105
213
|
const win = deps.win ?? globalThis.window;
|
|
106
214
|
const setTimer = deps.setTimer ?? ((fn, ms) => setTimeout(fn, ms));
|
|
107
215
|
const clearTimer = deps.clearTimer ?? ((t) => clearTimeout(t));
|
|
216
|
+
const lfsActions = () => deps.lfsActions?.() === true;
|
|
217
|
+
const copyText = deps.copyText ?? shellCopyText;
|
|
108
218
|
/** Window → the JSON last said to it; `waiting` → whether it needs the 60 s poll. */
|
|
109
219
|
const spoken = new WeakMap();
|
|
110
220
|
const waiting = new Set();
|
|
@@ -115,9 +225,11 @@ export function createAssetStateLane(deps) {
|
|
|
115
225
|
async function ask(canvas) {
|
|
116
226
|
let res;
|
|
117
227
|
try {
|
|
118
|
-
res = await
|
|
119
|
-
|
|
120
|
-
|
|
228
|
+
res = await fetchIfServed(
|
|
229
|
+
`/_api/asset-state?canvas=${encodeURIComponent(canvas)}`,
|
|
230
|
+
{ headers: { accept: 'application/json' } },
|
|
231
|
+
fetchImpl
|
|
232
|
+
);
|
|
121
233
|
} catch {
|
|
122
234
|
return null;
|
|
123
235
|
}
|
|
@@ -143,14 +255,19 @@ export function createAssetStateLane(deps) {
|
|
|
143
255
|
if (items.some((it) => it?.state === 'uploading')) uploading.add(canvas);
|
|
144
256
|
else uploading.delete(canvas);
|
|
145
257
|
arm();
|
|
146
|
-
|
|
258
|
+
// The buttons are offered only where the AI chat exists, and only when there is a placeholder.
|
|
259
|
+
const offer = lfsActions() && items.some((it) => it?.state === 'lfs-pointer');
|
|
260
|
+
const json = JSON.stringify(offer ? [items, true] : items);
|
|
147
261
|
const before = spoken.get(target);
|
|
148
262
|
if (!force && before === json) return;
|
|
149
263
|
if (before === undefined && items.length === 0) return;
|
|
150
264
|
spoken.set(target, json);
|
|
151
265
|
try {
|
|
152
266
|
// A literal `{ dgn }` (not postToCanvas) so the bridge inventory sees this send site.
|
|
153
|
-
target.postMessage(
|
|
267
|
+
target.postMessage(
|
|
268
|
+
offer ? { dgn: 'asset-state', items, lfsActions: true } : { dgn: 'asset-state', items },
|
|
269
|
+
deps.canvasOrigin() || '*'
|
|
270
|
+
);
|
|
154
271
|
} catch {
|
|
155
272
|
/* detached */
|
|
156
273
|
}
|
|
@@ -182,6 +299,10 @@ export function createAssetStateLane(deps) {
|
|
|
182
299
|
}
|
|
183
300
|
return;
|
|
184
301
|
}
|
|
302
|
+
if (dgn === 'asset-lfs-fix-request' || dgn === 'asset-lfs-copy-request') {
|
|
303
|
+
void onLfsRequest(e);
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
185
306
|
if (dgn !== 'asset-relink-request') return;
|
|
186
307
|
const m = acceptFromCanvas(e, {
|
|
187
308
|
canvasOrigin: deps.canvasOrigin(),
|
|
@@ -195,6 +316,39 @@ export function createAssetStateLane(deps) {
|
|
|
195
316
|
const item = assetItemsFor(canvas).get(m.rel);
|
|
196
317
|
if (item?.state === 'missing') deps.onRelink?.(item.rel, canvas);
|
|
197
318
|
};
|
|
319
|
+
// 2.0.3 — Fix with AI / Copy prompt. The canvas names a rel; everything else is this lane's.
|
|
320
|
+
async function onLfsRequest(e) {
|
|
321
|
+
if (!lfsActions()) return;
|
|
322
|
+
const m = acceptFromCanvas(e, {
|
|
323
|
+
canvasOrigin: deps.canvasOrigin(),
|
|
324
|
+
active: deps.activeWindow?.() ?? null,
|
|
325
|
+
});
|
|
326
|
+
if (!m || (m.dgn !== 'asset-lfs-fix-request' && m.dgn !== 'asset-lfs-copy-request')) return;
|
|
327
|
+
const frame = frames().find((f) => f.contentWindow === e.source);
|
|
328
|
+
const canvas = pathOf(frame);
|
|
329
|
+
const mine = assetItemsFor(canvas);
|
|
330
|
+
const item = mine.get(m.rel);
|
|
331
|
+
if (!canvas || item?.state !== 'lfs-pointer') return;
|
|
332
|
+
const prompt = lfsRepairPrompt({
|
|
333
|
+
items: mine.values(),
|
|
334
|
+
designRel: deps.designRel?.() ?? '.design',
|
|
335
|
+
date: deps.now?.() ?? new Date(),
|
|
336
|
+
});
|
|
337
|
+
if (m.dgn === 'asset-lfs-fix-request') {
|
|
338
|
+
deps.onLfsFix?.(prompt, canvas);
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const ok = await copyText(prompt);
|
|
342
|
+
try {
|
|
343
|
+
// A literal `{ dgn }` so the bridge inventory sees this send site.
|
|
344
|
+
frame.contentWindow.postMessage(
|
|
345
|
+
{ dgn: 'asset-lfs-copied', rel: item.rel, ok: ok === true },
|
|
346
|
+
deps.canvasOrigin() || '*'
|
|
347
|
+
);
|
|
348
|
+
} catch {
|
|
349
|
+
/* detached */
|
|
350
|
+
}
|
|
351
|
+
}
|
|
198
352
|
win?.addEventListener?.('message', onMessage);
|
|
199
353
|
// S8.14 — photos just placed from Finder reach the canvas file before their bytes reach the hub: when the index moves (the
|
|
200
354
|
// placement is one), ask again shortly, so the new pictures hear `uploading` and wear a bar. One quiet read per burst.
|
|
@@ -238,7 +392,9 @@ export function assetStateTriggers(prev, next) {
|
|
|
238
392
|
|
|
239
393
|
/**
|
|
240
394
|
* Mount once in the shell. `syncStatus` / `wsConnected` are the app's live values; `onRelink` opens
|
|
241
|
-
* the relink sheet for (rel, canvas).
|
|
395
|
+
* the relink sheet for (rel, canvas). `askAiAvailable` is the shell's answer the canvas error card
|
|
396
|
+
* uses (the desktop app's AI chat, not read-only): it alone turns on the LFS placeholder's buttons,
|
|
397
|
+
* and "Fix with AI" goes the error card's way — `ask-ai-fix` opens the chat with the prompt, unsent.
|
|
242
398
|
*/
|
|
243
399
|
export function useAssetStateLane({
|
|
244
400
|
syncStatus,
|
|
@@ -246,18 +402,30 @@ export function useAssetStateLane({
|
|
|
246
402
|
canvasOrigin,
|
|
247
403
|
activeWindow,
|
|
248
404
|
onRelink,
|
|
405
|
+
askAiAvailable = false,
|
|
406
|
+
designRel = '.design',
|
|
249
407
|
}) {
|
|
250
408
|
const lane = useRef(null);
|
|
251
|
-
const live = useRef({ canvasOrigin, activeWindow, onRelink });
|
|
252
|
-
live.current = { canvasOrigin, activeWindow, onRelink };
|
|
409
|
+
const live = useRef({ canvasOrigin, activeWindow, onRelink, askAiAvailable, designRel });
|
|
410
|
+
live.current = { canvasOrigin, activeWindow, onRelink, askAiAvailable, designRel };
|
|
253
411
|
useEffect(() => {
|
|
254
412
|
lane.current = createAssetStateLane({
|
|
255
413
|
canvasOrigin: () => live.current.canvasOrigin?.() ?? '',
|
|
256
414
|
activeWindow: () => live.current.activeWindow?.() ?? null,
|
|
257
415
|
onRelink: (rel, canvas) => live.current.onRelink?.(rel, canvas),
|
|
416
|
+
lfsActions: () => live.current.askAiAvailable === true,
|
|
417
|
+
designRel: () => live.current.designRel || '.design',
|
|
418
|
+
onLfsFix: (prompt, canvas) => dispatchCanvasOp('ask-ai-fix', canvas, prompt),
|
|
258
419
|
});
|
|
259
420
|
return () => lane.current?.stop();
|
|
260
421
|
}, []);
|
|
422
|
+
// The answer can arrive after the first tell (config loads late): say it again with the buttons.
|
|
423
|
+
const askedAi = useRef(askAiAvailable);
|
|
424
|
+
useEffect(() => {
|
|
425
|
+
if (askedAi.current === askAiAvailable) return;
|
|
426
|
+
askedAi.current = askAiAvailable;
|
|
427
|
+
void lane.current?.refresh();
|
|
428
|
+
}, [askAiAvailable]);
|
|
261
429
|
const prev = useRef(null);
|
|
262
430
|
useEffect(() => {
|
|
263
431
|
const next = { syncStatus, wsConnected };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// client/v2/assets/assets-bus.js — how the registry reaches the mounted Assets tab (S8.12).
|
|
2
2
|
//
|
|
3
|
-
// `assets.place` (↵)
|
|
3
|
+
// `assets.place` (↵), `assets.details` (⌘I) and `assets.spotlight` (Space) are shell actions whose state lives in the panel: which tile is picked,
|
|
4
4
|
// where the selected artboard is. The shell's one key listener and the menu runner call `runAssetsAction(id)`; the
|
|
5
5
|
// panel binds itself here while it is mounted and runs the SAME functions its tile menu runs, so a key, the menu and the
|
|
6
6
|
// right-click row are one code path.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// is picked AND keyboard focus is inside the tab. A tile still picked while focus moved to the canvas or a toolbar
|
|
10
10
|
// button must leave ↵ to whatever has focus.
|
|
11
11
|
|
|
12
|
-
/** @type {{ place: () => void, details: () => void, trash: () => void, generate?: () => void, addLink?: () => void, describe?: () => void, describeStop?: () => void, tileSelected: () => boolean } | null} */
|
|
12
|
+
/** @type {{ place: () => void, details: () => void, spotlight?: () => void, trash: () => void, generate?: () => void, addLink?: () => void, describe?: () => void, describeStop?: () => void, tileSelected: () => boolean } | null} */
|
|
13
13
|
let bound = null;
|
|
14
14
|
|
|
15
15
|
/** The panel binds itself on mount. @returns the unbind. */
|
|
@@ -60,7 +60,7 @@ export function takeAddLinkRequest() {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* Run `assets.place` / `assets.details` / `assets.trash` on the picked tile, or `assets.generate` (the ask).
|
|
63
|
+
* Run `assets.place` / `assets.details` / `assets.spotlight` / `assets.trash` on the picked tile, or `assets.generate` (the ask).
|
|
64
64
|
* @returns whether a mounted panel took it. `assets.generate` with no panel mounted is held for the next mount.
|
|
65
65
|
*/
|
|
66
66
|
export function runAssetsAction(id) {
|
|
@@ -98,11 +98,13 @@ export function runAssetsAction(id) {
|
|
|
98
98
|
? bound?.place
|
|
99
99
|
: id === 'assets.details'
|
|
100
100
|
? bound?.details
|
|
101
|
-
: id === 'assets.
|
|
102
|
-
? bound?.
|
|
103
|
-
: id === 'assets.
|
|
104
|
-
? bound?.
|
|
105
|
-
:
|
|
101
|
+
: id === 'assets.spotlight'
|
|
102
|
+
? bound?.spotlight
|
|
103
|
+
: id === 'assets.trash'
|
|
104
|
+
? bound?.trash
|
|
105
|
+
: id === 'assets.rename'
|
|
106
|
+
? bound?.rename
|
|
107
|
+
: null;
|
|
106
108
|
if (!fn) return false;
|
|
107
109
|
fn();
|
|
108
110
|
return true;
|
|
@@ -41,6 +41,7 @@ export function BrowseView({
|
|
|
41
41
|
onChange,
|
|
42
42
|
onPick,
|
|
43
43
|
onMenu,
|
|
44
|
+
onOpen = undefined,
|
|
44
45
|
onBack,
|
|
45
46
|
onClear,
|
|
46
47
|
onPlace,
|
|
@@ -152,6 +153,7 @@ export function BrowseView({
|
|
|
152
153
|
pickCircle
|
|
153
154
|
onPick={(path, e, isMenu) => onPick(ids, path, e, isMenu)}
|
|
154
155
|
onMenu={onMenu}
|
|
156
|
+
onOpen={onOpen}
|
|
155
157
|
/>
|
|
156
158
|
))}
|
|
157
159
|
</div>
|
|
@@ -10,6 +10,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
10
10
|
import { StIcon } from '../../shell/icons.jsx';
|
|
11
11
|
import { crumbsOf, filesWords, useDsLibrary } from './ds-library.js';
|
|
12
12
|
import { placeAsset, SELECT_ARTBOARD_LINE } from './place-asset.js';
|
|
13
|
+
import { AssetSpotlight } from './spotlight.jsx';
|
|
13
14
|
import { AssetTile } from './tile.jsx';
|
|
14
15
|
|
|
15
16
|
/** "Placed the photo in Fotky ze zápasu." — the design system keeps the picture; nothing is copied. */
|
|
@@ -37,6 +38,8 @@ export function DsLibraryView({
|
|
|
37
38
|
const [query, setQuery] = useState('');
|
|
38
39
|
const [picked, setPicked] = useState(null);
|
|
39
40
|
const [err, setErr] = useState('');
|
|
41
|
+
// 2.0.4 (#191) — the tile open large: the path showing; ← → walk the files listed now, in order
|
|
42
|
+
const [spot, setSpot] = useState(null);
|
|
40
43
|
const rootRef = useRef(null);
|
|
41
44
|
const sentinel = useRef(null);
|
|
42
45
|
const alive = useRef(true);
|
|
@@ -96,8 +99,30 @@ export function DsLibraryView({
|
|
|
96
99
|
[readOnly, rows, placeTarget, placeLabel, onRecord, toast]
|
|
97
100
|
);
|
|
98
101
|
|
|
102
|
+
const spotIndex = spot ? rows.findIndex((r) => r.path === spot) : -1;
|
|
103
|
+
const focusTile = (path) => {
|
|
104
|
+
const tile = Array.from(rootRef.current?.querySelectorAll?.('[data-asset]') ?? []).find(
|
|
105
|
+
(el) => el.dataset.asset === path
|
|
106
|
+
);
|
|
107
|
+
tile?.focus?.({ preventScroll: true });
|
|
108
|
+
};
|
|
109
|
+
const closeSpotlight = () => {
|
|
110
|
+
if (spot) focusTile(spot);
|
|
111
|
+
setSpot(null);
|
|
112
|
+
};
|
|
113
|
+
const openSpotlight = (path) => {
|
|
114
|
+
if (byPath.has(path)) setSpot(path);
|
|
115
|
+
};
|
|
116
|
+
// the same rows the tile has in this view: Place, for a file that can be one
|
|
117
|
+
const spotAsset = spotIndex >= 0 ? rows[spotIndex] : null;
|
|
118
|
+
const spotRows =
|
|
119
|
+
spotAsset && !readOnly && spotAsset.placeable && ['image', 'video'].includes(spotAsset.kind)
|
|
120
|
+
? [{ id: 'place', label: placeLabel ? `Place in ${placeLabel}` : 'Place', keys: '↵' }]
|
|
121
|
+
: [];
|
|
122
|
+
|
|
99
123
|
if (apiRef)
|
|
100
124
|
apiRef.current = {
|
|
125
|
+
spotlight: () => (picked ? openSpotlight(picked) : undefined),
|
|
101
126
|
place: () => (picked ? place(picked) : undefined),
|
|
102
127
|
tileSelected: () => !!picked && !!rootRef.current?.contains(document.activeElement),
|
|
103
128
|
};
|
|
@@ -212,6 +237,7 @@ export function DsLibraryView({
|
|
|
212
237
|
setPicked(p);
|
|
213
238
|
setErr('');
|
|
214
239
|
}}
|
|
240
|
+
onOpen={openSpotlight}
|
|
215
241
|
onMenu={() => {}}
|
|
216
242
|
/>
|
|
217
243
|
))}
|
|
@@ -258,6 +284,27 @@ export function DsLibraryView({
|
|
|
258
284
|
{byPath.get(picked)?.name}
|
|
259
285
|
</p>
|
|
260
286
|
) : null}
|
|
287
|
+
{spotAsset ? (
|
|
288
|
+
<AssetSpotlight
|
|
289
|
+
items={rows}
|
|
290
|
+
index={spotIndex}
|
|
291
|
+
urlOf={(p) => p}
|
|
292
|
+
rows={spotRows}
|
|
293
|
+
onIndex={(i) => {
|
|
294
|
+
const a = rows[i];
|
|
295
|
+
if (!a) return;
|
|
296
|
+
setSpot(a.path);
|
|
297
|
+
setPicked(a.path);
|
|
298
|
+
setErr('');
|
|
299
|
+
}}
|
|
300
|
+
onClose={closeSpotlight}
|
|
301
|
+
onRow={(id) => {
|
|
302
|
+
const path = spot;
|
|
303
|
+
setSpot(null);
|
|
304
|
+
if (id === 'place' && path) void place(path);
|
|
305
|
+
}}
|
|
306
|
+
/>
|
|
307
|
+
) : null}
|
|
261
308
|
</div>
|
|
262
309
|
);
|
|
263
310
|
}
|
|
@@ -54,17 +54,21 @@ export function AssetAbsentBox({ el, canvas, onReplace }) {
|
|
|
54
54
|
const words = item ? frameWords(item) : null;
|
|
55
55
|
if (!item || !words) return null;
|
|
56
56
|
const missing = words.state === 'missing';
|
|
57
|
+
// 2.0.3 — a Git LFS placeholder: the file IS here, so Relink… has nothing to point at.
|
|
58
|
+
const lfs = words.state === 'lfs-pointer';
|
|
57
59
|
return (
|
|
58
60
|
<div className="asset-absent" data-testid="asset-absent-box" data-state={words.state}>
|
|
59
61
|
<p className="asset-absent-t">
|
|
60
62
|
<strong data-testid="asset-absent-word">{missing ? 'Missing' : words.line}</strong>
|
|
61
63
|
</p>
|
|
62
64
|
<p className="asset-absent-d">
|
|
63
|
-
{
|
|
64
|
-
? '
|
|
65
|
-
:
|
|
65
|
+
{lfs
|
|
66
|
+
? 'The file here is a Git LFS placeholder, not the picture. Run git lfs pull, or use Fix with AI on the picture.'
|
|
67
|
+
: missing
|
|
68
|
+
? 'No device has this file now. The rest of the design is safe.'
|
|
69
|
+
: 'Not synced yet. Your design is safe — the picture fills in by itself.'}
|
|
66
70
|
</p>
|
|
67
|
-
{canEdit ? (
|
|
71
|
+
{canEdit && !lfs ? (
|
|
68
72
|
<p className="asset-absent-a">
|
|
69
73
|
{missing ? null : <span>Have it here?</span>}
|
|
70
74
|
<button
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// client/v2/assets/spotlight-model.js — the pure half of the asset spotlight (2.0.4, issue #191).
|
|
2
|
+
//
|
|
3
|
+
// A double-click on an Assets tile opens its picture, clip or sound large. Which tiles ← → walks, what the window says
|
|
4
|
+
// about the file and which rows it offers are decided here; the window itself is spotlight.jsx.
|
|
5
|
+
|
|
6
|
+
import { GROUP_CAP } from './library-foot.js';
|
|
7
|
+
import { sizeWords } from './tile.jsx';
|
|
8
|
+
|
|
9
|
+
/** The words the window uses (CONTRACT §3/§4: what happened · what is safe · one verb). */
|
|
10
|
+
export const SPOTLIGHT_WORDS = {
|
|
11
|
+
close: 'Close',
|
|
12
|
+
previous: 'Previous',
|
|
13
|
+
next: 'Next',
|
|
14
|
+
/** why an arrow is off at the ends (dead-controls: a disabled control says why) */
|
|
15
|
+
atFirst: 'This is the first file.',
|
|
16
|
+
atLast: 'This is the last file.',
|
|
17
|
+
noPreview: 'This file has no preview.',
|
|
18
|
+
failed: 'This picture could not be shown.',
|
|
19
|
+
/** "3 of 12" — a screen reader hears it as the position. */
|
|
20
|
+
position: (i, n) => `${i + 1} of ${n}`,
|
|
21
|
+
/** the dialog's name for a screen reader when the file has none */
|
|
22
|
+
fallbackName: 'Asset',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @returns {'image' | 'video' | 'audio' | 'file'} how the window draws it */
|
|
26
|
+
export function previewKind(asset) {
|
|
27
|
+
const k = asset?.kind;
|
|
28
|
+
return k === 'image' || k === 'video' || k === 'audio' ? k : 'file';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Step `delta` along a list of `n`: stops at the ends (the arrows disable there), never wraps. */
|
|
32
|
+
export function stepIndex(index, delta, n) {
|
|
33
|
+
if (!(n > 0)) return -1;
|
|
34
|
+
const to = index + delta;
|
|
35
|
+
return to < 0 || to >= n ? index : to;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The file's own folder + name, with no leading slash ("assets/9f2a.jpg"; a design-system file is "…/system/club/…"). */
|
|
39
|
+
export function pathWords(asset) {
|
|
40
|
+
return String(asset?.rel || asset?.path || '').replace(/^\/+/, '');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** One line under the picture: its size ("2.3 MB"), or nothing when the studio did not say. */
|
|
44
|
+
export function sizeLine(asset) {
|
|
45
|
+
return Number(asset?.size) > 0 ? sizeWords(asset.size) : '';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The rows the tile already offers (tile-menu.jsx `tileMenuItems`) that fit a window over the picture. Move to trash is
|
|
50
|
+
* left in the menu: a bigger look is not the place to remove a file.
|
|
51
|
+
*/
|
|
52
|
+
export function spotlightRows(menuItems) {
|
|
53
|
+
return (menuItems || []).filter((it) => !it.separator && it.id !== 'trash');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Which tiles of a group the narrow tab draws: all of them for Just added, Generated and a search, the first `GROUP_CAP`
|
|
58
|
+
* for a plain Photos / Video / Sound group — unless the Not used view lists everything to tidy.
|
|
59
|
+
*/
|
|
60
|
+
export function groupShown(group, { uncapped = false } = {}) {
|
|
61
|
+
if (group.kind === 'added' || group.kind === 'generated' || group.kind === 'found' || uncapped)
|
|
62
|
+
return group.items;
|
|
63
|
+
return group.items.slice(0, GROUP_CAP);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** The paths ← → walks in the narrow tab, in the order the tab draws them (the "Seen in the picture" group first). */
|
|
67
|
+
export function narrowOrder(groups, seen, { uncapped = false } = {}) {
|
|
68
|
+
const out = [];
|
|
69
|
+
const take = (p) => {
|
|
70
|
+
if (!out.includes(p)) out.push(p);
|
|
71
|
+
};
|
|
72
|
+
for (const s of seen || []) take(s.asset.path);
|
|
73
|
+
for (const g of groups || []) for (const a of groupShown(g, { uncapped })) take(a.path);
|
|
74
|
+
return out;
|
|
75
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/* client/v2/assets/spotlight.css — 2.0.4 (issue #191): an Assets tile, large (spotlight.jsx). Tokens only.
|
|
2
|
+
* Sits above the app like the shared dialogs (.gi-modal, z 9600): a scrim, then one window with the picture fitted to it. */
|
|
3
|
+
|
|
4
|
+
@layer shell {
|
|
5
|
+
.v2-spot {
|
|
6
|
+
position: fixed;
|
|
7
|
+
inset: 0;
|
|
8
|
+
z-index: 9600;
|
|
9
|
+
display: grid;
|
|
10
|
+
place-items: center;
|
|
11
|
+
padding: var(--space-5);
|
|
12
|
+
}
|
|
13
|
+
.v2-spot-scrim {
|
|
14
|
+
position: fixed;
|
|
15
|
+
inset: 0;
|
|
16
|
+
background: color-mix(in oklab, var(--bg-0) 78%, transparent);
|
|
17
|
+
}
|
|
18
|
+
.v2-spot-dialog {
|
|
19
|
+
position: relative;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
width: min(1100px, 100%);
|
|
23
|
+
height: min(820px, 100%);
|
|
24
|
+
min-height: 0;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
background: var(--bg-2);
|
|
27
|
+
border-radius: var(--radius-xl);
|
|
28
|
+
box-shadow:
|
|
29
|
+
var(--shadow-lg),
|
|
30
|
+
inset 0 0 0 0.5px var(--island-edge);
|
|
31
|
+
animation: v2-spot-in var(--dur-route) var(--ease-out);
|
|
32
|
+
}
|
|
33
|
+
.v2-spot-dialog:focus {
|
|
34
|
+
outline: none;
|
|
35
|
+
}
|
|
36
|
+
@keyframes v2-spot-in {
|
|
37
|
+
from {
|
|
38
|
+
opacity: 0;
|
|
39
|
+
scale: 0.98;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
.v2-spot-head {
|
|
43
|
+
flex: none;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: var(--space-2);
|
|
47
|
+
padding: var(--space-2) var(--space-3);
|
|
48
|
+
}
|
|
49
|
+
.v2-spot-title {
|
|
50
|
+
flex: 1;
|
|
51
|
+
min-width: 0;
|
|
52
|
+
margin: 0;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
text-overflow: ellipsis;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
font-size: var(--type-md);
|
|
57
|
+
font-weight: var(--w-medium);
|
|
58
|
+
color: var(--fg-0);
|
|
59
|
+
}
|
|
60
|
+
.v2-spot-pos {
|
|
61
|
+
flex: none;
|
|
62
|
+
font-size: var(--type-xs);
|
|
63
|
+
color: var(--fg-2);
|
|
64
|
+
}
|
|
65
|
+
.v2-spot-stage {
|
|
66
|
+
flex: 1;
|
|
67
|
+
min-height: 0;
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
gap: var(--space-2);
|
|
72
|
+
padding: 0 var(--space-3);
|
|
73
|
+
background: var(--bg-1);
|
|
74
|
+
}
|
|
75
|
+
.v2-spot-img,
|
|
76
|
+
.v2-spot-video {
|
|
77
|
+
flex: 0 1 auto;
|
|
78
|
+
min-width: 0;
|
|
79
|
+
min-height: 0;
|
|
80
|
+
max-width: 100%;
|
|
81
|
+
max-height: 100%;
|
|
82
|
+
object-fit: contain;
|
|
83
|
+
border-radius: var(--radius-sm);
|
|
84
|
+
}
|
|
85
|
+
.v2-spot-sound,
|
|
86
|
+
.v2-spot-file {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
align-items: center;
|
|
90
|
+
gap: var(--space-2);
|
|
91
|
+
max-width: 100%;
|
|
92
|
+
color: var(--fg-1);
|
|
93
|
+
text-align: center;
|
|
94
|
+
}
|
|
95
|
+
.v2-spot-file-n {
|
|
96
|
+
margin: 0;
|
|
97
|
+
max-width: 100%;
|
|
98
|
+
overflow-wrap: anywhere;
|
|
99
|
+
font-size: var(--type-md);
|
|
100
|
+
font-weight: var(--w-medium);
|
|
101
|
+
color: var(--fg-0);
|
|
102
|
+
}
|
|
103
|
+
.v2-spot-file-s {
|
|
104
|
+
margin: 0;
|
|
105
|
+
font-size: var(--type-sm);
|
|
106
|
+
color: var(--fg-2);
|
|
107
|
+
}
|
|
108
|
+
.v2-spot-nav {
|
|
109
|
+
flex: none;
|
|
110
|
+
}
|
|
111
|
+
.v2-spot-nav--prev svg {
|
|
112
|
+
rotate: 180deg;
|
|
113
|
+
}
|
|
114
|
+
.v2-spot-nav:disabled {
|
|
115
|
+
opacity: 0.35;
|
|
116
|
+
}
|
|
117
|
+
.v2-spot-foot {
|
|
118
|
+
flex: none;
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
flex-wrap: wrap;
|
|
122
|
+
gap: var(--space-2) var(--space-3);
|
|
123
|
+
padding: var(--space-2) var(--space-3);
|
|
124
|
+
}
|
|
125
|
+
.v2-spot-meta {
|
|
126
|
+
flex: 1;
|
|
127
|
+
min-width: 0;
|
|
128
|
+
margin: 0;
|
|
129
|
+
display: flex;
|
|
130
|
+
gap: var(--space-2);
|
|
131
|
+
font-size: var(--type-xs);
|
|
132
|
+
color: var(--fg-2);
|
|
133
|
+
}
|
|
134
|
+
.v2-spot-path {
|
|
135
|
+
min-width: 0;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
text-overflow: ellipsis;
|
|
138
|
+
white-space: nowrap;
|
|
139
|
+
}
|
|
140
|
+
.v2-spot-size {
|
|
141
|
+
flex: none;
|
|
142
|
+
}
|
|
143
|
+
.v2-spot-rows {
|
|
144
|
+
display: inline-flex;
|
|
145
|
+
gap: var(--space-2);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@media (prefers-reduced-motion: reduce) {
|
|
150
|
+
.v2-spot-dialog {
|
|
151
|
+
animation-duration: 1ms;
|
|
152
|
+
}
|
|
153
|
+
}
|