@mgamadeus/ddd-design-studio 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +358 -2
- package/dist/canvas/index.d.ts +18 -0
- package/dist/canvas/index.js +3063 -0
- package/dist/canvas/index.js.map +1 -0
- package/dist/chunk-RFW6QPM3.js +143 -0
- package/dist/chunk-RFW6QPM3.js.map +1 -0
- package/dist/index.d.ts +803 -0
- package/dist/index.js +386 -0
- package/dist/index.js.map +1 -0
- package/package.json +86 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,803 @@
|
|
|
1
|
+
import { Api, BaseQueryFn, FetchArgs, FetchBaseQueryError, FetchBaseQueryMeta, coreModuleName } from '@reduxjs/toolkit/query';
|
|
2
|
+
import { reactHooksModuleName, TypedUseQuery, TypedUseMutation } from '@reduxjs/toolkit/query/react';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { HTMLAttributes, ButtonHTMLAttributes, ComponentType, ReactNode, TextareaHTMLAttributes, InputHTMLAttributes } from 'react';
|
|
5
|
+
import { LucideIcon } from 'lucide-react';
|
|
6
|
+
import { ClassValue } from 'clsx';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The design studio's API contract: the entities, response bodies and request arguments of the 15 operations the studio
|
|
10
|
+
* calls (`createDesignStudioApi`). Field names are the backend's (the DesignStudio domain of a DDD application); these
|
|
11
|
+
* types are maintained here by hand and are the package's contract with the backend.
|
|
12
|
+
*/
|
|
13
|
+
/** Created / modified times of a stored entity (offsetless UTC `Y-m-d H:i:s`). */
|
|
14
|
+
interface DesignStudioChangeHistory {
|
|
15
|
+
createdTime?: string | null;
|
|
16
|
+
modifiedTime?: string | null;
|
|
17
|
+
objectType?: string | null;
|
|
18
|
+
}
|
|
19
|
+
/** A comment on a board: a thread root (`parentDesignStudioCommentId` null) or a reply. */
|
|
20
|
+
interface DesignStudioComment {
|
|
21
|
+
/** Key of the design project */
|
|
22
|
+
projectKey: string | null;
|
|
23
|
+
/** Key of the canvas within the project */
|
|
24
|
+
canvasKey: string | null;
|
|
25
|
+
/** File name of the board in the canvas folder */
|
|
26
|
+
boardKey: string | null;
|
|
27
|
+
/** Content hash of the board file the comment was written on (git blob hash) */
|
|
28
|
+
contentHash: string | null;
|
|
29
|
+
/** The thread root this comment replies to; null = a thread root */
|
|
30
|
+
parentDesignStudioCommentId?: number | null;
|
|
31
|
+
parentDesignStudioComment?: DesignStudioComment;
|
|
32
|
+
/** Pin position from the board's left edge in board pixels; null = a comment on the whole board */
|
|
33
|
+
x?: number | null;
|
|
34
|
+
/** Pin position from the board's top edge in board pixels */
|
|
35
|
+
y?: number | null;
|
|
36
|
+
/** The comment */
|
|
37
|
+
text: string | null;
|
|
38
|
+
/** Id of the account that wrote it; no relation, the account may be gone */
|
|
39
|
+
authorAccountId?: number | null;
|
|
40
|
+
/** Author as shown in the studio */
|
|
41
|
+
authorName?: string | null;
|
|
42
|
+
/** `USER`: written by a person in the studio · `AGENT`: written by an agent through the console commands */
|
|
43
|
+
authorKind: ('USER' | 'AGENT') | null;
|
|
44
|
+
/** Resolved (thread roots only) */
|
|
45
|
+
isResolved: boolean | null;
|
|
46
|
+
/** When it was resolved */
|
|
47
|
+
resolvedAt?: string | null;
|
|
48
|
+
/** Who resolved it */
|
|
49
|
+
resolvedByName?: string | null;
|
|
50
|
+
/** Marks a decision (decisions log); decisions do not expire unless configured */
|
|
51
|
+
isDecision: boolean | null;
|
|
52
|
+
/** Object key of the board file as it was when the thread started (thread roots only) */
|
|
53
|
+
snapshotObjectKey?: string | null;
|
|
54
|
+
/** Last activity in the thread (comment, reply, resolve, reopen, keep); set on the thread root, drives expiry */
|
|
55
|
+
lastActivityAt?: string | null;
|
|
56
|
+
objectType?: string | null;
|
|
57
|
+
/** The internal identifier of the entity */
|
|
58
|
+
id?: string | number | null;
|
|
59
|
+
changeHistory?: DesignStudioChangeHistory;
|
|
60
|
+
}
|
|
61
|
+
interface DesignStudioComments {
|
|
62
|
+
elements?: DesignStudioComment[];
|
|
63
|
+
objectType?: string | null;
|
|
64
|
+
}
|
|
65
|
+
/** The stored review status of a board. */
|
|
66
|
+
interface DesignStudioBoardStatus {
|
|
67
|
+
projectKey: string | null;
|
|
68
|
+
canvasKey: string | null;
|
|
69
|
+
boardKey: string | null;
|
|
70
|
+
/** Status key (one of the configured statuses) */
|
|
71
|
+
status: string | null;
|
|
72
|
+
/** Content hash of the board file when the status was set (git blob hash) */
|
|
73
|
+
contentHash?: string | null;
|
|
74
|
+
/** Id of the account that set the status; no relation, the account may be gone */
|
|
75
|
+
changedByAccountId?: number | null;
|
|
76
|
+
/** Who set the status, as shown in the studio */
|
|
77
|
+
changedByName?: string | null;
|
|
78
|
+
objectType?: string | null;
|
|
79
|
+
id?: string | number | null;
|
|
80
|
+
changeHistory?: DesignStudioChangeHistory;
|
|
81
|
+
}
|
|
82
|
+
/** A section of a canvas (a titled group of boards). */
|
|
83
|
+
interface DesignDirectorySection {
|
|
84
|
+
/** Key of the section in the canvas definition */
|
|
85
|
+
sectionKey?: string | null;
|
|
86
|
+
/** Section title */
|
|
87
|
+
title?: string | null;
|
|
88
|
+
/** Left edge of the title, relative to the canvas selection */
|
|
89
|
+
x?: number;
|
|
90
|
+
/** Top edge of the title, relative to the canvas selection */
|
|
91
|
+
y?: number;
|
|
92
|
+
/** Width the title may take, 0 = unbounded */
|
|
93
|
+
maximumWidth?: number;
|
|
94
|
+
/** Position within the canvas, top to bottom, starting at 1 */
|
|
95
|
+
displayOrder?: number;
|
|
96
|
+
objectType?: string | null;
|
|
97
|
+
}
|
|
98
|
+
interface DesignDirectorySections {
|
|
99
|
+
elements?: DesignDirectorySection[];
|
|
100
|
+
objectType?: string | null;
|
|
101
|
+
}
|
|
102
|
+
/** One board of a canvas as the studio shows it. */
|
|
103
|
+
interface DesignStudioBoardView {
|
|
104
|
+
/** File name of the board in the canvas folder */
|
|
105
|
+
boardKey?: string | null;
|
|
106
|
+
/** Board title */
|
|
107
|
+
title?: string | null;
|
|
108
|
+
/** Left edge, relative to the canvas selection */
|
|
109
|
+
x?: number;
|
|
110
|
+
/** Top edge, relative to the canvas selection */
|
|
111
|
+
y?: number;
|
|
112
|
+
/** Width in pixels */
|
|
113
|
+
width?: number;
|
|
114
|
+
/** Height in pixels */
|
|
115
|
+
height?: number;
|
|
116
|
+
/** Key of the section the board belongs to */
|
|
117
|
+
sectionKey?: string | null;
|
|
118
|
+
/** Position within the canvas, starting at 1 */
|
|
119
|
+
displayOrder?: number;
|
|
120
|
+
/** Content hash of the board file (git blob hash) */
|
|
121
|
+
contentHash?: string | null;
|
|
122
|
+
/** Review status (one of the configured statuses; the default without a stored one) */
|
|
123
|
+
status?: string | null;
|
|
124
|
+
/** The board file changed after the status was set */
|
|
125
|
+
hasChangedSinceStatus?: boolean;
|
|
126
|
+
/** Comment threads on the board that are not resolved */
|
|
127
|
+
openThreadCount?: number;
|
|
128
|
+
/** URL of the board for the sandboxed iframe (carries the content token) */
|
|
129
|
+
htmlUrl?: string | null;
|
|
130
|
+
/** URL of the thumbnail in the requested look, null when there is none (yet) */
|
|
131
|
+
thumbnailUrl?: string | null;
|
|
132
|
+
/** URL of the reduced thumbnail for far zoom levels, null when there is none (yet) */
|
|
133
|
+
thumbnailSmallUrl?: string | null;
|
|
134
|
+
objectType?: string | null;
|
|
135
|
+
}
|
|
136
|
+
interface DesignStudioBoardViews {
|
|
137
|
+
elements?: DesignStudioBoardView[];
|
|
138
|
+
objectType?: string | null;
|
|
139
|
+
}
|
|
140
|
+
/** A canvas with its sections and boards in one look. */
|
|
141
|
+
interface DesignStudioCanvasView {
|
|
142
|
+
projectKey?: string | null;
|
|
143
|
+
canvasKey?: string | null;
|
|
144
|
+
/** Name of the canvas */
|
|
145
|
+
label?: string | null;
|
|
146
|
+
/** Reference of the theme the delivery URLs and thumbnails are in, null = no theme */
|
|
147
|
+
themeReference?: string | null;
|
|
148
|
+
/** Reference of the theme the canvas names as its usual look */
|
|
149
|
+
referenceTheme?: string | null;
|
|
150
|
+
sections?: DesignDirectorySections;
|
|
151
|
+
boards?: DesignStudioBoardViews;
|
|
152
|
+
/** Problems found while reading the folder (missing files, oversized boards) */
|
|
153
|
+
warnings?: string[];
|
|
154
|
+
/** The configured status keys in display order */
|
|
155
|
+
statuses?: string[];
|
|
156
|
+
/** Fingerprint of boards, comments and statuses */
|
|
157
|
+
revision?: string | null;
|
|
158
|
+
/** Thumbnails are rendered and shown */
|
|
159
|
+
isRendererEnabled?: boolean;
|
|
160
|
+
/** Boards without a thumbnail in the requested look */
|
|
161
|
+
missingThumbnailCount?: number;
|
|
162
|
+
/** Status of the newest render request for the look, null without one */
|
|
163
|
+
renderRequestStatus?: string | null;
|
|
164
|
+
/** Last renderer problem of that request */
|
|
165
|
+
renderRequestError?: string | null;
|
|
166
|
+
objectType?: string | null;
|
|
167
|
+
}
|
|
168
|
+
interface DesignStudioCanvasSummary {
|
|
169
|
+
canvasKey?: string | null;
|
|
170
|
+
/** Name of the canvas */
|
|
171
|
+
label?: string | null;
|
|
172
|
+
/** Reference of the theme the canvas names as its usual look */
|
|
173
|
+
referenceTheme?: string | null;
|
|
174
|
+
/** Boards in the checkout */
|
|
175
|
+
boardCount?: number;
|
|
176
|
+
/** Comment threads that are not resolved */
|
|
177
|
+
openThreadCount?: number;
|
|
178
|
+
/** Decisions recorded on the canvas */
|
|
179
|
+
decisionCount?: number;
|
|
180
|
+
objectType?: string | null;
|
|
181
|
+
}
|
|
182
|
+
interface DesignStudioCanvasSummaries {
|
|
183
|
+
elements?: DesignStudioCanvasSummary[];
|
|
184
|
+
objectType?: string | null;
|
|
185
|
+
}
|
|
186
|
+
interface DesignStudioProjectSummary {
|
|
187
|
+
projectKey?: string | null;
|
|
188
|
+
/** Name of the project */
|
|
189
|
+
label?: string | null;
|
|
190
|
+
canvases?: DesignStudioCanvasSummaries;
|
|
191
|
+
objectType?: string | null;
|
|
192
|
+
}
|
|
193
|
+
interface DesignStudioProjectSummaries {
|
|
194
|
+
elements?: DesignStudioProjectSummary[];
|
|
195
|
+
objectType?: string | null;
|
|
196
|
+
}
|
|
197
|
+
/** Every project with its canvases, and the studio's configuration. */
|
|
198
|
+
interface DesignStudioOverview {
|
|
199
|
+
projects?: DesignStudioProjectSummaries;
|
|
200
|
+
/** The configured status keys in display order; the first is the default */
|
|
201
|
+
statuses?: string[];
|
|
202
|
+
/** Thumbnails are rendered and shown */
|
|
203
|
+
isRendererEnabled?: boolean;
|
|
204
|
+
/** The application offers themes (looks) for the boards */
|
|
205
|
+
hasThemes?: boolean;
|
|
206
|
+
/** Days a thread may be idle before it is deleted */
|
|
207
|
+
threadIdleDays?: number;
|
|
208
|
+
/** Threads that will be deleted soon unless something happens in them */
|
|
209
|
+
expiringThreadCount?: number;
|
|
210
|
+
objectType?: string | null;
|
|
211
|
+
}
|
|
212
|
+
/** A look the application offers for the boards. */
|
|
213
|
+
interface DesignTheme {
|
|
214
|
+
/** Id the application's theme provider resolves (no `:light` / `:dark` suffix) */
|
|
215
|
+
themeId?: string | null;
|
|
216
|
+
/** Name shown in the theme switcher */
|
|
217
|
+
label?: string | null;
|
|
218
|
+
/** The theme has a dark look of its own */
|
|
219
|
+
supportsDark?: boolean;
|
|
220
|
+
objectType?: string | null;
|
|
221
|
+
}
|
|
222
|
+
interface DesignThemes {
|
|
223
|
+
elements?: DesignTheme[];
|
|
224
|
+
objectType?: string | null;
|
|
225
|
+
}
|
|
226
|
+
interface DesignStudioOverviewResponse {
|
|
227
|
+
designStudioOverview: DesignStudioOverview;
|
|
228
|
+
}
|
|
229
|
+
interface DesignStudioThemesResponse {
|
|
230
|
+
designThemes: DesignThemes;
|
|
231
|
+
}
|
|
232
|
+
interface DesignStudioCanvasResponse {
|
|
233
|
+
designStudioCanvasView: DesignStudioCanvasView;
|
|
234
|
+
}
|
|
235
|
+
interface DesignStudioCanvasRevisionResponse {
|
|
236
|
+
/** Changes with every board file, position, comment and status of the canvas */
|
|
237
|
+
revision: string;
|
|
238
|
+
}
|
|
239
|
+
interface DesignStudioBoardStatusResponse {
|
|
240
|
+
designStudioBoardStatus: DesignStudioBoardStatus;
|
|
241
|
+
}
|
|
242
|
+
interface DesignStudioCommentResponse {
|
|
243
|
+
designStudioComment: DesignStudioComment;
|
|
244
|
+
}
|
|
245
|
+
interface DesignStudioCommentsResponse {
|
|
246
|
+
designStudioComments: DesignStudioComments;
|
|
247
|
+
}
|
|
248
|
+
interface DesignStudioDeleteResponse {
|
|
249
|
+
/** true when the deletion was carried out */
|
|
250
|
+
isDeleted: boolean;
|
|
251
|
+
}
|
|
252
|
+
/** Query parameters every operation of a DDD backend accepts. */
|
|
253
|
+
interface DesignStudioSharedParams {
|
|
254
|
+
noCache?: boolean;
|
|
255
|
+
outputFormat?: string;
|
|
256
|
+
}
|
|
257
|
+
interface DesignStudioThemesArg extends DesignStudioSharedParams {
|
|
258
|
+
/** Text the theme name contains */
|
|
259
|
+
search?: string;
|
|
260
|
+
}
|
|
261
|
+
interface DesignStudioCanvasArg extends DesignStudioSharedParams {
|
|
262
|
+
projectKey: string;
|
|
263
|
+
canvasKey: string;
|
|
264
|
+
/** Theme reference `<themeId>[:<mode>]` (mode light or dark); omitted = the reference theme of the canvas */
|
|
265
|
+
theme?: string;
|
|
266
|
+
}
|
|
267
|
+
interface DesignStudioCanvasCommentsArg extends DesignStudioCanvasArg {
|
|
268
|
+
/** true: only comments of threads that are not resolved */
|
|
269
|
+
onlyOpenThreads?: boolean;
|
|
270
|
+
/** Only comments with a larger id (polling) */
|
|
271
|
+
sinceId?: number;
|
|
272
|
+
}
|
|
273
|
+
interface DesignStudioThumbnailRenderRequestArg extends DesignStudioCanvasArg {
|
|
274
|
+
body: {
|
|
275
|
+
/** Theme reference `<themeId>[:<mode>]`; omitted = the reference theme of the canvas */
|
|
276
|
+
theme?: string | null;
|
|
277
|
+
/** Boards on screen, rendered first */
|
|
278
|
+
priorityBoardKeys?: string[] | null;
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
interface DesignStudioBoardArg extends DesignStudioSharedParams {
|
|
282
|
+
projectKey: string;
|
|
283
|
+
canvasKey: string;
|
|
284
|
+
boardKey: string;
|
|
285
|
+
}
|
|
286
|
+
interface DesignStudioBoardStatusPatchArg extends DesignStudioBoardArg {
|
|
287
|
+
body: {
|
|
288
|
+
/** One of the configured status keys */
|
|
289
|
+
status: string;
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
interface DesignStudioCommentCreateArg extends DesignStudioBoardArg {
|
|
293
|
+
body: {
|
|
294
|
+
/** The comment text */
|
|
295
|
+
text: string;
|
|
296
|
+
/** Pin position from the left edge in board pixels; omitted = a comment on the whole board */
|
|
297
|
+
x?: number | null;
|
|
298
|
+
/** Pin position from the top edge in board pixels */
|
|
299
|
+
y?: number | null;
|
|
300
|
+
/** Marks the comment as a decision */
|
|
301
|
+
isDecision?: boolean | null;
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
interface DesignStudioCommentArg extends DesignStudioSharedParams {
|
|
305
|
+
/** The id of the comment (a thread root for replies, resolve, reopen and keep) */
|
|
306
|
+
designStudioCommentId: number;
|
|
307
|
+
}
|
|
308
|
+
interface DesignStudioCommentReplyArg extends DesignStudioCommentArg {
|
|
309
|
+
body: {
|
|
310
|
+
/** The reply text */
|
|
311
|
+
text: string;
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
interface DesignStudioCommentPatchArg extends DesignStudioCommentArg {
|
|
315
|
+
body: {
|
|
316
|
+
/** New text (only the author may change it) */
|
|
317
|
+
text?: string | null;
|
|
318
|
+
/** Sets or clears the decision flag */
|
|
319
|
+
isDecision?: boolean | null;
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
interface DesignStudioCommentResolveArg extends DesignStudioCommentArg {
|
|
323
|
+
body: {
|
|
324
|
+
/** Reply written before the thread is resolved */
|
|
325
|
+
replyText?: string | null;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/** The one cache tag of the studio: every query provides it, every mutation invalidates it. */
|
|
330
|
+
declare const DESIGN_STUDIO_TAG = "DesignStudio";
|
|
331
|
+
/** The base query the studio's endpoints run on: a fetch-style one (`createDddBaseQuery` of `@mgamadeus/ddd-web/api`). */
|
|
332
|
+
type DesignStudioBaseQuery = BaseQueryFn<string | FetchArgs, unknown, FetchBaseQueryError, object, FetchBaseQueryMeta>;
|
|
333
|
+
/** The application's RTK Query api (`createApi` from `@reduxjs/toolkit/query/react`) the endpoints are injected into. */
|
|
334
|
+
type DesignStudioBaseApi<ReducerPath extends string = string, TagTypes extends string = string> = Api<DesignStudioBaseQuery, {}, ReducerPath, TagTypes, typeof coreModuleName | typeof reactHooksModuleName>;
|
|
335
|
+
interface CreateDesignStudioApiOptions<ReducerPath extends string, TagTypes extends string> {
|
|
336
|
+
/** The application's api; its base query carries the origin, the session and the refresh. */
|
|
337
|
+
baseApi: DesignStudioBaseApi<ReducerPath, TagTypes>;
|
|
338
|
+
/** Path prefix of the studio's routes, without a trailing slash (e.g. `/api/admin/designStudio`). */
|
|
339
|
+
apiPrefix: string;
|
|
340
|
+
}
|
|
341
|
+
type DesignStudioQueryHook<ResultType, QueryArg> = TypedUseQuery<ResultType, QueryArg, DesignStudioBaseQuery>;
|
|
342
|
+
type DesignStudioMutationHook<ResultType, QueryArg> = TypedUseMutation<ResultType, QueryArg, DesignStudioBaseQuery>;
|
|
343
|
+
/** The hooks `createDesignStudioApi` returns (`environment.api`). */
|
|
344
|
+
interface DesignStudioApi {
|
|
345
|
+
useOverviewQuery: DesignStudioQueryHook<DesignStudioOverviewResponse, void>;
|
|
346
|
+
useThemesQuery: DesignStudioQueryHook<DesignStudioThemesResponse, DesignStudioThemesArg>;
|
|
347
|
+
useCanvasQuery: DesignStudioQueryHook<DesignStudioCanvasResponse, DesignStudioCanvasArg>;
|
|
348
|
+
useCanvasRevisionQuery: DesignStudioQueryHook<DesignStudioCanvasRevisionResponse, DesignStudioCanvasArg>;
|
|
349
|
+
useCanvasCommentsQuery: DesignStudioQueryHook<DesignStudioCommentsResponse, DesignStudioCanvasCommentsArg>;
|
|
350
|
+
useExpiringCommentsQuery: DesignStudioQueryHook<DesignStudioCommentsResponse, void>;
|
|
351
|
+
useRequestThumbnailRenderingMutation: DesignStudioMutationHook<DesignStudioCanvasResponse, DesignStudioThumbnailRenderRequestArg>;
|
|
352
|
+
useSetBoardStatusMutation: DesignStudioMutationHook<DesignStudioBoardStatusResponse, DesignStudioBoardStatusPatchArg>;
|
|
353
|
+
useCreateCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentCreateArg>;
|
|
354
|
+
useReplyToCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentReplyArg>;
|
|
355
|
+
usePatchCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentPatchArg>;
|
|
356
|
+
useDeleteCommentMutation: DesignStudioMutationHook<DesignStudioDeleteResponse, DesignStudioCommentArg>;
|
|
357
|
+
useResolveCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentResolveArg>;
|
|
358
|
+
useReopenCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentArg>;
|
|
359
|
+
useKeepCommentMutation: DesignStudioMutationHook<DesignStudioCommentResponse, DesignStudioCommentArg>;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Injects the studio's 15 operations into the application's RTK Query api and returns their hooks. Call it once (module
|
|
363
|
+
* scope) and hand the result to `DesignStudioProvider` as `environment.api`.
|
|
364
|
+
*
|
|
365
|
+
* Cache: one tag (`DesignStudio`). Every query provides it and every mutation invalidates it, so a write refetches
|
|
366
|
+
* whatever the studio has on screen (the canvas, its comments, the overview).
|
|
367
|
+
*/
|
|
368
|
+
declare const createDesignStudioApi: <ReducerPath extends string, TagTypes extends string>({ baseApi, apiPrefix, }: CreateDesignStudioApiOptions<ReducerPath, TagTypes>) => DesignStudioApi;
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Design references for agentic editing ("send to agent"): a plain-text block that names one
|
|
372
|
+
* board (and optionally a region of it, a comment, a note) with stable keys, so an agent session can resolve it.
|
|
373
|
+
* Format (one line per board, fields joined by " · ", the deep link always last; optional
|
|
374
|
+
* extra lines below):
|
|
375
|
+
*
|
|
376
|
+
* [design-ref] App › Onboarding – first run › 2 Welcome · file welcome-2.dc.html · canvas app/onboarding
|
|
377
|
+
* · 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
|
|
379
|
+
* note: make the tab bar more compact
|
|
380
|
+
*
|
|
381
|
+
* `file` is the board key (the file name in the canvas folder), `v…` the first 7 characters of the board file's
|
|
382
|
+
* content hash (git blob hash), `theme` the theme reference the board was looked at in (`none` = as authored).
|
|
383
|
+
*
|
|
384
|
+
* Pure functions, no React (tested in designReference.test.ts).
|
|
385
|
+
*/
|
|
386
|
+
declare const DESIGN_REFERENCE_PREFIX = "[design-ref]";
|
|
387
|
+
/** A rectangle on a board in board pixels (independent of the zoom). */
|
|
388
|
+
interface BoardRegion {
|
|
389
|
+
x: number;
|
|
390
|
+
y: number;
|
|
391
|
+
width: number;
|
|
392
|
+
height: number;
|
|
393
|
+
}
|
|
394
|
+
interface DesignReferenceInput {
|
|
395
|
+
projectName: string;
|
|
396
|
+
canvasName: string;
|
|
397
|
+
projectKey: string;
|
|
398
|
+
canvasKey: string;
|
|
399
|
+
boardTitle: string;
|
|
400
|
+
/** File name of the board in the canvas folder. */
|
|
401
|
+
boardKey: string;
|
|
402
|
+
/** Content hash of the board file (git blob hash); the reference carries its first 7 characters. */
|
|
403
|
+
contentHash: string | null;
|
|
404
|
+
/** Theme reference the board is shown in (`<themeId>` or `<themeId>:dark`), null = as authored. */
|
|
405
|
+
themeReference: string | null;
|
|
406
|
+
/** Deep link to the board on the canvas (with theme and mode). */
|
|
407
|
+
url: string;
|
|
408
|
+
region?: BoardRegion | null;
|
|
409
|
+
/** A comment thread the reference is about (id + pin position). */
|
|
410
|
+
comment?: {
|
|
411
|
+
id: number | string;
|
|
412
|
+
x: number | null;
|
|
413
|
+
y: number | null;
|
|
414
|
+
lines: string[];
|
|
415
|
+
} | null;
|
|
416
|
+
/** What should change (free text). */
|
|
417
|
+
note?: string | null;
|
|
418
|
+
}
|
|
419
|
+
/** One reference block (first line + optional `comment:` / `note:` lines). */
|
|
420
|
+
declare const buildDesignReference: (input: DesignReferenceInput) => string;
|
|
421
|
+
/**
|
|
422
|
+
* Deep link to a board: the current page URL with `board` (the board key), the look (`theme`, `mode`; left out when
|
|
423
|
+
* the board is shown as authored) and, when given, the canvas viewport `vp` (other canvas parameters dropped) — the
|
|
424
|
+
* link reopens the focus view over the same part of the canvas.
|
|
425
|
+
*/
|
|
426
|
+
declare const buildBoardDeepLink: (pageUrl: string, boardKey: string, themeId: string | null, mode: "light" | "dark", viewport?: string | null) => string;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Theme references of the design studio: `<themeId>` or `<themeId>:<mode>` (mode `light` or `dark`), e.g.
|
|
430
|
+
* `brand:1:dark` — the theme id itself may contain colons, only a trailing `:light` / `:dark` is the mode (same rule
|
|
431
|
+
* as `DesignThemeReference::fromString`). Pure functions, no React (tested in designTheme.test.ts).
|
|
432
|
+
*/
|
|
433
|
+
type ThemeMode = 'light' | 'dark';
|
|
434
|
+
interface ThemeLook {
|
|
435
|
+
themeId: string;
|
|
436
|
+
mode: ThemeMode;
|
|
437
|
+
}
|
|
438
|
+
/** Splits a theme reference; null without one (the boards are shown as authored). */
|
|
439
|
+
declare const splitThemeReference: (themeReference: string | null | undefined) => ThemeLook | null;
|
|
440
|
+
/** `<themeId>` for light, `<themeId>:dark` for dark. */
|
|
441
|
+
declare const buildThemeReference: (themeId: string, mode: ThemeMode) => string;
|
|
442
|
+
|
|
443
|
+
/** Search-parameter updates; `null` or `''` removes the parameter. */
|
|
444
|
+
type DesignStudioSearchParamUpdates = Readonly<Record<string, string | null>>;
|
|
445
|
+
interface DesignStudioLinkProps {
|
|
446
|
+
/** An in-app path as `paths` builds it. */
|
|
447
|
+
href: string;
|
|
448
|
+
className?: string;
|
|
449
|
+
children?: ReactNode;
|
|
450
|
+
}
|
|
451
|
+
interface DesignStudioUrlStateOptions {
|
|
452
|
+
/**
|
|
453
|
+
* Stable id of the state (`designCanvas.<projectKey>.<canvasKey>`): the application remembers the state under it and
|
|
454
|
+
* hands it back when the page is opened without the parameters.
|
|
455
|
+
*/
|
|
456
|
+
stateId: string;
|
|
457
|
+
/** Delay between a change and the URL write / the settled value (ms). */
|
|
458
|
+
debounceMs: number;
|
|
459
|
+
/** Keys that do not count as filters. */
|
|
460
|
+
uncounted: readonly string[];
|
|
461
|
+
}
|
|
462
|
+
/** A set of string values kept in the URL (`''` = unset). */
|
|
463
|
+
interface DesignStudioUrlState<K extends string> {
|
|
464
|
+
/** What the inputs show (updates at once). */
|
|
465
|
+
values: Readonly<Record<K, string>>;
|
|
466
|
+
/** The settled values (`debounceMs` after the last change). */
|
|
467
|
+
debounced: Readonly<Record<K, string>>;
|
|
468
|
+
/** Stable across renders. */
|
|
469
|
+
setValue: (key: K, value: string) => void;
|
|
470
|
+
}
|
|
471
|
+
/** The application's router, as far as the studio needs it. Hooks follow the rules of hooks. */
|
|
472
|
+
interface DesignStudioRouter {
|
|
473
|
+
/** In-app link (client navigation, the application's base path prepended). */
|
|
474
|
+
Link: ComponentType<DesignStudioLinkProps>;
|
|
475
|
+
/** The current search parameters (reactive). */
|
|
476
|
+
useSearchParams: () => {
|
|
477
|
+
get: (key: string) => string | null;
|
|
478
|
+
};
|
|
479
|
+
/**
|
|
480
|
+
* A writer for search parameters of the current page: replaces the URL without a history entry and without a scroll
|
|
481
|
+
* jump, keeps every other parameter, and merges writes made in the same tick into one navigation.
|
|
482
|
+
*/
|
|
483
|
+
useSearchParamsWriter: () => (updates: DesignStudioSearchParamUpdates) => void;
|
|
484
|
+
/**
|
|
485
|
+
* The canvas state (search, filters, theme, mode, viewport) in the URL: read from the URL on mount, else restored
|
|
486
|
+
* from what the application remembered under `stateId`; written back debounced through the same merged writer.
|
|
487
|
+
* `keys` is a module constant.
|
|
488
|
+
*/
|
|
489
|
+
useUrlState: <K extends string>(keys: readonly K[], options: DesignStudioUrlStateOptions) => DesignStudioUrlState<K>;
|
|
490
|
+
}
|
|
491
|
+
/** In-app paths of the studio's pages (without the application's base path). */
|
|
492
|
+
interface DesignStudioPaths {
|
|
493
|
+
overview: () => string;
|
|
494
|
+
project: (projectKey: string) => string;
|
|
495
|
+
canvas: (projectKey: string, canvasKey: string) => string;
|
|
496
|
+
}
|
|
497
|
+
type DesignStudioStatusTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'highlight' | 'brand';
|
|
498
|
+
/** How one review status is shown. */
|
|
499
|
+
interface DesignStudioStatusDefinition {
|
|
500
|
+
label: string;
|
|
501
|
+
tone: DesignStudioStatusTone;
|
|
502
|
+
icon?: LucideIcon;
|
|
503
|
+
/** Hover text. */
|
|
504
|
+
description?: string;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Presentation per status key. The keys themselves are configured in the backend (`DesignStudioCanvasView.statuses`,
|
|
508
|
+
* the first one is the default); a key without a definition shows as it is, in the neutral tone.
|
|
509
|
+
*/
|
|
510
|
+
type DesignStudioStatuses = Readonly<Partial<Record<string, DesignStudioStatusDefinition>>>;
|
|
511
|
+
interface WithChildren {
|
|
512
|
+
children?: ReactNode;
|
|
513
|
+
}
|
|
514
|
+
interface WithClassName extends WithChildren {
|
|
515
|
+
className?: string;
|
|
516
|
+
}
|
|
517
|
+
interface AsChildTriggerProps extends WithChildren {
|
|
518
|
+
asChild?: boolean;
|
|
519
|
+
}
|
|
520
|
+
interface DesignStudioOption {
|
|
521
|
+
value: string;
|
|
522
|
+
label: string;
|
|
523
|
+
}
|
|
524
|
+
type DesignStudioButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
525
|
+
variant?: 'default' | 'outline' | 'ghost';
|
|
526
|
+
size?: 'sm' | 'icon' | 'icon-sm';
|
|
527
|
+
};
|
|
528
|
+
type DesignStudioBadgeProps = HTMLAttributes<HTMLSpanElement> & {
|
|
529
|
+
variant?: 'default' | 'outline';
|
|
530
|
+
};
|
|
531
|
+
interface DesignStudioCheckboxProps {
|
|
532
|
+
id?: string;
|
|
533
|
+
checked?: boolean;
|
|
534
|
+
onCheckedChange?: (checked: boolean | 'indeterminate') => void;
|
|
535
|
+
disabled?: boolean;
|
|
536
|
+
}
|
|
537
|
+
interface DesignStudioDialogProps extends WithChildren {
|
|
538
|
+
open?: boolean;
|
|
539
|
+
onOpenChange?: (open: boolean) => void;
|
|
540
|
+
}
|
|
541
|
+
interface DesignStudioDialogContentProps extends WithClassName {
|
|
542
|
+
/** `false`: the dialog draws its own close button. */
|
|
543
|
+
showCloseButton?: boolean;
|
|
544
|
+
}
|
|
545
|
+
interface DesignStudioComboboxProps {
|
|
546
|
+
options: readonly DesignStudioOption[];
|
|
547
|
+
/** `''` = nothing picked. */
|
|
548
|
+
value: string;
|
|
549
|
+
onChange: (value: string) => void;
|
|
550
|
+
placeholder?: string;
|
|
551
|
+
searchPlaceholder?: string;
|
|
552
|
+
isLoading?: boolean;
|
|
553
|
+
size?: 'sm';
|
|
554
|
+
/** `pill`: a picker in a bar, without the field's edge. */
|
|
555
|
+
shape?: 'pill';
|
|
556
|
+
className?: string;
|
|
557
|
+
'aria-label'?: string;
|
|
558
|
+
}
|
|
559
|
+
interface DesignStudioSearchFieldProps extends Pick<InputHTMLAttributes<HTMLInputElement>, 'placeholder' | 'aria-label' | 'className'> {
|
|
560
|
+
value: string;
|
|
561
|
+
onChange: (value: string) => void;
|
|
562
|
+
clearable?: boolean;
|
|
563
|
+
size?: 'sm';
|
|
564
|
+
}
|
|
565
|
+
interface DesignStudioQuickFilterPillsProps {
|
|
566
|
+
options: readonly DesignStudioOption[];
|
|
567
|
+
/** `''` = all. */
|
|
568
|
+
value: string;
|
|
569
|
+
onChange: (value: string) => void;
|
|
570
|
+
/** A leading pill that clears the filter. */
|
|
571
|
+
allLabel?: string;
|
|
572
|
+
size?: 'sm';
|
|
573
|
+
'aria-label': string;
|
|
574
|
+
}
|
|
575
|
+
interface DesignStudioStatusBadgeProps {
|
|
576
|
+
tone: DesignStudioStatusTone;
|
|
577
|
+
label: ReactNode;
|
|
578
|
+
icon?: LucideIcon;
|
|
579
|
+
title?: string;
|
|
580
|
+
className?: string;
|
|
581
|
+
}
|
|
582
|
+
interface DesignStudioPageHeaderProps {
|
|
583
|
+
title: ReactNode;
|
|
584
|
+
description?: ReactNode;
|
|
585
|
+
/** Before the title (an icon). */
|
|
586
|
+
leading?: ReactNode;
|
|
587
|
+
}
|
|
588
|
+
interface DesignStudioStatusCalloutProps {
|
|
589
|
+
/** Default: an informational notice. */
|
|
590
|
+
tone?: 'destructive';
|
|
591
|
+
title: ReactNode;
|
|
592
|
+
description?: ReactNode;
|
|
593
|
+
/** Replaces the tone's icon. */
|
|
594
|
+
icon?: LucideIcon;
|
|
595
|
+
className?: string;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* The application's UI primitives (shadcn "new-york" names and behaviour) and page blocks, typed with only the props
|
|
599
|
+
* the studio passes. The studio styles them further with Tailwind classes through `className`.
|
|
600
|
+
*/
|
|
601
|
+
interface DesignStudioComponents {
|
|
602
|
+
Button: ComponentType<DesignStudioButtonProps>;
|
|
603
|
+
Badge: ComponentType<DesignStudioBadgeProps>;
|
|
604
|
+
Card: ComponentType<WithClassName>;
|
|
605
|
+
CardHeader: ComponentType<WithClassName>;
|
|
606
|
+
CardTitle: ComponentType<WithClassName>;
|
|
607
|
+
CardContent: ComponentType<WithClassName>;
|
|
608
|
+
Skeleton: ComponentType<{
|
|
609
|
+
className?: string;
|
|
610
|
+
}>;
|
|
611
|
+
Checkbox: ComponentType<DesignStudioCheckboxProps>;
|
|
612
|
+
Label: ComponentType<WithClassName & {
|
|
613
|
+
htmlFor?: string;
|
|
614
|
+
}>;
|
|
615
|
+
Textarea: ComponentType<TextareaHTMLAttributes<HTMLTextAreaElement>>;
|
|
616
|
+
Dialog: ComponentType<DesignStudioDialogProps>;
|
|
617
|
+
DialogContent: ComponentType<DesignStudioDialogContentProps>;
|
|
618
|
+
DialogTitle: ComponentType<WithClassName>;
|
|
619
|
+
DialogDescription: ComponentType<WithClassName>;
|
|
620
|
+
Popover: ComponentType<WithChildren>;
|
|
621
|
+
PopoverTrigger: ComponentType<AsChildTriggerProps>;
|
|
622
|
+
PopoverContent: ComponentType<WithClassName & {
|
|
623
|
+
align?: 'start' | 'center' | 'end';
|
|
624
|
+
}>;
|
|
625
|
+
Tooltip: ComponentType<WithChildren>;
|
|
626
|
+
TooltipTrigger: ComponentType<AsChildTriggerProps>;
|
|
627
|
+
TooltipContent: ComponentType<WithClassName & {
|
|
628
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
629
|
+
}>;
|
|
630
|
+
DropdownMenu: ComponentType<WithChildren & {
|
|
631
|
+
modal?: boolean;
|
|
632
|
+
}>;
|
|
633
|
+
DropdownMenuTrigger: ComponentType<AsChildTriggerProps>;
|
|
634
|
+
DropdownMenuContent: ComponentType<WithChildren & {
|
|
635
|
+
align?: 'start' | 'center' | 'end';
|
|
636
|
+
}>;
|
|
637
|
+
DropdownMenuItem: ComponentType<WithChildren & {
|
|
638
|
+
onSelect?: () => void;
|
|
639
|
+
}>;
|
|
640
|
+
DropdownMenuSeparator: ComponentType<Record<never, never>>;
|
|
641
|
+
/** Single-choice picker with a search field. */
|
|
642
|
+
Combobox: ComponentType<DesignStudioComboboxProps>;
|
|
643
|
+
/** The search box (magnifier inside, clear button while there is text). */
|
|
644
|
+
SearchField: ComponentType<DesignStudioSearchFieldProps>;
|
|
645
|
+
/** A row of filter pills, one picked at most. */
|
|
646
|
+
QuickFilterPills: ComponentType<DesignStudioQuickFilterPillsProps>;
|
|
647
|
+
/** Status pill: tone colour, icon, label. */
|
|
648
|
+
StatusBadge: ComponentType<DesignStudioStatusBadgeProps>;
|
|
649
|
+
/** Title block of a page. */
|
|
650
|
+
PageHeader: ComponentType<DesignStudioPageHeaderProps>;
|
|
651
|
+
/** A notice box (empty state, error). */
|
|
652
|
+
StatusCallout: ComponentType<DesignStudioStatusCalloutProps>;
|
|
653
|
+
/** Cards side by side. */
|
|
654
|
+
CardGrid: ComponentType<{
|
|
655
|
+
children: ReactNode;
|
|
656
|
+
}>;
|
|
657
|
+
/** The vertical rhythm between the sections of a page. */
|
|
658
|
+
PageSections: ComponentType<{
|
|
659
|
+
children: ReactNode;
|
|
660
|
+
}>;
|
|
661
|
+
}
|
|
662
|
+
interface DesignStudioToastOptions {
|
|
663
|
+
/** A toast with the same id replaces the one on screen. */
|
|
664
|
+
id?: string;
|
|
665
|
+
action?: {
|
|
666
|
+
label: string;
|
|
667
|
+
onClick: () => void;
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
/** Toasts. */
|
|
671
|
+
interface DesignStudioNotify {
|
|
672
|
+
success: (message: string) => void;
|
|
673
|
+
error: (message: string) => void;
|
|
674
|
+
info: (message: string, options?: DesignStudioToastOptions) => void;
|
|
675
|
+
}
|
|
676
|
+
/** The values the studio persists in the browser, per viewer. */
|
|
677
|
+
type DesignStudioStorageKey =
|
|
678
|
+
/** `'1'` / `'0'`: the canvas' comments panel is open (nothing stored = open). */
|
|
679
|
+
'commentsPanelOpen';
|
|
680
|
+
/** Persistent per-viewer storage; the application maps the keys to its own registry. Must not throw. */
|
|
681
|
+
interface DesignStudioStorage {
|
|
682
|
+
read: (key: DesignStudioStorageKey) => string | null;
|
|
683
|
+
write: (key: DesignStudioStorageKey, value: string) => void;
|
|
684
|
+
}
|
|
685
|
+
/** The application shell around the studio's pages. */
|
|
686
|
+
interface DesignStudioShell {
|
|
687
|
+
/**
|
|
688
|
+
* The shell's sidebar: `[isCollapsed, toggle]`. With it the canvas collapses the sidebar while it is open and
|
|
689
|
+
* restores it when the page is left.
|
|
690
|
+
*/
|
|
691
|
+
useSidebarCollapsed?: () => readonly [boolean, () => void];
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* The studio's UI texts an application can replace (`environment.texts`); every entry has an English default
|
|
695
|
+
* (`provider/texts.ts`). Entries with parameters are functions.
|
|
696
|
+
*/
|
|
697
|
+
interface DesignStudioTexts {
|
|
698
|
+
/** Toast after copying design references to the clipboard (`count` = number of references, 1 or more). */
|
|
699
|
+
referencesCopied: (count: number) => string;
|
|
700
|
+
/** Toast of a live update: `count` boards changed on disk and were reloaded. */
|
|
701
|
+
boardsUpdated: (count: number) => string;
|
|
702
|
+
/** Action of the live-update toast: scrolls to the first changed board. */
|
|
703
|
+
showUpdatedBoard: string;
|
|
704
|
+
/** Toast of a manual reload that found no change. */
|
|
705
|
+
canvasUpToDate: string;
|
|
706
|
+
/** Label and tooltip of the reload button (the key is R). */
|
|
707
|
+
reload: string;
|
|
708
|
+
/** Thumbnail pill: the render request failed; a click files it again. */
|
|
709
|
+
thumbnailsFailed: string;
|
|
710
|
+
/** Thumbnail pill: the request waits for the renderer service (`themeLabel` = the shown theme). */
|
|
711
|
+
thumbnailsWaitingForRenderer: (themeLabel: string) => string;
|
|
712
|
+
/** Thumbnail pill: thumbnails are being rendered (`themeLabel` = the shown theme). */
|
|
713
|
+
thumbnailsRendering: (themeLabel: string) => string;
|
|
714
|
+
/** Stands in for `themeLabel` when the shown theme has no label. */
|
|
715
|
+
thumbnailsFallbackThemeLabel: string;
|
|
716
|
+
/** Tooltip of the thumbnail pill: `count` boards have no thumbnail in the shown look yet. */
|
|
717
|
+
thumbnailsMissing: (count: number) => string;
|
|
718
|
+
/** Appended to the tooltip of the thumbnail pill when the last render request reported an error. */
|
|
719
|
+
thumbnailsLastError: (error: string) => string;
|
|
720
|
+
/** Tooltip of the disabled dark-mode button of a theme without a dark variant. */
|
|
721
|
+
themeWithoutDarkMode: string;
|
|
722
|
+
/** Shown on a board card that has no thumbnail yet. */
|
|
723
|
+
thumbnailMissing: string;
|
|
724
|
+
/** Placeholder of the note field in the focus view's reference panel. */
|
|
725
|
+
referenceNotePlaceholder: string;
|
|
726
|
+
}
|
|
727
|
+
/** Everything the studio takes from the application it runs in (`DesignStudioProvider`). */
|
|
728
|
+
interface DesignStudioEnvironment {
|
|
729
|
+
/** The studio's API hooks: `createDesignStudioApi({ baseApi, apiPrefix })`. */
|
|
730
|
+
api: DesignStudioApi;
|
|
731
|
+
/** Origin the delivery URLs of boards and thumbnails (`/api/...`) are prefixed with; `''` = same origin. */
|
|
732
|
+
apiBaseUrl: string;
|
|
733
|
+
router: DesignStudioRouter;
|
|
734
|
+
paths: DesignStudioPaths;
|
|
735
|
+
components: DesignStudioComponents;
|
|
736
|
+
notify: DesignStudioNotify;
|
|
737
|
+
/** Formats a backend date-time (offsetless UTC) for the viewer. */
|
|
738
|
+
formatDateTime: (value: string | null | undefined) => string;
|
|
739
|
+
storage: DesignStudioStorage;
|
|
740
|
+
/** Whether write controls are enabled (the application's write guard / the viewer's rights). */
|
|
741
|
+
useCanWrite: () => boolean;
|
|
742
|
+
/** The signed-in account's id (own comments can be deleted), null while unknown. */
|
|
743
|
+
useCurrentAccountId: () => number | null;
|
|
744
|
+
shell?: DesignStudioShell;
|
|
745
|
+
/** Label, tone and icon per review status key. */
|
|
746
|
+
statuses: DesignStudioStatuses;
|
|
747
|
+
/** Minimap colour (a CSS colour) per review status key; a status without one is drawn muted. */
|
|
748
|
+
statusColors?: Readonly<Record<string, string>>;
|
|
749
|
+
/** Replacements for the studio's UI texts; an entry left out keeps its English default. */
|
|
750
|
+
texts?: Partial<DesignStudioTexts>;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
interface DesignStudioProviderProps {
|
|
754
|
+
/** Keep it referentially stable (a module constant): every studio component reads it. */
|
|
755
|
+
environment: DesignStudioEnvironment;
|
|
756
|
+
children: ReactNode;
|
|
757
|
+
}
|
|
758
|
+
/** Hands the application's environment (API, router, UI primitives, …) to the studio's screens below it. */
|
|
759
|
+
declare const DesignStudioProvider: ({ environment, children }: DesignStudioProviderProps) => react.JSX.Element;
|
|
760
|
+
/** The whole environment. */
|
|
761
|
+
declare const useDesignStudio: () => DesignStudioEnvironment;
|
|
762
|
+
declare const useDesignStudioApi: () => DesignStudioApi;
|
|
763
|
+
declare const useDesignStudioComponents: () => DesignStudioComponents;
|
|
764
|
+
declare const useDesignStudioRouter: () => DesignStudioRouter;
|
|
765
|
+
declare const useDesignStudioPaths: () => DesignStudioPaths;
|
|
766
|
+
declare const useDesignStudioNotify: () => DesignStudioNotify;
|
|
767
|
+
/** The UI texts: the application's replacements (`environment.texts`) on top of the English defaults. Stable per environment. */
|
|
768
|
+
declare const useDesignStudioTexts: () => DesignStudioTexts;
|
|
769
|
+
|
|
770
|
+
/** The English defaults of the texts an application can replace through `environment.texts`. */
|
|
771
|
+
declare const DEFAULT_DESIGN_STUDIO_TEXTS: DesignStudioTexts;
|
|
772
|
+
/** The defaults with the application's replacements on top; an entry that is missing or `undefined` keeps its default. */
|
|
773
|
+
declare const resolveDesignStudioTexts: (texts: Partial<DesignStudioTexts> | undefined) => DesignStudioTexts;
|
|
774
|
+
|
|
775
|
+
interface DesignStudioOverviewScreenProps {
|
|
776
|
+
/** Page title (a two-tone title wraps its accent part in `<em>`). */
|
|
777
|
+
title?: ReactNode;
|
|
778
|
+
/** One line under the title. */
|
|
779
|
+
description?: ReactNode;
|
|
780
|
+
}
|
|
781
|
+
/** Overview: every design project with its canvases (boards, open threads, decisions per canvas). */
|
|
782
|
+
declare const DesignStudioOverviewScreen: ({ title, description, }: DesignStudioOverviewScreenProps) => react.JSX.Element;
|
|
783
|
+
|
|
784
|
+
interface DesignStudioProjectScreenProps {
|
|
785
|
+
projectKey: string;
|
|
786
|
+
}
|
|
787
|
+
/** One design project: its canvases as cards (projects and canvases come from the studio's overview). */
|
|
788
|
+
declare const DesignStudioProjectScreen: ({ projectKey }: DesignStudioProjectScreenProps) => react.JSX.Element;
|
|
789
|
+
|
|
790
|
+
interface DesignStudioReviewsScreenProps {
|
|
791
|
+
/** One line under the title. */
|
|
792
|
+
description?: ReactNode;
|
|
793
|
+
/** Text of the empty state. */
|
|
794
|
+
emptyDescription?: ReactNode;
|
|
795
|
+
}
|
|
796
|
+
/** Reviews linked to boards (empty for now: review documents come with a later step of the studio). */
|
|
797
|
+
declare const DesignStudioReviewsScreen: ({ description, emptyDescription, }: DesignStudioReviewsScreenProps) => react.JSX.Element;
|
|
798
|
+
|
|
799
|
+
/** Conditional class names, later Tailwind classes winning over earlier ones (`clsx` + `tailwind-merge`). */
|
|
800
|
+
declare const cx: (...inputs: ClassValue[]) => string;
|
|
801
|
+
|
|
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 };
|
|
803
|
+
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 };
|