@mgamadeus/ddd-design-studio 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,16 @@
1
1
  'use client';
2
2
  import {
3
+ BoardComments,
3
4
  CODE_PARAM,
4
5
  FRAME_GAP,
5
6
  FRAME_LABEL_HEIGHT,
7
+ ViewportToolbar,
8
+ WidthDragHandle,
6
9
  boardCanvasSize,
7
10
  boardCodeOf,
8
11
  buildBoardCodeLink,
9
12
  buildBoardDeepLink,
13
+ buildCommentThreads,
10
14
  buildDesignReference,
11
15
  buildThemeReference,
12
16
  copyTextToClipboard,
@@ -19,21 +23,21 @@ import {
19
23
  isResponsiveBoard,
20
24
  normalizeBoardCode,
21
25
  pageHeightAtWidth,
22
- rotateViewport,
23
26
  splitThemeReference,
27
+ useCheckedContentUrl,
24
28
  useDesignStudio,
25
29
  useDesignStudioComponents,
26
30
  useDesignStudioTexts,
27
- viewportLabel,
31
+ useImageRetry,
28
32
  viewportOfComment,
29
- viewportOfDevice,
30
- viewportWithWidth
31
- } from "../chunk-D2DS4FPR.js";
33
+ viewportWithWidth,
34
+ wasContentUrlLoaded
35
+ } from "../chunk-NCMXGWLC.js";
32
36
 
33
37
  // src/canvas/DesignStudioCanvasScreen.tsx
34
- import { normalizeDddError as normalizeDddError3 } from "@mgamadeus/ddd-web/api";
38
+ import { normalizeDddError as normalizeDddError2 } from "@mgamadeus/ddd-web/api";
35
39
  import {
36
- ClipboardCopy as ClipboardCopy4,
40
+ ClipboardCopy as ClipboardCopy3,
37
41
  ImageDown,
38
42
  Link2,
39
43
  ListFilter,
@@ -48,397 +52,27 @@ import {
48
52
  RefreshCw,
49
53
  Sun,
50
54
  FoldVertical,
55
+ Globe,
51
56
  UnfoldVertical
52
57
  } from "lucide-react";
53
- import { useCallback as useCallback2, useEffect as useEffect6, useMemo as useMemo2, useRef as useRef4, useState as useState9 } from "react";
54
-
55
- // src/canvas/BoardComments.tsx
56
- import { normalizeDddError } from "@mgamadeus/ddd-web/api";
57
- import { Bot, CheckCircle2, ClipboardCopy, Flag, History, Hourglass, MapPin, RotateCcw, Trash2 } from "lucide-react";
58
- import { useState } from "react";
59
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
60
- var buildCommentThreads = (comments) => {
61
- const repliesByRootId = /* @__PURE__ */ new Map();
62
- for (const comment of comments) {
63
- if (comment.parentDesignStudioCommentId != null) {
64
- const replies = repliesByRootId.get(comment.parentDesignStudioCommentId) ?? [];
65
- replies.push(comment);
66
- repliesByRootId.set(comment.parentDesignStudioCommentId, replies);
67
- }
68
- }
69
- let pinNumber = 0;
70
- return comments.filter((comment) => comment.parentDesignStudioCommentId == null).map((root) => ({
71
- root,
72
- replies: repliesByRootId.get(Number(root.id)) ?? [],
73
- pinNumber: root.x != null && root.y != null ? ++pinNumber : null
74
- }));
75
- };
76
- var errorMessage = (error) => normalizeDddError(error, "Request failed").message;
77
- var CommentLine = ({ comment, isOwn, writesAllowed }) => {
78
- const { api, components, formatDateTime, notify } = useDesignStudio();
79
- const { Button } = components;
80
- const [deleteComment, { isLoading: isDeleting }] = api.useDeleteCommentMutation();
81
- return /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
82
- /* @__PURE__ */ jsxs("p", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
83
- comment.authorKind === "AGENT" && /* @__PURE__ */ jsx(Bot, { className: "size-3.5 text-brand-emphasis", "aria-label": "Agent" }),
84
- /* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground", children: comment.authorName ?? "Unknown" }),
85
- /* @__PURE__ */ jsxs("span", { children: [
86
- "\xB7 ",
87
- formatDateTime(comment.changeHistory?.createdTime)
88
- ] }),
89
- isOwn && /* @__PURE__ */ jsx(
90
- Button,
91
- {
92
- variant: "ghost",
93
- size: "icon-sm",
94
- className: "ml-auto size-6",
95
- "aria-label": "Delete comment",
96
- disabled: !writesAllowed || isDeleting,
97
- onClick: () => deleteComment({ designStudioCommentId: Number(comment.id) }).unwrap().catch((error) => notify.error(errorMessage(error))),
98
- children: /* @__PURE__ */ jsx(Trash2, { className: "size-3.5" })
99
- }
100
- )
101
- ] }),
102
- /* @__PURE__ */ jsx("p", { className: "text-sm whitespace-pre-wrap break-words", children: comment.text })
103
- ] });
104
- };
105
- var ThreadCard = ({
106
- thread,
107
- onCopyReference,
108
- isHighlighted,
109
- onHighlight,
110
- authAccountId,
111
- writesAllowed,
112
- hasBoardChangedSince,
113
- isExpiring,
114
- onSelectViewport
115
- }) => {
116
- const { root, replies, pinNumber } = thread;
117
- const rootViewport = viewportOfComment(root);
118
- const [replyText, setReplyText] = useState("");
119
- const { api, components, notify } = useDesignStudio();
120
- const { Badge, Button, Textarea } = components;
121
- const [createReply, { isLoading: isReplying }] = api.useReplyToCommentMutation();
122
- const [resolveThread, { isLoading: isResolving }] = api.useResolveCommentMutation();
123
- const [reopenThread, { isLoading: isReopening }] = api.useReopenCommentMutation();
124
- const [patchComment, { isLoading: isPatching }] = api.usePatchCommentMutation();
125
- const [keepThread, { isLoading: isKeeping }] = api.useKeepCommentMutation();
126
- const designStudioCommentId = Number(root.id);
127
- const sendReply = async () => {
128
- try {
129
- await createReply({
130
- designStudioCommentId,
131
- body: { text: replyText }
132
- }).unwrap();
133
- setReplyText("");
134
- } catch (error) {
135
- notify.error(errorMessage(error));
136
- }
137
- };
138
- return (
139
- // biome-ignore lint/a11y/useSemanticElements: an article that highlights its pin on hover / focus, not a control
140
- /* @__PURE__ */ jsxs(
141
- "article",
142
- {
143
- className: cx(
144
- "space-y-3 rounded-2xl bg-card p-4 shadow-surface-raised ring-1 ring-foreground/5",
145
- root.isResolved && "opacity-70",
146
- isHighlighted && "ring-2 ring-brand"
147
- ),
148
- onMouseEnter: onHighlight,
149
- onFocus: onHighlight,
150
- role: "group",
151
- "aria-label": `Comment thread${pinNumber ? ` ${pinNumber}` : ""}`,
152
- children: [
153
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
154
- pinNumber !== null ? /* @__PURE__ */ jsxs(Badge, { className: "bg-primary text-primary-foreground", children: [
155
- /* @__PURE__ */ jsx(MapPin, { "aria-hidden": true }),
156
- " ",
157
- pinNumber
158
- ] }) : /* @__PURE__ */ jsx(Badge, { variant: "outline", children: "Board" }),
159
- rootViewport && /* @__PURE__ */ jsxs(
160
- "button",
161
- {
162
- type: "button",
163
- className: "rounded-full bg-tint px-2 py-0.5 text-xs font-medium text-muted-foreground tabular-nums hover:bg-tint-strong hover:text-foreground disabled:cursor-default",
164
- title: "Pinned in this viewport: show the board in it",
165
- disabled: !onSelectViewport,
166
- onClick: () => onSelectViewport?.(rootViewport),
167
- children: [
168
- rootViewport.width,
169
- " \xD7 ",
170
- rootViewport.height,
171
- rootViewport.deviceKey ? ` \xB7 ${rootViewport.deviceKey}` : ""
172
- ]
173
- }
174
- ),
175
- root.isDecision && /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "border-transparent bg-success/15 text-success", children: [
176
- /* @__PURE__ */ jsx(Flag, { "aria-hidden": true }),
177
- " Decision"
178
- ] }),
179
- root.isResolved && /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "border-transparent bg-tint text-muted-foreground", children: [
180
- "Resolved",
181
- root.resolvedByName ? ` by ${root.resolvedByName}` : ""
182
- ] }),
183
- hasBoardChangedSince && /* @__PURE__ */ jsxs(
184
- Badge,
185
- {
186
- variant: "outline",
187
- className: "border-transparent bg-warning/15 text-warning",
188
- title: "The board file is another version than the one this thread was written on",
189
- children: [
190
- /* @__PURE__ */ jsx(History, { "aria-hidden": true }),
191
- " Board changed since"
192
- ]
193
- }
194
- ),
195
- isExpiring && /* @__PURE__ */ jsxs(
196
- Badge,
197
- {
198
- variant: "outline",
199
- className: "border-transparent bg-tint text-muted-foreground",
200
- title: "Idle threads are deleted; \u201CKeep\u201D or any reply postpones that",
201
- children: [
202
- /* @__PURE__ */ jsx(Hourglass, { "aria-hidden": true }),
203
- " Expires soon"
204
- ]
205
- }
206
- )
207
- ] }),
208
- /* @__PURE__ */ jsx(CommentLine, { comment: root, isOwn: authAccountId !== null && root.authorAccountId === authAccountId, writesAllowed }),
209
- replies.map((reply) => /* @__PURE__ */ jsx("div", { className: "border-l-2 border-border pl-3", children: /* @__PURE__ */ jsx(
210
- CommentLine,
211
- {
212
- comment: reply,
213
- isOwn: authAccountId !== null && reply.authorAccountId === authAccountId,
214
- writesAllowed
215
- }
216
- ) }, String(reply.id))),
217
- /* @__PURE__ */ jsx(
218
- Textarea,
219
- {
220
- value: replyText,
221
- onChange: (event) => setReplyText(event.target.value),
222
- placeholder: "Reply\u2026",
223
- rows: 2,
224
- "aria-label": "Reply",
225
- disabled: !writesAllowed
226
- }
227
- ),
228
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
229
- /* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", disabled: !writesAllowed || !replyText.trim() || isReplying, onClick: sendReply, children: "Reply" }),
230
- /* @__PURE__ */ jsxs(
231
- Button,
232
- {
233
- size: "sm",
234
- variant: "outline",
235
- disabled: !writesAllowed || isPatching,
236
- "aria-pressed": Boolean(root.isDecision),
237
- onClick: () => patchComment({
238
- designStudioCommentId,
239
- body: { isDecision: !root.isDecision }
240
- }).unwrap().catch((error) => notify.error(errorMessage(error))),
241
- children: [
242
- /* @__PURE__ */ jsx(Flag, {}),
243
- " ",
244
- root.isDecision ? "Not a decision" : "Decision"
245
- ]
246
- }
247
- ),
248
- /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "outline", onClick: () => onCopyReference(thread), "aria-label": "Copy for agent", children: [
249
- /* @__PURE__ */ jsx(ClipboardCopy, {}),
250
- " Copy for agent"
251
- ] }),
252
- isExpiring && /* @__PURE__ */ jsx(
253
- Button,
254
- {
255
- size: "sm",
256
- variant: "outline",
257
- disabled: !writesAllowed || isKeeping,
258
- onClick: () => keepThread({ designStudioCommentId }).unwrap().catch((error) => notify.error(errorMessage(error))),
259
- children: "Keep"
260
- }
261
- ),
262
- root.isResolved ? /* @__PURE__ */ jsxs(
263
- Button,
264
- {
265
- size: "sm",
266
- variant: "outline",
267
- className: "ml-auto",
268
- disabled: !writesAllowed || isReopening,
269
- onClick: () => reopenThread({ designStudioCommentId }).unwrap().catch((error) => notify.error(errorMessage(error))),
270
- children: [
271
- /* @__PURE__ */ jsx(RotateCcw, {}),
272
- " Reopen"
273
- ]
274
- }
275
- ) : /* @__PURE__ */ jsxs(
276
- Button,
277
- {
278
- size: "sm",
279
- variant: "outline",
280
- className: "ml-auto",
281
- disabled: !writesAllowed || isResolving,
282
- onClick: async () => {
283
- try {
284
- await resolveThread({
285
- designStudioCommentId,
286
- body: { replyText: replyText.trim() ? replyText : null }
287
- }).unwrap();
288
- setReplyText("");
289
- } catch (error) {
290
- notify.error(errorMessage(error));
291
- }
292
- },
293
- children: [
294
- /* @__PURE__ */ jsx(CheckCircle2, {}),
295
- " Resolve"
296
- ]
297
- }
298
- )
299
- ] })
300
- ]
301
- }
302
- )
303
- );
304
- };
305
- var BoardComments = ({
306
- projectKey,
307
- canvasKey,
308
- board,
309
- threads,
310
- pendingPin,
311
- onClearPendingPin,
312
- highlightedCommentId,
313
- onHighlightComment,
314
- writesAllowed,
315
- showResolved,
316
- onShowResolvedChange,
317
- pinHint,
318
- onCopyThreadReference,
319
- onSelectViewport
320
- }) => {
321
- const [text, setText] = useState("");
322
- const [isDecision, setIsDecision] = useState(false);
323
- const { api, components, notify, useCurrentAccountId } = useDesignStudio();
324
- const { Button, Checkbox, Label, Textarea } = components;
325
- const [createComment, { isLoading }] = api.useCreateCommentMutation();
326
- const authAccountId = useCurrentAccountId();
327
- const { data: expiringData } = api.useExpiringCommentsQuery();
328
- const expiringCommentIds = new Set(
329
- (expiringData?.designStudioComments.elements ?? []).map((comment) => Number(comment.id))
330
- );
331
- const visibleThreads = showResolved ? threads : threads.filter((thread) => !thread.root.isResolved);
332
- const resolvedCount = threads.length - threads.filter((thread) => !thread.root.isResolved).length;
333
- const addComment = async () => {
334
- try {
335
- await createComment({
336
- projectKey,
337
- canvasKey,
338
- boardKey: board.boardKey ?? "",
339
- body: {
340
- text,
341
- x: pendingPin?.x ?? null,
342
- y: pendingPin?.y ?? null,
343
- viewportWidth: pendingPin?.viewport?.width ?? null,
344
- viewportHeight: pendingPin?.viewport?.height ?? null,
345
- deviceKey: pendingPin?.viewport?.deviceKey ?? null,
346
- isDecision
347
- }
348
- }).unwrap();
349
- setText("");
350
- setIsDecision(false);
351
- onClearPendingPin();
352
- } catch (error) {
353
- notify.error(errorMessage(error));
354
- }
355
- };
356
- return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
357
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
358
- /* @__PURE__ */ jsx(Label, { htmlFor: "design-comment-text", className: "flex items-center gap-1.5", children: pendingPin ? /* @__PURE__ */ jsxs(Fragment, { children: [
359
- /* @__PURE__ */ jsx(MapPin, { className: "size-4 text-brand-emphasis", "aria-hidden": true }),
360
- " Comment at the placed pin"
361
- ] }) : "New comment on the board" }),
362
- /* @__PURE__ */ jsx(
363
- Textarea,
364
- {
365
- id: "design-comment-text",
366
- value: text,
367
- onChange: (event) => setText(event.target.value),
368
- placeholder: pendingPin ? "What should change here?" : `Comment\u2026 (${pinHint})`,
369
- rows: 3,
370
- disabled: !writesAllowed
371
- }
372
- ),
373
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
374
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
375
- /* @__PURE__ */ jsx(
376
- Checkbox,
377
- {
378
- id: "design-comment-decision",
379
- checked: isDecision,
380
- onCheckedChange: (checked) => setIsDecision(checked === true),
381
- disabled: !writesAllowed
382
- }
383
- ),
384
- /* @__PURE__ */ jsx(Label, { htmlFor: "design-comment-decision", className: "font-normal", children: "Decision" })
385
- ] }),
386
- pendingPin && /* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: onClearPendingPin, children: "Remove pin" }),
387
- /* @__PURE__ */ jsx(Button, { size: "sm", className: "ml-auto", disabled: !writesAllowed || !text.trim() || isLoading || !board.boardKey, onClick: addComment, children: "Comment" })
388
- ] })
389
- ] }),
390
- resolvedCount > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
391
- /* @__PURE__ */ jsx(
392
- Checkbox,
393
- {
394
- id: "design-comment-show-resolved",
395
- checked: showResolved,
396
- onCheckedChange: (checked) => onShowResolvedChange(checked === true)
397
- }
398
- ),
399
- /* @__PURE__ */ jsxs(Label, { htmlFor: "design-comment-show-resolved", className: "font-normal text-muted-foreground", children: [
400
- "Show ",
401
- resolvedCount,
402
- " resolved"
403
- ] })
404
- ] }),
405
- visibleThreads.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "No open comments on this board." }),
406
- visibleThreads.map((thread) => /* @__PURE__ */ jsx(
407
- ThreadCard,
408
- {
409
- thread,
410
- onCopyReference: onCopyThreadReference,
411
- onSelectViewport,
412
- isHighlighted: highlightedCommentId === Number(thread.root.id),
413
- onHighlight: () => onHighlightComment(Number(thread.root.id)),
414
- authAccountId,
415
- writesAllowed,
416
- hasBoardChangedSince: Boolean(thread.root.contentHash && board.contentHash) && thread.root.contentHash !== board.contentHash,
417
- isExpiring: expiringCommentIds.has(Number(thread.root.id))
418
- },
419
- String(thread.root.id)
420
- ))
421
- ] });
422
- };
58
+ import { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo2, useRef as useRef4, useState as useState7 } from "react";
423
59
 
424
60
  // src/canvas/BoardFocusView.tsx
425
61
  import {
426
62
  ChevronLeft,
427
63
  ChevronRight,
428
- ClipboardCopy as ClipboardCopy3,
429
- MapPin as MapPin2,
64
+ ClipboardCopy as ClipboardCopy2,
65
+ MapPin,
430
66
  MapPinPlus,
431
- RotateCw,
432
- Smartphone,
433
67
  SquareDashedMousePointer,
434
68
  X
435
69
  } from "lucide-react";
436
- import { useEffect as useEffect4, useRef as useRef2, useState as useState7 } from "react";
70
+ import { useEffect as useEffect3, useRef as useRef2, useState as useState5 } from "react";
437
71
 
438
72
  // src/canvas/BoardNode.tsx
439
73
  import { useStore } from "@xyflow/react";
440
- import { ClipboardCopy as ClipboardCopy2, Download, Maximize2, MessageSquare } from "lucide-react";
441
- import { memo, useEffect as useEffect3, useRef, useState as useState6 } from "react";
74
+ import { ClipboardCopy, Download, Maximize2, MessageSquare } from "lucide-react";
75
+ import { memo, useEffect as useEffect2, useRef, useState as useState4 } from "react";
442
76
 
443
77
  // src/canvas/boardStatus.ts
444
78
  var boardStatusDefinition = (statuses, status) => statuses[status];
@@ -699,116 +333,8 @@ var useCanvasView = () => {
699
333
  var boardNodeId = (boardKey) => `board-${boardKey}`;
700
334
  var sectionNodeId = (sectionKey) => `section-${sectionKey}`;
701
335
 
702
- // src/canvas/useCheckedContentUrl.ts
703
- import { useEffect, useState as useState2 } from "react";
704
- var MAX_CONCURRENT_LOADS = 2;
705
- var RETRY_DELAYS_MS = [2e3, 5e3, 15e3, 3e4];
706
- var MAX_REMEMBERED_URLS = 24;
707
- var loadedUrls = /* @__PURE__ */ new Set();
708
- var rememberLoadedUrl = (url) => {
709
- loadedUrls.delete(url);
710
- loadedUrls.add(url);
711
- while (loadedUrls.size > MAX_REMEMBERED_URLS) {
712
- const oldestUrl = loadedUrls.values().next().value;
713
- if (oldestUrl === void 0) break;
714
- loadedUrls.delete(oldestUrl);
715
- }
716
- };
717
- var wasContentUrlLoaded = (url) => Boolean(url && loadedUrls.has(url));
718
- var activeLoads = 0;
719
- var waitingLoads = [];
720
- var acquireLoadSlot = () => new Promise((resolve) => {
721
- if (activeLoads < MAX_CONCURRENT_LOADS) {
722
- activeLoads += 1;
723
- resolve();
724
- return;
725
- }
726
- waitingLoads.push(() => {
727
- activeLoads += 1;
728
- resolve();
729
- });
730
- });
731
- var releaseLoadSlot = () => {
732
- activeLoads -= 1;
733
- waitingLoads.shift()?.();
734
- };
735
- var loadUrl = async (url, signal) => {
736
- await acquireLoadSlot();
737
- try {
738
- if (signal.aborted) return false;
739
- const response = await fetch(url, { signal, credentials: "omit", referrerPolicy: "no-referrer" });
740
- if (!response.ok) return false;
741
- await response.blob();
742
- return true;
743
- } catch {
744
- return false;
745
- } finally {
746
- releaseLoadSlot();
747
- }
748
- };
749
- var useCheckedContentUrl = (url) => {
750
- const [checkedUrl, setCheckedUrl] = useState2(
751
- () => url && loadedUrls.has(url) ? url : void 0
752
- );
753
- useEffect(() => {
754
- if (!url) {
755
- setCheckedUrl(void 0);
756
- return;
757
- }
758
- if (loadedUrls.has(url)) {
759
- rememberLoadedUrl(url);
760
- setCheckedUrl(url);
761
- return;
762
- }
763
- setCheckedUrl(void 0);
764
- const abortController = new AbortController();
765
- let retryTimer;
766
- let attempt = 0;
767
- const tryLoad = async () => {
768
- const isLoaded = await loadUrl(url, abortController.signal);
769
- if (abortController.signal.aborted) return;
770
- if (isLoaded) {
771
- rememberLoadedUrl(url);
772
- setCheckedUrl(url);
773
- return;
774
- }
775
- const delay = RETRY_DELAYS_MS[Math.min(attempt, RETRY_DELAYS_MS.length - 1)];
776
- attempt += 1;
777
- retryTimer = setTimeout(tryLoad, delay);
778
- };
779
- void tryLoad();
780
- return () => {
781
- abortController.abort();
782
- if (retryTimer) clearTimeout(retryTimer);
783
- };
784
- }, [url]);
785
- return checkedUrl;
786
- };
787
- var useImageRetry = (url) => {
788
- const [attempt, setAttempt] = useState2(0);
789
- const [isFailed, setIsFailed] = useState2(false);
790
- const [previousUrl, setPreviousUrl] = useState2(url);
791
- if (url !== previousUrl) {
792
- setPreviousUrl(url);
793
- setAttempt(0);
794
- setIsFailed(false);
795
- }
796
- useEffect(() => {
797
- if (!isFailed) return;
798
- const retryTimer = setTimeout(
799
- () => {
800
- setIsFailed(false);
801
- setAttempt((previousAttempt) => previousAttempt + 1);
802
- },
803
- RETRY_DELAYS_MS[Math.min(attempt, RETRY_DELAYS_MS.length - 1)]
804
- );
805
- return () => clearTimeout(retryTimer);
806
- }, [isFailed, attempt]);
807
- return { imageKey: `${url ?? ""}#${attempt}`, isFailed, onError: () => setIsFailed(true) };
808
- };
809
-
810
336
  // src/canvas/useDeferredMount.ts
811
- import { useEffect as useEffect2, useState as useState3 } from "react";
337
+ import { useEffect, useState } from "react";
812
338
  var MOUNTS_PER_FRAME = 12;
813
339
  var queue = [];
814
340
  var isScheduled = false;
@@ -823,8 +349,8 @@ var schedule = () => {
823
349
  requestAnimationFrame(flush);
824
350
  };
825
351
  var useDeferredMount = () => {
826
- const [isMounted, setIsMounted] = useState3(false);
827
- useEffect2(() => {
352
+ const [isMounted, setIsMounted] = useState(false);
353
+ useEffect(() => {
828
354
  let isActive = true;
829
355
  const mount = () => {
830
356
  if (isActive) setIsMounted(true);
@@ -841,10 +367,10 @@ var useDeferredMount = () => {
841
367
  };
842
368
 
843
369
  // src/canvas/CanvasThumbnail.tsx
844
- import { useState as useState5 } from "react";
370
+ import { useState as useState3 } from "react";
845
371
 
846
372
  // src/canvas/stableContentUrl.ts
847
- import { useState as useState4 } from "react";
373
+ import { useState as useState2 } from "react";
848
374
  var EXPIRY_MARGIN_SECONDS = 120;
849
375
  var urlByContentKey = /* @__PURE__ */ new Map();
850
376
  var expiryByToken = /* @__PURE__ */ new Map();
@@ -878,7 +404,7 @@ var resolveStableContentUrl = (url) => {
878
404
  return url;
879
405
  };
880
406
  var useStableContentUrl = (url, isDisplayed = false) => {
881
- const [shownUrl, setShownUrl] = useState4(() => url ? resolveStableContentUrl(url) : void 0);
407
+ const [shownUrl, setShownUrl] = useState2(() => url ? resolveStableContentUrl(url) : void 0);
882
408
  if (!url) {
883
409
  if (shownUrl !== void 0) setShownUrl(void 0);
884
410
  return void 0;
@@ -892,35 +418,35 @@ var useStableContentUrl = (url, isDisplayed = false) => {
892
418
  };
893
419
 
894
420
  // src/canvas/CanvasThumbnail.tsx
895
- import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
421
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
896
422
  var isSameContent = (first, second) => Boolean(first && second) && withoutContentToken(first) === withoutContentToken(second);
897
423
  var CanvasThumbnail = ({ urls, variant, title, imageClassName, isCompact }) => {
898
424
  const { apiBaseUrl } = useDesignStudio();
899
425
  const texts = useDesignStudioTexts();
900
426
  const path = thumbnailUrlForVariant(urls, variant);
901
427
  const latestUrl = path ? `${apiBaseUrl}${path}` : void 0;
902
- const [loadedUrl, setLoadedUrl] = useState5(null);
428
+ const [loadedUrl, setLoadedUrl] = useState3(null);
903
429
  const url = useStableContentUrl(latestUrl, isSameContent(loadedUrl, latestUrl));
904
430
  const retry = useImageRetry(url);
905
431
  if (!url) return null;
906
432
  const isLoaded = isSameContent(loadedUrl, url);
907
- return /* @__PURE__ */ jsxs2(Fragment2, { children: [
908
- !loadedUrl && /* @__PURE__ */ jsx2(
433
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
434
+ !loadedUrl && /* @__PURE__ */ jsx(
909
435
  "span",
910
436
  {
911
437
  className: cx(
912
438
  "pointer-events-none absolute inset-0 flex flex-col items-center justify-start gap-2 bg-tint px-6 pt-16 text-center text-muted-foreground",
913
439
  "animate-pulse motion-reduce:animate-none"
914
440
  ),
915
- children: !isCompact && /* @__PURE__ */ jsxs2(Fragment2, { children: [
916
- /* @__PURE__ */ jsx2("span", { className: "line-clamp-2 text-[19px] font-semibold", children: title }),
917
- /* @__PURE__ */ jsx2("span", { className: "text-[16px]", children: texts.thumbnailLoading })
441
+ children: !isCompact && /* @__PURE__ */ jsxs(Fragment, { children: [
442
+ /* @__PURE__ */ jsx("span", { className: "line-clamp-2 text-[19px] font-semibold", children: title }),
443
+ /* @__PURE__ */ jsx("span", { className: "text-[16px]", children: texts.thumbnailLoading })
918
444
  ] })
919
445
  }
920
446
  ),
921
447
  loadedUrl && !isLoaded && // biome-ignore lint/performance/noImgElement: the picture shown before, from the browser cache, under the next one
922
- /* @__PURE__ */ jsx2("img", { src: loadedUrl, alt: "", draggable: false, className: cx("pointer-events-none select-none", imageClassName) }),
923
- /* @__PURE__ */ jsx2(
448
+ /* @__PURE__ */ jsx("img", { src: loadedUrl, alt: "", draggable: false, className: cx("pointer-events-none select-none", imageClassName) }),
449
+ /* @__PURE__ */ jsx(
924
450
  "img",
925
451
  {
926
452
  src: url,
@@ -938,7 +464,7 @@ var CanvasThumbnail = ({ urls, variant, title, imageClassName, isCompact }) => {
938
464
  };
939
465
 
940
466
  // src/canvas/BoardNode.tsx
941
- import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
467
+ import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
942
468
  var isSameContent2 = (first, second) => Boolean(first && second) && withoutContentToken(first) === withoutContentToken(second);
943
469
  var designContentUrl = (apiBaseUrl, path) => path ? `${apiBaseUrl}${path}` : void 0;
944
470
  var downloadName = (board, extension) => `${boardCodeOf(board.boardKey ?? "board")}.${extension}`;
@@ -976,32 +502,32 @@ var BoardNodeComponent = ({ id, data }) => {
976
502
  const isReady = useDeferredMount();
977
503
  const isThumbnailMissing = !isResponsive && !board.thumbnailUrl;
978
504
  const latestHtmlUrl = designContentUrl(apiBaseUrl, board.htmlUrl);
979
- const [loadedFrameUrl, setLoadedFrameUrl] = useState6(null);
505
+ const [loadedFrameUrl, setLoadedFrameUrl] = useState4(null);
980
506
  const htmlUrl = useStableContentUrl(latestHtmlUrl, isSameContent2(loadedFrameUrl, latestHtmlUrl));
981
507
  const isRememberedLive = isThumbnailMissing && thumbnailVariant !== "small" && isReady && wasContentUrlLoaded(htmlUrl);
982
508
  const showsLiveHtml = isLive || isRememberedLive;
983
509
  const liveHtmlUrl = useCheckedContentUrl(showsLiveHtml && isReady ? htmlUrl : void 0);
984
- useEffect3(() => {
510
+ useEffect2(() => {
985
511
  if (!liveHtmlUrl) setLoadedFrameUrl(null);
986
512
  }, [liveHtmlUrl]);
987
513
  const title = board.title ?? board.boardKey ?? "";
988
514
  const boardCode = board.code ?? boardCodeOf(board.boardKey ?? "");
989
- const [isDownloadOpen, setIsDownloadOpen] = useState6(false);
515
+ const [isDownloadOpen, setIsDownloadOpen] = useState4(false);
990
516
  const pressPointRef = useRef(null);
991
517
  const isCompact = thumbnailVariant === "small";
992
518
  if (!isReady) {
993
- return /* @__PURE__ */ jsx3("div", { className: cx("h-full w-full", isDimmed && "opacity-15"), style: { paddingTop: BOARD_HEADER_HEIGHT }, children: /* @__PURE__ */ jsx3("div", { className: "rounded-[20px] bg-card/70", style: { width, height: visibleHeight } }) });
519
+ return /* @__PURE__ */ jsx2("div", { className: cx("h-full w-full", isDimmed && "opacity-15"), style: { paddingTop: BOARD_HEADER_HEIGHT }, children: /* @__PURE__ */ jsx2("div", { className: "rounded-[20px] bg-card/70", style: { width, height: visibleHeight } }) });
994
520
  }
995
- return /* @__PURE__ */ jsxs3("div", { className: cx("relative h-full w-full", isDimmed && "opacity-15"), children: [
996
- /* @__PURE__ */ jsxs3("div", { className: "flex flex-col justify-end gap-0.5 pb-1", style: { height: BOARD_HEADER_HEIGHT }, children: [
997
- /* @__PURE__ */ jsx3("span", { className: "line-clamp-2 text-[19px] leading-6 font-medium text-muted-foreground", title, children: title }),
998
- /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1", children: [
999
- /* @__PURE__ */ jsx3("span", { className: "min-w-0 flex-1 truncate text-[15px] leading-5 font-semibold text-foreground/70 tabular-nums", title: boardCode, children: isCompact ? "" : boardCode }),
1000
- !isCompact && openThreads > 0 && /* @__PURE__ */ jsxs3("span", { className: "inline-flex shrink-0 items-center gap-1 rounded-full bg-primary px-2 py-0.5 text-sm font-semibold text-primary-foreground", children: [
1001
- /* @__PURE__ */ jsx3(MessageSquare, { className: "size-3.5", "aria-hidden": true }),
521
+ return /* @__PURE__ */ jsxs2("div", { className: cx("relative h-full w-full", isDimmed && "opacity-15"), children: [
522
+ /* @__PURE__ */ jsxs2("div", { className: "flex flex-col justify-end gap-0.5 pb-1", style: { height: BOARD_HEADER_HEIGHT }, children: [
523
+ /* @__PURE__ */ jsx2("span", { className: "line-clamp-2 text-[19px] leading-6 font-medium text-muted-foreground", title, children: title }),
524
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1", children: [
525
+ /* @__PURE__ */ jsx2("span", { className: "min-w-0 flex-1 truncate text-[15px] leading-5 font-semibold text-foreground/70 tabular-nums", title: boardCode, children: isCompact ? "" : boardCode }),
526
+ !isCompact && openThreads > 0 && /* @__PURE__ */ jsxs2("span", { className: "inline-flex shrink-0 items-center gap-1 rounded-full bg-primary px-2 py-0.5 text-sm font-semibold text-primary-foreground", children: [
527
+ /* @__PURE__ */ jsx2(MessageSquare, { className: "size-3.5", "aria-hidden": true }),
1002
528
  openThreads
1003
529
  ] }),
1004
- !isCompact && board.status && board.status !== defaultStatus && /* @__PURE__ */ jsx3(
530
+ !isCompact && board.status && board.status !== defaultStatus && /* @__PURE__ */ jsx2(
1005
531
  StatusBadge,
1006
532
  {
1007
533
  tone: statusDefinition?.tone ?? "neutral",
@@ -1011,7 +537,7 @@ var BoardNodeComponent = ({ id, data }) => {
1011
537
  className: "shrink-0"
1012
538
  }
1013
539
  ),
1014
- !isCompact && /* @__PURE__ */ jsx3(
540
+ !isCompact && /* @__PURE__ */ jsx2(
1015
541
  "button",
1016
542
  {
1017
543
  type: "button",
@@ -1019,10 +545,10 @@ var BoardNodeComponent = ({ id, data }) => {
1019
545
  "aria-label": `Copy reference of ${title} for an agent`,
1020
546
  title: "Copy reference (C)",
1021
547
  onClick: () => onCopyReference(id),
1022
- children: /* @__PURE__ */ jsx3(ClipboardCopy2, { className: "size-5" })
548
+ children: /* @__PURE__ */ jsx2(ClipboardCopy, { className: "size-5" })
1023
549
  }
1024
550
  ),
1025
- !isCompact && /* @__PURE__ */ jsx3(
551
+ !isCompact && /* @__PURE__ */ jsx2(
1026
552
  "button",
1027
553
  {
1028
554
  type: "button",
@@ -1030,11 +556,11 @@ var BoardNodeComponent = ({ id, data }) => {
1030
556
  "aria-label": `Open ${title} large`,
1031
557
  title: "Expand",
1032
558
  onClick: () => onOpenBoard(id),
1033
- children: /* @__PURE__ */ jsx3(Maximize2, { className: "size-5" })
559
+ children: /* @__PURE__ */ jsx2(Maximize2, { className: "size-5" })
1034
560
  }
1035
561
  ),
1036
- !isCompact && /* @__PURE__ */ jsxs3("div", { className: "relative", children: [
1037
- /* @__PURE__ */ jsx3(
562
+ !isCompact && /* @__PURE__ */ jsxs2("div", { className: "relative", children: [
563
+ /* @__PURE__ */ jsx2(
1038
564
  "button",
1039
565
  {
1040
566
  type: "button",
@@ -1043,16 +569,16 @@ var BoardNodeComponent = ({ id, data }) => {
1043
569
  "aria-expanded": isDownloadOpen,
1044
570
  title: "Download",
1045
571
  onClick: () => setIsDownloadOpen((isOpen) => !isOpen),
1046
- children: /* @__PURE__ */ jsx3(Download, { className: "size-5" })
572
+ children: /* @__PURE__ */ jsx2(Download, { className: "size-5" })
1047
573
  }
1048
574
  ),
1049
575
  isDownloadOpen && // a plain menu instead of a Radix one: mounted only while open, nothing per node at rest
1050
- /* @__PURE__ */ jsxs3(
576
+ /* @__PURE__ */ jsxs2(
1051
577
  "div",
1052
578
  {
1053
579
  className: "nodrag nopan absolute top-full right-0 z-20 mt-1 flex w-56 flex-col rounded-2xl bg-popover p-1.5 text-[18px] shadow-surface-raised ring-1 ring-foreground/5",
1054
580
  children: [
1055
- board.thumbnailUrl && /* @__PURE__ */ jsx3(
581
+ board.thumbnailUrl && /* @__PURE__ */ jsx2(
1056
582
  "a",
1057
583
  {
1058
584
  href: designContentUrl(apiBaseUrl, board.thumbnailUrl),
@@ -1062,7 +588,7 @@ var BoardNodeComponent = ({ id, data }) => {
1062
588
  children: "PNG (thumbnail)"
1063
589
  }
1064
590
  ),
1065
- board.htmlUrl && /* @__PURE__ */ jsx3(
591
+ board.htmlUrl && /* @__PURE__ */ jsx2(
1066
592
  "a",
1067
593
  {
1068
594
  href: htmlUrl,
@@ -1078,7 +604,7 @@ var BoardNodeComponent = ({ id, data }) => {
1078
604
  ] })
1079
605
  ] })
1080
606
  ] }),
1081
- /* @__PURE__ */ jsxs3(
607
+ /* @__PURE__ */ jsxs2(
1082
608
  "div",
1083
609
  {
1084
610
  className: cx(
@@ -1087,7 +613,7 @@ var BoardNodeComponent = ({ id, data }) => {
1087
613
  ),
1088
614
  style: { width, height: visibleHeight },
1089
615
  children: [
1090
- isResponsive && /* @__PURE__ */ jsx3(
616
+ isResponsive && /* @__PURE__ */ jsx2(
1091
617
  ResponsiveBoardFrames,
1092
618
  {
1093
619
  board,
@@ -1099,7 +625,7 @@ var BoardNodeComponent = ({ id, data }) => {
1099
625
  title
1100
626
  }
1101
627
  ),
1102
- !isResponsive && !isThumbnailMissing && /* @__PURE__ */ jsx3(
628
+ !isResponsive && !isThumbnailMissing && /* @__PURE__ */ jsx2(
1103
629
  CanvasThumbnail,
1104
630
  {
1105
631
  urls: board,
@@ -1109,8 +635,8 @@ var BoardNodeComponent = ({ id, data }) => {
1109
635
  isCompact
1110
636
  }
1111
637
  ),
1112
- isThumbnailMissing && !isCompact && !(showsLiveHtml && liveHtmlUrl) && /* @__PURE__ */ jsx3("span", { className: "pointer-events-none absolute inset-0 flex items-center justify-center px-6 text-center text-[17px] font-semibold text-muted-foreground", children: texts.thumbnailMissing }),
1113
- !isResponsive && showsLiveHtml && liveHtmlUrl && /* @__PURE__ */ jsx3(
638
+ isThumbnailMissing && !isCompact && !(showsLiveHtml && liveHtmlUrl) && /* @__PURE__ */ jsx2("span", { className: "pointer-events-none absolute inset-0 flex items-center justify-center px-6 text-center text-[17px] font-semibold text-muted-foreground", children: texts.thumbnailMissing }),
639
+ !isResponsive && showsLiveHtml && liveHtmlUrl && /* @__PURE__ */ jsx2(
1114
640
  "iframe",
1115
641
  {
1116
642
  src: liveHtmlUrl,
@@ -1124,12 +650,12 @@ var BoardNodeComponent = ({ id, data }) => {
1124
650
  className: "pointer-events-none absolute inset-0 border-0 bg-transparent"
1125
651
  }
1126
652
  ),
1127
- isCut && /* @__PURE__ */ jsxs3("span", { className: "pointer-events-none absolute inset-x-0 bottom-0 flex h-40 items-end justify-center bg-gradient-to-t from-card to-transparent pb-4 text-[16px] font-semibold text-muted-foreground", children: [
653
+ isCut && /* @__PURE__ */ jsxs2("span", { className: "pointer-events-none absolute inset-x-0 bottom-0 flex h-40 items-end justify-center bg-gradient-to-t from-card to-transparent pb-4 text-[16px] font-semibold text-muted-foreground", children: [
1128
654
  "\u2193 ",
1129
655
  Math.round(height),
1130
656
  " px \u2014 full length in the focus view"
1131
657
  ] }),
1132
- /* @__PURE__ */ jsx3(
658
+ /* @__PURE__ */ jsx2(
1133
659
  "button",
1134
660
  {
1135
661
  type: "button",
@@ -1165,10 +691,10 @@ var ResponsiveBoardFrames = ({
1165
691
  title
1166
692
  }) => {
1167
693
  let left = 0;
1168
- return /* @__PURE__ */ jsx3(Fragment3, { children: framesOf(board).map((frame) => {
694
+ return /* @__PURE__ */ jsx2(Fragment2, { children: framesOf(board).map((frame) => {
1169
695
  const frameLeft = left;
1170
696
  left += (frame.width ?? 0) + FRAME_GAP;
1171
- return /* @__PURE__ */ jsx3(
697
+ return /* @__PURE__ */ jsx2(
1172
698
  ResponsiveBoardFrame,
1173
699
  {
1174
700
  frame,
@@ -1202,8 +728,8 @@ var ResponsiveBoardFrame = ({
1202
728
  );
1203
729
  const liveHtmlUrl = useCheckedContentUrl(showsLiveHtml ? htmlUrl : void 0);
1204
730
  const isCut = frameHeightMode === "page" && (frame.pageHeight ?? 0) > frameHeight;
1205
- return /* @__PURE__ */ jsxs3("div", { className: "absolute top-0", style: { left, width: frameWidth }, children: [
1206
- /* @__PURE__ */ jsx3(
731
+ return /* @__PURE__ */ jsxs2("div", { className: "absolute top-0", style: { left, width: frameWidth }, children: [
732
+ /* @__PURE__ */ jsx2(
1207
733
  "div",
1208
734
  {
1209
735
  className: "flex items-end truncate pb-2 text-[17px] font-semibold text-muted-foreground tabular-nums",
@@ -1212,13 +738,13 @@ var ResponsiveBoardFrame = ({
1212
738
  children: thumbnailVariant === "small" ? "" : `${deviceLabel} \xB7 ${frameWidth}`
1213
739
  }
1214
740
  ),
1215
- /* @__PURE__ */ jsxs3(
741
+ /* @__PURE__ */ jsxs2(
1216
742
  "div",
1217
743
  {
1218
744
  className: "relative overflow-hidden rounded-[20px] bg-card shadow-surface-raised ring-1 ring-foreground/10",
1219
745
  style: { width: frameWidth, height: frameHeight },
1220
746
  children: [
1221
- frame.thumbnailUrl && /* @__PURE__ */ jsx3(
747
+ frame.thumbnailUrl && /* @__PURE__ */ jsx2(
1222
748
  CanvasThumbnail,
1223
749
  {
1224
750
  urls: frame,
@@ -1228,8 +754,8 @@ var ResponsiveBoardFrame = ({
1228
754
  isCompact: thumbnailVariant === "small"
1229
755
  }
1230
756
  ),
1231
- !frame.thumbnailUrl && !(showsLiveHtml && liveHtmlUrl) && thumbnailVariant !== "small" && /* @__PURE__ */ jsx3("span", { className: "pointer-events-none absolute inset-0 flex items-center justify-center px-6 text-center text-[17px] font-semibold text-muted-foreground", children: texts.thumbnailMissing }),
1232
- showsLiveHtml && liveHtmlUrl && /* @__PURE__ */ jsx3(
757
+ !frame.thumbnailUrl && !(showsLiveHtml && liveHtmlUrl) && thumbnailVariant !== "small" && /* @__PURE__ */ jsx2("span", { className: "pointer-events-none absolute inset-0 flex items-center justify-center px-6 text-center text-[17px] font-semibold text-muted-foreground", children: texts.thumbnailMissing }),
758
+ showsLiveHtml && liveHtmlUrl && /* @__PURE__ */ jsx2(
1233
759
  "iframe",
1234
760
  {
1235
761
  src: liveHtmlUrl,
@@ -1242,7 +768,7 @@ var ResponsiveBoardFrame = ({
1242
768
  className: "pointer-events-none absolute inset-0 border-0 bg-transparent"
1243
769
  }
1244
770
  ),
1245
- isCut && /* @__PURE__ */ jsxs3("span", { className: "pointer-events-none absolute inset-x-0 bottom-0 flex h-40 items-end justify-center bg-gradient-to-t from-card to-transparent pb-4 text-[16px] font-semibold text-muted-foreground", children: [
771
+ isCut && /* @__PURE__ */ jsxs2("span", { className: "pointer-events-none absolute inset-x-0 bottom-0 flex h-40 items-end justify-center bg-gradient-to-t from-card to-transparent pb-4 text-[16px] font-semibold text-muted-foreground", children: [
1246
772
  "\u2193 ",
1247
773
  Math.round(frame.pageHeight ?? 0),
1248
774
  " px \u2014 full length in the focus view"
@@ -1254,8 +780,8 @@ var ResponsiveBoardFrame = ({
1254
780
  };
1255
781
 
1256
782
  // src/canvas/BoardStatusChips.tsx
1257
- import { normalizeDddError as normalizeDddError2 } from "@mgamadeus/ddd-web/api";
1258
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
783
+ import { normalizeDddError } from "@mgamadeus/ddd-web/api";
784
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1259
785
  var BoardStatusChips = ({
1260
786
  projectKey,
1261
787
  canvasKey,
@@ -1266,11 +792,11 @@ var BoardStatusChips = ({
1266
792
  }) => {
1267
793
  const { api, notify, statuses: statusDefinitions } = useDesignStudio();
1268
794
  const [patchStatus, { isLoading }] = api.useSetBoardStatusMutation();
1269
- return /* @__PURE__ */ jsxs4("fieldset", { className: "m-0 flex flex-wrap items-center gap-1.5 border-0 p-0", "aria-label": "Board status", children: [
795
+ return /* @__PURE__ */ jsxs3("fieldset", { className: "m-0 flex flex-wrap items-center gap-1.5 border-0 p-0", "aria-label": "Board status", children: [
1270
796
  statuses.map((status) => {
1271
797
  const Icon = boardStatusDefinition(statusDefinitions, status)?.icon;
1272
798
  const isActive = board.status === status;
1273
- return /* @__PURE__ */ jsxs4(
799
+ return /* @__PURE__ */ jsxs3(
1274
800
  "button",
1275
801
  {
1276
802
  type: "button",
@@ -1286,7 +812,7 @@ var BoardStatusChips = ({
1286
812
  }).unwrap();
1287
813
  onStatusChanged(status);
1288
814
  } catch (error) {
1289
- notify.error(normalizeDddError2(error, "Request failed").message);
815
+ notify.error(normalizeDddError(error, "Request failed").message);
1290
816
  }
1291
817
  },
1292
818
  className: cx(
@@ -1295,19 +821,19 @@ var BoardStatusChips = ({
1295
821
  isActive ? "bg-primary text-primary-foreground" : "bg-tint text-muted-foreground hover:bg-tint-strong hover:text-foreground disabled:opacity-60"
1296
822
  ),
1297
823
  children: [
1298
- Icon && /* @__PURE__ */ jsx4(Icon, { className: "size-3.5", "aria-hidden": true }),
824
+ Icon && /* @__PURE__ */ jsx3(Icon, { className: "size-3.5", "aria-hidden": true }),
1299
825
  boardStatusLabel(statusDefinitions, status)
1300
826
  ]
1301
827
  },
1302
828
  status
1303
829
  );
1304
830
  }),
1305
- board.hasChangedSinceStatus && /* @__PURE__ */ jsx4("span", { className: "text-xs text-muted-foreground", title: "The board file changed after this status was set", children: "changed since" })
831
+ board.hasChangedSinceStatus && /* @__PURE__ */ jsx3("span", { className: "text-xs text-muted-foreground", title: "The board file changed after this status was set", children: "changed since" })
1306
832
  ] });
1307
833
  };
1308
834
 
1309
835
  // src/canvas/BoardFocusView.tsx
1310
- import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
836
+ import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1311
837
  var DEVICE_SCREEN_HEIGHT = 844;
1312
838
  var BoardFocusView = ({
1313
839
  projectKey,
@@ -1332,17 +858,17 @@ var BoardFocusView = ({
1332
858
  const { apiBaseUrl, components } = useDesignStudio();
1333
859
  const texts = useDesignStudioTexts();
1334
860
  const { Button, Dialog, DialogContent, DialogDescription, DialogTitle, Textarea } = components;
1335
- const [isPlacingPin, setIsPlacingPin] = useState7(false);
1336
- const [pendingPin, setPendingPin] = useState7(null);
1337
- const [highlightedCommentId, setHighlightedCommentId] = useState7(null);
1338
- const [showResolved, setShowResolved] = useState7(false);
1339
- const [isMarkingRegion, setIsMarkingRegion] = useState7(false);
1340
- const [region, setRegion] = useState7(null);
1341
- const [regionDraft, setRegionDraft] = useState7(null);
1342
- const [referenceNote, setReferenceNote] = useState7("");
1343
- const [isRegionFlashing, setIsRegionFlashing] = useState7(false);
861
+ const [isPlacingPin, setIsPlacingPin] = useState5(false);
862
+ const [pendingPin, setPendingPin] = useState5(null);
863
+ const [highlightedCommentId, setHighlightedCommentId] = useState5(null);
864
+ const [showResolved, setShowResolved] = useState5(false);
865
+ const [isMarkingRegion, setIsMarkingRegion] = useState5(false);
866
+ const [region, setRegion] = useState5(null);
867
+ const [regionDraft, setRegionDraft] = useState5(null);
868
+ const [referenceNote, setReferenceNote] = useState5("");
869
+ const [isRegionFlashing, setIsRegionFlashing] = useState5(false);
1344
870
  const boardKey = board?.boardKey ?? null;
1345
- useEffect4(() => {
871
+ useEffect3(() => {
1346
872
  if (boardKey === null) return;
1347
873
  setPendingPin(null);
1348
874
  setIsPlacingPin(false);
@@ -1352,7 +878,7 @@ var BoardFocusView = ({
1352
878
  setIsMarkingRegion(false);
1353
879
  setReferenceNote("");
1354
880
  }, [boardKey]);
1355
- useEffect4(() => {
881
+ useEffect3(() => {
1356
882
  if (!board) return;
1357
883
  const onKeyDown = (event) => {
1358
884
  const target = event.target;
@@ -1375,10 +901,10 @@ var BoardFocusView = ({
1375
901
  return () => window.removeEventListener("keydown", onKeyDown);
1376
902
  });
1377
903
  const isResponsive = isResponsiveBoard(board) && viewport !== null;
1378
- const [showsDeviceFrame, setShowsDeviceFrame] = useState7(true);
904
+ const [showsDeviceFrame, setShowsDeviceFrame] = useState5(true);
1379
905
  const stageRef = useRef2(null);
1380
- const [stageWidth, setStageWidth] = useState7(0);
1381
- useEffect4(() => {
906
+ const [stageWidth, setStageWidth] = useState5(0);
907
+ useEffect3(() => {
1382
908
  const stage = stageRef.current;
1383
909
  if (!stage || typeof ResizeObserver === "undefined") return;
1384
910
  const observer = new ResizeObserver(() => setStageWidth(stage.clientWidth));
@@ -1454,16 +980,16 @@ var BoardFocusView = ({
1454
980
  });
1455
981
  setIsPlacingPin(false);
1456
982
  };
1457
- return /* @__PURE__ */ jsx5(Dialog, { open: board !== null, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsx5(
983
+ return /* @__PURE__ */ jsx4(Dialog, { open: board !== null, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsx4(
1458
984
  DialogContent,
1459
985
  {
1460
986
  showCloseButton: false,
1461
987
  className: "flex h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-none flex-col gap-0 overflow-hidden rounded-3xl p-0 sm:max-w-none",
1462
- children: board && /* @__PURE__ */ jsxs5(Fragment4, { children: [
1463
- /* @__PURE__ */ jsxs5("header", { className: "flex flex-wrap items-center gap-3 border-b border-border px-5 py-3", children: [
1464
- /* @__PURE__ */ jsxs5("div", { className: "min-w-0 flex-1", children: [
1465
- /* @__PURE__ */ jsx5(DialogTitle, { className: "truncate text-lg font-semibold", children: board.title }),
1466
- /* @__PURE__ */ jsxs5(DialogDescription, { className: "truncate text-xs", children: [
988
+ children: board && /* @__PURE__ */ jsxs4(Fragment3, { children: [
989
+ /* @__PURE__ */ jsxs4("header", { className: "flex flex-wrap items-center gap-3 border-b border-border px-5 py-3", children: [
990
+ /* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
991
+ /* @__PURE__ */ jsx4(DialogTitle, { className: "truncate text-lg font-semibold", children: board.title }),
992
+ /* @__PURE__ */ jsxs4(DialogDescription, { className: "truncate text-xs", children: [
1467
993
  presentLabel ? "Present \xB7 " : "",
1468
994
  sectionTitle ? `${sectionTitle} \xB7 ` : "",
1469
995
  board.boardKey,
@@ -1475,7 +1001,7 @@ var BoardFocusView = ({
1475
1001
  position.count
1476
1002
  ] })
1477
1003
  ] }),
1478
- /* @__PURE__ */ jsx5(
1004
+ /* @__PURE__ */ jsx4(
1479
1005
  BoardStatusChips,
1480
1006
  {
1481
1007
  projectKey,
@@ -1486,15 +1012,15 @@ var BoardFocusView = ({
1486
1012
  onStatusChanged
1487
1013
  }
1488
1014
  ),
1489
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-1", children: [
1490
- /* @__PURE__ */ jsx5(Button, { variant: "outline", size: "icon", "aria-label": "Previous board (\u2190)", onClick: onPrevious, children: /* @__PURE__ */ jsx5(ChevronLeft, {}) }),
1491
- /* @__PURE__ */ jsx5(Button, { variant: "outline", size: "icon", "aria-label": "Next board (\u2192)", onClick: onNext, children: /* @__PURE__ */ jsx5(ChevronRight, {}) }),
1492
- /* @__PURE__ */ jsx5(Button, { variant: "ghost", size: "icon", "aria-label": "Close focus view", onClick: onClose, children: /* @__PURE__ */ jsx5(X, {}) })
1015
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1", children: [
1016
+ /* @__PURE__ */ jsx4(Button, { variant: "outline", size: "icon", "aria-label": "Previous board (\u2190)", onClick: onPrevious, children: /* @__PURE__ */ jsx4(ChevronLeft, {}) }),
1017
+ /* @__PURE__ */ jsx4(Button, { variant: "outline", size: "icon", "aria-label": "Next board (\u2192)", onClick: onNext, children: /* @__PURE__ */ jsx4(ChevronRight, {}) }),
1018
+ /* @__PURE__ */ jsx4(Button, { variant: "ghost", size: "icon", "aria-label": "Close focus view", onClick: onClose, children: /* @__PURE__ */ jsx4(X, {}) })
1493
1019
  ] })
1494
1020
  ] }),
1495
- /* @__PURE__ */ jsxs5("div", { className: "flex min-h-0 flex-1 flex-col lg:flex-row", children: [
1496
- /* @__PURE__ */ jsxs5("div", { className: "flex min-h-0 flex-1 flex-col bg-tint", children: [
1497
- isResponsive && /* @__PURE__ */ jsx5(
1021
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-h-0 flex-1 flex-col lg:flex-row", children: [
1022
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-h-0 flex-1 flex-col bg-tint", children: [
1023
+ isResponsive && /* @__PURE__ */ jsx4(
1498
1024
  ViewportToolbar,
1499
1025
  {
1500
1026
  devices,
@@ -1505,7 +1031,7 @@ var BoardFocusView = ({
1505
1031
  onViewportChange: (nextViewport) => onViewportChange?.(nextViewport)
1506
1032
  }
1507
1033
  ),
1508
- /* @__PURE__ */ jsx5("div", { ref: stageRef, className: "flex min-h-0 flex-1 items-start justify-center overflow-auto p-6", children: /* @__PURE__ */ jsx5("div", { style: { width: (width + bezelPadding) * scale, height: (screenHeight + bezelPadding) * scale }, children: /* @__PURE__ */ jsxs5(
1034
+ /* @__PURE__ */ jsx4("div", { ref: stageRef, className: "flex min-h-0 flex-1 items-start justify-center overflow-auto p-6", children: /* @__PURE__ */ jsx4("div", { style: { width: (width + bezelPadding) * scale, height: (screenHeight + bezelPadding) * scale }, children: /* @__PURE__ */ jsxs4(
1509
1035
  "div",
1510
1036
  {
1511
1037
  className: cx(
@@ -1515,7 +1041,7 @@ var BoardFocusView = ({
1515
1041
  ),
1516
1042
  style: { transform: scale !== 1 ? `scale(${scale})` : void 0, width: width + bezelPadding },
1517
1043
  children: [
1518
- /* @__PURE__ */ jsx5(
1044
+ /* @__PURE__ */ jsx4(
1519
1045
  "div",
1520
1046
  {
1521
1047
  className: cx(
@@ -1523,9 +1049,9 @@ var BoardFocusView = ({
1523
1049
  !isResponsive || showsDeviceFrame ? !isResponsive || viewport.width < 600 ? "rounded-[44px]" : "rounded-[18px]" : "rounded-md ring-1 ring-foreground/10"
1524
1050
  ),
1525
1051
  style: { width, height: screenHeight },
1526
- children: /* @__PURE__ */ jsxs5("div", { className: "relative", style: { width, height }, children: [
1052
+ children: /* @__PURE__ */ jsxs4("div", { className: "relative", style: { width, height }, children: [
1527
1053
  thumbnailUrl && // biome-ignore lint/performance/noImgElement: API thumbnail under the live board while it loads
1528
- /* @__PURE__ */ jsx5(
1054
+ /* @__PURE__ */ jsx4(
1529
1055
  "img",
1530
1056
  {
1531
1057
  src: thumbnailUrl,
@@ -1535,7 +1061,7 @@ var BoardFocusView = ({
1535
1061
  className: "pointer-events-none absolute inset-0 select-none"
1536
1062
  }
1537
1063
  ),
1538
- htmlUrl && /* @__PURE__ */ jsx5(
1064
+ htmlUrl && /* @__PURE__ */ jsx4(
1539
1065
  "iframe",
1540
1066
  {
1541
1067
  src: htmlUrl,
@@ -1548,7 +1074,7 @@ var BoardFocusView = ({
1548
1074
  },
1549
1075
  htmlUrl
1550
1076
  ),
1551
- isPlacingPin && /* @__PURE__ */ jsx5(
1077
+ isPlacingPin && /* @__PURE__ */ jsx4(
1552
1078
  "button",
1553
1079
  {
1554
1080
  type: "button",
@@ -1557,7 +1083,7 @@ var BoardFocusView = ({
1557
1083
  onClick: placePin
1558
1084
  }
1559
1085
  ),
1560
- isMarkingRegion && /* @__PURE__ */ jsx5(
1086
+ isMarkingRegion && /* @__PURE__ */ jsx4(
1561
1087
  "button",
1562
1088
  {
1563
1089
  type: "button",
@@ -1568,7 +1094,7 @@ var BoardFocusView = ({
1568
1094
  onPointerUp: endRegion
1569
1095
  }
1570
1096
  ),
1571
- shownRegion && /* @__PURE__ */ jsx5(
1097
+ shownRegion && /* @__PURE__ */ jsx4(
1572
1098
  "span",
1573
1099
  {
1574
1100
  "aria-hidden": true,
@@ -1584,7 +1110,7 @@ var BoardFocusView = ({
1584
1110
  }
1585
1111
  }
1586
1112
  ),
1587
- pinnedThreads.map((thread) => /* @__PURE__ */ jsx5(
1113
+ pinnedThreads.map((thread) => /* @__PURE__ */ jsx4(
1588
1114
  "button",
1589
1115
  {
1590
1116
  type: "button",
@@ -1601,19 +1127,19 @@ var BoardFocusView = ({
1601
1127
  },
1602
1128
  String(thread.root.id)
1603
1129
  )),
1604
- pendingPin && /* @__PURE__ */ jsx5(
1130
+ pendingPin && /* @__PURE__ */ jsx4(
1605
1131
  "span",
1606
1132
  {
1607
1133
  className: "absolute z-20 flex size-7 -translate-x-1/2 -translate-y-full items-center justify-center rounded-full rounded-bl-none bg-brand text-card shadow-surface-raised ring-2 ring-card",
1608
1134
  style: { left: pendingPin.x, top: pendingPin.y },
1609
1135
  "aria-hidden": true,
1610
- children: /* @__PURE__ */ jsx5(MapPin2, { className: "size-4" })
1136
+ children: /* @__PURE__ */ jsx4(MapPin, { className: "size-4" })
1611
1137
  }
1612
1138
  )
1613
1139
  ] })
1614
1140
  }
1615
1141
  ),
1616
- isResponsive && /* @__PURE__ */ jsx5(
1142
+ isResponsive && /* @__PURE__ */ jsx4(
1617
1143
  WidthDragHandle,
1618
1144
  {
1619
1145
  scale,
@@ -1625,11 +1151,11 @@ var BoardFocusView = ({
1625
1151
  }
1626
1152
  ) }) })
1627
1153
  ] }),
1628
- /* @__PURE__ */ jsxs5("aside", { className: "flex min-h-0 w-full flex-col border-t border-border lg:w-[400px] lg:border-t-0 lg:border-l", children: [
1629
- /* @__PURE__ */ jsxs5("div", { className: "space-y-2 border-b border-border px-5 py-4", children: [
1630
- /* @__PURE__ */ jsx5("p", { className: "text-sm font-semibold", children: "Reference for an agent" }),
1631
- /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center gap-2", children: [
1632
- /* @__PURE__ */ jsxs5(
1154
+ /* @__PURE__ */ jsxs4("aside", { className: "flex min-h-0 w-full flex-col border-t border-border lg:w-[400px] lg:border-t-0 lg:border-l", children: [
1155
+ /* @__PURE__ */ jsxs4("div", { className: "space-y-2 border-b border-border px-5 py-4", children: [
1156
+ /* @__PURE__ */ jsx4("p", { className: "text-sm font-semibold", children: "Reference for an agent" }),
1157
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-wrap items-center gap-2", children: [
1158
+ /* @__PURE__ */ jsxs4(
1633
1159
  Button,
1634
1160
  {
1635
1161
  variant: isMarkingRegion ? "default" : "outline",
@@ -1637,19 +1163,19 @@ var BoardFocusView = ({
1637
1163
  "aria-pressed": isMarkingRegion,
1638
1164
  onClick: () => setIsMarkingRegion((marking) => !marking),
1639
1165
  children: [
1640
- /* @__PURE__ */ jsx5(SquareDashedMousePointer, {}),
1166
+ /* @__PURE__ */ jsx4(SquareDashedMousePointer, {}),
1641
1167
  " ",
1642
1168
  isMarkingRegion ? "Drag on the board\u2026" : "Mark region"
1643
1169
  ]
1644
1170
  }
1645
1171
  ),
1646
- region && /* @__PURE__ */ jsx5(Button, { variant: "ghost", size: "sm", onClick: () => setRegion(null), children: "Clear region" }),
1647
- /* @__PURE__ */ jsxs5(Button, { variant: "outline", size: "sm", className: "ml-auto", onClick: copyReference, children: [
1648
- /* @__PURE__ */ jsx5(ClipboardCopy3, {}),
1172
+ region && /* @__PURE__ */ jsx4(Button, { variant: "ghost", size: "sm", onClick: () => setRegion(null), children: "Clear region" }),
1173
+ /* @__PURE__ */ jsxs4(Button, { variant: "outline", size: "sm", className: "ml-auto", onClick: copyReference, children: [
1174
+ /* @__PURE__ */ jsx4(ClipboardCopy2, {}),
1649
1175
  " Copy reference"
1650
1176
  ] })
1651
1177
  ] }),
1652
- region && /* @__PURE__ */ jsxs5("p", { className: "text-xs text-muted-foreground tabular-nums", children: [
1178
+ region && /* @__PURE__ */ jsxs4("p", { className: "text-xs text-muted-foreground tabular-nums", children: [
1653
1179
  "Region ",
1654
1180
  Math.round(region.x),
1655
1181
  ",",
@@ -1661,7 +1187,7 @@ var BoardFocusView = ({
1661
1187
  Math.round(region.height),
1662
1188
  " px"
1663
1189
  ] }),
1664
- /* @__PURE__ */ jsx5(
1190
+ /* @__PURE__ */ jsx4(
1665
1191
  Textarea,
1666
1192
  {
1667
1193
  value: referenceNote,
@@ -1672,8 +1198,8 @@ var BoardFocusView = ({
1672
1198
  }
1673
1199
  )
1674
1200
  ] }),
1675
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 px-5 pt-4", children: [
1676
- /* @__PURE__ */ jsxs5(
1201
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 px-5 pt-4", children: [
1202
+ /* @__PURE__ */ jsxs4(
1677
1203
  Button,
1678
1204
  {
1679
1205
  variant: isPlacingPin ? "default" : "outline",
@@ -1682,18 +1208,18 @@ var BoardFocusView = ({
1682
1208
  "aria-pressed": isPlacingPin,
1683
1209
  onClick: () => setIsPlacingPin((placing) => !placing),
1684
1210
  children: [
1685
- /* @__PURE__ */ jsx5(MapPinPlus, {}),
1211
+ /* @__PURE__ */ jsx4(MapPinPlus, {}),
1686
1212
  " ",
1687
1213
  isPlacingPin ? "Click on the board\u2026" : "Add pin"
1688
1214
  ]
1689
1215
  }
1690
1216
  ),
1691
- /* @__PURE__ */ jsxs5("span", { className: "text-xs text-muted-foreground", children: [
1217
+ /* @__PURE__ */ jsxs4("span", { className: "text-xs text-muted-foreground", children: [
1692
1218
  threads.filter((thread) => !thread.root.isResolved).length,
1693
1219
  " open"
1694
1220
  ] })
1695
1221
  ] }),
1696
- /* @__PURE__ */ jsx5("div", { className: "min-h-0 flex-1 overflow-y-auto px-5 py-4", children: /* @__PURE__ */ jsx5(
1222
+ /* @__PURE__ */ jsx4("div", { className: "min-h-0 flex-1 overflow-y-auto px-5 py-4", children: /* @__PURE__ */ jsx4(
1697
1223
  BoardComments,
1698
1224
  {
1699
1225
  projectKey,
@@ -1718,101 +1244,6 @@ var BoardFocusView = ({
1718
1244
  }
1719
1245
  ) });
1720
1246
  };
1721
- var ViewportToolbar = ({
1722
- devices,
1723
- viewport,
1724
- hiddenPinCount,
1725
- showsDeviceFrame,
1726
- onShowsDeviceFrameChange,
1727
- onViewportChange
1728
- }) => {
1729
- const { components } = useDesignStudio();
1730
- const { Button } = components;
1731
- return /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center gap-2 border-b border-border px-5 py-2 text-sm", children: [
1732
- /* @__PURE__ */ jsxs5("label", { className: "flex items-center gap-2", children: [
1733
- /* @__PURE__ */ jsx5("span", { className: "sr-only", children: "Device" }),
1734
- /* @__PURE__ */ jsxs5(
1735
- "select",
1736
- {
1737
- className: "h-8 rounded-lg border border-border bg-card px-2 text-sm",
1738
- value: viewport.deviceKey ?? "",
1739
- onChange: (event) => {
1740
- const device = devices.find((candidate) => candidate.deviceKey === event.target.value);
1741
- if (device) onViewportChange(viewportOfDevice(device));
1742
- },
1743
- children: [
1744
- viewport.deviceKey === null && /* @__PURE__ */ jsx5("option", { value: "", children: "Free width" }),
1745
- devices.map((device) => /* @__PURE__ */ jsxs5("option", { value: device.deviceKey ?? "", children: [
1746
- device.label,
1747
- " \xB7 ",
1748
- device.width,
1749
- " \xD7 ",
1750
- device.height
1751
- ] }, device.deviceKey ?? ""))
1752
- ]
1753
- }
1754
- )
1755
- ] }),
1756
- /* @__PURE__ */ jsxs5(
1757
- Button,
1758
- {
1759
- variant: "outline",
1760
- size: "sm",
1761
- "aria-label": "Rotate (landscape / portrait)",
1762
- onClick: () => onViewportChange(rotateViewport(viewport, devices)),
1763
- children: [
1764
- /* @__PURE__ */ jsx5(RotateCw, {}),
1765
- " Rotate"
1766
- ]
1767
- }
1768
- ),
1769
- /* @__PURE__ */ jsx5("span", { className: "text-muted-foreground tabular-nums", children: viewportLabel(viewport, devices) }),
1770
- /* @__PURE__ */ jsxs5(
1771
- Button,
1772
- {
1773
- variant: showsDeviceFrame ? "default" : "outline",
1774
- size: "sm",
1775
- "aria-pressed": showsDeviceFrame,
1776
- onClick: () => onShowsDeviceFrameChange(!showsDeviceFrame),
1777
- children: [
1778
- /* @__PURE__ */ jsx5(Smartphone, {}),
1779
- " Device frame"
1780
- ]
1781
- }
1782
- ),
1783
- hiddenPinCount > 0 && /* @__PURE__ */ jsxs5("span", { className: "ml-auto text-xs text-muted-foreground", children: [
1784
- hiddenPinCount,
1785
- " open pin(s) in other widths \u2014 pick their size in the comment list"
1786
- ] })
1787
- ] });
1788
- };
1789
- var WidthDragHandle = ({ scale, width, onWidthChange }) => {
1790
- const dragStartRef = useRef2(null);
1791
- return /* @__PURE__ */ jsx5(
1792
- "button",
1793
- {
1794
- type: "button",
1795
- "aria-label": `Viewport width ${width} px: drag to change`,
1796
- className: "absolute top-1/2 -right-6 z-30 h-24 w-3 -translate-y-1/2 cursor-ew-resize touch-none rounded-full bg-foreground/40 hover:bg-foreground/70",
1797
- onPointerDown: (event) => {
1798
- event.currentTarget.setPointerCapture(event.pointerId);
1799
- dragStartRef.current = { clientX: event.clientX, width };
1800
- },
1801
- onPointerMove: (event) => {
1802
- const dragStart = dragStartRef.current;
1803
- if (!dragStart) return;
1804
- onWidthChange(dragStart.width + (event.clientX - dragStart.clientX) / Math.max(0.05, scale));
1805
- },
1806
- onPointerUp: () => {
1807
- dragStartRef.current = null;
1808
- },
1809
- onKeyDown: (event) => {
1810
- if (event.key === "ArrowLeft") onWidthChange(width - 10);
1811
- if (event.key === "ArrowRight") onWidthChange(width + 10);
1812
- }
1813
- }
1814
- );
1815
- };
1816
1247
 
1817
1248
  // src/canvas/DesignCanvasFlow.tsx
1818
1249
  import "@xyflow/react/dist/style.css";
@@ -1827,26 +1258,26 @@ import {
1827
1258
  useStore as useStore3
1828
1259
  } from "@xyflow/react";
1829
1260
  import { ChevronDown, Hand, MousePointer2, Play } from "lucide-react";
1830
- import { useCallback, useEffect as useEffect5, useMemo, useRef as useRef3, useState as useState8 } from "react";
1261
+ import { useCallback, useEffect as useEffect4, useMemo, useRef as useRef3, useState as useState6 } from "react";
1831
1262
 
1832
1263
  // src/canvas/SectionNode.tsx
1833
1264
  import { useStore as useStore2 } from "@xyflow/react";
1834
1265
  import { memo as memo2 } from "react";
1835
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
1266
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
1836
1267
  var OVERVIEW_TITLE_SCREEN_PX = 15;
1837
1268
  var SectionNodeComponent = ({ data }) => {
1838
1269
  const { onZoomToSection } = useCanvasView();
1839
1270
  const zoom = useStore2((state) => data.isOverview ? Math.round(state.transform[2] * 1e3) / 1e3 : 1);
1840
1271
  if (!data.isOverview) {
1841
- return /* @__PURE__ */ jsx6("div", { className: "pointer-events-none h-full w-full rounded-[64px] bg-card/50 ring-2 ring-foreground/5 backdrop-blur-xl", children: /* @__PURE__ */ jsxs6(
1272
+ return /* @__PURE__ */ jsx5("div", { className: "pointer-events-none h-full w-full rounded-[64px] bg-card/50 ring-2 ring-foreground/5 backdrop-blur-xl", children: /* @__PURE__ */ jsxs5(
1842
1273
  "div",
1843
1274
  {
1844
1275
  className: "flex items-baseline gap-4 overflow-hidden text-ellipsis whitespace-nowrap",
1845
1276
  style: { padding: `${SECTION_PADDING}px ${SECTION_PADDING}px 0` },
1846
1277
  title: data.title,
1847
1278
  children: [
1848
- /* @__PURE__ */ jsx6("span", { className: "text-[56px] leading-none font-bold tracking-tight text-foreground", children: data.title }),
1849
- /* @__PURE__ */ jsxs6("span", { className: "text-[28px] leading-none text-muted-foreground", children: [
1279
+ /* @__PURE__ */ jsx5("span", { className: "text-[56px] leading-none font-bold tracking-tight text-foreground", children: data.title }),
1280
+ /* @__PURE__ */ jsxs5("span", { className: "text-[28px] leading-none text-muted-foreground", children: [
1850
1281
  data.boardCount,
1851
1282
  " boards"
1852
1283
  ] })
@@ -1855,7 +1286,7 @@ var SectionNodeComponent = ({ data }) => {
1855
1286
  ) });
1856
1287
  }
1857
1288
  const titleFontSize = Math.min(OVERVIEW_TITLE_SCREEN_PX / zoom, data.width / 7);
1858
- return /* @__PURE__ */ jsxs6(
1289
+ return /* @__PURE__ */ jsxs5(
1859
1290
  "button",
1860
1291
  {
1861
1292
  type: "button",
@@ -1864,21 +1295,21 @@ var SectionNodeComponent = ({ data }) => {
1864
1295
  className: "flex h-full w-full cursor-zoom-in flex-col overflow-hidden rounded-[64px] bg-card text-left shadow-surface-raised ring-1 ring-foreground/10 transition-shadow hover:ring-[24px] hover:ring-brand/40",
1865
1296
  style: { padding: titleFontSize },
1866
1297
  children: [
1867
- /* @__PURE__ */ jsxs6("span", { className: "block w-full", style: { fontSize: titleFontSize, lineHeight: 1.2 }, children: [
1868
- /* @__PURE__ */ jsx6("span", { className: "line-clamp-2 font-bold text-foreground", children: data.title }),
1869
- /* @__PURE__ */ jsxs6("span", { className: "block text-muted-foreground", style: { fontSize: titleFontSize * 0.8 }, children: [
1298
+ /* @__PURE__ */ jsxs5("span", { className: "block w-full", style: { fontSize: titleFontSize, lineHeight: 1.2 }, children: [
1299
+ /* @__PURE__ */ jsx5("span", { className: "line-clamp-2 font-bold text-foreground", children: data.title }),
1300
+ /* @__PURE__ */ jsxs5("span", { className: "block text-muted-foreground", style: { fontSize: titleFontSize * 0.8 }, children: [
1870
1301
  data.boardCount,
1871
1302
  " boards"
1872
1303
  ] })
1873
1304
  ] }),
1874
- /* @__PURE__ */ jsx6(
1305
+ /* @__PURE__ */ jsx5(
1875
1306
  "span",
1876
1307
  {
1877
1308
  className: "mt-auto grid min-h-0 flex-1 grid-cols-2 content-end",
1878
1309
  style: { gap: titleFontSize * 0.6, paddingTop: titleFontSize * 0.6 },
1879
1310
  children: data.coverUrls.map((coverUrl) => (
1880
1311
  // biome-ignore lint/performance/noImgElement: small cover thumbnails from the API at canvas scale
1881
- /* @__PURE__ */ jsx6(
1312
+ /* @__PURE__ */ jsx5(
1882
1313
  "img",
1883
1314
  {
1884
1315
  src: coverUrl,
@@ -1900,7 +1331,7 @@ var SectionNodeComponent = ({ data }) => {
1900
1331
  var SectionNode = memo2(SectionNodeComponent);
1901
1332
 
1902
1333
  // src/canvas/DesignCanvasFlow.tsx
1903
- import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
1334
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
1904
1335
  var NODE_TYPES = { board: BoardNode, section: SectionNode };
1905
1336
  var ZOOM_PRESETS = [0.25, 0.5, 1];
1906
1337
  var MIN_ZOOM = 5e-3;
@@ -1926,8 +1357,8 @@ var ZoomMenu = ({ onFitAll }) => {
1926
1357
  const { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } = useDesignStudioComponents();
1927
1358
  const reactFlow = useReactFlow();
1928
1359
  const zoomPercent = useStore3((state) => Math.round(state.transform[2] * 100));
1929
- return /* @__PURE__ */ jsxs7(DropdownMenu, { modal: false, children: [
1930
- /* @__PURE__ */ jsx7(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs7(
1360
+ return /* @__PURE__ */ jsxs6(DropdownMenu, { modal: false, children: [
1361
+ /* @__PURE__ */ jsx6(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(
1931
1362
  "button",
1932
1363
  {
1933
1364
  type: "button",
@@ -1936,19 +1367,19 @@ var ZoomMenu = ({ onFitAll }) => {
1936
1367
  children: [
1937
1368
  zoomPercent,
1938
1369
  "%",
1939
- /* @__PURE__ */ jsx7(ChevronDown, { className: "size-3.5 text-muted-foreground", "aria-hidden": true })
1370
+ /* @__PURE__ */ jsx6(ChevronDown, { className: "size-3.5 text-muted-foreground", "aria-hidden": true })
1940
1371
  ]
1941
1372
  }
1942
1373
  ) }),
1943
- /* @__PURE__ */ jsxs7(DropdownMenuContent, { align: "end", children: [
1944
- ZOOM_PRESETS.map((zoom) => /* @__PURE__ */ jsxs7(DropdownMenuItem, { onSelect: () => void reactFlow.zoomTo(zoom, { duration: 250 }), children: [
1374
+ /* @__PURE__ */ jsxs6(DropdownMenuContent, { align: "end", children: [
1375
+ ZOOM_PRESETS.map((zoom) => /* @__PURE__ */ jsxs6(DropdownMenuItem, { onSelect: () => void reactFlow.zoomTo(zoom, { duration: 250 }), children: [
1945
1376
  Math.round(zoom * 100),
1946
1377
  " %"
1947
1378
  ] }, zoom)),
1948
- /* @__PURE__ */ jsx7(DropdownMenuSeparator, {}),
1949
- /* @__PURE__ */ jsx7(DropdownMenuItem, { onSelect: () => void reactFlow.zoomIn({ duration: 200 }), children: "Zoom in" }),
1950
- /* @__PURE__ */ jsx7(DropdownMenuItem, { onSelect: () => void reactFlow.zoomOut({ duration: 200 }), children: "Zoom out" }),
1951
- /* @__PURE__ */ jsx7(DropdownMenuItem, { onSelect: onFitAll, children: "Fit all" })
1379
+ /* @__PURE__ */ jsx6(DropdownMenuSeparator, {}),
1380
+ /* @__PURE__ */ jsx6(DropdownMenuItem, { onSelect: () => void reactFlow.zoomIn({ duration: 200 }), children: "Zoom in" }),
1381
+ /* @__PURE__ */ jsx6(DropdownMenuItem, { onSelect: () => void reactFlow.zoomOut({ duration: 200 }), children: "Zoom out" }),
1382
+ /* @__PURE__ */ jsx6(DropdownMenuItem, { onSelect: onFitAll, children: "Fit all" })
1952
1383
  ] })
1953
1384
  ] });
1954
1385
  };
@@ -2025,7 +1456,7 @@ var reuseUnchangedNodes = (previousNodes, nextNodes) => {
2025
1456
  };
2026
1457
  var useWheelZoom = (containerRef) => {
2027
1458
  const reactFlow = useReactFlow();
2028
- useEffect5(() => {
1459
+ useEffect4(() => {
2029
1460
  const container = containerRef.current;
2030
1461
  if (!container) return;
2031
1462
  const minLogZoom = Math.log(MIN_ZOOM);
@@ -2144,7 +1575,7 @@ var FlowCanvas = ({
2144
1575
  if (liveBoardsTimerRef.current) clearTimeout(liveBoardsTimerRef.current);
2145
1576
  liveBoardsTimerRef.current = null;
2146
1577
  }, []);
2147
- useEffect5(() => cancelLiveBoardsUpdate, [cancelLiveBoardsUpdate]);
1578
+ useEffect4(() => cancelLiveBoardsUpdate, [cancelLiveBoardsUpdate]);
2148
1579
  const updateLiveBoards = useCallback(
2149
1580
  (viewport) => {
2150
1581
  const container = containerRef.current;
@@ -2198,7 +1629,7 @@ var FlowCanvas = ({
2198
1629
  fitRect(layout.bounds, 400);
2199
1630
  }, [fitRect, layout]);
2200
1631
  const handledFitKeyRef = useRef3(null);
2201
- useEffect5(() => {
1632
+ useEffect4(() => {
2202
1633
  if (!fitRequest || handledFitKeyRef.current === fitRequest.key) return;
2203
1634
  handledFitKeyRef.current = fitRequest.key;
2204
1635
  fitNodes(fitRequest.nodeIds);
@@ -2224,7 +1655,7 @@ var FlowCanvas = ({
2224
1655
  }
2225
1656
  }, [layout, initialFitNodeIds, fitNodes, fitRect, reactFlow, updateLiveBoards]);
2226
1657
  const viewportCommitTimerRef = useRef3(null);
2227
- useEffect5(
1658
+ useEffect4(
2228
1659
  () => () => {
2229
1660
  if (viewportCommitTimerRef.current) clearTimeout(viewportCommitTimerRef.current);
2230
1661
  },
@@ -2241,13 +1672,13 @@ var FlowCanvas = ({
2241
1672
  onViewportCommit?.(viewport);
2242
1673
  }, VIEWPORT_COMMIT_MS);
2243
1674
  };
2244
- useEffect5(() => {
1675
+ useEffect4(() => {
2245
1676
  fitInitialView();
2246
1677
  }, [fitInitialView]);
2247
- useEffect5(() => {
1678
+ useEffect4(() => {
2248
1679
  if (hasInitialFitRef.current) updateLiveBoards(reactFlow.getViewport());
2249
1680
  }, [reactFlow, updateLiveBoards]);
2250
- useEffect5(() => {
1681
+ useEffect4(() => {
2251
1682
  const container = containerRef.current;
2252
1683
  if (!container) return;
2253
1684
  const resizeObserver = new ResizeObserver(() => {
@@ -2257,7 +1688,7 @@ var FlowCanvas = ({
2257
1688
  resizeObserver.observe(container);
2258
1689
  return () => resizeObserver.disconnect();
2259
1690
  }, [reactFlow, updateLiveBoards, fitInitialView]);
2260
- useEffect5(() => {
1691
+ useEffect4(() => {
2261
1692
  const onKeyDown = (event) => {
2262
1693
  const target = event.target;
2263
1694
  if (target && (target.tagName === "TEXTAREA" || target.tagName === "INPUT" || target.isContentEditable)) return;
@@ -2294,7 +1725,7 @@ var FlowCanvas = ({
2294
1725
  const presentationStart = findSectionPresentationStart(layout.sections, selectedNodeId, sectionInView());
2295
1726
  if (presentationStart) onPresentSection(presentationStart.sectionId, presentationStart.boardId);
2296
1727
  };
2297
- const [marquee, setMarquee] = useState8(null);
1728
+ const [marquee, setMarquee] = useState6(null);
2298
1729
  const isMarqueeJustEndedRef = useRef3(false);
2299
1730
  const startMarquee = (event) => {
2300
1731
  const target = event.target;
@@ -2343,14 +1774,14 @@ var FlowCanvas = ({
2343
1774
  const minimapHeight = Math.round(
2344
1775
  Math.min(180, Math.max(60, MINIMAP_WIDTH * layout.bounds.height / Math.max(1, layout.bounds.width)))
2345
1776
  );
2346
- return /* @__PURE__ */ jsxs7(
1777
+ return /* @__PURE__ */ jsxs6(
2347
1778
  "div",
2348
1779
  {
2349
1780
  ref: containerRef,
2350
1781
  className: cx("relative h-full w-full", tool === "hand" && "cursor-grab active:cursor-grabbing"),
2351
1782
  onPointerDownCapture: startMarquee,
2352
1783
  children: [
2353
- marquee && /* @__PURE__ */ jsx7(
1784
+ marquee && /* @__PURE__ */ jsx6(
2354
1785
  "div",
2355
1786
  {
2356
1787
  "aria-hidden": true,
@@ -2363,7 +1794,7 @@ var FlowCanvas = ({
2363
1794
  }
2364
1795
  }
2365
1796
  ),
2366
- /* @__PURE__ */ jsxs7(
1797
+ /* @__PURE__ */ jsxs6(
2367
1798
  ReactFlow,
2368
1799
  {
2369
1800
  nodes,
@@ -2396,13 +1827,13 @@ var FlowCanvas = ({
2396
1827
  selectionOnDrag: false,
2397
1828
  proOptions: { hideAttribution: true },
2398
1829
  children: [
2399
- /* @__PURE__ */ jsx7(Background, { variant: BackgroundVariant.Dots, gap: 32, size: 1.5, color: "var(--tint-strong)" }),
2400
- /* @__PURE__ */ jsxs7(Panel, { position: "top-left", className: "flex max-w-[calc(100%-32rem)] flex-wrap items-center gap-2", children: [
2401
- /* @__PURE__ */ jsx7("div", { className: TOOLBAR_GROUP_CLASS, role: "toolbar", "aria-label": "Canvas tools", children: [
1830
+ /* @__PURE__ */ jsx6(Background, { variant: BackgroundVariant.Dots, gap: 32, size: 1.5, color: "var(--tint-strong)" }),
1831
+ /* @__PURE__ */ jsxs6(Panel, { position: "top-left", className: "flex max-w-[calc(100%-32rem)] flex-wrap items-center gap-2", children: [
1832
+ /* @__PURE__ */ jsx6("div", { className: TOOLBAR_GROUP_CLASS, role: "toolbar", "aria-label": "Canvas tools", children: [
2402
1833
  ["hand", Hand, "Pan (H / Esc) \u2014 drag moves the canvas, click selects a board"],
2403
1834
  ["select", MousePointer2, "Select area (V) \u2014 drag a rectangle to select boards, Space + drag pans"]
2404
- ].map(([toolName, Icon, label]) => /* @__PURE__ */ jsxs7(Tooltip, { children: [
2405
- /* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx7(
1835
+ ].map(([toolName, Icon, label]) => /* @__PURE__ */ jsxs6(Tooltip, { children: [
1836
+ /* @__PURE__ */ jsx6(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx6(
2406
1837
  "button",
2407
1838
  {
2408
1839
  type: "button",
@@ -2410,32 +1841,32 @@ var FlowCanvas = ({
2410
1841
  "aria-pressed": tool === toolName,
2411
1842
  onClick: () => onToolChange(toolName),
2412
1843
  className: cx(TOOL_BUTTON_CLASS, tool === toolName && "bg-brand-light text-brand-emphasis"),
2413
- children: /* @__PURE__ */ jsx7(Icon, { className: "size-4" })
1844
+ children: /* @__PURE__ */ jsx6(Icon, { className: "size-4" })
2414
1845
  }
2415
1846
  ) }),
2416
- /* @__PURE__ */ jsx7(TooltipContent, { side: "bottom", children: label })
1847
+ /* @__PURE__ */ jsx6(TooltipContent, { side: "bottom", children: label })
2417
1848
  ] }, toolName)) }),
2418
1849
  toolbarStart
2419
1850
  ] }),
2420
- /* @__PURE__ */ jsx7(Panel, { position: "top-right", children: /* @__PURE__ */ jsxs7("div", { className: TOOLBAR_GROUP_CLASS, children: [
1851
+ /* @__PURE__ */ jsx6(Panel, { position: "top-right", children: /* @__PURE__ */ jsxs6("div", { className: TOOLBAR_GROUP_CLASS, children: [
2421
1852
  toolbarEnd,
2422
- /* @__PURE__ */ jsxs7(Tooltip, { children: [
2423
- /* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx7(
1853
+ /* @__PURE__ */ jsxs6(Tooltip, { children: [
1854
+ /* @__PURE__ */ jsx6(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx6(
2424
1855
  "button",
2425
1856
  {
2426
1857
  type: "button",
2427
1858
  "aria-label": "Present the section in view",
2428
1859
  onClick: presentCurrentSection,
2429
1860
  className: TOOL_BUTTON_CLASS,
2430
- children: /* @__PURE__ */ jsx7(Play, { className: "size-4" })
1861
+ children: /* @__PURE__ */ jsx6(Play, { className: "size-4" })
2431
1862
  }
2432
1863
  ) }),
2433
- /* @__PURE__ */ jsx7(TooltipContent, { side: "bottom", children: "Present this section (\u2190 / \u2192)" })
1864
+ /* @__PURE__ */ jsx6(TooltipContent, { side: "bottom", children: "Present this section (\u2190 / \u2192)" })
2434
1865
  ] }),
2435
- /* @__PURE__ */ jsx7(ZoomMenu, { onFitAll: fitAll })
1866
+ /* @__PURE__ */ jsx6(ZoomMenu, { onFitAll: fitAll })
2436
1867
  ] }) }),
2437
- /* @__PURE__ */ jsx7(Panel, { position: "bottom-left", className: "pointer-events-none", children: /* @__PURE__ */ jsx7("p", { className: "surface-glass-strong rounded-xl px-3 py-1.5 text-xs text-muted-foreground ring-1 ring-foreground/5", children: "Drag to pan \xB7 Scroll or pinch to zoom \xB7 Click selects \xB7 Double-click opens \xB7 + / \u2212 / 0 \xB7 Shift+1 fits all" }) }),
2438
- !isEverythingVisible && /* @__PURE__ */ jsx7(
1868
+ /* @__PURE__ */ jsx6(Panel, { position: "bottom-left", className: "pointer-events-none", children: /* @__PURE__ */ jsx6("p", { className: "surface-glass-strong rounded-xl px-3 py-1.5 text-xs text-muted-foreground ring-1 ring-foreground/5", children: "Drag to pan \xB7 Scroll or pinch to zoom \xB7 Click selects \xB7 Double-click opens \xB7 + / \u2212 / 0 \xB7 Shift+1 fits all" }) }),
1869
+ !isEverythingVisible && /* @__PURE__ */ jsx6(
2439
1870
  MiniMap,
2440
1871
  {
2441
1872
  pannable: true,
@@ -2459,10 +1890,10 @@ var FlowCanvas = ({
2459
1890
  }
2460
1891
  );
2461
1892
  };
2462
- var DesignCanvasFlow = (props) => /* @__PURE__ */ jsx7(ReactFlowProvider, { children: /* @__PURE__ */ jsx7(FlowCanvas, { ...props }) });
1893
+ var DesignCanvasFlow = (props) => /* @__PURE__ */ jsx6(ReactFlowProvider, { children: /* @__PURE__ */ jsx6(FlowCanvas, { ...props }) });
2463
1894
 
2464
1895
  // src/canvas/DesignStudioCanvasScreen.tsx
2465
- import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
1896
+ import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
2466
1897
  var CANVAS_STATE_KEYS = ["q", "section", "status", "theme", "mode", "vp"];
2467
1898
  var UNCOUNTED_CANVAS_STATE_KEYS = ["q", "theme", "mode", "vp"];
2468
1899
  var LIVE_UPDATE_POLL_MS = 15e3;
@@ -2471,8 +1902,8 @@ var OPEN_RENDER_STATUSES = /* @__PURE__ */ new Set(["QUEUED", "RUNNING", "WAITIN
2471
1902
  var MAX_PRIORITY_BOARDS = 200;
2472
1903
  var LIVE_UPDATE_TOAST_ID = "design-canvas-live-update";
2473
1904
  var usePageVisible = () => {
2474
- const [isVisible, setIsVisible] = useState9(true);
2475
- useEffect6(() => {
1905
+ const [isVisible, setIsVisible] = useState7(true);
1906
+ useEffect5(() => {
2476
1907
  const update = () => setIsVisible(document.visibilityState === "visible");
2477
1908
  update();
2478
1909
  document.addEventListener("visibilitychange", update);
@@ -2491,7 +1922,7 @@ var useCollapsedSidebarWhileMounted = (useSidebarCollapsed = useNoSidebar) => {
2491
1922
  const collapsedByCanvasRef = useRef4(false);
2492
1923
  const toggleRef = useRef4(toggleCollapsed);
2493
1924
  toggleRef.current = toggleCollapsed;
2494
- useEffect6(() => {
1925
+ useEffect5(() => {
2495
1926
  if (!isCollapsed) {
2496
1927
  collapsedByCanvasRef.current = true;
2497
1928
  toggleRef.current();
@@ -2523,17 +1954,17 @@ var SelectedBoardPanel = ({
2523
1954
  }) => {
2524
1955
  const { Button } = useDesignStudioComponents();
2525
1956
  const texts = useDesignStudioTexts();
2526
- const [showResolved, setShowResolved] = useState9(false);
2527
- return /* @__PURE__ */ jsxs8("div", { className: "space-y-5", children: [
2528
- /* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
2529
- board.code && /* @__PURE__ */ jsx8("p", { className: "text-sm font-semibold tabular-nums text-foreground/70", children: board.code }),
2530
- /* @__PURE__ */ jsx8("h2", { className: "text-title-card font-semibold break-words", children: board.title }),
2531
- /* @__PURE__ */ jsxs8("p", { className: "text-xs text-muted-foreground", children: [
1957
+ const [showResolved, setShowResolved] = useState7(false);
1958
+ return /* @__PURE__ */ jsxs7("div", { className: "space-y-5", children: [
1959
+ /* @__PURE__ */ jsxs7("div", { className: "space-y-1", children: [
1960
+ board.code && /* @__PURE__ */ jsx7("p", { className: "text-sm font-semibold tabular-nums text-foreground/70", children: board.code }),
1961
+ /* @__PURE__ */ jsx7("h2", { className: "text-title-card font-semibold break-words", children: board.title }),
1962
+ /* @__PURE__ */ jsxs7("p", { className: "text-xs text-muted-foreground", children: [
2532
1963
  sectionTitle ? `${sectionTitle} \xB7 ` : "",
2533
1964
  board.boardKey
2534
1965
  ] })
2535
1966
  ] }),
2536
- /* @__PURE__ */ jsx8(
1967
+ /* @__PURE__ */ jsx7(
2537
1968
  BoardStatusChips,
2538
1969
  {
2539
1970
  projectKey,
@@ -2544,22 +1975,22 @@ var SelectedBoardPanel = ({
2544
1975
  onStatusChanged
2545
1976
  }
2546
1977
  ),
2547
- /* @__PURE__ */ jsxs8("div", { className: "flex gap-2", children: [
2548
- /* @__PURE__ */ jsxs8(Button, { variant: "outline", className: "flex-1", onClick: onOpen, children: [
2549
- /* @__PURE__ */ jsx8(Maximize22, {}),
1978
+ /* @__PURE__ */ jsxs7("div", { className: "flex gap-2", children: [
1979
+ /* @__PURE__ */ jsxs7(Button, { variant: "outline", className: "flex-1", onClick: onOpen, children: [
1980
+ /* @__PURE__ */ jsx7(Maximize22, {}),
2550
1981
  " Open focus view"
2551
1982
  ] }),
2552
- onCopyLink && /* @__PURE__ */ jsxs8(Button, { variant: "outline", onClick: onCopyLink, "aria-label": `${texts.copyBoardLink}: ${board.code ?? ""}`, children: [
2553
- /* @__PURE__ */ jsx8(Link2, {}),
1983
+ onCopyLink && /* @__PURE__ */ jsxs7(Button, { variant: "outline", onClick: onCopyLink, "aria-label": `${texts.copyBoardLink}: ${board.code ?? ""}`, children: [
1984
+ /* @__PURE__ */ jsx7(Link2, {}),
2554
1985
  " ",
2555
1986
  texts.copyBoardLink
2556
1987
  ] })
2557
1988
  ] }),
2558
- board.contentHash && /* @__PURE__ */ jsxs8("p", { className: "text-xs text-muted-foreground", title: `Content hash of the board file: ${board.contentHash}`, children: [
1989
+ board.contentHash && /* @__PURE__ */ jsxs7("p", { className: "text-xs text-muted-foreground", title: `Content hash of the board file: ${board.contentHash}`, children: [
2559
1990
  "Version ",
2560
- /* @__PURE__ */ jsx8("span", { className: "font-mono", children: shortContentHash(board.contentHash) })
1991
+ /* @__PURE__ */ jsx7("span", { className: "font-mono", children: shortContentHash(board.contentHash) })
2561
1992
  ] }),
2562
- /* @__PURE__ */ jsx8(
1993
+ /* @__PURE__ */ jsx7(
2563
1994
  BoardComments,
2564
1995
  {
2565
1996
  projectKey,
@@ -2584,6 +2015,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2584
2015
  api,
2585
2016
  components,
2586
2017
  notify,
2018
+ paths,
2587
2019
  router,
2588
2020
  shell,
2589
2021
  statuses: statusDefinitions,
@@ -2609,17 +2041,17 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2609
2041
  const writeSearchParams = router.useSearchParamsWriter();
2610
2042
  const writesAllowed = useCanWrite();
2611
2043
  const isPageVisible = usePageVisible();
2612
- const [statusOverrides, setStatusOverrides] = useState9(/* @__PURE__ */ new Map());
2613
- const [liveBoardIds, setLiveBoardIds] = useState9(/* @__PURE__ */ new Set());
2614
- const [selectedBoardId, setSelectedBoardId] = useState9(null);
2615
- const [selectedBoardIds, setSelectedBoardIds] = useState9(/* @__PURE__ */ new Set());
2616
- const [focusedBoardId, setFocusedBoardId] = useState9(null);
2617
- const [frameHeightMode, setFrameHeightMode] = useState9("viewport");
2618
- const [chosenFocusViewport, setChosenFocusViewport] = useState9(null);
2619
- const [presentSectionId, setPresentSectionId] = useState9(null);
2620
- const [fitRequest, setFitRequest] = useState9(null);
2621
- const [tool, setTool] = useState9("hand");
2622
- const [isCommentsPanelOpen, setIsCommentsPanelOpen] = useState9(
2044
+ const [statusOverrides, setStatusOverrides] = useState7(/* @__PURE__ */ new Map());
2045
+ const [liveBoardIds, setLiveBoardIds] = useState7(/* @__PURE__ */ new Set());
2046
+ const [selectedBoardId, setSelectedBoardId] = useState7(null);
2047
+ const [selectedBoardIds, setSelectedBoardIds] = useState7(/* @__PURE__ */ new Set());
2048
+ const [focusedBoardId, setFocusedBoardId] = useState7(null);
2049
+ const [frameHeightMode, setFrameHeightMode] = useState7("viewport");
2050
+ const [chosenFocusViewport, setChosenFocusViewport] = useState7(null);
2051
+ const [presentSectionId, setPresentSectionId] = useState7(null);
2052
+ const [fitRequest, setFitRequest] = useState7(null);
2053
+ const [tool, setTool] = useState7("hand");
2054
+ const [isCommentsPanelOpen, setIsCommentsPanelOpen] = useState7(
2623
2055
  () => Boolean(searchParams.get(CODE_PARAM)) || storage.read("commentsPanelOpen") !== "0"
2624
2056
  );
2625
2057
  const canvasState = router.useUrlState(CANVAS_STATE_KEYS, {
@@ -2636,16 +2068,16 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2636
2068
  const setSearch = useCallback2((value) => setCanvasStateValue("q", value), [setCanvasStateValue]);
2637
2069
  const setSectionFilter = useCallback2((value) => setCanvasStateValue("section", value), [setCanvasStateValue]);
2638
2070
  const setStatusFilter = useCallback2((value) => setCanvasStateValue("status", value), [setCanvasStateValue]);
2639
- const [isFullscreen, setIsFullscreen] = useState9(false);
2071
+ const [isFullscreen, setIsFullscreen] = useState7(false);
2640
2072
  const canvasAreaRef = useRef4(null);
2641
- const [canvasAspectRatio, setCanvasAspectRatio] = useState9(null);
2073
+ const [canvasAspectRatio, setCanvasAspectRatio] = useState7(null);
2642
2074
  useCollapsedSidebarWhileMounted(shell?.useSidebarCollapsed);
2643
2075
  const debouncedSearch = canvasState.debounced.q;
2644
- const [codeAtLoad] = useState9(() => searchParams.get(CODE_PARAM));
2645
- const [initialViewport] = useState9(
2076
+ const [codeAtLoad] = useState7(() => searchParams.get(CODE_PARAM));
2077
+ const [initialViewport] = useState7(
2646
2078
  () => codeAtLoad ? null : parseViewportParam(canvasState.values.vp)
2647
2079
  );
2648
- const [hasInitialFilterWithViewport] = useState9(
2080
+ const [hasInitialFilterWithViewport] = useState7(
2649
2081
  () => initialViewport !== null && Boolean(canvasState.values.q.trim() || canvasState.values.section || canvasState.values.status)
2650
2082
  );
2651
2083
  const currentViewportRef = useRef4(initialViewport ? formatViewportParam(initialViewport) : null);
@@ -2670,7 +2102,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2670
2102
  const themes = useMemo2(() => themesData?.designThemes.elements ?? [], [themesData]);
2671
2103
  const isDefaultLook = chosenThemeId === null && chosenMode === null;
2672
2104
  const isLookResolved = isDefaultLook || (overviewData !== void 0 || isOverviewError) && (!hasThemes || themesData !== void 0 || isThemesError);
2673
- const [loadedReferenceTheme, setLoadedReferenceTheme] = useState9(void 0);
2105
+ const [loadedReferenceTheme, setLoadedReferenceTheme] = useState7(void 0);
2674
2106
  const referenceTheme = loadedReferenceTheme !== void 0 ? loadedReferenceTheme : canvasSummary?.referenceTheme;
2675
2107
  const referenceLook = useMemo2(() => splitThemeReference(referenceTheme), [referenceTheme]);
2676
2108
  const referenceThemeId = referenceLook?.themeId ?? null;
@@ -2685,7 +2117,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2685
2117
  () => ({ projectKey, canvasKey, ...themeArgument ? { theme: themeArgument } : {} }),
2686
2118
  [projectKey, canvasKey, themeArgument]
2687
2119
  );
2688
- const [isRenderPolling, setIsRenderPolling] = useState9(false);
2120
+ const [isRenderPolling, setIsRenderPolling] = useState7(false);
2689
2121
  const {
2690
2122
  data,
2691
2123
  currentData: currentCanvasData,
@@ -2719,7 +2151,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2719
2151
  [statuses, statusDefinitions]
2720
2152
  );
2721
2153
  const canvasBoards = canvas?.boards?.elements;
2722
- const [shownBoards, setShownBoards] = useState9({
2154
+ const [shownBoards, setShownBoards] = useState7({
2723
2155
  source: void 0,
2724
2156
  themeReference: "",
2725
2157
  boards: [],
@@ -2779,7 +2211,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2779
2211
  const devices = useMemo2(() => canvas?.devices?.elements ?? [], [canvas?.devices]);
2780
2212
  const hasResponsiveBoards = useMemo2(() => shownBoardList.some((board) => isResponsiveBoard(board)), [shownBoardList]);
2781
2213
  const hasCanvas = Boolean(canvas);
2782
- useEffect6(() => {
2214
+ useEffect5(() => {
2783
2215
  const canvasArea = canvasAreaRef.current;
2784
2216
  if (!canvasArea) return;
2785
2217
  const measure = () => {
@@ -2798,7 +2230,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2798
2230
  const missingThumbnailCount = canvas?.missingThumbnailCount ?? 0;
2799
2231
  const renderStatus = canvas?.renderRequestStatus ?? null;
2800
2232
  const isRenderOpen = renderStatus !== null && OPEN_RENDER_STATUSES.has(renderStatus);
2801
- useEffect6(() => setIsRenderPolling(isRenderOpen), [isRenderOpen]);
2233
+ useEffect5(() => setIsRenderPolling(isRenderOpen), [isRenderOpen]);
2802
2234
  const [requestThumbnailRendering] = api.useRequestThumbnailRenderingMutation();
2803
2235
  const visibleBoardIdsRef = useRef4([]);
2804
2236
  const rememberVisibleBoardIds = useCallback2((visibleBoardIds) => {
@@ -2827,7 +2259,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2827
2259
  },
2828
2260
  [writesAllowed, currentCanvas, themeArgument, projectKey, canvasKey, requestThumbnailRendering]
2829
2261
  );
2830
- useEffect6(() => {
2262
+ useEffect5(() => {
2831
2263
  if (!currentCanvas?.isRendererEnabled || !currentCanvas.missingThumbnailCount) return;
2832
2264
  const currentStatus = currentCanvas.renderRequestStatus ?? null;
2833
2265
  if (currentStatus === "FAILED" || currentStatus !== null && OPEN_RENDER_STATUSES.has(currentStatus)) return;
@@ -2896,7 +2328,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2896
2328
  const filterKey = matchingBoardIds === null ? null : `${debouncedSearch.trim()}|${sectionFilter}|${statusFilter}`;
2897
2329
  const fittedFilterKeyRef = useRef4(null);
2898
2330
  const skipInitialFilterFitRef = useRef4(hasInitialFilterWithViewport);
2899
- useEffect6(() => {
2331
+ useEffect5(() => {
2900
2332
  if (filterKey === null || matchingBoardIds === null) {
2901
2333
  fittedFilterKeyRef.current = null;
2902
2334
  return;
@@ -2945,7 +2377,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2945
2377
  );
2946
2378
  const boardParam = searchParams.get(BOARD_PARAM);
2947
2379
  const isDeepLinkHandledRef = useRef4(false);
2948
- useEffect6(() => {
2380
+ useEffect5(() => {
2949
2381
  if (isDeepLinkHandledRef.current || !boardParam || boards.length === 0) return;
2950
2382
  isDeepLinkHandledRef.current = true;
2951
2383
  const nodeId = boardNodeId(boardParam);
@@ -2956,7 +2388,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2956
2388
  }, [boardParam, boards.length, boardsByNodeId, requestFit, initialViewport]);
2957
2389
  const codeParam = searchParams.get(CODE_PARAM);
2958
2390
  const handledCodeRef = useRef4(null);
2959
- useEffect6(() => {
2391
+ useEffect5(() => {
2960
2392
  if (!codeParam) {
2961
2393
  if (handledCodeRef.current !== null) handledCodeRef.current = "";
2962
2394
  return;
@@ -2982,7 +2414,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
2982
2414
  }
2983
2415
  }, [codeParam, codeAtLoad, boards, isCommentsPanelOpen, writeSearchParams, notify, texts, requestFit]);
2984
2416
  const pendingCodeFitRef = useRef4(null);
2985
- useEffect6(() => {
2417
+ useEffect5(() => {
2986
2418
  const nodeId = pendingCodeFitRef.current;
2987
2419
  if (!nodeId || layout.sections.length === 0) return;
2988
2420
  pendingCodeFitRef.current = null;
@@ -3094,7 +2526,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3094
2526
  const seenRevisionRef = useRef4(null);
3095
2527
  const revision = currentRevisionData?.revision;
3096
2528
  const revisionLook = themeArgument ?? "";
3097
- useEffect6(() => {
2529
+ useEffect5(() => {
3098
2530
  if (!revision) return;
3099
2531
  const seen = seenRevisionRef.current;
3100
2532
  seenRevisionRef.current = { look: revisionLook, revision };
@@ -3102,7 +2534,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3102
2534
  void refetchCanvas();
3103
2535
  void refetchComments();
3104
2536
  }, [revision, revisionLook, refetchCanvas, refetchComments]);
3105
- useEffect6(() => {
2537
+ useEffect5(() => {
3106
2538
  if (isPageVisible && seenRevisionRef.current) void refetchRevision();
3107
2539
  }, [isPageVisible, refetchRevision]);
3108
2540
  const showBoard = useCallback2(
@@ -3115,7 +2547,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3115
2547
  );
3116
2548
  const layoutOrderRef = useRef4(layoutOrder);
3117
2549
  layoutOrderRef.current = layoutOrder;
3118
- useEffect6(() => {
2550
+ useEffect5(() => {
3119
2551
  const changedBoardKeys = shownBoards.changedBoardKeys;
3120
2552
  if (changedBoardKeys.length === 0) return;
3121
2553
  const changedNodeIds = new Set(changedBoardKeys.map((boardKey) => boardNodeId(boardKey)));
@@ -3190,7 +2622,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3190
2622
  const presentedSectionTitle = presentSectionId ? layout.sections.find((section) => section.id === presentSectionId)?.title ?? null : null;
3191
2623
  const copySelectedRef = useRef4(copySelectedReferences);
3192
2624
  copySelectedRef.current = copySelectedReferences;
3193
- useEffect6(() => {
2625
+ useEffect5(() => {
3194
2626
  const onKeyDown = (event) => {
3195
2627
  const target = event.target;
3196
2628
  if (target && (target.tagName === "TEXTAREA" || target.tagName === "INPUT" || target.isContentEditable)) return;
@@ -3204,10 +2636,10 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3204
2636
  return () => window.removeEventListener("keydown", onKeyDown);
3205
2637
  }, []);
3206
2638
  const activeFilterCount = (sectionFilter ? 1 : 0) + (statusFilter ? 1 : 0);
3207
- const toolbarStart = /* @__PURE__ */ jsxs8("div", { className: cx(TOOLBAR_GROUP_CLASS2, "min-w-0 pl-3"), children: [
3208
- /* @__PURE__ */ jsxs8("div", { className: "min-w-0 pr-1", children: [
3209
- /* @__PURE__ */ jsx8("h1", { className: "max-w-72 truncate text-sm leading-tight font-semibold", title: canvasName, children: canvasName }),
3210
- /* @__PURE__ */ jsxs8("p", { className: "text-xs leading-tight text-muted-foreground", children: [
2639
+ const toolbarStart = /* @__PURE__ */ jsxs7("div", { className: cx(TOOLBAR_GROUP_CLASS2, "min-w-0 pl-3"), children: [
2640
+ /* @__PURE__ */ jsxs7("div", { className: "min-w-0 pr-1", children: [
2641
+ /* @__PURE__ */ jsx7("h1", { className: "max-w-72 truncate text-sm leading-tight font-semibold", title: canvasName, children: canvasName }),
2642
+ /* @__PURE__ */ jsxs7("p", { className: "text-xs leading-tight text-muted-foreground", children: [
3211
2643
  boards.length,
3212
2644
  " boards \xB7 ",
3213
2645
  layout.sections.length,
@@ -3215,7 +2647,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3215
2647
  matchingBoardIds !== null ? ` \xB7 ${matchingBoardIds.size} matching` : ""
3216
2648
  ] })
3217
2649
  ] }),
3218
- /* @__PURE__ */ jsx8(
2650
+ /* @__PURE__ */ jsx7(
3219
2651
  SearchField,
3220
2652
  {
3221
2653
  size: "sm",
@@ -3227,15 +2659,15 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3227
2659
  className: "w-44"
3228
2660
  }
3229
2661
  ),
3230
- /* @__PURE__ */ jsxs8(Popover, { children: [
3231
- /* @__PURE__ */ jsx8(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs8("button", { type: "button", className: cx(TOOL_BUTTON_CLASS2, activeFilterCount > 0 && "text-brand-emphasis"), "aria-label": "Filters", children: [
3232
- /* @__PURE__ */ jsx8(ListFilter, { className: "size-4" }),
3233
- activeFilterCount > 0 && /* @__PURE__ */ jsx8("span", { className: "absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-primary text-[10px] font-bold text-primary-foreground", children: activeFilterCount })
2662
+ /* @__PURE__ */ jsxs7(Popover, { children: [
2663
+ /* @__PURE__ */ jsx7(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs7("button", { type: "button", className: cx(TOOL_BUTTON_CLASS2, activeFilterCount > 0 && "text-brand-emphasis"), "aria-label": "Filters", children: [
2664
+ /* @__PURE__ */ jsx7(ListFilter, { className: "size-4" }),
2665
+ activeFilterCount > 0 && /* @__PURE__ */ jsx7("span", { className: "absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-primary text-[10px] font-bold text-primary-foreground", children: activeFilterCount })
3234
2666
  ] }) }),
3235
- /* @__PURE__ */ jsxs8(PopoverContent, { align: "start", className: "w-[22rem] space-y-4 p-4", children: [
3236
- /* @__PURE__ */ jsxs8("div", { className: "space-y-1.5", children: [
3237
- /* @__PURE__ */ jsx8("p", { className: "text-[12.5px] font-bold text-muted-foreground", children: "Section" }),
3238
- /* @__PURE__ */ jsx8(
2667
+ /* @__PURE__ */ jsxs7(PopoverContent, { align: "start", className: "w-[22rem] space-y-4 p-4", children: [
2668
+ /* @__PURE__ */ jsxs7("div", { className: "space-y-1.5", children: [
2669
+ /* @__PURE__ */ jsx7("p", { className: "text-[12.5px] font-bold text-muted-foreground", children: "Section" }),
2670
+ /* @__PURE__ */ jsx7(
3239
2671
  Combobox,
3240
2672
  {
3241
2673
  size: "sm",
@@ -3249,9 +2681,9 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3249
2681
  }
3250
2682
  )
3251
2683
  ] }),
3252
- /* @__PURE__ */ jsxs8("div", { className: "space-y-1.5", children: [
3253
- /* @__PURE__ */ jsx8("p", { className: "text-[12.5px] font-bold text-muted-foreground", children: "Status" }),
3254
- /* @__PURE__ */ jsx8(
2684
+ /* @__PURE__ */ jsxs7("div", { className: "space-y-1.5", children: [
2685
+ /* @__PURE__ */ jsx7("p", { className: "text-[12.5px] font-bold text-muted-foreground", children: "Status" }),
2686
+ /* @__PURE__ */ jsx7(
3255
2687
  QuickFilterPills,
3256
2688
  {
3257
2689
  options: statusFilterOptions,
@@ -3263,7 +2695,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3263
2695
  }
3264
2696
  )
3265
2697
  ] }),
3266
- activeFilterCount > 0 && /* @__PURE__ */ jsx8(
2698
+ activeFilterCount > 0 && /* @__PURE__ */ jsx7(
3267
2699
  Button,
3268
2700
  {
3269
2701
  size: "sm",
@@ -3278,9 +2710,15 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3278
2710
  ] })
3279
2711
  ] })
3280
2712
  ] });
3281
- const toolbarEnd = /* @__PURE__ */ jsxs8(Fragment5, { children: [
3282
- hasResponsiveBoards && /* @__PURE__ */ jsxs8(Tooltip, { children: [
3283
- /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx8(
2713
+ const siteStartRoute = selectedBoard?.route ?? (shownBoardList.some((board) => board.route) ? "/" : null);
2714
+ const siteHref = paths.site && siteStartRoute !== null ? `${paths.site(projectKey, canvasKey, siteStartRoute)}${shownLook?.themeId ? `?theme=${encodeURIComponent(shownLook.themeId)}&mode=${shownLook.mode}` : ""}` : null;
2715
+ const toolbarEnd = /* @__PURE__ */ jsxs7(Fragment4, { children: [
2716
+ siteHref && /* @__PURE__ */ jsxs7(Tooltip, { children: [
2717
+ /* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx7("span", { children: /* @__PURE__ */ jsx7(router.Link, { href: siteHref, className: TOOL_BUTTON_CLASS2, children: /* @__PURE__ */ jsx7(Globe, { className: "size-4", "aria-label": texts.openAsWebsite }) }) }) }),
2718
+ /* @__PURE__ */ jsx7(TooltipContent, { side: "bottom", children: texts.openAsWebsite })
2719
+ ] }),
2720
+ hasResponsiveBoards && /* @__PURE__ */ jsxs7(Tooltip, { children: [
2721
+ /* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx7(
3284
2722
  "button",
3285
2723
  {
3286
2724
  type: "button",
@@ -3288,13 +2726,13 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3288
2726
  "aria-pressed": frameHeightMode === "page",
3289
2727
  "aria-label": frameHeightMode === "page" ? "Device frames: whole page" : "Device frames: one screen",
3290
2728
  onClick: () => setFrameHeightMode((mode) => mode === "page" ? "viewport" : "page"),
3291
- children: frameHeightMode === "page" ? /* @__PURE__ */ jsx8(FoldVertical, { className: "size-4" }) : /* @__PURE__ */ jsx8(UnfoldVertical, { className: "size-4" })
2729
+ children: frameHeightMode === "page" ? /* @__PURE__ */ jsx7(FoldVertical, { className: "size-4" }) : /* @__PURE__ */ jsx7(UnfoldVertical, { className: "size-4" })
3292
2730
  }
3293
2731
  ) }),
3294
- /* @__PURE__ */ jsx8(TooltipContent, { side: "bottom", children: frameHeightMode === "page" ? "Responsive boards: whole page \u2014 show one screen per device" : "Responsive boards: one screen \u2014 show the whole page per device" })
2732
+ /* @__PURE__ */ jsx7(TooltipContent, { side: "bottom", children: frameHeightMode === "page" ? "Responsive boards: whole page \u2014 show one screen per device" : "Responsive boards: one screen \u2014 show the whole page per device" })
3295
2733
  ] }),
3296
- /* @__PURE__ */ jsxs8(Tooltip, { children: [
3297
- /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx8(
2734
+ /* @__PURE__ */ jsxs7(Tooltip, { children: [
2735
+ /* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx7(
3298
2736
  "button",
3299
2737
  {
3300
2738
  type: "button",
@@ -3303,13 +2741,13 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3303
2741
  "aria-keyshortcuts": "r",
3304
2742
  "aria-busy": isFetchingCanvas,
3305
2743
  onClick: () => void reloadCanvas(),
3306
- children: /* @__PURE__ */ jsx8(RefreshCw, { className: cx("size-4", isFetchingCanvas && "animate-spin motion-reduce:animate-none") })
2744
+ children: /* @__PURE__ */ jsx7(RefreshCw, { className: cx("size-4", isFetchingCanvas && "animate-spin motion-reduce:animate-none") })
3307
2745
  }
3308
2746
  ) }),
3309
- /* @__PURE__ */ jsx8(TooltipContent, { side: "bottom", children: texts.reload })
2747
+ /* @__PURE__ */ jsx7(TooltipContent, { side: "bottom", children: texts.reload })
3310
2748
  ] }),
3311
- /* @__PURE__ */ jsxs8(Tooltip, { children: [
3312
- /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx8("span", { children: /* @__PURE__ */ jsxs8(
2749
+ /* @__PURE__ */ jsxs7(Tooltip, { children: [
2750
+ /* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx7("span", { children: /* @__PURE__ */ jsxs7(
3313
2751
  "button",
3314
2752
  {
3315
2753
  type: "button",
@@ -3318,14 +2756,14 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3318
2756
  "aria-label": `Copy reference of ${selectedBoardIds.size} selected board(s) for an agent (C)`,
3319
2757
  onClick: copySelectedReferences,
3320
2758
  children: [
3321
- /* @__PURE__ */ jsx8(ClipboardCopy4, { className: "size-4" }),
3322
- selectedBoardIds.size > 1 && /* @__PURE__ */ jsx8("span", { className: "absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-brand px-1 text-[10px] font-bold text-foreground", children: selectedBoardIds.size })
2759
+ /* @__PURE__ */ jsx7(ClipboardCopy3, { className: "size-4" }),
2760
+ selectedBoardIds.size > 1 && /* @__PURE__ */ jsx7("span", { className: "absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-brand px-1 text-[10px] font-bold text-foreground", children: selectedBoardIds.size })
3323
2761
  ]
3324
2762
  }
3325
2763
  ) }) }),
3326
- /* @__PURE__ */ jsx8(TooltipContent, { side: "bottom", children: selectedBoardIds.size === 0 ? "Select boards to copy their reference" : "Copy reference for an agent (C)" })
2764
+ /* @__PURE__ */ jsx7(TooltipContent, { side: "bottom", children: selectedBoardIds.size === 0 ? "Select boards to copy their reference" : "Copy reference for an agent (C)" })
3327
2765
  ] }),
3328
- hasThemes && themes.length > 0 && /* @__PURE__ */ jsx8(
2766
+ hasThemes && themes.length > 0 && /* @__PURE__ */ jsx7(
3329
2767
  Combobox,
3330
2768
  {
3331
2769
  shape: "pill",
@@ -3340,8 +2778,8 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3340
2778
  className: "w-44"
3341
2779
  }
3342
2780
  ),
3343
- isRendererEnabled && missingThumbnailCount > 0 && renderStatus !== null && renderStatus !== "DONE" ? /* @__PURE__ */ jsxs8(Tooltip, { children: [
3344
- /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs8(
2781
+ isRendererEnabled && missingThumbnailCount > 0 && renderStatus !== null && renderStatus !== "DONE" ? /* @__PURE__ */ jsxs7(Tooltip, { children: [
2782
+ /* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs7(
3345
2783
  "button",
3346
2784
  {
3347
2785
  type: "button",
@@ -3349,7 +2787,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3349
2787
  className: "flex h-8 shrink-0 items-center gap-1.5 rounded-full bg-tint px-3 text-xs font-semibold text-muted-foreground transition-colors enabled:hover:bg-tint-strong enabled:hover:text-foreground",
3350
2788
  onClick: () => fileRenderRequest(true),
3351
2789
  children: [
3352
- renderStatus === "FAILED" ? /* @__PURE__ */ jsx8(ImageDown, { className: "size-4", "aria-hidden": true }) : /* @__PURE__ */ jsx8(LoaderCircle, { className: "size-4 animate-spin motion-reduce:animate-none", "aria-hidden": true }),
2790
+ renderStatus === "FAILED" ? /* @__PURE__ */ jsx7(ImageDown, { className: "size-4", "aria-hidden": true }) : /* @__PURE__ */ jsx7(LoaderCircle, { className: "size-4 animate-spin motion-reduce:animate-none", "aria-hidden": true }),
3353
2791
  renderStatus === "FAILED" ? texts.thumbnailsFailed : renderStatus === "WAITING_FOR_RENDERER" ? texts.thumbnailsWaitingForRenderer(shownThemeLabel) : texts.thumbnailsRendering(shownThemeLabel),
3354
2792
  " ",
3355
2793
  "\xB7 ",
@@ -3359,13 +2797,13 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3359
2797
  ]
3360
2798
  }
3361
2799
  ) }),
3362
- /* @__PURE__ */ jsxs8(TooltipContent, { side: "bottom", className: "max-w-sm", children: [
2800
+ /* @__PURE__ */ jsxs7(TooltipContent, { side: "bottom", className: "max-w-sm", children: [
3363
2801
  texts.thumbnailsMissing(missingThumbnailCount),
3364
2802
  canvas?.renderRequestError ? ` ${texts.thumbnailsLastError(canvas.renderRequestError)}` : ""
3365
2803
  ] })
3366
2804
  ] }) : null,
3367
- hasThemes && themes.length > 0 && /* @__PURE__ */ jsxs8(Tooltip, { children: [
3368
- /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx8("span", { children: /* @__PURE__ */ jsx8(
2805
+ hasThemes && themes.length > 0 && /* @__PURE__ */ jsxs7(Tooltip, { children: [
2806
+ /* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx7("span", { children: /* @__PURE__ */ jsx7(
3369
2807
  "button",
3370
2808
  {
3371
2809
  type: "button",
@@ -3377,13 +2815,13 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3377
2815
  const nextMode = effectiveMode === "dark" ? "light" : "dark";
3378
2816
  setCanvasStateValue("mode", nextMode === defaultMode ? "" : nextMode);
3379
2817
  },
3380
- children: effectiveMode === "dark" ? /* @__PURE__ */ jsx8(Sun, { className: "size-4" }) : /* @__PURE__ */ jsx8(Moon, { className: "size-4" })
2818
+ children: effectiveMode === "dark" ? /* @__PURE__ */ jsx7(Sun, { className: "size-4" }) : /* @__PURE__ */ jsx7(Moon, { className: "size-4" })
3381
2819
  }
3382
2820
  ) }) }),
3383
- /* @__PURE__ */ jsx8(TooltipContent, { side: "bottom", children: supportsDark ? effectiveMode === "dark" ? "Light theme" : "Dark theme" : texts.themeWithoutDarkMode })
2821
+ /* @__PURE__ */ jsx7(TooltipContent, { side: "bottom", children: supportsDark ? effectiveMode === "dark" ? "Light theme" : "Dark theme" : texts.themeWithoutDarkMode })
3384
2822
  ] }),
3385
- /* @__PURE__ */ jsxs8(Tooltip, { children: [
3386
- /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs8(
2823
+ /* @__PURE__ */ jsxs7(Tooltip, { children: [
2824
+ /* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs7(
3387
2825
  "button",
3388
2826
  {
3389
2827
  type: "button",
@@ -3392,15 +2830,15 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3392
2830
  "aria-pressed": isCommentsPanelOpen,
3393
2831
  onClick: toggleCommentsPanel,
3394
2832
  children: [
3395
- isCommentsPanelOpen ? /* @__PURE__ */ jsx8(PanelRightClose, { className: "size-4" }) : /* @__PURE__ */ jsx8(PanelRightOpen, { className: "size-4" }),
3396
- openThreadTotal > 0 && /* @__PURE__ */ jsx8("span", { className: "absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-primary px-1 text-[10px] font-bold text-primary-foreground", children: openThreadTotal })
2833
+ isCommentsPanelOpen ? /* @__PURE__ */ jsx7(PanelRightClose, { className: "size-4" }) : /* @__PURE__ */ jsx7(PanelRightOpen, { className: "size-4" }),
2834
+ openThreadTotal > 0 && /* @__PURE__ */ jsx7("span", { className: "absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-primary px-1 text-[10px] font-bold text-primary-foreground", children: openThreadTotal })
3397
2835
  ]
3398
2836
  }
3399
2837
  ) }),
3400
- /* @__PURE__ */ jsx8(TooltipContent, { side: "bottom", children: isCommentsPanelOpen ? "Hide comments" : "Show comments" })
2838
+ /* @__PURE__ */ jsx7(TooltipContent, { side: "bottom", children: isCommentsPanelOpen ? "Hide comments" : "Show comments" })
3401
2839
  ] }),
3402
- /* @__PURE__ */ jsxs8(Tooltip, { children: [
3403
- /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx8(
2840
+ /* @__PURE__ */ jsxs7(Tooltip, { children: [
2841
+ /* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx7(
3404
2842
  "button",
3405
2843
  {
3406
2844
  type: "button",
@@ -3408,13 +2846,13 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3408
2846
  "aria-label": isFullscreen ? "Exit fullscreen (F)" : "Fullscreen (F)",
3409
2847
  "aria-pressed": isFullscreen,
3410
2848
  onClick: () => setIsFullscreen((value) => !value),
3411
- children: isFullscreen ? /* @__PURE__ */ jsx8(Minimize, { className: "size-4" }) : /* @__PURE__ */ jsx8(Maximize, { className: "size-4" })
2849
+ children: isFullscreen ? /* @__PURE__ */ jsx7(Minimize, { className: "size-4" }) : /* @__PURE__ */ jsx7(Maximize, { className: "size-4" })
3412
2850
  }
3413
2851
  ) }),
3414
- /* @__PURE__ */ jsx8(TooltipContent, { side: "bottom", children: isFullscreen ? "Exit fullscreen (F)" : "Fullscreen (F)" })
2852
+ /* @__PURE__ */ jsx7(TooltipContent, { side: "bottom", children: isFullscreen ? "Exit fullscreen (F)" : "Fullscreen (F)" })
3415
2853
  ] })
3416
2854
  ] });
3417
- return /* @__PURE__ */ jsxs8(
2855
+ return /* @__PURE__ */ jsxs7(
3418
2856
  "div",
3419
2857
  {
3420
2858
  "data-page-frame": true,
@@ -3425,17 +2863,17 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3425
2863
  isFullscreen && "fixed inset-0 z-40 h-dvh bg-background"
3426
2864
  ),
3427
2865
  children: [
3428
- error && /* @__PURE__ */ jsx8("div", { className: "p-6", children: /* @__PURE__ */ jsx8(
2866
+ error && /* @__PURE__ */ jsx7("div", { className: "p-6", children: /* @__PURE__ */ jsx7(
3429
2867
  StatusCallout,
3430
2868
  {
3431
2869
  tone: "destructive",
3432
2870
  title: "The canvas could not be loaded",
3433
- description: normalizeDddError3(error, "Request failed").message
2871
+ description: normalizeDddError2(error, "Request failed").message
3434
2872
  }
3435
2873
  ) }),
3436
- (isLoading || !isLookResolved && !canvas) && /* @__PURE__ */ jsx8(Skeleton, { className: "m-6 flex-1 rounded-2xl" }),
3437
- canvas && /* @__PURE__ */ jsxs8(CanvasViewContext.Provider, { value: canvasView, children: [
3438
- /* @__PURE__ */ jsx8("div", { ref: canvasAreaRef, className: "relative min-h-[480px] min-w-0 flex-1", children: canvasAspectRatio !== null && /* @__PURE__ */ jsx8(
2874
+ (isLoading || !isLookResolved && !canvas) && /* @__PURE__ */ jsx7(Skeleton, { className: "m-6 flex-1 rounded-2xl" }),
2875
+ canvas && /* @__PURE__ */ jsxs7(CanvasViewContext.Provider, { value: canvasView, children: [
2876
+ /* @__PURE__ */ jsx7("div", { ref: canvasAreaRef, className: "relative min-h-[480px] min-w-0 flex-1", children: canvasAspectRatio !== null && /* @__PURE__ */ jsx7(
3439
2877
  DesignCanvasFlow,
3440
2878
  {
3441
2879
  layout,
@@ -3457,7 +2895,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3457
2895
  selectedNodeId: selectedBoardId
3458
2896
  }
3459
2897
  ) }),
3460
- isCommentsPanelOpen && /* @__PURE__ */ jsx8("aside", { className: "surface-glass-strong m-3 shrink-0 overflow-y-auto rounded-3xl p-5 ring-1 ring-foreground/5 lg:my-3 lg:ml-0 lg:w-[380px]", children: selectedBoard ? /* @__PURE__ */ jsx8(
2898
+ isCommentsPanelOpen && /* @__PURE__ */ jsx7("aside", { className: "surface-glass-strong m-3 shrink-0 overflow-y-auto rounded-3xl p-5 ring-1 ring-foreground/5 lg:my-3 lg:ml-0 lg:w-[380px]", children: selectedBoard ? /* @__PURE__ */ jsx7(
3461
2899
  SelectedBoardPanel,
3462
2900
  {
3463
2901
  projectKey,
@@ -3473,13 +2911,13 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3473
2911
  onCopyThreadReference: copyThreadReference
3474
2912
  },
3475
2913
  selectedBoard.boardKey ?? ""
3476
- ) : /* @__PURE__ */ jsxs8("div", { className: "space-y-4", children: [
3477
- /* @__PURE__ */ jsxs8("div", { children: [
3478
- /* @__PURE__ */ jsx8("h2", { className: "text-title-card font-semibold", children: "Open comments" }),
3479
- /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "Click a board to see its status and comments, double-click to open it large." })
2914
+ ) : /* @__PURE__ */ jsxs7("div", { className: "space-y-4", children: [
2915
+ /* @__PURE__ */ jsxs7("div", { children: [
2916
+ /* @__PURE__ */ jsx7("h2", { className: "text-title-card font-semibold", children: "Open comments" }),
2917
+ /* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: "Click a board to see its status and comments, double-click to open it large." })
3480
2918
  ] }),
3481
- boardsWithOpenThreads.length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "No open comments on this canvas." }),
3482
- /* @__PURE__ */ jsx8("ul", { className: "space-y-1", children: boardsWithOpenThreads.map((nodeId) => /* @__PURE__ */ jsx8("li", { children: /* @__PURE__ */ jsxs8(
2919
+ boardsWithOpenThreads.length === 0 && /* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: "No open comments on this canvas." }),
2920
+ /* @__PURE__ */ jsx7("ul", { className: "space-y-1", children: boardsWithOpenThreads.map((nodeId) => /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsxs7(
3483
2921
  "button",
3484
2922
  {
3485
2923
  type: "button",
@@ -3489,9 +2927,9 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3489
2927
  requestFit([nodeId]);
3490
2928
  },
3491
2929
  children: [
3492
- /* @__PURE__ */ jsx8("span", { className: "truncate", children: boardsByNodeId.get(nodeId)?.title }),
3493
- /* @__PURE__ */ jsxs8("span", { className: "inline-flex shrink-0 items-center gap-1 text-xs font-semibold text-muted-foreground", children: [
3494
- /* @__PURE__ */ jsx8(MessageSquare2, { className: "size-3.5", "aria-hidden": true }),
2930
+ /* @__PURE__ */ jsx7("span", { className: "truncate", children: boardsByNodeId.get(nodeId)?.title }),
2931
+ /* @__PURE__ */ jsxs7("span", { className: "inline-flex shrink-0 items-center gap-1 text-xs font-semibold text-muted-foreground", children: [
2932
+ /* @__PURE__ */ jsx7(MessageSquare2, { className: "size-3.5", "aria-hidden": true }),
3495
2933
  " ",
3496
2934
  openThreadCounts.get(nodeId)
3497
2935
  ] })
@@ -3500,7 +2938,7 @@ var DesignStudioCanvasScreen = ({ projectKey, canvasKey }) => {
3500
2938
  ) }, nodeId)) })
3501
2939
  ] }) })
3502
2940
  ] }),
3503
- /* @__PURE__ */ jsx8(
2941
+ /* @__PURE__ */ jsx7(
3504
2942
  BoardFocusView,
3505
2943
  {
3506
2944
  projectKey,