@vivix-labs/ads-workbench 1.0.0-beta.12 → 1.0.0-beta.15

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.
@@ -364,49 +364,22 @@ function Checkbox({ label, checked, onCheckedChange, hideLabel = false, appearan
364
364
  return _jsxs6("label", { className: "vx-checkbox", "data-appearance": appearance, "data-label-hidden": hideLabel || void 0, children: [_jsx8("input", { ...props, className: "vx-checkbox-input", type: "checkbox", "aria-label": hideLabel ? label : void 0, checked, onChange: (event2) => onCheckedChange(event2.currentTarget.checked) }), _jsx8("span", { className: "vx-checkbox-mark", "aria-hidden": "true", children: _jsx8(Icon, { name: appearance === "on-content" ? "check-on-content" : "check" }) }), !hideLabel && label] });
365
365
  }
366
366
 
367
- // packages/ui-system/dist/search-input.js
368
- import { jsx as _jsx9, jsxs as _jsxs7 } from "react/jsx-runtime";
369
- import { useRef, useState as useState2 } from "react";
370
- function SearchInput({ label, value, onValueChange, size = "medium", placeholder = "Type to search...", ...props }) {
371
- const input = useRef(null);
372
- const composing = useRef(false);
373
- const [draft, setDraft] = useState2(null);
374
- return _jsxs7("div", { className: "vx-search-input", "data-size": size, children: [_jsx9(Icon, { name: "search" }), _jsx9("input", { ...props, ref: input, type: "search", "aria-label": label, placeholder, value: draft ?? value, onChange: (event2) => {
375
- const next = event2.currentTarget.value;
376
- if (composing.current)
377
- setDraft(next);
378
- else if (next !== value)
379
- onValueChange(next);
380
- }, onCompositionStart: (event2) => {
381
- composing.current = true;
382
- setDraft(event2.currentTarget.value);
383
- }, onCompositionEnd: (event2) => {
384
- composing.current = false;
385
- setDraft(null);
386
- if (event2.currentTarget.value !== value)
387
- onValueChange(event2.currentTarget.value);
388
- } }), (draft ?? value) && _jsx9(IconButton, { icon: "clear", label: `Clear ${label}`, className: "vx-search-clear", disabled: props.disabled, onClick: () => {
389
- onValueChange("");
390
- input.current?.focus();
391
- } })] });
392
- }
393
-
394
367
  // packages/ui-system/dist/dropdown.js
395
- import { jsx as _jsx10, jsxs as _jsxs8 } from "react/jsx-runtime";
396
- import { useEffect as useEffect2, useId, useLayoutEffect, useRef as useRef2, useState as useState3 } from "react";
368
+ import { jsx as _jsx9, jsxs as _jsxs7 } from "react/jsx-runtime";
369
+ import { useEffect as useEffect2, useId, useLayoutEffect, useRef, useState as useState2 } from "react";
397
370
  function optionIcon(icon) {
398
- return typeof icon === "string" ? _jsx10(Icon, { name: icon }) : icon;
371
+ return typeof icon === "string" ? _jsx9(Icon, { name: icon }) : icon;
399
372
  }
400
373
  function Dropdown({ label, options, value, onValueChange, placeholder = "Select an option", size = "medium", width = "fixed", appearance = "default", textSize = 14, floating = false, disabled = false }) {
401
374
  const id = useId();
402
- const trigger = useRef2(null);
403
- const list = useRef2(null);
375
+ const trigger = useRef(null);
376
+ const list = useRef(null);
404
377
  const heading = appearance === "heading";
405
378
  const popover = heading || floating;
406
- const activeOption = useRef2(null);
407
- const search = useRef2({ query: "", time: 0 });
408
- const [open, setOpen] = useState3(false);
409
- const [highlighted, setHighlighted] = useState3(null);
379
+ const activeOption = useRef(null);
380
+ const search = useRef({ query: "", time: 0 });
381
+ const [open, setOpen] = useState2(false);
382
+ const [highlighted, setHighlighted] = useState2(null);
410
383
  const enabled = options.filter((option) => !option.disabled);
411
384
  const canOpen = !disabled && enabled.length > 0;
412
385
  const expanded = canOpen && open;
@@ -525,35 +498,35 @@ function Dropdown({ label, options, value, onValueChange, placeholder = "Select
525
498
  if (match)
526
499
  setHighlighted(match.value);
527
500
  }
528
- 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: () => {
501
+ return _jsxs7("div", { className: "vx-dropdown", "data-size": size, "data-width": width, "data-appearance": appearance, "data-text-size": textSize, "data-floating": floating || void 0, children: [_jsxs7("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: [_jsxs7("span", { className: "vx-dropdown-value", children: [optionIcon(selected?.icon), _jsx9("span", { children: selected?.triggerLabel ?? selected?.label ?? placeholder })] }), _jsx9(Icon, { name: expanded ? "chevron-up" : "chevron-down" })] }), _jsx9("ul", { ref: list, popover: popover ? "manual" : void 0, id: `${id}-listbox`, role: "listbox", "aria-label": label, hidden: !expanded, children: options.map((option, index) => _jsxs7("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: () => {
529
502
  if (!option.disabled)
530
503
  choose(option);
531
- }, children: [optionIcon(option.icon), option.label, width === "hug" && option.value === value && _jsx10(Icon, { name: "check" })] }, option.value)) })] });
504
+ }, children: [optionIcon(option.icon), option.label, width === "hug" && option.value === value && _jsx9(Icon, { name: "check" })] }, option.value)) })] });
532
505
  }
533
506
 
534
507
  // packages/ui-system/dist/segmented-control.js
535
- import { jsx as _jsx11, jsxs as _jsxs9 } from "react/jsx-runtime";
508
+ import { jsx as _jsx10, jsxs as _jsxs8 } from "react/jsx-runtime";
536
509
  import { useId as useId2 } from "react";
537
510
  function SegmentedControl({ label, items, value, onValueChange, size = "medium", width = "fixed", iconOnly = false }) {
538
511
  const id = useId2();
539
- return _jsx11("div", { role: "radiogroup", "aria-label": label, className: "vx-segment", "data-size": size, "data-width": width, "data-icon-only": iconOnly, children: items.map((item) => _jsxs9("label", { children: [_jsx11("input", { type: "radio", name: id, value: item.value, disabled: item.disabled, checked: item.value === value, "aria-label": item.label, onChange: () => onValueChange(item.value) }), _jsxs9("span", { className: "vx-segment-item", children: [item.icon && _jsx11(Icon, { name: item.icon }), (!iconOnly || !item.icon) && item.label] })] }, item.value)) });
512
+ return _jsx10("div", { role: "radiogroup", "aria-label": label, className: "vx-segment", "data-size": size, "data-width": width, "data-icon-only": iconOnly, children: items.map((item) => _jsxs8("label", { children: [_jsx10("input", { type: "radio", name: id, value: item.value, disabled: item.disabled, checked: item.value === value, "aria-label": item.label, onChange: () => onValueChange(item.value) }), _jsxs8("span", { className: "vx-segment-item", children: [item.icon && _jsx10(Icon, { name: item.icon }), (!iconOnly || !item.icon) && item.label] })] }, item.value)) });
540
513
  }
541
514
 
542
515
  // packages/ui-system/dist/inline-text.js
543
- import { jsx as _jsx12 } from "react/jsx-runtime";
544
- import { useLayoutEffect as useLayoutEffect2, useRef as useRef3, useState as useState4 } from "react";
516
+ import { jsx as _jsx11 } from "react/jsx-runtime";
517
+ import { useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState3 } from "react";
545
518
  function InlineText({ value, label, onChange, onCommit, onEditStart, as: Element = "span", multiline = false, disabled = false, placeholder = "Click to add text" }) {
546
- const node = useRef3(null);
547
- const initial = useRef3(value);
548
- const editing = useRef3(false);
549
- const [focused, setFocused] = useState4(false);
550
- const before = useRef3(value);
551
- const cancelled = useRef3(false);
519
+ const node = useRef2(null);
520
+ const initial = useRef2(value);
521
+ const editing = useRef2(false);
522
+ const [focused, setFocused] = useState3(false);
523
+ const before = useRef2(value);
524
+ const cancelled = useRef2(false);
552
525
  useLayoutEffect2(() => {
553
526
  if (!editing.current && node.current)
554
527
  node.current.textContent = value;
555
528
  }, [value, focused]);
556
- return _jsx12(Element, { ref: (element) => {
529
+ return _jsx11(Element, { ref: (element) => {
557
530
  node.current = element;
558
531
  }, className: "vx-inline-text", contentEditable: disabled ? false : "plaintext-only", suppressContentEditableWarning: true, role: "textbox", "aria-label": label, "aria-multiline": multiline, "aria-readonly": disabled, tabIndex: disabled ? -1 : 0, "data-placeholder": placeholder, spellCheck: true, title: multiline ? "Enter to finish editing, Shift+Enter for a new line, Esc to cancel" : "Enter to finish editing, Esc to cancel", onFocus: () => {
559
532
  editing.current = true;
@@ -592,14 +565,14 @@ function InlineText({ value, label, onChange, onCommit, onEditStart, as: Element
592
565
  }
593
566
 
594
567
  // packages/ui-system/dist/tag.js
595
- import { jsx as _jsx13 } from "react/jsx-runtime";
568
+ import { jsx as _jsx12 } from "react/jsx-runtime";
596
569
  function Tag({ children, variant = "overlay", className }) {
597
- return _jsx13("span", { className: className ? `vx-tag ${className}` : "vx-tag", "data-variant": variant, children });
570
+ return _jsx12("span", { className: className ? `vx-tag ${className}` : "vx-tag", "data-variant": variant, children });
598
571
  }
599
572
 
600
573
  // packages/ui-system/dist/dialog.js
601
- import { jsx as _jsx14, jsxs as _jsxs10, Fragment as _Fragment3 } from "react/jsx-runtime";
602
- import { useId as useId3, useLayoutEffect as useLayoutEffect3, useRef as useRef4, useState as useState5 } from "react";
574
+ import { jsx as _jsx13, jsxs as _jsxs9, Fragment as _Fragment3 } from "react/jsx-runtime";
575
+ import { useId as useId3, useLayoutEffect as useLayoutEffect3, useRef as useRef3, useState as useState4 } from "react";
603
576
  import { createPortal } from "react-dom";
604
577
 
605
578
  // packages/ui-system/dist/dialog-surface.js
@@ -661,9 +634,9 @@ function createDialogSurface(anchor2) {
661
634
 
662
635
  // packages/ui-system/dist/dialog.js
663
636
  function Dialog({ title, open, onOpenChange, children, actions, className, inlineWhenClosed = false, variant = "default", closeOnEscape = true, focusTitleOnOpen = variant === "welcome" }) {
664
- const ref = useRef4(null);
665
- const anchor2 = useRef4(null);
666
- const [surface, setSurface] = useState5();
637
+ const ref = useRef3(null);
638
+ const anchor2 = useRef3(null);
639
+ const [surface, setSurface] = useState4();
667
640
  const heading = useId3();
668
641
  useLayoutEffect3(() => {
669
642
  if (inlineWhenClosed || !open || !anchor2.current)
@@ -702,8 +675,8 @@ function Dialog({ title, open, onOpenChange, children, actions, className, inlin
702
675
  };
703
676
  }, [open, surface, inlineWhenClosed]);
704
677
  const welcome = variant === "welcome";
705
- const closeButton = _jsx14(IconButton, { icon: "close", label: "Close dialog", onClick: () => onOpenChange(false) });
706
- const dialog = _jsxs10("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) => {
678
+ const closeButton = _jsx13(IconButton, { icon: "close", label: "Close dialog", onClick: () => onOpenChange(false) });
679
+ const dialog = _jsxs9("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) => {
707
680
  event2.preventDefault();
708
681
  event2.stopPropagation();
709
682
  if (closeOnEscape)
@@ -711,17 +684,17 @@ function Dialog({ title, open, onOpenChange, children, actions, className, inlin
711
684
  }, onClose: (event2) => {
712
685
  if (open && event2.currentTarget.isConnected && !event2.currentTarget.open)
713
686
  onOpenChange(false);
714
- }, children: [_jsxs10("header", { hidden: inlineWhenClosed && !open, 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", { hidden: inlineWhenClosed && !open, children: [actions, welcome && closeButton] })] });
715
- return _jsxs10(_Fragment3, { children: [_jsx14("span", { ref: anchor2, hidden: true }), (open || inlineWhenClosed) && (surface ? createPortal(dialog, surface) : dialog)] });
687
+ }, children: [_jsxs9("header", { hidden: inlineWhenClosed && !open, children: [_jsx13("h2", { id: heading, tabIndex: focusTitleOnOpen ? -1 : void 0, autoFocus: focusTitleOnOpen, children: title }), !welcome && closeButton] }), _jsx13("div", { className: "vx-dialog-body", children }), (actions || welcome) && _jsxs9("footer", { hidden: inlineWhenClosed && !open, children: [actions, welcome && closeButton] })] });
688
+ return _jsxs9(_Fragment3, { children: [_jsx13("span", { ref: anchor2, hidden: true }), (open || inlineWhenClosed) && (surface ? createPortal(dialog, surface) : dialog)] });
716
689
  }
717
690
 
718
691
  // packages/ui-system/dist/toast.js
719
- import { jsx as _jsx15, jsxs as _jsxs11, Fragment as _Fragment4 } from "react/jsx-runtime";
720
- import { useCallback, useEffect as useEffect3, useLayoutEffect as useLayoutEffect4, useRef as useRef5, useState as useState6 } from "react";
692
+ import { jsx as _jsx14, jsxs as _jsxs10, Fragment as _Fragment4 } from "react/jsx-runtime";
693
+ import { useCallback, useEffect as useEffect3, useLayoutEffect as useLayoutEffect4, useRef as useRef4, useState as useState5 } from "react";
721
694
  import { createPortal as createPortal2 } from "react-dom";
722
695
  function useToastMessage() {
723
- const [message, setMessage] = useState6("");
724
- const timeout = useRef5(void 0);
696
+ const [message, setMessage] = useState5("");
697
+ const timeout = useRef4(void 0);
725
698
  useEffect3(() => () => clearTimeout(timeout.current), []);
726
699
  const show = useCallback((text) => {
727
700
  clearTimeout(timeout.current);
@@ -732,9 +705,9 @@ function useToastMessage() {
732
705
  return [message, show];
733
706
  }
734
707
  function Toast({ message, leading, className }) {
735
- const anchor2 = useRef5(null);
736
- const ref = useRef5(null);
737
- const [surface, setSurface] = useState6();
708
+ const anchor2 = useRef4(null);
709
+ const ref = useRef4(null);
710
+ const [surface, setSurface] = useState5();
738
711
  const visible = Boolean(message);
739
712
  useLayoutEffect4(() => {
740
713
  if (!visible || !anchor2.current)
@@ -776,18 +749,18 @@ function Toast({ message, leading, className }) {
776
749
  doc.removeEventListener("fullscreenchange", bringToFront);
777
750
  };
778
751
  }, [visible, surface]);
779
- const notice = visible && surface !== void 0 && _jsxs11("div", { ref, popover: "manual", role: "status", "aria-atomic": "true", className: className ? `vx-toast ${className}` : "vx-toast", children: [leading, _jsx15("span", { children: message })] });
780
- return _jsxs11(_Fragment4, { children: [_jsx15("span", { hidden: true, ref: anchor2 }), surface ? createPortal2(notice, surface) : notice] });
752
+ const notice = visible && surface !== void 0 && _jsxs10("div", { ref, popover: "manual", role: "status", "aria-atomic": "true", className: className ? `vx-toast ${className}` : "vx-toast", children: [leading, _jsx14("span", { children: message })] });
753
+ return _jsxs10(_Fragment4, { children: [_jsx14("span", { hidden: true, ref: anchor2 }), surface ? createPortal2(notice, surface) : notice] });
781
754
  }
782
755
 
783
756
  // packages/ui-system/dist/prompt-hint.js
784
- import { jsx as _jsx16, jsxs as _jsxs12 } from "react/jsx-runtime";
785
- import { useRef as useRef6, useState as useState7 } from "react";
757
+ import { jsx as _jsx15, jsxs as _jsxs11 } from "react/jsx-runtime";
758
+ import { useRef as useRef5, useState as useState6 } from "react";
786
759
  function PromptHint({ label, message, prompt }) {
787
760
  const [status, setStatus] = useToastMessage();
788
- const [manual, setManual] = useState7(false);
789
- const text = useRef6(null);
790
- return _jsxs12("aside", { className: "vx-prompt-hint", "aria-label": label, children: [_jsx16("p", { children: message }), manual && _jsx16("textarea", { ref: text, "aria-label": "Prompt to copy", readOnly: true, value: prompt, autoFocus: true, onFocus: (event2) => event2.currentTarget.select() }), _jsx16(Button, { label: "Copy prompt", variant: "text-tonal-sm", width: "hug", onClick: async (event2) => {
761
+ const [manual, setManual] = useState6(false);
762
+ const text = useRef5(null);
763
+ return _jsxs11("aside", { className: "vx-prompt-hint", "aria-label": label, children: [_jsx15("p", { children: message }), manual && _jsx15("textarea", { ref: text, "aria-label": "Prompt to copy", readOnly: true, value: prompt, autoFocus: true, onFocus: (event2) => event2.currentTarget.select() }), _jsx15(Button, { label: "Copy prompt", variant: "text-tonal-sm", width: "hug", onClick: async (event2) => {
791
764
  try {
792
765
  await event2.currentTarget.ownerDocument.defaultView.navigator.clipboard.writeText(prompt);
793
766
  setStatus("Prompt copied.");
@@ -795,15 +768,15 @@ function PromptHint({ label, message, prompt }) {
795
768
  setManual(true);
796
769
  setStatus("Select and copy the prompt.");
797
770
  }
798
- } }), _jsx16(Toast, { message: status })] });
771
+ } }), _jsx15(Toast, { message: status })] });
799
772
  }
800
773
 
801
774
  // packages/ui-system/dist/detail-panel.js
802
- import { useLayoutEffect as useLayoutEffect5, useRef as useRef7, useState as useState8 } from "react";
775
+ import { useLayoutEffect as useLayoutEffect5, useRef as useRef6, useState as useState7 } from "react";
803
776
  function useDetailPanel(open) {
804
- const ref = useRef7(null);
805
- const [retained, setRetained] = useState8(open);
806
- const animation = useRef7(null);
777
+ const ref = useRef6(null);
778
+ const [retained, setRetained] = useState7(open);
779
+ const animation = useRef6(null);
807
780
  const present = open || retained;
808
781
  useLayoutEffect5(() => {
809
782
  const element = ref.current;
@@ -851,12 +824,12 @@ function useDetailPanel(open) {
851
824
  }
852
825
 
853
826
  // packages/ui-system/dist/menu.js
854
- import { jsx as _jsx17, jsxs as _jsxs13 } from "react/jsx-runtime";
855
- import { useEffect as useEffect4, useId as useId4, useLayoutEffect as useLayoutEffect6, useRef as useRef8, useState as useState9 } from "react";
827
+ import { jsx as _jsx16, jsxs as _jsxs12 } from "react/jsx-runtime";
828
+ import { useEffect as useEffect4, useId as useId4, useLayoutEffect as useLayoutEffect6, useRef as useRef7, useState as useState8 } from "react";
856
829
  import { createPortal as createPortal3 } from "react-dom";
857
830
  function MenuPreview({ children }) {
858
- const ref = useRef8(null);
859
- const [visible, setVisible] = useState9(false);
831
+ const ref = useRef7(null);
832
+ const [visible, setVisible] = useState8(false);
860
833
  useEffect4(() => {
861
834
  const node = ref.current;
862
835
  if (!node)
@@ -870,21 +843,21 @@ function MenuPreview({ children }) {
870
843
  observer.observe(node);
871
844
  return () => observer.disconnect();
872
845
  }, []);
873
- return _jsx17("span", { ref, className: "vx-menu-preview", "aria-hidden": "true", children: visible && children });
846
+ return _jsx16("span", { ref, className: "vx-menu-preview", "aria-hidden": "true", children: visible && children });
874
847
  }
875
848
  function isEnabled(item) {
876
849
  return !item.disabled && item.items?.length !== 0;
877
850
  }
878
851
  function Menu({ label, items, triggerIcon, textTrigger = "dropdown", floating = false, cascading = false }) {
879
852
  const id = useId4();
880
- const trigger = useRef8(null);
881
- const popup = useRef8(null);
882
- const children = useRef8(/* @__PURE__ */ new Map());
883
- const focusOnOpen = useRef8(true);
853
+ const trigger = useRef7(null);
854
+ const popup = useRef7(null);
855
+ const children = useRef7(/* @__PURE__ */ new Map());
856
+ const focusOnOpen = useRef7(true);
884
857
  const cascade = floating && cascading;
885
- const focusIndex = useRef8(0);
886
- const [path, setPath] = useState9(null);
887
- const [placement, setPlacement] = useState9({ visibility: "hidden" });
858
+ const focusIndex = useRef7(0);
859
+ const [path, setPath] = useState8(null);
860
+ const [placement, setPlacement] = useState8({ visibility: "hidden" });
888
861
  const portalRoot = floating ? trigger.current?.closest("dialog, [data-vx-theme]") : null;
889
862
  useLayoutEffect6(() => {
890
863
  if (!floating || !path || !portalRoot)
@@ -1057,7 +1030,7 @@ function Menu({ label, items, triggerIcon, textTrigger = "dropdown", floating =
1057
1030
  focusOnOpen.current = false;
1058
1031
  setPath(next);
1059
1032
  }
1060
- const menu = levels.map(({ entries: entries2, menuLabel: menuLabel2 }, depth) => !cascade && depth !== levels.length - 1 ? null : _jsx17("div", { ref: !cascade || depth === 0 ? popup : (el) => {
1033
+ const menu = levels.map(({ entries: entries2, menuLabel: menuLabel2 }, depth) => !cascade && depth !== levels.length - 1 ? null : _jsx16("div", { ref: !cascade || depth === 0 ? popup : (el) => {
1061
1034
  if (el)
1062
1035
  children.current.set(depth, el);
1063
1036
  else
@@ -1068,25 +1041,25 @@ function Menu({ label, items, triggerIcon, textTrigger = "dropdown", floating =
1068
1041
  visibility: "hidden",
1069
1042
  maxHeight: "min(480px, calc(100dvh - 16px))",
1070
1043
  zIndex: 100 + depth
1071
- } : placement : void 0, children: entries2.map((item) => _jsxs13("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) => {
1044
+ } : placement : void 0, children: entries2.map((item) => _jsxs12("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) => {
1072
1045
  if (e.pointerType !== "touch")
1073
1046
  hover(item, depth);
1074
- } : 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));
1075
- return _jsxs13("div", { className: "vx-action-menu", onBlur: (event2) => {
1047
+ } : void 0, "data-size": item.size ?? "medium", "data-tone": item.tone, disabled: !isEnabled(item), tabIndex: -1, onClick: () => choose(item, depth), children: [item.icon && _jsx16(Icon, { name: item.icon }), path && item.preview && _jsx16(MenuPreview, { children: item.preview }), _jsx16("span", { className: "vx-menu-label", children: item.label }), item.checked && _jsx16(Icon, { name: "check" }), item.items?.length ? _jsx16(Icon, { name: "chevron-right" }) : null] }, item.id)) }, depth));
1048
+ return _jsxs12("div", { className: "vx-action-menu", onBlur: (event2) => {
1076
1049
  if (!event2.currentTarget.contains(event2.relatedTarget) && !(floating && popup.current?.contains(event2.relatedTarget)) && ![...children.current.values()].some((panel) => panel.contains(event2.relatedTarget)))
1077
1050
  setPath(null);
1078
- }, 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] });
1051
+ }, children: [triggerIcon ? _jsx16(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 }) : _jsx16(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] });
1079
1052
  }
1080
1053
 
1081
1054
  // packages/ui-system/dist/filter-menu.js
1082
- import { jsx as _jsx18, jsxs as _jsxs14, Fragment as _Fragment5 } from "react/jsx-runtime";
1083
- import { useId as useId5, useRef as useRef9, useState as useState10, useLayoutEffect as useLayoutEffect7 } from "react";
1055
+ import { jsx as _jsx17, jsxs as _jsxs13, Fragment as _Fragment5 } from "react/jsx-runtime";
1056
+ import { useId as useId5, useRef as useRef8, useState as useState9, useLayoutEffect as useLayoutEffect7 } from "react";
1084
1057
  function FilterMenu({ label, groups, value, onValueChange, leadingIcon = "filter" }) {
1085
1058
  const id = useId5();
1086
- const popup = useRef9(null);
1087
- const [expanded, setExpanded] = useState10(false);
1088
- const list = useRef9(null);
1089
- const [moreBelow, setMoreBelow] = useState10(false);
1059
+ const popup = useRef8(null);
1060
+ const [expanded, setExpanded] = useState9(false);
1061
+ const list = useRef8(null);
1062
+ const [moreBelow, setMoreBelow] = useState9(false);
1090
1063
  useLayoutEffect7(() => {
1091
1064
  const el = list.current;
1092
1065
  if (!el || !expanded)
@@ -1115,29 +1088,29 @@ function FilterMenu({ label, groups, value, onValueChange, leadingIcon = "filter
1115
1088
  function focusFirstGroup() {
1116
1089
  popup.current?.querySelector("summary")?.focus({ preventScroll: true });
1117
1090
  }
1118
- return _jsxs14(_Fragment5, { 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 }), _jsxs14("div", { ref: popup, id, className: "vx-filter-menu", popover: "auto", role: "dialog", "aria-label": label, onToggle: (event2) => {
1091
+ return _jsxs13(_Fragment5, { children: [_jsx17(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 }), _jsxs13("div", { ref: popup, id, className: "vx-filter-menu", popover: "auto", role: "dialog", "aria-label": label, onToggle: (event2) => {
1119
1092
  const open = event2.currentTarget.matches(":popover-open");
1120
1093
  setExpanded(open);
1121
1094
  if (open)
1122
1095
  focusFirstGroup();
1123
- }, 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 }) => _jsxs14("details", { open: !initiallyCollapsed, children: [_jsxs14("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({
1096
+ }, children: [_jsx17("div", { className: "vx-filter-scroll", "data-more-below": moreBelow || void 0, children: _jsx17("div", { className: "vx-filter-groups", ref: list, children: sections.map(({ id: groupId, label: label2, options, optionLabels, selected, initiallyCollapsed }) => _jsxs13("details", { open: !initiallyCollapsed, children: [_jsxs13("summary", { children: [label2, _jsx17(Icon, { name: "chevron-down", size: 16 })] }), _jsx17("div", { className: "vx-filter-options", role: "group", "aria-label": label2, children: options.map(([option, optionLabel]) => _jsx17(Checkbox, { label: optionLabels?.[option] ?? optionLabel, checked: selected.includes(option), onCheckedChange: (checked) => onValueChange({
1124
1097
  ...value,
1125
1098
  [groupId]: checked ? [...selected, option] : selected.filter((item) => item !== option)
1126
- }) }, option)) })] }, groupId)) }) }), _jsx18("footer", { children: _jsx18(Button, { label: "Clear Filters", variant: "text-tonal-sm", disabled: !count, onClick: () => {
1099
+ }) }, option)) })] }, groupId)) }) }), _jsx17("footer", { children: _jsx17(Button, { label: "Clear Filters", variant: "text-tonal-sm", disabled: !count, onClick: () => {
1127
1100
  onValueChange({});
1128
1101
  focusFirstGroup();
1129
1102
  } }) })] })] });
1130
1103
  }
1131
1104
 
1132
1105
  // packages/ui-system/dist/media.js
1133
- import { jsx as _jsx19, Fragment as _Fragment6, jsxs as _jsxs15 } from "react/jsx-runtime";
1134
- import { useRef as useRef10, useState as useState11 } from "react";
1106
+ import { jsx as _jsx18, Fragment as _Fragment6, jsxs as _jsxs14 } from "react/jsx-runtime";
1107
+ import { useRef as useRef9, useState as useState10 } from "react";
1135
1108
  function MediaBadges({ label, duration: duration3, labelVariant }) {
1136
- return _jsxs15(_Fragment6, { children: [" ", label && _jsx19("span", { className: labelVariant === "selected" ? "vx-media-selected" : "vx-media-label", children: _jsx19(Tag, { variant: labelVariant, children: label }) }), duration3 && _jsx19("span", { className: "vx-media-duration", children: _jsx19(Tag, { children: duration3 }) })] });
1109
+ return _jsxs14(_Fragment6, { children: [" ", label && _jsx18("span", { className: labelVariant === "selected" ? "vx-media-selected" : "vx-media-label", children: _jsx18(Tag, { variant: labelVariant, children: label }) }), duration3 && _jsx18("span", { className: "vx-media-duration", children: _jsx18(Tag, { children: duration3 }) })] });
1137
1110
  }
1138
1111
  function Media({ src, videoSrc, preferVideo = false, emptyLabel, script, alt, ratio = "16:9", state = "default", fit = "cover", emptyAppearance = "black", crop, label, labelVariant, duration: duration3, selectedLabel, selectionStyle = "outline", onSelect, onOpen }) {
1139
- const [failedImage, setFailedImage] = useState11();
1140
- const [failedVideo, setFailedVideo] = useState11();
1112
+ const [failedImage, setFailedImage] = useState10();
1113
+ const [failedVideo, setFailedVideo] = useState10();
1141
1114
  const video = videoSrc !== failedVideo ? videoSrc : void 0;
1142
1115
  const image = src !== failedImage && !(preferVideo && video) ? src : void 0;
1143
1116
  const selected = state === "selected";
@@ -1151,7 +1124,7 @@ function Media({ src, videoSrc, preferVideo = false, emptyLabel, script, alt, ra
1151
1124
  transform: `rotate(${crop.rotation ?? 0}deg)`,
1152
1125
  objectFit: "fill"
1153
1126
  } : { objectFit: fit };
1154
- const content = _jsxs15(_Fragment6, { 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: duration3 }), 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" })] });
1127
+ const content = _jsxs14(_Fragment6, { children: [script ? _jsx18(ScriptCover, { ...script }) : image ? _jsx18("img", { src: image, alt, style: imageStyle, onError: () => setFailedImage(image) }, image) : video ? _jsx18("video", { src: video, preload: "metadata", muted: true, playsInline: true, "aria-hidden": "true", style: { objectFit: fit }, onError: () => setFailedVideo(video) }, video) : emptyAppearance !== "black" && emptyAppearance !== "surface" ? _jsx18(Icon, { name: `placeholder-${emptyAppearance}`, size: 20 }) : emptyLabel && !busy ? _jsx18("span", { className: "vx-media-empty-label", children: emptyLabel }) : null, _jsx18(MediaBadges, { label, labelVariant, duration: duration3 }), selected && selectedLabel && _jsx18("span", { className: "vx-media-selected", children: _jsx18(Tag, { variant: "selected", children: "Selected" }) }), selectionStyle === "checkbox" && _jsx18("span", { className: "vx-media-marker", "aria-hidden": "true", children: selected && _jsx18(Icon, { name: "check", size: 12 }) }), busy && _jsx18("span", { className: "vx-media-progress", role: "status", children: state === "loading" ? "Loading" : "Generating" })] });
1155
1128
  const props = {
1156
1129
  className: "vx-media",
1157
1130
  "data-state": state,
@@ -1160,15 +1133,15 @@ function Media({ src, videoSrc, preferVideo = false, emptyLabel, script, alt, ra
1160
1133
  "aria-busy": busy || void 0,
1161
1134
  style: { aspectRatio: ratio.replace(":", " / ") }
1162
1135
  };
1163
- return onSelect || onOpen ? _jsx19("button", { ...props, type: "button", "aria-label": alt, "aria-pressed": onSelect ? selected : void 0, disabled: busy, onClick: () => onSelect ? onSelect(!selected) : onOpen?.(), children: content }) : _jsx19("div", { ...props, "aria-label": image ? void 0 : alt, children: content });
1136
+ return onSelect || onOpen ? _jsx18("button", { ...props, type: "button", "aria-label": alt, "aria-pressed": onSelect ? selected : void 0, disabled: busy, onClick: () => onSelect ? onSelect(!selected) : onOpen?.(), children: content }) : _jsx18("div", { ...props, "aria-label": image ? void 0 : alt, children: content });
1164
1137
  }
1165
1138
 
1166
1139
  // packages/ui-system/dist/audio-preview.js
1167
- import { jsx as _jsx20, jsxs as _jsxs16 } from "react/jsx-runtime";
1168
- import { useEffect as useEffect5, useRef as useRef11, useState as useState12 } from "react";
1140
+ import { jsx as _jsx19, jsxs as _jsxs15 } from "react/jsx-runtime";
1141
+ import { useEffect as useEffect5, useRef as useRef10, useState as useState11 } from "react";
1169
1142
  function AudioClip({ title, src, duration: duration3, disabled, playing: previewPlaying = false, quote, quoteContent, onPlayChange, onError, variant = "audio" }) {
1170
- const audio = useRef11(null);
1171
- const [nativePlaying, setPlaying] = useState12(false);
1143
+ const audio = useRef10(null);
1144
+ const [nativePlaying, setPlaying] = useState11(false);
1172
1145
  const playing = src ? nativePlaying : previewPlaying;
1173
1146
  useEffect5(() => {
1174
1147
  if (disabled)
@@ -1190,7 +1163,7 @@ function AudioClip({ title, src, duration: duration3, disabled, playing: preview
1190
1163
  setPlaying(next);
1191
1164
  onPlayChange?.(next);
1192
1165
  }
1193
- return _jsxs16("div", { className: "vx-audio-preview", "data-variant": variant, role: "group", "aria-label": title, children: [src && _jsx20(IconButton, { icon: playing ? "pause" : "play", variant: variant === "voice" ? "icon-circle-sm" : "icon-ghost-sm", label: `${playing ? "Pause" : "Play"} ${title}`, disabled, "aria-pressed": playing, onClick: () => {
1166
+ return _jsxs15("div", { className: "vx-audio-preview", "data-variant": variant, role: "group", "aria-label": title, children: [src && _jsx19(IconButton, { icon: playing ? "pause" : "play", variant: variant === "voice" ? "icon-circle-sm" : "icon-ghost-sm", label: `${playing ? "Pause" : "Play"} ${title}`, disabled, "aria-pressed": playing, onClick: () => {
1194
1167
  const player = audio.current;
1195
1168
  if (!player)
1196
1169
  return;
@@ -1198,30 +1171,30 @@ function AudioClip({ title, src, duration: duration3, disabled, playing: preview
1198
1171
  void player.play().catch((error) => onError?.(error));
1199
1172
  else
1200
1173
  player.pause();
1201
- } }), _jsxs16("div", { children: [_jsx20("span", { children: title }), quoteContent ?? (quote && _jsx20("p", { children: quote }))] }), duration3 && _jsx20("span", { children: duration3 }), src && _jsx20("audio", { ref: audio, src, preload: "none", onPlay: () => change(true), onPause: () => change(false), onEnded: () => change(false), onError: (event2) => onError?.(event2.currentTarget.error) })] });
1174
+ } }), _jsxs15("div", { children: [_jsx19("span", { children: title }), quoteContent ?? (quote && _jsx19("p", { children: quote }))] }), duration3 && _jsx19("span", { children: duration3 }), src && _jsx19("audio", { ref: audio, src, preload: "none", onPlay: () => change(true), onPause: () => change(false), onEnded: () => change(false), onError: (event2) => onError?.(event2.currentTarget.error) })] });
1202
1175
  }
1203
1176
  function VoicePreview(props) {
1204
- return _jsx20(AudioClip, { ...props, variant: "voice" }, props.src);
1177
+ return _jsx19(AudioClip, { ...props, variant: "voice" }, props.src);
1205
1178
  }
1206
1179
 
1207
1180
  // packages/ui-system/dist/video-player.js
1208
- import { jsx as _jsx21, jsxs as _jsxs17, Fragment as _Fragment7 } from "react/jsx-runtime";
1209
- import { useEffect as useEffect6, useRef as useRef12, useState as useState13 } from "react";
1181
+ import { jsx as _jsx20, jsxs as _jsxs16, Fragment as _Fragment7 } from "react/jsx-runtime";
1182
+ import { useEffect as useEffect6, useRef as useRef11, useState as useState12 } from "react";
1210
1183
  function timeLabel(seconds2, padMinutes = false) {
1211
1184
  const whole = Math.floor(seconds2);
1212
1185
  const minutes = String(Math.floor(whole / 60));
1213
1186
  return `${padMinutes ? minutes.padStart(2, "0") : minutes}:${String(whole % 60).padStart(2, "0")}`;
1214
1187
  }
1215
1188
  function PlaybackControls({ playing, muted, time, duration: duration3, size = "medium", disabled, onTogglePlay, onToggleMute, onSeek, onFullscreen, fullscreenLabel = "Toggle fullscreen", actions, appearance = "on-content", timeDisplay = "combined", renderTimeline }) {
1216
- const slider = _jsx21("input", { className: "vx-playback-range", "aria-label": "Playback position", "aria-valuetext": `${timeLabel(time)} of ${timeLabel(duration3)}`, type: "range", min: 0, max: duration3, value: time, step: "any", disabled: disabled || !duration3, onChange: (event2) => onSeek(event2.currentTarget.valueAsNumber) });
1217
- return _jsxs17("div", { className: "vx-playback-controls", role: "group", "aria-label": "Playback controls", "data-size": size, "data-appearance": appearance, style: {
1189
+ const slider = _jsx20("input", { className: "vx-playback-range", "aria-label": "Playback position", "aria-valuetext": `${timeLabel(time)} of ${timeLabel(duration3)}`, type: "range", min: 0, max: duration3, value: time, step: "any", disabled: disabled || !duration3, onChange: (event2) => onSeek(event2.currentTarget.valueAsNumber) });
1190
+ return _jsxs16("div", { className: "vx-playback-controls", role: "group", "aria-label": "Playback controls", "data-size": size, "data-appearance": appearance, style: {
1218
1191
  "--vx-playback-fraction": duration3 > 0 ? Math.min(1, Math.max(0, time / duration3)) : 0
1219
- }, children: [_jsx21(IconButton, { icon: playing ? size === "large" ? "pause-large" : "pause" : size === "large" ? "playback-play-large" : "playback-play", label: playing ? "Pause" : "Play", disabled, onClick: onTogglePlay }), timeDisplay === "split" && _jsx21("span", { "aria-hidden": "true", "data-time": "elapsed", children: timeLabel(time, true) }), renderTimeline ? renderTimeline(slider) : slider, _jsx21("span", { "aria-hidden": "true", "data-time": timeDisplay === "split" ? "duration" : void 0, children: timeDisplay === "split" ? timeLabel(duration3, true) : `${timeLabel(time)} / ${timeLabel(duration3)}` }), _jsx21(IconButton, { icon: muted ? size === "large" ? "mute-large" : "mute" : size === "large" ? "volume-large" : "volume", label: muted ? "Unmute" : "Mute", disabled, onClick: onToggleMute }), actions, onFullscreen && _jsx21(IconButton, { icon: size === "large" ? "fullscreen-large" : "fullscreen", label: fullscreenLabel, onClick: onFullscreen })] });
1192
+ }, 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(duration3, true) : `${timeLabel(time)} / ${timeLabel(duration3)}` }), _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 })] });
1220
1193
  }
1221
1194
 
1222
1195
  // packages/ui-system/dist/workspace-theme.js
1223
- import { jsx as _jsx22, jsxs as _jsxs18 } from "react/jsx-runtime";
1224
- import { useEffect as useEffect7, useState as useState14 } from "react";
1196
+ import { jsx as _jsx21, jsxs as _jsxs17 } from "react/jsx-runtime";
1197
+ import { useEffect as useEffect7, useState as useState13 } from "react";
1225
1198
  var key = "vivix.studio.theme";
1226
1199
  var event = "vivix-studio-theme";
1227
1200
  function readPreference() {
@@ -1234,8 +1207,8 @@ function readPreference() {
1234
1207
  return "light";
1235
1208
  }
1236
1209
  function useWorkspaceTheme() {
1237
- const [preference, setPreference] = useState14(readPreference);
1238
- const [system, setSystem] = useState14(() => globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light");
1210
+ const [preference, setPreference] = useState13(readPreference);
1211
+ const [system, setSystem] = useState13(() => globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light");
1239
1212
  useEffect7(() => {
1240
1213
  const query = globalThis.matchMedia?.("(prefers-color-scheme: dark)");
1241
1214
  const synchronize = () => setPreference(readPreference());
@@ -1266,10 +1239,10 @@ function formatDurationSeconds(durationMs) {
1266
1239
  }
1267
1240
 
1268
1241
  // packages/ui-system/dist/view-skeleton.js
1269
- import { jsx as _jsx23, Fragment as _Fragment8, jsxs as _jsxs19 } from "react/jsx-runtime";
1242
+ import { jsx as _jsx22, Fragment as _Fragment8, jsxs as _jsxs18 } from "react/jsx-runtime";
1270
1243
  function ViewSkeleton({ layout = "list", label = "Loading project", heading = true }) {
1271
1244
  const count = { list: 5, grid: 8, document: 1, preview: 1, compare: 2 }[layout];
1272
- return _jsxs19("section", { className: "vx-view-skeleton", "data-layout": layout, role: "status", "aria-label": label, "aria-busy": "true", children: [heading && _jsx23("div", { className: "vx-skeleton-heading", "aria-hidden": "true" }), _jsx23("div", { className: "vx-skeleton-content", "aria-hidden": "true", children: Array.from({ length: count }, (_, index) => _jsxs19("div", { className: "vx-skeleton-item", children: [layout !== "document" && _jsx23("div", { className: "vx-skeleton-media" }), _jsxs19("div", { className: "vx-skeleton-copy", children: [_jsx23("span", {}), _jsx23("span", {}), layout === "document" && _jsxs19(_Fragment8, { children: [_jsx23("span", {}), _jsx23("span", {}), _jsx23("span", {})] })] })] }, index)) })] });
1245
+ return _jsxs18("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) => _jsxs18("div", { className: "vx-skeleton-item", children: [layout !== "document" && _jsx22("div", { className: "vx-skeleton-media" }), _jsxs18("div", { className: "vx-skeleton-copy", children: [_jsx22("span", {}), _jsx22("span", {}), layout === "document" && _jsxs18(_Fragment8, { children: [_jsx22("span", {}), _jsx22("span", {}), _jsx22("span", {})] })] })] }, index)) })] });
1273
1246
  }
1274
1247
 
1275
1248
  // packages/ads-workbench/src/client.tsx
@@ -1792,13 +1765,13 @@ function AdPlayer({
1792
1765
 
1793
1766
  // packages/ads-workbench/src/ad-export-preview.tsx
1794
1767
  import * as React3 from "react";
1795
- import { useState as useState17 } from "react";
1768
+ import { useState as useState16 } from "react";
1796
1769
  function AdExportPreview({
1797
1770
  sequence,
1798
1771
  poster
1799
1772
  }) {
1800
- const [clip, setClip] = useState17(null);
1801
- const [error, setError] = useState17("");
1773
+ const [clip, setClip] = useState16(null);
1774
+ const [error, setError] = useState16("");
1802
1775
  return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
1803
1776
  AdPlayer,
1804
1777
  {
@@ -2308,7 +2281,6 @@ function AssetCard({
2308
2281
  );
2309
2282
  }
2310
2283
  function AdProjectAssets(props) {
2311
- const [query, setQuery] = React7.useState("");
2312
2284
  const { tab, onTabChange } = props;
2313
2285
  const [filters, setFilters] = React7.useState({});
2314
2286
  const [selecting, setSelecting] = React7.useState(false);
@@ -2389,7 +2361,7 @@ function AdProjectAssets(props) {
2389
2361
  props.favoriteRefs.has(selectedVersion(a)?.versionId) ? "Favorited" : "Not favorited"
2390
2362
  ) && matches("version", a.data.adoptedVersionId ? "Adopted" : "Not adopted") && (tab === "All" || (tab === "Videos" ? a.data.kind === "video" : String(a.metadata?.subjectType ?? "").toLowerCase() === (tab === "Models" ? "model" : "product") || a.data.tags?.includes(tab === "Models" ? "model" : "product") || props.references?.[tab === "Models" ? "modelRefs" : "productRefs"]?.some(
2391
2363
  (ref) => ref.objectId === a.objectId
2392
- ))) && a.data.name.toLowerCase().includes(query.toLowerCase())
2364
+ )))
2393
2365
  ).sort(
2394
2366
  (a, b) => (refOrder.get(a.objectId) ?? Infinity) - (refOrder.get(b.objectId) ?? Infinity) || (a.data.orderKey ?? Infinity) - (b.data.orderKey ?? Infinity)
2395
2367
  );
@@ -2399,6 +2371,7 @@ function AdProjectAssets(props) {
2399
2371
  "div",
2400
2372
  {
2401
2373
  className: "ad-library",
2374
+ "data-empty": !items.length || void 0,
2402
2375
  onKeyDown: (event2) => {
2403
2376
  if (selecting && !busy && !deleteOpen && event2.key === "Escape") {
2404
2377
  event2.preventDefault();
@@ -2444,7 +2417,7 @@ function AdProjectAssets(props) {
2444
2417
  cancelRef: cancelSelection,
2445
2418
  onCancel: finishSelection
2446
2419
  }
2447
- ) : /* @__PURE__ */ React7.createElement("div", { className: "vx-asset-library-controls" }, /* @__PURE__ */ React7.createElement("div", { className: "ad-asset-search" }, /* @__PURE__ */ React7.createElement(SearchInput, { label: "Search project assets", value: query, onValueChange: setQuery })), /* @__PURE__ */ React7.createElement(
2420
+ ) : /* @__PURE__ */ React7.createElement("div", { className: "vx-asset-library-controls" }, /* @__PURE__ */ React7.createElement(
2448
2421
  Button,
2449
2422
  {
2450
2423
  ref: selectButton,
@@ -2520,7 +2493,7 @@ function AdProjectAssets(props) {
2520
2493
  }
2521
2494
  }
2522
2495
  )),
2523
- grid ? /* @__PURE__ */ React7.createElement("div", { className: "ad-project-assets vx-asset-grid" }, items.map((asset) => /* @__PURE__ */ React7.createElement(
2496
+ !items.length ? null : grid ? /* @__PURE__ */ React7.createElement("div", { className: "ad-project-assets vx-asset-grid" }, items.map((asset) => /* @__PURE__ */ React7.createElement(
2524
2497
  AssetCard,
2525
2498
  {
2526
2499
  ...props,
@@ -2891,7 +2864,7 @@ var adsCss = `
2891
2864
 
2892
2865
  .ad-story-title{display:flex;align-items:baseline;justify-content:space-between;gap:16px}.ad-story-title>.vx-inline-text{margin:0;color:var(--vx-text-primary,#171512);font-size:14px;font-weight:600;flex:1}.ad-story-title>span,.ad-story-copy .ad-voice-hint{font-size:12px;color:var(--vx-text-secondary-readable)}.ad-story-copy .ad-voice-hint{margin-top:6px}.ad-story-copy{gap:12px}.ad-script-field{display:grid;grid-template-columns:105px minmax(0,1fr);align-items:start;gap:8px;line-height:24px}.ad-script-field>span{font-size:14px;font-weight:600}.ad-script-field>.vx-inline-text{padding:2px 5px;line-height:20px}.ad-story-copy .ad-actions{margin-top:8px}
2893
2866
 
2894
- body:has(.ads-workbench){margin:0}.ads-workbench{--ad-bg:var(--vx-background-page,#f8f6f4);display:flex;height:100dvh;min-height:100vh;overflow:hidden;background:var(--ad-bg);color:var(--vx-text-primary,#171512);font:14px 'Vivix Studio Inter',Inter,system-ui,sans-serif;box-sizing:border-box}.ads-workbench *{box-sizing:border-box}.ads-workbench button,.ads-workbench input,.ads-workbench textarea{font:inherit}.ads-workbench button{cursor:pointer}.ads-workbench button:disabled{cursor:default}.ads-workbench h1,.ads-workbench h2,.ads-workbench h3,.ads-workbench p{margin:0}.ads-workbench h1{font-size:18px}.ads-workbench h2{font-size:16px;font-weight:600}.ads-workbench h3{font-size:14px;color:var(--vx-text-secondary-readable);font-weight:400;margin:22px 0 10px}.ad-sidebar{width:240px;flex:0 0 240px;padding:16px 12px;border-right:1px solid var(--vx-border-secondary);display:flex;flex-direction:column;min-height:100vh;gap:18px}.ad-brand{font-size:19px;font-weight:900;color:inherit;text-decoration:none;padding:0 4px}.ad-sidebar nav{display:flex;flex-direction:column;gap:3px}.ad-sidebar nav a,.ad-sidebar button{display:flex;align-items:center;gap:10px;text-align:left;padding:8px 12px;color:inherit;border:0;border-radius:8px;background:transparent;text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ad-sidebar .active{background:var(--vx-surface-input)}.ad-sidebar-label,.ad-sub{font-size:13px;color:var(--vx-text-secondary-readable)}.ad-project-nav{border-left:1px solid var(--vx-border-secondary);margin-left:15px;padding-left:8px}.ad-sidebar .ad-project-nav button{color:var(--vx-text-secondary-readable)}.ad-sidebar .ad-project-nav .active{color:var(--vx-text-primary)}.ad-local-user{margin-top:auto;padding:10px 4px}.ad-main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;scrollbar-gutter: stable;overflow:scroll auto;padding:0 8px 8px}.ad-topbar{height:56px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 8px 8px 16px}.ad-breadcrumb{display:flex;align-items:center;font-size:18px;font-weight:600;min-width:0}.ad-breadcrumb button{border:0;background:transparent;color:inherit;font-weight:600;text-align:left}.ad-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ad-panel{background:var(--vx-background-dialog);border-radius:16px;overflow:hidden}.ad-film-layout{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:8px}.ad-film-center{min-width:0;min-height:0;display:flex;flex-direction:column;gap:8px}.ad-player{background:#000;border-radius:14px;overflow:hidden;position:relative;min-width:0}.ad-screen{height:calc(100vh - 290px);min-height:300px;max-height:680px;display:flex;justify-content:center;align-items:center;background:#000}.ad-crop-window{height:100%;max-width:100%;position:relative;overflow:hidden}.ad-empty-video{min-height:220px;color:#bcb5ae;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;padding:24px;background:#151412}.ad-film-center>.ad-player{flex:1;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto}.ad-film-center>.ad-player>.ad-screen{height:auto;min-height:0;max-height:none}.ad-timeline,.ad-basic-edit{flex-shrink:0}.ad-detail-panel,.ad-candidate-panel{padding:14px 16px;min-width:0;min-height:0;scrollbar-gutter: stable;overflow:scroll auto}.ad-candidates{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px;max-height:calc(100vh - 240px);scrollbar-gutter: stable;overflow:scroll auto}.ad-candidate{border:2px solid transparent;border-radius:10px;overflow:hidden;min-width:0}.ad-candidate.selected{border-color:#32b477}.ad-candidate-preview{width:100%;padding:0;border:0;display:block;background:var(--vx-cover-background);position:relative;min-height:120px}.ad-candidate video{width:100%;max-height:245px;display:block;object-fit:contain}.ad-candidate-label{position:absolute;bottom:5px;left:5px;background:#0008;color:white;border-radius:4px;padding:3px 5px;font-size:11px}.ad-candidate-actions{display:flex;flex-direction:column;gap:8px;margin-top:16px}.ad-timeline-items{display:flex;gap:8px;scrollbar-gutter: stable;overflow:scroll auto;padding:16px}.ad-timeline-items>button{position:relative;display:flex;flex-direction:column;gap:8px;min-width:150px;max-width:185px;min-height:116px;padding:12px;text-align:left;background:var(--vx-surface-input);border:2px solid transparent;border-radius:10px}.ad-timeline-items>button.selected{border-color:#32b477}.ad-scene-number,.ad-timeline-empty{font-size:12px;color:var(--vx-text-secondary-readable)}.ad-timeline-edit{margin-top:auto;text-decoration:underline}.ad-timeline-footer{display:flex;justify-content:space-between;border-top:1px solid var(--vx-border-secondary);padding:12px 16px;color:var(--vx-text-secondary-readable);font-size:12px}.ad-timeline-footer button{border:0;background:none;color:var(--vx-state-success)}.ad-scene-layout{flex:1;min-height:0;display:grid;grid-template-columns:280px minmax(0,1fr) 300px;gap:8px}.ad-scene-layout .ad-screen{height:calc(100vh - 210px)}.ad-scene-layout .ad-candidates{grid-template-columns:1fr}.ad-basic-edit{padding:16px}.ad-basic-edit .ad-actions{margin:12px 0}.ad-detail-panel>p{line-height:1.5}.ad-section-heading{padding:16px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--vx-border-secondary)}.ad-story-row{display:grid;grid-template-columns:minmax(220px,40%) minmax(0,1fr);gap:24px;padding:12px 16px;border-bottom:1px solid var(--vx-border-secondary);align-items:start}.ad-story-media video{width:100%;max-height:220px;background:#000;border-radius:12px}.ad-story-copy{display:flex;flex-direction:column;gap:3px;min-width:0}.ad-story-copy label{display:grid;grid-template-columns:105px minmax(0,1fr);align-items:start;font-size:13px;font-weight:600;line-height:24px;gap:8px;margin:0}.ad-story-copy textarea{resize:vertical;min-height:24px;border:1px solid transparent;padding:2px 5px;border-radius:5px;width:100%;font-weight:400;line-height:18px;background:transparent}.ad-story-copy textarea:hover,.ad-story-copy textarea:focus{border-color:var(--vx-border-secondary);background:var(--vx-surface-input)}.ad-story-copy input{max-width:150px;height:26px;padding:2px 6px;border:1px solid var(--vx-border-secondary);border-radius:5px}.ad-story-copy .ad-actions{gap:4px;margin-top:3px}.ad-story-copy .ad-actions .vx-button{font-size:12px}.ad-empty{text-align:center;padding:70px 24px;display:flex;flex-direction:column;gap:16px;align-items:center;color:var(--vx-text-secondary-readable)}.ad-alert,.ad-notice,.ad-duration-warning{display:flex;align-items:center;gap:10px;padding:10px 16px;margin:0 0 8px;border-radius:8px;font-size:13px;white-space:pre-wrap}.ad-alert{background:light-dark(#fff0ed,#371e19);color:light-dark(#9c2c20,#ffb3aa)}.ad-alert>span{flex:1}.ad-alert button,.ad-notice>button{border:0;background:none;color:inherit;text-decoration:underline}.ad-notice{background:color-mix(in srgb,var(--vx-state-success) 12%,var(--vx-background-dialog));color:var(--vx-text-primary)}.ad-duration-warning{background:light-dark(#fff6df,#352b18);color:light-dark(#806015,#f4cc79)}.ad-assets{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;padding:16px}.ad-assets article{border:1px solid var(--vx-border-secondary);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:8px}.ad-form{display:grid;grid-template-columns:1fr 1fr;gap:16px}.ad-form>label{display:flex;flex-direction:column;gap:5px}.ad-form textarea,.ad-form input{border:1px solid var(--vx-border-secondary);border-radius:6px;padding:9px;width:100%;background:var(--vx-background-dialog);color:inherit}.ad-reference-options{display:flex;flex-direction:column;gap:8px}.ad-reference-options label{display:flex;gap:8px}.ad-reference-options input{width:auto}.ad-prompt{width:100%;min-height:300px;font:inherit}.ad-dialog-preview video,.ad-dialog-preview img{max-width:100%;max-height:65vh;display:block;margin:auto}.ad-compare{min-height:calc(100vh - 70px)}.ads-workbench .vx-dialog.ad-dialog{max-width:900px;width:calc(100vw - 48px)}
2867
+ body:has(.ads-workbench){margin:0}.ads-workbench{--ad-bg:var(--vx-background-page,#f8f6f4);display:flex;height:100dvh;min-height:100vh;overflow:hidden;background:var(--ad-bg);color:var(--vx-text-primary,#171512);font:14px 'Vivix Studio Inter',Inter,system-ui,sans-serif;box-sizing:border-box}.ads-workbench *{box-sizing:border-box}.ads-workbench button,.ads-workbench input,.ads-workbench textarea{font:inherit}.ads-workbench button{cursor:pointer}.ads-workbench button:disabled{cursor:default}.ads-workbench h1,.ads-workbench h2,.ads-workbench h3,.ads-workbench p{margin:0}.ads-workbench h1{font-size:18px}.ads-workbench h2{font-size:16px;font-weight:600}.ads-workbench h3{font-size:14px;color:var(--vx-text-secondary-readable);font-weight:400;margin:22px 0 10px}.ad-sidebar{width:240px;flex:0 0 240px;padding:16px 12px;border-right:1px solid var(--vx-border-secondary);display:flex;flex-direction:column;min-height:100vh;gap:18px}.ad-brand{font-size:19px;font-weight:900;color:inherit;text-decoration:none;padding:0 4px}.ad-sidebar nav{display:flex;flex-direction:column;gap:3px}.ad-sidebar nav a,.ad-sidebar button{display:flex;align-items:center;gap:10px;text-align:left;padding:8px 12px;color:inherit;border:0;border-radius:8px;background:transparent;text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ad-sidebar .active{background:var(--vx-surface-input)}.ad-sidebar-label,.ad-sub{font-size:13px;color:var(--vx-text-secondary-readable)}.ad-project-nav{border-left:1px solid var(--vx-border-secondary);margin-left:15px;padding-left:8px}.ad-sidebar .ad-project-nav button{color:var(--vx-text-secondary-readable)}.ad-sidebar .ad-project-nav .active{color:var(--vx-text-primary)}.ad-local-user{margin-top:auto;padding:10px 4px}.ad-main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;scrollbar-gutter: stable;overflow:scroll auto;padding:0 8px 8px}.ad-topbar{height:56px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 8px 8px 16px}.ad-breadcrumb{display:flex;align-items:center;font-size:18px;font-weight:600;min-width:0}.ad-breadcrumb button{border:0;background:transparent;color:inherit;font-weight:600;text-align:left}.ad-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ad-panel{background:var(--vx-background-dialog);border-radius:16px;overflow:hidden}.ad-film-layout{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:8px}.ad-film-center{min-width:0;min-height:0;display:flex;flex-direction:column;gap:8px}.ad-player{background:#000;border-radius:14px;overflow:hidden;position:relative;min-width:0}.ad-screen{height:calc(100vh - 290px);min-height:300px;max-height:680px;display:flex;justify-content:center;align-items:center;background:#000}.ad-crop-window{height:100%;max-width:100%;position:relative;overflow:hidden}.ad-empty-video{min-height:220px;color:#bcb5ae;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;padding:24px}.ad-film-center>.ad-player{flex:1;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto}.ad-film-center>.ad-player>.ad-screen{height:auto;min-height:0;max-height:none}.ad-timeline,.ad-basic-edit{flex-shrink:0}.ad-detail-panel,.ad-candidate-panel{padding:14px 16px;min-width:0;min-height:0;scrollbar-gutter: stable;overflow:scroll auto}.ad-candidates{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px;max-height:calc(100vh - 240px);scrollbar-gutter: stable;overflow:scroll auto}.ad-candidate{border:2px solid transparent;border-radius:10px;overflow:hidden;min-width:0}.ad-candidate.selected{border-color:#32b477}.ad-candidate-preview{width:100%;padding:0;border:0;display:block;background:var(--vx-cover-background);position:relative;min-height:120px}.ad-candidate video{width:100%;max-height:245px;display:block;object-fit:contain}.ad-candidate-label{position:absolute;bottom:5px;left:5px;background:#0008;color:white;border-radius:4px;padding:3px 5px;font-size:11px}.ad-candidate-actions{display:flex;flex-direction:column;gap:8px;margin-top:16px}.ad-timeline-items{display:flex;gap:8px;scrollbar-gutter: stable;overflow:scroll auto;padding:16px}.ad-timeline-items>button{position:relative;display:flex;flex-direction:column;gap:8px;min-width:150px;max-width:185px;min-height:116px;padding:12px;text-align:left;background:var(--vx-surface-input);border:2px solid transparent;border-radius:10px}.ad-timeline-items>button.selected{border-color:#32b477}.ad-scene-number,.ad-timeline-empty{font-size:12px;color:var(--vx-text-secondary-readable)}.ad-timeline-edit{margin-top:auto;text-decoration:underline}.ad-timeline-footer{display:flex;justify-content:space-between;border-top:1px solid var(--vx-border-secondary);padding:12px 16px;color:var(--vx-text-secondary-readable);font-size:12px}.ad-timeline-footer button{border:0;background:none;color:var(--vx-state-success)}.ad-scene-layout{flex:1;min-height:0;display:grid;grid-template-columns:280px minmax(0,1fr) 300px;gap:8px}.ad-scene-layout .ad-screen{height:calc(100vh - 210px)}.ad-scene-layout .ad-candidates{grid-template-columns:1fr}.ad-basic-edit{padding:16px}.ad-basic-edit .ad-actions{margin:12px 0}.ad-detail-panel>p{line-height:1.5}.ad-section-heading{padding:16px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--vx-border-secondary)}.ad-story-row{display:grid;grid-template-columns:minmax(220px,40%) minmax(0,1fr);gap:24px;padding:12px 16px;border-bottom:1px solid var(--vx-border-secondary);align-items:start}.ad-story-media video{width:100%;max-height:220px;background:#000;border-radius:12px}.ad-story-copy{display:flex;flex-direction:column;gap:3px;min-width:0}.ad-story-copy label{display:grid;grid-template-columns:105px minmax(0,1fr);align-items:start;font-size:13px;font-weight:600;line-height:24px;gap:8px;margin:0}.ad-story-copy textarea{resize:vertical;min-height:24px;border:1px solid transparent;padding:2px 5px;border-radius:5px;width:100%;font-weight:400;line-height:18px;background:transparent}.ad-story-copy textarea:hover,.ad-story-copy textarea:focus{border-color:var(--vx-border-secondary);background:var(--vx-surface-input)}.ad-story-copy input{max-width:150px;height:26px;padding:2px 6px;border:1px solid var(--vx-border-secondary);border-radius:5px}.ad-story-copy .ad-actions{gap:4px;margin-top:3px}.ad-story-copy .ad-actions .vx-button{font-size:12px}.ad-empty{text-align:center;padding:70px 24px;display:flex;flex-direction:column;gap:16px;align-items:center;color:var(--vx-text-secondary-readable)}.ad-alert,.ad-notice,.ad-duration-warning{display:flex;align-items:center;gap:10px;padding:10px 16px;margin:0 0 8px;border-radius:8px;font-size:13px;white-space:pre-wrap}.ad-alert{background:light-dark(#fff0ed,#371e19);color:light-dark(#9c2c20,#ffb3aa)}.ad-alert>span{flex:1}.ad-alert button,.ad-notice>button{border:0;background:none;color:inherit;text-decoration:underline}.ad-notice{background:color-mix(in srgb,var(--vx-state-success) 12%,var(--vx-background-dialog));color:var(--vx-text-primary)}.ad-duration-warning{background:light-dark(#fff6df,#352b18);color:light-dark(#806015,#f4cc79)}.ad-assets{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;padding:16px}.ad-assets article{border:1px solid var(--vx-border-secondary);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:8px}.ad-form{display:grid;grid-template-columns:1fr 1fr;gap:16px}.ad-form>label{display:flex;flex-direction:column;gap:5px}.ad-form textarea,.ad-form input{border:1px solid var(--vx-border-secondary);border-radius:6px;padding:9px;width:100%;background:var(--vx-background-dialog);color:inherit}.ad-reference-options{display:flex;flex-direction:column;gap:8px}.ad-reference-options label{display:flex;gap:8px}.ad-reference-options input{width:auto}.ad-prompt{width:100%;min-height:300px;font:inherit}.ad-dialog-preview video,.ad-dialog-preview img{max-width:100%;max-height:65vh;display:block;margin:auto}.ad-compare{min-height:calc(100vh - 70px)}.ads-workbench .vx-dialog.ad-dialog{max-width:900px;width:calc(100vw - 48px)}
2895
2868
  .ad-brand-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.ad-nav-icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px;flex:none}.ad-nav-icon img{max-width:20px;max-height:20px}.ad-timeline-items>article{position:relative;min-width:144px;width:160px;border:2px solid transparent;border-radius:10px;overflow:hidden;background:var(--vx-surface-input);flex:none}.ad-timeline-items>article.selected{border-color:var(--vx-brand-primary,#32b477)}.ad-timeline-preview{height:90px;width:100%;border:0;padding:0;background:var(--vx-cover-background);display:block;position:relative}.ad-timeline-preview video{width:100%;height:100%;object-fit:cover}.ad-timeline-preview .ad-scene-number,.ad-thumb-duration{position:absolute;bottom:6px;background:#0009;border-radius:4px;color:white!important;padding:2px 4px}.ad-scene-number{left:6px}.ad-thumb-duration{right:6px}.ad-timeline-empty{color:#bdb5ad!important;font-size:12px}.ad-timeline-caption{display:flex;min-height:40px;gap:8px;align-items:center;justify-content:space-between;padding:8px}.ad-timeline-caption strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ad-timeline-caption button{border:0;background:transparent;color:var(--vx-text-secondary-readable);font-size:11px}.ad-candidate-preview{aspect-ratio:9/16}.ad-candidate-preview video{height:100%;max-height:none;object-fit:cover}
2896
2869
  .ad-story-media .ad-player{display:grid;grid-template-rows:minmax(0,1fr) auto;aspect-ratio:16/9}
2897
2870
  .ad-story-media .ad-screen{height:auto;min-height:0;max-height:none}
@@ -4111,6 +4084,7 @@ function AdsWorkbench({
4111
4084
  Button,
4112
4085
  {
4113
4086
  label: "Export",
4087
+ leadingIcon: "export",
4114
4088
  width: "hug",
4115
4089
  disabled: busy || !ad || !ExportDialog,
4116
4090
  onClick: (event2) => {
package/dist/client.css CHANGED
@@ -2621,6 +2621,14 @@ button.vx-tile-title {
2621
2621
  pointer-events: none;
2622
2622
  }
2623
2623
  @media (prefers-reduced-motion: no-preference) {
2624
+ .vx-dialog:modal,
2625
+ [role=dialog]:not(dialog, [popover], [hidden]),
2626
+ [role=dialog][popover]:popover-open {
2627
+ animation: vx-dialog-enter var(--vx-motion-duration-enter) var(--vx-motion-easing-enter);
2628
+ }
2629
+ .vx-dialog:modal::backdrop {
2630
+ animation: vx-backdrop-enter var(--vx-motion-duration-enter) var(--vx-motion-easing-enter);
2631
+ }
2624
2632
  .vx-toast:popover-open {
2625
2633
  animation: vx-toast-enter var(--vx-motion-duration-enter) var(--vx-motion-easing-enter);
2626
2634
  }
@@ -2649,6 +2657,26 @@ button.vx-tile-title {
2649
2657
  transform: translate(-50%, 0);
2650
2658
  }
2651
2659
  }
2660
+ @keyframes vx-dialog-enter {
2661
+ from {
2662
+ opacity: 0;
2663
+ translate: 0 8px;
2664
+ scale: 0.98;
2665
+ }
2666
+ to {
2667
+ opacity: 1;
2668
+ translate: 0 0;
2669
+ scale: 1;
2670
+ }
2671
+ }
2672
+ @keyframes vx-backdrop-enter {
2673
+ from {
2674
+ opacity: 0;
2675
+ }
2676
+ to {
2677
+ opacity: 1;
2678
+ }
2679
+ }
2652
2680
 
2653
2681
  /* packages/ui-system/dist/styles.css */
2654
2682
  @font-face {
@@ -3194,9 +3222,6 @@ button.vx-tile-title {
3194
3222
  .ad-asset-feedback[role=alert] {
3195
3223
  color: var(--vx-state-danger);
3196
3224
  }
3197
- .ad-library-bar .ad-asset-search {
3198
- width: min(100%, 180px);
3199
- }
3200
3225
  .ad-library .ad-asset-cover.vx-tile-preview {
3201
3226
  display: block;
3202
3227
  position: relative;
@@ -3928,6 +3953,25 @@ button.vx-tile-title {
3928
3953
  margin: 0;
3929
3954
  text-align: right;
3930
3955
  }
3956
+ .ads-workbench .ad-working-content > .ad-panel:has(.ad-library[data-empty]),
3957
+ .ads-workbench .ad-working-content > .ad-storyboard[data-empty] {
3958
+ overflow: auto;
3959
+ scrollbar-gutter: auto;
3960
+ }
3961
+ .ad-library[data-empty] > .ad-empty,
3962
+ .ads-workbench .ad-storyboard[data-empty] > .ad-empty {
3963
+ flex: 1;
3964
+ justify-content: center;
3965
+ padding: var(--vx-space-16);
3966
+ }
3967
+ .ads-workbench .ad-storyboard[data-empty] {
3968
+ display: flex;
3969
+ flex-direction: column;
3970
+ }
3971
+ .ad-library[data-empty] > .ad-library-bar,
3972
+ .ads-workbench .ad-storyboard[data-empty] > .ad-section-heading {
3973
+ flex-shrink: 0;
3974
+ }
3931
3975
 
3932
3976
  /* packages/ads-workbench/src/ad-video-layout.css */
3933
3977
  .ads-workbench .ad-screen {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vivix-labs/ads-workbench",
3
- "version": "1.0.0-beta.12",
3
+ "version": "1.0.0-beta.15",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
package/presets/ads.json CHANGED
@@ -7,7 +7,7 @@
7
7
  {
8
8
  "id": "api",
9
9
  "package": "@vivix-labs/vivix-api",
10
- "version": "1.0.0-beta.11",
10
+ "version": "1.0.0-beta.15",
11
11
  "enabled": true,
12
12
  "config": {},
13
13
  "requiredAccess": ["official.request"]
@@ -15,7 +15,7 @@
15
15
  {
16
16
  "id": "studio",
17
17
  "package": "@vivix-labs/project-studio",
18
- "version": "1.0.0-beta.11",
18
+ "version": "1.0.0-beta.15",
19
19
  "enabled": true,
20
20
  "config": {
21
21
  "role": "project",
@@ -30,7 +30,7 @@
30
30
  {
31
31
  "id": "library",
32
32
  "package": "@vivix-labs/material-library",
33
- "version": "1.0.0-beta.11",
33
+ "version": "1.0.0-beta.15",
34
34
  "enabled": true,
35
35
  "config": {
36
36
  "role": "client",
@@ -40,7 +40,7 @@
40
40
  {
41
41
  "id": "media",
42
42
  "package": "@vivix-labs/media-tools",
43
- "version": "1.0.0-beta.11",
43
+ "version": "1.0.0-beta.15",
44
44
  "enabled": true,
45
45
  "config": {
46
46
  "dataInstance": "user:data",
@@ -51,21 +51,21 @@
51
51
  {
52
52
  "id": "ads-compare",
53
53
  "package": "@vivix-labs/ads-compare",
54
- "version": "1.0.0-beta.11",
54
+ "version": "1.0.0-beta.15",
55
55
  "enabled": true,
56
56
  "config": {}
57
57
  },
58
58
  {
59
59
  "id": "ads-storyboard",
60
60
  "package": "@vivix-labs/ads-storyboard",
61
- "version": "1.0.0-beta.11",
61
+ "version": "1.0.0-beta.15",
62
62
  "enabled": true,
63
63
  "config": {}
64
64
  },
65
65
  {
66
66
  "id": "workbench",
67
67
  "package": "@vivix-labs/ads-workbench",
68
- "version": "1.0.0-beta.12",
68
+ "version": "1.0.0-beta.15",
69
69
  "enabled": true,
70
70
  "config": {
71
71
  "studioInstance": "studio",
@@ -15,7 +15,7 @@ Make the ad inside the active project's Advertising preset (`studio`, `workbench
15
15
  - The product on screen comes from the user's real photos. No product photo: ask for one and stop. Never invent the product.
16
16
  - Every claim, number, price, offer, review and endorsement comes from the user. If one is missing, ask or leave it out. This includes text and props in the set.
17
17
  - No price in the ad: not in a line, not in on-screen text, not in the CTA. Prices, discounts and coupons change with every platform campaign, and an ad outlives them. Show one only when the user asks for it in this ad; a price the user mentioned as a fact stays in the brief.
18
- - Generation is paid. Once the plan is accepted, single generations need no further approval. Before the first `capabilities.list` or `generation.submit`, run `vivix-studio auth status --json`; on `AUTH_REQUIRED`, run `vivix-studio auth login` yourself, then continue.
18
+ - Generation is paid. Once the plan is accepted, single generations need no further approval. Before the first `capabilities.list` or `generation.submit`, run `vivix-studio auth status --json`. On `AUTH_REQUIRED`, save your drafts and follow the installed `vivix-studio-cli` Skill's authentication steps: retain one `vivix-studio auth login --json` background command, show its login URL while it waits, and collect that same command's result after the user signs in through the browser. Verify `auth status --json` before resuming.
19
19
  - Call operations as `vivix-studio plugin call <instance> <operation> --project <id> --input <json> --request-key <key> --json`. Every write needs a `--request-key`. A new take or a changed input gets a new key; retrying the same call after a lost or unknown response keeps its key (`vivix-ads-workbench` skill). Instances: `studio` has `ads.*`, `projects.*`, `assets.*`, `choices.*`, `generation.submit`, `tasks.*`, `files.*`; `workbench` has `ads.resolveSequence` and `ads.bindEdit`; `media` has `edits.save`, `sequence.process`, `jobs.*`; `api` has `capabilities.list` and `capabilities.get`.
20
20
  - A generation returns a task at once. Read `tasks.get` until `state` is `succeeded`; the result is in `outputRefs`, and `files.resolveLocation` gives its local path. An export returns a job; read `media:jobs.get` the same way.
21
21
  - Spend nothing before the user has seen the plan: who is on screen, what each clip shows, every line word for word. After that, make one clip and check it before you submit the rest.