@vivix-labs/dashboard-projects 1.0.0-beta.15 → 1.0.0-beta.18
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/dist/client-code.js +116 -47
- package/package.json +1 -1
package/dist/client-code.js
CHANGED
|
@@ -79,14 +79,24 @@ var projectData = z2.object({
|
|
|
79
79
|
aspectRatio: z2.string().nullable().default(null),
|
|
80
80
|
projectType: projectType.optional(),
|
|
81
81
|
coverRef: versionRef.nullable().default(null),
|
|
82
|
-
briefRef: z2.object({ storeId: z2.uuid(), objectId: z2.uuid() }).strict().nullable().
|
|
82
|
+
briefRef: z2.object({ storeId: z2.uuid(), objectId: z2.uuid() }).strict().nullable().optional().transform(() => void 0),
|
|
83
83
|
tags
|
|
84
84
|
}).strict();
|
|
85
85
|
var assetData = z2.object({
|
|
86
86
|
projectId: z2.uuid(),
|
|
87
87
|
name: z2.string().trim().min(1).max(200),
|
|
88
88
|
kind,
|
|
89
|
-
purpose: z2.enum([
|
|
89
|
+
purpose: z2.enum([
|
|
90
|
+
"reference",
|
|
91
|
+
"script",
|
|
92
|
+
"shot",
|
|
93
|
+
"music",
|
|
94
|
+
"voice",
|
|
95
|
+
"speech",
|
|
96
|
+
"subtitle",
|
|
97
|
+
"final",
|
|
98
|
+
"other"
|
|
99
|
+
]).default("other"),
|
|
90
100
|
origin: z2.enum(["upload", "library", "generated", "authored"]),
|
|
91
101
|
orderKey: z2.number().int().nullable().default(null),
|
|
92
102
|
tags,
|
|
@@ -94,26 +104,26 @@ var assetData = z2.object({
|
|
|
94
104
|
sourceRef: versionRef.nullable().default(null),
|
|
95
105
|
adoptedVersionId: z2.uuid().nullable().default(null)
|
|
96
106
|
}).strict();
|
|
97
|
-
var
|
|
98
|
-
z2.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
startMs: z2.number().int().nonnegative(),
|
|
102
|
-
endMs: z2.number().int().nonnegative()
|
|
103
|
-
}).strict()
|
|
104
|
-
]);
|
|
105
|
-
var generationInput = z2.object({
|
|
107
|
+
var storedAssetData = assetData.extend({
|
|
108
|
+
purpose: z2.union([assetData.shape.purpose, z2.literal("speech")])
|
|
109
|
+
});
|
|
110
|
+
var generationFields = z2.object({
|
|
106
111
|
targetAssetId: z2.uuid().optional(),
|
|
107
112
|
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)).
|
|
113
|
+
context: z2.record(z2.string().min(1).max(64), z2.string().min(1).max(200)).describe(
|
|
114
|
+
"Owning-domain binding stored with the task. Short drama passes { episodeId, shotId } so the finished take attaches to that shot; production.generateShot sets it automatically."
|
|
115
|
+
).optional(),
|
|
109
116
|
expectedRevision: z2.number().int().positive().optional(),
|
|
110
117
|
newAsset: z2.object({
|
|
111
118
|
name: z2.string().trim().min(1).max(200),
|
|
112
|
-
kind: z2.enum(["image", "video", "audio"])
|
|
119
|
+
kind: z2.enum(["image", "video", "audio"]),
|
|
120
|
+
purpose: assetData.shape.purpose.unwrap().optional(),
|
|
121
|
+
tags: tags.unwrap().optional()
|
|
113
122
|
}).strict().optional(),
|
|
114
123
|
modelId: z2.string().min(1),
|
|
115
124
|
capabilityId: z2.string().min(1),
|
|
116
|
-
prompt: z2.string().max(32e3),
|
|
125
|
+
prompt: z2.string().max(32e3).optional(),
|
|
126
|
+
voiceRef: versionRef.optional(),
|
|
117
127
|
parameters: z2.record(z2.string(), z2.unknown()).default({}),
|
|
118
128
|
outputCount: z2.number().int().min(1).max(100).default(1),
|
|
119
129
|
inputs: z2.array(
|
|
@@ -127,10 +137,14 @@ var generationInput = z2.object({
|
|
|
127
137
|
baseVersionId: z2.uuid().optional(),
|
|
128
138
|
changeRequest: z2.string().trim().min(1).max(4e3).optional(),
|
|
129
139
|
preserveRequest: z2.string().max(4e3).default(""),
|
|
130
|
-
anchor:
|
|
140
|
+
anchor: z2.object({ kind: z2.literal("whole") }).strict().optional().describe("Deprecated whole-version selection."),
|
|
131
141
|
retryOfTaskId: z2.uuid().optional(),
|
|
132
142
|
acknowledgeUnknown: z2.boolean().optional()
|
|
133
143
|
}).strict();
|
|
144
|
+
var generationInput = generationFields.refine(
|
|
145
|
+
(input) => input.prompt !== void 0 || ["voice.clone", "voice.create"].includes(input.capabilityId),
|
|
146
|
+
{ path: ["prompt"], message: "A prompt is required for this operation." }
|
|
147
|
+
).transform((input) => ({ ...input, prompt: input.prompt ?? "" }));
|
|
134
148
|
var projectSettingsInput = z2.object({
|
|
135
149
|
projectId: z2.uuid(),
|
|
136
150
|
expectedRevision: z2.number().int().positive(),
|
|
@@ -141,11 +155,51 @@ var projectSettingsInput = z2.object({
|
|
|
141
155
|
coverRef: projectData.shape.coverRef.unwrap()
|
|
142
156
|
}).partial().strict()
|
|
143
157
|
}).strict();
|
|
158
|
+
function generationReceiptPredecessors() {
|
|
159
|
+
const legacy = generationFields.omit({ voiceRef: true }).extend({
|
|
160
|
+
prompt: generationFields.shape.prompt.unwrap(),
|
|
161
|
+
newAsset: generationFields.shape.newAsset.unwrap().omit({ purpose: true, tags: true }).optional(),
|
|
162
|
+
anchor: z2.discriminatedUnion("kind", [
|
|
163
|
+
z2.object({ kind: z2.literal("whole") }).strict(),
|
|
164
|
+
z2.object({
|
|
165
|
+
kind: z2.literal("timeRange"),
|
|
166
|
+
startMs: z2.number().int().nonnegative(),
|
|
167
|
+
endMs: z2.number().int().nonnegative()
|
|
168
|
+
}).strict()
|
|
169
|
+
]).default({ kind: "whole" })
|
|
170
|
+
});
|
|
171
|
+
const voice = legacy.extend({
|
|
172
|
+
prompt: legacy.shape.prompt.optional(),
|
|
173
|
+
voiceRef: versionRef.optional()
|
|
174
|
+
}).refine(
|
|
175
|
+
(input) => input.prompt !== void 0 || ["voice.clone", "voice.create"].includes(input.capabilityId)
|
|
176
|
+
).transform((input) => ({ ...input, prompt: input.prompt ?? "" }));
|
|
177
|
+
return [
|
|
178
|
+
{
|
|
179
|
+
packageVersion: "1.0.0-beta.19",
|
|
180
|
+
packageIntegrity: "e70b5c3b91d551bbd73c0b181eadbe92e71b66fbc6a642004184740a14bd4c06",
|
|
181
|
+
input: legacy
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
packageVersion: "1.0.0-beta.20",
|
|
185
|
+
packageIntegrity: "febb0e966d82d98555beab936e2d735dab3cc98d6101d19e8b692c1ebe0dbe8a",
|
|
186
|
+
input: voice
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
packageVersion: "1.0.0-beta.22",
|
|
190
|
+
packageIntegrity: "6fefdd978b7441df8598373da79d22d945587c8656de4e92b64cb615eec30afb",
|
|
191
|
+
input: voice
|
|
192
|
+
},
|
|
193
|
+
// The non-voice beta.22 branch used the original required prompt schema.
|
|
194
|
+
{ packageVersion: "1.0.0-beta.22", input: legacy }
|
|
195
|
+
];
|
|
196
|
+
}
|
|
144
197
|
var generationSubmitOperation = defineOperation({
|
|
145
198
|
id: "generation.submit",
|
|
146
199
|
title: "Generate",
|
|
147
|
-
description: "Submit one media generation without approval, retaining its paid request identity.",
|
|
200
|
+
description: "Submit one media generation without approval, retaining its paid request identity. Pass context with the owning domain identifiers; without it the output is only stored in the media library.",
|
|
148
201
|
input: generationInput,
|
|
202
|
+
receiptPredecessors: generationReceiptPredecessors,
|
|
149
203
|
output: z2.any(),
|
|
150
204
|
effects: ["write", "paid"],
|
|
151
205
|
confirm: "none"
|
|
@@ -166,10 +220,10 @@ var globalQueryInput = z2.object({
|
|
|
166
220
|
var projectListSql = "SELECT rowId, projectId, name, available, createdAt, coverRef FROM studio_projects ORDER BY createdAt DESC, rowId ASC";
|
|
167
221
|
|
|
168
222
|
// packages/ui-system/dist/button.js
|
|
169
|
-
import { jsx as _jsx2, jsxs as
|
|
223
|
+
import { jsx as _jsx2, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
170
224
|
|
|
171
225
|
// packages/ui-system/dist/icon.js
|
|
172
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
226
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
173
227
|
var iconGeometry = {
|
|
174
228
|
add: {
|
|
175
229
|
width: 16,
|
|
@@ -295,6 +349,7 @@ var iconGeometry = {
|
|
|
295
349
|
height: 20,
|
|
296
350
|
slot: 20
|
|
297
351
|
},
|
|
352
|
+
"fullscreen-exit": { width: 20, height: 20, slot: 20 },
|
|
298
353
|
"placeholder-image": {
|
|
299
354
|
width: 20,
|
|
300
355
|
height: 20,
|
|
@@ -364,7 +419,7 @@ var iconGeometry = {
|
|
|
364
419
|
slot: 24
|
|
365
420
|
}
|
|
366
421
|
};
|
|
367
|
-
function Icon({ name, size }) {
|
|
422
|
+
function Icon({ name, size, iconSet }) {
|
|
368
423
|
const geometry = iconGeometry[name];
|
|
369
424
|
const style = {
|
|
370
425
|
...geometry && {
|
|
@@ -374,7 +429,10 @@ function Icon({ name, size }) {
|
|
|
374
429
|
},
|
|
375
430
|
...size === void 0 ? {} : { "--vx-icon-size": `${size}px` }
|
|
376
431
|
};
|
|
377
|
-
|
|
432
|
+
if (name === "menu" || name === "relationships" || name === "color-adjust" || name === "speed") {
|
|
433
|
+
return _jsx("svg", { "aria-hidden": "true", className: "vx-icon", "data-icon": name, "data-icon-set": iconSet === "chat" ? "chat" : void 0, style, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: name === "menu" ? _jsx("path", { d: "M3 5h14M3 10h14M3 15h14" }) : name === "color-adjust" ? _jsxs(_Fragment, { children: [_jsx("path", { d: "M3 5h3m4 0h7M3 10h8m4 0h2M3 15h3m4 0h7" }), _jsx("circle", { cx: "8", cy: "5", r: "2" }), _jsx("circle", { cx: "13", cy: "10", r: "2" }), _jsx("circle", { cx: "8", cy: "15", r: "2" })] }) : name === "speed" ? _jsxs(_Fragment, { children: [_jsx("path", { d: "M4 16a8 8 0 1 1 12 0M10 3v2M3 10h2m10 0h2M5 5l1.4 1.4M10 12l4-5" }), _jsx("circle", { cx: "10", cy: "12", r: "1.5" })] }) : _jsxs(_Fragment, { children: [_jsx("path", { d: "M8.5 6.3 5 11.7M11.5 6.3 15 11.7M6.5 14.5h7" }), _jsx("circle", { cx: "10", cy: "4", r: "2.5" }), _jsx("circle", { cx: "4", cy: "14.5", r: "2.5" }), _jsx("circle", { cx: "16", cy: "14.5", r: "2.5" })] }) });
|
|
434
|
+
}
|
|
435
|
+
return _jsx("span", { "aria-hidden": "true", className: "vx-icon", "data-icon": name, "data-icon-set": iconSet === "chat" ? "chat" : void 0, style });
|
|
378
436
|
}
|
|
379
437
|
|
|
380
438
|
// packages/ui-system/dist/button-variants.js
|
|
@@ -406,7 +464,7 @@ var buttonVariants = {
|
|
|
406
464
|
"icon-outline-sm": { size: 32, appearance: "outline", shape: "icon" },
|
|
407
465
|
"icon-on-content": { size: 24, appearance: "on-content", shape: "icon" },
|
|
408
466
|
"icon-outline-lg": { size: 48, appearance: "outline", shape: "icon" },
|
|
409
|
-
// Compact bare action:
|
|
467
|
+
// Compact bare action: remain transparent at rest and on hover.
|
|
410
468
|
"icon-bare-xs": { size: 24, appearance: "ghost", shape: "icon" },
|
|
411
469
|
"icon-ghost-sm": { size: 32, appearance: "ghost", shape: "icon" },
|
|
412
470
|
"icon-ghost-lg": { size: 48, appearance: "ghost", shape: "icon" },
|
|
@@ -418,10 +476,10 @@ var buttonVariants = {
|
|
|
418
476
|
function ButtonFrame({ label, variant, loading = false, width, children, disabled, type = "button", style, className, ...props }) {
|
|
419
477
|
const spec = buttonVariants[variant];
|
|
420
478
|
const buttonStyle = "width" in spec ? { ...style, "--vx-button-width": `${spec.width}px` } : style;
|
|
421
|
-
return
|
|
479
|
+
return _jsxs2("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
480
|
}
|
|
423
481
|
function Button({ variant = "text-filled-sm", leadingIcon, trailingIcon, badge, ...props }) {
|
|
424
|
-
return
|
|
482
|
+
return _jsxs2(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
483
|
}
|
|
426
484
|
function IconButton({ icon, variant = "icon-ghost-sm", ...props }) {
|
|
427
485
|
return _jsx2(ButtonFrame, { ...props, variant, children: _jsx2(Icon, { name: icon }) });
|
|
@@ -444,28 +502,29 @@ function Preview({ className, ref, kind: kind2 = "image", src, pending, iconSize
|
|
|
444
502
|
}
|
|
445
503
|
|
|
446
504
|
// packages/ui-system/dist/segmented-control.js
|
|
447
|
-
import { jsx as _jsx4, jsxs as
|
|
505
|
+
import { jsx as _jsx4, jsxs as _jsxs3 } from "react/jsx-runtime";
|
|
448
506
|
import { useId } from "react";
|
|
449
507
|
function SegmentedControl({ label, items, value, onValueChange, size = "medium", width = "fixed", iconOnly = false }) {
|
|
450
508
|
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) =>
|
|
509
|
+
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) => _jsxs3("label", { title: iconOnly ? item.label : void 0, 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) }), _jsxs3("span", { className: "vx-segment-item", children: [item.icon && _jsx4(Icon, { name: item.icon }), (!iconOnly || !item.icon) && item.label] })] }, item.value)) });
|
|
452
510
|
}
|
|
453
511
|
|
|
454
512
|
// packages/ui-system/dist/input.js
|
|
455
|
-
import { jsx as _jsx5, jsxs as
|
|
513
|
+
import { jsx as _jsx5, jsxs as _jsxs4 } from "react/jsx-runtime";
|
|
514
|
+
import { useEffect, useState as useState2 } from "react";
|
|
456
515
|
function TextInput({ label, value, onValueChange, size = "medium", appearance = "default", placeholder, ...props }) {
|
|
457
|
-
return
|
|
516
|
+
return _jsxs4("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
517
|
}
|
|
459
518
|
|
|
460
519
|
// packages/ui-system/dist/dialog.js
|
|
461
|
-
import { jsx as _jsx6, jsxs as
|
|
462
|
-
import { useId as useId2, useLayoutEffect, useRef, useState as
|
|
520
|
+
import { jsx as _jsx6, jsxs as _jsxs5, Fragment as _Fragment2 } from "react/jsx-runtime";
|
|
521
|
+
import { useId as useId2, useLayoutEffect, useRef, useState as useState3 } from "react";
|
|
463
522
|
import { createPortal } from "react-dom";
|
|
464
523
|
|
|
465
524
|
// packages/ui-system/dist/dialog-surface.js
|
|
466
525
|
var overlayOpeningEvent = "vx-overlay-opening";
|
|
467
|
-
function outerDialogDocument(
|
|
468
|
-
const source =
|
|
526
|
+
function outerDialogDocument(anchor) {
|
|
527
|
+
const source = anchor.ownerDocument;
|
|
469
528
|
try {
|
|
470
529
|
const target = source.defaultView?.top?.document;
|
|
471
530
|
return target && target !== source ? target : void 0;
|
|
@@ -473,9 +532,9 @@ function outerDialogDocument(anchor2) {
|
|
|
473
532
|
return void 0;
|
|
474
533
|
}
|
|
475
534
|
}
|
|
476
|
-
function createDialogSurface(
|
|
477
|
-
const source =
|
|
478
|
-
const target = outerDialogDocument(
|
|
535
|
+
function createDialogSurface(anchor) {
|
|
536
|
+
const source = anchor.ownerDocument;
|
|
537
|
+
const target = outerDialogDocument(anchor);
|
|
479
538
|
if (!target)
|
|
480
539
|
return void 0;
|
|
481
540
|
const host = target.createElement("div");
|
|
@@ -491,19 +550,19 @@ function createDialogSurface(anchor2) {
|
|
|
491
550
|
clone.setAttribute("href", original.href);
|
|
492
551
|
shadow.append(clone);
|
|
493
552
|
}
|
|
494
|
-
const theme =
|
|
553
|
+
const theme = anchor.closest("[data-vx-theme]");
|
|
495
554
|
const root = target.createElement("div");
|
|
496
555
|
root.dataset.vxTheme = theme?.dataset.vxTheme ?? "light";
|
|
497
556
|
root.className = theme?.className ?? "";
|
|
498
557
|
root.style.display = "contents";
|
|
499
|
-
const style = source.defaultView.getComputedStyle(
|
|
558
|
+
const style = source.defaultView.getComputedStyle(anchor);
|
|
500
559
|
for (const name of style)
|
|
501
560
|
if (name.startsWith("--"))
|
|
502
561
|
root.style.setProperty(name, style.getPropertyValue(name));
|
|
503
562
|
shadow.append(root);
|
|
504
563
|
let container = root;
|
|
505
564
|
const ancestors = [];
|
|
506
|
-
for (let parent =
|
|
565
|
+
for (let parent = anchor.parentElement; parent && parent !== theme; parent = parent.parentElement)
|
|
507
566
|
ancestors.unshift(parent);
|
|
508
567
|
for (const original of ancestors) {
|
|
509
568
|
const wrapper = target.createElement("div");
|
|
@@ -522,14 +581,14 @@ function createDialogSurface(anchor2) {
|
|
|
522
581
|
// packages/ui-system/dist/dialog.js
|
|
523
582
|
function Dialog({ title, open, onOpenChange, children, actions, className, inlineWhenClosed = false, variant = "default", closeOnEscape = true, focusTitleOnOpen = variant === "welcome" }) {
|
|
524
583
|
const ref = useRef(null);
|
|
525
|
-
const
|
|
526
|
-
const [surface, setSurface] =
|
|
584
|
+
const anchor = useRef(null);
|
|
585
|
+
const [surface, setSurface] = useState3();
|
|
527
586
|
const heading = useId2();
|
|
528
587
|
useLayoutEffect(() => {
|
|
529
|
-
if (inlineWhenClosed || !open || !
|
|
588
|
+
if (inlineWhenClosed || !open || !anchor.current)
|
|
530
589
|
return;
|
|
531
|
-
const mounted = createDialogSurface(
|
|
532
|
-
const active =
|
|
590
|
+
const mounted = createDialogSurface(anchor.current);
|
|
591
|
+
const active = anchor.current.getRootNode().activeElement;
|
|
533
592
|
setSurface(mounted?.root ?? null);
|
|
534
593
|
return () => {
|
|
535
594
|
mounted?.dispose();
|
|
@@ -563,7 +622,7 @@ function Dialog({ title, open, onOpenChange, children, actions, className, inlin
|
|
|
563
622
|
}, [open, surface, inlineWhenClosed]);
|
|
564
623
|
const welcome = variant === "welcome";
|
|
565
624
|
const closeButton = _jsx6(IconButton, { icon: "close", label: "Close dialog", onClick: () => onOpenChange(false) });
|
|
566
|
-
const dialog =
|
|
625
|
+
const dialog = _jsxs5("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
626
|
event.preventDefault();
|
|
568
627
|
event.stopPropagation();
|
|
569
628
|
if (closeOnEscape)
|
|
@@ -571,8 +630,8 @@ function Dialog({ title, open, onOpenChange, children, actions, className, inlin
|
|
|
571
630
|
}, onClose: (event) => {
|
|
572
631
|
if (open && event.currentTarget.isConnected && !event.currentTarget.open)
|
|
573
632
|
onOpenChange(false);
|
|
574
|
-
}, children: [
|
|
575
|
-
return
|
|
633
|
+
}, children: [_jsxs5("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) && _jsxs5("footer", { hidden: inlineWhenClosed && !open, children: [actions, welcome && closeButton] })] });
|
|
634
|
+
return _jsxs5(_Fragment2, { children: [_jsx6("span", { ref: anchor, hidden: true }), (open || inlineWhenClosed) && (surface ? createPortal(dialog, surface) : dialog)] });
|
|
576
635
|
}
|
|
577
636
|
|
|
578
637
|
// packages/dashboard-projects/src/create-project-dialog.tsx
|
|
@@ -587,6 +646,16 @@ var projectTypes = [
|
|
|
587
646
|
{ value: "ads", label: "Product Ad", preset: "@vivix-labs/ads-workbench:ads" },
|
|
588
647
|
{ value: "table", label: "Others", preset: "@vivix-labs/studio-workbench:table" }
|
|
589
648
|
];
|
|
649
|
+
function formatErrorMessage(error) {
|
|
650
|
+
if (!(error instanceof Error)) return String(error);
|
|
651
|
+
const hint = "hint" in error && typeof error.hint === "string" ? error.hint.trim() : "";
|
|
652
|
+
const message = error.message.trim();
|
|
653
|
+
const detail = hint || message;
|
|
654
|
+
const code = "code" in error && typeof error.code === "string" ? error.code : "";
|
|
655
|
+
if (code === "INSTANCE_UNAVAILABLE" && detail && !detail.includes("vivix-studio"))
|
|
656
|
+
return `${detail} Check with: vivix-studio plugin list --scope user --json`;
|
|
657
|
+
return detail;
|
|
658
|
+
}
|
|
590
659
|
function NewProjectDialog({
|
|
591
660
|
client,
|
|
592
661
|
close,
|
|
@@ -609,7 +678,7 @@ function NewProjectDialog({
|
|
|
609
678
|
if (active) setPresets(items);
|
|
610
679
|
},
|
|
611
680
|
(error) => {
|
|
612
|
-
if (active) setStatus(error
|
|
681
|
+
if (active) setStatus(formatErrorMessage(error));
|
|
613
682
|
}
|
|
614
683
|
);
|
|
615
684
|
return () => {
|
|
@@ -641,7 +710,7 @@ function NewProjectDialog({
|
|
|
641
710
|
onCreated(project);
|
|
642
711
|
close();
|
|
643
712
|
} catch (error) {
|
|
644
|
-
setStatus(
|
|
713
|
+
setStatus(formatErrorMessage(error));
|
|
645
714
|
} finally {
|
|
646
715
|
setBusy(false);
|
|
647
716
|
}
|