@vivix-labs/studio-workbench 1.0.0-beta.14 → 1.0.0-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/fullscreen-exit-ADYOPBYH.svg +3 -0
- package/dist/client.bundle.js +135 -80
- package/dist/client.css +145 -23
- package/package.json +23 -23
- package/presets/table.json +4 -4
- package/presets/user-base.json +9 -9
- package/skills/SKILL.md +6 -6
- package/skills/references/assets-and-views.md +6 -6
- package/skills/scripts/initialize-home.mjs +182 -1
package/dist/client.bundle.js
CHANGED
|
@@ -188,10 +188,10 @@ function StudioTheme({ theme = "light", className, ...props }) {
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
// packages/ui-system/dist/button.js
|
|
191
|
-
import { jsx as _jsx3, jsxs as
|
|
191
|
+
import { jsx as _jsx3, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
192
192
|
|
|
193
193
|
// packages/ui-system/dist/icon.js
|
|
194
|
-
import { jsx as _jsx2 } from "react/jsx-runtime";
|
|
194
|
+
import { jsx as _jsx2, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
195
195
|
var iconGeometry = {
|
|
196
196
|
add: {
|
|
197
197
|
width: 16,
|
|
@@ -317,6 +317,7 @@ var iconGeometry = {
|
|
|
317
317
|
height: 20,
|
|
318
318
|
slot: 20
|
|
319
319
|
},
|
|
320
|
+
"fullscreen-exit": { width: 20, height: 20, slot: 20 },
|
|
320
321
|
"placeholder-image": {
|
|
321
322
|
width: 20,
|
|
322
323
|
height: 20,
|
|
@@ -396,6 +397,9 @@ function Icon({ name, size }) {
|
|
|
396
397
|
},
|
|
397
398
|
...size === void 0 ? {} : { "--vx-icon-size": `${size}px` }
|
|
398
399
|
};
|
|
400
|
+
if (name === "relationships" || name === "color-adjust" || name === "speed") {
|
|
401
|
+
return _jsx2("svg", { "aria-hidden": "true", className: "vx-icon", "data-icon": name, style, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: name === "color-adjust" ? _jsxs(_Fragment, { children: [_jsx2("path", { d: "M3 5h3m4 0h7M3 10h8m4 0h2M3 15h3m4 0h7" }), _jsx2("circle", { cx: "8", cy: "5", r: "2" }), _jsx2("circle", { cx: "13", cy: "10", r: "2" }), _jsx2("circle", { cx: "8", cy: "15", r: "2" })] }) : name === "speed" ? _jsxs(_Fragment, { children: [_jsx2("path", { d: "M4 16a8 8 0 1 1 12 0M10 3v2M3 10h2m10 0h2M5 5l1.4 1.4M10 12l4-5" }), _jsx2("circle", { cx: "10", cy: "12", r: "1.5" })] }) : _jsxs(_Fragment, { children: [_jsx2("path", { d: "M8.5 6.3 5 11.7M11.5 6.3 15 11.7M6.5 14.5h7" }), _jsx2("circle", { cx: "10", cy: "4", r: "2.5" }), _jsx2("circle", { cx: "4", cy: "14.5", r: "2.5" }), _jsx2("circle", { cx: "16", cy: "14.5", r: "2.5" })] }) });
|
|
402
|
+
}
|
|
399
403
|
return _jsx2("span", { "aria-hidden": "true", className: "vx-icon", "data-icon": name, style });
|
|
400
404
|
}
|
|
401
405
|
|
|
@@ -428,7 +432,7 @@ var buttonVariants = {
|
|
|
428
432
|
"icon-outline-sm": { size: 32, appearance: "outline", shape: "icon" },
|
|
429
433
|
"icon-on-content": { size: 24, appearance: "on-content", shape: "icon" },
|
|
430
434
|
"icon-outline-lg": { size: 48, appearance: "outline", shape: "icon" },
|
|
431
|
-
// Compact bare action:
|
|
435
|
+
// Compact bare action: remain transparent at rest and on hover.
|
|
432
436
|
"icon-bare-xs": { size: 24, appearance: "ghost", shape: "icon" },
|
|
433
437
|
"icon-ghost-sm": { size: 32, appearance: "ghost", shape: "icon" },
|
|
434
438
|
"icon-ghost-lg": { size: 48, appearance: "ghost", shape: "icon" },
|
|
@@ -440,40 +444,40 @@ var buttonVariants = {
|
|
|
440
444
|
function ButtonFrame({ label, variant, loading = false, width, children, disabled, type = "button", style, className, ...props }) {
|
|
441
445
|
const spec = buttonVariants[variant];
|
|
442
446
|
const buttonStyle = "width" in spec ? { ...style, "--vx-button-width": `${spec.width}px` } : style;
|
|
443
|
-
return
|
|
447
|
+
return _jsxs2("button", { ...props, type, className: className ? `vx-button ${className}` : "vx-button", "data-variant": variant, "data-appearance": spec.appearance, "data-shape": spec.shape, "data-size": spec.size, "data-width": width, "data-state": loading ? "loading" : disabled ? "disabled" : "default", style: buttonStyle, disabled: disabled || loading, "aria-label": label, "aria-busy": loading || void 0, children: [_jsx3("span", { className: "vx-button-content", children }), loading && _jsx3("span", { className: "vx-button-loading", "aria-hidden": "true" })] });
|
|
444
448
|
}
|
|
445
449
|
function Button({ variant = "text-filled-sm", leadingIcon, trailingIcon, badge, ...props }) {
|
|
446
|
-
return
|
|
450
|
+
return _jsxs2(ButtonFrame, { ...props, label: badge ? `${props.label} (${badge})` : props.label, variant, children: [leadingIcon && _jsx3(Icon, { name: leadingIcon }), _jsx3("span", { className: "vx-button-label", children: props.label }), badge !== void 0 && badge > 0 && _jsx3("span", { className: "vx-button-badge", children: badge }), trailingIcon && _jsx3("span", { className: "vx-button-trailing", children: _jsx3(Icon, { name: trailingIcon }) })] });
|
|
447
451
|
}
|
|
448
452
|
function IconButton({ icon, variant = "icon-ghost-sm", ...props }) {
|
|
449
453
|
return _jsx3(ButtonFrame, { ...props, variant, children: _jsx3(Icon, { name: icon }) });
|
|
450
454
|
}
|
|
451
455
|
|
|
452
456
|
// packages/ui-system/dist/asset-selection-toolbar.js
|
|
453
|
-
import { jsxs as
|
|
457
|
+
import { jsxs as _jsxs3, jsx as _jsx4, Fragment as _Fragment2 } from "react/jsx-runtime";
|
|
454
458
|
function AssetSelectionToolbar({ count, allSelected, label = "Selected asset actions", showAssetActions = true, onSelectAll, onFavorite, onDownload, onDelete, deleteHint, onCancel, cancelRef, busy }) {
|
|
455
459
|
const common = { variant: "text-tonal-sm", width: "hug" };
|
|
456
|
-
return
|
|
460
|
+
return _jsxs3("div", { className: "vx-asset-selection", role: "group", "aria-label": label, children: [_jsxs3("span", { role: "status", children: [count, " ", count === 1 ? "item" : "items", " selected"] }), _jsx4(Button, { ...common, label: "Select all", leadingIcon: "select-items", "aria-pressed": allSelected, disabled: busy || !onSelectAll, onClick: onSelectAll }), showAssetActions && _jsxs3(_Fragment2, { children: [_jsx4("i", { "aria-hidden": "true" }), _jsx4(Button, { ...common, label: "Favorite", leadingIcon: "favorite", disabled: busy || !onFavorite, onClick: onFavorite }), _jsx4(Button, { ...common, label: "Download", leadingIcon: "download", disabled: busy || !onDownload, onClick: onDownload }), _jsx4(Button, { ...common, label: "Delete", leadingIcon: "delete", title: deleteHint, disabled: busy || !onDelete, onClick: onDelete })] }), _jsx4("i", { "aria-hidden": "true" }), _jsx4(Button, { ...common, ref: cancelRef, label: "Cancel", leadingIcon: "close", disabled: busy, onClick: onCancel })] });
|
|
457
461
|
}
|
|
458
462
|
|
|
459
463
|
// packages/ui-system/dist/asset-reference-row.js
|
|
460
|
-
import { Fragment as
|
|
464
|
+
import { Fragment as _Fragment3, jsx as _jsx5, jsxs as _jsxs4 } from "react/jsx-runtime";
|
|
461
465
|
function AssetReferenceRow({ references, renderThumbnail, className = "" }) {
|
|
462
466
|
if (!references.length)
|
|
463
|
-
return _jsx5(
|
|
467
|
+
return _jsx5(_Fragment3, { children: "--" });
|
|
464
468
|
const remaining = references.length - 2;
|
|
465
|
-
return
|
|
469
|
+
return _jsxs4("span", { className: `vx-asset-reference-row ${className}`.trimEnd(), children: [references.slice(0, 2).map(renderThumbnail), remaining > 0 && _jsxs4("span", { className: "vx-asset-reference-count", title: `${remaining} more ${remaining === 1 ? "reference" : "references"}`, children: ["+", remaining] })] });
|
|
466
470
|
}
|
|
467
471
|
|
|
468
472
|
// packages/ui-system/dist/asset-tile-caption.js
|
|
469
|
-
import { jsx as _jsx6, jsxs as
|
|
473
|
+
import { jsx as _jsx6, jsxs as _jsxs5 } from "react/jsx-runtime";
|
|
470
474
|
function AssetTileCaption({ title, facts, status, actions, onOpen, disabled }) {
|
|
471
475
|
const details = facts.filter((fact) => typeof fact === "string" && Boolean(fact.trim()));
|
|
472
|
-
return
|
|
476
|
+
return _jsxs5("div", { className: "vx-tile-caption", children: [onOpen ? _jsx6("button", { type: "button", className: "vx-tile-title", title, onClick: onOpen, disabled, children: title }) : _jsx6("strong", { className: "vx-tile-title", title, children: title }), actions, _jsxs5("div", { className: "vx-tile-facts", title: details.join(" \xB7 "), children: [status, details.map((detail, i) => _jsx6("span", { children: detail }, i))] })] });
|
|
473
477
|
}
|
|
474
478
|
|
|
475
479
|
// packages/ui-system/dist/script-cover.js
|
|
476
|
-
import { jsx as _jsx7, jsxs as
|
|
480
|
+
import { jsx as _jsx7, jsxs as _jsxs6 } from "react/jsx-runtime";
|
|
477
481
|
import { useEffect, useState } from "react";
|
|
478
482
|
async function readTextExcerpt(response, signal, maxBytes = 1024) {
|
|
479
483
|
if (!response.ok || !response.body)
|
|
@@ -523,7 +527,7 @@ function ScriptCover({ title, synopsis, src }) {
|
|
|
523
527
|
return () => controller.abort();
|
|
524
528
|
}, [src, synopsis]);
|
|
525
529
|
const text = synopsis || (src && excerpt?.src === src ? excerpt.text : "");
|
|
526
|
-
return _jsx7("span", { className: "vx-script-cover", "aria-label": title, children:
|
|
530
|
+
return _jsx7("span", { className: "vx-script-cover", "aria-label": title, children: _jsxs6("span", { className: "vx-script-sheet", children: [_jsx7("strong", { children: title }), _jsx7("span", { children: text })] }) });
|
|
527
531
|
}
|
|
528
532
|
|
|
529
533
|
// packages/ui-system/dist/cover-preview.js
|
|
@@ -543,13 +547,13 @@ function Preview({ className, ref, kind: kind2 = "image", src, pending, iconSize
|
|
|
543
547
|
}
|
|
544
548
|
|
|
545
549
|
// packages/ui-system/dist/checkbox.js
|
|
546
|
-
import { jsx as _jsx9, jsxs as
|
|
550
|
+
import { jsx as _jsx9, jsxs as _jsxs7 } from "react/jsx-runtime";
|
|
547
551
|
function Checkbox({ label, checked, onCheckedChange, hideLabel = false, appearance = "default", ...props }) {
|
|
548
|
-
return
|
|
552
|
+
return _jsxs7("label", { className: "vx-checkbox", "data-appearance": appearance, "data-label-hidden": hideLabel || void 0, children: [_jsx9("input", { ...props, className: "vx-checkbox-input", type: "checkbox", "aria-label": hideLabel ? label : void 0, checked, onChange: (event2) => onCheckedChange(event2.currentTarget.checked) }), _jsx9("span", { className: "vx-checkbox-mark", "aria-hidden": "true", children: _jsx9(Icon, { name: appearance === "on-content" ? "check-on-content" : "check" }) }), !hideLabel && label] });
|
|
549
553
|
}
|
|
550
554
|
|
|
551
555
|
// packages/ui-system/dist/dropdown.js
|
|
552
|
-
import { jsx as _jsx10, jsxs as
|
|
556
|
+
import { jsx as _jsx10, jsxs as _jsxs8 } from "react/jsx-runtime";
|
|
553
557
|
import { useEffect as useEffect2, useId, useLayoutEffect, useRef, useState as useState3 } from "react";
|
|
554
558
|
function optionIcon(icon) {
|
|
555
559
|
return typeof icon === "string" ? _jsx10(Icon, { name: icon }) : icon;
|
|
@@ -682,14 +686,14 @@ function Dropdown({ label, options, value, onValueChange, placeholder = "Select
|
|
|
682
686
|
if (match)
|
|
683
687
|
setHighlighted(match.value);
|
|
684
688
|
}
|
|
685
|
-
return
|
|
689
|
+
return _jsxs8("div", { className: "vx-dropdown", "data-size": size, "data-width": width, "data-appearance": appearance, "data-text-size": textSize, "data-floating": floating || void 0, children: [_jsxs8("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: [_jsxs8("span", { className: "vx-dropdown-value", children: [optionIcon(selected?.icon), _jsx10("span", { children: selected?.triggerLabel ?? selected?.label ?? placeholder })] }), _jsx10(Icon, { name: expanded ? "chevron-up" : "chevron-down" })] }), _jsx10("ul", { ref: list, popover: popover ? "manual" : void 0, id: `${id}-listbox`, role: "listbox", "aria-label": label, hidden: !expanded, children: options.map((option, index) => _jsxs8("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: () => {
|
|
686
690
|
if (!option.disabled)
|
|
687
691
|
choose(option);
|
|
688
692
|
}, children: [optionIcon(option.icon), option.label, width === "hug" && option.value === value && _jsx10(Icon, { name: "check" })] }, option.value)) })] });
|
|
689
693
|
}
|
|
690
694
|
|
|
691
695
|
// packages/ui-system/dist/tabs.js
|
|
692
|
-
import { jsx as _jsx11, jsxs as
|
|
696
|
+
import { jsx as _jsx11, jsxs as _jsxs9 } from "react/jsx-runtime";
|
|
693
697
|
import { useId as useId2 } from "react";
|
|
694
698
|
function Tabs({ label, items, value, onValueChange, variant = "primary", actions }) {
|
|
695
699
|
const id = useId2();
|
|
@@ -710,24 +714,24 @@ function Tabs({ label, items, value, onValueChange, variant = "primary", actions
|
|
|
710
714
|
if (next.value !== value)
|
|
711
715
|
onValueChange(next.value);
|
|
712
716
|
}
|
|
713
|
-
return
|
|
717
|
+
return _jsxs9("div", { children: [_jsxs9("div", { className: "vx-tabs", "data-variant": variant, children: [_jsx11("div", { role: "tablist", "aria-label": label, className: "vx-tab-list", children: items.map((item, index) => _jsx11("button", { type: "button", role: "tab", id: `${id}-tab-${index}`, "aria-controls": `${id}-panel-${index}`, "aria-selected": item === selected, disabled: item.disabled, tabIndex: item === selected ? 0 : -1, onClick: () => {
|
|
714
718
|
if (item.value !== value)
|
|
715
719
|
onValueChange(item.value);
|
|
716
720
|
}, onKeyDown: (event2) => moveFocus(event2, item), children: item.label }, item.value)) }), actions && _jsx11("div", { className: "vx-tabs-actions", children: actions })] }), items.map((item, index) => _jsx11("div", { role: "tabpanel", id: `${id}-panel-${index}`, "aria-labelledby": `${id}-tab-${index}`, hidden: item !== selected, tabIndex: 0, children: item.panel }, item.value))] });
|
|
717
721
|
}
|
|
718
722
|
|
|
719
723
|
// packages/ui-system/dist/segmented-control.js
|
|
720
|
-
import { jsx as _jsx12, jsxs as
|
|
724
|
+
import { jsx as _jsx12, jsxs as _jsxs10 } from "react/jsx-runtime";
|
|
721
725
|
import { useId as useId3 } from "react";
|
|
722
726
|
function SegmentedControl({ label, items, value, onValueChange, size = "medium", width = "fixed", iconOnly = false }) {
|
|
723
727
|
const id = useId3();
|
|
724
|
-
return _jsx12("div", { role: "radiogroup", "aria-label": label, className: "vx-segment", "data-size": size, "data-width": width, "data-icon-only": iconOnly, children: items.map((item) =>
|
|
728
|
+
return _jsx12("div", { role: "radiogroup", "aria-label": label, className: "vx-segment", "data-size": size, "data-width": width, "data-icon-only": iconOnly, children: items.map((item) => _jsxs10("label", { title: iconOnly ? item.label : void 0, children: [_jsx12("input", { type: "radio", name: id, value: item.value, disabled: item.disabled, checked: item.value === value, "aria-label": item.label, onChange: () => onValueChange(item.value) }), _jsxs10("span", { className: "vx-segment-item", children: [item.icon && _jsx12(Icon, { name: item.icon }), (!iconOnly || !item.icon) && item.label] })] }, item.value)) });
|
|
725
729
|
}
|
|
726
730
|
|
|
727
731
|
// packages/ui-system/dist/input.js
|
|
728
|
-
import { jsx as _jsx13, jsxs as
|
|
732
|
+
import { jsx as _jsx13, jsxs as _jsxs11 } from "react/jsx-runtime";
|
|
729
733
|
function TextInput({ label, value, onValueChange, size = "medium", appearance = "default", placeholder, ...props }) {
|
|
730
|
-
return
|
|
734
|
+
return _jsxs11("label", { className: "vx-field", "data-size": size, "data-appearance": appearance, children: [_jsx13("span", { children: label }), _jsx13("input", { ...props, type: "text", placeholder: placeholder ?? (props.readOnly ? void 0 : "Enter text"), value, onChange: (event2) => onValueChange(event2.currentTarget.value) })] });
|
|
731
735
|
}
|
|
732
736
|
|
|
733
737
|
// packages/ui-system/dist/tag.js
|
|
@@ -737,7 +741,7 @@ function Tag({ children, variant = "overlay", className }) {
|
|
|
737
741
|
}
|
|
738
742
|
|
|
739
743
|
// packages/ui-system/dist/dialog.js
|
|
740
|
-
import { jsx as _jsx15, jsxs as
|
|
744
|
+
import { jsx as _jsx15, jsxs as _jsxs12, Fragment as _Fragment4 } from "react/jsx-runtime";
|
|
741
745
|
import { useId as useId4, useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState4 } from "react";
|
|
742
746
|
import { createPortal } from "react-dom";
|
|
743
747
|
|
|
@@ -850,7 +854,7 @@ function Dialog({ title, open, onOpenChange, children, actions, className, inlin
|
|
|
850
854
|
}, [open, surface, inlineWhenClosed]);
|
|
851
855
|
const welcome = variant === "welcome";
|
|
852
856
|
const closeButton = _jsx15(IconButton, { icon: "close", label: "Close dialog", onClick: () => onOpenChange(false) });
|
|
853
|
-
const dialog =
|
|
857
|
+
const dialog = _jsxs12("dialog", { ref, open: inlineWhenClosed || void 0, className: inlineWhenClosed && !open ? "vx-dialog vx-dialog-inline" : className ? `vx-dialog ${className}` : "vx-dialog", "data-variant": variant === "default" ? void 0 : variant, role: inlineWhenClosed && !open ? "presentation" : void 0, "aria-labelledby": inlineWhenClosed && !open ? void 0 : heading, onCancel: (event2) => {
|
|
854
858
|
event2.preventDefault();
|
|
855
859
|
event2.stopPropagation();
|
|
856
860
|
if (closeOnEscape)
|
|
@@ -858,12 +862,12 @@ function Dialog({ title, open, onOpenChange, children, actions, className, inlin
|
|
|
858
862
|
}, onClose: (event2) => {
|
|
859
863
|
if (open && event2.currentTarget.isConnected && !event2.currentTarget.open)
|
|
860
864
|
onOpenChange(false);
|
|
861
|
-
}, children: [
|
|
862
|
-
return
|
|
865
|
+
}, children: [_jsxs12("header", { hidden: inlineWhenClosed && !open, children: [_jsx15("h2", { id: heading, tabIndex: focusTitleOnOpen ? -1 : void 0, autoFocus: focusTitleOnOpen, children: title }), !welcome && closeButton] }), _jsx15("div", { className: "vx-dialog-body", children }), (actions || welcome) && _jsxs12("footer", { hidden: inlineWhenClosed && !open, children: [actions, welcome && closeButton] })] });
|
|
866
|
+
return _jsxs12(_Fragment4, { children: [_jsx15("span", { ref: anchor2, hidden: true }), (open || inlineWhenClosed) && (surface ? createPortal(dialog, surface) : dialog)] });
|
|
863
867
|
}
|
|
864
868
|
|
|
865
869
|
// packages/ui-system/dist/toast.js
|
|
866
|
-
import { jsx as _jsx16, jsxs as
|
|
870
|
+
import { jsx as _jsx16, jsxs as _jsxs13, Fragment as _Fragment5 } from "react/jsx-runtime";
|
|
867
871
|
import { useCallback, useEffect as useEffect3, useLayoutEffect as useLayoutEffect3, useRef as useRef3, useState as useState5 } from "react";
|
|
868
872
|
import { createPortal as createPortal2 } from "react-dom";
|
|
869
873
|
function useToastMessage() {
|
|
@@ -923,12 +927,12 @@ function Toast({ message: message2, leading, className }) {
|
|
|
923
927
|
doc.removeEventListener("fullscreenchange", bringToFront);
|
|
924
928
|
};
|
|
925
929
|
}, [visible, surface]);
|
|
926
|
-
const notice = visible && surface !== void 0 &&
|
|
927
|
-
return
|
|
930
|
+
const notice = visible && surface !== void 0 && _jsxs13("div", { ref, popover: "manual", role: "status", "aria-atomic": "true", className: className ? `vx-toast ${className}` : "vx-toast", children: [leading, _jsx16("span", { children: message2 })] });
|
|
931
|
+
return _jsxs13(_Fragment5, { children: [_jsx16("span", { hidden: true, ref: anchor2 }), surface ? createPortal2(notice, surface) : notice] });
|
|
928
932
|
}
|
|
929
933
|
|
|
930
934
|
// packages/ui-system/dist/menu.js
|
|
931
|
-
import { jsx as _jsx17, jsxs as
|
|
935
|
+
import { jsx as _jsx17, jsxs as _jsxs14 } from "react/jsx-runtime";
|
|
932
936
|
import { useEffect as useEffect4, useId as useId5, useLayoutEffect as useLayoutEffect4, useRef as useRef4, useState as useState6 } from "react";
|
|
933
937
|
import { createPortal as createPortal3 } from "react-dom";
|
|
934
938
|
function MenuPreview({ children }) {
|
|
@@ -1145,18 +1149,18 @@ function Menu({ label, items, triggerIcon, textTrigger = "dropdown", floating =
|
|
|
1145
1149
|
visibility: "hidden",
|
|
1146
1150
|
maxHeight: "min(480px, calc(100dvh - 16px))",
|
|
1147
1151
|
zIndex: 100 + depth
|
|
1148
|
-
} : placement : void 0, children: entries2.map((item) =>
|
|
1152
|
+
} : placement : void 0, children: entries2.map((item) => _jsxs14("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) => {
|
|
1149
1153
|
if (e.pointerType !== "touch")
|
|
1150
1154
|
hover(item, depth);
|
|
1151
1155
|
} : void 0, "data-size": item.size ?? "medium", "data-tone": item.tone, disabled: !isEnabled(item), tabIndex: -1, onClick: () => choose(item, depth), children: [item.icon && _jsx17(Icon, { name: item.icon }), path && item.preview && _jsx17(MenuPreview, { children: item.preview }), _jsx17("span", { className: "vx-menu-label", children: item.label }), item.checked && _jsx17(Icon, { name: "check" }), item.items?.length ? _jsx17(Icon, { name: "chevron-right" }) : null] }, item.id)) }, depth));
|
|
1152
|
-
return
|
|
1156
|
+
return _jsxs14("div", { className: "vx-action-menu", onBlur: (event2) => {
|
|
1153
1157
|
if (!event2.currentTarget.contains(event2.relatedTarget) && !(floating && popup.current?.contains(event2.relatedTarget)) && ![...children.current.values()].some((panel) => panel.contains(event2.relatedTarget)))
|
|
1154
1158
|
setPath(null);
|
|
1155
1159
|
}, children: [triggerIcon ? _jsx17(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 }) : _jsx17(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 ? createPortal3(menu, portalRoot) : menu] });
|
|
1156
1160
|
}
|
|
1157
1161
|
|
|
1158
1162
|
// packages/ui-system/dist/filter-menu.js
|
|
1159
|
-
import { jsx as _jsx18, jsxs as
|
|
1163
|
+
import { jsx as _jsx18, jsxs as _jsxs15, Fragment as _Fragment6 } from "react/jsx-runtime";
|
|
1160
1164
|
import { useId as useId6, useRef as useRef5, useState as useState7, useLayoutEffect as useLayoutEffect5 } from "react";
|
|
1161
1165
|
function FilterMenu({ label, groups, value, onValueChange, leadingIcon = "filter" }) {
|
|
1162
1166
|
const id = useId6();
|
|
@@ -1192,12 +1196,12 @@ function FilterMenu({ label, groups, value, onValueChange, leadingIcon = "filter
|
|
|
1192
1196
|
function focusFirstGroup() {
|
|
1193
1197
|
popup.current?.querySelector("summary")?.focus({ preventScroll: true });
|
|
1194
1198
|
}
|
|
1195
|
-
return
|
|
1199
|
+
return _jsxs15(_Fragment6, { children: [_jsx18(Button, { label, badge: count, className: "vx-filter-trigger", width: "hug", variant: "text-tonal-sm", leadingIcon, trailingIcon: leadingIcon ? void 0 : "chevron-down", popoverTarget: id, "aria-controls": id, "aria-expanded": expanded, "aria-haspopup": "dialog", disabled: !sections.length }), _jsxs15("div", { ref: popup, id, className: "vx-filter-menu", popover: "auto", role: "dialog", "aria-label": label, onToggle: (event2) => {
|
|
1196
1200
|
const open = event2.currentTarget.matches(":popover-open");
|
|
1197
1201
|
setExpanded(open);
|
|
1198
1202
|
if (open)
|
|
1199
1203
|
focusFirstGroup();
|
|
1200
|
-
}, children: [_jsx18("div", { className: "vx-filter-scroll", "data-more-below": moreBelow || void 0, children: _jsx18("div", { className: "vx-filter-groups", ref: list, children: sections.map(({ id: groupId, label: label2, options, optionLabels, selected, initiallyCollapsed }) =>
|
|
1204
|
+
}, children: [_jsx18("div", { className: "vx-filter-scroll", "data-more-below": moreBelow || void 0, children: _jsx18("div", { className: "vx-filter-groups", ref: list, children: sections.map(({ id: groupId, label: label2, options, optionLabels, selected, initiallyCollapsed }) => _jsxs15("details", { open: !initiallyCollapsed, children: [_jsxs15("summary", { children: [label2, _jsx18(Icon, { name: "chevron-down", size: 16 })] }), _jsx18("div", { className: "vx-filter-options", role: "group", "aria-label": label2, children: options.map(([option, optionLabel]) => _jsx18(Checkbox, { label: optionLabels?.[option] ?? optionLabel, checked: selected.includes(option), onCheckedChange: (checked) => onValueChange({
|
|
1201
1205
|
...value,
|
|
1202
1206
|
[groupId]: checked ? [...selected, option] : selected.filter((item) => item !== option)
|
|
1203
1207
|
}) }, option)) })] }, groupId)) }) }), _jsx18("footer", { children: _jsx18(Button, { label: "Clear Filters", variant: "text-tonal-sm", disabled: !count, onClick: () => {
|
|
@@ -1207,7 +1211,7 @@ function FilterMenu({ label, groups, value, onValueChange, leadingIcon = "filter
|
|
|
1207
1211
|
}
|
|
1208
1212
|
|
|
1209
1213
|
// packages/ui-system/dist/media.js
|
|
1210
|
-
import { jsx as _jsx19, Fragment as
|
|
1214
|
+
import { jsx as _jsx19, Fragment as _Fragment7, jsxs as _jsxs16 } from "react/jsx-runtime";
|
|
1211
1215
|
import { useRef as useRef6, useState as useState8 } from "react";
|
|
1212
1216
|
function AspectRatioIcon({ ratio: ratio2 }) {
|
|
1213
1217
|
const dimensions = ratio2?.trim().match(/^(\d+(?:\.\d+)?)\s*:\s*(\d+(?:\.\d+)?)$/);
|
|
@@ -1221,7 +1225,7 @@ function AspectRatioIcon({ ratio: ratio2 }) {
|
|
|
1221
1225
|
return _jsx19("span", { className: "vx-aspect-ratio-icon", "aria-hidden": "true", children: _jsx19("span", { style: { width: width * scale, height: height * scale } }) });
|
|
1222
1226
|
}
|
|
1223
1227
|
function MediaBadges({ label, duration, labelVariant }) {
|
|
1224
|
-
return
|
|
1228
|
+
return _jsxs16(_Fragment7, { children: [" ", label && _jsx19("span", { className: labelVariant === "selected" ? "vx-media-selected" : "vx-media-label", children: _jsx19(Tag, { variant: labelVariant, children: label }) }), duration && _jsx19("span", { className: "vx-media-duration", children: _jsx19(Tag, { children: duration }) })] });
|
|
1225
1229
|
}
|
|
1226
1230
|
function Media({ src, videoSrc, preferVideo = false, emptyLabel, script, alt, ratio: ratio2 = "16:9", state = "default", fit = "cover", emptyAppearance = "black", crop, label, labelVariant, duration, selectedLabel, selectionStyle = "outline", onSelect, onOpen }) {
|
|
1227
1231
|
const [failedImage, setFailedImage] = useState8();
|
|
@@ -1239,7 +1243,7 @@ function Media({ src, videoSrc, preferVideo = false, emptyLabel, script, alt, ra
|
|
|
1239
1243
|
transform: `rotate(${crop.rotation ?? 0}deg)`,
|
|
1240
1244
|
objectFit: "fill"
|
|
1241
1245
|
} : { objectFit: fit };
|
|
1242
|
-
const content =
|
|
1246
|
+
const content = _jsxs16(_Fragment7, { children: [script ? _jsx19(ScriptCover, { ...script }) : image ? _jsx19("img", { src: image, alt, style: imageStyle, onError: () => setFailedImage(image) }, image) : video ? _jsx19("video", { src: video, preload: "metadata", muted: true, playsInline: true, "aria-hidden": "true", style: { objectFit: fit }, onError: () => setFailedVideo(video) }, video) : emptyAppearance !== "black" && emptyAppearance !== "surface" ? _jsx19(Icon, { name: `placeholder-${emptyAppearance}`, size: 20 }) : emptyLabel && !busy ? _jsx19("span", { className: "vx-media-empty-label", children: emptyLabel }) : null, _jsx19(MediaBadges, { label, labelVariant, duration }), selected && selectedLabel && _jsx19("span", { className: "vx-media-selected", children: _jsx19(Tag, { variant: "selected", children: "Selected" }) }), selectionStyle === "checkbox" && _jsx19("span", { className: "vx-media-marker", "aria-hidden": "true", children: selected && _jsx19(Icon, { name: "check", size: 12 }) }), busy && _jsx19("span", { className: "vx-media-progress", role: "status", children: state === "loading" ? "Loading" : "Generating" })] });
|
|
1243
1247
|
const props = {
|
|
1244
1248
|
className: "vx-media",
|
|
1245
1249
|
"data-state": state,
|
|
@@ -1252,18 +1256,61 @@ function Media({ src, videoSrc, preferVideo = false, emptyLabel, script, alt, ra
|
|
|
1252
1256
|
}
|
|
1253
1257
|
|
|
1254
1258
|
// packages/ui-system/dist/video-player.js
|
|
1255
|
-
import { jsx as _jsx20, jsxs as
|
|
1256
|
-
import { useEffect as
|
|
1259
|
+
import { jsx as _jsx20, jsxs as _jsxs17, Fragment as _Fragment8 } from "react/jsx-runtime";
|
|
1260
|
+
import { useEffect as useEffect6, useRef as useRef7, useState as useState10 } from "react";
|
|
1261
|
+
|
|
1262
|
+
// packages/ui-system/dist/fullscreen.js
|
|
1263
|
+
import { useEffect as useEffect5, useState as useState9 } from "react";
|
|
1264
|
+
function isFullscreen(element) {
|
|
1265
|
+
const tree = element.getRootNode();
|
|
1266
|
+
return tree.fullscreenElement === element || element.matches(":fullscreen");
|
|
1267
|
+
}
|
|
1268
|
+
function useFullscreen(target) {
|
|
1269
|
+
const [fullscreen, setFullscreen] = useState9(false);
|
|
1270
|
+
useEffect5(() => {
|
|
1271
|
+
const element = target.current;
|
|
1272
|
+
if (!element)
|
|
1273
|
+
return;
|
|
1274
|
+
const doc = element.ownerDocument;
|
|
1275
|
+
const update = () => setFullscreen(isFullscreen(element));
|
|
1276
|
+
const escape = (event2) => {
|
|
1277
|
+
if (event2.key !== "Escape" || !isFullscreen(element))
|
|
1278
|
+
return;
|
|
1279
|
+
event2.preventDefault();
|
|
1280
|
+
event2.stopPropagation();
|
|
1281
|
+
void doc.exitFullscreen().catch(update);
|
|
1282
|
+
};
|
|
1283
|
+
update();
|
|
1284
|
+
doc.addEventListener("fullscreenchange", update);
|
|
1285
|
+
doc.addEventListener("keydown", escape, true);
|
|
1286
|
+
return () => {
|
|
1287
|
+
doc.removeEventListener("fullscreenchange", update);
|
|
1288
|
+
doc.removeEventListener("keydown", escape, true);
|
|
1289
|
+
};
|
|
1290
|
+
}, [target]);
|
|
1291
|
+
async function toggleFullscreen() {
|
|
1292
|
+
const element = target.current;
|
|
1293
|
+
if (!element)
|
|
1294
|
+
return;
|
|
1295
|
+
if (isFullscreen(element))
|
|
1296
|
+
await element.ownerDocument.exitFullscreen();
|
|
1297
|
+
else
|
|
1298
|
+
await element.requestFullscreen();
|
|
1299
|
+
}
|
|
1300
|
+
return { fullscreen, toggleFullscreen };
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
// packages/ui-system/dist/video-player.js
|
|
1257
1304
|
function timeLabel(seconds, padMinutes = false) {
|
|
1258
1305
|
const whole = Math.floor(seconds);
|
|
1259
1306
|
const minutes = String(Math.floor(whole / 60));
|
|
1260
1307
|
return `${padMinutes ? minutes.padStart(2, "0") : minutes}:${String(whole % 60).padStart(2, "0")}`;
|
|
1261
1308
|
}
|
|
1262
|
-
function PlaybackControls({ playing, muted, time, duration, size = "medium", disabled, onTogglePlay, onToggleMute, onSeek, onFullscreen, fullscreenLabel = "
|
|
1309
|
+
function PlaybackControls({ playing, muted, time, duration, size = "medium", disabled, onTogglePlay, onToggleMute, onSeek, onFullscreen, fullscreen = false, fullscreenLabel = fullscreen ? "Exit fullscreen" : "Enter fullscreen", actions, appearance = "on-content", timeDisplay = "combined", renderTimeline }) {
|
|
1263
1310
|
const slider = _jsx20("input", { className: "vx-playback-range", "aria-label": "Playback position", "aria-valuetext": `${timeLabel(time)} of ${timeLabel(duration)}`, type: "range", min: 0, max: duration, value: time, step: "any", disabled: disabled || !duration, onChange: (event2) => onSeek(event2.currentTarget.valueAsNumber) });
|
|
1264
|
-
return
|
|
1311
|
+
return _jsxs17("div", { className: "vx-playback-controls", role: "group", "aria-label": "Playback controls", "data-size": size, "data-appearance": appearance, style: {
|
|
1265
1312
|
"--vx-playback-fraction": duration > 0 ? Math.min(1, Math.max(0, time / duration)) : 0
|
|
1266
|
-
}, children: [_jsx20(IconButton, { icon: playing ? size === "large" ? "pause-large" : "pause" : size === "large" ? "playback-play-large" : "playback-play", label: playing ? "Pause" : "Play", disabled, onClick: onTogglePlay }), timeDisplay === "split" && _jsx20("span", { "aria-hidden": "true", "data-time": "elapsed", children: timeLabel(time, true) }), renderTimeline ? renderTimeline(slider) : slider, _jsx20("span", { "aria-hidden": "true", "data-time": timeDisplay === "split" ? "duration" : void 0, children: timeDisplay === "split" ? timeLabel(duration, true) : `${timeLabel(time)} / ${timeLabel(duration)}` }), _jsx20(IconButton, { icon: muted ? size === "large" ? "mute-large" : "mute" : size === "large" ? "volume-large" : "volume", label: muted ? "Unmute" : "Mute", disabled, onClick: onToggleMute }), actions, onFullscreen && _jsx20(IconButton, { icon: size === "large" ? "fullscreen-large" : "fullscreen", label: fullscreenLabel, onClick: onFullscreen })] });
|
|
1313
|
+
}, children: [_jsx20(IconButton, { variant: size === "small" ? "icon-bare-xs" : "icon-ghost-sm", icon: playing ? size === "large" ? "pause-large" : "pause" : size === "large" ? "playback-play-large" : "playback-play", label: playing ? "Pause" : "Play", disabled, onClick: onTogglePlay }), timeDisplay === "split" && _jsx20("span", { "aria-hidden": "true", "data-time": "elapsed", children: timeLabel(time, true) }), renderTimeline ? renderTimeline(slider) : slider, _jsx20("span", { "aria-hidden": "true", "data-time": timeDisplay === "split" ? "duration" : void 0, children: timeDisplay === "split" ? timeLabel(duration, true) : `${timeLabel(time)} / ${timeLabel(duration)}` }), _jsx20(IconButton, { variant: size === "small" ? "icon-bare-xs" : "icon-ghost-sm", icon: muted ? size === "large" ? "mute-large" : "mute" : size === "large" ? "volume-large" : "volume", label: muted ? "Unmute" : "Mute", disabled, onClick: onToggleMute }), actions, onFullscreen && _jsx20(IconButton, { variant: size === "small" ? "icon-bare-xs" : "icon-ghost-sm", icon: fullscreen ? "fullscreen-exit" : size === "large" ? "fullscreen-large" : "fullscreen", label: fullscreenLabel, "aria-pressed": fullscreen, onClick: onFullscreen })] });
|
|
1267
1314
|
}
|
|
1268
1315
|
function VideoPlayer(props) {
|
|
1269
1316
|
return _jsx20(Playback, { ...props }, JSON.stringify([props.src, props.poster, props.posterDuration]));
|
|
@@ -1271,20 +1318,21 @@ function VideoPlayer(props) {
|
|
|
1271
1318
|
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 }) {
|
|
1272
1319
|
const root = useRef7(null);
|
|
1273
1320
|
const video = useRef7(null);
|
|
1321
|
+
const nativeFullscreen = useFullscreen(root);
|
|
1274
1322
|
const playbackEpoch = useRef7(0);
|
|
1275
1323
|
const localDialog = useInlineDialog(root);
|
|
1276
1324
|
const inlineDialog = fullscreenMode === "dialog" && localDialog;
|
|
1277
1325
|
const position = useRef7(0);
|
|
1278
1326
|
const callbacks = useRef7({ onTimeChange, onStateChange, onEnded });
|
|
1279
|
-
const [time, setTime] =
|
|
1280
|
-
const [ratio2, setRatio] =
|
|
1281
|
-
const [metadataDuration, setMetadataDuration] =
|
|
1282
|
-
const [state, setState] =
|
|
1283
|
-
const [muted, setMuted] =
|
|
1284
|
-
const [expanded, setExpanded] =
|
|
1285
|
-
const [inlineHeight, setInlineHeight] =
|
|
1327
|
+
const [time, setTime] = useState10(0);
|
|
1328
|
+
const [ratio2, setRatio] = useState10();
|
|
1329
|
+
const [metadataDuration, setMetadataDuration] = useState10(0);
|
|
1330
|
+
const [state, setState] = useState10("cover");
|
|
1331
|
+
const [muted, setMuted] = useState10(defaultMuted);
|
|
1332
|
+
const [expanded, setExpanded] = useState10(false);
|
|
1333
|
+
const [inlineHeight, setInlineHeight] = useState10();
|
|
1286
1334
|
const restoreFocus = useRef7(false);
|
|
1287
|
-
|
|
1335
|
+
useEffect6(() => {
|
|
1288
1336
|
if (!expanded && restoreFocus.current) {
|
|
1289
1337
|
restoreFocus.current = false;
|
|
1290
1338
|
root.current?.querySelector('button[aria-label="Expand video"]')?.focus();
|
|
@@ -1294,7 +1342,7 @@ function Playback({ src, poster, aspectRatio, posterDuration = 0, title, version
|
|
|
1294
1342
|
const stillDuration = poster && Number.isFinite(posterDuration) ? Math.max(0, posterDuration) : 0;
|
|
1295
1343
|
const duration = src ? metadataDuration : stillDuration;
|
|
1296
1344
|
const displayRatio = ratio2 ?? aspectRatio ?? 16 / 9;
|
|
1297
|
-
|
|
1345
|
+
useEffect6(() => {
|
|
1298
1346
|
const element = video.current;
|
|
1299
1347
|
return () => {
|
|
1300
1348
|
if (!element)
|
|
@@ -1313,10 +1361,10 @@ function Playback({ src, poster, aspectRatio, posterDuration = 0, title, version
|
|
|
1313
1361
|
setState(next);
|
|
1314
1362
|
onStateChange?.(next);
|
|
1315
1363
|
}
|
|
1316
|
-
|
|
1364
|
+
useEffect6(() => {
|
|
1317
1365
|
callbacks.current = { onTimeChange, onStateChange, onEnded };
|
|
1318
1366
|
}, [onTimeChange, onStateChange, onEnded]);
|
|
1319
|
-
|
|
1367
|
+
useEffect6(() => {
|
|
1320
1368
|
if (src || state !== "playing" || !duration)
|
|
1321
1369
|
return;
|
|
1322
1370
|
let previous = performance.now();
|
|
@@ -1375,13 +1423,7 @@ function Playback({ src, poster, aspectRatio, posterDuration = 0, title, version
|
|
|
1375
1423
|
return;
|
|
1376
1424
|
}
|
|
1377
1425
|
try {
|
|
1378
|
-
|
|
1379
|
-
if (!player2?.requestFullscreen)
|
|
1380
|
-
return;
|
|
1381
|
-
if (player2.ownerDocument.fullscreenElement === player2)
|
|
1382
|
-
await player2.ownerDocument.exitFullscreen();
|
|
1383
|
-
else
|
|
1384
|
-
await player2.requestFullscreen();
|
|
1426
|
+
await nativeFullscreen.toggleFullscreen();
|
|
1385
1427
|
} catch (error) {
|
|
1386
1428
|
onError?.(error);
|
|
1387
1429
|
}
|
|
@@ -1406,7 +1448,7 @@ function Playback({ src, poster, aspectRatio, posterDuration = 0, title, version
|
|
|
1406
1448
|
setExpanded(next);
|
|
1407
1449
|
}
|
|
1408
1450
|
const fitted = fitContent || expanded && fitExpandedContent;
|
|
1409
|
-
const player =
|
|
1451
|
+
const player = _jsxs17("section", { ref: root, className: "vx-video-player", "aria-label": title, "data-fit": fitted ? "content" : void 0, style: { "--vx-video-ratio": displayRatio }, "data-placement": controlsPlacement, "data-controls-size": controlsSize, "data-state": state, children: [_jsxs17("div", { className: "vx-video-stage", children: [src ? _jsx20("video", { ref: video, src, poster, muted, playsInline: true, preload: "metadata", onResize: (event2) => {
|
|
1410
1452
|
const { videoWidth, videoHeight } = event2.currentTarget;
|
|
1411
1453
|
if (videoWidth && videoHeight)
|
|
1412
1454
|
setRatio(videoWidth / videoHeight);
|
|
@@ -1439,13 +1481,13 @@ function Playback({ src, poster, aspectRatio, posterDuration = 0, title, version
|
|
|
1439
1481
|
}, onEnded, onError: (event2) => {
|
|
1440
1482
|
if (event2.currentTarget.error)
|
|
1441
1483
|
onError?.(event2.currentTarget.error);
|
|
1442
|
-
} }) : poster && _jsx20("img", { src: poster, alt: "" }), overlay, state === "cover" && !fitted &&
|
|
1443
|
-
return
|
|
1484
|
+
} }) : poster && _jsx20("img", { src: poster, alt: "" }), overlay, state === "cover" && !fitted && _jsxs17("div", { className: "vx-video-cover", "data-plain": !showCoverInfo || void 0, children: [showCoverInfo && _jsxs17("div", { className: "vx-video-info", children: [_jsxs17("div", { className: "vx-video-title", children: [_jsx20("strong", { title, children: title }), version && _jsx20(Tag, { children: version })] }), (durationLabel || sceneLabel) && _jsxs17("div", { className: "vx-video-meta", children: [durationLabel && _jsx20("span", { children: durationLabel }), durationLabel && sceneLabel && _jsx20("span", { "aria-hidden": "true", children: "\xB7" }), sceneLabel && _jsx20("span", { children: sceneLabel })] })] }), showCoverPlay && (src || duration > 0) && _jsx20(IconButton, { icon: "play-cover", className: "vx-video-start", label: `Play ${title}`, variant: "icon-circle-lg", onClick: togglePlay })] })] }), _jsx20(PlaybackControls, { fullscreen: fullscreenMode === "dialog" ? expanded : nativeFullscreen.fullscreen, 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 })] });
|
|
1485
|
+
return _jsxs17(_Fragment8, { children: [expanded ? _jsx20("div", { "aria-hidden": "true", style: { height: inlineHeight } }) : !inlineDialog && player, _jsx20(Dialog, { title, open: expanded, onOpenChange: changeExpanded, className: fitExpandedContent ? "vx-video-dialog vx-video-dialog-fit" : "vx-video-dialog", inlineWhenClosed: inlineDialog, children: (expanded || inlineDialog) && player })] });
|
|
1444
1486
|
}
|
|
1445
1487
|
|
|
1446
1488
|
// packages/ui-system/dist/workspace-theme.js
|
|
1447
|
-
import { jsx as _jsx21, jsxs as
|
|
1448
|
-
import { useEffect as
|
|
1489
|
+
import { jsx as _jsx21, jsxs as _jsxs18 } from "react/jsx-runtime";
|
|
1490
|
+
import { useEffect as useEffect7, useState as useState11 } from "react";
|
|
1449
1491
|
var key = "vivix.studio.theme";
|
|
1450
1492
|
var event = "vivix-studio-theme";
|
|
1451
1493
|
function readPreference() {
|
|
@@ -1458,9 +1500,9 @@ function readPreference() {
|
|
|
1458
1500
|
return "light";
|
|
1459
1501
|
}
|
|
1460
1502
|
function useWorkspaceTheme() {
|
|
1461
|
-
const [preference, setPreference] =
|
|
1462
|
-
const [system, setSystem] =
|
|
1463
|
-
|
|
1503
|
+
const [preference, setPreference] = useState11(readPreference);
|
|
1504
|
+
const [system, setSystem] = useState11(() => globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light");
|
|
1505
|
+
useEffect7(() => {
|
|
1464
1506
|
const query = globalThis.matchMedia?.("(prefers-color-scheme: dark)");
|
|
1465
1507
|
const synchronize = () => setPreference(readPreference());
|
|
1466
1508
|
const systemChanged = () => setSystem(query?.matches ? "dark" : "light");
|
|
@@ -1486,14 +1528,14 @@ function useWorkspaceTheme() {
|
|
|
1486
1528
|
|
|
1487
1529
|
// packages/ui-system/dist/duration.js
|
|
1488
1530
|
function formatDurationSeconds(durationMs) {
|
|
1489
|
-
return (Math.round(durationMs / 100) / 10).toFixed(1);
|
|
1531
|
+
return (Math.round(durationMs / 100) / 10).toFixed(1).replace(/\.0$/, "");
|
|
1490
1532
|
}
|
|
1491
1533
|
|
|
1492
1534
|
// packages/ui-system/dist/view-skeleton.js
|
|
1493
|
-
import { jsx as _jsx22, Fragment as
|
|
1535
|
+
import { jsx as _jsx22, Fragment as _Fragment9, jsxs as _jsxs19 } from "react/jsx-runtime";
|
|
1494
1536
|
function ViewSkeleton({ layout = "list", label = "Loading project", heading = true }) {
|
|
1495
1537
|
const count = { list: 5, grid: 8, document: 1, preview: 1, compare: 2 }[layout];
|
|
1496
|
-
return
|
|
1538
|
+
return _jsxs19("section", { className: "vx-view-skeleton", "data-layout": layout, role: "status", "aria-label": label, "aria-busy": "true", children: [heading && _jsx22("div", { className: "vx-skeleton-heading", "aria-hidden": "true" }), _jsx22("div", { className: "vx-skeleton-content", "aria-hidden": "true", children: Array.from({ length: count }, (_, index) => _jsxs19("div", { className: "vx-skeleton-item", children: [layout !== "document" && _jsx22("div", { className: "vx-skeleton-media" }), _jsxs19("div", { className: "vx-skeleton-copy", children: [_jsx22("span", {}), _jsx22("span", {}), layout === "document" && _jsxs19(_Fragment9, { children: [_jsx22("span", {}), _jsx22("span", {}), _jsx22("span", {})] })] })] }, index)) })] });
|
|
1497
1539
|
}
|
|
1498
1540
|
|
|
1499
1541
|
// packages/studio-workbench/src/project-frame.tsx
|
|
@@ -2605,7 +2647,7 @@ function HomeBanner({ client }) {
|
|
|
2605
2647
|
}
|
|
2606
2648
|
|
|
2607
2649
|
// packages/studio-workbench/src/view-templates.ts
|
|
2608
|
-
var guide = "Run vivix-studio agent guide --json and read the installed plugin development guide.";
|
|
2650
|
+
var guide = "Run vivix-studio agent guide --json and read the installed plugin development guide and Studio plugin view guide, starting with \u201CCreate a view or connect a capability\u201D. Choose the local-mode, project-view, global-view or atomic-capability path before implementation. Reuse the installed UI System components and supported variants; keep custom styling inside the content canvas. Match the existing shell toolbar, card-caption alignment and spacing, detail metadata placement and filtered-empty layout; omit redundant explanatory copy. Verify loading, empty, filtered-empty, populated, hover, keyboard and dialog states in the installed Host, including enter/exit fullscreen when media is present.";
|
|
2609
2651
|
var projectGuide = "Inspect the target project and its active preset. Use the view in a compatible project through its existing navigation. For an existing project page, link to the project and its view ID. To compose a component in the same scope, declare the provider as a dependency and use resolveUI with the props it expects.";
|
|
2610
2652
|
var dramaProduction = {
|
|
2611
2653
|
project: "Out of steps",
|
|
@@ -3908,9 +3950,22 @@ function GlobalWorkbench({ client }) {
|
|
|
3908
3950
|
if (route.project.view !== view2) navigate({ ...route, project: { ...route.project, view: view2 } });
|
|
3909
3951
|
requestProjectView.current?.(view2, true);
|
|
3910
3952
|
}
|
|
3911
|
-
const
|
|
3912
|
-
|
|
3913
|
-
|
|
3953
|
+
const sidebarPreferenceKey = `studio-sidebar-collapsed:${client.project.id}`;
|
|
3954
|
+
const [collapsed, setCollapsed] = React8.useState(() => {
|
|
3955
|
+
try {
|
|
3956
|
+
return window.localStorage.getItem(sidebarPreferenceKey) === "true";
|
|
3957
|
+
} catch {
|
|
3958
|
+
return false;
|
|
3959
|
+
}
|
|
3960
|
+
});
|
|
3961
|
+
function toggleSidebar() {
|
|
3962
|
+
const next = !collapsed;
|
|
3963
|
+
setCollapsed(next);
|
|
3964
|
+
try {
|
|
3965
|
+
window.localStorage.setItem(sidebarPreferenceKey, String(next));
|
|
3966
|
+
} catch {
|
|
3967
|
+
}
|
|
3968
|
+
}
|
|
3914
3969
|
const pages = React8.useRef(/* @__PURE__ */ new Map());
|
|
3915
3970
|
const downloadFrame = React8.useId().replace(/[^a-zA-Z0-9]/g, "");
|
|
3916
3971
|
const importInput = React8.useRef(null);
|
|
@@ -4839,7 +4894,7 @@ function GlobalWorkbench({ client }) {
|
|
|
4839
4894
|
{
|
|
4840
4895
|
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
4841
4896
|
"aria-expanded": !collapsed,
|
|
4842
|
-
onClick:
|
|
4897
|
+
onClick: toggleSidebar
|
|
4843
4898
|
},
|
|
4844
4899
|
/* @__PURE__ */ React8.createElement(StudioGlyph, { name: "panel" })
|
|
4845
4900
|
)), /* @__PURE__ */ React8.createElement("nav", { "aria-label": "Workspace" }, /* @__PURE__ */ React8.createElement(
|
|
@@ -6432,7 +6487,7 @@ var workbenchCss = `
|
|
|
6432
6487
|
|
|
6433
6488
|
// packages/studio-workbench/src/file-library-styles.ts
|
|
6434
6489
|
var fileLibraryCss = `
|
|
6435
|
-
[hidden]{display:none!important}header{justify-content:space-between}header nav{margin-right:auto}h1{font-size:26px}.workspace{grid-template-columns:180px minmax(0,1fr)}.nav .eyebrow{letter-spacing:1px}.nav .recent{margin-top:30px}.nav button{padding:10px}.upload-button{display:inline-flex;align-items:center;min-height:34px;border-radius:6px;padding:10px 16px;cursor:pointer;font-size:12px;color:white;margin:0}.file-toolbar{display:flex;align-items:center;gap:20px;margin:24px 0}.file-toolbar>input{width:200px}.file-toolbar>select{margin-left:auto;font-size:11px;border:0;color:#777}.file-type-tabs{display:flex;gap:4px}.file-type-tabs button{border:0;color:#85828e;font-size:12px;padding:8px 11px}.file-type-tabs button.active{color:#5046b8;background:#efedf9}.file-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:28px 20px}.file-tile{border:0;padding:0;text-align:left;background:transparent;min-width:0;border-radius:8px}.file-tile:hover{background:transparent}.file-tile-preview{height:168px;border-radius:8px;background:#f5f4f8;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:background .15s,transform .15s}.file-tile:hover .file-tile-preview{background:#eeecf5;transform:translateY(-2px)}.file-tile-preview img,.file-tile-preview video{width:100%;height:100%;object-fit:cover}.file-tile>strong{font-size:12px;font-weight:550;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:12px 0 6px}.file-tile>span{font-size:10px;color:#92909c;display:flex;justify-content:space-between}.file-tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:9px}.file-tags small{font-size:10px;background:#f1f0f6;color:#85808f;padding:3px 6px;border-radius:4px}.file-document{width:65px;height:83px;background:white;border:1px solid #e1deea;border-radius:5px;padding:13px;box-shadow:0 5px 10px #27213405}.file-document span{font-size:19px;color:#a69db7}.file-document i{display:block;height:2px;background:#e4e0eb;margin-top:8px}.file-symbol{font-size:26px;color:#a399b5}.file-placeholder{font-size:11px;color:#aaa1b5;text-align:center;padding:20px}.files-empty{padding:80px 20px;text-align:center;color:#a49baa}.files-empty>span{font-size:35px}.files-empty h2{font-size:17px;color:#6b6375;font-weight:500}.files-empty p{font-size:12px}.file-overlay{position:fixed;inset:0;background:#24202c5c;z-index:9;display:grid;place-items:center;padding:32px;animation:fileFade .16s ease}.file-viewer{background:white;border-radius:12px;width:min(1100px,100%);height:min(740px,calc(100vh - 64px));overflow:hidden;position:relative;box-shadow:0 25px 100px #16102022}.file-viewer-header{height:76px;padding:0 23px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #ece9f1;gap:18px}.file-viewer-header>div:first-child{min-width:0}.file-viewer-header strong{display:block;font-size:
|
|
6490
|
+
[hidden]{display:none!important}header{justify-content:space-between}header nav{margin-right:auto}h1{font-size:26px}.workspace{grid-template-columns:180px minmax(0,1fr)}.nav .eyebrow{letter-spacing:1px}.nav .recent{margin-top:30px}.nav button{padding:10px}.upload-button{display:inline-flex;align-items:center;min-height:34px;border-radius:6px;padding:10px 16px;cursor:pointer;font-size:12px;color:white;margin:0}.file-toolbar{display:flex;align-items:center;gap:20px;margin:24px 0}.file-toolbar>input{width:200px}.file-toolbar>select{margin-left:auto;font-size:11px;border:0;color:#777}.file-type-tabs{display:flex;gap:4px}.file-type-tabs button{border:0;color:#85828e;font-size:12px;padding:8px 11px}.file-type-tabs button.active{color:#5046b8;background:#efedf9}.file-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:28px 20px}.file-tile{border:0;padding:0;text-align:left;background:transparent;min-width:0;border-radius:8px}.file-tile:hover{background:transparent}.file-tile-preview{height:168px;border-radius:8px;background:#f5f4f8;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:background .15s,transform .15s}.file-tile:hover .file-tile-preview{background:#eeecf5;transform:translateY(-2px)}.file-tile-preview img,.file-tile-preview video{width:100%;height:100%;object-fit:cover}.file-tile>strong{font-size:12px;font-weight:550;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:12px 0 6px}.file-tile>span{font-size:10px;color:#92909c;display:flex;justify-content:space-between}.file-tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:9px}.file-tags small{font-size:10px;background:#f1f0f6;color:#85808f;padding:3px 6px;border-radius:4px}.file-document{width:65px;height:83px;background:white;border:1px solid #e1deea;border-radius:5px;padding:13px;box-shadow:0 5px 10px #27213405}.file-document span{font-size:19px;color:#a69db7}.file-document i{display:block;height:2px;background:#e4e0eb;margin-top:8px}.file-symbol{font-size:26px;color:#a399b5}.file-placeholder{font-size:11px;color:#aaa1b5;text-align:center;padding:20px}.files-empty{padding:80px 20px;text-align:center;color:#a49baa}.files-empty>span{font-size:35px}.files-empty h2{font-size:17px;color:#6b6375;font-weight:500}.files-empty p{font-size:12px}.file-overlay{position:fixed;inset:0;background:#24202c5c;z-index:9;display:grid;place-items:center;padding:32px;animation:fileFade .16s ease}.file-viewer{background:white;border-radius:12px;width:min(1100px,100%);height:min(740px,calc(100vh - 64px));overflow:hidden;position:relative;box-shadow:0 25px 100px #16102022}.file-viewer-header{height:76px;padding:0 23px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #ece9f1;gap:18px}.file-viewer-header>div:first-child{min-width:0}.file-viewer-header strong{display:block;font-size:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-viewer-header span{display:block;font-size:10px;color:#a29aa9;margin-top:5px}.file-viewer-header .actions{flex-wrap:nowrap}.file-viewer-header button,.button{font-size:11px;white-space:nowrap}.button{border:1px solid #dedee4;border-radius:5px;padding:8px 12px;color:#4f4859}.file-close{font-size:23px!important;border:0;padding:4px 8px;color:#8d829a}.file-viewer-notice{position:absolute;top:78px;left:22px;z-index:1;background:#f0eaf8;color:#6c5c84;padding:9px 14px;border-radius:5px;font-size:11px;margin:8px 0}.file-viewer-body{display:grid;grid-template-columns:minmax(0,1fr) 230px;height:calc(100% - 76px)}.file-stage{background:#f7f6fa;display:flex;align-items:center;justify-content:center;scrollbar-gutter: stable;overflow:scroll auto;padding:28px}.file-stage>img,.file-stage>video{max-width:100%;max-height:100%;object-fit:contain;border-radius:5px}.file-stage>audio{width:min(400px,100%)}.file-text{white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.9 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;align-self:flex-start;background:white;padding:30px;min-height:100%;width:100%;margin:0}.file-details{padding:22px;border-left:1px solid #edeaf2;scrollbar-gutter: stable;overflow:scroll auto}.file-details h3{font-size:11px;font-weight:550;margin:4px 0 16px;color:#7b6f88}.file-details p{font-size:11px;color:#8b8194;margin:10px 0;line-height:1.8}.file-details h3:not(:first-child){border-top:1px solid #eeeaf3;margin-top:26px;padding-top:23px}.file-history{display:flex;flex-direction:column;gap:8px}.file-history button{display:flex;justify-content:space-between;align-items:center;gap:8px;border:0;background:#f7f6fa;text-align:left;font-size:11px;padding:12px}.file-history button b{font-weight:500}.file-history button span{font-size:9px;color:#9c92a8}.file-history button.active{background:#eeebfa;color:#5947af}.file-more{position:relative}.file-menu{position:absolute;right:0;top:calc(100% + 7px);background:white;box-shadow:0 10px 40px #24163020;border:1px solid #eee9f3;border-radius:8px;padding:5px;min-width:150px;z-index:2;animation:fileFade .1s ease}.file-menu button{display:block;text-align:left;border:0;width:100%;padding:11px 12px;background:white}.file-menu button:hover{background:#f7f4fb}.file-menu .danger{color:#a05a64}.file-edit-overlay,.simple-backdrop{position:fixed;inset:0;display:grid;place-items:center;background:#211b3445;z-index:12;padding:20px}.file-edit,.simple-dialog{background:white;padding:28px;border-radius:12px;width:min(440px,100%);box-shadow:0 18px 70px #1e11331c}.file-edit h2,.simple-dialog h2{font-size:18px;margin:0 0 23px}.file-edit label,.simple-dialog label{font-size:12px;margin:16px 0}.file-edit input,.file-edit textarea,.file-edit select,.simple-dialog input,.simple-dialog textarea{width:100%;margin-top:8px;padding:10px}.file-edit textarea{min-height:230px}.file-edit .actions,.simple-dialog .actions{margin-top:22px}.file-notice{background:#f4f1fa;color:#74648b;padding:11px 15px;font-size:11px;line-height:1.6;border-radius:5px;margin:14px 0}.creation-page>.file-notice{margin:8px 24px}.project-files-list>button{display:flex;align-items:center;width:100%;padding:22px 5px;border:0;border-bottom:1px solid #eeebf3;border-radius:0;text-align:left;gap:22px}.project-files-list>button:hover{background:#faf8fd}.project-files-list strong{font-size:14px;font-weight:550}.project-files-list p{font-size:11px;color:#9c92a5;margin:7px 0 0}.project-files-list>button>span:last-child{margin-left:auto;font-size:11px;color:#a393b0}.project-folder{font-size:32px;color:#c8bddc}.task-history>article{padding:22px 0;border-bottom:1px solid #eeeaf3;display:flex;align-items:center;gap:18px}.task-history strong{font-size:13px;font-weight:500}.task-history p{margin:7px 0 0;font-size:11px}.task-history .actions{margin-left:auto}.task-history .actions button{font-size:11px}.task-history-icon{width:36px;height:36px;border-radius:50%;background:#f3effa;color:#a18ac0;display:grid;place-items:center}.load-files{margin:30px 0;font-size:12px}.creation-page>.heading h1{font-size:24px}.generation-notice{line-height:1.7}.generation-form .reference-help{line-height:1.8}.generation-submit p{font-size:10px}.creation-results-empty p{line-height:1.8}.error button{margin-left:15px;font-size:10px}.error{font-size:12px;line-height:1.8}@keyframes fileFade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}@media(max-width:900px){.file-viewer-body{grid-template-columns:minmax(0,1fr) 190px}.file-details{padding:18px}.file-toolbar{flex-wrap:wrap;gap:12px}.file-toolbar>input{width:180px}.file-type-tabs{order:3;flex-basis:100%}.file-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}}@media(max-width:560px){.workspace{grid-template-columns:118px minmax(0,1fr)}.file-grid{grid-template-columns:1fr}.file-toolbar>input{width:100%}.file-toolbar>select{margin-left:0}.file-type-tabs{gap:0;flex-wrap:wrap}.file-type-tabs button{padding:7px}.file-overlay{padding:0}.file-viewer{height:100dvh;width:100%;border-radius:0}.file-viewer-header{padding:0 12px;height:68px}.file-viewer-header .actions{gap:4px}.file-viewer-header .actions button,.file-viewer-header .button{font-size:10px;padding:7px}.file-viewer-header strong{font-size:18px;max-width:110px}.file-viewer-body{display:flex;flex-direction:column;height:calc(100% - 68px)}.file-stage{flex:1;min-height:0;padding:15px}.file-details{height:170px;flex-shrink:0;border-left:0;border-top:1px solid #eee;display:grid;grid-template-columns:1fr 1fr;gap:10px;scrollbar-gutter: stable;overflow:scroll auto}.file-details h3{margin:0}.file-details h3:not(:first-child){border:0;margin:0;padding:0}.file-history{gap:5px}.file-text{padding:17px;font-size:12px}.heading .actions{gap:6px}.upload-button{display:inline-flex;align-items:center;min-height:34px;padding:9px;font-size:11px}.task-history>article{flex-wrap:wrap}.task-history .actions{margin-left:54px}.project-files-list>button{gap:12px}.project-files-list>button>span:last-child{display:none}}@media(prefers-reduced-motion:reduce){.file-overlay,.file-menu{animation:none}.file-tile-preview{transition:none}}
|
|
6436
6491
|
`;
|
|
6437
6492
|
|
|
6438
6493
|
// packages/studio-workbench/src/client.tsx
|