@vivix-labs/dashboard-projects 1.0.0-beta.15 → 1.0.0-beta.17
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 +29 -15
- package/package.json +1 -1
package/dist/client-code.js
CHANGED
|
@@ -166,10 +166,10 @@ var globalQueryInput = z2.object({
|
|
|
166
166
|
var projectListSql = "SELECT rowId, projectId, name, available, createdAt, coverRef FROM studio_projects ORDER BY createdAt DESC, rowId ASC";
|
|
167
167
|
|
|
168
168
|
// packages/ui-system/dist/button.js
|
|
169
|
-
import { jsx as _jsx2, jsxs as
|
|
169
|
+
import { jsx as _jsx2, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
170
170
|
|
|
171
171
|
// packages/ui-system/dist/icon.js
|
|
172
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
172
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
173
173
|
var iconGeometry = {
|
|
174
174
|
add: {
|
|
175
175
|
width: 16,
|
|
@@ -295,6 +295,7 @@ var iconGeometry = {
|
|
|
295
295
|
height: 20,
|
|
296
296
|
slot: 20
|
|
297
297
|
},
|
|
298
|
+
"fullscreen-exit": { width: 20, height: 20, slot: 20 },
|
|
298
299
|
"placeholder-image": {
|
|
299
300
|
width: 20,
|
|
300
301
|
height: 20,
|
|
@@ -374,6 +375,9 @@ function Icon({ name, size }) {
|
|
|
374
375
|
},
|
|
375
376
|
...size === void 0 ? {} : { "--vx-icon-size": `${size}px` }
|
|
376
377
|
};
|
|
378
|
+
if (name === "relationships" || name === "color-adjust" || name === "speed") {
|
|
379
|
+
return _jsx("svg", { "aria-hidden": "true", className: "vx-icon", "data-icon": name, style, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: 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" })] }) });
|
|
380
|
+
}
|
|
377
381
|
return _jsx("span", { "aria-hidden": "true", className: "vx-icon", "data-icon": name, style });
|
|
378
382
|
}
|
|
379
383
|
|
|
@@ -406,7 +410,7 @@ var buttonVariants = {
|
|
|
406
410
|
"icon-outline-sm": { size: 32, appearance: "outline", shape: "icon" },
|
|
407
411
|
"icon-on-content": { size: 24, appearance: "on-content", shape: "icon" },
|
|
408
412
|
"icon-outline-lg": { size: 48, appearance: "outline", shape: "icon" },
|
|
409
|
-
// Compact bare action:
|
|
413
|
+
// Compact bare action: remain transparent at rest and on hover.
|
|
410
414
|
"icon-bare-xs": { size: 24, appearance: "ghost", shape: "icon" },
|
|
411
415
|
"icon-ghost-sm": { size: 32, appearance: "ghost", shape: "icon" },
|
|
412
416
|
"icon-ghost-lg": { size: 48, appearance: "ghost", shape: "icon" },
|
|
@@ -418,10 +422,10 @@ var buttonVariants = {
|
|
|
418
422
|
function ButtonFrame({ label, variant, loading = false, width, children, disabled, type = "button", style, className, ...props }) {
|
|
419
423
|
const spec = buttonVariants[variant];
|
|
420
424
|
const buttonStyle = "width" in spec ? { ...style, "--vx-button-width": `${spec.width}px` } : style;
|
|
421
|
-
return
|
|
425
|
+
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
426
|
}
|
|
423
427
|
function Button({ variant = "text-filled-sm", leadingIcon, trailingIcon, badge, ...props }) {
|
|
424
|
-
return
|
|
428
|
+
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
429
|
}
|
|
426
430
|
function IconButton({ icon, variant = "icon-ghost-sm", ...props }) {
|
|
427
431
|
return _jsx2(ButtonFrame, { ...props, variant, children: _jsx2(Icon, { name: icon }) });
|
|
@@ -444,21 +448,21 @@ function Preview({ className, ref, kind: kind2 = "image", src, pending, iconSize
|
|
|
444
448
|
}
|
|
445
449
|
|
|
446
450
|
// packages/ui-system/dist/segmented-control.js
|
|
447
|
-
import { jsx as _jsx4, jsxs as
|
|
451
|
+
import { jsx as _jsx4, jsxs as _jsxs3 } from "react/jsx-runtime";
|
|
448
452
|
import { useId } from "react";
|
|
449
453
|
function SegmentedControl({ label, items, value, onValueChange, size = "medium", width = "fixed", iconOnly = false }) {
|
|
450
454
|
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) =>
|
|
455
|
+
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
456
|
}
|
|
453
457
|
|
|
454
458
|
// packages/ui-system/dist/input.js
|
|
455
|
-
import { jsx as _jsx5, jsxs as
|
|
459
|
+
import { jsx as _jsx5, jsxs as _jsxs4 } from "react/jsx-runtime";
|
|
456
460
|
function TextInput({ label, value, onValueChange, size = "medium", appearance = "default", placeholder, ...props }) {
|
|
457
|
-
return
|
|
461
|
+
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
462
|
}
|
|
459
463
|
|
|
460
464
|
// packages/ui-system/dist/dialog.js
|
|
461
|
-
import { jsx as _jsx6, jsxs as
|
|
465
|
+
import { jsx as _jsx6, jsxs as _jsxs5, Fragment as _Fragment2 } from "react/jsx-runtime";
|
|
462
466
|
import { useId as useId2, useLayoutEffect, useRef, useState as useState2 } from "react";
|
|
463
467
|
import { createPortal } from "react-dom";
|
|
464
468
|
|
|
@@ -563,7 +567,7 @@ function Dialog({ title, open, onOpenChange, children, actions, className, inlin
|
|
|
563
567
|
}, [open, surface, inlineWhenClosed]);
|
|
564
568
|
const welcome = variant === "welcome";
|
|
565
569
|
const closeButton = _jsx6(IconButton, { icon: "close", label: "Close dialog", onClick: () => onOpenChange(false) });
|
|
566
|
-
const dialog =
|
|
570
|
+
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
571
|
event.preventDefault();
|
|
568
572
|
event.stopPropagation();
|
|
569
573
|
if (closeOnEscape)
|
|
@@ -571,8 +575,8 @@ function Dialog({ title, open, onOpenChange, children, actions, className, inlin
|
|
|
571
575
|
}, onClose: (event) => {
|
|
572
576
|
if (open && event.currentTarget.isConnected && !event.currentTarget.open)
|
|
573
577
|
onOpenChange(false);
|
|
574
|
-
}, children: [
|
|
575
|
-
return
|
|
578
|
+
}, 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] })] });
|
|
579
|
+
return _jsxs5(_Fragment2, { children: [_jsx6("span", { ref: anchor2, hidden: true }), (open || inlineWhenClosed) && (surface ? createPortal(dialog, surface) : dialog)] });
|
|
576
580
|
}
|
|
577
581
|
|
|
578
582
|
// packages/dashboard-projects/src/create-project-dialog.tsx
|
|
@@ -587,6 +591,16 @@ var projectTypes = [
|
|
|
587
591
|
{ value: "ads", label: "Product Ad", preset: "@vivix-labs/ads-workbench:ads" },
|
|
588
592
|
{ value: "table", label: "Others", preset: "@vivix-labs/studio-workbench:table" }
|
|
589
593
|
];
|
|
594
|
+
function formatErrorMessage(error) {
|
|
595
|
+
if (!(error instanceof Error)) return String(error);
|
|
596
|
+
const hint = "hint" in error && typeof error.hint === "string" ? error.hint.trim() : "";
|
|
597
|
+
const message = error.message.trim();
|
|
598
|
+
const detail = hint || message;
|
|
599
|
+
const code = "code" in error && typeof error.code === "string" ? error.code : "";
|
|
600
|
+
if (code === "INSTANCE_UNAVAILABLE" && detail && !detail.includes("vivix-studio"))
|
|
601
|
+
return `${detail} Check with: vivix-studio plugin list --scope user --json`;
|
|
602
|
+
return detail;
|
|
603
|
+
}
|
|
590
604
|
function NewProjectDialog({
|
|
591
605
|
client,
|
|
592
606
|
close,
|
|
@@ -609,7 +623,7 @@ function NewProjectDialog({
|
|
|
609
623
|
if (active) setPresets(items);
|
|
610
624
|
},
|
|
611
625
|
(error) => {
|
|
612
|
-
if (active) setStatus(error
|
|
626
|
+
if (active) setStatus(formatErrorMessage(error));
|
|
613
627
|
}
|
|
614
628
|
);
|
|
615
629
|
return () => {
|
|
@@ -641,7 +655,7 @@ function NewProjectDialog({
|
|
|
641
655
|
onCreated(project);
|
|
642
656
|
close();
|
|
643
657
|
} catch (error) {
|
|
644
|
-
setStatus(
|
|
658
|
+
setStatus(formatErrorMessage(error));
|
|
645
659
|
} finally {
|
|
646
660
|
setBusy(false);
|
|
647
661
|
}
|