@vivix-labs/studio-workbench 1.0.0-beta.6 → 1.0.0-beta.9
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/assets/crop-5JXWHIPN.svg +6 -0
- package/dist/assets/trim-LQMHHN2M.svg +9 -0
- package/dist/assets/welcome-add-HS6LIH63.svg +5 -0
- package/dist/assets/welcome-close-NOBXBZOT.svg +5 -0
- package/dist/assets/welcome-product-ad-YRPDJRAH.png +0 -0
- package/dist/assets/welcome-short-drama-YDTZHBGK.png +0 -0
- package/dist/client.bundle.js +1366 -962
- package/dist/client.css +597 -109
- package/dist/server.js +261 -39
- package/package.json +23 -23
- package/presets/table.json +4 -4
- package/presets/user-base.json +9 -9
- package/skills/SKILL.md +4 -3
- package/skills/scripts/initialize-home.mjs +155 -119
package/dist/client.bundle.js
CHANGED
|
@@ -29,13 +29,15 @@ var taskNotice = z2.object({
|
|
|
29
29
|
requestedCount: z2.number().int().positive().nullable(),
|
|
30
30
|
resultCount: z2.number().int().nonnegative().nullable(),
|
|
31
31
|
partialResults: z2.boolean().nullable(),
|
|
32
|
-
results: z2.array(result)
|
|
32
|
+
results: z2.array(result),
|
|
33
|
+
billing: taskBilling.optional()
|
|
33
34
|
}).strict();
|
|
34
35
|
var billingNotice = z2.object({
|
|
35
36
|
taskId: z2.string(),
|
|
36
37
|
attemptId: z2.string(),
|
|
37
38
|
billingRecordId: z2.string(),
|
|
38
|
-
revision: z2.number().int().positive()
|
|
39
|
+
revision: z2.number().int().positive(),
|
|
40
|
+
billing: taskBilling.optional()
|
|
39
41
|
}).strict();
|
|
40
42
|
var eventDefinitions = taskEventNames.map((name) => ({
|
|
41
43
|
name,
|
|
@@ -177,7 +179,7 @@ function followLocalSaving(read, onError) {
|
|
|
177
179
|
}
|
|
178
180
|
|
|
179
181
|
// packages/studio-workbench/src/client.tsx
|
|
180
|
-
import * as
|
|
182
|
+
import * as React13 from "react";
|
|
181
183
|
|
|
182
184
|
// packages/ui-system/dist/studio-theme.js
|
|
183
185
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -257,6 +259,8 @@ var iconGeometry = {
|
|
|
257
259
|
slot: 18
|
|
258
260
|
},
|
|
259
261
|
"select-items": { width: 13.8681, height: 13.8667, slot: 16 },
|
|
262
|
+
trim: { width: 14.85, height: 14.85, slot: 16 },
|
|
263
|
+
crop: { width: 16.25, height: 16.25, slot: 16 },
|
|
260
264
|
filter: { width: 13.2, height: 13.2, slot: 16 },
|
|
261
265
|
select: {
|
|
262
266
|
width: 14.6298,
|
|
@@ -401,6 +405,8 @@ var buttonVariants = {
|
|
|
401
405
|
"text-filled-leading-sm": { size: 32, appearance: "filled", shape: "text" },
|
|
402
406
|
"text-ghost-sm": { size: 32, appearance: "ghost", shape: "text" },
|
|
403
407
|
"text-on-content-sm": { size: 32, appearance: "on-content", shape: "text" },
|
|
408
|
+
"text-plain-sm": { size: 32, appearance: "plain", shape: "text" },
|
|
409
|
+
"text-link-sm": { size: 32, appearance: "link", shape: "text" },
|
|
404
410
|
"text-outline-sm": { size: 32, appearance: "outline", shape: "text" },
|
|
405
411
|
"text-tonal-sm": { size: 32, appearance: "tonal", shape: "text" },
|
|
406
412
|
// The medium recipes are shared by all dialog footer actions.
|
|
@@ -535,9 +541,12 @@ function Checkbox({ label, checked, onCheckedChange, hideLabel = false, appearan
|
|
|
535
541
|
|
|
536
542
|
// packages/ui-system/dist/dropdown.js
|
|
537
543
|
import { jsx as _jsx9, jsxs as _jsxs6 } from "react/jsx-runtime";
|
|
538
|
-
import { useEffect as useEffect2, useId, useRef, useState as useState3 } from "react";
|
|
544
|
+
import { useEffect as useEffect2, useId, useLayoutEffect, useRef, useState as useState3 } from "react";
|
|
539
545
|
function Dropdown({ label, options, value, onValueChange, placeholder = "Select an option", size = "medium", width = "fixed", appearance = "default", textSize = 14, disabled = false }) {
|
|
540
546
|
const id = useId();
|
|
547
|
+
const trigger = useRef(null);
|
|
548
|
+
const list = useRef(null);
|
|
549
|
+
const heading = appearance === "heading";
|
|
541
550
|
const activeOption = useRef(null);
|
|
542
551
|
const search = useRef({ query: "", time: 0 });
|
|
543
552
|
const [open, setOpen] = useState3(false);
|
|
@@ -548,6 +557,37 @@ function Dropdown({ label, options, value, onValueChange, placeholder = "Select
|
|
|
548
557
|
const selected = options.find((option) => option.value === value);
|
|
549
558
|
const active = enabled.find((option) => option.value === highlighted) ?? enabled.find((option) => option.value === value) ?? enabled[0];
|
|
550
559
|
const activeIndex = active ? enabled.indexOf(active) : -1;
|
|
560
|
+
useLayoutEffect(() => {
|
|
561
|
+
const anchor2 = trigger.current;
|
|
562
|
+
const popup = list.current;
|
|
563
|
+
if (!expanded || !heading || !popup || !anchor2)
|
|
564
|
+
return;
|
|
565
|
+
const win = anchor2.ownerDocument.defaultView;
|
|
566
|
+
popup.showPopover?.();
|
|
567
|
+
function place() {
|
|
568
|
+
if (!anchor2 || !popup)
|
|
569
|
+
return;
|
|
570
|
+
const box = anchor2.getBoundingClientRect();
|
|
571
|
+
const width2 = anchor2.ownerDocument.documentElement.clientWidth;
|
|
572
|
+
const margin = 8;
|
|
573
|
+
const gap = 4;
|
|
574
|
+
const below = win.innerHeight - box.bottom - gap - margin;
|
|
575
|
+
const above = box.top - gap - margin;
|
|
576
|
+
const up = below < Math.min(popup.scrollHeight, 240) && above > below;
|
|
577
|
+
popup.style.maxHeight = Math.max(0, Math.min(240, up ? above : below)) + "px";
|
|
578
|
+
const size2 = popup.getBoundingClientRect();
|
|
579
|
+
popup.style.left = Math.max(margin, Math.min(box.left, width2 - size2.width - margin)) + "px";
|
|
580
|
+
popup.style.top = (up ? box.top - gap - size2.height : box.bottom + gap) + "px";
|
|
581
|
+
}
|
|
582
|
+
place();
|
|
583
|
+
win.addEventListener("resize", place);
|
|
584
|
+
win.addEventListener("scroll", place, true);
|
|
585
|
+
return () => {
|
|
586
|
+
popup.hidePopover?.();
|
|
587
|
+
win.removeEventListener("resize", place);
|
|
588
|
+
win.removeEventListener("scroll", place, true);
|
|
589
|
+
};
|
|
590
|
+
}, [expanded, heading]);
|
|
551
591
|
useEffect2(() => {
|
|
552
592
|
if (expanded)
|
|
553
593
|
activeOption.current?.scrollIntoView({ block: "nearest" });
|
|
@@ -627,7 +667,7 @@ function Dropdown({ label, options, value, onValueChange, placeholder = "Select
|
|
|
627
667
|
if (match)
|
|
628
668
|
setHighlighted(match.value);
|
|
629
669
|
}
|
|
630
|
-
return _jsxs6("div", { className: "vx-dropdown", "data-size": size, "data-width": width, "data-appearance": appearance, "data-text-size": textSize, children: [_jsxs6("button", { type: "button", role: "combobox", className: "vx-dropdown-trigger", "aria-label": label, "aria-expanded": expanded, "aria-controls": `${id}-listbox`, "aria-activedescendant": expanded && active ? `${id}-option-${options.indexOf(active)}` : void 0, disabled: !canOpen, onClick: () => expanded ? close() : setOpen(true), onBlur: close, onKeyDown: handleKey, children: [_jsxs6("span", { className: "vx-dropdown-value", children: [selected?.icon && _jsx9(Icon, { name: selected.icon }), _jsx9("span", { children: selected?.label ?? placeholder })] }), _jsx9(Icon, { name: expanded ? "chevron-up" : "chevron-down" })] }), _jsx9("ul", { id: `${id}-listbox`, role: "listbox", "aria-label": label, hidden: !expanded, children: options.map((option, index) => _jsxs6("li", { id: `${id}-option-${index}`, ref: active === option ? activeOption : void 0, role: "option", "aria-selected": option.value === value, "aria-disabled": option.disabled || void 0, "data-active": active === option, onMouseDown: (event2) => event2.preventDefault(), onClick: () => {
|
|
670
|
+
return _jsxs6("div", { className: "vx-dropdown", "data-size": size, "data-width": width, "data-appearance": appearance, "data-text-size": textSize, children: [_jsxs6("button", { type: "button", ref: trigger, role: "combobox", className: "vx-dropdown-trigger", "aria-label": label, "aria-expanded": expanded, "aria-controls": `${id}-listbox`, "aria-activedescendant": expanded && active ? `${id}-option-${options.indexOf(active)}` : void 0, disabled: !canOpen, onClick: () => expanded ? close() : setOpen(true), onBlur: close, onKeyDown: handleKey, children: [_jsxs6("span", { className: "vx-dropdown-value", children: [selected?.icon && _jsx9(Icon, { name: selected.icon }), _jsx9("span", { children: selected?.triggerLabel ?? selected?.label ?? placeholder })] }), _jsx9(Icon, { name: expanded ? "chevron-up" : "chevron-down" })] }), _jsx9("ul", { ref: list, popover: heading ? "manual" : void 0, id: `${id}-listbox`, role: "listbox", "aria-label": label, hidden: !expanded, children: options.map((option, index) => _jsxs6("li", { id: `${id}-option-${index}`, ref: active === option ? activeOption : void 0, role: "option", "aria-selected": option.value === value, "aria-disabled": option.disabled || void 0, "data-active": active === option, onMouseDown: (event2) => event2.preventDefault(), onClick: () => {
|
|
631
671
|
if (!option.disabled)
|
|
632
672
|
choose(option);
|
|
633
673
|
}, children: [option.icon && _jsx9(Icon, { name: option.icon }), option.label, width === "hug" && option.value === value && _jsx9(Icon, { name: "check" })] }, option.value)) })] });
|
|
@@ -683,7 +723,7 @@ function Tag({ children, variant = "overlay", className }) {
|
|
|
683
723
|
|
|
684
724
|
// packages/ui-system/dist/dialog.js
|
|
685
725
|
import { jsx as _jsx14, jsxs as _jsxs10, Fragment as _Fragment } from "react/jsx-runtime";
|
|
686
|
-
import { useId as useId4, useLayoutEffect, useRef as useRef2, useState as useState4 } from "react";
|
|
726
|
+
import { useId as useId4, useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState4 } from "react";
|
|
687
727
|
import { createPortal } from "react-dom";
|
|
688
728
|
|
|
689
729
|
// packages/ui-system/dist/dialog-surface.js
|
|
@@ -735,12 +775,12 @@ function createDialogSurface(anchor2) {
|
|
|
735
775
|
}
|
|
736
776
|
|
|
737
777
|
// packages/ui-system/dist/dialog.js
|
|
738
|
-
function Dialog({ title, open, onOpenChange, children, actions, className, variant = "default" }) {
|
|
778
|
+
function Dialog({ title, open, onOpenChange, children, actions, className, variant = "default", focusTitleOnOpen = variant === "welcome" }) {
|
|
739
779
|
const ref = useRef2(null);
|
|
740
780
|
const anchor2 = useRef2(null);
|
|
741
781
|
const [surface, setSurface] = useState4();
|
|
742
782
|
const heading = useId4();
|
|
743
|
-
|
|
783
|
+
useLayoutEffect2(() => {
|
|
744
784
|
if (!open || !anchor2.current)
|
|
745
785
|
return;
|
|
746
786
|
const mounted = createDialogSurface(anchor2.current);
|
|
@@ -755,7 +795,7 @@ function Dialog({ title, open, onOpenChange, children, actions, className, varia
|
|
|
755
795
|
});
|
|
756
796
|
};
|
|
757
797
|
}, [open]);
|
|
758
|
-
|
|
798
|
+
useLayoutEffect2(() => {
|
|
759
799
|
const dialog2 = ref.current;
|
|
760
800
|
if (!open || surface === void 0 || !dialog2)
|
|
761
801
|
return;
|
|
@@ -765,6 +805,8 @@ function Dialog({ title, open, onOpenChange, children, actions, className, varia
|
|
|
765
805
|
dialog2.close();
|
|
766
806
|
};
|
|
767
807
|
}, [open, surface]);
|
|
808
|
+
const welcome = variant === "welcome";
|
|
809
|
+
const closeButton = _jsx14(IconButton, { icon: "close", label: "Close dialog", onClick: () => onOpenChange(false) });
|
|
768
810
|
const dialog = _jsxs10("dialog", { ref, className: className ? `vx-dialog ${className}` : "vx-dialog", "data-variant": variant === "default" ? void 0 : variant, "aria-labelledby": heading, onCancel: (event2) => {
|
|
769
811
|
event2.preventDefault();
|
|
770
812
|
event2.stopPropagation();
|
|
@@ -772,18 +814,36 @@ function Dialog({ title, open, onOpenChange, children, actions, className, varia
|
|
|
772
814
|
}, onClose: (event2) => {
|
|
773
815
|
if (open && event2.currentTarget.isConnected && !event2.currentTarget.open)
|
|
774
816
|
onOpenChange(false);
|
|
775
|
-
}, children: [_jsxs10("header", { children: [_jsx14("h2", { id: heading,
|
|
817
|
+
}, children: [_jsxs10("header", { children: [_jsx14("h2", { id: heading, tabIndex: focusTitleOnOpen ? -1 : void 0, autoFocus: focusTitleOnOpen, children: title }), !welcome && closeButton] }), _jsx14("div", { className: "vx-dialog-body", children }), (actions || welcome) && _jsxs10("footer", { children: [actions, welcome && closeButton] })] });
|
|
776
818
|
return _jsxs10(_Fragment, { children: [_jsx14("span", { ref: anchor2, hidden: true }), open && (surface ? createPortal(dialog, surface) : dialog)] });
|
|
777
819
|
}
|
|
778
820
|
|
|
779
821
|
// packages/ui-system/dist/menu.js
|
|
780
822
|
import { jsx as _jsx15, jsxs as _jsxs11 } from "react/jsx-runtime";
|
|
781
|
-
import { useEffect as useEffect3, useId as useId5, useLayoutEffect as
|
|
823
|
+
import { useEffect as useEffect3, useId as useId5, useLayoutEffect as useLayoutEffect3, useRef as useRef3, useState as useState5 } from "react";
|
|
782
824
|
import { createPortal as createPortal2 } from "react-dom";
|
|
825
|
+
function MenuPreview({ children }) {
|
|
826
|
+
const ref = useRef3(null);
|
|
827
|
+
const [visible, setVisible] = useState5(false);
|
|
828
|
+
useEffect3(() => {
|
|
829
|
+
const node = ref.current;
|
|
830
|
+
if (!node)
|
|
831
|
+
return;
|
|
832
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
833
|
+
if (entry?.isIntersecting) {
|
|
834
|
+
setVisible(true);
|
|
835
|
+
observer.disconnect();
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
observer.observe(node);
|
|
839
|
+
return () => observer.disconnect();
|
|
840
|
+
}, []);
|
|
841
|
+
return _jsx15("span", { ref, className: "vx-menu-preview", "aria-hidden": "true", children: visible && children });
|
|
842
|
+
}
|
|
783
843
|
function isEnabled(item) {
|
|
784
844
|
return !item.disabled && item.items?.length !== 0;
|
|
785
845
|
}
|
|
786
|
-
function Menu({ label, items, triggerIcon, floating = false, cascading = false }) {
|
|
846
|
+
function Menu({ label, items, triggerIcon, textTrigger = "dropdown", floating = false, cascading = false }) {
|
|
787
847
|
const id = useId5();
|
|
788
848
|
const trigger = useRef3(null);
|
|
789
849
|
const popup = useRef3(null);
|
|
@@ -794,7 +854,7 @@ function Menu({ label, items, triggerIcon, floating = false, cascading = false }
|
|
|
794
854
|
const [path, setPath] = useState5(null);
|
|
795
855
|
const [placement, setPlacement] = useState5({ visibility: "hidden" });
|
|
796
856
|
const portalRoot = floating ? trigger.current?.closest("dialog, [data-vx-theme]") : null;
|
|
797
|
-
|
|
857
|
+
useLayoutEffect3(() => {
|
|
798
858
|
if (!floating || !path || !portalRoot)
|
|
799
859
|
return;
|
|
800
860
|
const position = () => {
|
|
@@ -970,7 +1030,7 @@ function Menu({ label, items, triggerIcon, floating = false, cascading = false }
|
|
|
970
1030
|
children.current.set(depth, el);
|
|
971
1031
|
else
|
|
972
1032
|
children.current.delete(depth);
|
|
973
|
-
}, className: "vx-action-menu-items", role: "menu", id: !cascade || !depth ? id : id + "-" + depth, "aria-label": menuLabel2, hidden: !path, onKeyDown: (e) => handleKey(e, depth), "data-floating": floating || void 0, style: floating && portalRoot ? cascade && depth ? {
|
|
1033
|
+
}, className: "vx-action-menu-items", role: "menu", id: !cascade || !depth ? id : id + "-" + depth, "aria-label": menuLabel2, hidden: !path, onKeyDown: (e) => handleKey(e, depth), "data-with-previews": entries2.some((item) => item.preview) || void 0, "data-floating": floating || void 0, style: floating && portalRoot ? cascade && depth ? {
|
|
974
1034
|
position: "fixed",
|
|
975
1035
|
insetInlineStart: "auto",
|
|
976
1036
|
visibility: "hidden",
|
|
@@ -979,23 +1039,23 @@ function Menu({ label, items, triggerIcon, floating = false, cascading = false }
|
|
|
979
1039
|
} : placement : void 0, children: entries2.map((item) => _jsxs11("button", { type: "button", role: item.checked === void 0 ? "menuitem" : "menuitemcheckbox", "aria-checked": item.checked, "aria-haspopup": item.items?.length ? "menu" : void 0, "data-key": item.id, "aria-expanded": cascade && item.items ? path?.[depth] === item.id : void 0, onPointerEnter: cascade ? (e) => {
|
|
980
1040
|
if (e.pointerType !== "touch")
|
|
981
1041
|
hover(item, depth);
|
|
982
|
-
} : void 0, "data-size": item.size ?? "medium", "data-tone": item.tone, disabled: !isEnabled(item), tabIndex: -1, onClick: () => choose(item, depth), children: [item.icon && _jsx15(Icon, { name: item.icon }), _jsx15("span", { children: item.label }), item.checked && _jsx15(Icon, { name: "check" }), item.items?.length ? _jsx15(Icon, { name: "chevron-right" }) : null] }, item.id)) }, depth));
|
|
1042
|
+
} : void 0, "data-size": item.size ?? "medium", "data-tone": item.tone, disabled: !isEnabled(item), tabIndex: -1, onClick: () => choose(item, depth), children: [item.icon && _jsx15(Icon, { name: item.icon }), path && item.preview && _jsx15(MenuPreview, { children: item.preview }), _jsx15("span", { className: "vx-menu-label", children: item.label }), item.checked && _jsx15(Icon, { name: "check" }), item.items?.length ? _jsx15(Icon, { name: "chevron-right" }) : null] }, item.id)) }, depth));
|
|
983
1043
|
return _jsxs11("div", { className: "vx-action-menu", onBlur: (event2) => {
|
|
984
1044
|
if (!event2.currentTarget.contains(event2.relatedTarget) && !(floating && popup.current?.contains(event2.relatedTarget)) && ![...children.current.values()].some((panel) => panel.contains(event2.relatedTarget)))
|
|
985
1045
|
setPath(null);
|
|
986
|
-
}, children: [triggerIcon ? _jsx15(IconButton, { ref: trigger, label, icon: triggerIcon, variant: "icon-ghost-sm", "aria-haspopup": "menu", "aria-controls": id, "aria-expanded": path !== null, disabled: !items.some(isEnabled), onClick: () => path ? close() : open(), onKeyDown: triggerKey }) : _jsx15(Button, { ref: trigger, label, variant: "text-tonal-sm", trailingIcon: "chevron-down", "aria-haspopup": "menu", "aria-controls": id, "aria-expanded": path !== null, disabled: !items.some(isEnabled), onClick: () => path ? close() : open(), onKeyDown: triggerKey }), portalRoot ? createPortal2(menu, portalRoot) : menu] });
|
|
1046
|
+
}, children: [triggerIcon ? _jsx15(IconButton, { ref: trigger, label, icon: triggerIcon, variant: "icon-ghost-sm", "aria-haspopup": "menu", "aria-controls": id, "aria-expanded": path !== null, disabled: !items.some(isEnabled), onClick: () => path ? close() : open(), onKeyDown: triggerKey }) : _jsx15(Button, { ref: trigger, label, variant: textTrigger === "plain" ? "text-plain-sm" : "text-tonal-sm", trailingIcon: textTrigger === "dropdown" ? "chevron-down" : void 0, "aria-haspopup": "menu", "aria-controls": id, "aria-expanded": path !== null, disabled: !items.some(isEnabled), onClick: () => path ? close() : open(), onKeyDown: triggerKey }), portalRoot ? createPortal2(menu, portalRoot) : menu] });
|
|
987
1047
|
}
|
|
988
1048
|
|
|
989
1049
|
// packages/ui-system/dist/filter-menu.js
|
|
990
1050
|
import { jsx as _jsx16, jsxs as _jsxs12, Fragment as _Fragment2 } from "react/jsx-runtime";
|
|
991
|
-
import { useId as useId6, useRef as useRef4, useState as useState6, useLayoutEffect as
|
|
1051
|
+
import { useId as useId6, useRef as useRef4, useState as useState6, useLayoutEffect as useLayoutEffect4 } from "react";
|
|
992
1052
|
function FilterMenu({ label, groups, value, onValueChange, leadingIcon = "filter" }) {
|
|
993
1053
|
const id = useId6();
|
|
994
1054
|
const popup = useRef4(null);
|
|
995
1055
|
const [expanded, setExpanded] = useState6(false);
|
|
996
1056
|
const list = useRef4(null);
|
|
997
1057
|
const [moreBelow, setMoreBelow] = useState6(false);
|
|
998
|
-
|
|
1058
|
+
useLayoutEffect4(() => {
|
|
999
1059
|
const el = list.current;
|
|
1000
1060
|
if (!el || !expanded)
|
|
1001
1061
|
return;
|
|
@@ -1040,10 +1100,10 @@ function FilterMenu({ label, groups, value, onValueChange, leadingIcon = "filter
|
|
|
1040
1100
|
// packages/ui-system/dist/media.js
|
|
1041
1101
|
import { jsx as _jsx17, Fragment as _Fragment3, jsxs as _jsxs13 } from "react/jsx-runtime";
|
|
1042
1102
|
import { useRef as useRef5, useState as useState7 } from "react";
|
|
1043
|
-
function MediaBadges({ label, duration }) {
|
|
1044
|
-
return _jsxs13(_Fragment3, { children: [" ", label && _jsx17("span", { className: "vx-media-label", children: _jsx17(Tag, { children: label }) }), duration && _jsx17("span", { className: "vx-media-duration", children: _jsx17(Tag, { children: duration }) })] });
|
|
1103
|
+
function MediaBadges({ label, duration, labelVariant }) {
|
|
1104
|
+
return _jsxs13(_Fragment3, { children: [" ", label && _jsx17("span", { className: labelVariant === "selected" ? "vx-media-selected" : "vx-media-label", children: _jsx17(Tag, { variant: labelVariant, children: label }) }), duration && _jsx17("span", { className: "vx-media-duration", children: _jsx17(Tag, { children: duration }) })] });
|
|
1045
1105
|
}
|
|
1046
|
-
function Media({ src, videoSrc, emptyLabel, script, alt, ratio: ratio2 = "16:9", state = "default", fit = "cover", emptyAppearance = "black", crop, label, duration, selectedLabel, selectionStyle = "outline", onSelect, onOpen }) {
|
|
1106
|
+
function Media({ src, videoSrc, emptyLabel, script, alt, ratio: ratio2 = "16:9", state = "default", fit = "cover", emptyAppearance = "black", crop, label, labelVariant, duration, selectedLabel, selectionStyle = "outline", onSelect, onOpen }) {
|
|
1047
1107
|
const [failedImage, setFailedImage] = useState7();
|
|
1048
1108
|
const [failedVideo, setFailedVideo] = useState7();
|
|
1049
1109
|
const image = src !== failedImage ? src : void 0;
|
|
@@ -1059,7 +1119,7 @@ function Media({ src, videoSrc, emptyLabel, script, alt, ratio: ratio2 = "16:9",
|
|
|
1059
1119
|
transform: `rotate(${crop.rotation ?? 0}deg)`,
|
|
1060
1120
|
objectFit: "fill"
|
|
1061
1121
|
} : { objectFit: fit };
|
|
1062
|
-
const content = _jsxs13(_Fragment3, { children: [script ? _jsx17(ScriptCover, { ...script }) : image ? _jsx17("img", { src: image, alt, style: imageStyle, onError: () => setFailedImage(image) }, image) : video ? _jsx17("video", { src: video, preload: "metadata", muted: true, playsInline: true, "aria-hidden": "true", style: { objectFit: fit }, onError: () => setFailedVideo(video) }, video) : emptyAppearance !== "black" && emptyAppearance !== "surface" ? _jsx17(Icon, { name: `placeholder-${emptyAppearance}`, size: 20 }) : emptyLabel && !busy ? _jsx17("span", { className: "vx-media-empty-label", children: emptyLabel }) : null, _jsx17(MediaBadges, { label, duration }), selected && selectedLabel && _jsx17("span", { className: "vx-media-selected", children: _jsx17(Tag, { variant: "selected", children: "Selected" }) }), selectionStyle === "checkbox" && _jsx17("span", { className: "vx-media-marker", "aria-hidden": "true", children: selected && _jsx17(Icon, { name: "check", size: 12 }) }), busy && _jsx17("span", { className: "vx-media-progress", role: "status", children: state === "loading" ? "Loading" : "Generating" })] });
|
|
1122
|
+
const content = _jsxs13(_Fragment3, { children: [script ? _jsx17(ScriptCover, { ...script }) : image ? _jsx17("img", { src: image, alt, style: imageStyle, onError: () => setFailedImage(image) }, image) : video ? _jsx17("video", { src: video, preload: "metadata", muted: true, playsInline: true, "aria-hidden": "true", style: { objectFit: fit }, onError: () => setFailedVideo(video) }, video) : emptyAppearance !== "black" && emptyAppearance !== "surface" ? _jsx17(Icon, { name: `placeholder-${emptyAppearance}`, size: 20 }) : emptyLabel && !busy ? _jsx17("span", { className: "vx-media-empty-label", children: emptyLabel }) : null, _jsx17(MediaBadges, { label, labelVariant, duration }), selected && selectedLabel && _jsx17("span", { className: "vx-media-selected", children: _jsx17(Tag, { variant: "selected", children: "Selected" }) }), selectionStyle === "checkbox" && _jsx17("span", { className: "vx-media-marker", "aria-hidden": "true", children: selected && _jsx17(Icon, { name: "check", size: 12 }) }), busy && _jsx17("span", { className: "vx-media-progress", role: "status", children: state === "loading" ? "Loading" : "Generating" })] });
|
|
1063
1123
|
const props = {
|
|
1064
1124
|
className: "vx-media",
|
|
1065
1125
|
"data-state": state,
|
|
@@ -1087,7 +1147,7 @@ function PlaybackControls({ playing, muted, time, duration, size = "medium", dis
|
|
|
1087
1147
|
function VideoPlayer(props) {
|
|
1088
1148
|
return _jsx18(Playback, { ...props }, JSON.stringify([props.src, props.poster, props.posterDuration]));
|
|
1089
1149
|
}
|
|
1090
|
-
function Playback({ src, poster, aspectRatio, posterDuration = 0, title, version, durationLabel, sceneLabel, defaultMuted = false, controlsPlacement = "overlay", fitContent = false, controlsSize, timeDisplay, controlsActions, showFullscreen = true, fullscreenMode = "native", overlay, onBeforePlay, onStateChange, onTimeChange, onEnded, onError }) {
|
|
1150
|
+
function Playback({ src, poster, aspectRatio, posterDuration = 0, title, version, durationLabel, sceneLabel, defaultMuted = false, controlsPlacement = "overlay", fitContent = false, showCoverInfo = true, showCoverPlay = true, fitExpandedContent = false, controlsSize, controlsAppearance, timeDisplay, controlsActions, showFullscreen = true, fullscreenMode = "native", overlay, onBeforePlay, onStateChange, onTimeChange, onEnded, onError }) {
|
|
1091
1151
|
const root = useRef6(null);
|
|
1092
1152
|
const video = useRef6(null);
|
|
1093
1153
|
const position = useRef6(0);
|
|
@@ -1099,6 +1159,13 @@ function Playback({ src, poster, aspectRatio, posterDuration = 0, title, version
|
|
|
1099
1159
|
const [muted, setMuted] = useState8(defaultMuted);
|
|
1100
1160
|
const [expanded, setExpanded] = useState8(false);
|
|
1101
1161
|
const [inlineHeight, setInlineHeight] = useState8();
|
|
1162
|
+
const restoreFocus = useRef6(false);
|
|
1163
|
+
useEffect4(() => {
|
|
1164
|
+
if (!expanded && restoreFocus.current) {
|
|
1165
|
+
restoreFocus.current = false;
|
|
1166
|
+
root.current?.querySelector('button[aria-label="Expand video"]')?.focus();
|
|
1167
|
+
}
|
|
1168
|
+
}, [expanded]);
|
|
1102
1169
|
const restore = useRef6(void 0);
|
|
1103
1170
|
const stillDuration = poster && Number.isFinite(posterDuration) ? Math.max(0, posterDuration) : 0;
|
|
1104
1171
|
const duration = src ? metadataDuration : stillDuration;
|
|
@@ -1195,17 +1262,20 @@ function Playback({ src, poster, aspectRatio, posterDuration = 0, title, version
|
|
|
1195
1262
|
};
|
|
1196
1263
|
if (next)
|
|
1197
1264
|
setInlineHeight(root.current?.getBoundingClientRect().height);
|
|
1265
|
+
else
|
|
1266
|
+
restoreFocus.current = true;
|
|
1198
1267
|
element?.pause();
|
|
1199
1268
|
setExpanded(next);
|
|
1200
1269
|
}
|
|
1201
|
-
const
|
|
1270
|
+
const fitted = fitContent || expanded && fitExpandedContent;
|
|
1271
|
+
const player = _jsxs14("section", { ref: root, className: "vx-video-player", "aria-label": title, "data-fit": fitted ? "content" : void 0, style: fitted ? { "--vx-video-ratio": aspectRatio ?? ratio2 } : void 0, "data-placement": controlsPlacement, "data-controls-size": controlsSize, "data-state": state, children: [_jsxs14("div", { className: "vx-video-stage", style: aspectRatio ? { aspectRatio } : void 0, children: [src ? _jsx18("video", { ref: video, src, poster, muted, playsInline: true, preload: "metadata", onResize: (event2) => {
|
|
1202
1272
|
const { videoWidth, videoHeight } = event2.currentTarget;
|
|
1203
|
-
if (
|
|
1273
|
+
if (videoWidth && videoHeight)
|
|
1204
1274
|
setRatio(videoWidth / videoHeight);
|
|
1205
1275
|
}, onLoadedMetadata: (event2) => {
|
|
1206
1276
|
const element = event2.currentTarget;
|
|
1207
1277
|
const { videoWidth, videoHeight } = element;
|
|
1208
|
-
if (
|
|
1278
|
+
if (videoWidth && videoHeight)
|
|
1209
1279
|
setRatio(videoWidth / videoHeight);
|
|
1210
1280
|
const previous = restore.current;
|
|
1211
1281
|
if (!previous)
|
|
@@ -1228,8 +1298,11 @@ function Playback({ src, poster, aspectRatio, posterDuration = 0, title, version
|
|
|
1228
1298
|
}, onTimeUpdate: (event2) => {
|
|
1229
1299
|
if (!restore.current)
|
|
1230
1300
|
updateTime(event2.currentTarget.currentTime);
|
|
1231
|
-
}, onEnded, onError: (event2) =>
|
|
1232
|
-
|
|
1301
|
+
}, onEnded, onError: (event2) => {
|
|
1302
|
+
if (event2.currentTarget.error)
|
|
1303
|
+
onError?.(event2.currentTarget.error);
|
|
1304
|
+
} }) : poster && _jsx18("img", { src: poster, alt: "" }), overlay, state === "cover" && !fitted && _jsxs14("div", { className: "vx-video-cover", "data-plain": !showCoverInfo || void 0, children: [showCoverInfo && _jsxs14("div", { className: "vx-video-info", children: [_jsxs14("div", { className: "vx-video-title", children: [_jsx18("strong", { title, children: title }), version && _jsx18(Tag, { children: version })] }), (durationLabel || sceneLabel) && _jsxs14("div", { className: "vx-video-meta", children: [durationLabel && _jsx18("span", { children: durationLabel }), durationLabel && sceneLabel && _jsx18("span", { "aria-hidden": "true", children: "\xB7" }), sceneLabel && _jsx18("span", { children: sceneLabel })] })] }), showCoverPlay && (src || duration > 0) && _jsx18(IconButton, { icon: "play-cover", className: "vx-video-start", label: `Play ${title}`, variant: "icon-circle-lg", onClick: togglePlay })] })] }), _jsx18(PlaybackControls, { playing: state === "playing", muted, time: Math.min(time, duration), duration, disabled: !src && !duration, size: controlsSize, appearance: controlsAppearance, timeDisplay, actions: controlsActions, onTogglePlay: togglePlay, onToggleMute: () => setMuted(!muted), onSeek: seek, onFullscreen: showFullscreen && !(expanded && fitExpandedContent) ? () => void toggleFullscreen() : void 0, fullscreenLabel: fullscreenMode === "dialog" ? expanded ? "Close expanded video" : "Expand video" : void 0 })] });
|
|
1305
|
+
return _jsxs14(_Fragment4, { children: [expanded ? _jsx18("div", { "aria-hidden": "true", style: { height: inlineHeight } }) : player, _jsx18(Dialog, { title, open: expanded, onOpenChange: changeExpanded, className: fitExpandedContent ? "vx-video-dialog vx-video-dialog-fit" : "vx-video-dialog", children: expanded && player })] });
|
|
1233
1306
|
}
|
|
1234
1307
|
|
|
1235
1308
|
// packages/ui-system/dist/workspace-theme.js
|
|
@@ -1273,8 +1346,245 @@ function useWorkspaceTheme() {
|
|
|
1273
1346
|
return { theme: preference === "system" ? system : preference, preference, update };
|
|
1274
1347
|
}
|
|
1275
1348
|
|
|
1349
|
+
// packages/studio-workbench/src/project-frame.tsx
|
|
1350
|
+
import * as React from "react";
|
|
1351
|
+
function ProjectSkeleton({ view }) {
|
|
1352
|
+
const layout = view === "compare" ? "compare" : !view || ["preview", "episode", "overview"].includes(view) ? "preview" : "list";
|
|
1353
|
+
return /* @__PURE__ */ React.createElement(
|
|
1354
|
+
"section",
|
|
1355
|
+
{
|
|
1356
|
+
className: "studio-project-skeleton",
|
|
1357
|
+
role: "status",
|
|
1358
|
+
"aria-label": "Loading project",
|
|
1359
|
+
"data-layout": layout
|
|
1360
|
+
},
|
|
1361
|
+
/* @__PURE__ */ React.createElement("div", { className: "studio-skeleton-title", "aria-hidden": "true" }),
|
|
1362
|
+
/* @__PURE__ */ React.createElement("div", { className: "studio-skeleton-panels", "aria-hidden": "true" }, Array.from(
|
|
1363
|
+
{ length: layout === "compare" ? 4 : layout === "preview" ? 3 : 1 },
|
|
1364
|
+
(_, column2) => /* @__PURE__ */ React.createElement("div", { key: column2, className: "studio-skeleton-panel" }, layout !== "list" && /* @__PURE__ */ React.createElement("div", { className: "studio-skeleton-cover" }), Array.from({ length: layout === "list" ? 7 : 4 }, (_2, row) => /* @__PURE__ */ React.createElement("div", { className: "studio-skeleton-line", key: row })))
|
|
1365
|
+
))
|
|
1366
|
+
);
|
|
1367
|
+
}
|
|
1368
|
+
function ProjectFrame({
|
|
1369
|
+
frame,
|
|
1370
|
+
src,
|
|
1371
|
+
view
|
|
1372
|
+
}) {
|
|
1373
|
+
const [ready, setReady] = React.useState(false);
|
|
1374
|
+
React.useEffect(() => {
|
|
1375
|
+
const element = frame.current;
|
|
1376
|
+
if (!element) return;
|
|
1377
|
+
let observer;
|
|
1378
|
+
function observe() {
|
|
1379
|
+
observer?.disconnect();
|
|
1380
|
+
const doc = element?.contentDocument;
|
|
1381
|
+
if (doc?.URL === "about:blank") return;
|
|
1382
|
+
const root = doc?.getElementById("app");
|
|
1383
|
+
if (!root) {
|
|
1384
|
+
setReady(true);
|
|
1385
|
+
return;
|
|
1386
|
+
}
|
|
1387
|
+
function inspect() {
|
|
1388
|
+
const complete = Boolean(root?.childElementCount || root?.getAttribute("role") === "alert");
|
|
1389
|
+
setReady(complete);
|
|
1390
|
+
if (complete) observer?.disconnect();
|
|
1391
|
+
}
|
|
1392
|
+
observer = new MutationObserver(inspect);
|
|
1393
|
+
observer.observe(root, { childList: true, attributes: true, attributeFilter: ["role"] });
|
|
1394
|
+
inspect();
|
|
1395
|
+
}
|
|
1396
|
+
element.addEventListener("load", observe);
|
|
1397
|
+
observe();
|
|
1398
|
+
return () => {
|
|
1399
|
+
observer?.disconnect();
|
|
1400
|
+
element.removeEventListener("load", observe);
|
|
1401
|
+
};
|
|
1402
|
+
}, [frame]);
|
|
1403
|
+
return /* @__PURE__ */ React.createElement("div", { className: "studio-frame-stage" }, /* @__PURE__ */ React.createElement(
|
|
1404
|
+
"iframe",
|
|
1405
|
+
{
|
|
1406
|
+
ref: frame,
|
|
1407
|
+
className: "studio-project-frame",
|
|
1408
|
+
title: "Project workbench",
|
|
1409
|
+
src,
|
|
1410
|
+
allowFullScreen: true,
|
|
1411
|
+
style: { visibility: ready ? "visible" : "hidden" }
|
|
1412
|
+
}
|
|
1413
|
+
), !ready && /* @__PURE__ */ React.createElement(ProjectSkeleton, { view }));
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1276
1416
|
// packages/studio-workbench/src/query-view.ts
|
|
1417
|
+
import { z as z5 } from "vivix-studio/sdk/shared";
|
|
1418
|
+
|
|
1419
|
+
// packages/project-studio/src/cost.ts
|
|
1420
|
+
function taskCostLabel(task) {
|
|
1421
|
+
const cost = task.cost;
|
|
1422
|
+
if (cost?.status === "settled" && cost.credits != null) return `${cost.credits} credits`;
|
|
1423
|
+
if (cost?.status === "pending") return "Pending settlement";
|
|
1424
|
+
return "-";
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
// packages/project-studio/src/shared.ts
|
|
1428
|
+
import { z as z4, defineOperation } from "vivix-studio/sdk/shared";
|
|
1429
|
+
|
|
1430
|
+
// packages/project-studio/src/ads-shared.ts
|
|
1277
1431
|
import { z as z3 } from "vivix-studio/sdk/shared";
|
|
1432
|
+
var fixedRef = z3.object({ storeId: z3.uuid(), objectId: z3.uuid(), versionId: z3.uuid() }).strict();
|
|
1433
|
+
var copy = z3.string().max(8e3).default("");
|
|
1434
|
+
var clipScript = z3.object({
|
|
1435
|
+
title: z3.string().trim().min(1).max(200),
|
|
1436
|
+
visual: copy,
|
|
1437
|
+
voiceover: copy,
|
|
1438
|
+
onScreenText: copy,
|
|
1439
|
+
cta: copy,
|
|
1440
|
+
plannedDurationMs: z3.number().int().positive().nullable().default(null)
|
|
1441
|
+
}).strict();
|
|
1442
|
+
var adBrief = z3.object({
|
|
1443
|
+
product: copy,
|
|
1444
|
+
category: copy,
|
|
1445
|
+
audience: copy,
|
|
1446
|
+
sellingPoints: copy,
|
|
1447
|
+
channel: copy,
|
|
1448
|
+
aspectRatio: z3.string().max(40).nullable().default(null),
|
|
1449
|
+
targetDurationMs: z3.number().int().positive().nullable().default(null),
|
|
1450
|
+
body: copy,
|
|
1451
|
+
productRefs: z3.array(fixedRef).max(100).default([]),
|
|
1452
|
+
modelRefs: z3.array(fixedRef).max(100).default([])
|
|
1453
|
+
}).strict();
|
|
1454
|
+
var adFilm = z3.object({
|
|
1455
|
+
title: z3.string().trim().min(1).max(150),
|
|
1456
|
+
source: fixedRef,
|
|
1457
|
+
width: z3.number().int().positive().max(8192),
|
|
1458
|
+
height: z3.number().int().positive().max(8192),
|
|
1459
|
+
aspectRatio: z3.string().regex(/^\d+:\d+$/)
|
|
1460
|
+
}).strict();
|
|
1461
|
+
var adStoryboard = z3.object({
|
|
1462
|
+
brief: adBrief,
|
|
1463
|
+
films: z3.array(adFilm).max(100).optional(),
|
|
1464
|
+
clips: z3.array(
|
|
1465
|
+
z3.object({
|
|
1466
|
+
assetId: z3.uuid(),
|
|
1467
|
+
filmId: z3.uuid().optional(),
|
|
1468
|
+
script: clipScript,
|
|
1469
|
+
edits: z3.array(z3.object({ sourceVersionId: z3.uuid(), editRef: fixedRef }).strict()).max(200)
|
|
1470
|
+
}).strict()
|
|
1471
|
+
).max(200)
|
|
1472
|
+
}).strict().superRefine((value, context) => {
|
|
1473
|
+
if (new Set(value.clips.map((c) => c.assetId)).size !== value.clips.length)
|
|
1474
|
+
context.addIssue({ code: "custom", message: "A clip can appear only once in a storyboard." });
|
|
1475
|
+
for (const clip of value.clips)
|
|
1476
|
+
if (new Set(clip.edits.map((e) => e.sourceVersionId)).size !== clip.edits.length)
|
|
1477
|
+
context.addIssue({
|
|
1478
|
+
code: "custom",
|
|
1479
|
+
message: "Each candidate has one current edit binding."
|
|
1480
|
+
});
|
|
1481
|
+
});
|
|
1482
|
+
|
|
1483
|
+
// packages/project-studio/src/shared.ts
|
|
1484
|
+
var projectType = z4.enum(["short-drama", "product-ad", "other"]);
|
|
1485
|
+
var studioConfig = z4.object({
|
|
1486
|
+
role: z4.enum(["project", "coordinator"]).default("project"),
|
|
1487
|
+
projectType: projectType.optional(),
|
|
1488
|
+
dataInstance: z4.string().min(1).default("user:data"),
|
|
1489
|
+
apiInstance: z4.string().min(1).default("api"),
|
|
1490
|
+
libraryInstance: z4.string().min(1).nullable().default(null),
|
|
1491
|
+
coordinatorInstance: z4.string().min(1).optional()
|
|
1492
|
+
}).strict();
|
|
1493
|
+
var versionRef = z4.object({ storeId: z4.uuid(), objectId: z4.uuid(), versionId: z4.uuid() }).strict();
|
|
1494
|
+
var tags = z4.array(z4.string().trim().min(1).max(64)).max(50).transform((x) => [...new Set(x)]).default([]);
|
|
1495
|
+
var kind = z4.enum(["text", "image", "video", "audio", "file"]);
|
|
1496
|
+
var projectData = z4.object({
|
|
1497
|
+
name: z4.string().trim().min(1).max(120),
|
|
1498
|
+
description: z4.string().max(4e3).default(""),
|
|
1499
|
+
status: z4.enum(["draft", "active", "archived"]).default("draft"),
|
|
1500
|
+
aspectRatio: z4.string().nullable().default(null),
|
|
1501
|
+
projectType: projectType.optional(),
|
|
1502
|
+
coverRef: versionRef.nullable().default(null),
|
|
1503
|
+
briefRef: z4.object({ storeId: z4.uuid(), objectId: z4.uuid() }).strict().nullable().default(null),
|
|
1504
|
+
tags
|
|
1505
|
+
}).strict();
|
|
1506
|
+
var assetData = z4.object({
|
|
1507
|
+
projectId: z4.uuid(),
|
|
1508
|
+
name: z4.string().trim().min(1).max(200),
|
|
1509
|
+
kind,
|
|
1510
|
+
purpose: z4.enum(["reference", "script", "shot", "music", "voice", "subtitle", "final", "other"]).default("other"),
|
|
1511
|
+
origin: z4.enum(["upload", "library", "generated", "authored"]),
|
|
1512
|
+
orderKey: z4.number().int().nullable().default(null),
|
|
1513
|
+
tags,
|
|
1514
|
+
lifecycle: z4.enum(["draft", "ready", "archived"]).default("draft"),
|
|
1515
|
+
sourceRef: versionRef.nullable().default(null),
|
|
1516
|
+
adoptedVersionId: z4.uuid().nullable().default(null)
|
|
1517
|
+
}).strict();
|
|
1518
|
+
var anchor = z4.discriminatedUnion("kind", [
|
|
1519
|
+
z4.object({ kind: z4.literal("whole") }).strict(),
|
|
1520
|
+
z4.object({
|
|
1521
|
+
kind: z4.literal("timeRange"),
|
|
1522
|
+
startMs: z4.number().int().nonnegative(),
|
|
1523
|
+
endMs: z4.number().int().nonnegative()
|
|
1524
|
+
}).strict()
|
|
1525
|
+
]);
|
|
1526
|
+
var generationInput = z4.object({
|
|
1527
|
+
targetAssetId: z4.uuid().optional(),
|
|
1528
|
+
taskName: z4.string().trim().min(1).max(200).optional(),
|
|
1529
|
+
context: z4.record(z4.string().min(1).max(64), z4.string().min(1).max(200)).optional(),
|
|
1530
|
+
expectedRevision: z4.number().int().positive().optional(),
|
|
1531
|
+
newAsset: z4.object({
|
|
1532
|
+
name: z4.string().trim().min(1).max(200),
|
|
1533
|
+
kind: z4.enum(["image", "video", "audio"])
|
|
1534
|
+
}).strict().optional(),
|
|
1535
|
+
modelId: z4.string().min(1),
|
|
1536
|
+
capabilityId: z4.string().min(1),
|
|
1537
|
+
prompt: z4.string().max(32e3),
|
|
1538
|
+
parameters: z4.record(z4.string(), z4.unknown()).default({}),
|
|
1539
|
+
outputCount: z4.number().int().min(1).max(100).default(1),
|
|
1540
|
+
inputs: z4.array(
|
|
1541
|
+
z4.object({
|
|
1542
|
+
ref: versionRef,
|
|
1543
|
+
role: z4.string().min(1),
|
|
1544
|
+
order: z4.number().int().nonnegative(),
|
|
1545
|
+
weight: z4.number().finite().nullable().default(null)
|
|
1546
|
+
}).strict()
|
|
1547
|
+
).max(100).default([]),
|
|
1548
|
+
baseVersionId: z4.uuid().optional(),
|
|
1549
|
+
changeRequest: z4.string().trim().min(1).max(4e3).optional(),
|
|
1550
|
+
preserveRequest: z4.string().max(4e3).default(""),
|
|
1551
|
+
anchor: anchor.default({ kind: "whole" }),
|
|
1552
|
+
retryOfTaskId: z4.uuid().optional(),
|
|
1553
|
+
acknowledgeUnknown: z4.boolean().optional()
|
|
1554
|
+
}).strict();
|
|
1555
|
+
var projectSettingsInput = z4.object({
|
|
1556
|
+
projectId: z4.uuid(),
|
|
1557
|
+
expectedRevision: z4.number().int().positive(),
|
|
1558
|
+
changes: projectData.pick({ name: true, description: true, tags: true, aspectRatio: true, coverRef: true }).extend({
|
|
1559
|
+
description: projectData.shape.description.unwrap(),
|
|
1560
|
+
tags: projectData.shape.tags.unwrap(),
|
|
1561
|
+
aspectRatio: projectData.shape.aspectRatio.unwrap(),
|
|
1562
|
+
coverRef: projectData.shape.coverRef.unwrap()
|
|
1563
|
+
}).partial().strict()
|
|
1564
|
+
}).strict();
|
|
1565
|
+
var generationSubmitOperation = defineOperation({
|
|
1566
|
+
id: "generation.submit",
|
|
1567
|
+
title: "Generate",
|
|
1568
|
+
description: "Submit one media generation without approval, retaining its paid request identity.",
|
|
1569
|
+
input: generationInput,
|
|
1570
|
+
output: z4.any(),
|
|
1571
|
+
effects: ["write", "paid"],
|
|
1572
|
+
confirm: "none"
|
|
1573
|
+
});
|
|
1574
|
+
var favoriteData = z4.object({ ref: versionRef }).strict();
|
|
1575
|
+
var sqlScalar = z4.union([z4.string(), z4.number().finite(), z4.null()]);
|
|
1576
|
+
var globalQueryInput = z4.object({
|
|
1577
|
+
sql: z4.string().trim().min(1),
|
|
1578
|
+
params: z4.union([z4.array(sqlScalar), z4.record(z4.string(), sqlScalar)]).optional(),
|
|
1579
|
+
timeoutMs: z4.number().int().positive().optional(),
|
|
1580
|
+
maxRows: z4.number().int().positive().optional(),
|
|
1581
|
+
limit: z4.number().int().min(1).max(200).optional(),
|
|
1582
|
+
offset: z4.number().int().nonnegative().optional(),
|
|
1583
|
+
source: z4.enum(["projects", "assets", "tasks"]),
|
|
1584
|
+
excludeProjectIds: z4.array(z4.uuid()).optional(),
|
|
1585
|
+
catalog: z4.array(z4.object({ id: z4.string().min(1), name: z4.string(), available: z4.boolean() }).strict()).optional()
|
|
1586
|
+
}).strict();
|
|
1587
|
+
var projectListSql = "SELECT rowId, projectId, name, available, createdAt, coverRef FROM studio_projects ORDER BY createdAt DESC, rowId ASC";
|
|
1278
1588
|
|
|
1279
1589
|
// packages/studio-workbench/src/view-common.ts
|
|
1280
1590
|
var pageSources = ["projects", "assets", "tasks"];
|
|
@@ -1288,28 +1598,28 @@ function supportedImport(file) {
|
|
|
1288
1598
|
}
|
|
1289
1599
|
|
|
1290
1600
|
// packages/studio-workbench/src/query-view.ts
|
|
1291
|
-
var columnName =
|
|
1292
|
-
var scalar =
|
|
1293
|
-
var customViewSchema =
|
|
1294
|
-
source:
|
|
1295
|
-
projectId:
|
|
1296
|
-
name:
|
|
1297
|
-
sql:
|
|
1298
|
-
params:
|
|
1299
|
-
columns:
|
|
1300
|
-
|
|
1601
|
+
var columnName = z5.string().min(1).max(200).refine((value) => !/[\u0000-\u001f]/.test(value));
|
|
1602
|
+
var scalar = z5.union([z5.null(), z5.string(), z5.number().finite()]);
|
|
1603
|
+
var customViewSchema = z5.object({
|
|
1604
|
+
source: z5.enum(pageSources),
|
|
1605
|
+
projectId: z5.uuid().optional(),
|
|
1606
|
+
name: z5.string().trim().min(1).max(120),
|
|
1607
|
+
sql: z5.string().trim().min(1).max(32e3),
|
|
1608
|
+
params: z5.union([z5.array(scalar), z5.record(z5.string(), scalar)]).default([]),
|
|
1609
|
+
columns: z5.array(
|
|
1610
|
+
z5.object({
|
|
1301
1611
|
path: columnName,
|
|
1302
|
-
label:
|
|
1303
|
-
width:
|
|
1304
|
-
visible:
|
|
1305
|
-
format:
|
|
1306
|
-
role:
|
|
1612
|
+
label: z5.string().min(1).max(120).optional(),
|
|
1613
|
+
width: z5.number().int().min(80).max(600).default(140),
|
|
1614
|
+
visible: z5.boolean().default(true),
|
|
1615
|
+
format: z5.enum(["text", "categories", "date", "json"]).default("text"),
|
|
1616
|
+
role: z5.enum(["name", "preview", "state", "project"]).optional()
|
|
1307
1617
|
}).strict()
|
|
1308
1618
|
).min(1).max(60).refine(
|
|
1309
1619
|
(columns) => new Set(columns.map((c) => c.path)).size === columns.length,
|
|
1310
1620
|
"Column names must be unique."
|
|
1311
1621
|
),
|
|
1312
|
-
identity:
|
|
1622
|
+
identity: z5.object({
|
|
1313
1623
|
row: columnName.default("rowId"),
|
|
1314
1624
|
project: columnName.default("projectId"),
|
|
1315
1625
|
ref: columnName.default("ref"),
|
|
@@ -1331,7 +1641,7 @@ var assetCategories = [
|
|
|
1331
1641
|
["audio", "Audio", "kind", "audio"],
|
|
1332
1642
|
["script", "Script", "purpose", "script"],
|
|
1333
1643
|
["character", "Characters", "subjectType", "Character"],
|
|
1334
|
-
["scene", "
|
|
1644
|
+
["scene", "Shots", "subjectType", "Scene"],
|
|
1335
1645
|
["product", "Products", "subjectType", "Product"],
|
|
1336
1646
|
["model", "Models", "subjectType", "Model"]
|
|
1337
1647
|
];
|
|
@@ -1366,13 +1676,15 @@ function assetBrowseQuery(viewId, filter) {
|
|
|
1366
1676
|
function projectBrowseQuery(viewId, types) {
|
|
1367
1677
|
const category = projectCategories.find(([id]) => viewId === `default:projects:${id}`)?.[0];
|
|
1368
1678
|
return {
|
|
1369
|
-
sql: "SELECT
|
|
1679
|
+
sql: projectListSql.replace("SELECT ", "SELECT projectType, ").replace(
|
|
1680
|
+
" ORDER BY",
|
|
1681
|
+
" WHERE (:category = '' OR projectType = :category) AND projectType IN (SELECT value FROM json_each(:types)) ORDER BY"
|
|
1682
|
+
),
|
|
1370
1683
|
params: { category: category ?? "", types: JSON.stringify(types) }
|
|
1371
1684
|
};
|
|
1372
1685
|
}
|
|
1373
1686
|
function defaultSql(source, favorites = false, conditions = []) {
|
|
1374
|
-
if (source === "projects")
|
|
1375
|
-
return "SELECT * FROM studio_projects ORDER BY createdAt DESC, rowId ASC";
|
|
1687
|
+
if (source === "projects") return projectListSql;
|
|
1376
1688
|
const table = favorites ? "studio_asset_versions" : `studio_${source}`;
|
|
1377
1689
|
const filters = [...favorites ? ["a.favorite = 1"] : [], ...conditions];
|
|
1378
1690
|
return `SELECT a.*, p.name AS projectName, p.available AS projectAvailable FROM ${table} AS a LEFT JOIN studio_projects AS p ON p.projectId = a.projectId${filters.length ? " WHERE " + filters.join(" AND ") : ""} ORDER BY a.createdAt DESC, a.rowId ASC`;
|
|
@@ -1382,7 +1694,6 @@ function defaultView(source) {
|
|
|
1382
1694
|
column("previewUrl", "Preview", 120, { role: "preview" }),
|
|
1383
1695
|
column("name", "Project title", 260, { role: "name" }),
|
|
1384
1696
|
column("projectType", "Type", 140),
|
|
1385
|
-
column("assetCount", "Assets", 120),
|
|
1386
1697
|
column("available", "Available", 120, { visible: false }),
|
|
1387
1698
|
column("createdAt", "Created Time", 160, { format: "date" })
|
|
1388
1699
|
] : source === "assets" ? [
|
|
@@ -1392,7 +1703,7 @@ function defaultView(source) {
|
|
|
1392
1703
|
column("kind", "Format", 112),
|
|
1393
1704
|
column("refs", "Reference", 112),
|
|
1394
1705
|
column("prompt", "Prompt", 128),
|
|
1395
|
-
column("scene", "
|
|
1706
|
+
column("scene", "Shot", 80),
|
|
1396
1707
|
column("aspectRatio", "Aspect Ratio", 112),
|
|
1397
1708
|
column("modelId", "Model", 112),
|
|
1398
1709
|
column("createdAt", "Created Time", 116, { format: "date" }),
|
|
@@ -1509,7 +1820,7 @@ function rowTitle(row, view) {
|
|
|
1509
1820
|
return String(row[field] ?? row[view.identity.row] ?? "Untitled");
|
|
1510
1821
|
}
|
|
1511
1822
|
function columnText(value, format = "text") {
|
|
1512
|
-
if (value
|
|
1823
|
+
if (value == null || typeof value === "string" && !value.trim()) return "--";
|
|
1513
1824
|
if (format === "date") {
|
|
1514
1825
|
const date2 = new Date(String(value));
|
|
1515
1826
|
return Number.isNaN(date2.getTime()) ? String(value) : date2.toLocaleString("en-US", {
|
|
@@ -1600,7 +1911,7 @@ var categories = [
|
|
|
1600
1911
|
["Audio", "format", "audio"],
|
|
1601
1912
|
["Script", "format", "text"],
|
|
1602
1913
|
["Characters", "subject", "character"],
|
|
1603
|
-
["
|
|
1914
|
+
["Shots", "subject", "scene"],
|
|
1604
1915
|
["Products", "subject", "product"],
|
|
1605
1916
|
["Models", "subject", "model"]
|
|
1606
1917
|
];
|
|
@@ -1677,178 +1988,9 @@ function categoryViews(source) {
|
|
|
1677
1988
|
}
|
|
1678
1989
|
|
|
1679
1990
|
// packages/studio-workbench/src/global-workbench.tsx
|
|
1680
|
-
import * as
|
|
1991
|
+
import * as React8 from "react";
|
|
1681
1992
|
import { z as z7 } from "vivix-studio/sdk/shared";
|
|
1682
1993
|
|
|
1683
|
-
// packages/project-studio/src/cost.ts
|
|
1684
|
-
function taskCostLabel(task) {
|
|
1685
|
-
const cost = task.cost;
|
|
1686
|
-
if (cost?.status === "settled" && cost.credits != null) return `${cost.credits} credits`;
|
|
1687
|
-
if (cost?.status === "pending") return "Pending settlement";
|
|
1688
|
-
return "-";
|
|
1689
|
-
}
|
|
1690
|
-
|
|
1691
|
-
// packages/project-studio/src/shared.ts
|
|
1692
|
-
import { z as z5, defineOperation } from "vivix-studio/sdk/shared";
|
|
1693
|
-
|
|
1694
|
-
// packages/project-studio/src/ads-shared.ts
|
|
1695
|
-
import { z as z4 } from "vivix-studio/sdk/shared";
|
|
1696
|
-
var fixedRef = z4.object({ storeId: z4.uuid(), objectId: z4.uuid(), versionId: z4.uuid() }).strict();
|
|
1697
|
-
var copy = z4.string().max(8e3).default("");
|
|
1698
|
-
var clipScript = z4.object({
|
|
1699
|
-
title: z4.string().trim().min(1).max(200),
|
|
1700
|
-
visual: copy,
|
|
1701
|
-
voiceover: copy,
|
|
1702
|
-
onScreenText: copy,
|
|
1703
|
-
cta: copy,
|
|
1704
|
-
plannedDurationMs: z4.number().int().positive().nullable().default(null)
|
|
1705
|
-
}).strict();
|
|
1706
|
-
var adBrief = z4.object({
|
|
1707
|
-
product: copy,
|
|
1708
|
-
category: copy,
|
|
1709
|
-
audience: copy,
|
|
1710
|
-
sellingPoints: copy,
|
|
1711
|
-
channel: copy,
|
|
1712
|
-
aspectRatio: z4.string().max(40).nullable().default(null),
|
|
1713
|
-
targetDurationMs: z4.number().int().positive().nullable().default(null),
|
|
1714
|
-
body: copy,
|
|
1715
|
-
productRefs: z4.array(fixedRef).max(100).default([]),
|
|
1716
|
-
modelRefs: z4.array(fixedRef).max(100).default([])
|
|
1717
|
-
}).strict();
|
|
1718
|
-
var adFilm = z4.object({
|
|
1719
|
-
title: z4.string().trim().min(1).max(150),
|
|
1720
|
-
source: fixedRef,
|
|
1721
|
-
width: z4.number().int().positive().max(8192),
|
|
1722
|
-
height: z4.number().int().positive().max(8192),
|
|
1723
|
-
aspectRatio: z4.string().regex(/^\d+:\d+$/)
|
|
1724
|
-
}).strict();
|
|
1725
|
-
var adStoryboard = z4.object({
|
|
1726
|
-
brief: adBrief,
|
|
1727
|
-
films: z4.array(adFilm).max(100).optional(),
|
|
1728
|
-
clips: z4.array(
|
|
1729
|
-
z4.object({
|
|
1730
|
-
assetId: z4.uuid(),
|
|
1731
|
-
filmId: z4.uuid().optional(),
|
|
1732
|
-
script: clipScript,
|
|
1733
|
-
edits: z4.array(z4.object({ sourceVersionId: z4.uuid(), editRef: fixedRef }).strict()).max(200)
|
|
1734
|
-
}).strict()
|
|
1735
|
-
).max(200)
|
|
1736
|
-
}).strict().superRefine((value, context) => {
|
|
1737
|
-
if (new Set(value.clips.map((c) => c.assetId)).size !== value.clips.length)
|
|
1738
|
-
context.addIssue({ code: "custom", message: "A clip can appear only once in a storyboard." });
|
|
1739
|
-
for (const clip of value.clips)
|
|
1740
|
-
if (new Set(clip.edits.map((e) => e.sourceVersionId)).size !== clip.edits.length)
|
|
1741
|
-
context.addIssue({
|
|
1742
|
-
code: "custom",
|
|
1743
|
-
message: "Each candidate has one current edit binding."
|
|
1744
|
-
});
|
|
1745
|
-
});
|
|
1746
|
-
|
|
1747
|
-
// packages/project-studio/src/shared.ts
|
|
1748
|
-
var projectType = z5.enum(["short-drama", "product-ad", "other"]);
|
|
1749
|
-
var studioConfig = z5.object({
|
|
1750
|
-
role: z5.enum(["project", "coordinator"]).default("project"),
|
|
1751
|
-
projectType: projectType.optional(),
|
|
1752
|
-
dataInstance: z5.string().min(1).default("user:data"),
|
|
1753
|
-
apiInstance: z5.string().min(1).default("api"),
|
|
1754
|
-
libraryInstance: z5.string().min(1).nullable().default(null),
|
|
1755
|
-
coordinatorInstance: z5.string().min(1).optional()
|
|
1756
|
-
}).strict();
|
|
1757
|
-
var versionRef = z5.object({ storeId: z5.uuid(), objectId: z5.uuid(), versionId: z5.uuid() }).strict();
|
|
1758
|
-
var tags = z5.array(z5.string().trim().min(1).max(64)).max(50).transform((x) => [...new Set(x)]).default([]);
|
|
1759
|
-
var kind = z5.enum(["text", "image", "video", "audio", "file"]);
|
|
1760
|
-
var projectData = z5.object({
|
|
1761
|
-
name: z5.string().trim().min(1).max(120),
|
|
1762
|
-
description: z5.string().max(4e3).default(""),
|
|
1763
|
-
status: z5.enum(["draft", "active", "archived"]).default("draft"),
|
|
1764
|
-
aspectRatio: z5.string().nullable().default(null),
|
|
1765
|
-
projectType: projectType.optional(),
|
|
1766
|
-
coverRef: versionRef.nullable().default(null),
|
|
1767
|
-
briefRef: z5.object({ storeId: z5.uuid(), objectId: z5.uuid() }).strict().nullable().default(null),
|
|
1768
|
-
tags
|
|
1769
|
-
}).strict();
|
|
1770
|
-
var assetData = z5.object({
|
|
1771
|
-
projectId: z5.uuid(),
|
|
1772
|
-
name: z5.string().trim().min(1).max(200),
|
|
1773
|
-
kind,
|
|
1774
|
-
purpose: z5.enum(["reference", "script", "shot", "music", "voice", "subtitle", "final", "other"]).default("other"),
|
|
1775
|
-
origin: z5.enum(["upload", "library", "generated", "authored"]),
|
|
1776
|
-
orderKey: z5.number().int().nullable().default(null),
|
|
1777
|
-
tags,
|
|
1778
|
-
lifecycle: z5.enum(["draft", "ready", "archived"]).default("draft"),
|
|
1779
|
-
sourceRef: versionRef.nullable().default(null),
|
|
1780
|
-
adoptedVersionId: z5.uuid().nullable().default(null)
|
|
1781
|
-
}).strict();
|
|
1782
|
-
var anchor = z5.discriminatedUnion("kind", [
|
|
1783
|
-
z5.object({ kind: z5.literal("whole") }).strict(),
|
|
1784
|
-
z5.object({
|
|
1785
|
-
kind: z5.literal("timeRange"),
|
|
1786
|
-
startMs: z5.number().int().nonnegative(),
|
|
1787
|
-
endMs: z5.number().int().nonnegative()
|
|
1788
|
-
}).strict()
|
|
1789
|
-
]);
|
|
1790
|
-
var generationInput = z5.object({
|
|
1791
|
-
targetAssetId: z5.uuid().optional(),
|
|
1792
|
-
taskName: z5.string().trim().min(1).max(200).optional(),
|
|
1793
|
-
context: z5.record(z5.string().min(1).max(64), z5.string().min(1).max(200)).optional(),
|
|
1794
|
-
expectedRevision: z5.number().int().positive().optional(),
|
|
1795
|
-
newAsset: z5.object({
|
|
1796
|
-
name: z5.string().trim().min(1).max(200),
|
|
1797
|
-
kind: z5.enum(["image", "video", "audio"])
|
|
1798
|
-
}).strict().optional(),
|
|
1799
|
-
modelId: z5.string().min(1),
|
|
1800
|
-
capabilityId: z5.string().min(1),
|
|
1801
|
-
prompt: z5.string().max(32e3),
|
|
1802
|
-
parameters: z5.record(z5.string(), z5.unknown()).default({}),
|
|
1803
|
-
outputCount: z5.number().int().min(1).max(100).default(1),
|
|
1804
|
-
inputs: z5.array(
|
|
1805
|
-
z5.object({
|
|
1806
|
-
ref: versionRef,
|
|
1807
|
-
role: z5.string().min(1),
|
|
1808
|
-
order: z5.number().int().nonnegative(),
|
|
1809
|
-
weight: z5.number().finite().nullable().default(null)
|
|
1810
|
-
}).strict()
|
|
1811
|
-
).max(100).default([]),
|
|
1812
|
-
baseVersionId: z5.uuid().optional(),
|
|
1813
|
-
changeRequest: z5.string().trim().min(1).max(4e3).optional(),
|
|
1814
|
-
preserveRequest: z5.string().max(4e3).default(""),
|
|
1815
|
-
anchor: anchor.default({ kind: "whole" }),
|
|
1816
|
-
retryOfTaskId: z5.uuid().optional(),
|
|
1817
|
-
acknowledgeUnknown: z5.boolean().optional()
|
|
1818
|
-
}).strict();
|
|
1819
|
-
var projectSettingsInput = z5.object({
|
|
1820
|
-
projectId: z5.uuid(),
|
|
1821
|
-
expectedRevision: z5.number().int().positive(),
|
|
1822
|
-
changes: projectData.pick({ name: true, description: true, tags: true, aspectRatio: true, coverRef: true }).extend({
|
|
1823
|
-
description: projectData.shape.description.unwrap(),
|
|
1824
|
-
tags: projectData.shape.tags.unwrap(),
|
|
1825
|
-
aspectRatio: projectData.shape.aspectRatio.unwrap(),
|
|
1826
|
-
coverRef: projectData.shape.coverRef.unwrap()
|
|
1827
|
-
}).partial().strict()
|
|
1828
|
-
}).strict();
|
|
1829
|
-
var generationSubmitOperation = defineOperation({
|
|
1830
|
-
id: "generation.submit",
|
|
1831
|
-
title: "Generate",
|
|
1832
|
-
description: "Submit one media generation without approval, retaining its paid request identity.",
|
|
1833
|
-
input: generationInput,
|
|
1834
|
-
output: z5.any(),
|
|
1835
|
-
effects: ["write", "paid"],
|
|
1836
|
-
confirm: "none"
|
|
1837
|
-
});
|
|
1838
|
-
var favoriteData = z5.object({ ref: versionRef }).strict();
|
|
1839
|
-
var sqlScalar = z5.union([z5.string(), z5.number().finite(), z5.null()]);
|
|
1840
|
-
var globalQueryInput = z5.object({
|
|
1841
|
-
sql: z5.string().trim().min(1),
|
|
1842
|
-
params: z5.union([z5.array(sqlScalar), z5.record(z5.string(), sqlScalar)]).optional(),
|
|
1843
|
-
timeoutMs: z5.number().int().positive().optional(),
|
|
1844
|
-
maxRows: z5.number().int().positive().optional(),
|
|
1845
|
-
limit: z5.number().int().min(1).max(200).optional(),
|
|
1846
|
-
offset: z5.number().int().nonnegative().optional(),
|
|
1847
|
-
source: z5.enum(["projects", "assets", "tasks"]),
|
|
1848
|
-
excludeProjectIds: z5.array(z5.uuid()).optional(),
|
|
1849
|
-
catalog: z5.array(z5.object({ id: z5.string().min(1), name: z5.string(), available: z5.boolean() }).strict()).optional()
|
|
1850
|
-
}).strict();
|
|
1851
|
-
|
|
1852
1994
|
// packages/project-studio/src/user-actions.ts
|
|
1853
1995
|
var stable = (value) => JSON.stringify(normalize(value));
|
|
1854
1996
|
function normalize(value) {
|
|
@@ -1985,7 +2127,7 @@ var dependencies = (config) => [
|
|
|
1985
2127
|
var draftKey = (workspaceId, projectId, target) => JSON.stringify(["generation-draft", 1, workspaceId, projectId, target]);
|
|
1986
2128
|
|
|
1987
2129
|
// packages/studio-workbench/src/query-results.tsx
|
|
1988
|
-
import * as
|
|
2130
|
+
import * as React2 from "react";
|
|
1989
2131
|
function QueryResults({
|
|
1990
2132
|
route,
|
|
1991
2133
|
active,
|
|
@@ -2005,22 +2147,22 @@ function QueryResults({
|
|
|
2005
2147
|
rowActions
|
|
2006
2148
|
}) {
|
|
2007
2149
|
const libraryGrid = active.id?.startsWith("default:");
|
|
2008
|
-
return /* @__PURE__ */
|
|
2150
|
+
return /* @__PURE__ */ React2.createElement("div", { className: "studio-results", "aria-busy": queryLoading }, route.layout === "list" ? /* @__PURE__ */ React2.createElement("div", { className: "studio-table-scroll" }, /* @__PURE__ */ React2.createElement(
|
|
2009
2151
|
"table",
|
|
2010
2152
|
{
|
|
2011
2153
|
className: `studio-table studio-table-${route.page}`,
|
|
2012
2154
|
"aria-label": pageTitles[route.page]
|
|
2013
2155
|
},
|
|
2014
|
-
/* @__PURE__ */
|
|
2015
|
-
/* @__PURE__ */
|
|
2016
|
-
/* @__PURE__ */
|
|
2156
|
+
/* @__PURE__ */ React2.createElement("colgroup", null, selecting && /* @__PURE__ */ React2.createElement("col", { style: { width: 48 } }), visibleColumns.map((column2) => /* @__PURE__ */ React2.createElement("col", { key: column2.path, style: { width: column2.width } })), /* @__PURE__ */ React2.createElement("col", { style: { width: 100 } })),
|
|
2157
|
+
/* @__PURE__ */ React2.createElement("thead", null, /* @__PURE__ */ React2.createElement("tr", null, selecting && /* @__PURE__ */ React2.createElement("th", { scope: "col" }, "Select"), visibleColumns.map((column2) => /* @__PURE__ */ React2.createElement("th", { key: column2.path, scope: "col" }, column2.label ?? column2.path)), active.id !== "default:assets" && /* @__PURE__ */ React2.createElement("th", { scope: "col" }, "Action"))),
|
|
2158
|
+
/* @__PURE__ */ React2.createElement("tbody", null, presentationRows(rows, active.view).map(({ row, renderKey }) => /* @__PURE__ */ React2.createElement(
|
|
2017
2159
|
"tr",
|
|
2018
2160
|
{
|
|
2019
2161
|
key: renderKey,
|
|
2020
2162
|
"data-row-id": rowKey(row, active.view) ?? void 0,
|
|
2021
2163
|
"data-magic-edit-project": annotationProject(row)
|
|
2022
2164
|
},
|
|
2023
|
-
selecting && /* @__PURE__ */
|
|
2165
|
+
selecting && /* @__PURE__ */ React2.createElement("td", null, /* @__PURE__ */ React2.createElement(
|
|
2024
2166
|
Checkbox,
|
|
2025
2167
|
{
|
|
2026
2168
|
label: `Select ${rowTitle(row, active.view)}`,
|
|
@@ -2030,7 +2172,7 @@ function QueryResults({
|
|
|
2030
2172
|
onCheckedChange: () => toggle(row)
|
|
2031
2173
|
}
|
|
2032
2174
|
)),
|
|
2033
|
-
visibleColumns.map((column2) => /* @__PURE__ */
|
|
2175
|
+
visibleColumns.map((column2) => /* @__PURE__ */ React2.createElement("td", { key: column2.path }, column2.role === "preview" ? cover(row) : column2.role === "name" ? /* @__PURE__ */ React2.createElement(
|
|
2034
2176
|
Button,
|
|
2035
2177
|
{
|
|
2036
2178
|
className: "studio-row-name",
|
|
@@ -2040,9 +2182,9 @@ function QueryResults({
|
|
|
2040
2182
|
onClick: () => selecting ? toggle(row) : openRow(row)
|
|
2041
2183
|
}
|
|
2042
2184
|
) : renderCell(row, column2))),
|
|
2043
|
-
active.id !== "default:assets" && /* @__PURE__ */
|
|
2185
|
+
active.id !== "default:assets" && /* @__PURE__ */ React2.createElement("td", null, !selecting && rowActions(row))
|
|
2044
2186
|
)))
|
|
2045
|
-
), !rows.length && /* @__PURE__ */
|
|
2187
|
+
), !rows.length && /* @__PURE__ */ React2.createElement("div", { className: "studio-empty", role: "status" }, queryLoading ? "Loading\u2026" : failure ? "The query could not be loaded." : route.page === "projects" ? "No matching projects." : route.page === "tasks" ? "No matching tasks." : "No assets.")) : /* @__PURE__ */ React2.createElement("div", { className: libraryGrid ? "studio-grid vx-asset-grid" : "studio-grid" }, presentationRows(rows, active.view).map(({ row, renderKey }) => /* @__PURE__ */ React2.createElement(
|
|
2046
2188
|
"article",
|
|
2047
2189
|
{
|
|
2048
2190
|
key: renderKey,
|
|
@@ -2051,14 +2193,14 @@ function QueryResults({
|
|
|
2051
2193
|
className: libraryGrid ? "studio-card vx-asset-tile" : "studio-card"
|
|
2052
2194
|
},
|
|
2053
2195
|
cover(row),
|
|
2054
|
-
libraryGrid ? /* @__PURE__ */
|
|
2196
|
+
libraryGrid ? /* @__PURE__ */ React2.createElement(
|
|
2055
2197
|
AssetTileCaption,
|
|
2056
2198
|
{
|
|
2057
2199
|
title: rowTitle(row, active.view),
|
|
2058
2200
|
onOpen: () => selecting ? toggle(row) : openRow(row),
|
|
2059
2201
|
disabled: selecting ? !selectionKey(row) : !canOpen(row),
|
|
2060
2202
|
actions: !selecting && rowActions(row),
|
|
2061
|
-
status: route.page === "tasks" ? visibleColumns.filter((c) => c.role === "state").map((c) => /* @__PURE__ */
|
|
2203
|
+
status: route.page === "tasks" ? visibleColumns.filter((c) => c.role === "state").map((c) => /* @__PURE__ */ React2.createElement(React2.Fragment, { key: c.path }, renderCell(row, c))) : void 0,
|
|
2062
2204
|
facts: route.page === "tasks" ? [row.projectName, row.modelId, row.aspectRatio] : route.page === "projects" ? [
|
|
2063
2205
|
row.projectType,
|
|
2064
2206
|
typeof row.assetCount === "number" ? `${row.assetCount} assets` : null,
|
|
@@ -2070,7 +2212,7 @@ function QueryResults({
|
|
|
2070
2212
|
!row.modelId && !row.aspectRatio && !row.resolution && !row.width ? row.kind : null
|
|
2071
2213
|
]
|
|
2072
2214
|
}
|
|
2073
|
-
) : /* @__PURE__ */
|
|
2215
|
+
) : /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("div", { className: "studio-card-heading" }, /* @__PURE__ */ React2.createElement(
|
|
2074
2216
|
Button,
|
|
2075
2217
|
{
|
|
2076
2218
|
className: "studio-row-name",
|
|
@@ -2079,20 +2221,20 @@ function QueryResults({
|
|
|
2079
2221
|
disabled: selecting ? !selectionKey(row) : !canOpen(row),
|
|
2080
2222
|
onClick: () => selecting ? toggle(row) : openRow(row)
|
|
2081
2223
|
}
|
|
2082
|
-
), !selecting && rowActions(row)), route.page === "assets" && rowRef(row, active.view) ? /* @__PURE__ */
|
|
2224
|
+
), !selecting && rowActions(row)), route.page === "assets" && rowRef(row, active.view) ? /* @__PURE__ */ React2.createElement("div", { className: "studio-card-subtitle" }, visibleColumns.some((column2) => column2.format === "categories") ? visibleColumns.filter((column2) => column2.format === "categories").map((column2) => /* @__PURE__ */ React2.createElement(React2.Fragment, { key: column2.path }, renderCell(row, column2))) : columnText(row.kind)) : /* @__PURE__ */ React2.createElement("dl", null, visibleColumns.filter(
|
|
2083
2225
|
(column2) => !column2.role || column2.role === "state" || column2.role === "project"
|
|
2084
|
-
).map((column2) => /* @__PURE__ */
|
|
2085
|
-
)), !rows.length && /* @__PURE__ */
|
|
2226
|
+
).map((column2) => /* @__PURE__ */ React2.createElement("div", { key: column2.path }, /* @__PURE__ */ React2.createElement("dt", null, column2.label ?? column2.path), /* @__PURE__ */ React2.createElement("dd", null, renderCell(row, column2))))))
|
|
2227
|
+
)), !rows.length && /* @__PURE__ */ React2.createElement("div", { className: "studio-empty", role: "status" }, queryLoading ? "Loading\u2026" : failure ? "The query could not be loaded." : route.page === "projects" ? "No matching projects." : route.page === "tasks" ? "No matching tasks." : "No assets.")));
|
|
2086
2228
|
}
|
|
2087
2229
|
|
|
2088
2230
|
// packages/studio-workbench/src/home.tsx
|
|
2089
|
-
import * as
|
|
2231
|
+
import * as React4 from "react";
|
|
2090
2232
|
|
|
2091
2233
|
// packages/studio-workbench/src/home-banner.tsx
|
|
2092
|
-
import * as
|
|
2234
|
+
import * as React3 from "react";
|
|
2093
2235
|
function useClip(client, clip) {
|
|
2094
|
-
const [state, setState] =
|
|
2095
|
-
|
|
2236
|
+
const [state, setState] = React3.useState();
|
|
2237
|
+
React3.useEffect(() => {
|
|
2096
2238
|
if (!clip) return;
|
|
2097
2239
|
const abort = new AbortController();
|
|
2098
2240
|
let url;
|
|
@@ -2120,17 +2262,17 @@ function useClip(client, clip) {
|
|
|
2120
2262
|
}
|
|
2121
2263
|
var resultAnimation = "studio-home-motion-result";
|
|
2122
2264
|
var buildPrompt = "Build me a shot sequence view";
|
|
2123
|
-
var blossomPrompt = "Change the
|
|
2265
|
+
var blossomPrompt = "Change the shot to cherry blossoms.";
|
|
2124
2266
|
function Stage({
|
|
2125
2267
|
blossom,
|
|
2126
2268
|
exiting,
|
|
2127
2269
|
url,
|
|
2128
2270
|
onCountdown
|
|
2129
2271
|
}) {
|
|
2130
|
-
const video =
|
|
2131
|
-
const revealed =
|
|
2272
|
+
const video = React3.useRef(null);
|
|
2273
|
+
const revealed = React3.useRef(false);
|
|
2132
2274
|
const prompt = blossom ? blossomPrompt : buildPrompt;
|
|
2133
|
-
|
|
2275
|
+
React3.useEffect(() => {
|
|
2134
2276
|
const element = video.current;
|
|
2135
2277
|
if (exiting) element?.pause();
|
|
2136
2278
|
else if (revealed.current && url) {
|
|
@@ -2139,7 +2281,7 @@ function Stage({
|
|
|
2139
2281
|
});
|
|
2140
2282
|
}
|
|
2141
2283
|
}, [blossom, exiting, onCountdown, url]);
|
|
2142
|
-
return /* @__PURE__ */
|
|
2284
|
+
return /* @__PURE__ */ React3.createElement(
|
|
2143
2285
|
"div",
|
|
2144
2286
|
{
|
|
2145
2287
|
className: "studio-home-motion-stage",
|
|
@@ -2152,7 +2294,7 @@ function Stage({
|
|
|
2152
2294
|
}
|
|
2153
2295
|
}
|
|
2154
2296
|
},
|
|
2155
|
-
/* @__PURE__ */
|
|
2297
|
+
/* @__PURE__ */ React3.createElement("div", { className: "studio-home-motion-board" }, /* @__PURE__ */ React3.createElement("div", { className: "studio-home-motion-board-sidebar" }, [0, 1, 2, 3].map((i) => /* @__PURE__ */ React3.createElement("span", { key: i, className: "studio-home-motion-board-line" }))), /* @__PURE__ */ React3.createElement("div", { className: "studio-home-motion-board-shots" }, /* @__PURE__ */ React3.createElement("div", { className: "studio-home-motion-shot" }, /* @__PURE__ */ React3.createElement(
|
|
2156
2298
|
"video",
|
|
2157
2299
|
{
|
|
2158
2300
|
className: "studio-home-motion-shot-video",
|
|
@@ -2181,22 +2323,22 @@ function Stage({
|
|
|
2181
2323
|
if (!exiting && !blossom) onCountdown(true);
|
|
2182
2324
|
}
|
|
2183
2325
|
}
|
|
2184
|
-
), /* @__PURE__ */
|
|
2185
|
-
/* @__PURE__ */
|
|
2326
|
+
), /* @__PURE__ */ React3.createElement("span", { className: "studio-home-motion-sweep" })), /* @__PURE__ */ React3.createElement("div", { className: "studio-home-motion-strip" }))),
|
|
2327
|
+
/* @__PURE__ */ React3.createElement("div", { className: "studio-home-motion-command" }, /* @__PURE__ */ React3.createElement("div", { className: "studio-home-motion-pill" }, /* @__PURE__ */ React3.createElement("span", { className: "studio-home-motion-label" }, "Magic Edit"), /* @__PURE__ */ React3.createElement(
|
|
2186
2328
|
"span",
|
|
2187
2329
|
{
|
|
2188
2330
|
className: "studio-home-motion-typing",
|
|
2189
2331
|
style: { "--characters": prompt.length }
|
|
2190
2332
|
},
|
|
2191
|
-
/* @__PURE__ */
|
|
2192
|
-
)), /* @__PURE__ */
|
|
2333
|
+
/* @__PURE__ */ React3.createElement("span", { className: "studio-home-motion-typed" }, prompt)
|
|
2334
|
+
)), /* @__PURE__ */ React3.createElement("div", { className: "studio-home-motion-pointer" }))
|
|
2193
2335
|
);
|
|
2194
2336
|
}
|
|
2195
2337
|
function BannerDemo({ client }) {
|
|
2196
|
-
const [animate, setAnimate] =
|
|
2197
|
-
const [turn, setTurn] =
|
|
2198
|
-
const [countdown, setCountdown] =
|
|
2199
|
-
|
|
2338
|
+
const [animate, setAnimate] = React3.useState(false);
|
|
2339
|
+
const [turn, setTurn] = React3.useState(0);
|
|
2340
|
+
const [countdown, setCountdown] = React3.useState(false);
|
|
2341
|
+
React3.useEffect(() => {
|
|
2200
2342
|
const preference = window.matchMedia("(prefers-reduced-motion: no-preference)");
|
|
2201
2343
|
const update = () => {
|
|
2202
2344
|
setAnimate(preference.matches);
|
|
@@ -2213,7 +2355,7 @@ function BannerDemo({ client }) {
|
|
|
2213
2355
|
const blossom = useClip(client, animate ? "tree-shadow-blossom" : void 0);
|
|
2214
2356
|
const isBlossom = turn % 2 === 1;
|
|
2215
2357
|
const stages = isBlossom ? [turn - 1, turn] : [turn];
|
|
2216
|
-
return /* @__PURE__ */
|
|
2358
|
+
return /* @__PURE__ */ React3.createElement(
|
|
2217
2359
|
"div",
|
|
2218
2360
|
{
|
|
2219
2361
|
className: "studio-home-motion-demo",
|
|
@@ -2225,7 +2367,7 @@ function BannerDemo({ client }) {
|
|
|
2225
2367
|
setTurn((value) => value + 1);
|
|
2226
2368
|
}
|
|
2227
2369
|
},
|
|
2228
|
-
stages.map((index) => /* @__PURE__ */
|
|
2370
|
+
stages.map((index) => /* @__PURE__ */ React3.createElement(
|
|
2229
2371
|
Stage,
|
|
2230
2372
|
{
|
|
2231
2373
|
key: index,
|
|
@@ -2242,10 +2384,10 @@ var tutorials = [
|
|
|
2242
2384
|
{ value: "product-ad", label: "Product Ad" }
|
|
2243
2385
|
];
|
|
2244
2386
|
function Tutorials({ client, close }) {
|
|
2245
|
-
const [selected, setSelected] =
|
|
2387
|
+
const [selected, setSelected] = React3.useState("short-drama");
|
|
2246
2388
|
const clip = useClip(client, selected);
|
|
2247
2389
|
const label = tutorials.find(({ value }) => value === selected).label;
|
|
2248
|
-
return /* @__PURE__ */
|
|
2390
|
+
return /* @__PURE__ */ React3.createElement(StudioTheme, { theme: "dark" }, /* @__PURE__ */ React3.createElement(
|
|
2249
2391
|
Dialog,
|
|
2250
2392
|
{
|
|
2251
2393
|
title: "Workbench tutorials",
|
|
@@ -2253,7 +2395,7 @@ function Tutorials({ client, close }) {
|
|
|
2253
2395
|
onOpenChange: (open) => !open && close(),
|
|
2254
2396
|
className: "studio-home-tutorials"
|
|
2255
2397
|
},
|
|
2256
|
-
/* @__PURE__ */
|
|
2398
|
+
/* @__PURE__ */ React3.createElement(
|
|
2257
2399
|
SegmentedControl,
|
|
2258
2400
|
{
|
|
2259
2401
|
label: "Workbench tutorials",
|
|
@@ -2262,13 +2404,13 @@ function Tutorials({ client, close }) {
|
|
|
2262
2404
|
onValueChange: (value) => setSelected(value === "product-ad" ? value : "short-drama")
|
|
2263
2405
|
}
|
|
2264
2406
|
),
|
|
2265
|
-
/* @__PURE__ */
|
|
2407
|
+
/* @__PURE__ */ React3.createElement("div", { className: "studio-home-tutorial-stage" }, clip?.url ? /* @__PURE__ */ React3.createElement("video", { key: selected, "aria-label": label, src: clip.url, controls: true, autoPlay: true, playsInline: true }) : /* @__PURE__ */ React3.createElement("p", { role: clip?.error ? "alert" : "status" }, clip?.error ? "This tutorial could not be loaded." : "Loading tutorial\u2026"))
|
|
2266
2408
|
));
|
|
2267
2409
|
}
|
|
2268
2410
|
function HomeBanner({ client }) {
|
|
2269
|
-
const [watch, setWatch] =
|
|
2270
|
-
const trigger =
|
|
2271
|
-
return /* @__PURE__ */
|
|
2411
|
+
const [watch, setWatch] = React3.useState(false);
|
|
2412
|
+
const trigger = React3.useRef(null);
|
|
2413
|
+
return /* @__PURE__ */ React3.createElement("div", { className: "studio-home-hero" }, /* @__PURE__ */ React3.createElement("div", { className: "studio-home-hero-copy" }, /* @__PURE__ */ React3.createElement("h1", null, "Shape your creative system with Vivix CLI"), /* @__PURE__ */ React3.createElement("p", null, "Chat to your agent to generate videos or create your own custom views to suit your creative needs")), !watch && /* @__PURE__ */ React3.createElement(BannerDemo, { client }), /* @__PURE__ */ React3.createElement(
|
|
2272
2414
|
"button",
|
|
2273
2415
|
{
|
|
2274
2416
|
type: "button",
|
|
@@ -2278,7 +2420,7 @@ function HomeBanner({ client }) {
|
|
|
2278
2420
|
"aria-haspopup": "dialog",
|
|
2279
2421
|
onClick: () => setWatch(true)
|
|
2280
2422
|
}
|
|
2281
|
-
), watch && /* @__PURE__ */
|
|
2423
|
+
), watch && /* @__PURE__ */ React3.createElement(
|
|
2282
2424
|
Tutorials,
|
|
2283
2425
|
{
|
|
2284
2426
|
client,
|
|
@@ -2361,7 +2503,7 @@ var viewTemplates = [
|
|
|
2361
2503
|
title: "Script Editor",
|
|
2362
2504
|
preview: "script-editor",
|
|
2363
2505
|
route: "script-editor",
|
|
2364
|
-
description: "Write and organize a short-drama script by episode and
|
|
2506
|
+
description: "Write and organize a short-drama script by episode and shot."
|
|
2365
2507
|
},
|
|
2366
2508
|
{
|
|
2367
2509
|
...ads,
|
|
@@ -2420,20 +2562,20 @@ function createViewPrompt(template, source) {
|
|
|
2420
2562
|
}
|
|
2421
2563
|
|
|
2422
2564
|
// packages/studio-workbench/src/home.tsx
|
|
2423
|
-
var CardBoundary = class extends
|
|
2565
|
+
var CardBoundary = class extends React4.Component {
|
|
2424
2566
|
state = { failed: false };
|
|
2425
2567
|
static getDerivedStateFromError() {
|
|
2426
2568
|
return { failed: true };
|
|
2427
2569
|
}
|
|
2428
2570
|
render() {
|
|
2429
|
-
return this.state.failed ? /* @__PURE__ */
|
|
2571
|
+
return this.state.failed ? /* @__PURE__ */ React4.createElement("p", { role: "alert" }, this.props.title, " could not be displayed.") : this.props.children;
|
|
2430
2572
|
}
|
|
2431
2573
|
};
|
|
2432
2574
|
function PromptDialog({ prompt, close }) {
|
|
2433
|
-
const [value, setValue] =
|
|
2434
|
-
const [status, setStatus] =
|
|
2435
|
-
const fieldId =
|
|
2436
|
-
const text =
|
|
2575
|
+
const [value, setValue] = React4.useState(prompt.value);
|
|
2576
|
+
const [status, setStatus] = React4.useState("");
|
|
2577
|
+
const fieldId = React4.useId();
|
|
2578
|
+
const text = React4.useRef(null);
|
|
2437
2579
|
async function copy2() {
|
|
2438
2580
|
try {
|
|
2439
2581
|
await navigator.clipboard.writeText(value);
|
|
@@ -2444,7 +2586,7 @@ function PromptDialog({ prompt, close }) {
|
|
|
2444
2586
|
setStatus("Copy the selected text.");
|
|
2445
2587
|
}
|
|
2446
2588
|
}
|
|
2447
|
-
return /* @__PURE__ */
|
|
2589
|
+
return /* @__PURE__ */ React4.createElement(
|
|
2448
2590
|
Dialog,
|
|
2449
2591
|
{
|
|
2450
2592
|
className: "studio-home-dialog",
|
|
@@ -2452,7 +2594,7 @@ function PromptDialog({ prompt, close }) {
|
|
|
2452
2594
|
title: prompt.title,
|
|
2453
2595
|
open: true,
|
|
2454
2596
|
onOpenChange: (open) => !open && close(),
|
|
2455
|
-
actions: /* @__PURE__ */
|
|
2597
|
+
actions: /* @__PURE__ */ React4.createElement(React4.Fragment, null, prompt.editable && /* @__PURE__ */ React4.createElement(Button, { label: "Cancel", variant: "text-tonal-lg", width: "hug", onClick: close }), /* @__PURE__ */ React4.createElement(
|
|
2456
2598
|
Button,
|
|
2457
2599
|
{
|
|
2458
2600
|
label: prompt.editable ? "Copy prompt" : "Copy Prompt",
|
|
@@ -2462,7 +2604,7 @@ function PromptDialog({ prompt, close }) {
|
|
|
2462
2604
|
}
|
|
2463
2605
|
))
|
|
2464
2606
|
},
|
|
2465
|
-
prompt.preview !== void 0 && /* @__PURE__ */
|
|
2607
|
+
prompt.preview !== void 0 && /* @__PURE__ */ React4.createElement(
|
|
2466
2608
|
"div",
|
|
2467
2609
|
{
|
|
2468
2610
|
className: "studio-home-preview",
|
|
@@ -2472,8 +2614,8 @@ function PromptDialog({ prompt, close }) {
|
|
|
2472
2614
|
"aria-label": prompt.title + " preview"
|
|
2473
2615
|
}
|
|
2474
2616
|
),
|
|
2475
|
-
prompt.editable && /* @__PURE__ */
|
|
2476
|
-
/* @__PURE__ */
|
|
2617
|
+
prompt.editable && /* @__PURE__ */ React4.createElement("label", { className: "studio-dashboard-field-label", htmlFor: fieldId }, "Copy prompt and send to your agent"),
|
|
2618
|
+
/* @__PURE__ */ React4.createElement(
|
|
2477
2619
|
"textarea",
|
|
2478
2620
|
{
|
|
2479
2621
|
id: fieldId,
|
|
@@ -2485,15 +2627,15 @@ function PromptDialog({ prompt, close }) {
|
|
|
2485
2627
|
onChange: (event2) => setValue(event2.target.value)
|
|
2486
2628
|
}
|
|
2487
2629
|
),
|
|
2488
|
-
/* @__PURE__ */
|
|
2630
|
+
/* @__PURE__ */ React4.createElement("span", { role: "status" }, status)
|
|
2489
2631
|
);
|
|
2490
2632
|
}
|
|
2491
2633
|
function SavedViewsEmpty({
|
|
2492
2634
|
instance,
|
|
2493
2635
|
showPrompt
|
|
2494
2636
|
}) {
|
|
2495
|
-
const [copied, setCopied] =
|
|
2496
|
-
|
|
2637
|
+
const [copied, setCopied] = React4.useState(false);
|
|
2638
|
+
React4.useEffect(() => {
|
|
2497
2639
|
if (!copied) return;
|
|
2498
2640
|
const timer = window.setTimeout(() => setCopied(false), 2e3);
|
|
2499
2641
|
return () => window.clearTimeout(timer);
|
|
@@ -2512,7 +2654,7 @@ function SavedViewsEmpty({
|
|
|
2512
2654
|
showPrompt({ title: "Create a saved view", value });
|
|
2513
2655
|
}
|
|
2514
2656
|
}
|
|
2515
|
-
return /* @__PURE__ */
|
|
2657
|
+
return /* @__PURE__ */ React4.createElement("div", { className: "studio-saved-empty" }, /* @__PURE__ */ React4.createElement("p", null, "No saved view yet. Ask your agent to create any views."), /* @__PURE__ */ React4.createElement(
|
|
2516
2658
|
Button,
|
|
2517
2659
|
{
|
|
2518
2660
|
label: copied ? "Copied" : "Copy prompt",
|
|
@@ -2529,39 +2671,39 @@ function StudioHome({
|
|
|
2529
2671
|
onRoute,
|
|
2530
2672
|
...props
|
|
2531
2673
|
}) {
|
|
2532
|
-
const [prompt, setPrompt] =
|
|
2674
|
+
const [prompt, setPrompt] = React4.useState();
|
|
2533
2675
|
const cards = client.config.dashboard ?? [];
|
|
2534
2676
|
const resolve = (ref) => client.resolveUI(ref);
|
|
2535
2677
|
const mounted = (ref) => {
|
|
2536
2678
|
const ui = resolve(ref);
|
|
2537
2679
|
const Component2 = ui?.kind === "component" ? ui.component : void 0;
|
|
2538
|
-
return /* @__PURE__ */
|
|
2680
|
+
return /* @__PURE__ */ React4.createElement(CardBoundary, { key: ref.plugin + "/" + ref.id, title: ui?.title ?? ref.id }, Component2 ? /* @__PURE__ */ React4.createElement(Component2, { ...props }) : /* @__PURE__ */ React4.createElement("p", { role: "status" }, "View unavailable: ", ref.plugin, "/", ref.id));
|
|
2539
2681
|
};
|
|
2540
2682
|
const saved = client.config.savedViews;
|
|
2541
2683
|
const selected = saved.find(
|
|
2542
2684
|
(ref) => "plugin" in ref && ref.plugin + "/" + ref.id === route.selected
|
|
2543
2685
|
);
|
|
2544
|
-
const savedTiles = selected && "plugin" in selected ? /* @__PURE__ */
|
|
2686
|
+
const savedTiles = selected && "plugin" in selected ? /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(
|
|
2545
2687
|
Button,
|
|
2546
2688
|
{
|
|
2547
2689
|
label: "Back to Saved Views",
|
|
2548
2690
|
variant: "text-tonal-sm",
|
|
2549
2691
|
onClick: () => onRoute({ ...route, selected: void 0 })
|
|
2550
2692
|
}
|
|
2551
|
-
), mounted(selected)) : saved.length ? /* @__PURE__ */
|
|
2693
|
+
), mounted(selected)) : saved.length ? /* @__PURE__ */ React4.createElement("div", { className: "studio-home-grid studio-home-gallery", role: "list" }, saved.map((ref) => {
|
|
2552
2694
|
const ui = "plugin" in ref ? resolve(ref) : void 0;
|
|
2553
2695
|
const title = "plugin" in ref ? ui?.title ?? ref.id : ref.title;
|
|
2554
2696
|
const identifier = "plugin" in ref ? `${ref.plugin}/${ref.id}` : `${ref.projectId}/${ref.viewId}`;
|
|
2555
|
-
return /* @__PURE__ */
|
|
2697
|
+
return /* @__PURE__ */ React4.createElement("article", { className: "studio-home-template", key: identifier, role: "listitem" }, /* @__PURE__ */ React4.createElement(
|
|
2556
2698
|
"button",
|
|
2557
2699
|
{
|
|
2558
2700
|
type: "button",
|
|
2559
2701
|
className: "studio-home-tile",
|
|
2560
2702
|
onClick: () => "plugin" in ref ? onRoute({ ...route, selected: identifier }) : props.openProject(ref.projectId, ref.viewId)
|
|
2561
2703
|
},
|
|
2562
|
-
/* @__PURE__ */
|
|
2563
|
-
/* @__PURE__ */
|
|
2564
|
-
), /* @__PURE__ */
|
|
2704
|
+
/* @__PURE__ */ React4.createElement("span", { className: "studio-home-cover", "aria-hidden": "true" }, /* @__PURE__ */ React4.createElement(Icon, { name: "placeholder-image", size: 20 })),
|
|
2705
|
+
/* @__PURE__ */ React4.createElement("strong", null, title)
|
|
2706
|
+
), /* @__PURE__ */ React4.createElement(
|
|
2565
2707
|
Button,
|
|
2566
2708
|
{
|
|
2567
2709
|
label: "View Prompt",
|
|
@@ -2578,15 +2720,15 @@ ${"plugin" in ref ? "Use this enabled user-scope component in the Home instance
|
|
|
2578
2720
|
})
|
|
2579
2721
|
}
|
|
2580
2722
|
));
|
|
2581
|
-
})) : /* @__PURE__ */
|
|
2582
|
-
return /* @__PURE__ */
|
|
2723
|
+
})) : /* @__PURE__ */ React4.createElement(SavedViewsEmpty, { instance: client.instanceId, showPrompt: setPrompt });
|
|
2724
|
+
return /* @__PURE__ */ React4.createElement(
|
|
2583
2725
|
"section",
|
|
2584
2726
|
{
|
|
2585
2727
|
className: "studio-home",
|
|
2586
2728
|
"aria-label": "Home",
|
|
2587
2729
|
"data-custom-views": route.mode === "custom-views" || void 0
|
|
2588
2730
|
},
|
|
2589
|
-
/* @__PURE__ */
|
|
2731
|
+
/* @__PURE__ */ React4.createElement("div", { className: "studio-home-toolbar" }, /* @__PURE__ */ React4.createElement(
|
|
2590
2732
|
SegmentedControl,
|
|
2591
2733
|
{
|
|
2592
2734
|
label: "Dashboard mode",
|
|
@@ -2597,7 +2739,7 @@ ${"plugin" in ref ? "Use this enabled user-scope component in the Home instance
|
|
|
2597
2739
|
],
|
|
2598
2740
|
onValueChange: (value) => onRoute({ ...route, mode: value === "custom-views" ? value : "dashboard" })
|
|
2599
2741
|
}
|
|
2600
|
-
), /* @__PURE__ */
|
|
2742
|
+
), /* @__PURE__ */ React4.createElement("div", { className: "studio-home-actions", inert: route.mode !== "dashboard" }, /* @__PURE__ */ React4.createElement(
|
|
2601
2743
|
Button,
|
|
2602
2744
|
{
|
|
2603
2745
|
label: "Edit layout",
|
|
@@ -2624,8 +2766,8 @@ ${"plugin" in ref ? "Use this enabled user-scope component in the Home instance
|
|
|
2624
2766
|
})
|
|
2625
2767
|
}
|
|
2626
2768
|
))),
|
|
2627
|
-
/* @__PURE__ */
|
|
2628
|
-
route.mode === "dashboard" ? /* @__PURE__ */
|
|
2769
|
+
/* @__PURE__ */ React4.createElement(HomeBanner, { client }),
|
|
2770
|
+
route.mode === "dashboard" ? /* @__PURE__ */ React4.createElement("div", { className: "studio-home-panels" }, cards.map(mounted)) : /* @__PURE__ */ React4.createElement("section", { className: "studio-home-panel studio-home-views", "aria-label": "Custom Views" }, /* @__PURE__ */ React4.createElement(
|
|
2629
2771
|
Tabs,
|
|
2630
2772
|
{
|
|
2631
2773
|
label: "Custom view library",
|
|
@@ -2635,12 +2777,12 @@ ${"plugin" in ref ? "Use this enabled user-scope component in the Home instance
|
|
|
2635
2777
|
{
|
|
2636
2778
|
value: "preset",
|
|
2637
2779
|
label: "Preset",
|
|
2638
|
-
panel: /* @__PURE__ */
|
|
2780
|
+
panel: /* @__PURE__ */ React4.createElement("div", { className: "studio-home-grid studio-home-gallery", role: "list" }, viewTemplates.map((template) => {
|
|
2639
2781
|
const { title, project: projectName, route: view } = template;
|
|
2640
2782
|
const project = projectName ? props.projects.find(
|
|
2641
2783
|
(item) => item.available && (item.name === projectName || item.name === projectName.toLowerCase().replaceAll(" ", "-"))
|
|
2642
2784
|
) : void 0;
|
|
2643
|
-
return /* @__PURE__ */
|
|
2785
|
+
return /* @__PURE__ */ React4.createElement("article", { className: "studio-home-template", key: title, role: "listitem" }, /* @__PURE__ */ React4.createElement(
|
|
2644
2786
|
"button",
|
|
2645
2787
|
{
|
|
2646
2788
|
type: "button",
|
|
@@ -2657,9 +2799,9 @@ ${"plugin" in ref ? "Use this enabled user-scope component in the Home instance
|
|
|
2657
2799
|
});
|
|
2658
2800
|
}
|
|
2659
2801
|
},
|
|
2660
|
-
/* @__PURE__ */
|
|
2661
|
-
/* @__PURE__ */
|
|
2662
|
-
), /* @__PURE__ */
|
|
2802
|
+
/* @__PURE__ */ React4.createElement("span", { className: "studio-home-preview", "data-preview": template.preview }),
|
|
2803
|
+
/* @__PURE__ */ React4.createElement("span", { className: "studio-template-caption" }, /* @__PURE__ */ React4.createElement("strong", null, title), /* @__PURE__ */ React4.createElement("span", { className: "studio-home-template-summary" }, template.description))
|
|
2804
|
+
), /* @__PURE__ */ React4.createElement(
|
|
2663
2805
|
Button,
|
|
2664
2806
|
{
|
|
2665
2807
|
label: "View Prompt",
|
|
@@ -2678,27 +2820,165 @@ ${"plugin" in ref ? "Use this enabled user-scope component in the Home instance
|
|
|
2678
2820
|
]
|
|
2679
2821
|
}
|
|
2680
2822
|
)),
|
|
2681
|
-
prompt && /* @__PURE__ */
|
|
2823
|
+
prompt && /* @__PURE__ */ React4.createElement(PromptDialog, { prompt, close: () => setPrompt(void 0) })
|
|
2824
|
+
);
|
|
2825
|
+
}
|
|
2826
|
+
|
|
2827
|
+
// packages/studio-workbench/src/welcome-dialog.tsx
|
|
2828
|
+
import * as React5 from "react";
|
|
2829
|
+
var welcomeKey = "vivix.studio.dashboard.welcome.v1";
|
|
2830
|
+
var dramaSampleRequest = "66067767-ff7a-4c73-9cd2-debde07b6ea2";
|
|
2831
|
+
var samples = [
|
|
2832
|
+
{ name: "out-of-steps", cover: "drama", label: "View a Short Drama Sample" },
|
|
2833
|
+
{ name: "cobalt-headphones", cover: "ad", label: "View a Product Ad Sample" }
|
|
2834
|
+
];
|
|
2835
|
+
function WelcomeDialog({
|
|
2836
|
+
client,
|
|
2837
|
+
instanceId,
|
|
2838
|
+
onCreate,
|
|
2839
|
+
onProject
|
|
2840
|
+
}) {
|
|
2841
|
+
const [open, setOpen] = React5.useState(false);
|
|
2842
|
+
const [pending, setPending] = React5.useState();
|
|
2843
|
+
const [error, setError] = React5.useState("");
|
|
2844
|
+
const dataInstance = client.config.dataInstance;
|
|
2845
|
+
const localKey = welcomeKey + "." + (client.scope?.id ?? "user");
|
|
2846
|
+
React5.useEffect(() => {
|
|
2847
|
+
let active = true;
|
|
2848
|
+
async function firstVisit() {
|
|
2849
|
+
try {
|
|
2850
|
+
const seen = await client.invoke(
|
|
2851
|
+
{ instanceId: dataInstance, operationId: "storage.query" },
|
|
2852
|
+
{
|
|
2853
|
+
sql: "SELECT 1 FROM records WHERE type_id = 'extensions.document' AND deleted_at IS NULL AND json_extract(data_json, '$.payload.namespace') = :key LIMIT 1",
|
|
2854
|
+
params: { key: welcomeKey }
|
|
2855
|
+
}
|
|
2856
|
+
);
|
|
2857
|
+
if (!active || seen.length) return;
|
|
2858
|
+
} catch {
|
|
2859
|
+
try {
|
|
2860
|
+
if (localStorage.getItem(localKey)) return;
|
|
2861
|
+
} catch {
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
if (active) setOpen(true);
|
|
2865
|
+
}
|
|
2866
|
+
void firstVisit();
|
|
2867
|
+
return () => {
|
|
2868
|
+
active = false;
|
|
2869
|
+
};
|
|
2870
|
+
}, [client, dataInstance, localKey]);
|
|
2871
|
+
if (!open) return null;
|
|
2872
|
+
function dismiss() {
|
|
2873
|
+
setOpen(false);
|
|
2874
|
+
void client.invoke(
|
|
2875
|
+
{ instanceId: dataInstance, operationId: "documents.create" },
|
|
2876
|
+
{ name: "Studio welcome", payload: { namespace: welcomeKey } },
|
|
2877
|
+
{ requestKey: welcomeKey }
|
|
2878
|
+
).catch(() => {
|
|
2879
|
+
try {
|
|
2880
|
+
localStorage.setItem(localKey, "seen");
|
|
2881
|
+
} catch {
|
|
2882
|
+
}
|
|
2883
|
+
});
|
|
2884
|
+
}
|
|
2885
|
+
async function openSample(sample) {
|
|
2886
|
+
if (pending) return;
|
|
2887
|
+
setPending(sample);
|
|
2888
|
+
setError("");
|
|
2889
|
+
try {
|
|
2890
|
+
const drama = sample === "out-of-steps" ? await client.invoke(
|
|
2891
|
+
{ instanceId, operationId: "workspace.dramaSample" },
|
|
2892
|
+
{}
|
|
2893
|
+
) : void 0;
|
|
2894
|
+
let project;
|
|
2895
|
+
if (drama && !drama.legacy) {
|
|
2896
|
+
if (!client.projects?.create) throw Error("Update Studio CLI to open Out of steps.");
|
|
2897
|
+
project = await client.projects.create({
|
|
2898
|
+
requestId: dramaSampleRequest,
|
|
2899
|
+
name: "Out of steps",
|
|
2900
|
+
preset: drama.preset,
|
|
2901
|
+
trust: true,
|
|
2902
|
+
allowAccess: [
|
|
2903
|
+
"official.request",
|
|
2904
|
+
"events.publish",
|
|
2905
|
+
"project.content.read",
|
|
2906
|
+
"project.content.write"
|
|
2907
|
+
]
|
|
2908
|
+
});
|
|
2909
|
+
} else {
|
|
2910
|
+
project = await client.invoke(
|
|
2911
|
+
{ instanceId, operationId: "workspace.openSample" },
|
|
2912
|
+
{ sample },
|
|
2913
|
+
{ requestKey: crypto.randomUUID() }
|
|
2914
|
+
);
|
|
2915
|
+
}
|
|
2916
|
+
dismiss();
|
|
2917
|
+
onProject(project);
|
|
2918
|
+
} catch (error2) {
|
|
2919
|
+
setError(error2 instanceof Error ? error2.message : String(error2));
|
|
2920
|
+
} finally {
|
|
2921
|
+
setPending(void 0);
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2924
|
+
return /* @__PURE__ */ React5.createElement(
|
|
2925
|
+
Dialog,
|
|
2926
|
+
{
|
|
2927
|
+
title: "Welcome to Vivix Studio",
|
|
2928
|
+
variant: "welcome",
|
|
2929
|
+
className: "studio-welcome",
|
|
2930
|
+
open: true,
|
|
2931
|
+
onOpenChange: (next) => !next && !pending && dismiss()
|
|
2932
|
+
},
|
|
2933
|
+
/* @__PURE__ */ React5.createElement("p", { className: "studio-welcome-intro" }, "Start with a blank project, or explore the sample drafts to get a feel for Vivix Studio's capabilities"),
|
|
2934
|
+
/* @__PURE__ */ React5.createElement("div", { className: "studio-welcome-choices" }, /* @__PURE__ */ React5.createElement(
|
|
2935
|
+
"button",
|
|
2936
|
+
{
|
|
2937
|
+
className: "studio-welcome-choice",
|
|
2938
|
+
type: "button",
|
|
2939
|
+
disabled: !onCreate || !!pending,
|
|
2940
|
+
onClick: () => {
|
|
2941
|
+
dismiss();
|
|
2942
|
+
onCreate?.();
|
|
2943
|
+
}
|
|
2944
|
+
},
|
|
2945
|
+
/* @__PURE__ */ React5.createElement("span", { className: "studio-welcome-cover" }, /* @__PURE__ */ React5.createElement("span", { className: "studio-welcome-plus" }, /* @__PURE__ */ React5.createElement(Icon, { name: "add", size: 18 }))),
|
|
2946
|
+
/* @__PURE__ */ React5.createElement("span", null, "Create a Blank Project")
|
|
2947
|
+
), samples.map(({ name, cover, label }) => /* @__PURE__ */ React5.createElement(
|
|
2948
|
+
"button",
|
|
2949
|
+
{
|
|
2950
|
+
className: "studio-welcome-choice",
|
|
2951
|
+
key: name,
|
|
2952
|
+
type: "button",
|
|
2953
|
+
"aria-label": label,
|
|
2954
|
+
disabled: !!pending,
|
|
2955
|
+
onClick: () => void openSample(name)
|
|
2956
|
+
},
|
|
2957
|
+
/* @__PURE__ */ React5.createElement("span", { className: "studio-welcome-cover", "data-sample": cover }, /* @__PURE__ */ React5.createElement(Tag, null, "Sample project")),
|
|
2958
|
+
/* @__PURE__ */ React5.createElement("span", null, label)
|
|
2959
|
+
))),
|
|
2960
|
+
pending && /* @__PURE__ */ React5.createElement("p", { role: "status" }, "Loading sample project\u2026"),
|
|
2961
|
+
error && /* @__PURE__ */ React5.createElement("p", { role: "alert" }, error)
|
|
2682
2962
|
);
|
|
2683
2963
|
}
|
|
2684
2964
|
|
|
2685
2965
|
// packages/studio-workbench/src/custom-view-dialog.tsx
|
|
2686
|
-
import * as
|
|
2966
|
+
import * as React6 from "react";
|
|
2687
2967
|
function CreateViewDialog({
|
|
2688
2968
|
source,
|
|
2689
2969
|
onClose,
|
|
2690
2970
|
onCopy
|
|
2691
2971
|
}) {
|
|
2692
|
-
const [selected, setSelected] =
|
|
2693
|
-
const [copyFailed, setCopyFailed] =
|
|
2694
|
-
const radioName =
|
|
2695
|
-
const [scroll, setScroll] =
|
|
2696
|
-
const [atEnd, setAtEnd] =
|
|
2697
|
-
const updateFade =
|
|
2972
|
+
const [selected, setSelected] = React6.useState(0);
|
|
2973
|
+
const [copyFailed, setCopyFailed] = React6.useState(false);
|
|
2974
|
+
const radioName = React6.useId();
|
|
2975
|
+
const [scroll, setScroll] = React6.useState(null);
|
|
2976
|
+
const [atEnd, setAtEnd] = React6.useState(false);
|
|
2977
|
+
const updateFade = React6.useCallback(() => {
|
|
2698
2978
|
const element = scroll;
|
|
2699
2979
|
if (element) setAtEnd(element.scrollTop + element.clientHeight >= element.scrollHeight - 1);
|
|
2700
2980
|
}, [scroll]);
|
|
2701
|
-
|
|
2981
|
+
React6.useEffect(() => {
|
|
2702
2982
|
const element = scroll;
|
|
2703
2983
|
if (!element) return;
|
|
2704
2984
|
const observer = new ResizeObserver(updateFade);
|
|
@@ -2707,9 +2987,9 @@ function CreateViewDialog({
|
|
|
2707
2987
|
updateFade();
|
|
2708
2988
|
return () => observer.disconnect();
|
|
2709
2989
|
}, [scroll, updateFade]);
|
|
2710
|
-
const text =
|
|
2990
|
+
const text = React6.useRef(null);
|
|
2711
2991
|
const prompt = createViewPrompt(viewTemplates[selected], source);
|
|
2712
|
-
|
|
2992
|
+
React6.useEffect(() => {
|
|
2713
2993
|
if (copyFailed) {
|
|
2714
2994
|
text.current?.focus();
|
|
2715
2995
|
text.current?.select();
|
|
@@ -2727,14 +3007,14 @@ function CreateViewDialog({
|
|
|
2727
3007
|
onClose();
|
|
2728
3008
|
onCopy();
|
|
2729
3009
|
}
|
|
2730
|
-
return /* @__PURE__ */
|
|
3010
|
+
return /* @__PURE__ */ React6.createElement(
|
|
2731
3011
|
Dialog,
|
|
2732
3012
|
{
|
|
2733
3013
|
title: "Create Custom View",
|
|
2734
3014
|
className: "studio-template-dialog",
|
|
2735
3015
|
open: true,
|
|
2736
3016
|
onOpenChange: (open) => !open && onClose(),
|
|
2737
|
-
actions: /* @__PURE__ */
|
|
3017
|
+
actions: /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(Button, { label: "Cancel", variant: "text-tonal-md", width: "hug", onClick: onClose }), /* @__PURE__ */ React6.createElement(
|
|
2738
3018
|
Button,
|
|
2739
3019
|
{
|
|
2740
3020
|
label: "Copy Prompt",
|
|
@@ -2744,7 +3024,7 @@ function CreateViewDialog({
|
|
|
2744
3024
|
}
|
|
2745
3025
|
))
|
|
2746
3026
|
},
|
|
2747
|
-
/* @__PURE__ */
|
|
3027
|
+
/* @__PURE__ */ React6.createElement("div", { className: "studio-template-body", "data-at-end": atEnd }, /* @__PURE__ */ React6.createElement("div", { className: "studio-template-scroll", ref: setScroll, onScroll: updateFade }, /* @__PURE__ */ React6.createElement(
|
|
2748
3028
|
"div",
|
|
2749
3029
|
{
|
|
2750
3030
|
className: "studio-template-options",
|
|
@@ -2772,7 +3052,7 @@ function CreateViewDialog({
|
|
|
2772
3052
|
grid.querySelectorAll("input")[next]?.focus();
|
|
2773
3053
|
}
|
|
2774
3054
|
},
|
|
2775
|
-
viewTemplates.map(({ title, description, preview }, index) => /* @__PURE__ */
|
|
3055
|
+
viewTemplates.map(({ title, description, preview }, index) => /* @__PURE__ */ React6.createElement("label", { className: "studio-template-option", key: title }, /* @__PURE__ */ React6.createElement(
|
|
2776
3056
|
"input",
|
|
2777
3057
|
{
|
|
2778
3058
|
type: "radio",
|
|
@@ -2781,13 +3061,13 @@ function CreateViewDialog({
|
|
|
2781
3061
|
checked: selected === index,
|
|
2782
3062
|
onChange: () => setSelected(index)
|
|
2783
3063
|
}
|
|
2784
|
-
), /* @__PURE__ */
|
|
2785
|
-
), copyFailed && /* @__PURE__ */
|
|
3064
|
+
), /* @__PURE__ */ React6.createElement("span", { className: "studio-home-preview", "data-preview": preview, "aria-hidden": "true" }), /* @__PURE__ */ React6.createElement("strong", null, title), /* @__PURE__ */ React6.createElement("small", null, description)))
|
|
3065
|
+
), copyFailed && /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement("p", { role: "alert" }, "Could not copy the prompt. Copy the selected text to your agent chat."), /* @__PURE__ */ React6.createElement("textarea", { ref: text, value: prompt, "aria-label": "Prompt", readOnly: true, rows: 5 }))))
|
|
2786
3066
|
);
|
|
2787
3067
|
}
|
|
2788
3068
|
|
|
2789
3069
|
// packages/studio-workbench/src/studio-glyph.tsx
|
|
2790
|
-
import * as
|
|
3070
|
+
import * as React7 from "react";
|
|
2791
3071
|
var paths = {
|
|
2792
3072
|
projects: [
|
|
2793
3073
|
"M6.66803 5.83333H10.0023M10.0023 5.83333H13.9617C15.7177 5.83333 16.5958 5.83333 17.2265 6.25466C17.4995 6.43706 17.734 6.67143 17.9164 6.94441C18.2448 7.43568 18.3173 8.07703 18.3333 9.16667M10.0023 5.83333L9.47426 4.7776C9.03683 3.90298 8.63709 3.0226 7.66768 2.65917C7.2431 2.5 6.75807 2.5 5.78802 2.5C4.27388 2.5 3.51681 2.5 2.94874 2.81693C2.54379 3.04285 2.20966 3.37689 1.98368 3.78172C1.66667 4.34964 1.66667 5.1065 1.66667 6.62023V9.16667C1.66667 13.095 1.66667 15.0592 2.88739 16.2796C4.10811 17.5 6.07283 17.5 10.0023 17.5",
|
|
@@ -2811,7 +3091,7 @@ var paths = {
|
|
|
2811
3091
|
]
|
|
2812
3092
|
};
|
|
2813
3093
|
function StudioGlyph({ name }) {
|
|
2814
|
-
return /* @__PURE__ */
|
|
3094
|
+
return /* @__PURE__ */ React7.createElement(
|
|
2815
3095
|
"svg",
|
|
2816
3096
|
{
|
|
2817
3097
|
className: "studio-glyph",
|
|
@@ -2825,7 +3105,7 @@ function StudioGlyph({ name }) {
|
|
|
2825
3105
|
strokeLinecap: "round",
|
|
2826
3106
|
strokeLinejoin: "round"
|
|
2827
3107
|
},
|
|
2828
|
-
paths[name].map((d, index) => /* @__PURE__ */
|
|
3108
|
+
paths[name].map((d, index) => /* @__PURE__ */ React7.createElement("path", { key: index, d }))
|
|
2829
3109
|
);
|
|
2830
3110
|
}
|
|
2831
3111
|
|
|
@@ -2918,16 +3198,27 @@ var fallbackFavorites = () => {
|
|
|
2918
3198
|
}
|
|
2919
3199
|
};
|
|
2920
3200
|
};
|
|
2921
|
-
function
|
|
3201
|
+
function thumbnail(row) {
|
|
3202
|
+
if (typeof row?.posterUrl === "string") return { url: row.posterUrl, kind: "image" };
|
|
3203
|
+
if (typeof row?.previewUrl === "string" && typeof row.kind === "string")
|
|
3204
|
+
return { url: row.previewUrl, kind: row.kind };
|
|
3205
|
+
}
|
|
3206
|
+
function referenceValue(value) {
|
|
3207
|
+
return decodeRef(assetMetadata(value).ref ?? value);
|
|
3208
|
+
}
|
|
3209
|
+
function AssetThumbnail({
|
|
3210
|
+
className,
|
|
3211
|
+
known,
|
|
2922
3212
|
cover,
|
|
2923
3213
|
pending,
|
|
2924
3214
|
resolvePreview
|
|
2925
3215
|
}) {
|
|
2926
|
-
const anchor2 =
|
|
2927
|
-
const [preview, setPreview] =
|
|
2928
|
-
const resolve =
|
|
2929
|
-
|
|
2930
|
-
|
|
3216
|
+
const anchor2 = React8.useRef(null);
|
|
3217
|
+
const [preview, setPreview] = React8.useState();
|
|
3218
|
+
const resolve = React8.useEffectEvent(resolvePreview);
|
|
3219
|
+
const key3 = cover && !known ? refKey(cover) : null;
|
|
3220
|
+
React8.useEffect(() => {
|
|
3221
|
+
if (!cover || !key3 || !anchor2.current) return;
|
|
2931
3222
|
let active = true;
|
|
2932
3223
|
const load = () => {
|
|
2933
3224
|
void resolve(cover).then(
|
|
@@ -2945,16 +3236,16 @@ function ProjectThumbnail({
|
|
|
2945
3236
|
active = false;
|
|
2946
3237
|
observer.disconnect();
|
|
2947
3238
|
};
|
|
2948
|
-
}, [
|
|
2949
|
-
return /* @__PURE__ */
|
|
3239
|
+
}, [key3]);
|
|
3240
|
+
return /* @__PURE__ */ React8.createElement(
|
|
2950
3241
|
CoverPreview,
|
|
2951
3242
|
{
|
|
2952
|
-
className
|
|
3243
|
+
className,
|
|
2953
3244
|
ref: anchor2,
|
|
2954
3245
|
iconSize: 16,
|
|
2955
|
-
kind: preview?.kind,
|
|
2956
|
-
src: preview?.url,
|
|
2957
|
-
pending: pending || Boolean(
|
|
3246
|
+
kind: (known ?? preview)?.kind,
|
|
3247
|
+
src: (known ?? preview)?.url,
|
|
3248
|
+
pending: pending || Boolean(key3 && preview === void 0)
|
|
2958
3249
|
}
|
|
2959
3250
|
);
|
|
2960
3251
|
}
|
|
@@ -2966,17 +3257,18 @@ function QueryCover({
|
|
|
2966
3257
|
onSelect,
|
|
2967
3258
|
onOpen,
|
|
2968
3259
|
previewKey,
|
|
3260
|
+
cachedPreview,
|
|
2969
3261
|
resolvePreview,
|
|
2970
3262
|
selectionStyle,
|
|
2971
3263
|
projectId
|
|
2972
3264
|
}) {
|
|
2973
3265
|
const poster = view.source === "assets" && typeof row.posterUrl === "string" ? row.posterUrl : void 0;
|
|
2974
3266
|
const sourceUrl = poster ?? previewSource(row, view);
|
|
2975
|
-
const [resolved, setResolved] =
|
|
2976
|
-
const resolver =
|
|
3267
|
+
const [resolved, setResolved] = React8.useState(null);
|
|
3268
|
+
const resolver = React8.useRef(resolvePreview);
|
|
2977
3269
|
resolver.current = resolvePreview;
|
|
2978
|
-
|
|
2979
|
-
if (sourceUrl || !previewKey || !resolver.current) return;
|
|
3270
|
+
React8.useEffect(() => {
|
|
3271
|
+
if (sourceUrl || cachedPreview || !previewKey || !resolver.current) return;
|
|
2980
3272
|
let active = true;
|
|
2981
3273
|
void resolver.current().then((preview) => {
|
|
2982
3274
|
if (active) setResolved({ key: previewKey, ...preview });
|
|
@@ -2986,13 +3278,13 @@ function QueryCover({
|
|
|
2986
3278
|
return () => {
|
|
2987
3279
|
active = false;
|
|
2988
3280
|
};
|
|
2989
|
-
}, [sourceUrl, previewKey]);
|
|
2990
|
-
const url = sourceUrl || (resolved?.key === previewKey ? resolved?.url : void 0);
|
|
2991
|
-
const [failed, setFailed] =
|
|
2992
|
-
|
|
2993
|
-
const kind2 = resolved?.key === previewKey && resolved?.kind ? resolved.kind : typeof row.kind === "string" ? row.kind : typeof row.mimeType === "string" ? row.mimeType.split("/")[0] : "";
|
|
3281
|
+
}, [sourceUrl, cachedPreview, previewKey]);
|
|
3282
|
+
const url = sourceUrl || cachedPreview?.url || (resolved?.key === previewKey ? resolved?.url : void 0);
|
|
3283
|
+
const [failed, setFailed] = React8.useState(false);
|
|
3284
|
+
React8.useEffect(() => setFailed(false), [url]);
|
|
3285
|
+
const kind2 = cachedPreview?.kind ?? (resolved?.key === previewKey && resolved?.kind ? resolved.kind : typeof row.kind === "string" ? row.kind : typeof row.mimeType === "string" ? row.mimeType.split("/")[0] : "");
|
|
2994
3286
|
const image = kind2 === "image" || Boolean(poster), video = kind2 === "video" && !poster;
|
|
2995
|
-
return /* @__PURE__ */
|
|
3287
|
+
return /* @__PURE__ */ React8.createElement(
|
|
2996
3288
|
"div",
|
|
2997
3289
|
{
|
|
2998
3290
|
className: "studio-cover",
|
|
@@ -3000,7 +3292,7 @@ function QueryCover({
|
|
|
3000
3292
|
"data-magic-edit-project": projectId,
|
|
3001
3293
|
onErrorCapture: () => setFailed(true)
|
|
3002
3294
|
},
|
|
3003
|
-
/* @__PURE__ */
|
|
3295
|
+
/* @__PURE__ */ React8.createElement(
|
|
3004
3296
|
Media,
|
|
3005
3297
|
{
|
|
3006
3298
|
src: image && !failed ? url : void 0,
|
|
@@ -3010,7 +3302,7 @@ function QueryCover({
|
|
|
3010
3302
|
synopsis: typeof row.synopsis === "string" ? row.synopsis : void 0,
|
|
3011
3303
|
src: url
|
|
3012
3304
|
} : void 0,
|
|
3013
|
-
emptyAppearance: view.source === "projects" ? "surface" : kind2 === "text" ? "script" : kind2 === "video" || kind2 === "audio" ? kind2 : "image",
|
|
3305
|
+
emptyAppearance: video && url && !failed ? "black" : view.source === "projects" ? "surface" : kind2 === "text" ? "script" : kind2 === "video" || kind2 === "audio" ? kind2 : "image",
|
|
3014
3306
|
fit: "contain",
|
|
3015
3307
|
state: selected ? "selected" : "default",
|
|
3016
3308
|
selectionStyle: selectionStyle ?? (selecting ? "checkbox" : "outline"),
|
|
@@ -3018,7 +3310,7 @@ function QueryCover({
|
|
|
3018
3310
|
onOpen
|
|
3019
3311
|
}
|
|
3020
3312
|
),
|
|
3021
|
-
video && url && !failed ? /* @__PURE__ */
|
|
3313
|
+
video && url && !failed ? /* @__PURE__ */ React8.createElement(
|
|
3022
3314
|
"video",
|
|
3023
3315
|
{
|
|
3024
3316
|
className: "studio-cover-video",
|
|
@@ -3035,11 +3327,11 @@ function displayCell(row, column2) {
|
|
|
3035
3327
|
const value = row[column2.path];
|
|
3036
3328
|
if (column2.format === "categories") {
|
|
3037
3329
|
const values = parseArray(value).filter((item) => typeof item === "string");
|
|
3038
|
-
return values.length ? /* @__PURE__ */
|
|
3330
|
+
return values.length ? /* @__PURE__ */ React8.createElement("span", { className: "studio-categories" }, values.map((item, index) => /* @__PURE__ */ React8.createElement(Tag, { key: index, variant: "neutral" }, item))) : "--";
|
|
3039
3331
|
}
|
|
3040
3332
|
if (column2.role === "state")
|
|
3041
|
-
return /* @__PURE__ */
|
|
3042
|
-
return /* @__PURE__ */
|
|
3333
|
+
return /* @__PURE__ */ React8.createElement("span", { className: "studio-task-state", "data-state": String(value) }, ["remote_succeeded", "saving", "save_failed", "partial"].includes(String(value)) && columnText(row.remoteOutcome).includes("succeeded") ? "Remote complete \xB7 " : "", taskLabels[String(value)] ?? columnText(value));
|
|
3334
|
+
return /* @__PURE__ */ React8.createElement("span", { className: "studio-cell-text", title: columnText(value, column2.format) }, columnText(value, column2.format));
|
|
3043
3335
|
}
|
|
3044
3336
|
function CustomViewEditor({
|
|
3045
3337
|
saved,
|
|
@@ -3047,11 +3339,11 @@ function CustomViewEditor({
|
|
|
3047
3339
|
onSave
|
|
3048
3340
|
}) {
|
|
3049
3341
|
const isCopy = saved.revision === 0;
|
|
3050
|
-
const formId =
|
|
3051
|
-
const [name, setName] =
|
|
3052
|
-
const [columns, setColumns] =
|
|
3053
|
-
const [error, setError] =
|
|
3054
|
-
const [saving, setSaving] =
|
|
3342
|
+
const formId = React8.useId();
|
|
3343
|
+
const [name, setName] = React8.useState(isCopy ? `${saved.view.name} view` : saved.view.name);
|
|
3344
|
+
const [columns, setColumns] = React8.useState(saved.view.columns);
|
|
3345
|
+
const [error, setError] = React8.useState("");
|
|
3346
|
+
const [saving, setSaving] = React8.useState(false);
|
|
3055
3347
|
const valid = name.trim() && columns.some((column2) => column2.visible);
|
|
3056
3348
|
const submit = async () => {
|
|
3057
3349
|
if (!valid || saving) return;
|
|
@@ -3065,7 +3357,7 @@ function CustomViewEditor({
|
|
|
3065
3357
|
setSaving(false);
|
|
3066
3358
|
}
|
|
3067
3359
|
};
|
|
3068
|
-
return /* @__PURE__ */
|
|
3360
|
+
return /* @__PURE__ */ React8.createElement(
|
|
3069
3361
|
Dialog,
|
|
3070
3362
|
{
|
|
3071
3363
|
title: "Edit view",
|
|
@@ -3073,7 +3365,7 @@ function CustomViewEditor({
|
|
|
3073
3365
|
onOpenChange: (open) => {
|
|
3074
3366
|
if (!open && !saving) onClose();
|
|
3075
3367
|
},
|
|
3076
|
-
actions: /* @__PURE__ */
|
|
3368
|
+
actions: /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(Button, { label: "Cancel", variant: "text-tonal-sm", disabled: saving, onClick: onClose }), /* @__PURE__ */ React8.createElement(
|
|
3077
3369
|
Button,
|
|
3078
3370
|
{
|
|
3079
3371
|
label: isCopy ? "Save as view" : "Save view",
|
|
@@ -3084,7 +3376,7 @@ function CustomViewEditor({
|
|
|
3084
3376
|
}
|
|
3085
3377
|
))
|
|
3086
3378
|
},
|
|
3087
|
-
/* @__PURE__ */
|
|
3379
|
+
/* @__PURE__ */ React8.createElement(
|
|
3088
3380
|
"form",
|
|
3089
3381
|
{
|
|
3090
3382
|
className: "studio-view-form",
|
|
@@ -3094,7 +3386,7 @@ function CustomViewEditor({
|
|
|
3094
3386
|
void submit();
|
|
3095
3387
|
}
|
|
3096
3388
|
},
|
|
3097
|
-
/* @__PURE__ */
|
|
3389
|
+
/* @__PURE__ */ React8.createElement(
|
|
3098
3390
|
TextInput,
|
|
3099
3391
|
{
|
|
3100
3392
|
label: "View name",
|
|
@@ -3105,7 +3397,7 @@ function CustomViewEditor({
|
|
|
3105
3397
|
disabled: saving
|
|
3106
3398
|
}
|
|
3107
3399
|
),
|
|
3108
|
-
/* @__PURE__ */
|
|
3400
|
+
/* @__PURE__ */ React8.createElement("fieldset", { disabled: saving }, /* @__PURE__ */ React8.createElement("legend", null, "Visible columns"), columns.map((column2) => /* @__PURE__ */ React8.createElement(
|
|
3109
3401
|
Checkbox,
|
|
3110
3402
|
{
|
|
3111
3403
|
key: column2.path,
|
|
@@ -3116,31 +3408,76 @@ function CustomViewEditor({
|
|
|
3116
3408
|
)
|
|
3117
3409
|
}
|
|
3118
3410
|
))),
|
|
3119
|
-
!columns.some((column2) => column2.visible) && /* @__PURE__ */
|
|
3120
|
-
error && /* @__PURE__ */
|
|
3411
|
+
!columns.some((column2) => column2.visible) && /* @__PURE__ */ React8.createElement("p", null, "Choose at least one column."),
|
|
3412
|
+
error && /* @__PURE__ */ React8.createElement("p", { role: "alert" }, error)
|
|
3121
3413
|
)
|
|
3122
3414
|
);
|
|
3123
3415
|
}
|
|
3416
|
+
function mediaAspectRatio(width, height) {
|
|
3417
|
+
let a = width, b = height;
|
|
3418
|
+
while (b) [a, b] = [b, a % b];
|
|
3419
|
+
return `${width / a}:${height / a}`;
|
|
3420
|
+
}
|
|
3421
|
+
function DetailPrompt({ value }) {
|
|
3422
|
+
const [expanded, setExpanded] = React8.useState(false);
|
|
3423
|
+
const [clipped, setClipped] = React8.useState(false);
|
|
3424
|
+
const paragraph = React8.useRef(null);
|
|
3425
|
+
React8.useLayoutEffect(() => {
|
|
3426
|
+
const p = paragraph.current;
|
|
3427
|
+
if (!p || expanded) return;
|
|
3428
|
+
const measure = () => setClipped(p.scrollHeight > p.clientHeight + 1);
|
|
3429
|
+
measure();
|
|
3430
|
+
const observer = new ResizeObserver(measure);
|
|
3431
|
+
observer.observe(p);
|
|
3432
|
+
return () => observer.disconnect();
|
|
3433
|
+
}, [value, expanded]);
|
|
3434
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("p", { ref: paragraph, className: "studio-prompt", "data-expanded": expanded }, value), (clipped || expanded) && /* @__PURE__ */ React8.createElement(
|
|
3435
|
+
"button",
|
|
3436
|
+
{
|
|
3437
|
+
type: "button",
|
|
3438
|
+
className: "studio-prompt-toggle",
|
|
3439
|
+
"aria-expanded": expanded,
|
|
3440
|
+
onClick: () => setExpanded(!expanded)
|
|
3441
|
+
},
|
|
3442
|
+
expanded ? "Show less" : "Show more"
|
|
3443
|
+
));
|
|
3444
|
+
}
|
|
3124
3445
|
function Detail({
|
|
3125
3446
|
detail,
|
|
3126
3447
|
refValue,
|
|
3127
3448
|
busy,
|
|
3128
3449
|
onBack,
|
|
3129
3450
|
onVersion,
|
|
3451
|
+
references,
|
|
3130
3452
|
onFavorite,
|
|
3131
3453
|
onDownload,
|
|
3132
3454
|
onProject,
|
|
3133
|
-
project
|
|
3455
|
+
project,
|
|
3456
|
+
error,
|
|
3457
|
+
notice
|
|
3134
3458
|
}) {
|
|
3135
3459
|
const item = detail?.item;
|
|
3136
|
-
const [
|
|
3137
|
-
const
|
|
3138
|
-
const
|
|
3460
|
+
const [information, setInformation] = React8.useState(false);
|
|
3461
|
+
const version = detail?.versions.find((v) => v.versionId === refValue.versionId);
|
|
3462
|
+
const payload = version?.payload;
|
|
3463
|
+
const width = Number(payload?.width);
|
|
3464
|
+
const height = Number(payload?.height);
|
|
3465
|
+
const duration = Number(payload?.durationMs);
|
|
3466
|
+
const dimensions = width > 0 && height > 0;
|
|
3467
|
+
const ratio2 = dimensions ? mediaAspectRatio(width, height) : void 0;
|
|
3468
|
+
const facts = [
|
|
3469
|
+
ratio2,
|
|
3470
|
+
dimensions ? item?.kind === "video" ? `${Math.min(width, height)}P` : `${width} \xD7 ${height}` : void 0,
|
|
3471
|
+
duration > 0 ? `${Number((duration / 1e3).toFixed(2))}s` : void 0
|
|
3472
|
+
].filter(Boolean);
|
|
3473
|
+
const prompt = typeof item?.prompt === "string" ? item.prompt.trim() : "";
|
|
3474
|
+
const savedVersions = parseArray(item?.favoriteRefs).map(decodeRef).filter((ref) => ref !== null);
|
|
3475
|
+
const [text, setText] = React8.useState("");
|
|
3476
|
+
const [previewError, setPreviewError] = React8.useState("");
|
|
3139
3477
|
const url = typeof item?.previewUrl === "string" ? item.previewUrl : void 0;
|
|
3140
|
-
|
|
3478
|
+
React8.useEffect(() => {
|
|
3141
3479
|
setText("");
|
|
3142
3480
|
setPreviewError("");
|
|
3143
|
-
setExpanded(false);
|
|
3144
3481
|
if (item?.kind !== "text" || !url) return;
|
|
3145
3482
|
const abort = new AbortController();
|
|
3146
3483
|
void (async () => {
|
|
@@ -3150,47 +3487,68 @@ function Detail({
|
|
|
3150
3487
|
setText(
|
|
3151
3488
|
preview.text + (preview.truncated ? "\n\nPreview truncated. Download this version to read the full text." : "")
|
|
3152
3489
|
);
|
|
3153
|
-
})().catch((
|
|
3154
|
-
if (!abort.signal.aborted) setPreviewError(message(
|
|
3490
|
+
})().catch((error2) => {
|
|
3491
|
+
if (!abort.signal.aborted) setPreviewError(message(error2));
|
|
3155
3492
|
});
|
|
3156
3493
|
return () => abort.abort();
|
|
3157
3494
|
}, [url, item?.kind, refValue.versionId]);
|
|
3158
|
-
const section = (label, contents) => /* @__PURE__ */
|
|
3159
|
-
return /* @__PURE__ */
|
|
3160
|
-
"
|
|
3495
|
+
const section = (label, contents) => /* @__PURE__ */ React8.createElement("section", { className: "studio-detail-group" }, /* @__PURE__ */ React8.createElement("span", null, label), contents);
|
|
3496
|
+
return /* @__PURE__ */ React8.createElement(
|
|
3497
|
+
"main",
|
|
3161
3498
|
{
|
|
3162
3499
|
className: "studio-asset-detail",
|
|
3163
3500
|
"aria-label": "Asset details",
|
|
3164
3501
|
"data-magic-edit-project": item?.projectId
|
|
3165
3502
|
},
|
|
3166
|
-
/* @__PURE__ */
|
|
3503
|
+
/* @__PURE__ */ React8.createElement("div", { className: "studio-preview-stage" }, /* @__PURE__ */ React8.createElement(
|
|
3167
3504
|
Button,
|
|
3168
3505
|
{
|
|
3506
|
+
autoFocus: true,
|
|
3169
3507
|
className: "studio-detail-back",
|
|
3170
3508
|
label: "Back",
|
|
3171
3509
|
variant: "pill-small",
|
|
3172
3510
|
leadingIcon: "chevron-left",
|
|
3173
3511
|
onClick: onBack
|
|
3174
3512
|
}
|
|
3175
|
-
), /* @__PURE__ */
|
|
3176
|
-
|
|
3513
|
+
), /* @__PURE__ */ React8.createElement("div", { className: "studio-preview-actions" }, /* @__PURE__ */ React8.createElement(
|
|
3514
|
+
IconButton,
|
|
3177
3515
|
{
|
|
3516
|
+
icon: "download",
|
|
3178
3517
|
label: "Download asset",
|
|
3179
|
-
variant: "pill-small",
|
|
3180
3518
|
disabled: !detail || busy,
|
|
3181
3519
|
onClick: () => onDownload([refValue])
|
|
3182
3520
|
}
|
|
3183
|
-
),
|
|
3184
|
-
|
|
3521
|
+
), /* @__PURE__ */ React8.createElement(
|
|
3522
|
+
IconButton,
|
|
3185
3523
|
{
|
|
3186
|
-
|
|
3187
|
-
|
|
3524
|
+
icon: "favorite",
|
|
3525
|
+
label: item?.favorite ? "Remove favorite" : "Add favorite",
|
|
3188
3526
|
"aria-pressed": Boolean(item?.favorite),
|
|
3189
|
-
disabled: busy,
|
|
3527
|
+
disabled: !detail || busy,
|
|
3190
3528
|
onClick: () => onFavorite(refValue, !item?.favorite)
|
|
3191
|
-
}
|
|
3192
|
-
|
|
3193
|
-
|
|
3529
|
+
}
|
|
3530
|
+
), /* @__PURE__ */ React8.createElement(
|
|
3531
|
+
Menu,
|
|
3532
|
+
{
|
|
3533
|
+
label: "More asset actions",
|
|
3534
|
+
triggerIcon: "more",
|
|
3535
|
+
floating: true,
|
|
3536
|
+
items: [
|
|
3537
|
+
{
|
|
3538
|
+
id: "info",
|
|
3539
|
+
label: information ? "Hide asset information" : "Show asset information",
|
|
3540
|
+
disabled: !detail,
|
|
3541
|
+
onSelect: () => setInformation(!information)
|
|
3542
|
+
},
|
|
3543
|
+
{
|
|
3544
|
+
id: "project",
|
|
3545
|
+
label: "Open project",
|
|
3546
|
+
disabled: !project?.available,
|
|
3547
|
+
onSelect: () => onProject(String(item?.projectId))
|
|
3548
|
+
}
|
|
3549
|
+
]
|
|
3550
|
+
}
|
|
3551
|
+
)), !detail ? error ? /* @__PURE__ */ React8.createElement("p", { role: "alert" }, error) : /* @__PURE__ */ React8.createElement("p", { role: "status" }, "Loading asset\u2026") : previewError ? /* @__PURE__ */ React8.createElement("p", { role: "alert" }, previewError) : !url ? /* @__PURE__ */ React8.createElement("p", null, "No preview available for this version.") : item?.kind === "video" ? /* @__PURE__ */ React8.createElement("div", { className: "studio-detail-canvas" }, /* @__PURE__ */ React8.createElement(
|
|
3194
3552
|
VideoPlayer,
|
|
3195
3553
|
{
|
|
3196
3554
|
key: url,
|
|
@@ -3200,7 +3558,7 @@ function Detail({
|
|
|
3200
3558
|
poster: typeof item.posterUrl === "string" ? item.posterUrl : void 0,
|
|
3201
3559
|
onError: () => setPreviewError("The video preview could not be loaded.")
|
|
3202
3560
|
}
|
|
3203
|
-
)) : item?.kind === "audio" ? /* @__PURE__ */
|
|
3561
|
+
)) : item?.kind === "audio" ? /* @__PURE__ */ React8.createElement(
|
|
3204
3562
|
"audio",
|
|
3205
3563
|
{
|
|
3206
3564
|
controls: true,
|
|
@@ -3208,7 +3566,7 @@ function Detail({
|
|
|
3208
3566
|
"aria-label": String(item.name),
|
|
3209
3567
|
onError: () => setPreviewError("The audio preview could not be loaded.")
|
|
3210
3568
|
}
|
|
3211
|
-
) : item?.kind === "text" ? /* @__PURE__ */
|
|
3569
|
+
) : item?.kind === "text" ? /* @__PURE__ */ React8.createElement("pre", { className: "studio-text-preview" }, text) : /* @__PURE__ */ React8.createElement(
|
|
3212
3570
|
"img",
|
|
3213
3571
|
{
|
|
3214
3572
|
src: url,
|
|
@@ -3216,9 +3574,15 @@ function Detail({
|
|
|
3216
3574
|
onError: () => setPreviewError("The image preview could not be loaded.")
|
|
3217
3575
|
}
|
|
3218
3576
|
)),
|
|
3219
|
-
/* @__PURE__ */
|
|
3577
|
+
/* @__PURE__ */ React8.createElement("aside", { className: "studio-preview-details" }, detail && /* @__PURE__ */ React8.createElement(React8.Fragment, null, prompt && section(
|
|
3578
|
+
item?.kind === "video" ? "Video prompt" : item?.kind === "image" ? "Image prompt" : "Prompt",
|
|
3579
|
+
/* @__PURE__ */ React8.createElement(DetailPrompt, { key: refKey(refValue), value: prompt })
|
|
3580
|
+
), parseArray(item?.refs).some(referenceValue) && section("Reference", references(item?.refs)), item?.modelId && section("Model", /* @__PURE__ */ React8.createElement("p", null, String(item.modelId))), section(
|
|
3581
|
+
"Details",
|
|
3582
|
+
/* @__PURE__ */ React8.createElement("p", { className: "studio-media-facts" }, ratio2 && /* @__PURE__ */ React8.createElement("span", { "aria-hidden": "true", className: "studio-ratio-icon" }), facts.length ? facts.join(" \xB7 ") : String(item?.mimeType ?? item?.kind ?? "--"))
|
|
3583
|
+
), (information || detail.versions.length > 1) && section(
|
|
3220
3584
|
"Version",
|
|
3221
|
-
/* @__PURE__ */
|
|
3585
|
+
/* @__PURE__ */ React8.createElement(
|
|
3222
3586
|
Dropdown,
|
|
3223
3587
|
{
|
|
3224
3588
|
label: "Asset version",
|
|
@@ -3230,52 +3594,9 @@ function Detail({
|
|
|
3230
3594
|
onValueChange: (versionId) => onVersion({ ...refValue, versionId })
|
|
3231
3595
|
}
|
|
3232
3596
|
)
|
|
3233
|
-
), section(
|
|
3234
|
-
"Prompt",
|
|
3235
|
-
/* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement("p", { className: "studio-prompt", "data-expanded": expanded }, String(item?.prompt ?? "Unavailable for this version")), item?.prompt && /* @__PURE__ */ React6.createElement(
|
|
3236
|
-
Button,
|
|
3237
|
-
{
|
|
3238
|
-
label: expanded ? "Show less" : "Show more",
|
|
3239
|
-
variant: "text-tonal-sm",
|
|
3240
|
-
"aria-expanded": expanded,
|
|
3241
|
-
onClick: () => setExpanded(!expanded)
|
|
3242
|
-
}
|
|
3243
|
-
))
|
|
3244
|
-
), section(
|
|
3245
|
-
"Original prompt",
|
|
3246
|
-
/* @__PURE__ */ React6.createElement("p", null, String(item?.originalPrompt ?? "Unavailable for this version"))
|
|
3247
|
-
), section(
|
|
3248
|
-
"Reference",
|
|
3249
|
-
/* @__PURE__ */ React6.createElement("div", { className: "studio-reference-list" }, parseArray(item?.refs).length ? parseArray(item?.refs).map((value, index) => {
|
|
3250
|
-
const input = value;
|
|
3251
|
-
const ref = decodeRef(input.ref);
|
|
3252
|
-
return ref ? /* @__PURE__ */ React6.createElement(
|
|
3253
|
-
Button,
|
|
3254
|
-
{
|
|
3255
|
-
key: index,
|
|
3256
|
-
label: `Reference ${index + 1}${input.role ? ` \xB7 ${input.role}` : ""}`,
|
|
3257
|
-
variant: "text-tonal-sm",
|
|
3258
|
-
onClick: () => onVersion(ref)
|
|
3259
|
-
}
|
|
3260
|
-
) : /* @__PURE__ */ React6.createElement("span", { key: index }, "Unavailable reference");
|
|
3261
|
-
}) : /* @__PURE__ */ React6.createElement("span", null, "\u2014"))
|
|
3262
|
-
), section("Model", /* @__PURE__ */ React6.createElement("p", null, String(item?.modelId ?? "Unavailable for this version"))), section(
|
|
3263
|
-
"Parameters",
|
|
3264
|
-
/* @__PURE__ */ React6.createElement("pre", null, item?.parameters === null || item?.parameters === void 0 ? "Unavailable for this version" : JSON.stringify(item.parameters, null, 2))
|
|
3265
|
-
), section(
|
|
3266
|
-
"Project",
|
|
3267
|
-
/* @__PURE__ */ React6.createElement(
|
|
3268
|
-
Button,
|
|
3269
|
-
{
|
|
3270
|
-
label: project?.name ?? String(item?.projectId ?? "Unavailable project"),
|
|
3271
|
-
disabled: !project?.available,
|
|
3272
|
-
variant: "text-tonal-sm",
|
|
3273
|
-
onClick: () => onProject(String(item?.projectId))
|
|
3274
|
-
}
|
|
3275
|
-
)
|
|
3276
|
-
), section("Metadata", /* @__PURE__ */ React6.createElement("pre", null, JSON.stringify(item?.metadata ?? {}, null, 2))), section(
|
|
3597
|
+
), information && /* @__PURE__ */ React8.createElement(React8.Fragment, null, section("Title", /* @__PURE__ */ React8.createElement("p", null, String(item?.name ?? "Asset"))), item?.originalPrompt && section("Original prompt", /* @__PURE__ */ React8.createElement("p", null, String(item.originalPrompt))), item?.parameters && section("Parameters", /* @__PURE__ */ React8.createElement("pre", null, JSON.stringify(item.parameters, null, 2))), item?.metadata && section("Metadata", /* @__PURE__ */ React8.createElement("pre", null, JSON.stringify(item.metadata, null, 2))), savedVersions.length > 0 && section(
|
|
3277
3598
|
"Saved favorites",
|
|
3278
|
-
/* @__PURE__ */
|
|
3599
|
+
/* @__PURE__ */ React8.createElement("div", { className: "studio-reference-list" }, savedVersions.map((ref) => /* @__PURE__ */ React8.createElement(
|
|
3279
3600
|
Button,
|
|
3280
3601
|
{
|
|
3281
3602
|
key: refKey(ref),
|
|
@@ -3284,57 +3605,57 @@ function Detail({
|
|
|
3284
3605
|
onClick: () => onVersion(ref)
|
|
3285
3606
|
}
|
|
3286
3607
|
)))
|
|
3287
|
-
)))
|
|
3608
|
+
)), error && /* @__PURE__ */ React8.createElement("p", { className: "studio-error", role: "alert" }, error), notice && /* @__PURE__ */ React8.createElement("p", { role: "status" }, notice)))
|
|
3288
3609
|
);
|
|
3289
3610
|
}
|
|
3290
3611
|
function GlobalWorkbench({ client }) {
|
|
3291
|
-
const bridge =
|
|
3612
|
+
const bridge = React8.useMemo(() => userActionsBridge(client, client.config), [client]);
|
|
3292
3613
|
const scopeIdentity = JSON.stringify(client.scope);
|
|
3293
3614
|
const theme = useWorkspaceTheme();
|
|
3294
3615
|
const ownInstance = client.instanceId || Config.parse(client.config).operationInstance;
|
|
3295
|
-
const [route, setRoute] =
|
|
3296
|
-
const [saved, setSaved] =
|
|
3297
|
-
const [loadedSource, setLoadedSource] =
|
|
3298
|
-
const [catalogSnapshot, setCatalog] =
|
|
3299
|
-
const [summariesPending, setSummariesPending] =
|
|
3300
|
-
const [projectSummaries, setProjectSummaries] =
|
|
3616
|
+
const [route, setRoute] = React8.useState(() => readRoute(new URL(window.location.href)));
|
|
3617
|
+
const [saved, setSaved] = React8.useState([]);
|
|
3618
|
+
const [loadedSource, setLoadedSource] = React8.useState(null);
|
|
3619
|
+
const [catalogSnapshot, setCatalog] = React8.useState(null);
|
|
3620
|
+
const [summariesPending, setSummariesPending] = React8.useState(true);
|
|
3621
|
+
const [projectSummaries, setProjectSummaries] = React8.useState(
|
|
3301
3622
|
/* @__PURE__ */ new Map()
|
|
3302
3623
|
);
|
|
3303
|
-
const [catalogRevision, refreshCatalog] =
|
|
3624
|
+
const [catalogRevision, refreshCatalog] = React8.useReducer((revision) => revision + 1, 0);
|
|
3304
3625
|
const catalog = catalogSnapshot ?? [];
|
|
3305
|
-
const [legacyWorkbench, setLegacyWorkbench] =
|
|
3306
|
-
const [hiddenProjects, setHiddenProjects] =
|
|
3626
|
+
const [legacyWorkbench, setLegacyWorkbench] = React8.useState(false);
|
|
3627
|
+
const [hiddenProjects, setHiddenProjects] = React8.useState([]);
|
|
3307
3628
|
const visibleProjects = catalog.filter(({ id }) => !hiddenProjects.includes(id));
|
|
3308
3629
|
const excludeProjectIds = route.page === "projects" ? hiddenProjects : [];
|
|
3309
3630
|
const catalogReady = catalogSnapshot !== null;
|
|
3310
|
-
const [resultRows, setRows] =
|
|
3311
|
-
const recoveredRows =
|
|
3312
|
-
const pendingReads =
|
|
3313
|
-
const [resultIdentity, setResultIdentity] =
|
|
3314
|
-
const [nextOffset, setNextOffset] =
|
|
3315
|
-
const [loading, setLoading] =
|
|
3316
|
-
const [busy, setBusy] =
|
|
3317
|
-
const [error, setError] =
|
|
3318
|
-
const [loadFailure, setLoadFailure] =
|
|
3319
|
-
const [notice, setNotice] =
|
|
3320
|
-
const [listRevision, setListRevision] =
|
|
3321
|
-
const [queryOwner, setQueryOwner] =
|
|
3631
|
+
const [resultRows, setRows] = React8.useState([]);
|
|
3632
|
+
const recoveredRows = React8.useRef(null);
|
|
3633
|
+
const pendingReads = React8.useRef(/* @__PURE__ */ new Set());
|
|
3634
|
+
const [resultIdentity, setResultIdentity] = React8.useState("");
|
|
3635
|
+
const [nextOffset, setNextOffset] = React8.useState(null);
|
|
3636
|
+
const [loading, setLoading] = React8.useState(true);
|
|
3637
|
+
const [busy, setBusy] = React8.useState(false);
|
|
3638
|
+
const [error, setError] = React8.useState("");
|
|
3639
|
+
const [loadFailure, setLoadFailure] = React8.useState(null);
|
|
3640
|
+
const [notice, setNotice] = React8.useState("");
|
|
3641
|
+
const [listRevision, setListRevision] = React8.useState(0);
|
|
3642
|
+
const [queryOwner, setQueryOwner] = React8.useState(null);
|
|
3322
3643
|
const canQuery = queryOwner?.client === client && queryOwner.scope === scopeIdentity;
|
|
3323
|
-
const liveRefresh =
|
|
3644
|
+
const liveRefresh = React8.useRef(async () => {
|
|
3324
3645
|
});
|
|
3325
|
-
const liveSequence =
|
|
3326
|
-
const querySequence =
|
|
3327
|
-
const [editor, setEditor] =
|
|
3328
|
-
const [createViewOpen, setCreateViewOpen] =
|
|
3329
|
-
const [projectAction, setProjectAction] =
|
|
3330
|
-
const [projectActionError, setProjectActionError] =
|
|
3331
|
-
const [projectActionBusy, setProjectActionBusy] =
|
|
3332
|
-
const [selecting, setSelecting] =
|
|
3333
|
-
const [selected, setSelected] =
|
|
3646
|
+
const liveSequence = React8.useRef(0);
|
|
3647
|
+
const querySequence = React8.useRef(0);
|
|
3648
|
+
const [editor, setEditor] = React8.useState(null);
|
|
3649
|
+
const [createViewOpen, setCreateViewOpen] = React8.useState(false);
|
|
3650
|
+
const [projectAction, setProjectAction] = React8.useState(null);
|
|
3651
|
+
const [projectActionError, setProjectActionError] = React8.useState("");
|
|
3652
|
+
const [projectActionBusy, setProjectActionBusy] = React8.useState(false);
|
|
3653
|
+
const [selecting, setSelecting] = React8.useState(false);
|
|
3654
|
+
const [selected, setSelected] = React8.useState(
|
|
3334
3655
|
/* @__PURE__ */ new Map()
|
|
3335
3656
|
);
|
|
3336
3657
|
const detailIdentity = route.ref ? refKey(route.ref) : "";
|
|
3337
|
-
const [detailState, setDetail] =
|
|
3658
|
+
const [detailState, setDetail] = React8.useState(
|
|
3338
3659
|
null
|
|
3339
3660
|
);
|
|
3340
3661
|
const detail = detailState?.identity === detailIdentity ? detailState.value : null;
|
|
@@ -3344,20 +3665,20 @@ function GlobalWorkbench({ client }) {
|
|
|
3344
3665
|
window.location.origin,
|
|
3345
3666
|
route.project.page
|
|
3346
3667
|
) : null;
|
|
3347
|
-
const frame =
|
|
3668
|
+
const frame = React8.useRef(null);
|
|
3348
3669
|
const projectId = requestedProject?.id;
|
|
3349
3670
|
const MagicEdit = client.config.magicEditInstance ? client.resolveUI({
|
|
3350
3671
|
plugin: client.config.magicEditInstance,
|
|
3351
3672
|
id: "magic-edit.panel"
|
|
3352
3673
|
})?.component : void 0;
|
|
3353
3674
|
const projectPage = route.project?.page;
|
|
3354
|
-
const requestProjectView =
|
|
3355
|
-
const [projectMenu, setProjectMenu] =
|
|
3356
|
-
const [projectView, setProjectView] =
|
|
3675
|
+
const requestProjectView = React8.useRef(void 0);
|
|
3676
|
+
const [projectMenu, setProjectMenu] = React8.useState();
|
|
3677
|
+
const [projectView, setProjectView] = React8.useState();
|
|
3357
3678
|
const definition = projectMenu?.entry === projectEntry ? projectMenu.value : null;
|
|
3358
3679
|
const view = projectView?.entry === projectEntry ? projectView.value : void 0;
|
|
3359
3680
|
const menu = definition ? { ...definition, active: definition.overview, ...view } : void 0;
|
|
3360
|
-
|
|
3681
|
+
React8.useEffect(() => {
|
|
3361
3682
|
const projectFrame = frame.current;
|
|
3362
3683
|
const projects = client.projects;
|
|
3363
3684
|
if (!projectEntry || !projectId || !projectFrame || !projects) return;
|
|
@@ -3429,16 +3750,16 @@ function GlobalWorkbench({ client }) {
|
|
|
3429
3750
|
if (route.project.view !== view2) navigate({ ...route, project: { ...route.project, view: view2 } });
|
|
3430
3751
|
requestProjectView.current?.(view2, true);
|
|
3431
3752
|
}
|
|
3432
|
-
const [collapsed, setCollapsed] =
|
|
3753
|
+
const [collapsed, setCollapsed] = React8.useState(
|
|
3433
3754
|
() => window.matchMedia?.("(max-width: 1100px)").matches ?? false
|
|
3434
3755
|
);
|
|
3435
|
-
const pages =
|
|
3436
|
-
const downloadFrame =
|
|
3437
|
-
const importInput =
|
|
3438
|
-
const [pendingImport, setPendingImport] =
|
|
3439
|
-
const coverInput =
|
|
3440
|
-
const coverProject =
|
|
3441
|
-
const defaults =
|
|
3756
|
+
const pages = React8.useRef(/* @__PURE__ */ new Map());
|
|
3757
|
+
const downloadFrame = React8.useId().replace(/[^a-zA-Z0-9]/g, "");
|
|
3758
|
+
const importInput = React8.useRef(null);
|
|
3759
|
+
const [pendingImport, setPendingImport] = React8.useState();
|
|
3760
|
+
const coverInput = React8.useRef(null);
|
|
3761
|
+
const coverProject = React8.useRef(null);
|
|
3762
|
+
const defaults = React8.useMemo(
|
|
3442
3763
|
() => [
|
|
3443
3764
|
defaultView(route.page),
|
|
3444
3765
|
...categoryViews(route.page),
|
|
@@ -3467,7 +3788,7 @@ function GlobalWorkbench({ client }) {
|
|
|
3467
3788
|
if (replace) window.history.replaceState(null, "", url);
|
|
3468
3789
|
else window.history.pushState(null, "", url);
|
|
3469
3790
|
}
|
|
3470
|
-
|
|
3791
|
+
React8.useEffect(() => {
|
|
3471
3792
|
const onAsset = (event2) => {
|
|
3472
3793
|
if (event2.origin !== location.origin || !frame.current || event2.source !== frame.current.contentWindow || event2.data?.type !== "studio:open-asset")
|
|
3473
3794
|
return;
|
|
@@ -3484,7 +3805,7 @@ function GlobalWorkbench({ client }) {
|
|
|
3484
3805
|
window.removeEventListener("message", onAsset);
|
|
3485
3806
|
};
|
|
3486
3807
|
}, []);
|
|
3487
|
-
|
|
3808
|
+
React8.useEffect(() => {
|
|
3488
3809
|
let valid = true;
|
|
3489
3810
|
setLoadedSource(null);
|
|
3490
3811
|
setLoadFailure(null);
|
|
@@ -3517,7 +3838,7 @@ function GlobalWorkbench({ client }) {
|
|
|
3517
3838
|
valid = false;
|
|
3518
3839
|
};
|
|
3519
3840
|
}, [client, route.page, catalogRevision]);
|
|
3520
|
-
|
|
3841
|
+
React8.useEffect(() => {
|
|
3521
3842
|
if (!client.config.studioInstance) return;
|
|
3522
3843
|
let valid = true;
|
|
3523
3844
|
setSummariesPending(true);
|
|
@@ -3546,10 +3867,10 @@ function GlobalWorkbench({ client }) {
|
|
|
3546
3867
|
valid = false;
|
|
3547
3868
|
};
|
|
3548
3869
|
}, [client, catalogRevision]);
|
|
3549
|
-
const [filtersByPage, setFiltersByPage] =
|
|
3870
|
+
const [filtersByPage, setFiltersByPage] = React8.useState({});
|
|
3550
3871
|
const assetFilter = filtersByPage[route.page] ?? {};
|
|
3551
3872
|
const setAssetFilter = (value) => setFiltersByPage((previous) => ({ ...previous, [route.page]: value }));
|
|
3552
|
-
const [creatingProject, setCreatingProject] =
|
|
3873
|
+
const [creatingProject, setCreatingProject] = React8.useState(false);
|
|
3553
3874
|
const projectCard = client.config.dashboard?.find((card) => card.id === "projects");
|
|
3554
3875
|
const creatorRef = client.config.views?.projectCreator ?? (projectCard && { plugin: projectCard.plugin, id: "create-project" });
|
|
3555
3876
|
const NewProjectDialog = route.page === "projects" && creatorRef ? client.resolveUI(creatorRef)?.component : void 0;
|
|
@@ -3581,15 +3902,20 @@ function GlobalWorkbench({ client }) {
|
|
|
3581
3902
|
assetQuery,
|
|
3582
3903
|
builtIn && route.page === "projects" ? assetFilter : null
|
|
3583
3904
|
]);
|
|
3584
|
-
const [resultWindow, setResultWindow] =
|
|
3905
|
+
const [resultWindow, setResultWindow] = React8.useState({ identity: "", count: 50 });
|
|
3585
3906
|
const visibleCount = resultWindow.identity === queryIdentity ? resultWindow.count : 50;
|
|
3586
|
-
const rows =
|
|
3907
|
+
const rows = React8.useMemo(
|
|
3587
3908
|
() => resultIdentity !== queryIdentity ? [] : builtIn ? resultRows.slice(0, visibleCount) : resultRows,
|
|
3588
3909
|
[resultIdentity, queryIdentity, builtIn, resultRows, visibleCount]
|
|
3589
3910
|
);
|
|
3590
|
-
const failure = loadFailure?.source === route.page && (loadFailure.query === void 0 || loadFailure.query === queryIdentity) ? loadFailure : null;
|
|
3911
|
+
const failure = (tableVisible || loadFailure?.query === void 0) && loadFailure?.source === route.page && (loadFailure.query === void 0 || loadFailure.query === queryIdentity) ? loadFailure : null;
|
|
3591
3912
|
const queryLoading = loading || !failure && (loadedSource !== route.page || resultIdentity !== queryIdentity);
|
|
3592
|
-
|
|
3913
|
+
React8.useEffect(() => {
|
|
3914
|
+
if (tableVisible) return;
|
|
3915
|
+
setLoadFailure((previous) => previous?.query === void 0 ? previous : null);
|
|
3916
|
+
setLoading(false);
|
|
3917
|
+
}, [tableVisible]);
|
|
3918
|
+
React8.useEffect(() => {
|
|
3593
3919
|
if (!tableVisible || !canQuery || loadedSource !== route.page || !catalogReady) return;
|
|
3594
3920
|
const sequence = ++querySequence.current;
|
|
3595
3921
|
let valid = true;
|
|
@@ -3676,12 +4002,12 @@ function GlobalWorkbench({ client }) {
|
|
|
3676
4002
|
valid = false;
|
|
3677
4003
|
};
|
|
3678
4004
|
}, [client, loadedSource, queryIdentity, listRevision, canQuery, tableVisible]);
|
|
3679
|
-
const queueVisit =
|
|
4005
|
+
const queueVisit = React8.useRef(/* @__PURE__ */ new Set());
|
|
3680
4006
|
const queueVisible = tableVisible && route.page === "tasks";
|
|
3681
|
-
|
|
4007
|
+
React8.useEffect(() => {
|
|
3682
4008
|
queueVisit.current.clear();
|
|
3683
4009
|
}, [queueVisible, client]);
|
|
3684
|
-
|
|
4010
|
+
React8.useEffect(() => {
|
|
3685
4011
|
if (!queueVisible || resultIdentity !== queryIdentity) return;
|
|
3686
4012
|
let active2 = true;
|
|
3687
4013
|
void (async () => {
|
|
@@ -3708,7 +4034,7 @@ function GlobalWorkbench({ client }) {
|
|
|
3708
4034
|
active2 = false;
|
|
3709
4035
|
};
|
|
3710
4036
|
}, [client, queueVisible, resultIdentity, queryIdentity, resultRows]);
|
|
3711
|
-
const liveIdentity =
|
|
4037
|
+
const liveIdentity = React8.useRef(queryIdentity);
|
|
3712
4038
|
liveIdentity.current = queryIdentity;
|
|
3713
4039
|
liveRefresh.current = async () => {
|
|
3714
4040
|
querySequence.current++;
|
|
@@ -3728,7 +4054,7 @@ function GlobalWorkbench({ client }) {
|
|
|
3728
4054
|
setListRevision((old) => old + 1);
|
|
3729
4055
|
await synchronized;
|
|
3730
4056
|
};
|
|
3731
|
-
|
|
4057
|
+
React8.useEffect(() => {
|
|
3732
4058
|
setRows([]);
|
|
3733
4059
|
setResultIdentity("");
|
|
3734
4060
|
setSelected(/* @__PURE__ */ new Map());
|
|
@@ -3775,7 +4101,7 @@ function GlobalWorkbench({ client }) {
|
|
|
3775
4101
|
void watcher.dispose();
|
|
3776
4102
|
};
|
|
3777
4103
|
}, [client, scopeIdentity]);
|
|
3778
|
-
|
|
4104
|
+
React8.useEffect(() => {
|
|
3779
4105
|
if (!route.ref) return;
|
|
3780
4106
|
let valid = true;
|
|
3781
4107
|
void globalCall("global.asset", { ref: route.ref }).then((value) => {
|
|
@@ -3816,7 +4142,7 @@ function GlobalWorkbench({ client }) {
|
|
|
3816
4142
|
});
|
|
3817
4143
|
}
|
|
3818
4144
|
function onProjectCreated(project) {
|
|
3819
|
-
setCatalog((items) => [...items ?? [], project]);
|
|
4145
|
+
setCatalog((items) => [...(items ?? []).filter((item) => item.id !== project.id), project]);
|
|
3820
4146
|
refreshCatalog();
|
|
3821
4147
|
navigate({
|
|
3822
4148
|
...route,
|
|
@@ -4051,10 +4377,24 @@ function GlobalWorkbench({ client }) {
|
|
|
4051
4377
|
const id = row[active.view.identity.project];
|
|
4052
4378
|
return typeof id === "string" ? id : void 0;
|
|
4053
4379
|
};
|
|
4380
|
+
const projectPreviews = React8.useMemo(() => /* @__PURE__ */ new Map(), [client]);
|
|
4381
|
+
async function resolveProjectPreview(ref) {
|
|
4382
|
+
const key3 = refKey(ref);
|
|
4383
|
+
const cached = projectPreviews.get(key3);
|
|
4384
|
+
if (cached) return cached;
|
|
4385
|
+
const { item } = await globalCall("global.asset", { ref });
|
|
4386
|
+
if (!item.previewUrl) return;
|
|
4387
|
+
const previous = projectPreviews.get(key3);
|
|
4388
|
+
if (previous) return previous;
|
|
4389
|
+
const preview = { url: item.previewUrl, kind: item.kind };
|
|
4390
|
+
projectPreviews.set(key3, preview);
|
|
4391
|
+
if (projectPreviews.size > 128) projectPreviews.delete(projectPreviews.keys().next().value);
|
|
4392
|
+
return preview;
|
|
4393
|
+
}
|
|
4054
4394
|
const cover = (row) => {
|
|
4055
4395
|
const projectId2 = annotationProject(row);
|
|
4056
4396
|
const output = active.view.source === "projects" && projectId2 ? projectSummaries.has(projectId2) ? projectSummaries.get(projectId2).cover : decodeRef(row.coverRef) : taskCoverRef(row, active.view);
|
|
4057
|
-
return /* @__PURE__ */
|
|
4397
|
+
return /* @__PURE__ */ React8.createElement(
|
|
4058
4398
|
QueryCover,
|
|
4059
4399
|
{
|
|
4060
4400
|
row,
|
|
@@ -4066,7 +4406,10 @@ function GlobalWorkbench({ client }) {
|
|
|
4066
4406
|
onSelect: selecting && selectionKey(row) ? () => toggle(row) : void 0,
|
|
4067
4407
|
onOpen: canOpen(row) ? () => openRow(row) : void 0,
|
|
4068
4408
|
previewKey: output ? refKey(output) : void 0,
|
|
4409
|
+
cachedPreview: active.view.source === "projects" && output ? projectPreviews.get(refKey(output)) : void 0,
|
|
4069
4410
|
resolvePreview: output ? async () => {
|
|
4411
|
+
if (active.view.source === "projects")
|
|
4412
|
+
return await resolveProjectPreview(output) ?? {};
|
|
4070
4413
|
const { item } = await globalCall("global.asset", { ref: output });
|
|
4071
4414
|
return { url: item.previewUrl ?? void 0, kind: item.kind };
|
|
4072
4415
|
} : void 0
|
|
@@ -4074,49 +4417,79 @@ function GlobalWorkbench({ client }) {
|
|
|
4074
4417
|
);
|
|
4075
4418
|
};
|
|
4076
4419
|
const libraryRows = recoveredRows.current?.items;
|
|
4077
|
-
const referenceRows =
|
|
4078
|
-
|
|
4079
|
-
[
|
|
4420
|
+
const referenceRows = React8.useMemo(() => {
|
|
4421
|
+
const byRef = /* @__PURE__ */ new Map();
|
|
4422
|
+
for (const row of libraryRows ?? []) {
|
|
4423
|
+
const ref = decodeRef(row.ref);
|
|
4424
|
+
if (ref) byRef.set(refKey(ref), row);
|
|
4425
|
+
}
|
|
4426
|
+
return byRef;
|
|
4427
|
+
}, [libraryRows]);
|
|
4428
|
+
const previewRequests = React8.useMemo(
|
|
4429
|
+
() => /* @__PURE__ */ new Map(),
|
|
4430
|
+
[client, libraryRows]
|
|
4080
4431
|
);
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
"button",
|
|
4089
|
-
{
|
|
4090
|
-
type: "button",
|
|
4091
|
-
key: refKey(ref) + index,
|
|
4092
|
-
"aria-label": "Open reference " + (item?.name ?? index + 1),
|
|
4093
|
-
disabled: selecting,
|
|
4094
|
-
onClick: () => navigate({ ...route, ref })
|
|
4095
|
-
},
|
|
4096
|
-
typeof preview === "string" ? /* @__PURE__ */ React6.createElement("img", { src: preview, alt: "", loading: "lazy" }) : /* @__PURE__ */ React6.createElement(Icon, { name: "placeholder-image" })
|
|
4097
|
-
);
|
|
4098
|
-
})) : "\u2014";
|
|
4432
|
+
function resolveReference(ref) {
|
|
4433
|
+
const key3 = refKey(ref);
|
|
4434
|
+
let request = previewRequests.get(key3);
|
|
4435
|
+
if (!request) {
|
|
4436
|
+
request = globalCall("global.asset", { ref }).then(({ item }) => thumbnail(item));
|
|
4437
|
+
previewRequests.set(key3, request);
|
|
4438
|
+
void request.catch(() => previewRequests.delete(key3));
|
|
4099
4439
|
}
|
|
4440
|
+
return request;
|
|
4441
|
+
}
|
|
4442
|
+
function renderReferences(value, disabled = false) {
|
|
4443
|
+
const refs = parseArray(value).map(referenceValue).filter((ref) => ref !== null);
|
|
4444
|
+
if (!refs.length) return "--";
|
|
4445
|
+
return /* @__PURE__ */ React8.createElement("span", { className: "studio-asset-references" }, refs.map((ref, index) => {
|
|
4446
|
+
const key3 = refKey(ref);
|
|
4447
|
+
const item = referenceRows.get(key3);
|
|
4448
|
+
return /* @__PURE__ */ React8.createElement(
|
|
4449
|
+
"button",
|
|
4450
|
+
{
|
|
4451
|
+
type: "button",
|
|
4452
|
+
key: key3 + index,
|
|
4453
|
+
"aria-label": "Open reference " + (item?.name ?? index + 1),
|
|
4454
|
+
disabled,
|
|
4455
|
+
onClick: () => navigate({ ...route, ref })
|
|
4456
|
+
},
|
|
4457
|
+
/* @__PURE__ */ React8.createElement(
|
|
4458
|
+
AssetThumbnail,
|
|
4459
|
+
{
|
|
4460
|
+
className: "studio-reference-thumbnail",
|
|
4461
|
+
known: thumbnail(item),
|
|
4462
|
+
cover: ref,
|
|
4463
|
+
resolvePreview: resolveReference
|
|
4464
|
+
}
|
|
4465
|
+
)
|
|
4466
|
+
);
|
|
4467
|
+
}));
|
|
4468
|
+
}
|
|
4469
|
+
const renderCell = (row, column2) => {
|
|
4470
|
+
if (builtIn && route.page !== "projects" && column2.path === "refs")
|
|
4471
|
+
return renderReferences(row.refs, selecting);
|
|
4100
4472
|
if (builtIn && (column2.path === "aspectRatio" || column2.path === "scene")) {
|
|
4101
4473
|
const meta = assetMetadata(row.metadata);
|
|
4102
4474
|
const source = assetMetadata(meta.adSource);
|
|
4103
4475
|
const params = assetMetadata(row.parameters);
|
|
4104
4476
|
const value = column2.path === "scene" ? meta.sceneTitle ?? meta.sceneNumber ?? meta.scene : params.aspect_ratio ?? params.aspectRatio ?? (source.versionId === row.versionId ? source.aspectRatio : void 0) ?? meta.aspectRatio;
|
|
4105
|
-
return typeof value === "string" || typeof value === "number" ? value : "
|
|
4477
|
+
return typeof value === "string" || typeof value === "number" ? value : "--";
|
|
4106
4478
|
}
|
|
4107
4479
|
if (builtIn && column2.path === "subjectType") {
|
|
4108
4480
|
const value = row.subjectType ?? assetMetadata(row.metadata).subjectType ?? assetMetadata(row.parameters).subjectType;
|
|
4109
|
-
|
|
4481
|
+
if (typeof value === "string" && value.toLowerCase() === "scene") return "Shot";
|
|
4482
|
+
return typeof value === "string" ? value : "--";
|
|
4110
4483
|
}
|
|
4111
4484
|
if (builtIn && column2.path === "createdAt" && typeof row.createdAt === "string") {
|
|
4112
4485
|
const date2 = new Date(row.createdAt);
|
|
4113
4486
|
if (!Number.isNaN(date2.getTime()))
|
|
4114
|
-
return /* @__PURE__ */
|
|
4487
|
+
return /* @__PURE__ */ React8.createElement("time", { dateTime: row.createdAt, title: date2.toLocaleString() }, date2.getFullYear(), " ", String(date2.getMonth() + 1).padStart(2, "0"), ".", String(date2.getDate()).padStart(2, "0"));
|
|
4115
4488
|
}
|
|
4116
4489
|
if (builtIn && column2.path === "kind" && typeof row.kind === "string") {
|
|
4117
4490
|
return row.kind === "text" ? "Text" : row.kind.charAt(0).toUpperCase() + row.kind.slice(1);
|
|
4118
4491
|
}
|
|
4119
|
-
return column2.role === "project" ? /* @__PURE__ */
|
|
4492
|
+
return column2.role === "project" ? /* @__PURE__ */ React8.createElement(
|
|
4120
4493
|
Button,
|
|
4121
4494
|
{
|
|
4122
4495
|
className: "studio-row-name",
|
|
@@ -4191,6 +4564,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4191
4564
|
{
|
|
4192
4565
|
id: "clear-cover",
|
|
4193
4566
|
label: "Remove project cover",
|
|
4567
|
+
tone: "danger",
|
|
4194
4568
|
disabled: busy,
|
|
4195
4569
|
onSelect: () => void changeCover(projectId2, null)
|
|
4196
4570
|
}
|
|
@@ -4199,11 +4573,11 @@ function GlobalWorkbench({ client }) {
|
|
|
4199
4573
|
};
|
|
4200
4574
|
const rowActions = (row) => {
|
|
4201
4575
|
const projectId2 = annotationProject(row);
|
|
4202
|
-
return !canOpen(row) ? null : /* @__PURE__ */
|
|
4576
|
+
return !canOpen(row) ? null : /* @__PURE__ */ React8.createElement(
|
|
4203
4577
|
Menu,
|
|
4204
4578
|
{
|
|
4205
4579
|
floating: true,
|
|
4206
|
-
triggerIcon: route.layout === "grid" && active.id.startsWith("default:") ? "more" : void 0,
|
|
4580
|
+
triggerIcon: route.page === "assets" || route.layout === "grid" && active.id.startsWith("default:") ? "more" : void 0,
|
|
4207
4581
|
label: `Actions for ${rowTitle(row, active.view)}`,
|
|
4208
4582
|
items: [
|
|
4209
4583
|
{
|
|
@@ -4232,6 +4606,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4232
4606
|
{
|
|
4233
4607
|
id: "favorite",
|
|
4234
4608
|
label: row.favorite ? "Remove favorite" : "Add favorite",
|
|
4609
|
+
tone: row.favorite ? "danger" : void 0,
|
|
4235
4610
|
disabled: busy,
|
|
4236
4611
|
onSelect: () => void favorite([rowRef(row, active.view)], !row.favorite)
|
|
4237
4612
|
},
|
|
@@ -4246,19 +4621,19 @@ function GlobalWorkbench({ client }) {
|
|
|
4246
4621
|
}
|
|
4247
4622
|
);
|
|
4248
4623
|
};
|
|
4249
|
-
return /* @__PURE__ */
|
|
4624
|
+
return /* @__PURE__ */ React8.createElement(
|
|
4250
4625
|
StudioTheme,
|
|
4251
4626
|
{
|
|
4252
4627
|
theme: theme.preference === "system" ? menu?.theme ?? theme.theme : theme.theme,
|
|
4253
4628
|
className: "studio-global"
|
|
4254
4629
|
},
|
|
4255
|
-
/* @__PURE__ */
|
|
4630
|
+
/* @__PURE__ */ React8.createElement(
|
|
4256
4631
|
"div",
|
|
4257
4632
|
{
|
|
4258
4633
|
className: "studio-shell",
|
|
4259
4634
|
"data-project": Boolean(projectEntry) || void 0,
|
|
4260
4635
|
"data-focus": menu?.layout === "focus" || void 0,
|
|
4261
|
-
|
|
4636
|
+
inert: Boolean(route.ref),
|
|
4262
4637
|
onKeyDown: (event2) => {
|
|
4263
4638
|
if (event2.key === "Escape" && selecting && !editor) {
|
|
4264
4639
|
event2.preventDefault();
|
|
@@ -4266,24 +4641,24 @@ function GlobalWorkbench({ client }) {
|
|
|
4266
4641
|
}
|
|
4267
4642
|
}
|
|
4268
4643
|
},
|
|
4269
|
-
/* @__PURE__ */
|
|
4644
|
+
/* @__PURE__ */ React8.createElement("aside", { className: "studio-sidebar", "data-collapsed": collapsed }, /* @__PURE__ */ React8.createElement("div", { className: "studio-logo" }, /* @__PURE__ */ React8.createElement("strong", null, "VIVIX STUDIO"), /* @__PURE__ */ React8.createElement(
|
|
4270
4645
|
"button",
|
|
4271
4646
|
{
|
|
4272
4647
|
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
4273
4648
|
"aria-expanded": !collapsed,
|
|
4274
4649
|
onClick: () => setCollapsed(!collapsed)
|
|
4275
4650
|
},
|
|
4276
|
-
/* @__PURE__ */
|
|
4277
|
-
)), /* @__PURE__ */
|
|
4651
|
+
/* @__PURE__ */ React8.createElement(StudioGlyph, { name: "panel" })
|
|
4652
|
+
)), /* @__PURE__ */ React8.createElement("nav", { "aria-label": "Workspace" }, /* @__PURE__ */ React8.createElement(
|
|
4278
4653
|
"button",
|
|
4279
4654
|
{
|
|
4280
4655
|
title: "Home",
|
|
4281
4656
|
"aria-current": route.home && !route.project ? "page" : void 0,
|
|
4282
4657
|
onClick: goHome
|
|
4283
4658
|
},
|
|
4284
|
-
/* @__PURE__ */
|
|
4285
|
-
/* @__PURE__ */
|
|
4286
|
-
), pageSources.map((page) => /* @__PURE__ */
|
|
4659
|
+
/* @__PURE__ */ React8.createElement("span", { className: "studio-nav-icon", "data-icon": "home", "aria-hidden": "true" }),
|
|
4660
|
+
/* @__PURE__ */ React8.createElement("span", null, "Home")
|
|
4661
|
+
), pageSources.map((page) => /* @__PURE__ */ React8.createElement(
|
|
4287
4662
|
"button",
|
|
4288
4663
|
{
|
|
4289
4664
|
key: page,
|
|
@@ -4291,14 +4666,14 @@ function GlobalWorkbench({ client }) {
|
|
|
4291
4666
|
"aria-current": !route.home && !route.project && route.page === page ? "page" : void 0,
|
|
4292
4667
|
onClick: () => go(page)
|
|
4293
4668
|
},
|
|
4294
|
-
/* @__PURE__ */
|
|
4295
|
-
/* @__PURE__ */
|
|
4296
|
-
)), /* @__PURE__ */
|
|
4669
|
+
/* @__PURE__ */ React8.createElement("span", { className: "studio-nav-icon", "data-icon": page, "aria-hidden": "true" }),
|
|
4670
|
+
/* @__PURE__ */ React8.createElement("span", null, workspaceLabels[page])
|
|
4671
|
+
)), /* @__PURE__ */ React8.createElement("h2", null, "Projects"), visibleProjects.map((project) => {
|
|
4297
4672
|
const active2 = sidebarProject === project.id;
|
|
4298
4673
|
const summary = projectSummaries.get(project.id);
|
|
4299
4674
|
const title = summary?.name ?? project.name;
|
|
4300
4675
|
const tabs = active2 && !collapsed && route.project ? menu?.tabs : void 0;
|
|
4301
|
-
return /* @__PURE__ */
|
|
4676
|
+
return /* @__PURE__ */ React8.createElement("div", { className: "studio-project-group", key: project.id }, /* @__PURE__ */ React8.createElement("div", { className: "studio-project-row", "data-active": active2 || void 0 }, /* @__PURE__ */ React8.createElement(
|
|
4302
4677
|
"button",
|
|
4303
4678
|
{
|
|
4304
4679
|
"aria-expanded": tabs?.length ? true : void 0,
|
|
@@ -4309,20 +4684,18 @@ function GlobalWorkbench({ client }) {
|
|
|
4309
4684
|
disabled: !project.available,
|
|
4310
4685
|
onClick: () => openProject(project.id)
|
|
4311
4686
|
},
|
|
4312
|
-
/* @__PURE__ */
|
|
4313
|
-
|
|
4687
|
+
/* @__PURE__ */ React8.createElement(
|
|
4688
|
+
AssetThumbnail,
|
|
4314
4689
|
{
|
|
4690
|
+
className: "studio-project-thumbnail",
|
|
4315
4691
|
key: project.available && summary?.cover ? refKey(summary.cover) : "",
|
|
4316
4692
|
pending: project.available && Boolean(client.config.studioInstance) && !summary && summariesPending,
|
|
4317
4693
|
cover: project.available ? summary?.cover ?? null : null,
|
|
4318
|
-
resolvePreview:
|
|
4319
|
-
const { item } = await globalCall("global.asset", { ref });
|
|
4320
|
-
return item.previewUrl ? { url: item.previewUrl, kind: item.kind } : void 0;
|
|
4321
|
-
}
|
|
4694
|
+
resolvePreview: resolveProjectPreview
|
|
4322
4695
|
}
|
|
4323
4696
|
),
|
|
4324
|
-
/* @__PURE__ */
|
|
4325
|
-
), project.available && !collapsed && /* @__PURE__ */
|
|
4697
|
+
/* @__PURE__ */ React8.createElement("span", { className: "studio-project-caption" }, /* @__PURE__ */ React8.createElement("span", null, title), summary?.tags.includes("sample") && /* @__PURE__ */ React8.createElement("small", { className: "studio-sample-label" }, "Sample"))
|
|
4698
|
+
), project.available && !collapsed && /* @__PURE__ */ React8.createElement("div", { className: "studio-project-actions" }, /* @__PURE__ */ React8.createElement(
|
|
4326
4699
|
Menu,
|
|
4327
4700
|
{
|
|
4328
4701
|
floating: true,
|
|
@@ -4353,14 +4726,14 @@ function GlobalWorkbench({ client }) {
|
|
|
4353
4726
|
] : []
|
|
4354
4727
|
]
|
|
4355
4728
|
}
|
|
4356
|
-
))), Boolean(tabs?.length) && /* @__PURE__ */
|
|
4729
|
+
))), Boolean(tabs?.length) && /* @__PURE__ */ React8.createElement(
|
|
4357
4730
|
"div",
|
|
4358
4731
|
{
|
|
4359
4732
|
className: "studio-project-pages",
|
|
4360
4733
|
role: "group",
|
|
4361
4734
|
"aria-label": `${title} pages`
|
|
4362
4735
|
},
|
|
4363
|
-
tabs?.map((tab) => /* @__PURE__ */
|
|
4736
|
+
tabs?.map((tab) => /* @__PURE__ */ React8.createElement(
|
|
4364
4737
|
"button",
|
|
4365
4738
|
{
|
|
4366
4739
|
key: tab.id,
|
|
@@ -4368,11 +4741,11 @@ function GlobalWorkbench({ client }) {
|
|
|
4368
4741
|
"aria-current": menu?.active === tab.id ? "page" : void 0,
|
|
4369
4742
|
onClick: () => openProjectView(tab.id)
|
|
4370
4743
|
},
|
|
4371
|
-
/* @__PURE__ */
|
|
4744
|
+
/* @__PURE__ */ React8.createElement("span", null, tab.label)
|
|
4372
4745
|
))
|
|
4373
4746
|
));
|
|
4374
|
-
})), /* @__PURE__ */
|
|
4375
|
-
/* @__PURE__ */
|
|
4747
|
+
})), /* @__PURE__ */ React8.createElement("div", { className: "studio-account" }, /* @__PURE__ */ React8.createElement("span", { className: "studio-user-mark", "aria-hidden": "true" }), /* @__PURE__ */ React8.createElement("span", null, "Local User"))),
|
|
4748
|
+
/* @__PURE__ */ React8.createElement("main", { className: "studio-content" }, /* @__PURE__ */ React8.createElement("div", { className: "studio-mobile-nav" }, /* @__PURE__ */ React8.createElement(
|
|
4376
4749
|
Dropdown,
|
|
4377
4750
|
{
|
|
4378
4751
|
label: "Workspace page",
|
|
@@ -4393,7 +4766,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4393
4766
|
else go(value);
|
|
4394
4767
|
}
|
|
4395
4768
|
}
|
|
4396
|
-
)), !projectEntry && !route.home && /* @__PURE__ */
|
|
4769
|
+
)), !projectEntry && (!route.project || catalogReady || failure) && !route.home && /* @__PURE__ */ React8.createElement("header", { className: "studio-page-header" }, /* @__PURE__ */ React8.createElement("h1", null, route.project ? "Project workbench" : route.page === "assets" ? "Assets" : pageTitles[route.page]), route.project ? /* @__PURE__ */ React8.createElement(
|
|
4397
4770
|
Button,
|
|
4398
4771
|
{
|
|
4399
4772
|
label: "Back to workspace",
|
|
@@ -4401,39 +4774,23 @@ function GlobalWorkbench({ client }) {
|
|
|
4401
4774
|
variant: "text-tonal-sm",
|
|
4402
4775
|
onClick: () => navigate({ ...route, project: void 0 })
|
|
4403
4776
|
}
|
|
4404
|
-
) : /* @__PURE__ */
|
|
4777
|
+
) : /* @__PURE__ */ React8.createElement(
|
|
4405
4778
|
Button,
|
|
4406
4779
|
{
|
|
4407
4780
|
className: "studio-create-view",
|
|
4408
4781
|
label: "Create Custom View",
|
|
4409
4782
|
variant: "text-tonal-sm",
|
|
4410
|
-
leadingIcon: "add",
|
|
4411
4783
|
onClick: () => setCreateViewOpen(true)
|
|
4412
4784
|
}
|
|
4413
|
-
)), (error || failure) && /* @__PURE__ */
|
|
4414
|
-
|
|
4415
|
-
{
|
|
4416
|
-
detail,
|
|
4417
|
-
refValue: route.ref,
|
|
4418
|
-
busy,
|
|
4419
|
-
onBack: () => navigate({ ...route, ref: null }),
|
|
4420
|
-
onVersion: (ref) => navigate({ ...route, ref }),
|
|
4421
|
-
onFavorite: (ref, enabled) => void favorite([ref], enabled),
|
|
4422
|
-
onDownload: (refs) => void download(refs),
|
|
4423
|
-
onProject: openProject,
|
|
4424
|
-
project: catalog.find((project) => project.id === detail?.item.projectId)
|
|
4425
|
-
}
|
|
4426
|
-
), route.project ? projectEntry ? /* @__PURE__ */ React6.createElement(
|
|
4427
|
-
"iframe",
|
|
4785
|
+
)), (error || failure) && /* @__PURE__ */ React8.createElement("div", { className: "studio-feedback studio-error", role: "alert" }, error || failure?.message, failure && " Reload the workspace to try again.", error && /* @__PURE__ */ React8.createElement(IconButton, { icon: "close", label: "Dismiss error", onClick: () => setError("") })), notice && /* @__PURE__ */ React8.createElement("div", { className: "studio-feedback", role: "status" }, notice, /* @__PURE__ */ React8.createElement(IconButton, { icon: "close", label: "Dismiss notice", onClick: () => setNotice("") })), route.project ? projectEntry ? /* @__PURE__ */ React8.createElement(
|
|
4786
|
+
ProjectFrame,
|
|
4428
4787
|
{
|
|
4429
4788
|
key: projectEntry,
|
|
4430
|
-
|
|
4431
|
-
className: "studio-project-frame",
|
|
4432
|
-
title: "Project workbench",
|
|
4789
|
+
frame,
|
|
4433
4790
|
src: projectEntry,
|
|
4434
|
-
|
|
4791
|
+
view: route.project.view
|
|
4435
4792
|
}
|
|
4436
|
-
) : /* @__PURE__ */
|
|
4793
|
+
) : !catalogReady && !failure ? /* @__PURE__ */ React8.createElement(ProjectSkeleton, { view: route.project.view }) : /* @__PURE__ */ React8.createElement("div", { className: "studio-empty", role: "alert" }, failure ? `${failure.message} Reload the workspace to try again.` : "This project is unavailable. Register or restore its directory in Studio CLI.") : route.home ? /* @__PURE__ */ React8.createElement(
|
|
4437
4794
|
StudioHome,
|
|
4438
4795
|
{
|
|
4439
4796
|
client,
|
|
@@ -4457,7 +4814,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4457
4814
|
ref
|
|
4458
4815
|
}) : go("assets")
|
|
4459
4816
|
}
|
|
4460
|
-
) : /* @__PURE__ */
|
|
4817
|
+
) : /* @__PURE__ */ React8.createElement(
|
|
4461
4818
|
"section",
|
|
4462
4819
|
{
|
|
4463
4820
|
className: "studio-page-panel",
|
|
@@ -4474,208 +4831,228 @@ function GlobalWorkbench({ client }) {
|
|
|
4474
4831
|
"data-asset-library": filterAssets || void 0,
|
|
4475
4832
|
"aria-label": pageTitles[route.page]
|
|
4476
4833
|
},
|
|
4477
|
-
/* @__PURE__ */
|
|
4478
|
-
|
|
4834
|
+
/* @__PURE__ */ React8.createElement(
|
|
4835
|
+
"div",
|
|
4479
4836
|
{
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4837
|
+
className: route.page === "assets" ? "studio-toolbar vx-asset-library-toolbar" : "studio-toolbar",
|
|
4838
|
+
"data-selection": selecting
|
|
4839
|
+
},
|
|
4840
|
+
/* @__PURE__ */ React8.createElement("div", { className: "studio-view-tabs", role: "group", "aria-label": "Custom Views" }, visibleViews.map((view2) => /* @__PURE__ */ React8.createElement(
|
|
4841
|
+
Button,
|
|
4842
|
+
{
|
|
4843
|
+
key: view2.id,
|
|
4844
|
+
label: view2.view.name,
|
|
4845
|
+
variant: "text-tonal-sm",
|
|
4846
|
+
"aria-pressed": active.id === view2.id || favoriteView && view2.id === "default:assets",
|
|
4847
|
+
className: active.id === view2.id || favoriteView && view2.id === "default:assets" ? "active" : "",
|
|
4848
|
+
onClick: () => {
|
|
4849
|
+
stopSelecting();
|
|
4850
|
+
navigate({ ...route, view: view2.id, offset: 0 });
|
|
4851
|
+
}
|
|
4488
4852
|
}
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
}
|
|
4502
|
-
) : selecting ? /* @__PURE__ */ React6.createElement("div", { className: "studio-bulk", role: "group", "aria-label": "Selected item actions" }, /* @__PURE__ */ React6.createElement("span", { role: "status" }, selected.size, " selected"), /* @__PURE__ */ React6.createElement(
|
|
4503
|
-
Button,
|
|
4504
|
-
{
|
|
4505
|
-
label: allSelected ? "Deselect page" : "Select page",
|
|
4506
|
-
variant: "text-tonal-sm",
|
|
4507
|
-
disabled: !rows.length,
|
|
4508
|
-
onClick: toggleSelectedPage
|
|
4509
|
-
}
|
|
4510
|
-
), route.page === "projects" ? /* @__PURE__ */ React6.createElement(
|
|
4511
|
-
Button,
|
|
4512
|
-
{
|
|
4513
|
-
label: "Copy names",
|
|
4514
|
-
variant: "text-tonal-sm",
|
|
4515
|
-
disabled: !selected.size,
|
|
4516
|
-
onClick: () => {
|
|
4517
|
-
void navigator.clipboard.writeText([...selected.values()].map((item) => item.title).join("\n")).then(
|
|
4518
|
-
() => setNotice("Project names copied."),
|
|
4519
|
-
(error2) => setError(message(error2))
|
|
4520
|
-
);
|
|
4853
|
+
))),
|
|
4854
|
+
selecting && route.page === "assets" ? /* @__PURE__ */ React8.createElement(
|
|
4855
|
+
AssetSelectionToolbar,
|
|
4856
|
+
{
|
|
4857
|
+
count: selected.size,
|
|
4858
|
+
allSelected,
|
|
4859
|
+
busy,
|
|
4860
|
+
onSelectAll: rows.length ? toggleSelectedPage : void 0,
|
|
4861
|
+
onFavorite: selectedRefs.length ? () => void favorite(selectedRefs, true) : void 0,
|
|
4862
|
+
onDownload: selectedRefs.length && selectedRefs.length <= 100 ? () => void download(selectedRefs) : void 0,
|
|
4863
|
+
deleteHint: "Delete assets in their project.",
|
|
4864
|
+
onCancel: stopSelecting
|
|
4521
4865
|
}
|
|
4522
|
-
}
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4866
|
+
) : selecting ? /* @__PURE__ */ React8.createElement("div", { className: "studio-bulk", role: "group", "aria-label": "Selected item actions" }, /* @__PURE__ */ React8.createElement("span", { role: "status" }, selected.size, " selected"), /* @__PURE__ */ React8.createElement(
|
|
4867
|
+
Button,
|
|
4868
|
+
{
|
|
4869
|
+
label: allSelected ? "Deselect page" : "Select page",
|
|
4870
|
+
variant: "text-tonal-sm",
|
|
4871
|
+
disabled: !rows.length,
|
|
4872
|
+
onClick: toggleSelectedPage
|
|
4873
|
+
}
|
|
4874
|
+
), route.page === "projects" ? /* @__PURE__ */ React8.createElement(
|
|
4875
|
+
Button,
|
|
4876
|
+
{
|
|
4877
|
+
label: "Copy names",
|
|
4878
|
+
variant: "text-tonal-sm",
|
|
4879
|
+
disabled: !selected.size,
|
|
4880
|
+
onClick: () => {
|
|
4881
|
+
void navigator.clipboard.writeText([...selected.values()].map((item) => item.title).join("\n")).then(
|
|
4882
|
+
() => setNotice("Project names copied."),
|
|
4883
|
+
(error2) => setError(message(error2))
|
|
4884
|
+
);
|
|
4885
|
+
}
|
|
4886
|
+
}
|
|
4887
|
+
) : /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(
|
|
4888
|
+
Button,
|
|
4889
|
+
{
|
|
4890
|
+
label: "Favorite",
|
|
4891
|
+
variant: "text-tonal-sm",
|
|
4892
|
+
disabled: !selectedRefs.length || busy,
|
|
4893
|
+
onClick: () => void favorite(selectedRefs, true)
|
|
4894
|
+
}
|
|
4895
|
+
), /* @__PURE__ */ React8.createElement(
|
|
4896
|
+
Button,
|
|
4897
|
+
{
|
|
4898
|
+
label: "Download",
|
|
4899
|
+
variant: "text-tonal-sm",
|
|
4900
|
+
disabled: !selectedRefs.length || busy,
|
|
4901
|
+
onClick: () => void download(selectedRefs)
|
|
4902
|
+
}
|
|
4903
|
+
)), /* @__PURE__ */ React8.createElement(
|
|
4904
|
+
Button,
|
|
4905
|
+
{
|
|
4906
|
+
label: "Cancel selection",
|
|
4907
|
+
variant: "text-tonal-sm",
|
|
4908
|
+
onClick: stopSelecting
|
|
4909
|
+
}
|
|
4910
|
+
)) : /* @__PURE__ */ React8.createElement(
|
|
4911
|
+
"div",
|
|
4912
|
+
{
|
|
4913
|
+
className: route.page === "assets" ? "studio-toolbar-controls vx-asset-library-controls" : "studio-toolbar-controls"
|
|
4914
|
+
},
|
|
4915
|
+
!active.id.startsWith("default:") && /* @__PURE__ */ React8.createElement(
|
|
4916
|
+
Button,
|
|
4569
4917
|
{
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4918
|
+
label: "Edit view",
|
|
4919
|
+
variant: "text-tonal-sm",
|
|
4920
|
+
onClick: () => setEditor(active)
|
|
4573
4921
|
}
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
id: "favorite",
|
|
4578
|
-
label: "Favorites",
|
|
4579
|
-
options: ["Favorites"],
|
|
4580
|
-
optionLabels: { Favorites: "Favorited" }
|
|
4581
|
-
}
|
|
4582
|
-
] : [
|
|
4583
|
-
{
|
|
4584
|
-
id: "state",
|
|
4585
|
-
label: "Status",
|
|
4586
|
-
options: Object.keys(taskLabels),
|
|
4587
|
-
optionLabels: taskLabels
|
|
4588
|
-
}
|
|
4589
|
-
],
|
|
4922
|
+
),
|
|
4923
|
+
builtIn && /* @__PURE__ */ React8.createElement(
|
|
4924
|
+
Button,
|
|
4590
4925
|
{
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4926
|
+
label: "Selects",
|
|
4927
|
+
leadingIcon: "select-items",
|
|
4928
|
+
variant: "text-tonal-sm",
|
|
4929
|
+
width: "hug",
|
|
4930
|
+
onClick: () => setSelecting(true)
|
|
4931
|
+
}
|
|
4932
|
+
),
|
|
4933
|
+
builtIn && /* @__PURE__ */ React8.createElement(
|
|
4934
|
+
FilterMenu,
|
|
4595
4935
|
{
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4936
|
+
label: "Filter",
|
|
4937
|
+
leadingIcon: "filter",
|
|
4938
|
+
groups: route.page === "projects" ? [
|
|
4939
|
+
{ id: "type", label: "Project type", options: projectTypes },
|
|
4940
|
+
{
|
|
4941
|
+
id: "availability",
|
|
4942
|
+
label: "Availability",
|
|
4943
|
+
options: ["Available", "Unavailable"]
|
|
4944
|
+
}
|
|
4945
|
+
] : [
|
|
4946
|
+
...route.page === "assets" ? [
|
|
4947
|
+
{
|
|
4948
|
+
id: "favorite",
|
|
4949
|
+
label: "Favorites",
|
|
4950
|
+
options: ["Favorites"],
|
|
4951
|
+
optionLabels: { Favorites: "Favorited" }
|
|
4952
|
+
}
|
|
4953
|
+
] : [
|
|
4954
|
+
{
|
|
4955
|
+
id: "state",
|
|
4956
|
+
label: "Status",
|
|
4957
|
+
options: Object.keys(taskLabels),
|
|
4958
|
+
optionLabels: taskLabels
|
|
4959
|
+
}
|
|
4960
|
+
],
|
|
4961
|
+
{
|
|
4962
|
+
id: "subject",
|
|
4963
|
+
label: "Type",
|
|
4964
|
+
options: ["Character", "Scene", "Product", "Model"],
|
|
4965
|
+
optionLabels: { Scene: "Shot" }
|
|
4966
|
+
},
|
|
4967
|
+
{
|
|
4968
|
+
id: "format",
|
|
4969
|
+
label: "Format",
|
|
4970
|
+
options: ["image", "video", "audio", "text"],
|
|
4971
|
+
optionLabels: {
|
|
4972
|
+
image: "Image",
|
|
4973
|
+
video: "Video",
|
|
4974
|
+
audio: "Audio",
|
|
4975
|
+
text: "Script"
|
|
4976
|
+
}
|
|
4977
|
+
},
|
|
4978
|
+
{
|
|
4979
|
+
id: "aspect",
|
|
4980
|
+
initiallyCollapsed: true,
|
|
4981
|
+
label: "Aspect ratio",
|
|
4982
|
+
options: ["16:9", "9:16", "1:1", "4:3", "3:4"]
|
|
4983
|
+
},
|
|
4984
|
+
{
|
|
4985
|
+
id: "model",
|
|
4986
|
+
initiallyCollapsed: true,
|
|
4987
|
+
label: "Generation Model",
|
|
4988
|
+
options: [
|
|
4989
|
+
...new Set(
|
|
4990
|
+
(libraryRows ?? []).map((row) => row.modelId).filter(
|
|
4991
|
+
(id) => typeof id === "string" && !!id
|
|
4992
|
+
)
|
|
4993
|
+
)
|
|
4994
|
+
]
|
|
4995
|
+
},
|
|
4996
|
+
{
|
|
4997
|
+
id: "project",
|
|
4998
|
+
initiallyCollapsed: true,
|
|
4999
|
+
label: "Project",
|
|
5000
|
+
options: catalog.map((p) => p.id),
|
|
5001
|
+
optionLabels: Object.fromEntries(
|
|
5002
|
+
catalog.map((p) => [
|
|
5003
|
+
p.id,
|
|
5004
|
+
projectSummaries.get(p.id)?.name || p.name
|
|
5005
|
+
])
|
|
5006
|
+
)
|
|
5007
|
+
}
|
|
5008
|
+
],
|
|
5009
|
+
value: favoriteView ? { ...assetFilter, favorite: ["Favorites"] } : assetFilter,
|
|
5010
|
+
onValueChange: (next) => {
|
|
5011
|
+
setAssetFilter(next);
|
|
5012
|
+
navigate({
|
|
5013
|
+
...route,
|
|
5014
|
+
view: favoriteView && !next.favorite?.length ? "default:assets" : route.view,
|
|
5015
|
+
offset: 0
|
|
5016
|
+
});
|
|
4604
5017
|
}
|
|
4605
|
-
}
|
|
5018
|
+
}
|
|
5019
|
+
),
|
|
5020
|
+
/* @__PURE__ */ React8.createElement(
|
|
5021
|
+
SegmentedControl,
|
|
4606
5022
|
{
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
5023
|
+
label: "Layout",
|
|
5024
|
+
iconOnly: true,
|
|
5025
|
+
width: "hug",
|
|
5026
|
+
value: route.layout,
|
|
5027
|
+
items: [
|
|
5028
|
+
{ value: "list", label: "List", icon: "list" },
|
|
5029
|
+
{ value: "grid", label: "Grid", icon: "grid" }
|
|
5030
|
+
],
|
|
5031
|
+
onValueChange: (layout) => navigate({ ...route, layout })
|
|
5032
|
+
}
|
|
5033
|
+
),
|
|
5034
|
+
route.page === "projects" && NewProjectDialog && /* @__PURE__ */ React8.createElement(
|
|
5035
|
+
Button,
|
|
4612
5036
|
{
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
)
|
|
4622
|
-
]
|
|
4623
|
-
},
|
|
5037
|
+
label: "Create Project",
|
|
5038
|
+
variant: "text-filled-sm",
|
|
5039
|
+
width: "hug",
|
|
5040
|
+
onClick: () => setCreatingProject(true)
|
|
5041
|
+
}
|
|
5042
|
+
),
|
|
5043
|
+
route.page === "assets" && /* @__PURE__ */ React8.createElement(
|
|
5044
|
+
Button,
|
|
4624
5045
|
{
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
catalog.map((p) => [
|
|
4631
|
-
p.id,
|
|
4632
|
-
projectSummaries.get(p.id)?.name || p.name
|
|
4633
|
-
])
|
|
4634
|
-
)
|
|
5046
|
+
label: "Import assets",
|
|
5047
|
+
width: "hug",
|
|
5048
|
+
variant: "text-filled-sm",
|
|
5049
|
+
disabled: busy,
|
|
5050
|
+
onClick: () => importInput.current?.click()
|
|
4635
5051
|
}
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
navigate({
|
|
4641
|
-
...route,
|
|
4642
|
-
view: favoriteView && !next.favorite?.length ? "default:assets" : route.view,
|
|
4643
|
-
offset: 0
|
|
4644
|
-
});
|
|
4645
|
-
}
|
|
4646
|
-
}
|
|
4647
|
-
), /* @__PURE__ */ React6.createElement(
|
|
4648
|
-
SegmentedControl,
|
|
4649
|
-
{
|
|
4650
|
-
label: "Layout",
|
|
4651
|
-
iconOnly: true,
|
|
4652
|
-
width: "hug",
|
|
4653
|
-
value: route.layout,
|
|
4654
|
-
items: [
|
|
4655
|
-
{ value: "list", label: "List", icon: "list" },
|
|
4656
|
-
{ value: "grid", label: "Grid", icon: "grid" }
|
|
4657
|
-
],
|
|
4658
|
-
onValueChange: (layout) => navigate({ ...route, layout })
|
|
4659
|
-
}
|
|
4660
|
-
), route.page === "projects" && NewProjectDialog && /* @__PURE__ */ React6.createElement(
|
|
4661
|
-
Button,
|
|
4662
|
-
{
|
|
4663
|
-
label: "Create Project",
|
|
4664
|
-
variant: "text-filled-sm",
|
|
4665
|
-
width: "hug",
|
|
4666
|
-
onClick: () => setCreatingProject(true)
|
|
4667
|
-
}
|
|
4668
|
-
), route.page === "assets" && /* @__PURE__ */ React6.createElement(
|
|
4669
|
-
Button,
|
|
4670
|
-
{
|
|
4671
|
-
label: "Import assets",
|
|
4672
|
-
width: "hug",
|
|
4673
|
-
variant: "text-filled-sm",
|
|
4674
|
-
disabled: busy,
|
|
4675
|
-
onClick: () => importInput.current?.click()
|
|
4676
|
-
}
|
|
4677
|
-
))),
|
|
4678
|
-
/* @__PURE__ */ React6.createElement(
|
|
5052
|
+
)
|
|
5053
|
+
)
|
|
5054
|
+
),
|
|
5055
|
+
/* @__PURE__ */ React8.createElement(
|
|
4679
5056
|
Results,
|
|
4680
5057
|
{
|
|
4681
5058
|
route,
|
|
@@ -4696,7 +5073,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4696
5073
|
rowActions
|
|
4697
5074
|
}
|
|
4698
5075
|
),
|
|
4699
|
-
!builtIn && (route.offset > 0 || nextOffset !== null) && /* @__PURE__ */
|
|
5076
|
+
!builtIn && (route.offset > 0 || nextOffset !== null) && /* @__PURE__ */ React8.createElement("footer", { className: "studio-pagination" }, /* @__PURE__ */ React8.createElement(
|
|
4700
5077
|
Button,
|
|
4701
5078
|
{
|
|
4702
5079
|
label: "Previous page",
|
|
@@ -4704,7 +5081,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4704
5081
|
disabled: route.offset === 0 || queryLoading,
|
|
4705
5082
|
onClick: () => navigate({ ...route, offset: Math.max(0, route.offset - 50) })
|
|
4706
5083
|
}
|
|
4707
|
-
), /* @__PURE__ */
|
|
5084
|
+
), /* @__PURE__ */ React8.createElement("span", null, "Page ", Math.floor(route.offset / 50) + 1), /* @__PURE__ */ React8.createElement(
|
|
4708
5085
|
Button,
|
|
4709
5086
|
{
|
|
4710
5087
|
label: "Next page",
|
|
@@ -4715,7 +5092,25 @@ function GlobalWorkbench({ client }) {
|
|
|
4715
5092
|
))
|
|
4716
5093
|
))
|
|
4717
5094
|
),
|
|
4718
|
-
/* @__PURE__ */
|
|
5095
|
+
route.ref && /* @__PURE__ */ React8.createElement(
|
|
5096
|
+
Detail,
|
|
5097
|
+
{
|
|
5098
|
+
key: detailIdentity,
|
|
5099
|
+
error: error || failure?.message || "",
|
|
5100
|
+
notice,
|
|
5101
|
+
detail,
|
|
5102
|
+
refValue: route.ref,
|
|
5103
|
+
busy,
|
|
5104
|
+
onBack: () => navigate({ ...route, ref: null }),
|
|
5105
|
+
onVersion: (ref) => navigate({ ...route, ref }),
|
|
5106
|
+
references: (value) => renderReferences(value),
|
|
5107
|
+
onFavorite: (ref, enabled) => void favorite([ref], enabled),
|
|
5108
|
+
onDownload: (refs) => void download(refs),
|
|
5109
|
+
onProject: openProject,
|
|
5110
|
+
project: catalog.find((project) => project.id === detail?.item.projectId)
|
|
5111
|
+
}
|
|
5112
|
+
),
|
|
5113
|
+
/* @__PURE__ */ React8.createElement(
|
|
4719
5114
|
"input",
|
|
4720
5115
|
{
|
|
4721
5116
|
ref: coverInput,
|
|
@@ -4731,7 +5126,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4731
5126
|
}
|
|
4732
5127
|
}
|
|
4733
5128
|
),
|
|
4734
|
-
/* @__PURE__ */
|
|
5129
|
+
/* @__PURE__ */ React8.createElement(
|
|
4735
5130
|
"input",
|
|
4736
5131
|
{
|
|
4737
5132
|
ref: importInput,
|
|
@@ -4749,7 +5144,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4749
5144
|
}
|
|
4750
5145
|
}
|
|
4751
5146
|
),
|
|
4752
|
-
/* @__PURE__ */
|
|
5147
|
+
/* @__PURE__ */ React8.createElement(
|
|
4753
5148
|
"iframe",
|
|
4754
5149
|
{
|
|
4755
5150
|
name: downloadFrame,
|
|
@@ -4769,13 +5164,13 @@ function GlobalWorkbench({ client }) {
|
|
|
4769
5164
|
}
|
|
4770
5165
|
}
|
|
4771
5166
|
),
|
|
4772
|
-
pendingImport && /* @__PURE__ */
|
|
5167
|
+
pendingImport && /* @__PURE__ */ React8.createElement(
|
|
4773
5168
|
Dialog,
|
|
4774
5169
|
{
|
|
4775
5170
|
title: "Import assets",
|
|
4776
5171
|
open: true,
|
|
4777
5172
|
onOpenChange: (open) => !open && !busy && setPendingImport(void 0),
|
|
4778
|
-
actions: /* @__PURE__ */
|
|
5173
|
+
actions: /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(
|
|
4779
5174
|
Button,
|
|
4780
5175
|
{
|
|
4781
5176
|
label: "Cancel",
|
|
@@ -4783,7 +5178,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4783
5178
|
disabled: busy,
|
|
4784
5179
|
onClick: () => setPendingImport(void 0)
|
|
4785
5180
|
}
|
|
4786
|
-
), /* @__PURE__ */
|
|
5181
|
+
), /* @__PURE__ */ React8.createElement(
|
|
4787
5182
|
Button,
|
|
4788
5183
|
{
|
|
4789
5184
|
label: busy ? "Importing\u2026" : "Import",
|
|
@@ -4792,8 +5187,8 @@ function GlobalWorkbench({ client }) {
|
|
|
4792
5187
|
}
|
|
4793
5188
|
))
|
|
4794
5189
|
},
|
|
4795
|
-
/* @__PURE__ */
|
|
4796
|
-
/* @__PURE__ */
|
|
5190
|
+
/* @__PURE__ */ React8.createElement("p", null, pendingImport.files.length, " files selected. Choose their project."),
|
|
5191
|
+
/* @__PURE__ */ React8.createElement(
|
|
4797
5192
|
Dropdown,
|
|
4798
5193
|
{
|
|
4799
5194
|
label: "Import into project",
|
|
@@ -4803,10 +5198,10 @@ function GlobalWorkbench({ client }) {
|
|
|
4803
5198
|
onValueChange: (projectId2) => setPendingImport({ ...pendingImport, projectId: projectId2 })
|
|
4804
5199
|
}
|
|
4805
5200
|
),
|
|
4806
|
-
!catalog.some((p) => p.available) && /* @__PURE__ */
|
|
4807
|
-
error && /* @__PURE__ */
|
|
5201
|
+
!catalog.some((p) => p.available) && /* @__PURE__ */ React8.createElement("p", { role: "alert" }, "Create a project before importing assets."),
|
|
5202
|
+
error && /* @__PURE__ */ React8.createElement("p", { role: "alert" }, error)
|
|
4808
5203
|
),
|
|
4809
|
-
projectAction && /* @__PURE__ */
|
|
5204
|
+
projectAction && /* @__PURE__ */ React8.createElement(
|
|
4810
5205
|
Dialog,
|
|
4811
5206
|
{
|
|
4812
5207
|
title: "Rename project",
|
|
@@ -4814,7 +5209,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4814
5209
|
onOpenChange: (open) => {
|
|
4815
5210
|
if (!open && !projectActionBusy) setProjectAction(null);
|
|
4816
5211
|
},
|
|
4817
|
-
actions: /* @__PURE__ */
|
|
5212
|
+
actions: /* @__PURE__ */ React8.createElement(
|
|
4818
5213
|
Button,
|
|
4819
5214
|
{
|
|
4820
5215
|
label: "Rename",
|
|
@@ -4824,7 +5219,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4824
5219
|
}
|
|
4825
5220
|
)
|
|
4826
5221
|
},
|
|
4827
|
-
/* @__PURE__ */
|
|
5222
|
+
/* @__PURE__ */ React8.createElement(
|
|
4828
5223
|
"form",
|
|
4829
5224
|
{
|
|
4830
5225
|
onSubmit: (event2) => {
|
|
@@ -4832,7 +5227,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4832
5227
|
void saveProjectAction();
|
|
4833
5228
|
}
|
|
4834
5229
|
},
|
|
4835
|
-
/* @__PURE__ */
|
|
5230
|
+
/* @__PURE__ */ React8.createElement(
|
|
4836
5231
|
TextInput,
|
|
4837
5232
|
{
|
|
4838
5233
|
label: "Project name",
|
|
@@ -4842,11 +5237,20 @@ function GlobalWorkbench({ client }) {
|
|
|
4842
5237
|
onValueChange: (name) => setProjectAction({ ...projectAction, name })
|
|
4843
5238
|
}
|
|
4844
5239
|
),
|
|
4845
|
-
projectActionError && /* @__PURE__ */
|
|
5240
|
+
projectActionError && /* @__PURE__ */ React8.createElement("p", { role: "alert" }, projectActionError)
|
|
4846
5241
|
)
|
|
4847
5242
|
),
|
|
4848
|
-
|
|
4849
|
-
|
|
5243
|
+
route.home?.mode === "dashboard" && !route.project && !route.ref && /* @__PURE__ */ React8.createElement(
|
|
5244
|
+
WelcomeDialog,
|
|
5245
|
+
{
|
|
5246
|
+
client,
|
|
5247
|
+
instanceId: ownInstance,
|
|
5248
|
+
onCreate: NewProjectDialog ? () => setCreatingProject(true) : void 0,
|
|
5249
|
+
onProject: onProjectCreated
|
|
5250
|
+
}
|
|
5251
|
+
),
|
|
5252
|
+
creatingProject && NewProjectDialog && /* @__PURE__ */ React8.createElement(NewProjectDialog, { close: () => setCreatingProject(false), onCreated: onProjectCreated }),
|
|
5253
|
+
createViewOpen && /* @__PURE__ */ React8.createElement(
|
|
4850
5254
|
CreateViewDialog,
|
|
4851
5255
|
{
|
|
4852
5256
|
source: route.page,
|
|
@@ -4854,7 +5258,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4854
5258
|
onCopy: () => setNotice("Prompt copied. Paste it into your agent chat.")
|
|
4855
5259
|
}
|
|
4856
5260
|
),
|
|
4857
|
-
editor && /* @__PURE__ */
|
|
5261
|
+
editor && /* @__PURE__ */ React8.createElement(
|
|
4858
5262
|
CustomViewEditor,
|
|
4859
5263
|
{
|
|
4860
5264
|
saved: editor,
|
|
@@ -4877,7 +5281,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4877
5281
|
}
|
|
4878
5282
|
}
|
|
4879
5283
|
),
|
|
4880
|
-
MagicEdit && /* @__PURE__ */
|
|
5284
|
+
MagicEdit && /* @__PURE__ */ React8.createElement(
|
|
4881
5285
|
MagicEdit,
|
|
4882
5286
|
{
|
|
4883
5287
|
key: projectEntry ?? route.page,
|
|
@@ -4889,10 +5293,10 @@ function GlobalWorkbench({ client }) {
|
|
|
4889
5293
|
}
|
|
4890
5294
|
|
|
4891
5295
|
// packages/studio-workbench/src/creation.tsx
|
|
4892
|
-
import * as
|
|
5296
|
+
import * as React10 from "react";
|
|
4893
5297
|
|
|
4894
5298
|
// packages/studio-workbench/src/file-browser.tsx
|
|
4895
|
-
import * as
|
|
5299
|
+
import * as React9 from "react";
|
|
4896
5300
|
var fileKinds = {
|
|
4897
5301
|
image: "Image",
|
|
4898
5302
|
video: "Video",
|
|
@@ -4927,9 +5331,9 @@ var date = (value) => value ? new Date(value).toLocaleString("zh-CN", {
|
|
|
4927
5331
|
minute: "2-digit"
|
|
4928
5332
|
}) : "";
|
|
4929
5333
|
function FilePreview({ bridge, projectId, instance, row, version, compact = false }) {
|
|
4930
|
-
const mediaElement =
|
|
4931
|
-
const [location2, setLocation] =
|
|
4932
|
-
|
|
5334
|
+
const mediaElement = React9.useRef(null);
|
|
5335
|
+
const [location2, setLocation] = React9.useState(null), [text, setText] = React9.useState(""), [error, setError] = React9.useState("");
|
|
5336
|
+
React9.useEffect(() => {
|
|
4933
5337
|
const element = mediaElement.current;
|
|
4934
5338
|
return () => {
|
|
4935
5339
|
if (element) {
|
|
@@ -4939,7 +5343,7 @@ function FilePreview({ bridge, projectId, instance, row, version, compact = fals
|
|
|
4939
5343
|
}
|
|
4940
5344
|
};
|
|
4941
5345
|
}, [location2?.previewUrl]);
|
|
4942
|
-
|
|
5346
|
+
React9.useEffect(() => {
|
|
4943
5347
|
let active = true;
|
|
4944
5348
|
setLocation(null);
|
|
4945
5349
|
setText("");
|
|
@@ -4962,15 +5366,15 @@ function FilePreview({ bridge, projectId, instance, row, version, compact = fals
|
|
|
4962
5366
|
active = false;
|
|
4963
5367
|
};
|
|
4964
5368
|
}, [projectId, instance, row.objectId, version?.versionId, compact]);
|
|
4965
|
-
if (!version) return /* @__PURE__ */
|
|
4966
|
-
if (error) return /* @__PURE__ */
|
|
5369
|
+
if (!version) return /* @__PURE__ */ React9.createElement("div", { className: "file-placeholder" }, "\u6587\u4EF6\u5C1A\u65E0\u5185\u5BB9");
|
|
5370
|
+
if (error) return /* @__PURE__ */ React9.createElement("div", { className: "file-placeholder" }, error);
|
|
4967
5371
|
if (row.data.kind === "text" && compact)
|
|
4968
|
-
return /* @__PURE__ */
|
|
4969
|
-
if (!location2) return /* @__PURE__ */
|
|
5372
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "file-document", "aria-hidden": "true" }, /* @__PURE__ */ React9.createElement("span", null, "\u6587"), /* @__PURE__ */ React9.createElement("i", null), /* @__PURE__ */ React9.createElement("i", null), /* @__PURE__ */ React9.createElement("i", null));
|
|
5373
|
+
if (!location2) return /* @__PURE__ */ React9.createElement("div", { className: "file-placeholder" }, "\u6B63\u5728\u52A0\u8F7D\u2026");
|
|
4970
5374
|
if (row.data.kind === "image")
|
|
4971
|
-
return /* @__PURE__ */
|
|
5375
|
+
return /* @__PURE__ */ React9.createElement("img", { loading: "lazy", src: location2.previewUrl, alt: row.data.name });
|
|
4972
5376
|
if (row.data.kind === "video")
|
|
4973
|
-
return /* @__PURE__ */
|
|
5377
|
+
return /* @__PURE__ */ React9.createElement(
|
|
4974
5378
|
"video",
|
|
4975
5379
|
{
|
|
4976
5380
|
ref: mediaElement,
|
|
@@ -4982,7 +5386,7 @@ function FilePreview({ bridge, projectId, instance, row, version, compact = fals
|
|
|
4982
5386
|
}
|
|
4983
5387
|
);
|
|
4984
5388
|
if (row.data.kind === "audio")
|
|
4985
|
-
return compact ? /* @__PURE__ */
|
|
5389
|
+
return compact ? /* @__PURE__ */ React9.createElement("div", { className: "file-symbol" }, "\u266B") : /* @__PURE__ */ React9.createElement(
|
|
4986
5390
|
"audio",
|
|
4987
5391
|
{
|
|
4988
5392
|
ref: mediaElement,
|
|
@@ -4991,8 +5395,8 @@ function FilePreview({ bridge, projectId, instance, row, version, compact = fals
|
|
|
4991
5395
|
src: location2.previewUrl
|
|
4992
5396
|
}
|
|
4993
5397
|
);
|
|
4994
|
-
if (row.data.kind === "text") return /* @__PURE__ */
|
|
4995
|
-
return /* @__PURE__ */
|
|
5398
|
+
if (row.data.kind === "text") return /* @__PURE__ */ React9.createElement("pre", { className: "file-text" }, text);
|
|
5399
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "file-symbol" }, "\u6587\u4EF6");
|
|
4996
5400
|
}
|
|
4997
5401
|
function FileBrowser({
|
|
4998
5402
|
rows,
|
|
@@ -5012,19 +5416,19 @@ function FileBrowser({
|
|
|
5012
5416
|
Properties,
|
|
5013
5417
|
MediaActions
|
|
5014
5418
|
}) {
|
|
5015
|
-
const [mediaOpen, setMediaOpen] =
|
|
5016
|
-
const [versionId, setVersionId] =
|
|
5017
|
-
const upload =
|
|
5419
|
+
const [mediaOpen, setMediaOpen] = React9.useState(false);
|
|
5420
|
+
const [versionId, setVersionId] = React9.useState(""), [menu, setMenu] = React9.useState(false), [edit, setEdit] = React9.useState(""), [name, setName] = React9.useState(""), [tags2, setTags] = React9.useState(""), [text, setText] = React9.useState(""), [working, setWorking] = React9.useState(false), [download, setDownload] = React9.useState(""), [notice, setNotice] = React9.useState(""), [targetProject, setTargetProject] = React9.useState("");
|
|
5421
|
+
const upload = React9.useRef(null);
|
|
5018
5422
|
const library = !projectId;
|
|
5019
5423
|
const version = selected?.versions?.find((v) => v.versionId === versionId) || selected?.versions?.at(-1);
|
|
5020
5424
|
const call = (op, input, options = {}) => projectId ? bridge.project(projectId, instance, op, input, options) : bridge.user(instance, op, input, options);
|
|
5021
|
-
|
|
5425
|
+
React9.useEffect(() => {
|
|
5022
5426
|
setVersionId(selected?.versions?.at(-1)?.versionId || "");
|
|
5023
5427
|
setMenu(false);
|
|
5024
5428
|
setEdit("");
|
|
5025
5429
|
setNotice("");
|
|
5026
5430
|
}, [selected?.objectId]);
|
|
5027
|
-
|
|
5431
|
+
React9.useEffect(() => {
|
|
5028
5432
|
let active = true;
|
|
5029
5433
|
setDownload("");
|
|
5030
5434
|
if (selected && version)
|
|
@@ -5057,7 +5461,7 @@ function FileBrowser({
|
|
|
5057
5461
|
setMenu(false);
|
|
5058
5462
|
setEdit("rename");
|
|
5059
5463
|
};
|
|
5060
|
-
return /* @__PURE__ */
|
|
5464
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, notice && !selected && /* @__PURE__ */ React9.createElement("p", { className: "file-notice", role: "status" }, notice), /* @__PURE__ */ React9.createElement("div", { className: "file-grid", "aria-label": "\u6587\u4EF6\u5217\u8868" }, rows.map((row) => /* @__PURE__ */ React9.createElement(
|
|
5061
5465
|
"button",
|
|
5062
5466
|
{
|
|
5063
5467
|
className: "file-tile",
|
|
@@ -5065,7 +5469,7 @@ function FileBrowser({
|
|
|
5065
5469
|
onClick: () => onSelect(row),
|
|
5066
5470
|
"aria-label": "\u6253\u5F00\u6587\u4EF6 " + row.data.name
|
|
5067
5471
|
},
|
|
5068
|
-
/* @__PURE__ */
|
|
5472
|
+
/* @__PURE__ */ React9.createElement("div", { className: "file-tile-preview" }, /* @__PURE__ */ React9.createElement(
|
|
5069
5473
|
FilePreview,
|
|
5070
5474
|
{
|
|
5071
5475
|
bridge,
|
|
@@ -5076,10 +5480,10 @@ function FileBrowser({
|
|
|
5076
5480
|
compact: true
|
|
5077
5481
|
}
|
|
5078
5482
|
)),
|
|
5079
|
-
/* @__PURE__ */
|
|
5080
|
-
/* @__PURE__ */
|
|
5081
|
-
!!row.data.tags?.length && /* @__PURE__ */
|
|
5082
|
-
))), !rows.length && /* @__PURE__ */
|
|
5483
|
+
/* @__PURE__ */ React9.createElement("strong", null, row.data.name),
|
|
5484
|
+
/* @__PURE__ */ React9.createElement("span", null, fileKinds[row.data.kind] || "\u6587\u4EF6", /* @__PURE__ */ React9.createElement("span", null, date(row.updatedAt))),
|
|
5485
|
+
!!row.data.tags?.length && /* @__PURE__ */ React9.createElement("div", { className: "file-tags" }, row.data.tags.slice(0, 3).map((tag) => /* @__PURE__ */ React9.createElement("small", { key: tag }, tag)))
|
|
5486
|
+
))), !rows.length && /* @__PURE__ */ React9.createElement("div", { className: "files-empty" }, /* @__PURE__ */ React9.createElement("span", null, "\uFF0B"), /* @__PURE__ */ React9.createElement("h2", null, "\u8FD9\u91CC\u8FD8\u6CA1\u6709\u6587\u4EF6"), /* @__PURE__ */ React9.createElement("p", null, "\u4E0A\u4F20\u6587\u4EF6\uFF0C\u6216\u4ECE\u300C\u751F\u6210\u300D\u5F00\u59CB\u521B\u4F5C\u3002")), selected && /* @__PURE__ */ React9.createElement(
|
|
5083
5487
|
"div",
|
|
5084
5488
|
{
|
|
5085
5489
|
className: "file-overlay",
|
|
@@ -5087,7 +5491,7 @@ function FileBrowser({
|
|
|
5087
5491
|
if (e.key === "Escape") onClose();
|
|
5088
5492
|
}
|
|
5089
5493
|
},
|
|
5090
|
-
/* @__PURE__ */
|
|
5494
|
+
/* @__PURE__ */ React9.createElement(
|
|
5091
5495
|
"section",
|
|
5092
5496
|
{
|
|
5093
5497
|
className: "file-viewer",
|
|
@@ -5095,7 +5499,7 @@ function FileBrowser({
|
|
|
5095
5499
|
"aria-modal": "true",
|
|
5096
5500
|
"aria-label": "\u6587\u4EF6\u9884\u89C8 " + selected.data.name
|
|
5097
5501
|
},
|
|
5098
|
-
/* @__PURE__ */
|
|
5502
|
+
/* @__PURE__ */ React9.createElement("div", { className: "file-viewer-header" }, /* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement("strong", null, selected.data.name), /* @__PURE__ */ React9.createElement("span", null, fileKinds[selected.data.kind] || "\u6587\u4EF6")), /* @__PURE__ */ React9.createElement("div", { className: "actions" }, download && /* @__PURE__ */ React9.createElement("a", { className: "button", href: download, download: selected.data.name }, "\u4E0B\u8F7D"), projectId && ["image", "video", "audio"].includes(selected.data.kind) && version && /* @__PURE__ */ React9.createElement("button", { className: "primary", onClick: () => onUse(selected, version) }, "\u7528\u4F5C\u53C2\u8003"), /* @__PURE__ */ React9.createElement("div", { className: "file-more" }, /* @__PURE__ */ React9.createElement(
|
|
5099
5503
|
"button",
|
|
5100
5504
|
{
|
|
5101
5505
|
"aria-label": "\u66F4\u591A\u6587\u4EF6\u64CD\u4F5C",
|
|
@@ -5103,7 +5507,7 @@ function FileBrowser({
|
|
|
5103
5507
|
onClick: () => setMenu(!menu)
|
|
5104
5508
|
},
|
|
5105
5509
|
"\u66F4\u591A \u22EF"
|
|
5106
|
-
), menu && /* @__PURE__ */
|
|
5510
|
+
), menu && /* @__PURE__ */ React9.createElement("div", { role: "menu", className: "file-menu" }, /* @__PURE__ */ React9.createElement("button", { role: "menuitem", onClick: rename }, "\u91CD\u547D\u540D\u4E0E\u6807\u7B7E"), version && /* @__PURE__ */ React9.createElement(
|
|
5107
5511
|
"button",
|
|
5108
5512
|
{
|
|
5109
5513
|
role: "menuitem",
|
|
@@ -5113,7 +5517,7 @@ function FileBrowser({
|
|
|
5113
5517
|
}
|
|
5114
5518
|
},
|
|
5115
5519
|
"\u4E0A\u4F20\u65B0\u7248\u672C"
|
|
5116
|
-
), projectId && selected.data.kind === "text" && version && /* @__PURE__ */
|
|
5520
|
+
), projectId && selected.data.kind === "text" && version && /* @__PURE__ */ React9.createElement(
|
|
5117
5521
|
"button",
|
|
5118
5522
|
{
|
|
5119
5523
|
role: "menuitem",
|
|
@@ -5125,7 +5529,7 @@ function FileBrowser({
|
|
|
5125
5529
|
}, false)
|
|
5126
5530
|
},
|
|
5127
5531
|
"\u7F16\u8F91\u6587\u672C"
|
|
5128
|
-
), library && /* @__PURE__ */
|
|
5532
|
+
), library && /* @__PURE__ */ React9.createElement(
|
|
5129
5533
|
"button",
|
|
5130
5534
|
{
|
|
5131
5535
|
role: "menuitem",
|
|
@@ -5136,7 +5540,7 @@ function FileBrowser({
|
|
|
5136
5540
|
}
|
|
5137
5541
|
},
|
|
5138
5542
|
"\u6DFB\u52A0\u5230\u9879\u76EE"
|
|
5139
|
-
), /* @__PURE__ */
|
|
5543
|
+
), /* @__PURE__ */ React9.createElement(
|
|
5140
5544
|
"button",
|
|
5141
5545
|
{
|
|
5142
5546
|
role: "menuitem",
|
|
@@ -5156,9 +5560,9 @@ function FileBrowser({
|
|
|
5156
5560
|
})
|
|
5157
5561
|
},
|
|
5158
5562
|
"\u79FB\u9664\u6587\u4EF6"
|
|
5159
|
-
))), /* @__PURE__ */
|
|
5160
|
-
notice && /* @__PURE__ */
|
|
5161
|
-
/* @__PURE__ */
|
|
5563
|
+
))), /* @__PURE__ */ React9.createElement("button", { "aria-label": "\u5173\u95ED\u6587\u4EF6\u9884\u89C8", className: "file-close", onClick: onClose }, "\xD7"))),
|
|
5564
|
+
notice && /* @__PURE__ */ React9.createElement("p", { className: "file-viewer-notice", role: "status" }, notice),
|
|
5565
|
+
/* @__PURE__ */ React9.createElement("div", { className: "file-viewer-body" }, /* @__PURE__ */ React9.createElement("div", { className: "file-stage" }, mediaOpen ? /* @__PURE__ */ React9.createElement("p", null, "Playback is paused while video tools are open.") : /* @__PURE__ */ React9.createElement(
|
|
5162
5566
|
FilePreview,
|
|
5163
5567
|
{
|
|
5164
5568
|
bridge,
|
|
@@ -5167,7 +5571,7 @@ function FileBrowser({
|
|
|
5167
5571
|
row: selected,
|
|
5168
5572
|
version
|
|
5169
5573
|
}
|
|
5170
|
-
)), /* @__PURE__ */
|
|
5574
|
+
)), /* @__PURE__ */ React9.createElement("aside", { className: "file-details" }, /* @__PURE__ */ React9.createElement("h3", null, "\u6587\u4EF6\u4FE1\u606F"), /* @__PURE__ */ React9.createElement("p", null, fileKinds[selected.data.kind] || "\u6587\u4EF6"), /* @__PURE__ */ React9.createElement("p", { className: "sub" }, "\u66F4\u65B0\u4E8E ", date(selected.updatedAt)), /* @__PURE__ */ React9.createElement("div", { className: "file-tags" }, selected.data.tags?.map((tag) => /* @__PURE__ */ React9.createElement("small", { key: tag }, tag))), Properties && /* @__PURE__ */ React9.createElement(Properties, { record: selected }), MediaActions && version && selected.data.kind === "video" && /* @__PURE__ */ React9.createElement(
|
|
5171
5575
|
MediaActions,
|
|
5172
5576
|
{
|
|
5173
5577
|
key: JSON.stringify([selected.objectId, version.versionId]),
|
|
@@ -5175,7 +5579,7 @@ function FileBrowser({
|
|
|
5175
5579
|
version,
|
|
5176
5580
|
onActiveChange: setMediaOpen
|
|
5177
5581
|
}
|
|
5178
|
-
), /* @__PURE__ */
|
|
5582
|
+
), /* @__PURE__ */ React9.createElement("h3", null, "\u7248\u672C\u8BB0\u5F55"), /* @__PURE__ */ React9.createElement("div", { className: "file-history" }, [...selected.versions || []].reverse().map((v) => /* @__PURE__ */ React9.createElement(
|
|
5179
5583
|
"button",
|
|
5180
5584
|
{
|
|
5181
5585
|
key: v.versionId,
|
|
@@ -5183,10 +5587,10 @@ function FileBrowser({
|
|
|
5183
5587
|
"aria-label": "\u9884\u89C8\u7B2C " + v.versionNumber + " \u7248",
|
|
5184
5588
|
onClick: () => setVersionId(v.versionId)
|
|
5185
5589
|
},
|
|
5186
|
-
/* @__PURE__ */
|
|
5187
|
-
/* @__PURE__ */
|
|
5590
|
+
/* @__PURE__ */ React9.createElement("b", null, "v", v.versionNumber),
|
|
5591
|
+
/* @__PURE__ */ React9.createElement("span", null, v.versionId === selected.versions.at(-1)?.versionId ? "\u6700\u65B0\u7248\u672C" : date(v.createdAt))
|
|
5188
5592
|
))))),
|
|
5189
|
-
/* @__PURE__ */
|
|
5593
|
+
/* @__PURE__ */ React9.createElement(
|
|
5190
5594
|
"input",
|
|
5191
5595
|
{
|
|
5192
5596
|
ref: upload,
|
|
@@ -5214,7 +5618,7 @@ function FileBrowser({
|
|
|
5214
5618
|
}
|
|
5215
5619
|
}
|
|
5216
5620
|
),
|
|
5217
|
-
edit && /* @__PURE__ */
|
|
5621
|
+
edit && /* @__PURE__ */ React9.createElement("div", { className: "file-edit-overlay" }, /* @__PURE__ */ React9.createElement(
|
|
5218
5622
|
"form",
|
|
5219
5623
|
{
|
|
5220
5624
|
className: "file-edit",
|
|
@@ -5284,8 +5688,8 @@ function FileBrowser({
|
|
|
5284
5688
|
});
|
|
5285
5689
|
}
|
|
5286
5690
|
},
|
|
5287
|
-
/* @__PURE__ */
|
|
5288
|
-
edit === "rename" && /* @__PURE__ */
|
|
5691
|
+
/* @__PURE__ */ React9.createElement("h2", null, edit === "rename" ? "\u91CD\u547D\u540D\u4E0E\u6807\u7B7E" : edit === "text" ? "\u7F16\u8F91\u6587\u672C" : "\u6DFB\u52A0\u5230\u9879\u76EE"),
|
|
5692
|
+
edit === "rename" && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("label", null, "\u6587\u4EF6\u540D", /* @__PURE__ */ React9.createElement(
|
|
5289
5693
|
"input",
|
|
5290
5694
|
{
|
|
5291
5695
|
"aria-label": "\u6587\u4EF6\u540D",
|
|
@@ -5294,7 +5698,7 @@ function FileBrowser({
|
|
|
5294
5698
|
value: name,
|
|
5295
5699
|
onChange: (e) => setName(e.target.value)
|
|
5296
5700
|
}
|
|
5297
|
-
)), /* @__PURE__ */
|
|
5701
|
+
)), /* @__PURE__ */ React9.createElement("label", null, "\u6807\u7B7E", /* @__PURE__ */ React9.createElement(
|
|
5298
5702
|
"input",
|
|
5299
5703
|
{
|
|
5300
5704
|
"aria-label": "\u6587\u4EF6\u6807\u7B7E",
|
|
@@ -5303,7 +5707,7 @@ function FileBrowser({
|
|
|
5303
5707
|
onChange: (e) => setTags(e.target.value)
|
|
5304
5708
|
}
|
|
5305
5709
|
))),
|
|
5306
|
-
edit === "text" && /* @__PURE__ */
|
|
5710
|
+
edit === "text" && /* @__PURE__ */ React9.createElement("label", null, "\u5185\u5BB9", /* @__PURE__ */ React9.createElement(
|
|
5307
5711
|
"textarea",
|
|
5308
5712
|
{
|
|
5309
5713
|
"aria-label": "\u6587\u672C\u5185\u5BB9",
|
|
@@ -5311,22 +5715,22 @@ function FileBrowser({
|
|
|
5311
5715
|
onChange: (e) => setText(e.target.value)
|
|
5312
5716
|
}
|
|
5313
5717
|
)),
|
|
5314
|
-
edit === "project" && !activeProjectId && /* @__PURE__ */
|
|
5718
|
+
edit === "project" && !activeProjectId && /* @__PURE__ */ React9.createElement("label", null, "\u9009\u62E9\u9879\u76EE", /* @__PURE__ */ React9.createElement(
|
|
5315
5719
|
"select",
|
|
5316
5720
|
{
|
|
5317
5721
|
"aria-label": "\u9009\u62E9\u9879\u76EE",
|
|
5318
5722
|
value: targetProject,
|
|
5319
5723
|
onChange: (e) => setTargetProject(e.target.value)
|
|
5320
5724
|
},
|
|
5321
|
-
projects.map((p) => /* @__PURE__ */
|
|
5725
|
+
projects.map((p) => /* @__PURE__ */ React9.createElement("option", { key: p.objectId, value: p.objectId }, p.data.name))
|
|
5322
5726
|
)),
|
|
5323
|
-
/* @__PURE__ */
|
|
5727
|
+
/* @__PURE__ */ React9.createElement("div", { className: "actions" }, /* @__PURE__ */ React9.createElement("button", { className: "primary", disabled: working, type: "submit" }, working ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58"), /* @__PURE__ */ React9.createElement("button", { type: "button", onClick: () => setEdit("") }, "\u53D6\u6D88"))
|
|
5324
5728
|
))
|
|
5325
5729
|
)
|
|
5326
5730
|
));
|
|
5327
5731
|
}
|
|
5328
5732
|
function TaskHistory({ rows, onOpenFile, onRecover, busy, Details }) {
|
|
5329
|
-
return /* @__PURE__ */
|
|
5733
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "task-history" }, rows.filter((task) => task.typeId === "studio.task").map((task) => /* @__PURE__ */ React9.createElement("article", { key: task.objectId }, /* @__PURE__ */ React9.createElement("div", { className: "task-history-icon", "aria-hidden": "true" }, task.data.state === "succeeded" ? "\u2713" : "\u25CC"), /* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement("strong", null, task.data.name || task.data.inputSnapshot?.newAsset?.name || "Generation task"), /* @__PURE__ */ React9.createElement("p", { className: "sub" }, task.projection?.remoteOutcome.status === "succeeded" && task.data.state !== "succeeded" ? "Remote complete \xB7 " : "", taskLabels2[task.data.state] || "Processing", " \xB7 ", date(task.createdAt), " \xB7", " ", taskCostLabel(task.data))), /* @__PURE__ */ React9.createElement("div", { className: "actions" }, Details && /* @__PURE__ */ React9.createElement("details", null, /* @__PURE__ */ React9.createElement("summary", null, "Task details"), /* @__PURE__ */ React9.createElement(Details, { form: task })), onRecover && (task.data.remoteTaskId || task.data.execution?.receipt || task.data.attemptCount > 0) && /* @__PURE__ */ React9.createElement("button", { disabled: busy, onClick: () => onRecover(task) }, "Refresh cost"), task.data.outputRefs?.length > 0 && /* @__PURE__ */ React9.createElement("button", { onClick: () => onOpenFile(task) }, "Open asset")))), !rows.length && /* @__PURE__ */ React9.createElement("div", { className: "files-empty" }, /* @__PURE__ */ React9.createElement("h2", null, "No generation tasks"), /* @__PURE__ */ React9.createElement("p", null, "Generation progress and results will appear here.")));
|
|
5330
5734
|
}
|
|
5331
5735
|
|
|
5332
5736
|
// packages/studio-workbench/src/creation.tsx
|
|
@@ -5346,7 +5750,7 @@ function CreationResults({
|
|
|
5346
5750
|
const pending = tasks.filter(
|
|
5347
5751
|
(task) => !["succeeded", "canceled", "cancelled", "archived"].includes(task.data.state)
|
|
5348
5752
|
);
|
|
5349
|
-
return /* @__PURE__ */
|
|
5753
|
+
return /* @__PURE__ */ React10.createElement("section", { className: "creation-results", "aria-label": "\u751F\u6210\u7ED3\u679C" }, /* @__PURE__ */ React10.createElement("div", { className: "creation-results-heading" }, /* @__PURE__ */ React10.createElement("h2", null, "\u751F\u6210\u7ED3\u679C"), /* @__PURE__ */ React10.createElement("span", { className: "sub" }, "\u81EA\u52A8\u4FDD\u5B58\u5230\u9879\u76EE\u6587\u4EF6")), pending.map((task) => /* @__PURE__ */ React10.createElement("button", { className: "creation-task", key: task.objectId, onClick: () => onOpen(task) }, /* @__PURE__ */ React10.createElement("span", { className: "creation-task-dot" }), /* @__PURE__ */ React10.createElement("span", null, task.data.inputSnapshot?.newAsset?.name || task.data.inputSnapshot?.modelId || "Generation"), /* @__PURE__ */ React10.createElement("span", { className: "sub" }, taskLabels2[task.data.state] || "\u5904\u7406\u4E2D"))), /* @__PURE__ */ React10.createElement("div", { className: "creation-result-grid" }, results.map((row) => /* @__PURE__ */ React10.createElement(
|
|
5350
5754
|
CreationResult,
|
|
5351
5755
|
{
|
|
5352
5756
|
key: row.objectId,
|
|
@@ -5358,13 +5762,13 @@ function CreationResults({
|
|
|
5358
5762
|
onUse,
|
|
5359
5763
|
busy
|
|
5360
5764
|
}
|
|
5361
|
-
))), !results.length && !pending.length && /* @__PURE__ */
|
|
5765
|
+
))), !results.length && !pending.length && /* @__PURE__ */ React10.createElement("div", { className: "creation-results-empty" }, /* @__PURE__ */ React10.createElement("span", { className: "creation-empty-symbol", "aria-hidden": "true" }, "\u2727"), /* @__PURE__ */ React10.createElement("h3", null, "\u8FD8\u6CA1\u6709\u751F\u6210\u7ED3\u679C"), /* @__PURE__ */ React10.createElement("p", null, "\u9009\u62E9\u6A21\u578B\uFF0C\u63CF\u8FF0\u60F3\u521B\u4F5C\u7684\u5185\u5BB9\u3002"), /* @__PURE__ */ React10.createElement("p", null, "\u5B8C\u6210\u540E\uFF0C\u6587\u4EF6\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002")));
|
|
5362
5766
|
}
|
|
5363
5767
|
function CreationResult({ row, bridge, projectId, studio, onOpen, onUse, busy }) {
|
|
5364
5768
|
const version = row.versions?.at(-1);
|
|
5365
|
-
const [location2, setLocation] =
|
|
5366
|
-
const [error, setError] =
|
|
5367
|
-
|
|
5769
|
+
const [location2, setLocation] = React10.useState(null);
|
|
5770
|
+
const [error, setError] = React10.useState("");
|
|
5771
|
+
React10.useEffect(() => {
|
|
5368
5772
|
let current = true;
|
|
5369
5773
|
setLocation(null);
|
|
5370
5774
|
setError("");
|
|
@@ -5380,25 +5784,25 @@ function CreationResult({ row, bridge, projectId, studio, onOpen, onUse, busy })
|
|
|
5380
5784
|
current = false;
|
|
5381
5785
|
};
|
|
5382
5786
|
}, [projectId, studio, row.objectId, version?.versionId]);
|
|
5383
|
-
return /* @__PURE__ */
|
|
5787
|
+
return /* @__PURE__ */ React10.createElement("article", { className: "creation-result" }, /* @__PURE__ */ React10.createElement("div", { className: "creation-result-media" }, !location2 ? /* @__PURE__ */ React10.createElement("span", { className: "sub" }, error || "\u6B63\u5728\u52A0\u8F7D\u2026") : row.data.kind === "image" ? /* @__PURE__ */ React10.createElement("img", { src: location2.previewUrl, alt: row.data.name }) : row.data.kind === "video" ? /* @__PURE__ */ React10.createElement("video", { controls: true, preload: "metadata", src: location2.previewUrl }) : row.data.kind === "audio" ? /* @__PURE__ */ React10.createElement("audio", { controls: true, preload: "metadata", src: location2.previewUrl }) : /* @__PURE__ */ React10.createElement("a", { href: location2.previewUrl }, "\u6253\u5F00\u6587\u4EF6")), /* @__PURE__ */ React10.createElement("div", { className: "creation-result-caption" }, /* @__PURE__ */ React10.createElement("strong", null, row.data.name), /* @__PURE__ */ React10.createElement("span", { className: "sub" }, "v", version?.versionNumber)), /* @__PURE__ */ React10.createElement("div", { className: "actions" }, /* @__PURE__ */ React10.createElement("button", { onClick: () => onOpen(row) }, "\u6253\u5F00\u6587\u4EF6"), /* @__PURE__ */ React10.createElement("button", { disabled: busy, onClick: () => onUse(row) }, "\u7528\u4F5C\u53C2\u8003")));
|
|
5384
5788
|
}
|
|
5385
5789
|
|
|
5386
5790
|
// packages/studio-workbench/src/settings.tsx
|
|
5387
|
-
import * as
|
|
5791
|
+
import * as React11 from "react";
|
|
5388
5792
|
function Settings({ bridge, projectId, onError, project, studio, onSaved }) {
|
|
5389
|
-
const [form, setForm] =
|
|
5390
|
-
const [saving, setSaving] =
|
|
5391
|
-
const [saved, setSaved] =
|
|
5793
|
+
const [form, setForm] = React11.useState({ name: "", description: "", aspectRatio: "", tags: "" });
|
|
5794
|
+
const [saving, setSaving] = React11.useState(false);
|
|
5795
|
+
const [saved, setSaved] = React11.useState("");
|
|
5392
5796
|
const reset = () => setForm({
|
|
5393
5797
|
name: project?.data.name || "",
|
|
5394
5798
|
description: project?.data.description || "",
|
|
5395
5799
|
aspectRatio: project?.data.aspectRatio || "",
|
|
5396
5800
|
tags: project?.data.tags?.join(", ") || ""
|
|
5397
5801
|
});
|
|
5398
|
-
|
|
5802
|
+
React11.useEffect(() => {
|
|
5399
5803
|
reset();
|
|
5400
5804
|
}, [projectId, project?.revision]);
|
|
5401
|
-
|
|
5805
|
+
React11.useEffect(() => {
|
|
5402
5806
|
setSaved("");
|
|
5403
5807
|
}, [projectId]);
|
|
5404
5808
|
const run = async (fn) => {
|
|
@@ -5417,8 +5821,8 @@ function Settings({ bridge, projectId, onError, project, studio, onSaved }) {
|
|
|
5417
5821
|
}
|
|
5418
5822
|
};
|
|
5419
5823
|
if (!projectId)
|
|
5420
|
-
return /* @__PURE__ */
|
|
5421
|
-
return /* @__PURE__ */
|
|
5824
|
+
return /* @__PURE__ */ React11.createElement("section", { className: "project-settings" }, /* @__PURE__ */ React11.createElement("div", { className: "settings-section" }, /* @__PURE__ */ React11.createElement("div", null, /* @__PURE__ */ React11.createElement("h2", null, "\u672C\u673A\u6587\u4EF6"), /* @__PURE__ */ React11.createElement("p", { className: "sub" }, "\u9879\u76EE\u4E0E\u6587\u4EF6\u4FDD\u5B58\u5728\u8FD9\u53F0\u7535\u8111\u3002")), /* @__PURE__ */ React11.createElement("div", null, /* @__PURE__ */ React11.createElement("h3", null, "\u9879\u76EE\u8BBE\u7F6E"), /* @__PURE__ */ React11.createElement("p", { className: "sub" }, "\u53EF\u4EE5\u5728\u9879\u76EE\u4E2D\u4FEE\u6539\u540D\u79F0\u3001\u8BF4\u660E\u548C\u6807\u7B7E\u3002"))), /* @__PURE__ */ React11.createElement("p", { className: "sub" }, "\u8BF7\u5148\u6253\u5F00\u4E00\u4E2A\u9879\u76EE\u3002"));
|
|
5825
|
+
return /* @__PURE__ */ React11.createElement("section", { className: "project-settings", "aria-label": "\u9879\u76EE\u8BBE\u7F6E" }, /* @__PURE__ */ React11.createElement("div", { className: "settings-section" }, /* @__PURE__ */ React11.createElement("div", null, /* @__PURE__ */ React11.createElement("h2", null, "\u9879\u76EE\u4FE1\u606F"), /* @__PURE__ */ React11.createElement("p", { className: "sub" }, "\u8BBE\u7F6E\u9879\u76EE\u540D\u79F0\u4E0E\u8BF4\u660E\u3002")), /* @__PURE__ */ React11.createElement("div", { className: "settings-fields" }, /* @__PURE__ */ React11.createElement("label", null, /* @__PURE__ */ React11.createElement("span", null, "\u9879\u76EE\u540D\u79F0"), /* @__PURE__ */ React11.createElement(
|
|
5422
5826
|
"input",
|
|
5423
5827
|
{
|
|
5424
5828
|
"aria-label": "\u9879\u76EE\u540D\u79F0",
|
|
@@ -5426,7 +5830,7 @@ function Settings({ bridge, projectId, onError, project, studio, onSaved }) {
|
|
|
5426
5830
|
onChange: (e) => setForm({ ...form, name: e.target.value }),
|
|
5427
5831
|
maxLength: 120
|
|
5428
5832
|
}
|
|
5429
|
-
)), /* @__PURE__ */
|
|
5833
|
+
)), /* @__PURE__ */ React11.createElement("label", null, /* @__PURE__ */ React11.createElement("span", null, "\u8BF4\u660E"), /* @__PURE__ */ React11.createElement(
|
|
5430
5834
|
"textarea",
|
|
5431
5835
|
{
|
|
5432
5836
|
"aria-label": "\u9879\u76EE\u8BF4\u660E",
|
|
@@ -5434,7 +5838,7 @@ function Settings({ bridge, projectId, onError, project, studio, onSaved }) {
|
|
|
5434
5838
|
onChange: (e) => setForm({ ...form, description: e.target.value }),
|
|
5435
5839
|
maxLength: 4e3
|
|
5436
5840
|
}
|
|
5437
|
-
)), /* @__PURE__ */
|
|
5841
|
+
)), /* @__PURE__ */ React11.createElement("label", null, /* @__PURE__ */ React11.createElement("span", null, "\u6807\u7B7E"), /* @__PURE__ */ React11.createElement(
|
|
5438
5842
|
"input",
|
|
5439
5843
|
{
|
|
5440
5844
|
"aria-label": "\u9879\u76EE\u6807\u7B7E",
|
|
@@ -5442,14 +5846,14 @@ function Settings({ bridge, projectId, onError, project, studio, onSaved }) {
|
|
|
5442
5846
|
onChange: (e) => setForm({ ...form, tags: e.target.value }),
|
|
5443
5847
|
placeholder: "\u7528\u9017\u53F7\u5206\u9694\u591A\u4E2A\u6807\u7B7E"
|
|
5444
5848
|
}
|
|
5445
|
-
)), /* @__PURE__ */
|
|
5849
|
+
)), /* @__PURE__ */ React11.createElement("label", null, /* @__PURE__ */ React11.createElement("span", null, "\u753B\u9762\u6BD4\u4F8B"), /* @__PURE__ */ React11.createElement(
|
|
5446
5850
|
"select",
|
|
5447
5851
|
{
|
|
5448
5852
|
"aria-label": "\u9879\u76EE\u753B\u9762\u6BD4\u4F8B",
|
|
5449
5853
|
value: form.aspectRatio,
|
|
5450
5854
|
onChange: (e) => setForm({ ...form, aspectRatio: e.target.value })
|
|
5451
5855
|
},
|
|
5452
|
-
/* @__PURE__ */
|
|
5856
|
+
/* @__PURE__ */ React11.createElement("option", { value: "" }, "\u672A\u6307\u5B9A"),
|
|
5453
5857
|
[
|
|
5454
5858
|
.../* @__PURE__ */ new Set([
|
|
5455
5859
|
"16:9",
|
|
@@ -5458,8 +5862,8 @@ function Settings({ bridge, projectId, onError, project, studio, onSaved }) {
|
|
|
5458
5862
|
"4:3",
|
|
5459
5863
|
...form.aspectRatio ? [form.aspectRatio] : []
|
|
5460
5864
|
])
|
|
5461
|
-
].map((value) => /* @__PURE__ */
|
|
5462
|
-
)))), /* @__PURE__ */
|
|
5865
|
+
].map((value) => /* @__PURE__ */ React11.createElement("option", { key: value }, value))
|
|
5866
|
+
)))), /* @__PURE__ */ React11.createElement("div", { className: "settings-save-row" }, /* @__PURE__ */ React11.createElement("span", { className: "sub", role: "status" }, saved || "\u4FEE\u6539\u4EC5\u7528\u4E8E\u5F53\u524D\u9879\u76EE\u3002"), /* @__PURE__ */ React11.createElement("div", { className: "actions" }, /* @__PURE__ */ React11.createElement("button", { disabled: saving, onClick: reset }, "\u53D6\u6D88\u4FEE\u6539"), /* @__PURE__ */ React11.createElement(
|
|
5463
5867
|
"button",
|
|
5464
5868
|
{
|
|
5465
5869
|
className: "primary",
|
|
@@ -5484,7 +5888,7 @@ function Settings({ bridge, projectId, onError, project, studio, onSaved }) {
|
|
|
5484
5888
|
})
|
|
5485
5889
|
},
|
|
5486
5890
|
saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u4FEE\u6539"
|
|
5487
|
-
))), project && /* @__PURE__ */
|
|
5891
|
+
))), project && /* @__PURE__ */ React11.createElement("div", { className: "settings-project-actions" }, /* @__PURE__ */ React11.createElement("h3", null, "\u9879\u76EE\u7BA1\u7406"), /* @__PURE__ */ React11.createElement(
|
|
5488
5892
|
"button",
|
|
5489
5893
|
{
|
|
5490
5894
|
disabled: saving,
|
|
@@ -5509,7 +5913,7 @@ function Settings({ bridge, projectId, onError, project, studio, onSaved }) {
|
|
|
5509
5913
|
}
|
|
5510
5914
|
|
|
5511
5915
|
// packages/studio-workbench/src/media-tools.tsx
|
|
5512
|
-
import * as
|
|
5916
|
+
import * as React12 from "react";
|
|
5513
5917
|
function errorText(error) {
|
|
5514
5918
|
return error instanceof Error ? error.message : "The media action failed.";
|
|
5515
5919
|
}
|
|
@@ -5530,35 +5934,35 @@ function FileMediaTools({
|
|
|
5530
5934
|
onTasks
|
|
5531
5935
|
}) {
|
|
5532
5936
|
const file = fixedVideo(row, version);
|
|
5533
|
-
const [usage, setUsage] =
|
|
5534
|
-
const [mode, setMode] =
|
|
5535
|
-
const [compare, setCompare] =
|
|
5536
|
-
const [details, setDetails] =
|
|
5537
|
-
const [detailError, setDetailError] =
|
|
5538
|
-
const [detailLoading, setDetailLoading] =
|
|
5539
|
-
const [picker, setPicker] =
|
|
5540
|
-
const [chosen, setChosen] =
|
|
5541
|
-
const [outputName, setOutputName] =
|
|
5542
|
-
const [error, setError] =
|
|
5543
|
-
const [notice, setNotice] =
|
|
5544
|
-
const [submitting, setSubmitting] =
|
|
5545
|
-
const [refresh, setRefresh] =
|
|
5546
|
-
const live =
|
|
5547
|
-
const detailGeneration =
|
|
5548
|
-
const bindingKey =
|
|
5549
|
-
const processingKey =
|
|
5550
|
-
const pickerRef =
|
|
5937
|
+
const [usage, setUsage] = React12.useState(null);
|
|
5938
|
+
const [mode, setMode] = React12.useState(null);
|
|
5939
|
+
const [compare, setCompare] = React12.useState(null);
|
|
5940
|
+
const [details, setDetails] = React12.useState(null);
|
|
5941
|
+
const [detailError, setDetailError] = React12.useState("");
|
|
5942
|
+
const [detailLoading, setDetailLoading] = React12.useState(false);
|
|
5943
|
+
const [picker, setPicker] = React12.useState(null);
|
|
5944
|
+
const [chosen, setChosen] = React12.useState(0);
|
|
5945
|
+
const [outputName, setOutputName] = React12.useState(`${row.data.name} edited`);
|
|
5946
|
+
const [error, setError] = React12.useState("");
|
|
5947
|
+
const [notice, setNotice] = React12.useState("");
|
|
5948
|
+
const [submitting, setSubmitting] = React12.useState(false);
|
|
5949
|
+
const [refresh, setRefresh] = React12.useState(0);
|
|
5950
|
+
const live = React12.useRef(true);
|
|
5951
|
+
const detailGeneration = React12.useRef(0);
|
|
5952
|
+
const bindingKey = React12.useRef(null);
|
|
5953
|
+
const processingKey = React12.useRef(null);
|
|
5954
|
+
const pickerRef = React12.useRef(picker);
|
|
5551
5955
|
pickerRef.current = picker;
|
|
5552
5956
|
const identity = JSON.stringify(file);
|
|
5553
5957
|
const usageId = `file-preview:${row.objectId}:${version?.versionId}`;
|
|
5554
|
-
|
|
5958
|
+
React12.useEffect(() => {
|
|
5555
5959
|
live.current = true;
|
|
5556
5960
|
return () => {
|
|
5557
5961
|
live.current = false;
|
|
5558
5962
|
pickerRef.current?.resolve(null);
|
|
5559
5963
|
};
|
|
5560
5964
|
}, []);
|
|
5561
|
-
|
|
5965
|
+
React12.useEffect(() => {
|
|
5562
5966
|
let active = true;
|
|
5563
5967
|
setUsage(null);
|
|
5564
5968
|
setError("");
|
|
@@ -5573,7 +5977,7 @@ function FileMediaTools({
|
|
|
5573
5977
|
};
|
|
5574
5978
|
}, [client, studio, identity, usageId, refresh]);
|
|
5575
5979
|
const open = mode !== null || compare !== null;
|
|
5576
|
-
|
|
5980
|
+
React12.useEffect(() => {
|
|
5577
5981
|
onActiveChange(open);
|
|
5578
5982
|
return () => onActiveChange(false);
|
|
5579
5983
|
}, [open, onActiveChange]);
|
|
@@ -5667,7 +6071,7 @@ function FileMediaTools({
|
|
|
5667
6071
|
setDetailError("");
|
|
5668
6072
|
setDetailLoading(false);
|
|
5669
6073
|
}
|
|
5670
|
-
return /* @__PURE__ */
|
|
6074
|
+
return /* @__PURE__ */ React12.createElement(
|
|
5671
6075
|
"div",
|
|
5672
6076
|
{
|
|
5673
6077
|
className: "file-media-tools",
|
|
@@ -5677,8 +6081,8 @@ function FileMediaTools({
|
|
|
5677
6081
|
if (open && event2.key === "Escape") event2.stopPropagation();
|
|
5678
6082
|
}
|
|
5679
6083
|
},
|
|
5680
|
-
/* @__PURE__ */
|
|
5681
|
-
/* @__PURE__ */
|
|
6084
|
+
/* @__PURE__ */ React12.createElement("h3", null, "Video tools"),
|
|
6085
|
+
/* @__PURE__ */ React12.createElement("div", { className: "actions" }, /* @__PURE__ */ React12.createElement(
|
|
5682
6086
|
Button,
|
|
5683
6087
|
{
|
|
5684
6088
|
label: "Crop",
|
|
@@ -5687,7 +6091,7 @@ function FileMediaTools({
|
|
|
5687
6091
|
disabled: !usage || !Editor,
|
|
5688
6092
|
onClick: () => setMode("crop")
|
|
5689
6093
|
}
|
|
5690
|
-
), /* @__PURE__ */
|
|
6094
|
+
), /* @__PURE__ */ React12.createElement(
|
|
5691
6095
|
Button,
|
|
5692
6096
|
{
|
|
5693
6097
|
label: "Trim",
|
|
@@ -5696,7 +6100,7 @@ function FileMediaTools({
|
|
|
5696
6100
|
disabled: !usage || !Editor,
|
|
5697
6101
|
onClick: () => setMode("trim")
|
|
5698
6102
|
}
|
|
5699
|
-
), /* @__PURE__ */
|
|
6103
|
+
), /* @__PURE__ */ React12.createElement(
|
|
5700
6104
|
Button,
|
|
5701
6105
|
{
|
|
5702
6106
|
label: "Compare",
|
|
@@ -5718,8 +6122,8 @@ function FileMediaTools({
|
|
|
5718
6122
|
}
|
|
5719
6123
|
}
|
|
5720
6124
|
)),
|
|
5721
|
-
/* @__PURE__ */
|
|
5722
|
-
/* @__PURE__ */
|
|
6125
|
+
/* @__PURE__ */ React12.createElement("p", null, usage?.editRef ? "A fixed editing recipe is saved." : "The original video is selected."),
|
|
6126
|
+
/* @__PURE__ */ React12.createElement("label", null, "Output name", /* @__PURE__ */ React12.createElement(
|
|
5723
6127
|
"input",
|
|
5724
6128
|
{
|
|
5725
6129
|
value: outputName,
|
|
@@ -5727,7 +6131,7 @@ function FileMediaTools({
|
|
|
5727
6131
|
onChange: (event2) => setOutputName(event2.target.value)
|
|
5728
6132
|
}
|
|
5729
6133
|
)),
|
|
5730
|
-
/* @__PURE__ */
|
|
6134
|
+
/* @__PURE__ */ React12.createElement("div", { className: "actions" }, /* @__PURE__ */ React12.createElement(
|
|
5731
6135
|
Button,
|
|
5732
6136
|
{
|
|
5733
6137
|
label: "Generate video file",
|
|
@@ -5736,7 +6140,7 @@ function FileMediaTools({
|
|
|
5736
6140
|
loading: submitting,
|
|
5737
6141
|
onClick: () => void process()
|
|
5738
6142
|
}
|
|
5739
|
-
), /* @__PURE__ */
|
|
6143
|
+
), /* @__PURE__ */ React12.createElement(Button, { label: "View media tasks", width: "hug", variant: "text-ghost-sm", onClick: onTasks }), /* @__PURE__ */ React12.createElement(
|
|
5740
6144
|
Button,
|
|
5741
6145
|
{
|
|
5742
6146
|
label: "Reload saved recipe",
|
|
@@ -5746,10 +6150,10 @@ function FileMediaTools({
|
|
|
5746
6150
|
disabled: open
|
|
5747
6151
|
}
|
|
5748
6152
|
)),
|
|
5749
|
-
notice && /* @__PURE__ */
|
|
5750
|
-
error && /* @__PURE__ */
|
|
5751
|
-
mode && Editor && /* @__PURE__ */
|
|
5752
|
-
compare && Compare && /* @__PURE__ */
|
|
6153
|
+
notice && /* @__PURE__ */ React12.createElement("p", { role: "status" }, notice),
|
|
6154
|
+
error && /* @__PURE__ */ React12.createElement("p", { role: "alert", className: "error" }, error),
|
|
6155
|
+
mode && Editor && /* @__PURE__ */ React12.createElement(Editor, { input, mode, onApply: apply, onClose: () => setMode(null) }),
|
|
6156
|
+
compare && Compare && /* @__PURE__ */ React12.createElement("div", { className: "file-media-comparison" }, /* @__PURE__ */ React12.createElement(
|
|
5753
6157
|
Dialog,
|
|
5754
6158
|
{
|
|
5755
6159
|
title: details || detailLoading || detailError ? "Video details" : "Compare videos",
|
|
@@ -5758,7 +6162,7 @@ function FileMediaTools({
|
|
|
5758
6162
|
if (!value) closeComparison();
|
|
5759
6163
|
}
|
|
5760
6164
|
},
|
|
5761
|
-
details || detailLoading || detailError ? /* @__PURE__ */
|
|
6165
|
+
details || detailLoading || detailError ? /* @__PURE__ */ React12.createElement("section", { "aria-label": "Video details" }, detailLoading && /* @__PURE__ */ React12.createElement("p", { role: "status" }, "Loading fixed details\u2026"), detailError && /* @__PURE__ */ React12.createElement("p", { role: "alert" }, detailError), details && /* @__PURE__ */ React12.createElement("dl", null, /* @__PURE__ */ React12.createElement("dt", null, "Name"), /* @__PURE__ */ React12.createElement("dd", null, details.name), /* @__PURE__ */ React12.createElement("dt", null, "Version"), /* @__PURE__ */ React12.createElement("dd", null, "v", details.versionNumber), /* @__PURE__ */ React12.createElement("dt", null, "Editing"), /* @__PURE__ */ React12.createElement("dd", null, details.edited ? "Fixed editing recipe" : "Original"), /* @__PURE__ */ React12.createElement("dt", null, "Effective duration"), /* @__PURE__ */ React12.createElement("dd", null, (details.effectiveDurationMs / 1e3).toFixed(3), " s"), /* @__PURE__ */ React12.createElement("dt", null, "Frame"), /* @__PURE__ */ React12.createElement("dd", null, details.geometry.pixelRect.width, " \xD7 ", details.geometry.pixelRect.height)), /* @__PURE__ */ React12.createElement(
|
|
5762
6166
|
Button,
|
|
5763
6167
|
{
|
|
5764
6168
|
label: "Back to comparison",
|
|
@@ -5771,7 +6175,7 @@ function FileMediaTools({
|
|
|
5771
6175
|
setDetailLoading(false);
|
|
5772
6176
|
}
|
|
5773
6177
|
}
|
|
5774
|
-
)) : /* @__PURE__ */
|
|
6178
|
+
)) : /* @__PURE__ */ React12.createElement(
|
|
5775
6179
|
Compare,
|
|
5776
6180
|
{
|
|
5777
6181
|
slots: compare,
|
|
@@ -5784,7 +6188,7 @@ function FileMediaTools({
|
|
|
5784
6188
|
})
|
|
5785
6189
|
}
|
|
5786
6190
|
),
|
|
5787
|
-
picker && /* @__PURE__ */
|
|
6191
|
+
picker && /* @__PURE__ */ React12.createElement(
|
|
5788
6192
|
Dialog,
|
|
5789
6193
|
{
|
|
5790
6194
|
title: "Choose comparison video",
|
|
@@ -5795,7 +6199,7 @@ function FileMediaTools({
|
|
|
5795
6199
|
setPicker(null);
|
|
5796
6200
|
}
|
|
5797
6201
|
},
|
|
5798
|
-
actions: /* @__PURE__ */
|
|
6202
|
+
actions: /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(
|
|
5799
6203
|
Button,
|
|
5800
6204
|
{
|
|
5801
6205
|
label: "Cancel selection",
|
|
@@ -5806,7 +6210,7 @@ function FileMediaTools({
|
|
|
5806
6210
|
setPicker(null);
|
|
5807
6211
|
}
|
|
5808
6212
|
}
|
|
5809
|
-
), /* @__PURE__ */
|
|
6213
|
+
), /* @__PURE__ */ React12.createElement(
|
|
5810
6214
|
Button,
|
|
5811
6215
|
{
|
|
5812
6216
|
label: "Choose video",
|
|
@@ -5820,13 +6224,13 @@ function FileMediaTools({
|
|
|
5820
6224
|
}
|
|
5821
6225
|
))
|
|
5822
6226
|
},
|
|
5823
|
-
/* @__PURE__ */
|
|
6227
|
+
/* @__PURE__ */ React12.createElement("label", { className: "file-media-choice" }, "Video", /* @__PURE__ */ React12.createElement(
|
|
5824
6228
|
"select",
|
|
5825
6229
|
{
|
|
5826
6230
|
value: chosen,
|
|
5827
6231
|
onChange: (event2) => setChosen(Number(event2.target.value))
|
|
5828
6232
|
},
|
|
5829
|
-
picker.choices.map((value, index) => /* @__PURE__ */
|
|
6233
|
+
picker.choices.map((value, index) => /* @__PURE__ */ React12.createElement("option", { key: index, value: index }, value.label))
|
|
5830
6234
|
))
|
|
5831
6235
|
)
|
|
5832
6236
|
))
|
|
@@ -5888,12 +6292,12 @@ function saveDraft(key3, value) {
|
|
|
5888
6292
|
}
|
|
5889
6293
|
}
|
|
5890
6294
|
function Workbench({ client, navigation }) {
|
|
5891
|
-
if (client.scope?.kind === "user") return /* @__PURE__ */
|
|
5892
|
-
return /* @__PURE__ */
|
|
6295
|
+
if (client.scope?.kind === "user") return /* @__PURE__ */ React13.createElement(GlobalWorkbench, { client });
|
|
6296
|
+
return /* @__PURE__ */ React13.createElement(ProjectWorkbench, { client, navigation });
|
|
5893
6297
|
}
|
|
5894
6298
|
function ProjectWorkbench({ client, navigation }) {
|
|
5895
|
-
const bridge =
|
|
5896
|
-
const initial =
|
|
6299
|
+
const bridge = React13.useMemo(() => userActionsBridge(client, client.config), [client]);
|
|
6300
|
+
const initial = React13.useMemo(() => new URL(window.location.href), []);
|
|
5897
6301
|
const projectId = bridge.scope.kind === "project" ? bridge.scope.id : null;
|
|
5898
6302
|
const scopeIdentity = JSON.stringify([client.scope, projectId]);
|
|
5899
6303
|
const inWorkspace = client.presentation === "embedded";
|
|
@@ -5904,32 +6308,32 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
5904
6308
|
...client.config.mediaInstance ? ["media"] : [],
|
|
5905
6309
|
"settings"
|
|
5906
6310
|
];
|
|
5907
|
-
const [page, setPage] =
|
|
6311
|
+
const [page, setPage] = React13.useState(() => {
|
|
5908
6312
|
const requested = initial.searchParams.get("page");
|
|
5909
6313
|
return requested && (projectId ? projectViews : ["projects", "library", "tasks", "all-tasks"]).includes(requested) ? requested === "all-tasks" ? "tasks" : requested : projectId ? "assets" : "projects";
|
|
5910
6314
|
});
|
|
5911
|
-
const [embedded, setEmbedded] =
|
|
5912
|
-
const [projects, setProjects] =
|
|
5913
|
-
const [project, setProject] =
|
|
5914
|
-
const [rows, setRows] =
|
|
5915
|
-
const recoveredRows =
|
|
5916
|
-
const recoveredTasks =
|
|
5917
|
-
const mediaRows =
|
|
6315
|
+
const [embedded, setEmbedded] = React13.useState(null);
|
|
6316
|
+
const [projects, setProjects] = React13.useState([]);
|
|
6317
|
+
const [project, setProject] = React13.useState(null);
|
|
6318
|
+
const [rows, setRows] = React13.useState([]);
|
|
6319
|
+
const recoveredRows = React13.useRef(null);
|
|
6320
|
+
const recoveredTasks = React13.useRef(null);
|
|
6321
|
+
const mediaRows = React13.useRef(rows);
|
|
5918
6322
|
mediaRows.current = rows;
|
|
5919
|
-
const [tasks, setTasks] =
|
|
5920
|
-
const [selected, setSelected] =
|
|
5921
|
-
const [filter, setFilter] =
|
|
5922
|
-
const [sort, setSort] =
|
|
5923
|
-
const [offset, setOffset] =
|
|
5924
|
-
const [nextOffset, setNextOffset] =
|
|
5925
|
-
const [busy, setBusy] =
|
|
5926
|
-
const [error, setError] =
|
|
5927
|
-
const [notice, setNotice] =
|
|
5928
|
-
const [draft, setDraft] =
|
|
5929
|
-
const [models, setModels] =
|
|
5930
|
-
const [capability, setCapability] =
|
|
5931
|
-
const [form, setForm] =
|
|
5932
|
-
const pendingFile =
|
|
6323
|
+
const [tasks, setTasks] = React13.useState([]);
|
|
6324
|
+
const [selected, setSelected] = React13.useState(null);
|
|
6325
|
+
const [filter, setFilter] = React13.useState({ search: "", kind: "" });
|
|
6326
|
+
const [sort, setSort] = React13.useState("createdAt");
|
|
6327
|
+
const [offset, setOffset] = React13.useState(0);
|
|
6328
|
+
const [nextOffset, setNextOffset] = React13.useState(null);
|
|
6329
|
+
const [busy, setBusy] = React13.useState(false);
|
|
6330
|
+
const [error, setError] = React13.useState("");
|
|
6331
|
+
const [notice, setNotice] = React13.useState("");
|
|
6332
|
+
const [draft, setDraft] = React13.useState({});
|
|
6333
|
+
const [models, setModels] = React13.useState([]);
|
|
6334
|
+
const [capability, setCapability] = React13.useState(null);
|
|
6335
|
+
const [form, setForm] = React13.useState(null);
|
|
6336
|
+
const pendingFile = React13.useRef(initial.searchParams.get("file"));
|
|
5933
6337
|
const studio = client.config.studioInstance;
|
|
5934
6338
|
const api = client.config.apiInstance;
|
|
5935
6339
|
const library = client.config.libraryServiceInstance;
|
|
@@ -5963,7 +6367,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
5963
6367
|
setEmbedded(url.pathname + url.search);
|
|
5964
6368
|
setSelected(null);
|
|
5965
6369
|
}
|
|
5966
|
-
|
|
6370
|
+
React13.useEffect(() => {
|
|
5967
6371
|
const url = new URL(window.location.href);
|
|
5968
6372
|
url.searchParams.set("page", page);
|
|
5969
6373
|
if (selected && ["assets", "library"].includes(page))
|
|
@@ -5973,12 +6377,12 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
5973
6377
|
}, [page, selected?.objectId]);
|
|
5974
6378
|
const identity = JSON.stringify([projectId, page, filter, sort, offset]);
|
|
5975
6379
|
const recoveryIdentity = JSON.stringify([scopeIdentity, page, filter, sort]);
|
|
5976
|
-
const currentQuery =
|
|
6380
|
+
const currentQuery = React13.useRef(identity);
|
|
5977
6381
|
currentQuery.current = identity;
|
|
5978
|
-
const sequence =
|
|
5979
|
-
const [queryOwner, setQueryOwner] =
|
|
6382
|
+
const sequence = React13.useRef(0);
|
|
6383
|
+
const [queryOwner, setQueryOwner] = React13.useState(null);
|
|
5980
6384
|
const canQuery = queryOwner?.client === client && queryOwner.scope === scopeIdentity;
|
|
5981
|
-
const liveReload =
|
|
6385
|
+
const liveReload = React13.useRef(async () => {
|
|
5982
6386
|
});
|
|
5983
6387
|
liveReload.current = reload;
|
|
5984
6388
|
async function reload() {
|
|
@@ -6072,16 +6476,16 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6072
6476
|
}
|
|
6073
6477
|
}
|
|
6074
6478
|
}
|
|
6075
|
-
|
|
6479
|
+
React13.useEffect(() => {
|
|
6076
6480
|
setOffset(0);
|
|
6077
6481
|
}, [page, filter.search, filter.kind, sort]);
|
|
6078
|
-
|
|
6482
|
+
React13.useEffect(() => {
|
|
6079
6483
|
if (canQuery) void reload().catch((e) => setError(humanError(e)));
|
|
6080
6484
|
return () => {
|
|
6081
6485
|
sequence.current++;
|
|
6082
6486
|
};
|
|
6083
6487
|
}, [client, identity, canQuery]);
|
|
6084
|
-
|
|
6488
|
+
React13.useEffect(() => {
|
|
6085
6489
|
setRows([]);
|
|
6086
6490
|
setTasks([]);
|
|
6087
6491
|
setSelected(null);
|
|
@@ -6134,15 +6538,15 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6134
6538
|
if (next === "create") void creation();
|
|
6135
6539
|
else setPage(next);
|
|
6136
6540
|
}
|
|
6137
|
-
const openFromHome =
|
|
6541
|
+
const openFromHome = React13.useEffectEvent((id) => {
|
|
6138
6542
|
if (projectViews.includes(id)) go(id);
|
|
6139
6543
|
});
|
|
6140
6544
|
const selection = navigation?.selection;
|
|
6141
|
-
|
|
6545
|
+
React13.useEffect(() => {
|
|
6142
6546
|
if (selection) openFromHome(selection.id);
|
|
6143
6547
|
}, [selection]);
|
|
6144
6548
|
const report = navigation?.report;
|
|
6145
|
-
|
|
6549
|
+
React13.useEffect(() => {
|
|
6146
6550
|
report?.({ active: page === "media" ? null : page, pageTitle: labels[page] });
|
|
6147
6551
|
}, [page, report]);
|
|
6148
6552
|
const draftStorage = (id = projectId) => draftKey(bridge.workspaceId, id, "new");
|
|
@@ -6195,7 +6599,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6195
6599
|
setCapability(await bridge.call(api, "capabilities.get", { modelId: value.modelId }));
|
|
6196
6600
|
});
|
|
6197
6601
|
}
|
|
6198
|
-
|
|
6602
|
+
React13.useEffect(() => {
|
|
6199
6603
|
if (page === "create" && projectId && !draft.kind && api) void creation();
|
|
6200
6604
|
}, [page, projectId, api]);
|
|
6201
6605
|
async function submitGeneration(resolved) {
|
|
@@ -6315,8 +6719,8 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6315
6719
|
await reload();
|
|
6316
6720
|
});
|
|
6317
6721
|
}
|
|
6318
|
-
const initialAction =
|
|
6319
|
-
|
|
6722
|
+
const initialAction = React13.useRef(false);
|
|
6723
|
+
React13.useEffect(() => {
|
|
6320
6724
|
if (!projectId || initialAction.current) return;
|
|
6321
6725
|
initialAction.current = true;
|
|
6322
6726
|
const task = initial.searchParams.get("task"), action = initial.searchParams.get("taskAction");
|
|
@@ -6349,8 +6753,8 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6349
6753
|
})?.component : void 0;
|
|
6350
6754
|
const media = projectId ? client.config.mediaInstance : void 0;
|
|
6351
6755
|
const MediaTasks = media ? client.resolveUI({ plugin: media, id: "media.jobs" })?.component : void 0;
|
|
6352
|
-
const MediaActions =
|
|
6353
|
-
() => media && studio ? (props) => /* @__PURE__ */
|
|
6756
|
+
const MediaActions = React13.useMemo(
|
|
6757
|
+
() => media && studio ? (props) => /* @__PURE__ */ React13.createElement(
|
|
6354
6758
|
FileMediaTools,
|
|
6355
6759
|
{
|
|
6356
6760
|
...props,
|
|
@@ -6366,7 +6770,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6366
6770
|
) : void 0,
|
|
6367
6771
|
[client, media, studio]
|
|
6368
6772
|
);
|
|
6369
|
-
return /* @__PURE__ */
|
|
6773
|
+
return /* @__PURE__ */ React13.createElement(StudioTheme, null, /* @__PURE__ */ React13.createElement("style", null, baseCss + workbenchCss + fileLibraryCss + ".project-embed{width:100%;height:calc(100vh - 72px);border:0}.embed-main{padding:0!important}"), /* @__PURE__ */ React13.createElement("style", null, `.file-media-tools{border-top:1px solid #e1dcd7;margin-top:20px;padding-top:12px}.file-media-tools label{display:grid;gap:5px}.file-media-tools input{max-width:100%;box-sizing:border-box}.file-media-tools>button{margin:5px 4px 0 0}.file-media-tools>p{font-size:12px;overflow-wrap:anywhere}`), !inWorkspace && /* @__PURE__ */ React13.createElement("header", null, /* @__PURE__ */ React13.createElement("a", { className: "brand", href: "/?scope=user", target: projectId ? "_top" : void 0 }, /* @__PURE__ */ React13.createElement("b", null, "V"), "Vivix Studio")), /* @__PURE__ */ React13.createElement("div", { className: inWorkspace ? "workspace project-content" : "workspace" }, !inWorkspace && /* @__PURE__ */ React13.createElement("aside", { className: "nav" }, /* @__PURE__ */ React13.createElement("div", { className: "eyebrow" }, projectId ? project?.data.name || "\u5F53\u524D\u9879\u76EE" : "\u6211\u7684\u5DE5\u4F5C\u7A7A\u95F4"), (projectId ? projectViews : ["projects", "library", "tasks"]).map((item) => /* @__PURE__ */ React13.createElement(
|
|
6370
6774
|
"button",
|
|
6371
6775
|
{
|
|
6372
6776
|
key: item,
|
|
@@ -6374,7 +6778,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6374
6778
|
onClick: () => go(item)
|
|
6375
6779
|
},
|
|
6376
6780
|
!projectId && item === "tasks" ? "\u6240\u6709\u751F\u6210\u8BB0\u5F55" : labels[item]
|
|
6377
|
-
)), !projectId && /* @__PURE__ */
|
|
6781
|
+
)), !projectId && /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement("div", { className: "eyebrow recent" }, "\u6700\u8FD1\u9879\u76EE"), projects.slice(0, 8).map((item) => /* @__PURE__ */ React13.createElement(
|
|
6378
6782
|
"button",
|
|
6379
6783
|
{
|
|
6380
6784
|
key: item.objectId,
|
|
@@ -6382,7 +6786,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6382
6786
|
onClick: () => openProject(item.objectId)
|
|
6383
6787
|
},
|
|
6384
6788
|
item.data.name
|
|
6385
|
-
))), /* @__PURE__ */
|
|
6789
|
+
))), /* @__PURE__ */ React13.createElement("small", null, "\u6587\u4EF6\u4FDD\u5B58\u5728\u8FD9\u53F0\u7535\u8111")), /* @__PURE__ */ React13.createElement("main", { className: embedded ? "embed-main" : page === "create" ? "creation-page" : "" }, embedded ? /* @__PURE__ */ React13.createElement("iframe", { key: embedded, title: "\u9879\u76EE\u5DE5\u4F5C\u53F0", className: "project-embed", src: embedded }) : /* @__PURE__ */ React13.createElement(React13.Fragment, null, inWorkspace && !navigation && /* @__PURE__ */ React13.createElement("nav", { className: "project-content-navigation", "aria-label": "Project views" }, projectViews.map((item) => /* @__PURE__ */ React13.createElement(
|
|
6386
6790
|
"button",
|
|
6387
6791
|
{
|
|
6388
6792
|
key: item,
|
|
@@ -6390,7 +6794,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6390
6794
|
onClick: () => go(item)
|
|
6391
6795
|
},
|
|
6392
6796
|
labels[item]
|
|
6393
|
-
))), /* @__PURE__ */
|
|
6797
|
+
))), /* @__PURE__ */ React13.createElement("div", { className: "heading" }, /* @__PURE__ */ React13.createElement("div", null, /* @__PURE__ */ React13.createElement("div", { className: "eyebrow" }, projectId ? project?.data.name || "\u9879\u76EE" : "\u6211\u7684\u5DE5\u4F5C\u7A7A\u95F4"), /* @__PURE__ */ React13.createElement("h1", null, labels[page]), page === "library" && /* @__PURE__ */ React13.createElement("p", { className: "sub" }, "\u4FDD\u5B58\u53EF\u4EE5\u5728\u4E0D\u540C\u9879\u76EE\u590D\u7528\u7684\u6587\u4EF6\u3002")), /* @__PURE__ */ React13.createElement("div", { className: "actions" }, inWorkspace && navigation && MediaTasks && page !== "media" && /* @__PURE__ */ React13.createElement("button", { onClick: () => go("media") }, labels.media), ["assets", "library"].includes(page) && /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement("label", { className: "upload-button primary" }, "\u4E0A\u4F20\u6587\u4EF6", /* @__PURE__ */ React13.createElement(
|
|
6394
6798
|
"input",
|
|
6395
6799
|
{
|
|
6396
6800
|
"aria-label": "\u4E0A\u4F20\u6587\u4EF6",
|
|
@@ -6400,7 +6804,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6400
6804
|
hidden: true,
|
|
6401
6805
|
onChange: (e) => void importFiles(e.target.files)
|
|
6402
6806
|
}
|
|
6403
|
-
)), projectId && page === "assets" && /* @__PURE__ */
|
|
6807
|
+
)), projectId && page === "assets" && /* @__PURE__ */ React13.createElement("button", { onClick: () => setForm({ name: "\u672A\u547D\u540D\u6587\u672C", text: "" }) }, "\u65B0\u5EFA\u6587\u672C")))), error && /* @__PURE__ */ React13.createElement("div", { role: "alert", className: "error" }, error, /* @__PURE__ */ React13.createElement("button", { onClick: () => setError("") }, "\u5173\u95ED")), notice && /* @__PURE__ */ React13.createElement("p", { role: "status", className: "file-notice" }, notice), ["projects", "assets", "library"].includes(page) && /* @__PURE__ */ React13.createElement("div", { className: "file-toolbar" }, /* @__PURE__ */ React13.createElement(
|
|
6404
6808
|
"input",
|
|
6405
6809
|
{
|
|
6406
6810
|
"aria-label": page === "projects" ? "\u641C\u7D22\u9879\u76EE" : "\u641C\u7D22\u6587\u4EF6",
|
|
@@ -6408,14 +6812,14 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6408
6812
|
value: filter.search,
|
|
6409
6813
|
onChange: (e) => setFilter({ ...filter, search: e.target.value })
|
|
6410
6814
|
}
|
|
6411
|
-
), page !== "projects" && /* @__PURE__ */
|
|
6815
|
+
), page !== "projects" && /* @__PURE__ */ React13.createElement("div", { className: "file-type-tabs", role: "group", "aria-label": "\u6587\u4EF6\u7C7B\u578B" }, [
|
|
6412
6816
|
["", "\u5168\u90E8"],
|
|
6413
6817
|
["image", "\u56FE\u7247"],
|
|
6414
6818
|
["video", "\u89C6\u9891"],
|
|
6415
6819
|
["audio", "\u97F3\u9891"],
|
|
6416
6820
|
["text", "\u6587\u672C"],
|
|
6417
6821
|
["file", "\u5176\u4ED6"]
|
|
6418
|
-
].map(([kind2, label]) => /* @__PURE__ */
|
|
6822
|
+
].map(([kind2, label]) => /* @__PURE__ */ React13.createElement(
|
|
6419
6823
|
"button",
|
|
6420
6824
|
{
|
|
6421
6825
|
className: filter.kind === kind2 ? "active" : "",
|
|
@@ -6423,17 +6827,17 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6423
6827
|
onClick: () => setFilter({ ...filter, kind: kind2 })
|
|
6424
6828
|
},
|
|
6425
6829
|
label
|
|
6426
|
-
))), /* @__PURE__ */
|
|
6830
|
+
))), /* @__PURE__ */ React13.createElement("select", { "aria-label": "\u6392\u5E8F", value: sort, onChange: (e) => setSort(e.target.value) }, /* @__PURE__ */ React13.createElement("option", { value: "createdAt" }, "\u6700\u65B0\u4E0A\u4F20"), /* @__PURE__ */ React13.createElement("option", { value: "updatedAt" }, "\u6700\u8FD1\u4FEE\u6539"), /* @__PURE__ */ React13.createElement("option", { value: "name" }, "\u6587\u4EF6\u540D"))), page === "projects" && /* @__PURE__ */ React13.createElement("div", { className: "project-files-list" }, rows.map((item) => /* @__PURE__ */ React13.createElement(
|
|
6427
6831
|
"button",
|
|
6428
6832
|
{
|
|
6429
6833
|
key: item.objectId,
|
|
6430
6834
|
disabled: !item.available,
|
|
6431
6835
|
onClick: () => openProject(item.objectId)
|
|
6432
6836
|
},
|
|
6433
|
-
/* @__PURE__ */
|
|
6434
|
-
/* @__PURE__ */
|
|
6435
|
-
/* @__PURE__ */
|
|
6436
|
-
)), !rows.length && /* @__PURE__ */
|
|
6837
|
+
/* @__PURE__ */ React13.createElement("span", { className: "project-folder" }, "\u25B0"),
|
|
6838
|
+
/* @__PURE__ */ React13.createElement("div", null, /* @__PURE__ */ React13.createElement("strong", null, item.data.name), /* @__PURE__ */ React13.createElement("p", null, item.available ? "\u6253\u5F00\u9879\u76EE\u6587\u4EF6" : "\u9879\u76EE\u76EE\u5F55\u6682\u4E0D\u53EF\u7528")),
|
|
6839
|
+
/* @__PURE__ */ React13.createElement("span", null, "\u6253\u5F00 \u2192")
|
|
6840
|
+
)), !rows.length && /* @__PURE__ */ React13.createElement("div", { className: "files-empty" }, /* @__PURE__ */ React13.createElement("h2", null, "\u8FD8\u6CA1\u6709\u9879\u76EE"), /* @__PURE__ */ React13.createElement("p", null, "\u4F7F\u7528 Vivix Studio CLI \u521B\u5EFA\u6216\u767B\u8BB0\u9879\u76EE\u3002"))), ["assets", "library"].includes(page) && /* @__PURE__ */ React13.createElement(
|
|
6437
6841
|
FileBrowser,
|
|
6438
6842
|
{
|
|
6439
6843
|
rows,
|
|
@@ -6453,7 +6857,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6453
6857
|
Properties,
|
|
6454
6858
|
MediaActions: page === "assets" ? MediaActions : void 0
|
|
6455
6859
|
}
|
|
6456
|
-
), page === "media" && MediaTasks && /* @__PURE__ */
|
|
6860
|
+
), page === "media" && MediaTasks && /* @__PURE__ */ React13.createElement(
|
|
6457
6861
|
MediaTasks,
|
|
6458
6862
|
{
|
|
6459
6863
|
onOpenResult: (result2) => {
|
|
@@ -6465,7 +6869,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6465
6869
|
});
|
|
6466
6870
|
}
|
|
6467
6871
|
}
|
|
6468
|
-
), page === "tasks" && /* @__PURE__ */
|
|
6872
|
+
), page === "tasks" && /* @__PURE__ */ React13.createElement(
|
|
6469
6873
|
TaskHistory,
|
|
6470
6874
|
{
|
|
6471
6875
|
rows,
|
|
@@ -6477,7 +6881,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6477
6881
|
onRecover: (task) => void taskAction(task, "tasks.queryOriginal"),
|
|
6478
6882
|
onDownload: (task) => void taskAction(task, "tasks.retryDownload")
|
|
6479
6883
|
}
|
|
6480
|
-
), page === "create" && projectId && /* @__PURE__ */
|
|
6884
|
+
), page === "create" && projectId && /* @__PURE__ */ React13.createElement("div", { className: "creation-layout" }, /* @__PURE__ */ React13.createElement("section", { className: "creation-controls", "aria-label": "\u521B\u4F5C\u8BBE\u7F6E" }, GenerationPanel && draft.kind && /* @__PURE__ */ React13.createElement(
|
|
6481
6885
|
GenerationPanel,
|
|
6482
6886
|
{
|
|
6483
6887
|
bridge,
|
|
@@ -6494,7 +6898,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6494
6898
|
attempt,
|
|
6495
6899
|
setCapability
|
|
6496
6900
|
}
|
|
6497
|
-
)), /* @__PURE__ */
|
|
6901
|
+
)), /* @__PURE__ */ React13.createElement(
|
|
6498
6902
|
CreationResults,
|
|
6499
6903
|
{
|
|
6500
6904
|
rows,
|
|
@@ -6513,7 +6917,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6513
6917
|
},
|
|
6514
6918
|
onUse: (row) => useReference(row, row.versions.at(-1))
|
|
6515
6919
|
}
|
|
6516
|
-
)), page === "settings" && /* @__PURE__ */
|
|
6920
|
+
)), page === "settings" && /* @__PURE__ */ React13.createElement(
|
|
6517
6921
|
Settings,
|
|
6518
6922
|
{
|
|
6519
6923
|
bridge,
|
|
@@ -6523,7 +6927,7 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6523
6927
|
onError: setError,
|
|
6524
6928
|
onSaved: reload
|
|
6525
6929
|
}
|
|
6526
|
-
), nextOffset !== null && !["create", "settings"].includes(page) && /* @__PURE__ */
|
|
6930
|
+
), nextOffset !== null && !["create", "settings"].includes(page) && /* @__PURE__ */ React13.createElement("button", { className: "load-files", onClick: () => setOffset(nextOffset) }, "\u52A0\u8F7D\u66F4\u591A")))), form && /* @__PURE__ */ React13.createElement("div", { className: "simple-backdrop" }, /* @__PURE__ */ React13.createElement(
|
|
6527
6931
|
"form",
|
|
6528
6932
|
{
|
|
6529
6933
|
className: "simple-dialog",
|
|
@@ -6538,8 +6942,8 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6538
6942
|
});
|
|
6539
6943
|
}
|
|
6540
6944
|
},
|
|
6541
|
-
/* @__PURE__ */
|
|
6542
|
-
/* @__PURE__ */
|
|
6945
|
+
/* @__PURE__ */ React13.createElement("h2", null, "\u65B0\u5EFA\u6587\u672C"),
|
|
6946
|
+
/* @__PURE__ */ React13.createElement("label", null, "\u6587\u4EF6\u540D", /* @__PURE__ */ React13.createElement(
|
|
6543
6947
|
"input",
|
|
6544
6948
|
{
|
|
6545
6949
|
required: true,
|
|
@@ -6547,14 +6951,14 @@ function ProjectWorkbench({ client, navigation }) {
|
|
|
6547
6951
|
onChange: (e) => setForm({ ...form, name: e.target.value })
|
|
6548
6952
|
}
|
|
6549
6953
|
)),
|
|
6550
|
-
/* @__PURE__ */
|
|
6954
|
+
/* @__PURE__ */ React13.createElement("label", null, "\u5185\u5BB9", /* @__PURE__ */ React13.createElement(
|
|
6551
6955
|
"textarea",
|
|
6552
6956
|
{
|
|
6553
6957
|
value: form.text,
|
|
6554
6958
|
onChange: (e) => setForm({ ...form, text: e.target.value })
|
|
6555
6959
|
}
|
|
6556
6960
|
)),
|
|
6557
|
-
/* @__PURE__ */
|
|
6961
|
+
/* @__PURE__ */ React13.createElement("div", { className: "actions" }, /* @__PURE__ */ React13.createElement("button", { className: "primary", disabled: busy }, "\u521B\u5EFA"), /* @__PURE__ */ React13.createElement("button", { type: "button", onClick: () => setForm(null) }, "\u53D6\u6D88"))
|
|
6558
6962
|
)));
|
|
6559
6963
|
}
|
|
6560
6964
|
function activate(client) {
|
|
@@ -6564,14 +6968,14 @@ function activate(client) {
|
|
|
6564
6968
|
id: "studio-home",
|
|
6565
6969
|
title: "Studio Home",
|
|
6566
6970
|
kind: "frontend",
|
|
6567
|
-
component: ({ navigation }) => active ? /* @__PURE__ */
|
|
6971
|
+
component: ({ navigation }) => active ? /* @__PURE__ */ React13.createElement(Workbench, { client, navigation }) : null
|
|
6568
6972
|
});
|
|
6569
6973
|
}
|
|
6570
6974
|
client.registerUI({
|
|
6571
6975
|
id: "table-workbench",
|
|
6572
6976
|
title: "Table workbench",
|
|
6573
6977
|
kind: "frontend",
|
|
6574
|
-
component: ({ navigation }) => active ? /* @__PURE__ */
|
|
6978
|
+
component: ({ navigation }) => active ? /* @__PURE__ */ React13.createElement(Workbench, { client, navigation }) : null
|
|
6575
6979
|
});
|
|
6576
6980
|
client.onDispose(() => {
|
|
6577
6981
|
active = false;
|