@vivix-labs/dashboard-projects 0.0.0-stage → 1.0.0-beta.10

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.
@@ -0,0 +1,93 @@
1
+ Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 VIVIX
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,117 @@
1
+ /* packages/dashboard-projects/src/create-project-dialog.css */
2
+ .studio-home-create-form {
3
+ display: grid;
4
+ gap: var(--vx-space-16);
5
+ }
6
+ .studio-home-create-field {
7
+ display: grid;
8
+ gap: var(--vx-space-8);
9
+ color: var(--vx-text-secondary);
10
+ font: var(--vx-typography-inter-14-regular);
11
+ }
12
+ .studio-home-create-form p {
13
+ margin: 0;
14
+ color: var(--vx-text-secondary-readable);
15
+ }
16
+
17
+ /* packages/dashboard-projects/src/card.css */
18
+ .studio-home-panel {
19
+ --home-panel-inset: 16px;
20
+ min-width: 0;
21
+ border-radius: 12px;
22
+ background: var(--vx-background-dialog);
23
+ }
24
+ .studio-home-panel > header {
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: space-between;
28
+ gap: 8px;
29
+ min-height: 44px;
30
+ padding: 0 var(--home-panel-inset);
31
+ }
32
+ .studio-home-panel > header h2 {
33
+ margin: 0;
34
+ font: var(--vx-typography-inter-16-semi-bold);
35
+ }
36
+ .studio-home-grid {
37
+ display: grid;
38
+ grid-template-columns: repeat(auto-fill, minmax(min(100%, max(150px, calc((100% - 32px) / 5))), 1fr));
39
+ gap: 8px;
40
+ padding: 0 var(--home-panel-inset) var(--home-panel-inset);
41
+ }
42
+ .studio-home-panel .studio-home-tile {
43
+ display: grid;
44
+ align-content: start;
45
+ text-align: start;
46
+ gap: var(--vx-space-8);
47
+ min-width: 0;
48
+ width: 100%;
49
+ color: inherit;
50
+ font: inherit;
51
+ background: transparent;
52
+ border: 0;
53
+ padding: 0;
54
+ cursor: pointer;
55
+ }
56
+ .studio-home-caption {
57
+ display: grid;
58
+ min-width: 0;
59
+ gap: var(--vx-space-4);
60
+ }
61
+ .studio-home-caption > strong {
62
+ font: var(--vx-typography-inter-14-semi-bold);
63
+ }
64
+ .studio-home-tile:disabled {
65
+ opacity: 0.5;
66
+ cursor: default;
67
+ }
68
+ .studio-home-tile strong,
69
+ .studio-home-tile small {
70
+ display: block;
71
+ white-space: nowrap;
72
+ overflow: hidden;
73
+ text-overflow: ellipsis;
74
+ }
75
+ .studio-home-tile small {
76
+ color: var(--vx-text-secondary);
77
+ }
78
+ .studio-home-cover {
79
+ position: relative;
80
+ display: grid;
81
+ width: 100%;
82
+ aspect-ratio: 16 / 9;
83
+ place-items: center;
84
+ overflow: hidden;
85
+ border-radius: 8px;
86
+ background: var(--vx-cover-background);
87
+ color: var(--vx-text-on-content-secondary);
88
+ }
89
+ .studio-home-cover img,
90
+ .studio-home-cover video {
91
+ position: absolute;
92
+ inset: 0;
93
+ width: 100%;
94
+ height: 100%;
95
+ object-fit: contain;
96
+ }
97
+ .studio-home-create .studio-home-cover {
98
+ border: 1px dashed var(--vx-border-secondary);
99
+ background: var(--vx-surface-input);
100
+ color: var(--vx-text-primary);
101
+ }
102
+ .studio-home-create .studio-home-cover > span {
103
+ display: grid;
104
+ place-items: center;
105
+ inline-size: 24px;
106
+ block-size: 24px;
107
+ border-radius: 4px;
108
+ background: var(--vx-background-dialog);
109
+ }
110
+ @media (max-width: 660px) {
111
+ .studio-home-panel {
112
+ --home-panel-inset: 12px;
113
+ }
114
+ .studio-home-grid {
115
+ grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr));
116
+ }
117
+ }
@@ -0,0 +1,978 @@
1
+ // packages/dashboard-projects/src/client.tsx
2
+ import * as React2 from "react";
3
+ import { z as z3 } from "vivix-studio/sdk/shared";
4
+
5
+ // packages/project-studio/dist/shared.js
6
+ import { z as z2, defineOperation } from "vivix-studio/sdk/shared";
7
+ import { z } from "vivix-studio/sdk/shared";
8
+ var creditsFormat = new Intl.NumberFormat("en-US", {
9
+ minimumFractionDigits: 1,
10
+ maximumFractionDigits: 1,
11
+ useGrouping: false
12
+ });
13
+ var fixedRef = z.object({ storeId: z.uuid(), objectId: z.uuid(), versionId: z.uuid() }).strict();
14
+ var copy = z.string().max(8e3).default("");
15
+ var clipScript = z.object({
16
+ title: z.string().trim().min(1).max(200),
17
+ visual: copy,
18
+ voiceover: copy,
19
+ onScreenText: copy,
20
+ cta: copy,
21
+ plannedDurationMs: z.number().int().positive().nullable().default(null)
22
+ }).strict();
23
+ var adBrief = z.object({
24
+ product: copy,
25
+ category: copy,
26
+ audience: copy,
27
+ sellingPoints: copy,
28
+ channel: copy,
29
+ aspectRatio: z.string().max(40).nullable().default(null),
30
+ targetDurationMs: z.number().int().positive().nullable().default(null),
31
+ body: copy,
32
+ productRefs: z.array(fixedRef).max(100).default([]),
33
+ modelRefs: z.array(fixedRef).max(100).default([])
34
+ }).strict();
35
+ var adFilm = z.object({
36
+ title: z.string().trim().min(1).max(150),
37
+ source: fixedRef,
38
+ width: z.number().int().positive().max(8192),
39
+ height: z.number().int().positive().max(8192),
40
+ aspectRatio: z.string().regex(/^\d+:\d+$/)
41
+ }).strict();
42
+ var adStoryboard = z.object({
43
+ brief: adBrief,
44
+ films: z.array(adFilm).max(100).optional(),
45
+ clips: z.array(
46
+ z.object({
47
+ assetId: z.uuid(),
48
+ filmId: z.uuid().optional(),
49
+ script: clipScript,
50
+ edits: z.array(z.object({ sourceVersionId: z.uuid(), editRef: fixedRef }).strict()).max(200)
51
+ }).strict()
52
+ ).max(200)
53
+ }).strict().superRefine((value, context) => {
54
+ if (new Set(value.clips.map((c) => c.assetId)).size !== value.clips.length)
55
+ context.addIssue({ code: "custom", message: "A clip can appear only once in a storyboard." });
56
+ for (const clip of value.clips)
57
+ if (new Set(clip.edits.map((e) => e.sourceVersionId)).size !== clip.edits.length)
58
+ context.addIssue({
59
+ code: "custom",
60
+ message: "Each candidate has one current edit binding."
61
+ });
62
+ });
63
+ var projectType = z2.enum(["short-drama", "product-ad", "other"]);
64
+ var studioConfig = z2.object({
65
+ role: z2.enum(["project", "coordinator"]).default("project"),
66
+ projectType: projectType.optional(),
67
+ dataInstance: z2.string().min(1).default("user:data"),
68
+ apiInstance: z2.string().min(1).default("api"),
69
+ libraryInstance: z2.string().min(1).nullable().default(null),
70
+ coordinatorInstance: z2.string().min(1).optional()
71
+ }).strict();
72
+ var versionRef = z2.object({ storeId: z2.uuid(), objectId: z2.uuid(), versionId: z2.uuid() }).strict();
73
+ var tags = z2.array(z2.string().trim().min(1).max(64)).max(50).transform((x) => [...new Set(x)]).default([]);
74
+ var kind = z2.enum(["text", "image", "video", "audio", "file"]);
75
+ var projectData = z2.object({
76
+ name: z2.string().trim().min(1).max(120),
77
+ description: z2.string().max(4e3).default(""),
78
+ status: z2.enum(["draft", "active", "archived"]).default("draft"),
79
+ aspectRatio: z2.string().nullable().default(null),
80
+ projectType: projectType.optional(),
81
+ coverRef: versionRef.nullable().default(null),
82
+ briefRef: z2.object({ storeId: z2.uuid(), objectId: z2.uuid() }).strict().nullable().default(null),
83
+ tags
84
+ }).strict();
85
+ var assetData = z2.object({
86
+ projectId: z2.uuid(),
87
+ name: z2.string().trim().min(1).max(200),
88
+ kind,
89
+ purpose: z2.enum(["reference", "script", "shot", "music", "voice", "subtitle", "final", "other"]).default("other"),
90
+ origin: z2.enum(["upload", "library", "generated", "authored"]),
91
+ orderKey: z2.number().int().nullable().default(null),
92
+ tags,
93
+ lifecycle: z2.enum(["draft", "ready", "archived"]).default("draft"),
94
+ sourceRef: versionRef.nullable().default(null),
95
+ adoptedVersionId: z2.uuid().nullable().default(null)
96
+ }).strict();
97
+ var anchor = z2.discriminatedUnion("kind", [
98
+ z2.object({ kind: z2.literal("whole") }).strict(),
99
+ z2.object({
100
+ kind: z2.literal("timeRange"),
101
+ startMs: z2.number().int().nonnegative(),
102
+ endMs: z2.number().int().nonnegative()
103
+ }).strict()
104
+ ]);
105
+ var generationInput = z2.object({
106
+ targetAssetId: z2.uuid().optional(),
107
+ taskName: z2.string().trim().min(1).max(200).optional(),
108
+ context: z2.record(z2.string().min(1).max(64), z2.string().min(1).max(200)).optional(),
109
+ expectedRevision: z2.number().int().positive().optional(),
110
+ newAsset: z2.object({
111
+ name: z2.string().trim().min(1).max(200),
112
+ kind: z2.enum(["image", "video", "audio"])
113
+ }).strict().optional(),
114
+ modelId: z2.string().min(1),
115
+ capabilityId: z2.string().min(1),
116
+ prompt: z2.string().max(32e3),
117
+ parameters: z2.record(z2.string(), z2.unknown()).default({}),
118
+ outputCount: z2.number().int().min(1).max(100).default(1),
119
+ inputs: z2.array(
120
+ z2.object({
121
+ ref: versionRef,
122
+ role: z2.string().min(1),
123
+ order: z2.number().int().nonnegative(),
124
+ weight: z2.number().finite().nullable().default(null)
125
+ }).strict()
126
+ ).max(100).default([]),
127
+ baseVersionId: z2.uuid().optional(),
128
+ changeRequest: z2.string().trim().min(1).max(4e3).optional(),
129
+ preserveRequest: z2.string().max(4e3).default(""),
130
+ anchor: anchor.default({ kind: "whole" }),
131
+ retryOfTaskId: z2.uuid().optional(),
132
+ acknowledgeUnknown: z2.boolean().optional()
133
+ }).strict();
134
+ var projectSettingsInput = z2.object({
135
+ projectId: z2.uuid(),
136
+ expectedRevision: z2.number().int().positive(),
137
+ changes: projectData.pick({ name: true, description: true, tags: true, aspectRatio: true, coverRef: true }).extend({
138
+ description: projectData.shape.description.unwrap(),
139
+ tags: projectData.shape.tags.unwrap(),
140
+ aspectRatio: projectData.shape.aspectRatio.unwrap(),
141
+ coverRef: projectData.shape.coverRef.unwrap()
142
+ }).partial().strict()
143
+ }).strict();
144
+ var generationSubmitOperation = defineOperation({
145
+ id: "generation.submit",
146
+ title: "Generate",
147
+ description: "Submit one media generation without approval, retaining its paid request identity.",
148
+ input: generationInput,
149
+ output: z2.any(),
150
+ effects: ["write", "paid"],
151
+ confirm: "none"
152
+ });
153
+ var favoriteData = z2.object({ ref: versionRef }).strict();
154
+ var sqlScalar = z2.union([z2.string(), z2.number().finite(), z2.null()]);
155
+ var globalQueryInput = z2.object({
156
+ sql: z2.string().trim().min(1),
157
+ params: z2.union([z2.array(sqlScalar), z2.record(z2.string(), sqlScalar)]).optional(),
158
+ timeoutMs: z2.number().int().positive().optional(),
159
+ maxRows: z2.number().int().positive().optional(),
160
+ limit: z2.number().int().min(1).max(200).optional(),
161
+ offset: z2.number().int().nonnegative().optional(),
162
+ source: z2.enum(["projects", "assets", "tasks"]),
163
+ excludeProjectIds: z2.array(z2.uuid()).optional(),
164
+ catalog: z2.array(z2.object({ id: z2.string().min(1), name: z2.string(), available: z2.boolean() }).strict()).optional()
165
+ }).strict();
166
+ var projectListSql = "SELECT rowId, projectId, name, available, createdAt, coverRef FROM studio_projects ORDER BY createdAt DESC, rowId ASC";
167
+
168
+ // packages/ui-system/dist/button.js
169
+ import { jsx as _jsx2, jsxs as _jsxs } from "react/jsx-runtime";
170
+
171
+ // packages/ui-system/dist/icon.js
172
+ import { jsx as _jsx } from "react/jsx-runtime";
173
+ var iconGeometry = {
174
+ add: {
175
+ width: 16,
176
+ height: 16,
177
+ slot: 16
178
+ },
179
+ check: {
180
+ width: 12,
181
+ height: 12,
182
+ slot: 12
183
+ },
184
+ "check-on-content": {
185
+ width: 12,
186
+ height: 12,
187
+ slot: 12
188
+ },
189
+ "chevron-up": {
190
+ width: 12,
191
+ height: 12,
192
+ slot: 12
193
+ },
194
+ expand: {
195
+ width: 16,
196
+ height: 16,
197
+ slot: 16
198
+ },
199
+ "chevron-down": {
200
+ width: 12,
201
+ height: 12,
202
+ slot: 12
203
+ },
204
+ clear: {
205
+ width: 14.5332,
206
+ height: 14.5332,
207
+ slot: 16
208
+ },
209
+ grid: {
210
+ width: 13.2039,
211
+ height: 13.2,
212
+ slot: 16
213
+ },
214
+ list: {
215
+ width: 13.3372,
216
+ height: 12.0039,
217
+ slot: 16
218
+ },
219
+ search: {
220
+ width: 13.2,
221
+ height: 13.2,
222
+ slot: 16
223
+ },
224
+ calendar: {
225
+ width: 16,
226
+ height: 16,
227
+ slot: 16
228
+ },
229
+ import: {
230
+ width: 16,
231
+ height: 16,
232
+ slot: 16
233
+ },
234
+ magic: {
235
+ width: 14.0625,
236
+ height: 15.5625,
237
+ slot: 18
238
+ },
239
+ "select-items": { width: 13.8681, height: 13.8667, slot: 16 },
240
+ trim: { width: 14.85, height: 14.85, slot: 16 },
241
+ crop: { width: 16.25, height: 16.25, slot: 16 },
242
+ filter: { width: 13.2, height: 13.2, slot: 16 },
243
+ select: {
244
+ width: 14.6298,
245
+ height: 16.065,
246
+ slot: 18
247
+ },
248
+ area: {
249
+ width: 16.125,
250
+ height: 16.125,
251
+ slot: 18
252
+ },
253
+ draw: {
254
+ width: 16.125,
255
+ height: 16.125,
256
+ slot: 18
257
+ },
258
+ close: {
259
+ width: 18,
260
+ height: 18,
261
+ slot: 18
262
+ },
263
+ reset: {
264
+ width: 16.35,
265
+ height: 16.35,
266
+ slot: 18
267
+ },
268
+ more: {
269
+ width: 16,
270
+ height: 16,
271
+ slot: 16
272
+ },
273
+ play: {
274
+ width: 12.381,
275
+ height: 13.2143,
276
+ slot: 20
277
+ },
278
+ pause: {
279
+ width: 14.1905,
280
+ height: 14.1905,
281
+ slot: 20
282
+ },
283
+ mute: {
284
+ width: 17.5239,
285
+ height: 14.1922,
286
+ slot: 20
287
+ },
288
+ volume: {
289
+ width: 17.5239,
290
+ height: 14.1922,
291
+ slot: 20
292
+ },
293
+ fullscreen: {
294
+ width: 20,
295
+ height: 20,
296
+ slot: 20
297
+ },
298
+ "placeholder-image": {
299
+ width: 20,
300
+ height: 20,
301
+ slot: 20
302
+ },
303
+ "placeholder-video": {
304
+ width: 17.9199,
305
+ height: 16.2506,
306
+ slot: 20
307
+ },
308
+ "placeholder-audio": {
309
+ width: 17.5017,
310
+ height: 17.4992,
311
+ slot: 20
312
+ },
313
+ "placeholder-script": {
314
+ width: 17.0834,
315
+ height: 17.0837,
316
+ slot: 20
317
+ },
318
+ export: {
319
+ width: 11.8667,
320
+ height: 13.2,
321
+ slot: 16
322
+ },
323
+ favorite: { width: 11.8667, height: 14.5333, slot: 16 },
324
+ download: { width: 13.2001, height: 13.1997, slot: 16 },
325
+ delete: { width: 13.2, height: 14.533, slot: 16 },
326
+ edit: {
327
+ width: 10.8791,
328
+ height: 12.0459,
329
+ slot: 14
330
+ },
331
+ "play-cover": {
332
+ width: 12.9167,
333
+ height: 13.7501,
334
+ slot: 20
335
+ },
336
+ "playback-play": {
337
+ width: 13.29564,
338
+ height: 14.1905,
339
+ slot: 20
340
+ },
341
+ "playback-play-large": {
342
+ width: 15.95477,
343
+ height: 17.0286,
344
+ slot: 24
345
+ },
346
+ "pause-large": {
347
+ width: 17.0286,
348
+ height: 17.0286,
349
+ slot: 24
350
+ },
351
+ "volume-large": {
352
+ width: 21.02868,
353
+ height: 17.03064,
354
+ slot: 24
355
+ },
356
+ "mute-large": {
357
+ width: 21.0286,
358
+ height: 17.0307,
359
+ slot: 24
360
+ },
361
+ "fullscreen-large": {
362
+ width: 24,
363
+ height: 24,
364
+ slot: 24
365
+ }
366
+ };
367
+ function Icon({ name, size }) {
368
+ const geometry = iconGeometry[name];
369
+ const style = {
370
+ ...geometry && {
371
+ "--vx-icon-native-size": `${geometry.slot}px`,
372
+ "--vx-icon-width": `${geometry.width / geometry.slot * 100}%`,
373
+ "--vx-icon-height": `${geometry.height / geometry.slot * 100}%`
374
+ },
375
+ ...size === void 0 ? {} : { "--vx-icon-size": `${size}px` }
376
+ };
377
+ return _jsx("span", { "aria-hidden": "true", className: "vx-icon", "data-icon": name, style });
378
+ }
379
+
380
+ // packages/ui-system/dist/button-variants.js
381
+ var buttonVariants = {
382
+ "text-filled-sm": { size: 32, appearance: "filled", shape: "text", width: 215 },
383
+ "text-filled-leading-sm": { size: 32, appearance: "filled", shape: "text" },
384
+ "text-ghost-sm": { size: 32, appearance: "ghost", shape: "text" },
385
+ "text-on-content-sm": { size: 32, appearance: "on-content", shape: "text" },
386
+ "text-plain-sm": { size: 32, appearance: "plain", shape: "text" },
387
+ "text-link-sm": { size: 32, appearance: "link", shape: "text" },
388
+ "text-outline-sm": { size: 32, appearance: "outline", shape: "text" },
389
+ "text-tonal-sm": { size: 32, appearance: "tonal", shape: "text" },
390
+ // The medium recipes are shared by all dialog footer actions.
391
+ "text-filled-md": { size: 40, appearance: "filled", shape: "text" },
392
+ "text-tonal-md": { size: 40, appearance: "tonal", shape: "text" },
393
+ "text-ghost-md": { size: 40, appearance: "ghost", shape: "text" },
394
+ "icon-ghost-md": { size: 40, appearance: "ghost", shape: "icon" },
395
+ "text-filled-lg": { size: 44, appearance: "filled", shape: "text", width: 412 },
396
+ "text-tonal-lg": { size: 44, appearance: "tonal", shape: "text", width: 412 },
397
+ "text-outline-lg": {
398
+ size: 44,
399
+ appearance: "outline",
400
+ shape: "text",
401
+ width: 412
402
+ },
403
+ "pill-filled": { size: 44, appearance: "filled", shape: "pill" },
404
+ "pill-plain": { size: 48, appearance: "plain", shape: "pill" },
405
+ "pill-small": { size: 32, appearance: "plain", shape: "pill" },
406
+ "icon-outline-sm": { size: 32, appearance: "outline", shape: "icon" },
407
+ "icon-on-content": { size: 24, appearance: "on-content", shape: "icon" },
408
+ "icon-outline-lg": { size: 48, appearance: "outline", shape: "icon" },
409
+ // Compact bare action: reuse the transparent/default and surface-hover ghost treatment.
410
+ "icon-bare-xs": { size: 24, appearance: "ghost", shape: "icon" },
411
+ "icon-ghost-sm": { size: 32, appearance: "ghost", shape: "icon" },
412
+ "icon-ghost-lg": { size: 48, appearance: "ghost", shape: "icon" },
413
+ "icon-circle-sm": { size: 32, appearance: "filled", shape: "circle" },
414
+ "icon-circle-lg": { size: 44, appearance: "filled", shape: "circle" }
415
+ };
416
+
417
+ // packages/ui-system/dist/button.js
418
+ function ButtonFrame({ label, variant, loading = false, width, children, disabled, type = "button", style, className, ...props }) {
419
+ const spec = buttonVariants[variant];
420
+ const buttonStyle = "width" in spec ? { ...style, "--vx-button-width": `${spec.width}px` } : style;
421
+ return _jsxs("button", { ...props, type, className: className ? `vx-button ${className}` : "vx-button", "data-variant": variant, "data-appearance": spec.appearance, "data-shape": spec.shape, "data-size": spec.size, "data-width": width, "data-state": loading ? "loading" : disabled ? "disabled" : "default", style: buttonStyle, disabled: disabled || loading, "aria-label": label, "aria-busy": loading || void 0, children: [_jsx2("span", { className: "vx-button-content", children }), loading && _jsx2("span", { className: "vx-button-loading", "aria-hidden": "true" })] });
422
+ }
423
+ function Button({ variant = "text-filled-sm", leadingIcon, trailingIcon, badge, ...props }) {
424
+ return _jsxs(ButtonFrame, { ...props, label: badge ? `${props.label} (${badge})` : props.label, variant, children: [leadingIcon && _jsx2(Icon, { name: leadingIcon }), _jsx2("span", { className: "vx-button-label", children: props.label }), badge !== void 0 && badge > 0 && _jsx2("span", { className: "vx-button-badge", children: badge }), trailingIcon && _jsx2("span", { className: "vx-button-trailing", children: _jsx2(Icon, { name: trailingIcon }) })] });
425
+ }
426
+ function IconButton({ icon, variant = "icon-ghost-sm", ...props }) {
427
+ return _jsx2(ButtonFrame, { ...props, variant, children: _jsx2(Icon, { name: icon }) });
428
+ }
429
+
430
+ // packages/ui-system/dist/cover-preview.js
431
+ import { jsx as _jsx3 } from "react/jsx-runtime";
432
+ import { useState } from "react";
433
+ function CoverPreview(props) {
434
+ return _jsx3(Preview, { ...props }, JSON.stringify([props.kind, props.src]));
435
+ }
436
+ function Preview({ className, ref, kind: kind2 = "image", src, pending, iconSize = 20, children }) {
437
+ const [mediaState, setMediaState] = useState("loading");
438
+ const media = src && (kind2 === "image" || kind2 === "video");
439
+ const state = pending ? "loading" : media ? mediaState : children ? "ready" : "empty";
440
+ const iconKind = kind2 === "video" || kind2 === "audio" ? kind2 : kind2 === "text" ? "script" : "image";
441
+ const ready = () => setMediaState("ready");
442
+ const failed = () => setMediaState("empty");
443
+ return _jsx3("span", { ref, className: `vx-cover-preview ${className}`, "data-cover-state": state, "aria-hidden": "true", children: state === "empty" ? _jsx3(Icon, { name: `placeholder-${iconKind}`, size: iconSize }) : !pending && media ? kind2 === "video" ? _jsx3("video", { src, muted: true, playsInline: true, preload: "auto", onLoadedData: ready, onError: failed }) : _jsx3("img", { src, alt: "", loading: "lazy", onLoad: ready, onError: failed }) : state === "ready" ? children : null });
444
+ }
445
+
446
+ // packages/ui-system/dist/segmented-control.js
447
+ import { jsx as _jsx4, jsxs as _jsxs2 } from "react/jsx-runtime";
448
+ import { useId } from "react";
449
+ function SegmentedControl({ label, items, value, onValueChange, size = "medium", width = "fixed", iconOnly = false }) {
450
+ const id = useId();
451
+ return _jsx4("div", { role: "radiogroup", "aria-label": label, className: "vx-segment", "data-size": size, "data-width": width, "data-icon-only": iconOnly, children: items.map((item) => _jsxs2("label", { children: [_jsx4("input", { type: "radio", name: id, value: item.value, disabled: item.disabled, checked: item.value === value, "aria-label": item.label, onChange: () => onValueChange(item.value) }), _jsxs2("span", { className: "vx-segment-item", children: [item.icon && _jsx4(Icon, { name: item.icon }), (!iconOnly || !item.icon) && item.label] })] }, item.value)) });
452
+ }
453
+
454
+ // packages/ui-system/dist/input.js
455
+ import { jsx as _jsx5, jsxs as _jsxs3 } from "react/jsx-runtime";
456
+ function TextInput({ label, value, onValueChange, size = "medium", appearance = "default", placeholder, ...props }) {
457
+ return _jsxs3("label", { className: "vx-field", "data-size": size, "data-appearance": appearance, children: [_jsx5("span", { children: label }), _jsx5("input", { ...props, type: "text", placeholder: placeholder ?? (props.readOnly ? void 0 : "Enter text"), value, onChange: (event) => onValueChange(event.currentTarget.value) })] });
458
+ }
459
+
460
+ // packages/ui-system/dist/dialog.js
461
+ import { jsx as _jsx6, jsxs as _jsxs4, Fragment as _Fragment } from "react/jsx-runtime";
462
+ import { useId as useId2, useLayoutEffect, useRef, useState as useState2 } from "react";
463
+ import { createPortal } from "react-dom";
464
+
465
+ // packages/ui-system/dist/dialog-surface.js
466
+ var overlayOpeningEvent = "vx-overlay-opening";
467
+ function outerDialogDocument(anchor2) {
468
+ const source = anchor2.ownerDocument;
469
+ try {
470
+ const target = source.defaultView?.top?.document;
471
+ return target && target !== source ? target : void 0;
472
+ } catch {
473
+ return void 0;
474
+ }
475
+ }
476
+ function createDialogSurface(anchor2) {
477
+ const source = anchor2.ownerDocument;
478
+ const target = outerDialogDocument(anchor2);
479
+ if (!target)
480
+ return void 0;
481
+ const host = target.createElement("div");
482
+ host.dataset.studioDialogSurface = "";
483
+ const shadow = host.attachShadow({ mode: "open" });
484
+ shadow.addEventListener("beforetoggle", (event) => {
485
+ if (event.newState === "open" && !event.target.classList.contains("vx-toast"))
486
+ target.dispatchEvent(new Event(overlayOpeningEvent));
487
+ }, true);
488
+ for (const original of source.querySelectorAll('link[rel="stylesheet"], style')) {
489
+ const clone = original.cloneNode(true);
490
+ if (original.tagName === "LINK")
491
+ clone.setAttribute("href", original.href);
492
+ shadow.append(clone);
493
+ }
494
+ const theme = anchor2.closest("[data-vx-theme]");
495
+ const root = target.createElement("div");
496
+ root.dataset.vxTheme = theme?.dataset.vxTheme ?? "light";
497
+ root.className = theme?.className ?? "";
498
+ root.style.display = "contents";
499
+ const style = source.defaultView.getComputedStyle(anchor2);
500
+ for (const name of style)
501
+ if (name.startsWith("--"))
502
+ root.style.setProperty(name, style.getPropertyValue(name));
503
+ shadow.append(root);
504
+ let container = root;
505
+ const ancestors = [];
506
+ for (let parent = anchor2.parentElement; parent && parent !== theme; parent = parent.parentElement)
507
+ ancestors.unshift(parent);
508
+ for (const original of ancestors) {
509
+ const wrapper = target.createElement("div");
510
+ wrapper.className = original.className;
511
+ for (const { name, value } of original.attributes)
512
+ if (name.startsWith("data-"))
513
+ wrapper.setAttribute(name, value);
514
+ wrapper.style.display = "contents";
515
+ container.append(wrapper);
516
+ container = wrapper;
517
+ }
518
+ target.body.append(host);
519
+ return { root: container, dispose: () => host.remove() };
520
+ }
521
+
522
+ // packages/ui-system/dist/dialog.js
523
+ function Dialog({ title, open, onOpenChange, children, actions, className, inlineWhenClosed = false, variant = "default", closeOnEscape = true, focusTitleOnOpen = variant === "welcome" }) {
524
+ const ref = useRef(null);
525
+ const anchor2 = useRef(null);
526
+ const [surface, setSurface] = useState2();
527
+ const heading = useId2();
528
+ useLayoutEffect(() => {
529
+ if (inlineWhenClosed || !open || !anchor2.current)
530
+ return;
531
+ const mounted = createDialogSurface(anchor2.current);
532
+ const active = anchor2.current.getRootNode().activeElement;
533
+ setSurface(mounted?.root ?? null);
534
+ return () => {
535
+ mounted?.dispose();
536
+ setSurface(void 0);
537
+ queueMicrotask(() => {
538
+ if (active?.isConnected)
539
+ active.focus();
540
+ });
541
+ };
542
+ }, [open, inlineWhenClosed]);
543
+ useLayoutEffect(() => {
544
+ const dialog2 = ref.current;
545
+ if (inlineWhenClosed && dialog2) {
546
+ if (open) {
547
+ dialog2.close();
548
+ dialog2.showModal();
549
+ } else {
550
+ if (dialog2.matches(":modal"))
551
+ dialog2.close();
552
+ dialog2.open = true;
553
+ }
554
+ return;
555
+ }
556
+ if (!open || surface === void 0 || !dialog2)
557
+ return;
558
+ dialog2.showModal();
559
+ return () => {
560
+ if (dialog2.open)
561
+ dialog2.close();
562
+ };
563
+ }, [open, surface, inlineWhenClosed]);
564
+ const welcome = variant === "welcome";
565
+ const closeButton = _jsx6(IconButton, { icon: "close", label: "Close dialog", onClick: () => onOpenChange(false) });
566
+ const dialog = _jsxs4("dialog", { ref, open: inlineWhenClosed || void 0, className: inlineWhenClosed && !open ? "vx-dialog vx-dialog-inline" : className ? `vx-dialog ${className}` : "vx-dialog", "data-variant": variant === "default" ? void 0 : variant, role: inlineWhenClosed && !open ? "presentation" : void 0, "aria-labelledby": inlineWhenClosed && !open ? void 0 : heading, onCancel: (event) => {
567
+ event.preventDefault();
568
+ event.stopPropagation();
569
+ if (closeOnEscape)
570
+ onOpenChange(false);
571
+ }, onClose: (event) => {
572
+ if (open && event.currentTarget.isConnected && !event.currentTarget.open)
573
+ onOpenChange(false);
574
+ }, children: [_jsxs4("header", { hidden: inlineWhenClosed && !open, children: [_jsx6("h2", { id: heading, tabIndex: focusTitleOnOpen ? -1 : void 0, autoFocus: focusTitleOnOpen, children: title }), !welcome && closeButton] }), _jsx6("div", { className: "vx-dialog-body", children }), (actions || welcome) && _jsxs4("footer", { hidden: inlineWhenClosed && !open, children: [actions, welcome && closeButton] })] });
575
+ return _jsxs4(_Fragment, { children: [_jsx6("span", { ref: anchor2, hidden: true }), (open || inlineWhenClosed) && (surface ? createPortal(dialog, surface) : dialog)] });
576
+ }
577
+
578
+ // packages/dashboard-projects/src/create-project-dialog.tsx
579
+ import * as React from "react";
580
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
581
+ var projectTypes = [
582
+ {
583
+ value: "short-drama",
584
+ label: "Short Drama",
585
+ preset: "@vivix-labs/short-drama-workbench:short-drama"
586
+ },
587
+ { value: "ads", label: "Product Ad", preset: "@vivix-labs/ads-workbench:ads" },
588
+ { value: "table", label: "Others", preset: "@vivix-labs/studio-workbench:table" }
589
+ ];
590
+ function NewProjectDialog({
591
+ client,
592
+ close,
593
+ onCreated
594
+ }) {
595
+ const [type, setType] = React.useState(projectTypes[0].value);
596
+ const [name, setName] = React.useState("");
597
+ const [status, setStatus] = React.useState("");
598
+ const [presets, setPresets] = React.useState();
599
+ const [busy, setBusy] = React.useState(false);
600
+ const request = React.useRef(void 0);
601
+ React.useEffect(() => {
602
+ let active = true;
603
+ if (!client.projects?.presets || !client.projects.create) {
604
+ setStatus("Update Studio CLI to create projects from Home.");
605
+ return;
606
+ }
607
+ void client.projects.presets().then(
608
+ (items) => {
609
+ if (active) setPresets(items);
610
+ },
611
+ (error) => {
612
+ if (active) setStatus(error.message);
613
+ }
614
+ );
615
+ return () => {
616
+ active = false;
617
+ };
618
+ }, [client]);
619
+ const selection = projectTypes.find((item) => item.value === type);
620
+ const placeholder = type === "table" ? "Untitled Project" : "Untitled " + selection.label;
621
+ const [packageName, presetId] = selection.preset.split(":");
622
+ const preset = [packageName, packageName.replace("@vivix-labs/", "@vivix-studio/")].flatMap(
623
+ (name2) => presets?.filter(
624
+ (item) => item.spec.startsWith(name2 + "@") && item.spec.endsWith(":" + presetId)
625
+ ) ?? []
626
+ )[0];
627
+ async function create() {
628
+ if (!preset || !client.projects?.create || busy) return;
629
+ const input = {
630
+ name: name.trim() || placeholder,
631
+ preset: preset.spec,
632
+ trust: true,
633
+ allowAccess: [...preset.requiredAccess]
634
+ };
635
+ const intent = JSON.stringify(input);
636
+ if (request.current?.intent !== intent) request.current = { intent, id: crypto.randomUUID() };
637
+ setBusy(true);
638
+ setStatus("");
639
+ try {
640
+ const project = await client.projects.create({ ...input, requestId: request.current.id });
641
+ onCreated(project);
642
+ close();
643
+ } catch (error) {
644
+ setStatus(error instanceof Error ? error.message : String(error));
645
+ } finally {
646
+ setBusy(false);
647
+ }
648
+ }
649
+ return /* @__PURE__ */ jsx(
650
+ Dialog,
651
+ {
652
+ title: "Create Projects",
653
+ open: true,
654
+ variant: "create-project",
655
+ className: "studio-home-dialog",
656
+ onOpenChange: (open) => !open && !busy && close(),
657
+ actions: /* @__PURE__ */ jsxs(Fragment, { children: [
658
+ /* @__PURE__ */ jsx(
659
+ Button,
660
+ {
661
+ label: "Cancel",
662
+ variant: "text-tonal-lg",
663
+ width: "hug",
664
+ disabled: busy,
665
+ onClick: close
666
+ }
667
+ ),
668
+ /* @__PURE__ */ jsx(
669
+ Button,
670
+ {
671
+ label: busy ? "Creating\u2026" : "Create Project",
672
+ variant: "text-filled-lg",
673
+ width: "hug",
674
+ disabled: busy || !preset,
675
+ onClick: () => void create()
676
+ }
677
+ )
678
+ ] }),
679
+ children: /* @__PURE__ */ jsxs("div", { className: "studio-home-create-form", children: [
680
+ /* @__PURE__ */ jsxs("div", { className: "studio-home-create-field", children: [
681
+ /* @__PURE__ */ jsx("span", { children: "Project type" }),
682
+ /* @__PURE__ */ jsx(
683
+ SegmentedControl,
684
+ {
685
+ label: "Project type",
686
+ size: "large",
687
+ width: "full",
688
+ value: type,
689
+ items: projectTypes.map((item) => ({ ...item, disabled: busy })),
690
+ onValueChange: setType
691
+ }
692
+ )
693
+ ] }),
694
+ /* @__PURE__ */ jsx(
695
+ TextInput,
696
+ {
697
+ label: "Project name",
698
+ size: "large",
699
+ value: name,
700
+ onValueChange: setName,
701
+ maxLength: 100,
702
+ disabled: busy,
703
+ placeholder: "Enter project name"
704
+ }
705
+ ),
706
+ presets && !preset && /* @__PURE__ */ jsxs("p", { role: "alert", children: [
707
+ "Install the ",
708
+ selection.label,
709
+ " preset to create this project."
710
+ ] }),
711
+ status && /* @__PURE__ */ jsx("p", { role: "alert", children: status })
712
+ ] })
713
+ }
714
+ );
715
+ }
716
+
717
+ // packages/dashboard-projects/src/client.tsx
718
+ import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
719
+ var Config = z3.object({ studioInstance: z3.string().min(1).nullable().default(null) });
720
+ var dependencies = (config) => config.studioInstance ? [config.studioInstance] : [];
721
+ function decodeRef(value) {
722
+ let item = value;
723
+ if (typeof item === "string") {
724
+ try {
725
+ item = JSON.parse(item);
726
+ } catch {
727
+ return null;
728
+ }
729
+ }
730
+ if (!item || typeof item !== "object" || Array.isArray(item)) return null;
731
+ const ref = item;
732
+ return ["storeId", "objectId", "versionId"].every(
733
+ (key) => typeof ref[key] === "string" && /^[0-9a-f-]{36}$/i.test(ref[key])
734
+ ) ? {
735
+ storeId: ref.storeId,
736
+ objectId: ref.objectId,
737
+ versionId: ref.versionId
738
+ } : null;
739
+ }
740
+ var projectPreviews = /* @__PURE__ */ new WeakMap();
741
+ function ProjectCover({
742
+ client,
743
+ row,
744
+ pending
745
+ }) {
746
+ const ref = decodeRef(row?.available ? row.previewRef ?? row.coverRef : void 0);
747
+ const instanceId = client.config.studioInstance;
748
+ const key = ref && JSON.stringify([instanceId, ref.storeId, ref.objectId, ref.versionId]);
749
+ const cached = key ? projectPreviews.get(client)?.get(key) : void 0;
750
+ const [resolved, setResolved] = React2.useState();
751
+ React2.useEffect(() => {
752
+ if (!ref || !instanceId || !key || cached) return;
753
+ let active = true;
754
+ void client.invoke({ instanceId, operationId: "global.asset" }, { ref }).then(
755
+ ({ item }) => {
756
+ if (!active) return;
757
+ if (item.previewUrl) {
758
+ const previews = projectPreviews.get(client) ?? /* @__PURE__ */ new Map();
759
+ previews.set(key, item);
760
+ if (previews.size > 64) previews.delete(previews.keys().next().value);
761
+ projectPreviews.set(client, previews);
762
+ }
763
+ setResolved(item);
764
+ },
765
+ () => {
766
+ if (active) setResolved(null);
767
+ }
768
+ );
769
+ return () => {
770
+ active = false;
771
+ };
772
+ }, [client, instanceId, key, cached]);
773
+ const preview = cached ?? resolved;
774
+ const src = preview?.previewUrl ?? row?.previewUrl;
775
+ return /* @__PURE__ */ jsx2(
776
+ CoverPreview,
777
+ {
778
+ className: "studio-home-cover",
779
+ src: typeof src === "string" ? src : void 0,
780
+ kind: String(preview?.kind ?? row?.previewKind ?? "image"),
781
+ pending: pending || Boolean(instanceId && ref && preview === void 0)
782
+ }
783
+ );
784
+ }
785
+ var previousProjects = /* @__PURE__ */ new WeakMap();
786
+ function ProjectsCard({
787
+ client,
788
+ projects,
789
+ hiddenProjectIds,
790
+ projectCovers,
791
+ ready,
792
+ openProject,
793
+ openProjects,
794
+ onProjectCreated
795
+ }) {
796
+ const [result, setResult] = React2.useState(() => previousProjects.get(client));
797
+ const [creating, setCreating] = React2.useState(false);
798
+ const grid = React2.useRef(null);
799
+ const [columns, setColumns] = React2.useState(1);
800
+ React2.useLayoutEffect(() => {
801
+ const element = grid.current;
802
+ if (!element) return;
803
+ const measure = () => setColumns(getComputedStyle(element).gridTemplateColumns.split(" ").length);
804
+ measure();
805
+ const observer = new ResizeObserver(measure);
806
+ observer.observe(element);
807
+ return () => observer.disconnect();
808
+ }, []);
809
+ const catalogKey = JSON.stringify(projects);
810
+ const hiddenKey = JSON.stringify(hiddenProjectIds ?? []);
811
+ const resultKey = JSON.stringify([catalogKey, hiddenKey]);
812
+ React2.useEffect(() => {
813
+ const instanceId = client.config.studioInstance;
814
+ if (!ready || !instanceId) return;
815
+ let active = true;
816
+ const loadProjects = (countColumn) => client.invoke(
817
+ { instanceId, operationId: "global.query" },
818
+ {
819
+ source: "projects",
820
+ sql: projectListSql.replace("SELECT ", `SELECT ${countColumn} AS cardAssetCount, `),
821
+ params: [],
822
+ catalog: JSON.parse(catalogKey),
823
+ ...hiddenKey !== "[]" && { excludeProjectIds: JSON.parse(hiddenKey) },
824
+ limit: 5,
825
+ timeoutMs: 8e3,
826
+ offset: 0
827
+ }
828
+ );
829
+ void loadProjects("savedAssetCount").catch(() => loadProjects("assetCount")).then(
830
+ ({ items }) => {
831
+ if (!active) return;
832
+ const result2 = { catalogKey: resultKey, rows: items };
833
+ previousProjects.set(client, result2);
834
+ setResult(result2);
835
+ },
836
+ () => {
837
+ if (!active) return;
838
+ previousProjects.delete(client);
839
+ setResult({ catalogKey: resultKey, rows: [] });
840
+ }
841
+ );
842
+ return () => {
843
+ active = false;
844
+ };
845
+ }, [client, ready, catalogKey, hiddenKey]);
846
+ const current = resultKey === result?.catalogKey ? result : void 0;
847
+ const pending = Boolean(client.config.studioInstance) && (!ready || !current);
848
+ const list = current?.rows ?? [];
849
+ const entries = (list.length ? list.map((row) => projects.find(({ id }) => id === row.projectId)).filter((entry) => !!entry) : projects.slice(0, 5)).map((project) => {
850
+ const row = list.find((entry) => entry.projectId === project.id);
851
+ const cover = projectCovers?.get(project.id);
852
+ const previewRow = {
853
+ ...row,
854
+ available: project.available,
855
+ coverRef: cover ? { ...cover } : row?.coverRef ?? null
856
+ };
857
+ return {
858
+ key: project.id,
859
+ row: previewRow,
860
+ name: String(row?.name ?? project.name),
861
+ note: typeof row?.cardAssetCount === "number" ? `${row.cardAssetCount} ${row.cardAssetCount === 1 ? "asset" : "assets"}` : "",
862
+ enabled: project.available,
863
+ open: () => openProject(project.id)
864
+ };
865
+ });
866
+ return /* @__PURE__ */ jsxs2("section", { className: "studio-home-panel", "aria-label": "Project List", children: [
867
+ /* @__PURE__ */ jsxs2("header", { children: [
868
+ /* @__PURE__ */ jsx2("h2", { children: "Project List" }),
869
+ /* @__PURE__ */ jsx2(
870
+ Button,
871
+ {
872
+ label: ready ? `View all ${projects.length}` : "View all",
873
+ "aria-label": "View all project list",
874
+ variant: "text-link-sm",
875
+ onClick: openProjects
876
+ }
877
+ )
878
+ ] }),
879
+ /* @__PURE__ */ jsxs2("div", { className: "studio-home-grid", ref: grid, children: [
880
+ /* @__PURE__ */ jsxs2(
881
+ "button",
882
+ {
883
+ type: "button",
884
+ className: "studio-home-tile studio-home-create",
885
+ onClick: () => setCreating(true),
886
+ children: [
887
+ /* @__PURE__ */ jsx2("span", { className: "studio-home-cover", "aria-hidden": "true", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(Icon, { name: "add" }) }) }),
888
+ /* @__PURE__ */ jsxs2("span", { className: "studio-home-caption", children: [
889
+ /* @__PURE__ */ jsx2("strong", { children: "Create Project" }),
890
+ /* @__PURE__ */ jsx2("small", { children: "Create a local project" })
891
+ ] })
892
+ ]
893
+ }
894
+ ),
895
+ entries.slice(0, columns - 1).map(({ key, row, name, note, enabled, open }) => /* @__PURE__ */ jsxs2(
896
+ "button",
897
+ {
898
+ type: "button",
899
+ className: "studio-home-tile",
900
+ onClick: open,
901
+ disabled: !enabled,
902
+ children: [
903
+ /* @__PURE__ */ jsx2(
904
+ ProjectCover,
905
+ {
906
+ client,
907
+ row,
908
+ pending: enabled && pending
909
+ },
910
+ JSON.stringify([
911
+ client.config.studioInstance,
912
+ row?.available,
913
+ row?.previewRef ?? row?.coverRef
914
+ ])
915
+ ),
916
+ /* @__PURE__ */ jsxs2("span", { className: "studio-home-caption", children: [
917
+ /* @__PURE__ */ jsx2("strong", { title: name, children: name }),
918
+ note && /* @__PURE__ */ jsx2("small", { children: note })
919
+ ] })
920
+ ]
921
+ },
922
+ key
923
+ ))
924
+ ] }),
925
+ creating && /* @__PURE__ */ jsx2(
926
+ NewProjectDialog,
927
+ {
928
+ client,
929
+ close: () => setCreating(false),
930
+ onCreated: (project) => {
931
+ if (onProjectCreated) onProjectCreated(project);
932
+ else openProject(project.id);
933
+ }
934
+ }
935
+ )
936
+ ] });
937
+ }
938
+ function activate(client) {
939
+ client.registerUI({
940
+ id: "projects",
941
+ title: "Project List",
942
+ kind: "component",
943
+ component: (props) => /* @__PURE__ */ jsx2(ProjectsCard, { ...props, client })
944
+ });
945
+ client.registerUI({
946
+ id: "create-project",
947
+ title: "Create Project",
948
+ kind: "component",
949
+ component: function ProjectCreator(props) {
950
+ const [open, setOpen] = React2.useState(false);
951
+ if ("close" in props) return /* @__PURE__ */ jsx2(NewProjectDialog, { client, ...props });
952
+ return /* @__PURE__ */ jsxs2(Fragment2, { children: [
953
+ /* @__PURE__ */ jsx2(
954
+ Button,
955
+ {
956
+ label: "Create Project",
957
+ variant: "text-filled-sm",
958
+ width: "hug",
959
+ onClick: () => setOpen(true)
960
+ }
961
+ ),
962
+ open && /* @__PURE__ */ jsx2(
963
+ NewProjectDialog,
964
+ {
965
+ client,
966
+ close: () => setOpen(false),
967
+ onCreated: (project) => props.onProjectCreated?.(project)
968
+ }
969
+ )
970
+ ] });
971
+ }
972
+ });
973
+ }
974
+ export {
975
+ Config,
976
+ activate as default,
977
+ dependencies
978
+ };
package/dist/client.js ADDED
@@ -0,0 +1,3 @@
1
+ import './client-code.css';
2
+ export { default } from './client-code.js';
3
+ export * from './client-code.js';
package/package.json CHANGED
@@ -1,6 +1,25 @@
1
1
  {
2
2
  "name": "@vivix-labs/dashboard-projects",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0-beta.10",
4
+ "type": "module",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org/",
8
+ "tag": "beta"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "studio-plugin.json"
13
+ ],
14
+ "exports": {
15
+ "./client": "./dist/client.js"
16
+ },
17
+ "peerDependencies": {
18
+ "vivix-studio": ">=2.2.0",
19
+ "react": "^19.0.0",
20
+ "react-dom": "^19.0.0"
21
+ },
22
+ "devDependencies": {
23
+ "@vivix-labs/project-studio": "1.0.0-beta.10"
24
+ }
6
25
  }
@@ -0,0 +1,8 @@
1
+ {
2
+ "manifestVersion": "0.2",
3
+ "id": "vivix.dashboard-projects",
4
+ "requirements": {
5
+ "studioPluginApi": "^0.2.1"
6
+ },
7
+ "requestedAccess": []
8
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.