@mgamadeus/ddd-design-studio 0.1.0 → 0.2.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.
@@ -6,6 +6,7 @@ var oneLine = (text) => text.replace(/\s+/g, " ").trim();
6
6
  var buildDesignReference = (input) => {
7
7
  const fields = [
8
8
  `${DESIGN_REFERENCE_PREFIX} ${oneLine(input.projectName)} \u203A ${oneLine(input.canvasName)} \u203A ${oneLine(input.boardTitle)}`,
9
+ ...input.boardCode ? [`code ${oneLine(input.boardCode)}`] : [],
9
10
  `file ${input.boardKey}`,
10
11
  `canvas ${input.projectKey}/${input.canvasKey}`,
11
12
  `v${input.contentHash ? input.contentHash.slice(0, 7) : "?"}`,
@@ -60,6 +61,48 @@ var copyTextToClipboard = async (text) => {
60
61
  return isCopied;
61
62
  };
62
63
 
64
+ // src/canvas/boardKey.ts
65
+ var boardCodeOf = (boardKey) => boardKey.replace(/(?:\.dc)?\.html$/, "");
66
+
67
+ // src/canvas/boardCode.ts
68
+ var CODE_PARAM = "code";
69
+ var normalizeBoardCode = (code) => code.toUpperCase().replace(/[^A-Z0-9]/g, "");
70
+ var codeParts = (code) => code.trim().toUpperCase().split(/[\s-]+/).filter(Boolean);
71
+ var boardCodeMatches = (typedCode, boardCode) => {
72
+ const typed = normalizeBoardCode(typedCode);
73
+ if (!typed || !boardCode) return false;
74
+ const parts = codeParts(boardCode);
75
+ return parts.some((_, index) => parts.slice(index).join("") === typed);
76
+ };
77
+ var codeBelongsToCanvas = (typedCode, canvasCode) => {
78
+ const typed = normalizeBoardCode(typedCode);
79
+ if (!typed || !canvasCode) return false;
80
+ const parts = codeParts(canvasCode);
81
+ return parts.some((_, index) => {
82
+ const prefix = parts.slice(index).join("");
83
+ return typed.length > prefix.length && typed.startsWith(prefix);
84
+ });
85
+ };
86
+ var boardCodeUrlValue = (code) => codeParts(code).join("-");
87
+ var buildBoardCodeLink = (canvasPageUrl, code, themeId, mode) => {
88
+ const url = new URL(canvasPageUrl);
89
+ url.search = "";
90
+ url.hash = "";
91
+ url.searchParams.set(CODE_PARAM, boardCodeUrlValue(code));
92
+ if (themeId) {
93
+ url.searchParams.set("theme", themeId);
94
+ url.searchParams.set("mode", mode);
95
+ }
96
+ return url.toString().replace(/%3A/gi, ":");
97
+ };
98
+ var findBoardForCode = (boards, typedCode) => {
99
+ const byCode = boards.filter((board) => boardCodeMatches(typedCode, board.code));
100
+ if (byCode.length > 0) return byCode.length === 1 ? byCode[0] : null;
101
+ const typed = typedCode.trim().toLowerCase();
102
+ const byName = boards.filter((board) => board.boardKey && boardCodeOf(board.boardKey).toLowerCase() === typed);
103
+ return byName.length === 1 ? byName[0] : null;
104
+ };
105
+
63
106
  // src/canvas/designTheme.ts
64
107
  var splitThemeReference = (themeReference) => {
65
108
  const reference = (themeReference ?? "").trim();
@@ -86,7 +129,10 @@ var DEFAULT_DESIGN_STUDIO_TEXTS = {
86
129
  thumbnailsLastError: (error) => `Last error: ${error}`,
87
130
  themeWithoutDarkMode: "This theme has no dark mode",
88
131
  thumbnailMissing: "No thumbnail yet",
89
- referenceNotePlaceholder: "What should change? (optional, goes into the reference)"
132
+ referenceNotePlaceholder: "What should change? (optional, goes into the reference)",
133
+ boardCodeNotFound: (code) => `No board has the code ${code}`,
134
+ boardLinkCopied: (code) => `Link to ${code} copied`,
135
+ copyBoardLink: "Copy link"
90
136
  };
91
137
  var resolveDesignStudioTexts = (texts) => {
92
138
  if (!texts) return DEFAULT_DESIGN_STUDIO_TEXTS;
@@ -126,6 +172,14 @@ export {
126
172
  buildDesignReference,
127
173
  buildBoardDeepLink,
128
174
  copyTextToClipboard,
175
+ boardCodeOf,
176
+ CODE_PARAM,
177
+ normalizeBoardCode,
178
+ boardCodeMatches,
179
+ codeBelongsToCanvas,
180
+ boardCodeUrlValue,
181
+ buildBoardCodeLink,
182
+ findBoardForCode,
129
183
  splitThemeReference,
130
184
  buildThemeReference,
131
185
  DEFAULT_DESIGN_STUDIO_TEXTS,
@@ -140,4 +194,4 @@ export {
140
194
  useDesignStudioTexts,
141
195
  cx
142
196
  };
143
- //# sourceMappingURL=chunk-RFW6QPM3.js.map
197
+ //# sourceMappingURL=chunk-ICDABLFY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/canvas/designReference.ts","../src/canvas/boardKey.ts","../src/canvas/boardCode.ts","../src/canvas/designTheme.ts","../src/provider/texts.ts","../src/provider/DesignStudioProvider.tsx","../src/utils/cx.ts"],"sourcesContent":["/**\n * Design references for agentic editing (\"send to agent\"): a plain-text block that names one\n * board (and optionally a region of it, a comment, a note) with stable keys, so an agent session can resolve it.\n * Format (one line per board, fields joined by \" · \", the deep link always last; optional\n * extra lines below):\n *\n * [design-ref] App › Onboarding – first run › 2 Welcome · code APP ONB-W2 · file onb-w-2-welcome.dc.html · canvas app/onboarding\n * · v3f9c2ab · theme brand:1:dark · region 24,180,342,220\n * · https://…/app/canvases/onboarding?board=onb-w-2-welcome.dc.html&theme=brand:1&mode=dark\n * note: make the tab bar more compact\n *\n * `code` is the board code (left out when the board has none), `file` the board key (the file name in the canvas folder), `v…` the first 7 characters of the board file's\n * content hash (git blob hash), `theme` the theme reference the board was looked at in (`none` = as authored).\n *\n * Pure functions, no React (tested in designReference.test.ts).\n */\n\nexport const DESIGN_REFERENCE_PREFIX = '[design-ref]';\n\n/** A rectangle on a board in board pixels (independent of the zoom). */\nexport interface BoardRegion {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface DesignReferenceInput {\n projectName: string;\n canvasName: string;\n projectKey: string;\n canvasKey: string;\n boardTitle: string;\n /** File name of the board in the canvas folder. */\n boardKey: string;\n /** Board code (`APP ONB-W2`), null / absent = the board has none. */\n boardCode?: string | null;\n /** Content hash of the board file (git blob hash); the reference carries its first 7 characters. */\n contentHash: string | null;\n /** Theme reference the board is shown in (`<themeId>` or `<themeId>:dark`), null = as authored. */\n themeReference: string | null;\n /** Deep link to the board on the canvas (with theme and mode). */\n url: string;\n region?: BoardRegion | null;\n /** A comment thread the reference is about (id + pin position). */\n comment?: { id: number | string; x: number | null; y: number | null; lines: string[] } | null;\n /** What should change (free text). */\n note?: string | null;\n}\n\nconst oneLine = (text: string) => text.replace(/\\s+/g, ' ').trim();\n\n/** One reference block (first line + optional `comment:` / `note:` lines). */\nexport const buildDesignReference = (input: DesignReferenceInput): string => {\n const fields = [\n `${DESIGN_REFERENCE_PREFIX} ${oneLine(input.projectName)} › ${oneLine(input.canvasName)} › ${oneLine(input.boardTitle)}`,\n ...(input.boardCode ? [`code ${oneLine(input.boardCode)}`] : []),\n `file ${input.boardKey}`,\n `canvas ${input.projectKey}/${input.canvasKey}`,\n `v${input.contentHash ? input.contentHash.slice(0, 7) : '?'}`,\n `theme ${input.themeReference || 'none'}`,\n ];\n if (input.region) {\n const { x, y, width, height } = input.region;\n fields.push(`region ${Math.round(x)},${Math.round(y)},${Math.round(width)},${Math.round(height)}`);\n }\n if (input.comment) {\n const position =\n input.comment.x != null && input.comment.y != null\n ? ` at ${Math.round(input.comment.x)},${Math.round(input.comment.y)}`\n : '';\n fields.push(`comment ${input.comment.id}${position}`);\n }\n fields.push(input.url);\n const lines = [fields.join(' · ')];\n for (const commentLine of input.comment?.lines ?? []) {\n if (commentLine.trim()) lines.push(`comment: ${oneLine(commentLine)}`);\n }\n if (input.note?.trim()) lines.push(`note: ${oneLine(input.note)}`);\n return lines.join('\\n');\n};\n\n/**\n * Deep link to a board: the current page URL with `board` (the board key), the look (`theme`, `mode`; left out when\n * the board is shown as authored) and, when given, the canvas viewport `vp` (other canvas parameters dropped) — the\n * link reopens the focus view over the same part of the canvas.\n */\nexport const buildBoardDeepLink = (\n pageUrl: string,\n boardKey: string,\n themeId: string | null,\n mode: 'light' | 'dark',\n viewport?: string | null\n): string => {\n const url = new URL(pageUrl);\n url.search = '';\n url.hash = '';\n url.searchParams.set('board', boardKey);\n if (themeId) {\n url.searchParams.set('theme', themeId);\n url.searchParams.set('mode', mode);\n }\n if (viewport) url.searchParams.set('vp', viewport);\n // commas and colons are valid in a query; unescaped, the viewport and the theme stay readable in a pasted reference\n return url.toString().replace(/%2C/gi, ',').replace(/%3A/gi, ':');\n};\n\n/**\n * Copies text: the async Clipboard API, else a hidden textarea + `execCommand('copy')` (older browsers, insecure\n * origins).\n * @returns whether the text reached the clipboard\n */\nexport const copyTextToClipboard = async (text: string): Promise<boolean> => {\n if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {\n try {\n await navigator.clipboard.writeText(text);\n return true;\n } catch {\n // fall through to the textarea fallback (permission denied, document not focused)\n }\n }\n if (typeof document === 'undefined') return false;\n const textarea = document.createElement('textarea');\n textarea.value = text;\n textarea.setAttribute('readonly', '');\n textarea.style.position = 'fixed';\n textarea.style.opacity = '0';\n document.body.appendChild(textarea);\n textarea.select();\n const isCopied = document.execCommand('copy');\n textarea.remove();\n return isCopied;\n};\n","/**\n * A board's code: its key (the file name in the canvas folder) without the `.html` extension and without an optional\n * `.dc` before it (`welcome.html` and `welcome.dc.html` both give `welcome`). Shown under the title and used as the\n * base name of downloads. A key without `.html` is returned as it is.\n */\nexport const boardCodeOf = (boardKey: string): string => boardKey.replace(/(?:\\.dc)?\\.html$/, '');\n","/**\n * Board codes (`APP ONB-W2`): the short name of a board that people say in a chat or paste into the studio. The\n * backend sets them (project code + canvas code + a board part from the file name or canvas.json); here they are\n * matched and turned into links. A code link opens the canvas on that board: the view moves to it, the board is\n * selected and its side panel shows.\n *\n * Pure functions, no React (tested in boardCode.test.ts).\n */\n\nimport { boardCodeOf } from './boardKey.ts';\n\n/** URL parameter of a code link (`?code=APP-ONB-W2`). */\nexport const CODE_PARAM = 'code';\n\n/** A code for comparisons: upper case, letters and digits only (`app onb-w2` → `APPONBW2`). */\nexport const normalizeBoardCode = (code: string): string => code.toUpperCase().replace(/[^A-Z0-9]/g, '');\n\n/** The parts of a code: `APP ONB-W2` → `['APP', 'ONB', 'W2']`. */\nconst codeParts = (code: string): string[] => code.trim().toUpperCase().split(/[\\s-]+/).filter(Boolean);\n\n/**\n * Whether a typed code names a board on its canvas: the full code, the code without the project part, or the board\n * part alone (`APP ONB-W2`, `ONB-W2`, `w2`) — case, spaces and dashes do not matter, a fragment (`2`, `NBW2`) does not\n * match.\n */\nexport const boardCodeMatches = (typedCode: string, boardCode: string | null | undefined): boolean => {\n const typed = normalizeBoardCode(typedCode);\n if (!typed || !boardCode) return false;\n const parts = codeParts(boardCode);\n return parts.some((_, index) => parts.slice(index).join('') === typed);\n};\n\n/**\n * Whether a typed code belongs to a canvas: it starts with the canvas' code prefix, with or without the project part\n * (`APP ONB-W2` and `ONB-W2` belong to `APP ONB`). Used by the overview to send a pasted code to its canvas.\n */\nexport const codeBelongsToCanvas = (typedCode: string, canvasCode: string | null | undefined): boolean => {\n const typed = normalizeBoardCode(typedCode);\n if (!typed || !canvasCode) return false;\n const parts = codeParts(canvasCode);\n return parts.some((_, index) => {\n const prefix = parts.slice(index).join('');\n return typed.length > prefix.length && typed.startsWith(prefix);\n });\n};\n\n/** A code as a URL value: parts joined by dashes (`APP ONB-W2` → `APP-ONB-W2`), readable in a pasted link. */\nexport const boardCodeUrlValue = (code: string): string => codeParts(code).join('-');\n\n/**\n * Link that opens a canvas on one board by its code: the canvas page URL (other parameters dropped) with `code`,\n * plus the look (`theme`, `mode`) when the board is shown in one.\n */\nexport const buildBoardCodeLink = (\n canvasPageUrl: string,\n code: string,\n themeId: string | null,\n mode: 'light' | 'dark'\n): string => {\n const url = new URL(canvasPageUrl);\n url.search = '';\n url.hash = '';\n url.searchParams.set(CODE_PARAM, boardCodeUrlValue(code));\n if (themeId) {\n url.searchParams.set('theme', themeId);\n url.searchParams.set('mode', mode);\n }\n return url.toString().replace(/%3A/gi, ':');\n};\n\n/**\n * The board a typed code names on a canvas: by its code (`boardCodeMatches`), else by its file name without extension\n * (`onb-w-2-welcome`, for boards without a code). Null when none or more than one board matches.\n */\nexport const findBoardForCode = <Board extends { code?: string | null; boardKey?: string | null }>(\n boards: readonly Board[],\n typedCode: string\n): Board | null => {\n const byCode = boards.filter(board => boardCodeMatches(typedCode, board.code));\n if (byCode.length > 0) return byCode.length === 1 ? byCode[0] : null;\n const typed = typedCode.trim().toLowerCase();\n const byName = boards.filter(board => board.boardKey && boardCodeOf(board.boardKey).toLowerCase() === typed);\n return byName.length === 1 ? byName[0] : null;\n};\n","/**\n * Theme references of the design studio: `<themeId>` or `<themeId>:<mode>` (mode `light` or `dark`), e.g.\n * `brand:1:dark` — the theme id itself may contain colons, only a trailing `:light` / `:dark` is the mode (same rule\n * as `DesignThemeReference::fromString`). Pure functions, no React (tested in designTheme.test.ts).\n */\n\nexport type ThemeMode = 'light' | 'dark';\n\nexport interface ThemeLook {\n themeId: string;\n mode: ThemeMode;\n}\n\n/** Splits a theme reference; null without one (the boards are shown as authored). */\nexport const splitThemeReference = (themeReference: string | null | undefined): ThemeLook | null => {\n const reference = (themeReference ?? '').trim();\n if (!reference) return null;\n for (const mode of ['light', 'dark'] as const) {\n if (reference.endsWith(`:${mode}`)) return { themeId: reference.slice(0, -(mode.length + 1)), mode };\n }\n return { themeId: reference, mode: 'light' };\n};\n\n/** `<themeId>` for light, `<themeId>:dark` for dark. */\nexport const buildThemeReference = (themeId: string, mode: ThemeMode): string =>\n mode === 'dark' ? `${themeId}:dark` : themeId;\n","import type { DesignStudioTexts } from './types';\n\n/** The English defaults of the texts an application can replace through `environment.texts`. */\nexport const DEFAULT_DESIGN_STUDIO_TEXTS: DesignStudioTexts = {\n referencesCopied: count => (count > 1 ? `References copied (${count})` : 'Reference copied'),\n boardsUpdated: count => (count === 1 ? '1 board updated' : `${count} boards updated`),\n showUpdatedBoard: 'Show',\n canvasUpToDate: 'Canvas is up to date',\n reload: 'Reload (R)',\n thumbnailsFailed: 'Thumbnails failed · try again',\n thumbnailsWaitingForRenderer: themeLabel => `Thumbnails for ${themeLabel} are waiting for the renderer`,\n thumbnailsRendering: themeLabel => `Thumbnails for ${themeLabel} are being rendered`,\n thumbnailsFallbackThemeLabel: 'this look',\n thumbnailsMissing: count =>\n count === 1\n ? '1 board has no thumbnail in this look yet; it appears as soon as it is rendered.'\n : `${count} boards have no thumbnail in this look yet; they appear as soon as they are rendered.`,\n thumbnailsLastError: error => `Last error: ${error}`,\n themeWithoutDarkMode: 'This theme has no dark mode',\n thumbnailMissing: 'No thumbnail yet',\n referenceNotePlaceholder: 'What should change? (optional, goes into the reference)',\n boardCodeNotFound: code => `No board has the code ${code}`,\n boardLinkCopied: code => `Link to ${code} copied`,\n copyBoardLink: 'Copy link',\n};\n\n/** The defaults with the application's replacements on top; an entry that is missing or `undefined` keeps its default. */\nexport const resolveDesignStudioTexts = (texts: Partial<DesignStudioTexts> | undefined): DesignStudioTexts => {\n if (!texts) return DEFAULT_DESIGN_STUDIO_TEXTS;\n const defined = Object.fromEntries(Object.entries(texts).filter(([, value]) => value !== undefined));\n return { ...DEFAULT_DESIGN_STUDIO_TEXTS, ...defined };\n};\n","'use client';\n\nimport { createContext, type ReactNode, useContext, useMemo } from 'react';\n\nimport type { DesignStudioApi } from '../api/createDesignStudioApi';\nimport { resolveDesignStudioTexts } from './texts';\nimport type {\n DesignStudioComponents,\n DesignStudioEnvironment,\n DesignStudioNotify,\n DesignStudioPaths,\n DesignStudioRouter,\n DesignStudioTexts,\n} from './types';\n\nconst DesignStudioContext = createContext<DesignStudioEnvironment | null>(null);\n\nexport interface DesignStudioProviderProps {\n /** Keep it referentially stable (a module constant): every studio component reads it. */\n environment: DesignStudioEnvironment;\n children: ReactNode;\n}\n\n/** Hands the application's environment (API, router, UI primitives, …) to the studio's screens below it. */\nexport const DesignStudioProvider = ({ environment, children }: DesignStudioProviderProps) => (\n <DesignStudioContext.Provider value={environment}>{children}</DesignStudioContext.Provider>\n);\n\n/** The whole environment. */\nexport const useDesignStudio = (): DesignStudioEnvironment => {\n const environment = useContext(DesignStudioContext);\n if (!environment) {\n throw new Error('The design studio needs a DesignStudioProvider above it');\n }\n return environment;\n};\n\nexport const useDesignStudioApi = (): DesignStudioApi => useDesignStudio().api;\n\nexport const useDesignStudioComponents = (): DesignStudioComponents => useDesignStudio().components;\n\nexport const useDesignStudioRouter = (): DesignStudioRouter => useDesignStudio().router;\n\nexport const useDesignStudioPaths = (): DesignStudioPaths => useDesignStudio().paths;\n\nexport const useDesignStudioNotify = (): DesignStudioNotify => useDesignStudio().notify;\n\n/** The UI texts: the application's replacements (`environment.texts`) on top of the English defaults. Stable per environment. */\nexport const useDesignStudioTexts = (): DesignStudioTexts => {\n const { texts } = useDesignStudio();\n return useMemo(() => resolveDesignStudioTexts(texts), [texts]);\n};\n","import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/** Conditional class names, later Tailwind classes winning over earlier ones (`clsx` + `tailwind-merge`). */\nexport const cx = (...inputs: ClassValue[]): string => twMerge(clsx(inputs));\n"],"mappings":";;;AAiBO,IAAM,0BAA0B;AAiCvC,IAAM,UAAU,CAAC,SAAiB,KAAK,QAAQ,QAAQ,GAAG,EAAE,KAAK;AAG1D,IAAM,uBAAuB,CAAC,UAAwC;AAC3E,QAAM,SAAS;AAAA,IACb,GAAG,uBAAuB,IAAI,QAAQ,MAAM,WAAW,CAAC,WAAM,QAAQ,MAAM,UAAU,CAAC,WAAM,QAAQ,MAAM,UAAU,CAAC;AAAA,IACtH,GAAI,MAAM,YAAY,CAAC,QAAQ,QAAQ,MAAM,SAAS,CAAC,EAAE,IAAI,CAAC;AAAA,IAC9D,QAAQ,MAAM,QAAQ;AAAA,IACtB,UAAU,MAAM,UAAU,IAAI,MAAM,SAAS;AAAA,IAC7C,IAAI,MAAM,cAAc,MAAM,YAAY,MAAM,GAAG,CAAC,IAAI,GAAG;AAAA,IAC3D,SAAS,MAAM,kBAAkB,MAAM;AAAA,EACzC;AACA,MAAI,MAAM,QAAQ;AAChB,UAAM,EAAE,GAAG,GAAG,OAAO,OAAO,IAAI,MAAM;AACtC,WAAO,KAAK,UAAU,KAAK,MAAM,CAAC,CAAC,IAAI,KAAK,MAAM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EAAE,MAAM,IAAI,gBAAgB;AAClC,SAAO,QAAQ,MAAM,yBAAyB,KAAK,GAAG,CAAC,KAAK,CAAC;AAC/D;;;ACnDA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAGjB,IAAM,KAAK,IAAI,WAAiC,QAAQ,KAAK,MAAM,CAAC;","names":[]}
package/dist/index.d.ts CHANGED
@@ -103,6 +103,8 @@ interface DesignDirectorySections {
103
103
  interface DesignStudioBoardView {
104
104
  /** File name of the board in the canvas folder */
105
105
  boardKey?: string | null;
106
+ /** Short code of the board (`APP ONB-W2`): names it in chats and opens it on the canvas, null = none */
107
+ code?: string | null;
106
108
  /** Board title */
107
109
  title?: string | null;
108
110
  /** Left edge, relative to the canvas selection */
@@ -141,6 +143,8 @@ interface DesignStudioBoardViews {
141
143
  interface DesignStudioCanvasView {
142
144
  projectKey?: string | null;
143
145
  canvasKey?: string | null;
146
+ /** What every board code of the canvas starts with (`APP ONB`), null when the canvas has no code */
147
+ code?: string | null;
144
148
  /** Name of the canvas */
145
149
  label?: string | null;
146
150
  /** Reference of the theme the delivery URLs and thumbnails are in, null = no theme */
@@ -167,6 +171,8 @@ interface DesignStudioCanvasView {
167
171
  }
168
172
  interface DesignStudioCanvasSummary {
169
173
  canvasKey?: string | null;
174
+ /** What every board code of the canvas starts with (`APP ONB`), null when the canvas has no code */
175
+ code?: string | null;
170
176
  /** Name of the canvas */
171
177
  label?: string | null;
172
178
  /** Reference of the theme the canvas names as its usual look */
@@ -373,12 +379,12 @@ declare const createDesignStudioApi: <ReducerPath extends string, TagTypes exten
373
379
  * Format (one line per board, fields joined by " · ", the deep link always last; optional
374
380
  * extra lines below):
375
381
  *
376
- * [design-ref] App › Onboarding – first run › 2 Welcome · file welcome-2.dc.html · canvas app/onboarding
382
+ * [design-ref] App › Onboarding – first run › 2 Welcome · code APP ONB-W2 · file onb-w-2-welcome.dc.html · canvas app/onboarding
377
383
  * · v3f9c2ab · theme brand:1:dark · region 24,180,342,220
378
- * · https://…/app/canvases/onboarding?board=welcome-2.dc.html&theme=brand:1&mode=dark
384
+ * · https://…/app/canvases/onboarding?board=onb-w-2-welcome.dc.html&theme=brand:1&mode=dark
379
385
  * note: make the tab bar more compact
380
386
  *
381
- * `file` is the board key (the file name in the canvas folder), `v…` the first 7 characters of the board file's
387
+ * `code` is the board code (left out when the board has none), `file` the board key (the file name in the canvas folder), `v…` the first 7 characters of the board file's
382
388
  * content hash (git blob hash), `theme` the theme reference the board was looked at in (`none` = as authored).
383
389
  *
384
390
  * Pure functions, no React (tested in designReference.test.ts).
@@ -399,6 +405,8 @@ interface DesignReferenceInput {
399
405
  boardTitle: string;
400
406
  /** File name of the board in the canvas folder. */
401
407
  boardKey: string;
408
+ /** Board code (`APP ONB-W2`), null / absent = the board has none. */
409
+ boardCode?: string | null;
402
410
  /** Content hash of the board file (git blob hash); the reference carries its first 7 characters. */
403
411
  contentHash: string | null;
404
412
  /** Theme reference the board is shown in (`<themeId>` or `<themeId>:dark`), null = as authored. */
@@ -425,6 +433,45 @@ declare const buildDesignReference: (input: DesignReferenceInput) => string;
425
433
  */
426
434
  declare const buildBoardDeepLink: (pageUrl: string, boardKey: string, themeId: string | null, mode: "light" | "dark", viewport?: string | null) => string;
427
435
 
436
+ /**
437
+ * Board codes (`APP ONB-W2`): the short name of a board that people say in a chat or paste into the studio. The
438
+ * backend sets them (project code + canvas code + a board part from the file name or canvas.json); here they are
439
+ * matched and turned into links. A code link opens the canvas on that board: the view moves to it, the board is
440
+ * selected and its side panel shows.
441
+ *
442
+ * Pure functions, no React (tested in boardCode.test.ts).
443
+ */
444
+ /** URL parameter of a code link (`?code=APP-ONB-W2`). */
445
+ declare const CODE_PARAM = "code";
446
+ /** A code for comparisons: upper case, letters and digits only (`app onb-w2` → `APPONBW2`). */
447
+ declare const normalizeBoardCode: (code: string) => string;
448
+ /**
449
+ * Whether a typed code names a board on its canvas: the full code, the code without the project part, or the board
450
+ * part alone (`APP ONB-W2`, `ONB-W2`, `w2`) — case, spaces and dashes do not matter, a fragment (`2`, `NBW2`) does not
451
+ * match.
452
+ */
453
+ declare const boardCodeMatches: (typedCode: string, boardCode: string | null | undefined) => boolean;
454
+ /**
455
+ * Whether a typed code belongs to a canvas: it starts with the canvas' code prefix, with or without the project part
456
+ * (`APP ONB-W2` and `ONB-W2` belong to `APP ONB`). Used by the overview to send a pasted code to its canvas.
457
+ */
458
+ declare const codeBelongsToCanvas: (typedCode: string, canvasCode: string | null | undefined) => boolean;
459
+ /** A code as a URL value: parts joined by dashes (`APP ONB-W2` → `APP-ONB-W2`), readable in a pasted link. */
460
+ declare const boardCodeUrlValue: (code: string) => string;
461
+ /**
462
+ * Link that opens a canvas on one board by its code: the canvas page URL (other parameters dropped) with `code`,
463
+ * plus the look (`theme`, `mode`) when the board is shown in one.
464
+ */
465
+ declare const buildBoardCodeLink: (canvasPageUrl: string, code: string, themeId: string | null, mode: "light" | "dark") => string;
466
+ /**
467
+ * The board a typed code names on a canvas: by its code (`boardCodeMatches`), else by its file name without extension
468
+ * (`onb-w-2-welcome`, for boards without a code). Null when none or more than one board matches.
469
+ */
470
+ declare const findBoardForCode: <Board extends {
471
+ code?: string | null;
472
+ boardKey?: string | null;
473
+ }>(boards: readonly Board[], typedCode: string) => Board | null;
474
+
428
475
  /**
429
476
  * Theme references of the design studio: `<themeId>` or `<themeId>:<mode>` (mode `light` or `dark`), e.g.
430
477
  * `brand:1:dark` — the theme id itself may contain colons, only a trailing `:light` / `:dark` is the mode (same rule
@@ -487,6 +534,12 @@ interface DesignStudioRouter {
487
534
  * `keys` is a module constant.
488
535
  */
489
536
  useUrlState: <K extends string>(keys: readonly K[], options: DesignStudioUrlStateOptions) => DesignStudioUrlState<K>;
537
+ /**
538
+ * Optional: a function that navigates to an in-app path (as `paths` builds it, query string allowed; client
539
+ * navigation with a history entry). The overview uses it to open a board code; without it the overview shows a link
540
+ * to click instead.
541
+ */
542
+ useNavigate?: () => (href: string) => void;
490
543
  }
491
544
  /** In-app paths of the studio's pages (without the application's base path). */
492
545
  interface DesignStudioPaths {
@@ -723,6 +776,12 @@ interface DesignStudioTexts {
723
776
  thumbnailMissing: string;
724
777
  /** Placeholder of the note field in the focus view's reference panel. */
725
778
  referenceNotePlaceholder: string;
779
+ /** Toast of a code link (`?code=`) or a pasted code that names no board (`code` = what was given). */
780
+ boardCodeNotFound: (code: string) => string;
781
+ /** Toast after copying a board's code link (`code` = the board code). */
782
+ boardLinkCopied: (code: string) => string;
783
+ /** Button of the selected board's panel: copies the link that opens the canvas on that board. */
784
+ copyBoardLink: string;
726
785
  }
727
786
  /** Everything the studio takes from the application it runs in (`DesignStudioProvider`). */
728
787
  interface DesignStudioEnvironment {
@@ -778,7 +837,11 @@ interface DesignStudioOverviewScreenProps {
778
837
  /** One line under the title. */
779
838
  description?: ReactNode;
780
839
  }
781
- /** Overview: every design project with its canvases (boards, open threads, decisions per canvas). */
840
+ /**
841
+ * Overview: every design project with its canvases (boards, open threads, decisions per canvas), and a field that
842
+ * opens a board by its code. `?code=<board code>` on this page opens it directly (a short link that needs no canvas
843
+ * path).
844
+ */
782
845
  declare const DesignStudioOverviewScreen: ({ title, description, }: DesignStudioOverviewScreenProps) => react.JSX.Element;
783
846
 
784
847
  interface DesignStudioProjectScreenProps {
@@ -799,5 +862,5 @@ declare const DesignStudioReviewsScreen: ({ description, emptyDescription, }: De
799
862
  /** Conditional class names, later Tailwind classes winning over earlier ones (`clsx` + `tailwind-merge`). */
800
863
  declare const cx: (...inputs: ClassValue[]) => string;
801
864
 
802
- export { DEFAULT_DESIGN_STUDIO_TEXTS, DESIGN_REFERENCE_PREFIX, DESIGN_STUDIO_TAG, DesignStudioOverviewScreen, DesignStudioProjectScreen, DesignStudioProvider, DesignStudioReviewsScreen, buildBoardDeepLink, buildDesignReference, buildThemeReference, createDesignStudioApi, cx, resolveDesignStudioTexts, splitThemeReference, useDesignStudio, useDesignStudioApi, useDesignStudioComponents, useDesignStudioNotify, useDesignStudioPaths, useDesignStudioRouter, useDesignStudioTexts };
865
+ export { CODE_PARAM, DEFAULT_DESIGN_STUDIO_TEXTS, DESIGN_REFERENCE_PREFIX, DESIGN_STUDIO_TAG, DesignStudioOverviewScreen, DesignStudioProjectScreen, DesignStudioProvider, DesignStudioReviewsScreen, boardCodeMatches, boardCodeUrlValue, buildBoardCodeLink, buildBoardDeepLink, buildDesignReference, buildThemeReference, codeBelongsToCanvas, createDesignStudioApi, cx, findBoardForCode, normalizeBoardCode, resolveDesignStudioTexts, splitThemeReference, useDesignStudio, useDesignStudioApi, useDesignStudioComponents, useDesignStudioNotify, useDesignStudioPaths, useDesignStudioRouter, useDesignStudioTexts };
803
866
  export type { BoardRegion, CreateDesignStudioApiOptions, DesignDirectorySection, DesignDirectorySections, DesignReferenceInput, DesignStudioApi, DesignStudioBadgeProps, DesignStudioBaseApi, DesignStudioBaseQuery, DesignStudioBoardArg, DesignStudioBoardStatus, DesignStudioBoardStatusPatchArg, DesignStudioBoardStatusResponse, DesignStudioBoardView, DesignStudioBoardViews, DesignStudioButtonProps, DesignStudioCanvasArg, DesignStudioCanvasCommentsArg, DesignStudioCanvasResponse, DesignStudioCanvasRevisionResponse, DesignStudioCanvasSummaries, DesignStudioCanvasSummary, DesignStudioCanvasView, DesignStudioChangeHistory, DesignStudioCheckboxProps, DesignStudioComboboxProps, DesignStudioComment, DesignStudioCommentArg, DesignStudioCommentCreateArg, DesignStudioCommentPatchArg, DesignStudioCommentReplyArg, DesignStudioCommentResolveArg, DesignStudioCommentResponse, DesignStudioComments, DesignStudioCommentsResponse, DesignStudioComponents, DesignStudioDeleteResponse, DesignStudioDialogContentProps, DesignStudioDialogProps, DesignStudioEnvironment, DesignStudioLinkProps, DesignStudioNotify, DesignStudioOption, DesignStudioOverview, DesignStudioOverviewResponse, DesignStudioOverviewScreenProps, DesignStudioPageHeaderProps, DesignStudioPaths, DesignStudioProjectScreenProps, DesignStudioProjectSummaries, DesignStudioProjectSummary, DesignStudioProviderProps, DesignStudioQuickFilterPillsProps, DesignStudioReviewsScreenProps, DesignStudioRouter, DesignStudioSearchFieldProps, DesignStudioSearchParamUpdates, DesignStudioSharedParams, DesignStudioShell, DesignStudioStatusBadgeProps, DesignStudioStatusCalloutProps, DesignStudioStatusDefinition, DesignStudioStatusTone, DesignStudioStatuses, DesignStudioStorage, DesignStudioStorageKey, DesignStudioTexts, DesignStudioThemesArg, DesignStudioThemesResponse, DesignStudioThumbnailRenderRequestArg, DesignStudioToastOptions, DesignStudioUrlState, DesignStudioUrlStateOptions, DesignTheme, DesignThemes, ThemeLook, ThemeMode };
package/dist/index.js CHANGED
@@ -1,12 +1,19 @@
1
1
  'use client';
2
2
  import {
3
+ CODE_PARAM,
3
4
  DEFAULT_DESIGN_STUDIO_TEXTS,
4
5
  DESIGN_REFERENCE_PREFIX,
5
6
  DesignStudioProvider,
7
+ boardCodeMatches,
8
+ boardCodeUrlValue,
9
+ buildBoardCodeLink,
6
10
  buildBoardDeepLink,
7
11
  buildDesignReference,
8
12
  buildThemeReference,
13
+ codeBelongsToCanvas,
9
14
  cx,
15
+ findBoardForCode,
16
+ normalizeBoardCode,
10
17
  resolveDesignStudioTexts,
11
18
  splitThemeReference,
12
19
  useDesignStudio,
@@ -16,7 +23,7 @@ import {
16
23
  useDesignStudioPaths,
17
24
  useDesignStudioRouter,
18
25
  useDesignStudioTexts
19
- } from "./chunk-RFW6QPM3.js";
26
+ } from "./chunk-ICDABLFY.js";
20
27
 
21
28
  // src/api/createDesignStudioApi.ts
22
29
  var DESIGN_STUDIO_TAG = "DesignStudio";
@@ -176,7 +183,15 @@ var createDesignStudioApi = ({
176
183
  // src/screens/DesignStudioOverviewScreen.tsx
177
184
  import { normalizeDddError } from "@mgamadeus/ddd-web/api";
178
185
  import { Hourglass, LayoutGrid, Palette } from "lucide-react";
186
+ import { useEffect, useMemo, useRef, useState } from "react";
179
187
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
188
+ var useNoNavigate = () => null;
189
+ var codeTarget = (projects, typedCode, paths) => {
190
+ const targets = projects.flatMap(
191
+ (project) => (project.canvases?.elements ?? []).filter((canvas) => codeBelongsToCanvas(typedCode, canvas.code)).map((canvas) => `${paths.canvas(project.projectKey ?? "", canvas.canvasKey ?? "")}?${CODE_PARAM}=${encodeURIComponent(boardCodeUrlValue(typedCode))}`)
192
+ );
193
+ return targets.length === 1 ? targets[0] : null;
194
+ };
180
195
  var DesignStudioOverviewScreen = ({
181
196
  title = /* @__PURE__ */ jsxs(Fragment, { children: [
182
197
  "Design ",
@@ -185,12 +200,49 @@ var DesignStudioOverviewScreen = ({
185
200
  description = "Design projects and their canvases \u2014 review, comment, decide."
186
201
  }) => {
187
202
  const { api, components, paths, router } = useDesignStudio();
188
- const { Badge, Card, CardContent, CardHeader, CardTitle, CardGrid, PageHeader, PageSections, Skeleton, StatusCallout } = components;
203
+ const texts = useDesignStudioTexts();
204
+ const {
205
+ Badge,
206
+ Button,
207
+ Card,
208
+ CardContent,
209
+ CardHeader,
210
+ CardTitle,
211
+ CardGrid,
212
+ PageHeader,
213
+ PageSections,
214
+ SearchField,
215
+ Skeleton,
216
+ StatusCallout
217
+ } = components;
189
218
  const { Link } = router;
219
+ const navigate = (router.useNavigate ?? useNoNavigate)();
190
220
  const { data, isLoading, error } = api.useOverviewQuery();
191
221
  const overview = data?.designStudioOverview;
192
- const projects = overview?.projects?.elements ?? [];
222
+ const projects = useMemo(() => overview?.projects?.elements ?? [], [overview]);
193
223
  const expiringThreadCount = overview?.expiringThreadCount ?? 0;
224
+ const hasCodes = projects.some((project) => (project.canvases?.elements ?? []).some((canvas) => canvas.code));
225
+ const codeParam = router.useSearchParams().get(CODE_PARAM);
226
+ const [typedCode, setTypedCode] = useState("");
227
+ const [pendingCode, setPendingCode] = useState(null);
228
+ const openCode = (code) => {
229
+ if (!code.trim()) return;
230
+ const href = codeTarget(projects, code, paths);
231
+ setPendingCode({ code: code.trim(), href });
232
+ if (href && navigate) navigate(href);
233
+ };
234
+ const openCodeRef = useRef(openCode);
235
+ openCodeRef.current = openCode;
236
+ const handledCodeParamRef = useRef(null);
237
+ useEffect(() => {
238
+ if (!codeParam || !overview || handledCodeParamRef.current === codeParam) return;
239
+ handledCodeParamRef.current = codeParam;
240
+ openCodeRef.current(codeParam);
241
+ }, [codeParam, overview]);
242
+ const submitCode = (event) => {
243
+ event.preventDefault();
244
+ openCode(typedCode);
245
+ };
194
246
  return /* @__PURE__ */ jsxs(Fragment, { children: [
195
247
  /* @__PURE__ */ jsx(
196
248
  PageHeader,
@@ -210,6 +262,28 @@ var DesignStudioOverviewScreen = ({
210
262
  }
211
263
  ),
212
264
  /* @__PURE__ */ jsxs(PageSections, { children: [
265
+ hasCodes && /* @__PURE__ */ jsxs("form", { onSubmit: submitCode, className: "flex max-w-md items-center gap-2", children: [
266
+ /* @__PURE__ */ jsx(
267
+ SearchField,
268
+ {
269
+ value: typedCode,
270
+ onChange: setTypedCode,
271
+ placeholder: "Open a board by its code, e.g. APP ONB-W2",
272
+ "aria-label": "Board code",
273
+ className: "flex-1",
274
+ clearable: true
275
+ }
276
+ ),
277
+ /* @__PURE__ */ jsx(Button, { type: "submit", variant: "outline", disabled: !typedCode.trim(), children: "Open" })
278
+ ] }),
279
+ pendingCode && !pendingCode.href && /* @__PURE__ */ jsx(StatusCallout, { tone: "destructive", title: texts.boardCodeNotFound(pendingCode.code) }),
280
+ pendingCode?.href && !navigate && /* @__PURE__ */ jsx(
281
+ StatusCallout,
282
+ {
283
+ title: `Board ${pendingCode.code}`,
284
+ description: /* @__PURE__ */ jsx(Link, { href: pendingCode.href, children: "Open it on its canvas" })
285
+ }
286
+ ),
213
287
  isLoading && /* @__PURE__ */ jsx(Skeleton, { className: "h-40 w-full rounded-2xl" }),
214
288
  !isLoading && !error && projects.length === 0 && /* @__PURE__ */ jsx(
215
289
  StatusCallout,
@@ -240,7 +314,8 @@ var DesignStudioOverviewScreen = ({
240
314
  children: [
241
315
  /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2 font-medium", children: [
242
316
  /* @__PURE__ */ jsx(LayoutGrid, { className: "size-4 shrink-0 text-brand-emphasis", "aria-hidden": true }),
243
- /* @__PURE__ */ jsx("span", { className: "truncate", children: canvas.label ?? canvas.canvasKey })
317
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: canvas.label ?? canvas.canvasKey }),
318
+ canvas.code && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs font-semibold text-muted-foreground tabular-nums", children: canvas.code })
244
319
  ] }),
245
320
  /* @__PURE__ */ jsxs("span", { className: "shrink-0 text-muted-foreground", children: [
246
321
  canvas.boardCount ?? 0,
@@ -361,6 +436,7 @@ var DesignStudioReviewsScreen = ({
361
436
  ] });
362
437
  };
363
438
  export {
439
+ CODE_PARAM,
364
440
  DEFAULT_DESIGN_STUDIO_TEXTS,
365
441
  DESIGN_REFERENCE_PREFIX,
366
442
  DESIGN_STUDIO_TAG,
@@ -368,11 +444,17 @@ export {
368
444
  DesignStudioProjectScreen,
369
445
  DesignStudioProvider,
370
446
  DesignStudioReviewsScreen,
447
+ boardCodeMatches,
448
+ boardCodeUrlValue,
449
+ buildBoardCodeLink,
371
450
  buildBoardDeepLink,
372
451
  buildDesignReference,
373
452
  buildThemeReference,
453
+ codeBelongsToCanvas,
374
454
  createDesignStudioApi,
375
455
  cx,
456
+ findBoardForCode,
457
+ normalizeBoardCode,
376
458
  resolveDesignStudioTexts,
377
459
  splitThemeReference,
378
460
  useDesignStudio,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/createDesignStudioApi.ts","../src/screens/DesignStudioOverviewScreen.tsx","../src/screens/DesignStudioProjectScreen.tsx","../src/screens/DesignStudioReviewsScreen.tsx"],"sourcesContent":["import type {\n Api,\n BaseQueryFn,\n coreModuleName,\n FetchArgs,\n FetchBaseQueryError,\n FetchBaseQueryMeta,\n} from '@reduxjs/toolkit/query';\nimport type { reactHooksModuleName, TypedUseMutation, TypedUseQuery } from '@reduxjs/toolkit/query/react';\n\nimport type {\n DesignStudioBoardStatusPatchArg,\n DesignStudioBoardStatusResponse,\n DesignStudioCanvasArg,\n DesignStudioCanvasCommentsArg,\n DesignStudioCanvasResponse,\n DesignStudioCanvasRevisionResponse,\n DesignStudioCommentArg,\n DesignStudioCommentCreateArg,\n DesignStudioCommentPatchArg,\n DesignStudioCommentReplyArg,\n DesignStudioCommentResolveArg,\n DesignStudioCommentResponse,\n DesignStudioCommentsResponse,\n DesignStudioDeleteResponse,\n DesignStudioOverviewResponse,\n DesignStudioThemesArg,\n DesignStudioThemesResponse,\n DesignStudioThumbnailRenderRequestArg,\n} from './types';\n\n/** The one cache tag of the studio: every query provides it, every mutation invalidates it. */\nexport const DESIGN_STUDIO_TAG = 'DesignStudio';\n\n/** The base query the studio's endpoints run on: a fetch-style one (`createDddBaseQuery` of `@mgamadeus/ddd-web/api`). */\nexport type DesignStudioBaseQuery = BaseQueryFn<\n string | FetchArgs,\n unknown,\n FetchBaseQueryError,\n object,\n FetchBaseQueryMeta\n>;\n\n/** The application's RTK Query api (`createApi` from `@reduxjs/toolkit/query/react`) the endpoints are injected into. */\nexport type DesignStudioBaseApi<ReducerPath extends string = string, TagTypes extends string = string> = Api<\n DesignStudioBaseQuery,\n // biome-ignore lint/complexity/noBannedTypes: RTK Query's own type of \"no endpoints yet\" (`createApi({ endpoints: () => ({}) })`)\n {},\n ReducerPath,\n TagTypes,\n typeof coreModuleName | typeof reactHooksModuleName\n>;\n\nexport interface CreateDesignStudioApiOptions<ReducerPath extends string, TagTypes extends string> {\n /** The application's api; its base query carries the origin, the session and the refresh. */\n baseApi: DesignStudioBaseApi<ReducerPath, TagTypes>;\n /** Path prefix of the studio's routes, without a trailing slash (e.g. `/api/admin/designStudio`). */\n apiPrefix: string;\n}\n\ntype DesignStudioQueryHook<ResultType, QueryArg> = TypedUseQuery<ResultType, QueryArg, DesignStudioBaseQuery>;\ntype DesignStudioMutationHook<ResultType, QueryArg> = TypedUseMutation<ResultType, QueryArg, DesignStudioBaseQuery>;\n\n/** The hooks `createDesignStudioApi` returns (`environment.api`). */\nexport interface DesignStudioApi {\n useOverviewQuery: DesignStudioQueryHook<DesignStudioOverviewResponse, void>;\n useThemesQuery: DesignStudioQueryHook<DesignStudioThemesResponse, DesignStudioThemesArg>;\n useCanvasQuery: DesignStudioQueryHook<DesignStudioCanvasResponse, DesignStudioCanvasArg>;\n useCanvasRevisionQuery: DesignStudioQueryHook<DesignStudioCanvasRevisionResponse, DesignStudioCanvasArg>;\n useCanvasCommentsQuery: DesignStudioQueryHook<DesignStudioCommentsResponse, DesignStudioCanvasCommentsArg>;\n useExpiringCommentsQuery: DesignStudioQueryHook<DesignStudioCommentsResponse, void>;\n useRequestThumbnailRenderingMutation: DesignStudioMutationHook<\n DesignStudioCanvasResponse,\n DesignStudioThumbnailRenderRequestArg\n >;\n useSetBoardStatusMutation: DesignStudioMutationHook<DesignStudioBoardStatusResponse, DesignStudioBoardStatusPatchArg>;\n useCreateCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentCreateArg>;\n useReplyToCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentReplyArg>;\n usePatchCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentPatchArg>;\n useDeleteCommentMutation: DesignStudioMutationHook<DesignStudioDeleteResponse, DesignStudioCommentArg>;\n useResolveCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentResolveArg>;\n useReopenCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentArg>;\n useKeepCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentArg>;\n}\n\nconst PROVIDED = [{ type: DESIGN_STUDIO_TAG, id: 'LIST' }] as const;\nconst INVALIDATED = [{ type: DESIGN_STUDIO_TAG, id: 'LIST' }, { type: DESIGN_STUDIO_TAG }] as const;\n\n/**\n * Injects the studio's 15 operations into the application's RTK Query api and returns their hooks. Call it once (module\n * scope) and hand the result to `DesignStudioProvider` as `environment.api`.\n *\n * Cache: one tag (`DesignStudio`). Every query provides it and every mutation invalidates it, so a write refetches\n * whatever the studio has on screen (the canvas, its comments, the overview).\n */\nexport const createDesignStudioApi = <ReducerPath extends string, TagTypes extends string>({\n baseApi,\n apiPrefix,\n}: CreateDesignStudioApiOptions<ReducerPath, TagTypes>): DesignStudioApi => {\n const canvasUrl = (arg: { projectKey: string; canvasKey: string }) =>\n `${apiPrefix}/canvases/${arg.projectKey}/${arg.canvasKey}`;\n const commentUrl = (arg: DesignStudioCommentArg) => `${apiPrefix}/comments/${arg.designStudioCommentId}`;\n\n // Widened to plain strings: the returned hooks do not depend on the application's reducer path and tag names. An api\n // is invariant in both, hence the cast; it also keeps the hook types nameable in the package's declaration files.\n const widenedBaseApi = baseApi as unknown as DesignStudioBaseApi;\n const api = widenedBaseApi.enhanceEndpoints({ addTagTypes: [DESIGN_STUDIO_TAG] }).injectEndpoints({\n endpoints: build => ({\n designStudioOverview: build.query<DesignStudioOverviewResponse, void>({\n query: () => ({ url: `${apiPrefix}/overview` }),\n providesTags: PROVIDED,\n }),\n designStudioThemes: build.query<DesignStudioThemesResponse, DesignStudioThemesArg>({\n query: arg => ({\n url: `${apiPrefix}/themes`,\n params: { search: arg.search, noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n providesTags: PROVIDED,\n }),\n designStudioCanvas: build.query<DesignStudioCanvasResponse, DesignStudioCanvasArg>({\n query: arg => ({\n url: canvasUrl(arg),\n params: { theme: arg.theme, noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n providesTags: PROVIDED,\n }),\n designStudioCanvasRevision: build.query<DesignStudioCanvasRevisionResponse, DesignStudioCanvasArg>({\n query: arg => ({\n url: `${canvasUrl(arg)}/revision`,\n params: { theme: arg.theme, noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n providesTags: PROVIDED,\n }),\n designStudioCanvasComments: build.query<DesignStudioCommentsResponse, DesignStudioCanvasCommentsArg>({\n query: arg => ({\n url: `${canvasUrl(arg)}/comments`,\n params: {\n theme: arg.theme,\n noCache: arg.noCache,\n outputFormat: arg.outputFormat,\n onlyOpenThreads: arg.onlyOpenThreads,\n sinceId: arg.sinceId,\n },\n }),\n providesTags: PROVIDED,\n }),\n designStudioExpiringComments: build.query<DesignStudioCommentsResponse, void>({\n query: () => ({ url: `${apiPrefix}/comments/expiring` }),\n providesTags: PROVIDED,\n }),\n designStudioRequestThumbnailRendering: build.mutation<\n DesignStudioCanvasResponse,\n DesignStudioThumbnailRenderRequestArg\n >({\n query: arg => ({\n url: `${canvasUrl(arg)}/thumbnailRenderRequests`,\n method: 'POST',\n body: arg.body,\n params: { theme: arg.theme, noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioSetBoardStatus: build.mutation<DesignStudioBoardStatusResponse, DesignStudioBoardStatusPatchArg>({\n query: arg => ({\n url: `${canvasUrl(arg)}/boards/${arg.boardKey}/status`,\n method: 'PATCH',\n body: arg.body,\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioCreateComment: build.mutation<DesignStudioCommentResponse, DesignStudioCommentCreateArg>({\n query: arg => ({\n url: `${canvasUrl(arg)}/boards/${arg.boardKey}/comments`,\n method: 'POST',\n body: arg.body,\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioReplyToComment: build.mutation<DesignStudioCommentResponse, DesignStudioCommentReplyArg>({\n query: arg => ({\n url: `${commentUrl(arg)}/replies`,\n method: 'POST',\n body: arg.body,\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioPatchComment: build.mutation<DesignStudioCommentResponse, DesignStudioCommentPatchArg>({\n query: arg => ({\n url: commentUrl(arg),\n method: 'PATCH',\n body: arg.body,\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioDeleteComment: build.mutation<DesignStudioDeleteResponse, DesignStudioCommentArg>({\n query: arg => ({\n url: commentUrl(arg),\n method: 'DELETE',\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioResolveComment: build.mutation<DesignStudioCommentResponse, DesignStudioCommentResolveArg>({\n query: arg => ({\n url: `${commentUrl(arg)}/resolve`,\n method: 'POST',\n body: arg.body,\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioReopenComment: build.mutation<DesignStudioCommentResponse, DesignStudioCommentArg>({\n query: arg => ({\n url: `${commentUrl(arg)}/reopen`,\n method: 'POST',\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioKeepComment: build.mutation<DesignStudioCommentResponse, DesignStudioCommentArg>({\n query: arg => ({\n url: `${commentUrl(arg)}/keep`,\n method: 'POST',\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n }),\n overrideExisting: false,\n });\n\n return {\n useOverviewQuery: api.useDesignStudioOverviewQuery,\n useThemesQuery: api.useDesignStudioThemesQuery,\n useCanvasQuery: api.useDesignStudioCanvasQuery,\n useCanvasRevisionQuery: api.useDesignStudioCanvasRevisionQuery,\n useCanvasCommentsQuery: api.useDesignStudioCanvasCommentsQuery,\n useExpiringCommentsQuery: api.useDesignStudioExpiringCommentsQuery,\n useRequestThumbnailRenderingMutation: api.useDesignStudioRequestThumbnailRenderingMutation,\n useSetBoardStatusMutation: api.useDesignStudioSetBoardStatusMutation,\n useCreateCommentMutation: api.useDesignStudioCreateCommentMutation,\n useReplyToCommentMutation: api.useDesignStudioReplyToCommentMutation,\n usePatchCommentMutation: api.useDesignStudioPatchCommentMutation,\n useDeleteCommentMutation: api.useDesignStudioDeleteCommentMutation,\n useResolveCommentMutation: api.useDesignStudioResolveCommentMutation,\n useReopenCommentMutation: api.useDesignStudioReopenCommentMutation,\n useKeepCommentMutation: api.useDesignStudioKeepCommentMutation,\n };\n};\n","'use client';\n\nimport { normalizeDddError } from '@mgamadeus/ddd-web/api';\nimport { Hourglass, LayoutGrid, Palette } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { useDesignStudio } from '../provider/DesignStudioProvider';\n\nexport interface DesignStudioOverviewScreenProps {\n /** Page title (a two-tone title wraps its accent part in `<em>`). */\n title?: ReactNode;\n /** One line under the title. */\n description?: ReactNode;\n}\n\n/** Overview: every design project with its canvases (boards, open threads, decisions per canvas). */\nexport const DesignStudioOverviewScreen = ({\n title = (\n <>\n Design <em>Studio</em>\n </>\n ),\n description = 'Design projects and their canvases — review, comment, decide.',\n}: DesignStudioOverviewScreenProps) => {\n const { api, components, paths, router } = useDesignStudio();\n const { Badge, Card, CardContent, CardHeader, CardTitle, CardGrid, PageHeader, PageSections, Skeleton, StatusCallout } =\n components;\n const { Link } = router;\n const { data, isLoading, error } = api.useOverviewQuery();\n const overview = data?.designStudioOverview;\n const projects = overview?.projects?.elements ?? [];\n const expiringThreadCount = overview?.expiringThreadCount ?? 0;\n\n return (\n <>\n <PageHeader\n title={title}\n description={description}\n leading={<Palette className=\"size-7 text-brand-emphasis\" aria-hidden />}\n />\n {error && (\n <StatusCallout\n tone=\"destructive\"\n title=\"The overview could not be loaded\"\n description={normalizeDddError(error, 'Request failed').message}\n className=\"mb-6\"\n />\n )}\n <PageSections>\n {isLoading && <Skeleton className=\"h-40 w-full rounded-2xl\" />}\n {!isLoading && !error && projects.length === 0 && (\n <StatusCallout\n title=\"No design projects configured\"\n description=\"Projects and canvases are configured in the backend; their boards are read from the canvas folders in the checkout.\"\n />\n )}\n {projects.length > 0 && (\n <CardGrid>\n {projects.map(project => {\n const projectKey = project.projectKey ?? '';\n const canvases = project.canvases?.elements ?? [];\n return (\n <Card key={projectKey}>\n <CardHeader>\n <CardTitle className=\"flex items-center justify-between gap-2 text-title-card\">\n <Link href={paths.project(projectKey)} className=\"hover:underline\">\n {project.label ?? projectKey}\n </Link>\n <Badge variant=\"outline\">\n {canvases.length} {canvases.length === 1 ? 'canvas' : 'canvases'}\n </Badge>\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2\">\n {canvases.length === 0 && (\n <p className=\"text-sm text-muted-foreground\">No canvas configured for this project yet.</p>\n )}\n {canvases.map(canvas => (\n <Link\n key={canvas.canvasKey}\n href={paths.canvas(projectKey, canvas.canvasKey ?? '')}\n className=\"flex items-center justify-between gap-3 rounded-xl bg-tint px-3 py-2 text-sm transition-colors hover:bg-tint-strong\"\n >\n <span className=\"flex min-w-0 items-center gap-2 font-medium\">\n <LayoutGrid className=\"size-4 shrink-0 text-brand-emphasis\" aria-hidden />\n <span className=\"truncate\">{canvas.label ?? canvas.canvasKey}</span>\n </span>\n <span className=\"shrink-0 text-muted-foreground\">\n {canvas.boardCount ?? 0} boards · {canvas.openThreadCount ?? 0} open ·{' '}\n {canvas.decisionCount ?? 0} decisions\n </span>\n </Link>\n ))}\n </CardContent>\n </Card>\n );\n })}\n </CardGrid>\n )}\n {overview && (\n <p className=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground\">\n <span>Boards are read from the canvas folders in the checkout; open threads and decisions are counted per canvas.</span>\n {expiringThreadCount > 0 && (\n <span className=\"inline-flex items-center gap-1 font-medium text-foreground\">\n <Hourglass className=\"size-3.5\" aria-hidden />\n {expiringThreadCount} {expiringThreadCount === 1 ? 'thread expires' : 'threads expire'} soon (threads idle\n for {overview.threadIdleDays ?? 0} days are deleted) — open the board and choose “Keep”.\n </span>\n )}\n </p>\n )}\n </PageSections>\n </>\n );\n};\n","'use client';\n\nimport { normalizeDddError } from '@mgamadeus/ddd-web/api';\nimport { Flag, LayoutGrid, MessageSquare } from 'lucide-react';\n\nimport { useDesignStudio } from '../provider/DesignStudioProvider';\n\nexport interface DesignStudioProjectScreenProps {\n projectKey: string;\n}\n\n/** One design project: its canvases as cards (projects and canvases come from the studio's overview). */\nexport const DesignStudioProjectScreen = ({ projectKey }: DesignStudioProjectScreenProps) => {\n const { api, components, paths, router } = useDesignStudio();\n const { Card, CardContent, PageHeader, Skeleton, StatusCallout } = components;\n const { Link } = router;\n const { data, isLoading, error } = api.useOverviewQuery();\n const project = data?.designStudioOverview.projects?.elements?.find(item => item.projectKey === projectKey);\n const canvases = project?.canvases?.elements ?? [];\n const isLoaded = !isLoading && !error;\n\n return (\n <>\n <PageHeader\n title={project?.label ?? projectKey}\n description={project ? 'The canvases of this design project.' : undefined}\n />\n {error && (\n <StatusCallout\n tone=\"destructive\"\n title=\"The canvases could not be loaded\"\n description={normalizeDddError(error, 'Request failed').message}\n />\n )}\n {isLoading && <Skeleton className=\"h-32 w-full rounded-2xl\" />}\n {isLoaded && !project && (\n <StatusCallout\n title=\"No design project with this key is configured\"\n description={\n <>\n The design studio knows no project <code className=\"font-mono text-xs\">{projectKey}</code>. Projects and\n their canvases are configured in the backend and read from the checkout folder.\n </>\n }\n />\n )}\n {isLoaded && project && canvases.length === 0 && (\n <StatusCallout\n title=\"No canvases yet\"\n description=\"Canvases are configured per project and their boards are read from the canvas folder in the checkout; a configured canvas appears here.\"\n />\n )}\n {canvases.length > 0 && (\n <div className=\"grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(320px,1fr))]\">\n {canvases.map(canvas => (\n <Link key={canvas.canvasKey} href={paths.canvas(projectKey, canvas.canvasKey ?? '')} className=\"group\">\n <Card className=\"h-full gap-0 py-0 transition-shadow group-hover:shadow-md\">\n <CardContent className=\"flex h-full flex-col gap-2 p-4\">\n <span className=\"flex items-center gap-2 font-semibold\">\n <LayoutGrid className=\"size-4 shrink-0 text-brand-emphasis\" aria-hidden />\n <span className=\"truncate\">{canvas.label ?? canvas.canvasKey}</span>\n </span>\n <p className=\"text-sm text-muted-foreground\">\n {canvas.boardCount ?? 0} boards\n <span className=\"inline-flex items-center gap-1 pl-3\">\n <MessageSquare className=\"size-3.5\" aria-hidden /> {canvas.openThreadCount ?? 0} open\n </span>\n <span className=\"inline-flex items-center gap-1 pl-3\">\n <Flag className=\"size-3.5\" aria-hidden /> {canvas.decisionCount ?? 0} decisions\n </span>\n </p>\n <p className=\"mt-auto text-xs text-muted-foreground\">{canvas.canvasKey}</p>\n </CardContent>\n </Card>\n </Link>\n ))}\n </div>\n )}\n </>\n );\n};\n","'use client';\n\nimport { ClipboardCheck } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { useDesignStudioComponents } from '../provider/DesignStudioProvider';\n\nexport interface DesignStudioReviewsScreenProps {\n /** One line under the title. */\n description?: ReactNode;\n /** Text of the empty state. */\n emptyDescription?: ReactNode;\n}\n\n/** Reviews linked to boards (empty for now: review documents come with a later step of the studio). */\nexport const DesignStudioReviewsScreen = ({\n description = 'Reviews with scores, linked to the boards.',\n emptyDescription = 'Review documents (scores, findings linked to boards, verified / adopted / rejected) come with a later step of the design studio.',\n}: DesignStudioReviewsScreenProps) => {\n const { PageHeader, StatusCallout } = useDesignStudioComponents();\n return (\n <>\n <PageHeader title=\"Reviews\" description={description} />\n <StatusCallout icon={ClipboardCheck} title=\"No reviews imported yet\" description={emptyDescription} />\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgCO,IAAM,oBAAoB;AAqDjC,IAAM,WAAW,CAAC,EAAE,MAAM,mBAAmB,IAAI,OAAO,CAAC;AACzD,IAAM,cAAc,CAAC,EAAE,MAAM,mBAAmB,IAAI,OAAO,GAAG,EAAE,MAAM,kBAAkB,CAAC;AASlF,IAAM,wBAAwB,CAAsD;AAAA,EACzF;AAAA,EACA;AACF,MAA4E;AAC1E,QAAM,YAAY,CAAC,QACjB,GAAG,SAAS,aAAa,IAAI,UAAU,IAAI,IAAI,SAAS;AAC1D,QAAM,aAAa,CAAC,QAAgC,GAAG,SAAS,aAAa,IAAI,qBAAqB;AAItG,QAAM,iBAAiB;AACvB,QAAM,MAAM,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WACE,OAAAC,MADF,QAAAC,aAAA;AANG,IAAM,4BAA4B,CAAC;AAAA,EACxC,cAAc;AAAA,EACd,mBAAmB;AACrB,MAAsC;AACpC,QAAM,EAAE,YAAY,cAAc,IAAI,0BAA0B;AAChE,SACE,gBAAAA,MAAAF,WAAA,EACE;AAAA,oBAAAC,KAAC,cAAW,OAAM,WAAU,aAA0B;AAAA,IACtD,gBAAAA,KAAC,iBAAc,MAAM,gBAAgB,OAAM,2BAA0B,aAAa,kBAAkB;AAAA,KACtG;AAEJ;","names":["normalizeDddError","LayoutGrid","Fragment","jsx","jsxs","normalizeDddError","LayoutGrid","Fragment","jsx","jsxs"]}
1
+ {"version":3,"sources":["../src/api/createDesignStudioApi.ts","../src/screens/DesignStudioOverviewScreen.tsx","../src/screens/DesignStudioProjectScreen.tsx","../src/screens/DesignStudioReviewsScreen.tsx"],"sourcesContent":["import type {\n Api,\n BaseQueryFn,\n coreModuleName,\n FetchArgs,\n FetchBaseQueryError,\n FetchBaseQueryMeta,\n} from '@reduxjs/toolkit/query';\nimport type { reactHooksModuleName, TypedUseMutation, TypedUseQuery } from '@reduxjs/toolkit/query/react';\n\nimport type {\n DesignStudioBoardStatusPatchArg,\n DesignStudioBoardStatusResponse,\n DesignStudioCanvasArg,\n DesignStudioCanvasCommentsArg,\n DesignStudioCanvasResponse,\n DesignStudioCanvasRevisionResponse,\n DesignStudioCommentArg,\n DesignStudioCommentCreateArg,\n DesignStudioCommentPatchArg,\n DesignStudioCommentReplyArg,\n DesignStudioCommentResolveArg,\n DesignStudioCommentResponse,\n DesignStudioCommentsResponse,\n DesignStudioDeleteResponse,\n DesignStudioOverviewResponse,\n DesignStudioThemesArg,\n DesignStudioThemesResponse,\n DesignStudioThumbnailRenderRequestArg,\n} from './types';\n\n/** The one cache tag of the studio: every query provides it, every mutation invalidates it. */\nexport const DESIGN_STUDIO_TAG = 'DesignStudio';\n\n/** The base query the studio's endpoints run on: a fetch-style one (`createDddBaseQuery` of `@mgamadeus/ddd-web/api`). */\nexport type DesignStudioBaseQuery = BaseQueryFn<\n string | FetchArgs,\n unknown,\n FetchBaseQueryError,\n object,\n FetchBaseQueryMeta\n>;\n\n/** The application's RTK Query api (`createApi` from `@reduxjs/toolkit/query/react`) the endpoints are injected into. */\nexport type DesignStudioBaseApi<ReducerPath extends string = string, TagTypes extends string = string> = Api<\n DesignStudioBaseQuery,\n // biome-ignore lint/complexity/noBannedTypes: RTK Query's own type of \"no endpoints yet\" (`createApi({ endpoints: () => ({}) })`)\n {},\n ReducerPath,\n TagTypes,\n typeof coreModuleName | typeof reactHooksModuleName\n>;\n\nexport interface CreateDesignStudioApiOptions<ReducerPath extends string, TagTypes extends string> {\n /** The application's api; its base query carries the origin, the session and the refresh. */\n baseApi: DesignStudioBaseApi<ReducerPath, TagTypes>;\n /** Path prefix of the studio's routes, without a trailing slash (e.g. `/api/admin/designStudio`). */\n apiPrefix: string;\n}\n\ntype DesignStudioQueryHook<ResultType, QueryArg> = TypedUseQuery<ResultType, QueryArg, DesignStudioBaseQuery>;\ntype DesignStudioMutationHook<ResultType, QueryArg> = TypedUseMutation<ResultType, QueryArg, DesignStudioBaseQuery>;\n\n/** The hooks `createDesignStudioApi` returns (`environment.api`). */\nexport interface DesignStudioApi {\n useOverviewQuery: DesignStudioQueryHook<DesignStudioOverviewResponse, void>;\n useThemesQuery: DesignStudioQueryHook<DesignStudioThemesResponse, DesignStudioThemesArg>;\n useCanvasQuery: DesignStudioQueryHook<DesignStudioCanvasResponse, DesignStudioCanvasArg>;\n useCanvasRevisionQuery: DesignStudioQueryHook<DesignStudioCanvasRevisionResponse, DesignStudioCanvasArg>;\n useCanvasCommentsQuery: DesignStudioQueryHook<DesignStudioCommentsResponse, DesignStudioCanvasCommentsArg>;\n useExpiringCommentsQuery: DesignStudioQueryHook<DesignStudioCommentsResponse, void>;\n useRequestThumbnailRenderingMutation: DesignStudioMutationHook<\n DesignStudioCanvasResponse,\n DesignStudioThumbnailRenderRequestArg\n >;\n useSetBoardStatusMutation: DesignStudioMutationHook<DesignStudioBoardStatusResponse, DesignStudioBoardStatusPatchArg>;\n useCreateCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentCreateArg>;\n useReplyToCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentReplyArg>;\n usePatchCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentPatchArg>;\n useDeleteCommentMutation: DesignStudioMutationHook<DesignStudioDeleteResponse, DesignStudioCommentArg>;\n useResolveCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentResolveArg>;\n useReopenCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentArg>;\n useKeepCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentArg>;\n}\n\nconst PROVIDED = [{ type: DESIGN_STUDIO_TAG, id: 'LIST' }] as const;\nconst INVALIDATED = [{ type: DESIGN_STUDIO_TAG, id: 'LIST' }, { type: DESIGN_STUDIO_TAG }] as const;\n\n/**\n * Injects the studio's 15 operations into the application's RTK Query api and returns their hooks. Call it once (module\n * scope) and hand the result to `DesignStudioProvider` as `environment.api`.\n *\n * Cache: one tag (`DesignStudio`). Every query provides it and every mutation invalidates it, so a write refetches\n * whatever the studio has on screen (the canvas, its comments, the overview).\n */\nexport const createDesignStudioApi = <ReducerPath extends string, TagTypes extends string>({\n baseApi,\n apiPrefix,\n}: CreateDesignStudioApiOptions<ReducerPath, TagTypes>): DesignStudioApi => {\n const canvasUrl = (arg: { projectKey: string; canvasKey: string }) =>\n `${apiPrefix}/canvases/${arg.projectKey}/${arg.canvasKey}`;\n const commentUrl = (arg: DesignStudioCommentArg) => `${apiPrefix}/comments/${arg.designStudioCommentId}`;\n\n // Widened to plain strings: the returned hooks do not depend on the application's reducer path and tag names. An api\n // is invariant in both, hence the cast; it also keeps the hook types nameable in the package's declaration files.\n const widenedBaseApi = baseApi as unknown as DesignStudioBaseApi;\n const api = widenedBaseApi.enhanceEndpoints({ addTagTypes: [DESIGN_STUDIO_TAG] }).injectEndpoints({\n endpoints: build => ({\n designStudioOverview: build.query<DesignStudioOverviewResponse, void>({\n query: () => ({ url: `${apiPrefix}/overview` }),\n providesTags: PROVIDED,\n }),\n designStudioThemes: build.query<DesignStudioThemesResponse, DesignStudioThemesArg>({\n query: arg => ({\n url: `${apiPrefix}/themes`,\n params: { search: arg.search, noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n providesTags: PROVIDED,\n }),\n designStudioCanvas: build.query<DesignStudioCanvasResponse, DesignStudioCanvasArg>({\n query: arg => ({\n url: canvasUrl(arg),\n params: { theme: arg.theme, noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n providesTags: PROVIDED,\n }),\n designStudioCanvasRevision: build.query<DesignStudioCanvasRevisionResponse, DesignStudioCanvasArg>({\n query: arg => ({\n url: `${canvasUrl(arg)}/revision`,\n params: { theme: arg.theme, noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n providesTags: PROVIDED,\n }),\n designStudioCanvasComments: build.query<DesignStudioCommentsResponse, DesignStudioCanvasCommentsArg>({\n query: arg => ({\n url: `${canvasUrl(arg)}/comments`,\n params: {\n theme: arg.theme,\n noCache: arg.noCache,\n outputFormat: arg.outputFormat,\n onlyOpenThreads: arg.onlyOpenThreads,\n sinceId: arg.sinceId,\n },\n }),\n providesTags: PROVIDED,\n }),\n designStudioExpiringComments: build.query<DesignStudioCommentsResponse, void>({\n query: () => ({ url: `${apiPrefix}/comments/expiring` }),\n providesTags: PROVIDED,\n }),\n designStudioRequestThumbnailRendering: build.mutation<\n DesignStudioCanvasResponse,\n DesignStudioThumbnailRenderRequestArg\n >({\n query: arg => ({\n url: `${canvasUrl(arg)}/thumbnailRenderRequests`,\n method: 'POST',\n body: arg.body,\n params: { theme: arg.theme, noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioSetBoardStatus: build.mutation<DesignStudioBoardStatusResponse, DesignStudioBoardStatusPatchArg>({\n query: arg => ({\n url: `${canvasUrl(arg)}/boards/${arg.boardKey}/status`,\n method: 'PATCH',\n body: arg.body,\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioCreateComment: build.mutation<DesignStudioCommentResponse, DesignStudioCommentCreateArg>({\n query: arg => ({\n url: `${canvasUrl(arg)}/boards/${arg.boardKey}/comments`,\n method: 'POST',\n body: arg.body,\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioReplyToComment: build.mutation<DesignStudioCommentResponse, DesignStudioCommentReplyArg>({\n query: arg => ({\n url: `${commentUrl(arg)}/replies`,\n method: 'POST',\n body: arg.body,\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioPatchComment: build.mutation<DesignStudioCommentResponse, DesignStudioCommentPatchArg>({\n query: arg => ({\n url: commentUrl(arg),\n method: 'PATCH',\n body: arg.body,\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioDeleteComment: build.mutation<DesignStudioDeleteResponse, DesignStudioCommentArg>({\n query: arg => ({\n url: commentUrl(arg),\n method: 'DELETE',\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioResolveComment: build.mutation<DesignStudioCommentResponse, DesignStudioCommentResolveArg>({\n query: arg => ({\n url: `${commentUrl(arg)}/resolve`,\n method: 'POST',\n body: arg.body,\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioReopenComment: build.mutation<DesignStudioCommentResponse, DesignStudioCommentArg>({\n query: arg => ({\n url: `${commentUrl(arg)}/reopen`,\n method: 'POST',\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n designStudioKeepComment: build.mutation<DesignStudioCommentResponse, DesignStudioCommentArg>({\n query: arg => ({\n url: `${commentUrl(arg)}/keep`,\n method: 'POST',\n params: { noCache: arg.noCache, outputFormat: arg.outputFormat },\n }),\n invalidatesTags: INVALIDATED,\n }),\n }),\n overrideExisting: false,\n });\n\n return {\n useOverviewQuery: api.useDesignStudioOverviewQuery,\n useThemesQuery: api.useDesignStudioThemesQuery,\n useCanvasQuery: api.useDesignStudioCanvasQuery,\n useCanvasRevisionQuery: api.useDesignStudioCanvasRevisionQuery,\n useCanvasCommentsQuery: api.useDesignStudioCanvasCommentsQuery,\n useExpiringCommentsQuery: api.useDesignStudioExpiringCommentsQuery,\n useRequestThumbnailRenderingMutation: api.useDesignStudioRequestThumbnailRenderingMutation,\n useSetBoardStatusMutation: api.useDesignStudioSetBoardStatusMutation,\n useCreateCommentMutation: api.useDesignStudioCreateCommentMutation,\n useReplyToCommentMutation: api.useDesignStudioReplyToCommentMutation,\n usePatchCommentMutation: api.useDesignStudioPatchCommentMutation,\n useDeleteCommentMutation: api.useDesignStudioDeleteCommentMutation,\n useResolveCommentMutation: api.useDesignStudioResolveCommentMutation,\n useReopenCommentMutation: api.useDesignStudioReopenCommentMutation,\n useKeepCommentMutation: api.useDesignStudioKeepCommentMutation,\n };\n};\n","'use client';\n\nimport { normalizeDddError } from '@mgamadeus/ddd-web/api';\nimport { Hourglass, LayoutGrid, Palette } from 'lucide-react';\nimport { type FormEvent, type ReactNode, useEffect, useMemo, useRef, useState } from 'react';\n\nimport type { DesignStudioProjectSummary } from '../api/types';\nimport { boardCodeUrlValue, CODE_PARAM, codeBelongsToCanvas } from '../canvas/boardCode';\nimport { useDesignStudio, useDesignStudioTexts } from '../provider/DesignStudioProvider';\nimport type { DesignStudioPaths } from '../provider/types';\n\n/** Without the application's `useNavigate` the overview shows a link to the board instead of navigating. */\nconst useNoNavigate = (): ((href: string) => void) | null => null;\n\nexport interface DesignStudioOverviewScreenProps {\n /** Page title (a two-tone title wraps its accent part in `<em>`). */\n title?: ReactNode;\n /** One line under the title. */\n description?: ReactNode;\n}\n\n/**\n * The canvas page that opens a board code (`APP ONB-W2`, `ONB-W2`): the path of the one canvas whose code the\n * typed code starts with, with `?code=`; null when no canvas or more than one matches.\n */\nconst codeTarget = (\n projects: readonly DesignStudioProjectSummary[],\n typedCode: string,\n paths: DesignStudioPaths\n): string | null => {\n const targets = projects.flatMap(project =>\n (project.canvases?.elements ?? [])\n .filter(canvas => codeBelongsToCanvas(typedCode, canvas.code))\n .map(canvas => `${paths.canvas(project.projectKey ?? '', canvas.canvasKey ?? '')}?${CODE_PARAM}=${encodeURIComponent(boardCodeUrlValue(typedCode))}`)\n );\n return targets.length === 1 ? targets[0] : null;\n};\n\n/**\n * Overview: every design project with its canvases (boards, open threads, decisions per canvas), and a field that\n * opens a board by its code. `?code=<board code>` on this page opens it directly (a short link that needs no canvas\n * path).\n */\nexport const DesignStudioOverviewScreen = ({\n title = (\n <>\n Design <em>Studio</em>\n </>\n ),\n description = 'Design projects and their canvases — review, comment, decide.',\n}: DesignStudioOverviewScreenProps) => {\n const { api, components, paths, router } = useDesignStudio();\n const texts = useDesignStudioTexts();\n const {\n Badge,\n Button,\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n CardGrid,\n PageHeader,\n PageSections,\n SearchField,\n Skeleton,\n StatusCallout,\n } = components;\n const { Link } = router;\n const navigate = (router.useNavigate ?? useNoNavigate)();\n const { data, isLoading, error } = api.useOverviewQuery();\n const overview = data?.designStudioOverview;\n const projects = useMemo(() => overview?.projects?.elements ?? [], [overview]);\n const expiringThreadCount = overview?.expiringThreadCount ?? 0;\n const hasCodes = projects.some(project => (project.canvases?.elements ?? []).some(canvas => canvas.code));\n\n // Open a board by its code: typed into the field, or `?code=` on this page.\n const codeParam = router.useSearchParams().get(CODE_PARAM);\n const [typedCode, setTypedCode] = useState('');\n const [pendingCode, setPendingCode] = useState<{ code: string; href: string | null } | null>(null);\n const openCode = (code: string) => {\n if (!code.trim()) return;\n const href = codeTarget(projects, code, paths);\n setPendingCode({ code: code.trim(), href });\n if (href && navigate) navigate(href);\n };\n const openCodeRef = useRef(openCode);\n openCodeRef.current = openCode;\n const handledCodeParamRef = useRef<string | null>(null);\n useEffect(() => {\n if (!codeParam || !overview || handledCodeParamRef.current === codeParam) return;\n handledCodeParamRef.current = codeParam;\n openCodeRef.current(codeParam);\n }, [codeParam, overview]);\n const submitCode = (event: FormEvent) => {\n event.preventDefault();\n openCode(typedCode);\n };\n\n return (\n <>\n <PageHeader\n title={title}\n description={description}\n leading={<Palette className=\"size-7 text-brand-emphasis\" aria-hidden />}\n />\n {error && (\n <StatusCallout\n tone=\"destructive\"\n title=\"The overview could not be loaded\"\n description={normalizeDddError(error, 'Request failed').message}\n className=\"mb-6\"\n />\n )}\n <PageSections>\n {hasCodes && (\n <form onSubmit={submitCode} className=\"flex max-w-md items-center gap-2\">\n <SearchField\n value={typedCode}\n onChange={setTypedCode}\n placeholder=\"Open a board by its code, e.g. APP ONB-W2\"\n aria-label=\"Board code\"\n className=\"flex-1\"\n clearable\n />\n <Button type=\"submit\" variant=\"outline\" disabled={!typedCode.trim()}>\n Open\n </Button>\n </form>\n )}\n {pendingCode && !pendingCode.href && (\n <StatusCallout tone=\"destructive\" title={texts.boardCodeNotFound(pendingCode.code)} />\n )}\n {pendingCode?.href && !navigate && (\n <StatusCallout\n title={`Board ${pendingCode.code}`}\n description={<Link href={pendingCode.href}>Open it on its canvas</Link>}\n />\n )}\n {isLoading && <Skeleton className=\"h-40 w-full rounded-2xl\" />}\n {!isLoading && !error && projects.length === 0 && (\n <StatusCallout\n title=\"No design projects configured\"\n description=\"Projects and canvases are configured in the backend; their boards are read from the canvas folders in the checkout.\"\n />\n )}\n {projects.length > 0 && (\n <CardGrid>\n {projects.map(project => {\n const projectKey = project.projectKey ?? '';\n const canvases = project.canvases?.elements ?? [];\n return (\n <Card key={projectKey}>\n <CardHeader>\n <CardTitle className=\"flex items-center justify-between gap-2 text-title-card\">\n <Link href={paths.project(projectKey)} className=\"hover:underline\">\n {project.label ?? projectKey}\n </Link>\n <Badge variant=\"outline\">\n {canvases.length} {canvases.length === 1 ? 'canvas' : 'canvases'}\n </Badge>\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2\">\n {canvases.length === 0 && (\n <p className=\"text-sm text-muted-foreground\">No canvas configured for this project yet.</p>\n )}\n {canvases.map(canvas => (\n <Link\n key={canvas.canvasKey}\n href={paths.canvas(projectKey, canvas.canvasKey ?? '')}\n className=\"flex items-center justify-between gap-3 rounded-xl bg-tint px-3 py-2 text-sm transition-colors hover:bg-tint-strong\"\n >\n <span className=\"flex min-w-0 items-center gap-2 font-medium\">\n <LayoutGrid className=\"size-4 shrink-0 text-brand-emphasis\" aria-hidden />\n <span className=\"truncate\">{canvas.label ?? canvas.canvasKey}</span>\n {canvas.code && (\n <span className=\"shrink-0 text-xs font-semibold text-muted-foreground tabular-nums\">{canvas.code}</span>\n )}\n </span>\n <span className=\"shrink-0 text-muted-foreground\">\n {canvas.boardCount ?? 0} boards · {canvas.openThreadCount ?? 0} open ·{' '}\n {canvas.decisionCount ?? 0} decisions\n </span>\n </Link>\n ))}\n </CardContent>\n </Card>\n );\n })}\n </CardGrid>\n )}\n {overview && (\n <p className=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground\">\n <span>Boards are read from the canvas folders in the checkout; open threads and decisions are counted per canvas.</span>\n {expiringThreadCount > 0 && (\n <span className=\"inline-flex items-center gap-1 font-medium text-foreground\">\n <Hourglass className=\"size-3.5\" aria-hidden />\n {expiringThreadCount} {expiringThreadCount === 1 ? 'thread expires' : 'threads expire'} soon (threads idle\n for {overview.threadIdleDays ?? 0} days are deleted) — open the board and choose “Keep”.\n </span>\n )}\n </p>\n )}\n </PageSections>\n </>\n );\n};\n","'use client';\n\nimport { normalizeDddError } from '@mgamadeus/ddd-web/api';\nimport { Flag, LayoutGrid, MessageSquare } from 'lucide-react';\n\nimport { useDesignStudio } from '../provider/DesignStudioProvider';\n\nexport interface DesignStudioProjectScreenProps {\n projectKey: string;\n}\n\n/** One design project: its canvases as cards (projects and canvases come from the studio's overview). */\nexport const DesignStudioProjectScreen = ({ projectKey }: DesignStudioProjectScreenProps) => {\n const { api, components, paths, router } = useDesignStudio();\n const { Card, CardContent, PageHeader, Skeleton, StatusCallout } = components;\n const { Link } = router;\n const { data, isLoading, error } = api.useOverviewQuery();\n const project = data?.designStudioOverview.projects?.elements?.find(item => item.projectKey === projectKey);\n const canvases = project?.canvases?.elements ?? [];\n const isLoaded = !isLoading && !error;\n\n return (\n <>\n <PageHeader\n title={project?.label ?? projectKey}\n description={project ? 'The canvases of this design project.' : undefined}\n />\n {error && (\n <StatusCallout\n tone=\"destructive\"\n title=\"The canvases could not be loaded\"\n description={normalizeDddError(error, 'Request failed').message}\n />\n )}\n {isLoading && <Skeleton className=\"h-32 w-full rounded-2xl\" />}\n {isLoaded && !project && (\n <StatusCallout\n title=\"No design project with this key is configured\"\n description={\n <>\n The design studio knows no project <code className=\"font-mono text-xs\">{projectKey}</code>. Projects and\n their canvases are configured in the backend and read from the checkout folder.\n </>\n }\n />\n )}\n {isLoaded && project && canvases.length === 0 && (\n <StatusCallout\n title=\"No canvases yet\"\n description=\"Canvases are configured per project and their boards are read from the canvas folder in the checkout; a configured canvas appears here.\"\n />\n )}\n {canvases.length > 0 && (\n <div className=\"grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(320px,1fr))]\">\n {canvases.map(canvas => (\n <Link key={canvas.canvasKey} href={paths.canvas(projectKey, canvas.canvasKey ?? '')} className=\"group\">\n <Card className=\"h-full gap-0 py-0 transition-shadow group-hover:shadow-md\">\n <CardContent className=\"flex h-full flex-col gap-2 p-4\">\n <span className=\"flex items-center gap-2 font-semibold\">\n <LayoutGrid className=\"size-4 shrink-0 text-brand-emphasis\" aria-hidden />\n <span className=\"truncate\">{canvas.label ?? canvas.canvasKey}</span>\n </span>\n <p className=\"text-sm text-muted-foreground\">\n {canvas.boardCount ?? 0} boards\n <span className=\"inline-flex items-center gap-1 pl-3\">\n <MessageSquare className=\"size-3.5\" aria-hidden /> {canvas.openThreadCount ?? 0} open\n </span>\n <span className=\"inline-flex items-center gap-1 pl-3\">\n <Flag className=\"size-3.5\" aria-hidden /> {canvas.decisionCount ?? 0} decisions\n </span>\n </p>\n <p className=\"mt-auto text-xs text-muted-foreground\">{canvas.canvasKey}</p>\n </CardContent>\n </Card>\n </Link>\n ))}\n </div>\n )}\n </>\n );\n};\n","'use client';\n\nimport { ClipboardCheck } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { useDesignStudioComponents } from '../provider/DesignStudioProvider';\n\nexport interface DesignStudioReviewsScreenProps {\n /** One line under the title. */\n description?: ReactNode;\n /** Text of the empty state. */\n emptyDescription?: ReactNode;\n}\n\n/** Reviews linked to boards (empty for now: review documents come with a later step of the studio). */\nexport const DesignStudioReviewsScreen = ({\n description = 'Reviews with scores, linked to the boards.',\n emptyDescription = 'Review documents (scores, findings linked to boards, verified / adopted / rejected) come with a later step of the design studio.',\n}: DesignStudioReviewsScreenProps) => {\n const { PageHeader, StatusCallout } = useDesignStudioComponents();\n return (\n <>\n <PageHeader title=\"Reviews\" description={description} />\n <StatusCallout icon={ClipboardCheck} title=\"No reviews imported yet\" description={emptyDescription} />\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCO,IAAM,oBAAoB;AAqDjC,IAAM,WAAW,CAAC,EAAE,MAAM,mBAAmB,IAAI,OAAO,CAAC;AACzD,IAAM,cAAc,CAAC,EAAE,MAAM,mBAAmB,IAAI,OAAO,GAAG,EAAE,MAAM,kBAAkB,CAAC;AASlF,IAAM,wBAAwB,CAAsD;AAAA,EACzF;AAAA,EACA;AACF,MAA4E;AAC1E,QAAM,YAAY,CAAC,QACjB,GAAG,SAAS,aAAa,IAAI,UAAU,IAAI,IAAI,SAAS;AAC1D,QA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