@vivix-labs/ads-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/client.bundle.js
CHANGED
|
@@ -5,10 +5,10 @@ function StudioTheme({ theme = "light", className, ...props }) {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
// packages/ui-system/dist/button.js
|
|
8
|
-
import { jsx as _jsx3, jsxs as
|
|
8
|
+
import { jsx as _jsx3, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
9
9
|
|
|
10
10
|
// packages/ui-system/dist/icon.js
|
|
11
|
-
import { jsx as _jsx2 } from "react/jsx-runtime";
|
|
11
|
+
import { jsx as _jsx2, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
var iconGeometry = {
|
|
13
13
|
add: {
|
|
14
14
|
width: 16,
|
|
@@ -134,6 +134,7 @@ var iconGeometry = {
|
|
|
134
134
|
height: 20,
|
|
135
135
|
slot: 20
|
|
136
136
|
},
|
|
137
|
+
"fullscreen-exit": { width: 20, height: 20, slot: 20 },
|
|
137
138
|
"placeholder-image": {
|
|
138
139
|
width: 20,
|
|
139
140
|
height: 20,
|
|
@@ -213,6 +214,9 @@ function Icon({ name, size }) {
|
|
|
213
214
|
},
|
|
214
215
|
...size === void 0 ? {} : { "--vx-icon-size": `${size}px` }
|
|
215
216
|
};
|
|
217
|
+
if (name === "relationships" || name === "color-adjust" || name === "speed") {
|
|
218
|
+
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" })] }) });
|
|
219
|
+
}
|
|
216
220
|
return _jsx2("span", { "aria-hidden": "true", className: "vx-icon", "data-icon": name, style });
|
|
217
221
|
}
|
|
218
222
|
|
|
@@ -245,7 +249,7 @@ var buttonVariants = {
|
|
|
245
249
|
"icon-outline-sm": { size: 32, appearance: "outline", shape: "icon" },
|
|
246
250
|
"icon-on-content": { size: 24, appearance: "on-content", shape: "icon" },
|
|
247
251
|
"icon-outline-lg": { size: 48, appearance: "outline", shape: "icon" },
|
|
248
|
-
// Compact bare action:
|
|
252
|
+
// Compact bare action: remain transparent at rest and on hover.
|
|
249
253
|
"icon-bare-xs": { size: 24, appearance: "ghost", shape: "icon" },
|
|
250
254
|
"icon-ghost-sm": { size: 32, appearance: "ghost", shape: "icon" },
|
|
251
255
|
"icon-ghost-lg": { size: 48, appearance: "ghost", shape: "icon" },
|
|
@@ -257,36 +261,36 @@ var buttonVariants = {
|
|
|
257
261
|
function ButtonFrame({ label, variant, loading = false, width, children, disabled, type = "button", style, className, ...props }) {
|
|
258
262
|
const spec = buttonVariants[variant];
|
|
259
263
|
const buttonStyle = "width" in spec ? { ...style, "--vx-button-width": `${spec.width}px` } : style;
|
|
260
|
-
return
|
|
264
|
+
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" })] });
|
|
261
265
|
}
|
|
262
266
|
function Button({ variant = "text-filled-sm", leadingIcon, trailingIcon, badge, ...props }) {
|
|
263
|
-
return
|
|
267
|
+
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 }) })] });
|
|
264
268
|
}
|
|
265
269
|
function IconButton({ icon, variant = "icon-ghost-sm", ...props }) {
|
|
266
270
|
return _jsx3(ButtonFrame, { ...props, variant, children: _jsx3(Icon, { name: icon }) });
|
|
267
271
|
}
|
|
268
272
|
|
|
269
273
|
// packages/ui-system/dist/asset-selection-toolbar.js
|
|
270
|
-
import { jsxs as
|
|
274
|
+
import { jsxs as _jsxs3, jsx as _jsx4, Fragment as _Fragment2 } from "react/jsx-runtime";
|
|
271
275
|
function AssetSelectionToolbar({ count, allSelected, label = "Selected asset actions", showAssetActions = true, onSelectAll, onFavorite, onDownload, onDelete, deleteHint, onCancel, cancelRef, busy }) {
|
|
272
276
|
const common = { variant: "text-tonal-sm", width: "hug" };
|
|
273
|
-
return
|
|
277
|
+
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 })] });
|
|
274
278
|
}
|
|
275
279
|
|
|
276
280
|
// packages/ui-system/dist/asset-reference-row.js
|
|
277
|
-
import { Fragment as
|
|
281
|
+
import { Fragment as _Fragment3, jsx as _jsx5, jsxs as _jsxs4 } from "react/jsx-runtime";
|
|
278
282
|
function AssetReferenceRow({ references, renderThumbnail, className = "" }) {
|
|
279
283
|
if (!references.length)
|
|
280
|
-
return _jsx5(
|
|
284
|
+
return _jsx5(_Fragment3, { children: "--" });
|
|
281
285
|
const remaining = references.length - 2;
|
|
282
|
-
return
|
|
286
|
+
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] })] });
|
|
283
287
|
}
|
|
284
288
|
|
|
285
289
|
// packages/ui-system/dist/asset-tile-caption.js
|
|
286
|
-
import { jsx as _jsx6, jsxs as
|
|
290
|
+
import { jsx as _jsx6, jsxs as _jsxs5 } from "react/jsx-runtime";
|
|
287
291
|
function AssetTileCaption({ title, facts, status, actions, onOpen, disabled }) {
|
|
288
292
|
const details = facts.filter((fact) => typeof fact === "string" && Boolean(fact.trim()));
|
|
289
|
-
return
|
|
293
|
+
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))] })] });
|
|
290
294
|
}
|
|
291
295
|
|
|
292
296
|
// packages/ui-system/dist/open-workbench-asset.js
|
|
@@ -305,7 +309,7 @@ function openWorkbenchAsset(ref) {
|
|
|
305
309
|
}
|
|
306
310
|
|
|
307
311
|
// packages/ui-system/dist/script-cover.js
|
|
308
|
-
import { jsx as _jsx7, jsxs as
|
|
312
|
+
import { jsx as _jsx7, jsxs as _jsxs6 } from "react/jsx-runtime";
|
|
309
313
|
import { useEffect, useState } from "react";
|
|
310
314
|
async function readTextExcerpt(response, signal, maxBytes = 1024) {
|
|
311
315
|
if (!response.ok || !response.body)
|
|
@@ -355,58 +359,31 @@ function ScriptCover({ title, synopsis, src }) {
|
|
|
355
359
|
return () => controller.abort();
|
|
356
360
|
}, [src, synopsis]);
|
|
357
361
|
const text = synopsis || (src && excerpt?.src === src ? excerpt.text : "");
|
|
358
|
-
return _jsx7("span", { className: "vx-script-cover", "aria-label": title, children:
|
|
362
|
+
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 })] }) });
|
|
359
363
|
}
|
|
360
364
|
|
|
361
365
|
// packages/ui-system/dist/checkbox.js
|
|
362
|
-
import { jsx as _jsx8, jsxs as
|
|
366
|
+
import { jsx as _jsx8, jsxs as _jsxs7 } from "react/jsx-runtime";
|
|
363
367
|
function Checkbox({ label, checked, onCheckedChange, hideLabel = false, appearance = "default", ...props }) {
|
|
364
|
-
return
|
|
365
|
-
}
|
|
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
|
-
} })] });
|
|
368
|
+
return _jsxs7("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] });
|
|
392
369
|
}
|
|
393
370
|
|
|
394
371
|
// packages/ui-system/dist/dropdown.js
|
|
395
|
-
import { jsx as
|
|
396
|
-
import { useEffect as useEffect2, useId, useLayoutEffect, useRef
|
|
372
|
+
import { jsx as _jsx9, jsxs as _jsxs8 } from "react/jsx-runtime";
|
|
373
|
+
import { useEffect as useEffect2, useId, useLayoutEffect, useRef, useState as useState2 } from "react";
|
|
397
374
|
function optionIcon(icon) {
|
|
398
|
-
return typeof icon === "string" ?
|
|
375
|
+
return typeof icon === "string" ? _jsx9(Icon, { name: icon }) : icon;
|
|
399
376
|
}
|
|
400
377
|
function Dropdown({ label, options, value, onValueChange, placeholder = "Select an option", size = "medium", width = "fixed", appearance = "default", textSize = 14, floating = false, disabled = false }) {
|
|
401
378
|
const id = useId();
|
|
402
|
-
const trigger =
|
|
403
|
-
const list =
|
|
379
|
+
const trigger = useRef(null);
|
|
380
|
+
const list = useRef(null);
|
|
404
381
|
const heading = appearance === "heading";
|
|
405
382
|
const popover = heading || floating;
|
|
406
|
-
const activeOption =
|
|
407
|
-
const search =
|
|
408
|
-
const [open, setOpen] =
|
|
409
|
-
const [highlighted, setHighlighted] =
|
|
383
|
+
const activeOption = useRef(null);
|
|
384
|
+
const search = useRef({ query: "", time: 0 });
|
|
385
|
+
const [open, setOpen] = useState2(false);
|
|
386
|
+
const [highlighted, setHighlighted] = useState2(null);
|
|
410
387
|
const enabled = options.filter((option) => !option.disabled);
|
|
411
388
|
const canOpen = !disabled && enabled.length > 0;
|
|
412
389
|
const expanded = canOpen && open;
|
|
@@ -525,35 +502,35 @@ function Dropdown({ label, options, value, onValueChange, placeholder = "Select
|
|
|
525
502
|
if (match)
|
|
526
503
|
setHighlighted(match.value);
|
|
527
504
|
}
|
|
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),
|
|
505
|
+
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), _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) => _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: () => {
|
|
529
506
|
if (!option.disabled)
|
|
530
507
|
choose(option);
|
|
531
|
-
}, children: [optionIcon(option.icon), option.label, width === "hug" && option.value === value &&
|
|
508
|
+
}, children: [optionIcon(option.icon), option.label, width === "hug" && option.value === value && _jsx9(Icon, { name: "check" })] }, option.value)) })] });
|
|
532
509
|
}
|
|
533
510
|
|
|
534
511
|
// packages/ui-system/dist/segmented-control.js
|
|
535
|
-
import { jsx as
|
|
512
|
+
import { jsx as _jsx10, jsxs as _jsxs9 } from "react/jsx-runtime";
|
|
536
513
|
import { useId as useId2 } from "react";
|
|
537
514
|
function SegmentedControl({ label, items, value, onValueChange, size = "medium", width = "fixed", iconOnly = false }) {
|
|
538
515
|
const id = useId2();
|
|
539
|
-
return
|
|
516
|
+
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) => _jsxs9("label", { title: iconOnly ? item.label : void 0, 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) }), _jsxs9("span", { className: "vx-segment-item", children: [item.icon && _jsx10(Icon, { name: item.icon }), (!iconOnly || !item.icon) && item.label] })] }, item.value)) });
|
|
540
517
|
}
|
|
541
518
|
|
|
542
519
|
// packages/ui-system/dist/inline-text.js
|
|
543
|
-
import { jsx as
|
|
544
|
-
import { useLayoutEffect as useLayoutEffect2, useRef as
|
|
520
|
+
import { jsx as _jsx11 } from "react/jsx-runtime";
|
|
521
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState3 } from "react";
|
|
545
522
|
function InlineText({ value, label, onChange, onCommit, onEditStart, as: Element = "span", multiline = false, disabled = false, placeholder = "Click to add text" }) {
|
|
546
|
-
const node =
|
|
547
|
-
const initial =
|
|
548
|
-
const editing =
|
|
549
|
-
const [focused, setFocused] =
|
|
550
|
-
const before =
|
|
551
|
-
const cancelled =
|
|
523
|
+
const node = useRef2(null);
|
|
524
|
+
const initial = useRef2(value);
|
|
525
|
+
const editing = useRef2(false);
|
|
526
|
+
const [focused, setFocused] = useState3(false);
|
|
527
|
+
const before = useRef2(value);
|
|
528
|
+
const cancelled = useRef2(false);
|
|
552
529
|
useLayoutEffect2(() => {
|
|
553
530
|
if (!editing.current && node.current)
|
|
554
531
|
node.current.textContent = value;
|
|
555
532
|
}, [value, focused]);
|
|
556
|
-
return
|
|
533
|
+
return _jsx11(Element, { ref: (element) => {
|
|
557
534
|
node.current = element;
|
|
558
535
|
}, 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
536
|
editing.current = true;
|
|
@@ -592,14 +569,14 @@ function InlineText({ value, label, onChange, onCommit, onEditStart, as: Element
|
|
|
592
569
|
}
|
|
593
570
|
|
|
594
571
|
// packages/ui-system/dist/tag.js
|
|
595
|
-
import { jsx as
|
|
572
|
+
import { jsx as _jsx12 } from "react/jsx-runtime";
|
|
596
573
|
function Tag({ children, variant = "overlay", className }) {
|
|
597
|
-
return
|
|
574
|
+
return _jsx12("span", { className: className ? `vx-tag ${className}` : "vx-tag", "data-variant": variant, children });
|
|
598
575
|
}
|
|
599
576
|
|
|
600
577
|
// packages/ui-system/dist/dialog.js
|
|
601
|
-
import { jsx as
|
|
602
|
-
import { useId as useId3, useLayoutEffect as useLayoutEffect3, useRef as
|
|
578
|
+
import { jsx as _jsx13, jsxs as _jsxs10, Fragment as _Fragment4 } from "react/jsx-runtime";
|
|
579
|
+
import { useId as useId3, useLayoutEffect as useLayoutEffect3, useRef as useRef3, useState as useState4 } from "react";
|
|
603
580
|
import { createPortal } from "react-dom";
|
|
604
581
|
|
|
605
582
|
// packages/ui-system/dist/dialog-surface.js
|
|
@@ -661,9 +638,9 @@ function createDialogSurface(anchor2) {
|
|
|
661
638
|
|
|
662
639
|
// packages/ui-system/dist/dialog.js
|
|
663
640
|
function Dialog({ title, open, onOpenChange, children, actions, className, inlineWhenClosed = false, variant = "default", closeOnEscape = true, focusTitleOnOpen = variant === "welcome" }) {
|
|
664
|
-
const ref =
|
|
665
|
-
const anchor2 =
|
|
666
|
-
const [surface, setSurface] =
|
|
641
|
+
const ref = useRef3(null);
|
|
642
|
+
const anchor2 = useRef3(null);
|
|
643
|
+
const [surface, setSurface] = useState4();
|
|
667
644
|
const heading = useId3();
|
|
668
645
|
useLayoutEffect3(() => {
|
|
669
646
|
if (inlineWhenClosed || !open || !anchor2.current)
|
|
@@ -702,7 +679,7 @@ function Dialog({ title, open, onOpenChange, children, actions, className, inlin
|
|
|
702
679
|
};
|
|
703
680
|
}, [open, surface, inlineWhenClosed]);
|
|
704
681
|
const welcome = variant === "welcome";
|
|
705
|
-
const closeButton =
|
|
682
|
+
const closeButton = _jsx13(IconButton, { icon: "close", label: "Close dialog", onClick: () => onOpenChange(false) });
|
|
706
683
|
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) => {
|
|
707
684
|
event2.preventDefault();
|
|
708
685
|
event2.stopPropagation();
|
|
@@ -711,17 +688,17 @@ function Dialog({ title, open, onOpenChange, children, actions, className, inlin
|
|
|
711
688
|
}, onClose: (event2) => {
|
|
712
689
|
if (open && event2.currentTarget.isConnected && !event2.currentTarget.open)
|
|
713
690
|
onOpenChange(false);
|
|
714
|
-
}, children: [_jsxs10("header", { hidden: inlineWhenClosed && !open, children: [
|
|
715
|
-
return _jsxs10(
|
|
691
|
+
}, children: [_jsxs10("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) && _jsxs10("footer", { hidden: inlineWhenClosed && !open, children: [actions, welcome && closeButton] })] });
|
|
692
|
+
return _jsxs10(_Fragment4, { children: [_jsx13("span", { ref: anchor2, hidden: true }), (open || inlineWhenClosed) && (surface ? createPortal(dialog, surface) : dialog)] });
|
|
716
693
|
}
|
|
717
694
|
|
|
718
695
|
// packages/ui-system/dist/toast.js
|
|
719
|
-
import { jsx as
|
|
720
|
-
import { useCallback, useEffect as useEffect3, useLayoutEffect as useLayoutEffect4, useRef as
|
|
696
|
+
import { jsx as _jsx14, jsxs as _jsxs11, Fragment as _Fragment5 } from "react/jsx-runtime";
|
|
697
|
+
import { useCallback, useEffect as useEffect3, useLayoutEffect as useLayoutEffect4, useRef as useRef4, useState as useState5 } from "react";
|
|
721
698
|
import { createPortal as createPortal2 } from "react-dom";
|
|
722
699
|
function useToastMessage() {
|
|
723
|
-
const [message, setMessage] =
|
|
724
|
-
const timeout =
|
|
700
|
+
const [message, setMessage] = useState5("");
|
|
701
|
+
const timeout = useRef4(void 0);
|
|
725
702
|
useEffect3(() => () => clearTimeout(timeout.current), []);
|
|
726
703
|
const show = useCallback((text) => {
|
|
727
704
|
clearTimeout(timeout.current);
|
|
@@ -732,9 +709,9 @@ function useToastMessage() {
|
|
|
732
709
|
return [message, show];
|
|
733
710
|
}
|
|
734
711
|
function Toast({ message, leading, className }) {
|
|
735
|
-
const anchor2 =
|
|
736
|
-
const ref =
|
|
737
|
-
const [surface, setSurface] =
|
|
712
|
+
const anchor2 = useRef4(null);
|
|
713
|
+
const ref = useRef4(null);
|
|
714
|
+
const [surface, setSurface] = useState5();
|
|
738
715
|
const visible = Boolean(message);
|
|
739
716
|
useLayoutEffect4(() => {
|
|
740
717
|
if (!visible || !anchor2.current)
|
|
@@ -776,18 +753,18 @@ function Toast({ message, leading, className }) {
|
|
|
776
753
|
doc.removeEventListener("fullscreenchange", bringToFront);
|
|
777
754
|
};
|
|
778
755
|
}, [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,
|
|
780
|
-
return _jsxs11(
|
|
756
|
+
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, _jsx14("span", { children: message })] });
|
|
757
|
+
return _jsxs11(_Fragment5, { children: [_jsx14("span", { hidden: true, ref: anchor2 }), surface ? createPortal2(notice, surface) : notice] });
|
|
781
758
|
}
|
|
782
759
|
|
|
783
760
|
// packages/ui-system/dist/prompt-hint.js
|
|
784
|
-
import { jsx as
|
|
785
|
-
import { useRef as
|
|
761
|
+
import { jsx as _jsx15, jsxs as _jsxs12 } from "react/jsx-runtime";
|
|
762
|
+
import { useRef as useRef5, useState as useState6 } from "react";
|
|
786
763
|
function PromptHint({ label, message, prompt }) {
|
|
787
764
|
const [status, setStatus] = useToastMessage();
|
|
788
|
-
const [manual, setManual] =
|
|
789
|
-
const text =
|
|
790
|
-
return _jsxs12("aside", { className: "vx-prompt-hint", "aria-label": label, children: [
|
|
765
|
+
const [manual, setManual] = useState6(false);
|
|
766
|
+
const text = useRef5(null);
|
|
767
|
+
return _jsxs12("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
768
|
try {
|
|
792
769
|
await event2.currentTarget.ownerDocument.defaultView.navigator.clipboard.writeText(prompt);
|
|
793
770
|
setStatus("Prompt copied.");
|
|
@@ -795,15 +772,15 @@ function PromptHint({ label, message, prompt }) {
|
|
|
795
772
|
setManual(true);
|
|
796
773
|
setStatus("Select and copy the prompt.");
|
|
797
774
|
}
|
|
798
|
-
} }),
|
|
775
|
+
} }), _jsx15(Toast, { message: status })] });
|
|
799
776
|
}
|
|
800
777
|
|
|
801
778
|
// packages/ui-system/dist/detail-panel.js
|
|
802
|
-
import { useLayoutEffect as useLayoutEffect5, useRef as
|
|
779
|
+
import { useLayoutEffect as useLayoutEffect5, useRef as useRef6, useState as useState7 } from "react";
|
|
803
780
|
function useDetailPanel(open) {
|
|
804
|
-
const ref =
|
|
805
|
-
const [retained, setRetained] =
|
|
806
|
-
const animation =
|
|
781
|
+
const ref = useRef6(null);
|
|
782
|
+
const [retained, setRetained] = useState7(open);
|
|
783
|
+
const animation = useRef6(null);
|
|
807
784
|
const present = open || retained;
|
|
808
785
|
useLayoutEffect5(() => {
|
|
809
786
|
const element = ref.current;
|
|
@@ -851,12 +828,12 @@ function useDetailPanel(open) {
|
|
|
851
828
|
}
|
|
852
829
|
|
|
853
830
|
// packages/ui-system/dist/menu.js
|
|
854
|
-
import { jsx as
|
|
855
|
-
import { useEffect as useEffect4, useId as useId4, useLayoutEffect as useLayoutEffect6, useRef as
|
|
831
|
+
import { jsx as _jsx16, jsxs as _jsxs13 } from "react/jsx-runtime";
|
|
832
|
+
import { useEffect as useEffect4, useId as useId4, useLayoutEffect as useLayoutEffect6, useRef as useRef7, useState as useState8 } from "react";
|
|
856
833
|
import { createPortal as createPortal3 } from "react-dom";
|
|
857
834
|
function MenuPreview({ children }) {
|
|
858
|
-
const ref =
|
|
859
|
-
const [visible, setVisible] =
|
|
835
|
+
const ref = useRef7(null);
|
|
836
|
+
const [visible, setVisible] = useState8(false);
|
|
860
837
|
useEffect4(() => {
|
|
861
838
|
const node = ref.current;
|
|
862
839
|
if (!node)
|
|
@@ -870,21 +847,21 @@ function MenuPreview({ children }) {
|
|
|
870
847
|
observer.observe(node);
|
|
871
848
|
return () => observer.disconnect();
|
|
872
849
|
}, []);
|
|
873
|
-
return
|
|
850
|
+
return _jsx16("span", { ref, className: "vx-menu-preview", "aria-hidden": "true", children: visible && children });
|
|
874
851
|
}
|
|
875
852
|
function isEnabled(item) {
|
|
876
853
|
return !item.disabled && item.items?.length !== 0;
|
|
877
854
|
}
|
|
878
855
|
function Menu({ label, items, triggerIcon, textTrigger = "dropdown", floating = false, cascading = false }) {
|
|
879
856
|
const id = useId4();
|
|
880
|
-
const trigger =
|
|
881
|
-
const popup =
|
|
882
|
-
const children =
|
|
883
|
-
const focusOnOpen =
|
|
857
|
+
const trigger = useRef7(null);
|
|
858
|
+
const popup = useRef7(null);
|
|
859
|
+
const children = useRef7(/* @__PURE__ */ new Map());
|
|
860
|
+
const focusOnOpen = useRef7(true);
|
|
884
861
|
const cascade = floating && cascading;
|
|
885
|
-
const focusIndex =
|
|
886
|
-
const [path, setPath] =
|
|
887
|
-
const [placement, setPlacement] =
|
|
862
|
+
const focusIndex = useRef7(0);
|
|
863
|
+
const [path, setPath] = useState8(null);
|
|
864
|
+
const [placement, setPlacement] = useState8({ visibility: "hidden" });
|
|
888
865
|
const portalRoot = floating ? trigger.current?.closest("dialog, [data-vx-theme]") : null;
|
|
889
866
|
useLayoutEffect6(() => {
|
|
890
867
|
if (!floating || !path || !portalRoot)
|
|
@@ -1057,7 +1034,7 @@ function Menu({ label, items, triggerIcon, textTrigger = "dropdown", floating =
|
|
|
1057
1034
|
focusOnOpen.current = false;
|
|
1058
1035
|
setPath(next);
|
|
1059
1036
|
}
|
|
1060
|
-
const menu = levels.map(({ entries: entries2, menuLabel: menuLabel2 }, depth) => !cascade && depth !== levels.length - 1 ? null :
|
|
1037
|
+
const menu = levels.map(({ entries: entries2, menuLabel: menuLabel2 }, depth) => !cascade && depth !== levels.length - 1 ? null : _jsx16("div", { ref: !cascade || depth === 0 ? popup : (el) => {
|
|
1061
1038
|
if (el)
|
|
1062
1039
|
children.current.set(depth, el);
|
|
1063
1040
|
else
|
|
@@ -1071,22 +1048,22 @@ function Menu({ label, items, triggerIcon, textTrigger = "dropdown", floating =
|
|
|
1071
1048
|
} : 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) => {
|
|
1072
1049
|
if (e.pointerType !== "touch")
|
|
1073
1050
|
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 &&
|
|
1051
|
+
} : 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));
|
|
1075
1052
|
return _jsxs13("div", { className: "vx-action-menu", onBlur: (event2) => {
|
|
1076
1053
|
if (!event2.currentTarget.contains(event2.relatedTarget) && !(floating && popup.current?.contains(event2.relatedTarget)) && ![...children.current.values()].some((panel) => panel.contains(event2.relatedTarget)))
|
|
1077
1054
|
setPath(null);
|
|
1078
|
-
}, children: [triggerIcon ?
|
|
1055
|
+
}, 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
1056
|
}
|
|
1080
1057
|
|
|
1081
1058
|
// packages/ui-system/dist/filter-menu.js
|
|
1082
|
-
import { jsx as
|
|
1083
|
-
import { useId as useId5, useRef as
|
|
1059
|
+
import { jsx as _jsx17, jsxs as _jsxs14, Fragment as _Fragment6 } from "react/jsx-runtime";
|
|
1060
|
+
import { useId as useId5, useRef as useRef8, useState as useState9, useLayoutEffect as useLayoutEffect7 } from "react";
|
|
1084
1061
|
function FilterMenu({ label, groups, value, onValueChange, leadingIcon = "filter" }) {
|
|
1085
1062
|
const id = useId5();
|
|
1086
|
-
const popup =
|
|
1087
|
-
const [expanded, setExpanded] =
|
|
1088
|
-
const list =
|
|
1089
|
-
const [moreBelow, setMoreBelow] =
|
|
1063
|
+
const popup = useRef8(null);
|
|
1064
|
+
const [expanded, setExpanded] = useState9(false);
|
|
1065
|
+
const list = useRef8(null);
|
|
1066
|
+
const [moreBelow, setMoreBelow] = useState9(false);
|
|
1090
1067
|
useLayoutEffect7(() => {
|
|
1091
1068
|
const el = list.current;
|
|
1092
1069
|
if (!el || !expanded)
|
|
@@ -1115,29 +1092,29 @@ function FilterMenu({ label, groups, value, onValueChange, leadingIcon = "filter
|
|
|
1115
1092
|
function focusFirstGroup() {
|
|
1116
1093
|
popup.current?.querySelector("summary")?.focus({ preventScroll: true });
|
|
1117
1094
|
}
|
|
1118
|
-
return _jsxs14(
|
|
1095
|
+
return _jsxs14(_Fragment6, { 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 }), _jsxs14("div", { ref: popup, id, className: "vx-filter-menu", popover: "auto", role: "dialog", "aria-label": label, onToggle: (event2) => {
|
|
1119
1096
|
const open = event2.currentTarget.matches(":popover-open");
|
|
1120
1097
|
setExpanded(open);
|
|
1121
1098
|
if (open)
|
|
1122
1099
|
focusFirstGroup();
|
|
1123
|
-
}, children: [
|
|
1100
|
+
}, 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 }) => _jsxs14("details", { open: !initiallyCollapsed, children: [_jsxs14("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
1101
|
...value,
|
|
1125
1102
|
[groupId]: checked ? [...selected, option] : selected.filter((item) => item !== option)
|
|
1126
|
-
}) }, option)) })] }, groupId)) }) }),
|
|
1103
|
+
}) }, option)) })] }, groupId)) }) }), _jsx17("footer", { children: _jsx17(Button, { label: "Clear Filters", variant: "text-tonal-sm", disabled: !count, onClick: () => {
|
|
1127
1104
|
onValueChange({});
|
|
1128
1105
|
focusFirstGroup();
|
|
1129
1106
|
} }) })] })] });
|
|
1130
1107
|
}
|
|
1131
1108
|
|
|
1132
1109
|
// packages/ui-system/dist/media.js
|
|
1133
|
-
import { jsx as
|
|
1134
|
-
import { useRef as
|
|
1110
|
+
import { jsx as _jsx18, Fragment as _Fragment7, jsxs as _jsxs15 } from "react/jsx-runtime";
|
|
1111
|
+
import { useRef as useRef9, useState as useState10 } from "react";
|
|
1135
1112
|
function MediaBadges({ label, duration: duration3, labelVariant }) {
|
|
1136
|
-
return _jsxs15(
|
|
1113
|
+
return _jsxs15(_Fragment7, { 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
1114
|
}
|
|
1138
1115
|
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] =
|
|
1140
|
-
const [failedVideo, setFailedVideo] =
|
|
1116
|
+
const [failedImage, setFailedImage] = useState10();
|
|
1117
|
+
const [failedVideo, setFailedVideo] = useState10();
|
|
1141
1118
|
const video = videoSrc !== failedVideo ? videoSrc : void 0;
|
|
1142
1119
|
const image = src !== failedImage && !(preferVideo && video) ? src : void 0;
|
|
1143
1120
|
const selected = state === "selected";
|
|
@@ -1151,7 +1128,7 @@ function Media({ src, videoSrc, preferVideo = false, emptyLabel, script, alt, ra
|
|
|
1151
1128
|
transform: `rotate(${crop.rotation ?? 0}deg)`,
|
|
1152
1129
|
objectFit: "fill"
|
|
1153
1130
|
} : { objectFit: fit };
|
|
1154
|
-
const content = _jsxs15(
|
|
1131
|
+
const content = _jsxs15(_Fragment7, { 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
1132
|
const props = {
|
|
1156
1133
|
className: "vx-media",
|
|
1157
1134
|
"data-state": state,
|
|
@@ -1160,15 +1137,15 @@ function Media({ src, videoSrc, preferVideo = false, emptyLabel, script, alt, ra
|
|
|
1160
1137
|
"aria-busy": busy || void 0,
|
|
1161
1138
|
style: { aspectRatio: ratio.replace(":", " / ") }
|
|
1162
1139
|
};
|
|
1163
|
-
return onSelect || onOpen ?
|
|
1140
|
+
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
1141
|
}
|
|
1165
1142
|
|
|
1166
1143
|
// packages/ui-system/dist/audio-preview.js
|
|
1167
|
-
import { jsx as
|
|
1168
|
-
import { useEffect as useEffect5, useRef as
|
|
1144
|
+
import { jsx as _jsx19, jsxs as _jsxs16 } from "react/jsx-runtime";
|
|
1145
|
+
import { useEffect as useEffect5, useRef as useRef10, useState as useState11 } from "react";
|
|
1169
1146
|
function AudioClip({ title, src, duration: duration3, disabled, playing: previewPlaying = false, quote, quoteContent, onPlayChange, onError, variant = "audio" }) {
|
|
1170
|
-
const audio =
|
|
1171
|
-
const [nativePlaying, setPlaying] =
|
|
1147
|
+
const audio = useRef10(null);
|
|
1148
|
+
const [nativePlaying, setPlaying] = useState11(false);
|
|
1172
1149
|
const playing = src ? nativePlaying : previewPlaying;
|
|
1173
1150
|
useEffect5(() => {
|
|
1174
1151
|
if (disabled)
|
|
@@ -1190,7 +1167,7 @@ function AudioClip({ title, src, duration: duration3, disabled, playing: preview
|
|
|
1190
1167
|
setPlaying(next);
|
|
1191
1168
|
onPlayChange?.(next);
|
|
1192
1169
|
}
|
|
1193
|
-
return _jsxs16("div", { className: "vx-audio-preview", "data-variant": variant, role: "group", "aria-label": title, children: [src &&
|
|
1170
|
+
return _jsxs16("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
1171
|
const player = audio.current;
|
|
1195
1172
|
if (!player)
|
|
1196
1173
|
return;
|
|
@@ -1198,30 +1175,73 @@ function AudioClip({ title, src, duration: duration3, disabled, playing: preview
|
|
|
1198
1175
|
void player.play().catch((error) => onError?.(error));
|
|
1199
1176
|
else
|
|
1200
1177
|
player.pause();
|
|
1201
|
-
} }), _jsxs16("div", { children: [
|
|
1178
|
+
} }), _jsxs16("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
1179
|
}
|
|
1203
1180
|
function VoicePreview(props) {
|
|
1204
|
-
return
|
|
1181
|
+
return _jsx19(AudioClip, { ...props, variant: "voice" }, props.src);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
// packages/ui-system/dist/video-player.js
|
|
1185
|
+
import { jsx as _jsx20, jsxs as _jsxs17, Fragment as _Fragment8 } from "react/jsx-runtime";
|
|
1186
|
+
import { useEffect as useEffect7, useRef as useRef11, useState as useState13 } from "react";
|
|
1187
|
+
|
|
1188
|
+
// packages/ui-system/dist/fullscreen.js
|
|
1189
|
+
import { useEffect as useEffect6, useState as useState12 } from "react";
|
|
1190
|
+
function isFullscreen(element) {
|
|
1191
|
+
const tree = element.getRootNode();
|
|
1192
|
+
return tree.fullscreenElement === element || element.matches(":fullscreen");
|
|
1193
|
+
}
|
|
1194
|
+
function useFullscreen(target) {
|
|
1195
|
+
const [fullscreen, setFullscreen] = useState12(false);
|
|
1196
|
+
useEffect6(() => {
|
|
1197
|
+
const element = target.current;
|
|
1198
|
+
if (!element)
|
|
1199
|
+
return;
|
|
1200
|
+
const doc = element.ownerDocument;
|
|
1201
|
+
const update = () => setFullscreen(isFullscreen(element));
|
|
1202
|
+
const escape = (event2) => {
|
|
1203
|
+
if (event2.key !== "Escape" || !isFullscreen(element))
|
|
1204
|
+
return;
|
|
1205
|
+
event2.preventDefault();
|
|
1206
|
+
event2.stopPropagation();
|
|
1207
|
+
void doc.exitFullscreen().catch(update);
|
|
1208
|
+
};
|
|
1209
|
+
update();
|
|
1210
|
+
doc.addEventListener("fullscreenchange", update);
|
|
1211
|
+
doc.addEventListener("keydown", escape, true);
|
|
1212
|
+
return () => {
|
|
1213
|
+
doc.removeEventListener("fullscreenchange", update);
|
|
1214
|
+
doc.removeEventListener("keydown", escape, true);
|
|
1215
|
+
};
|
|
1216
|
+
}, [target]);
|
|
1217
|
+
async function toggleFullscreen() {
|
|
1218
|
+
const element = target.current;
|
|
1219
|
+
if (!element)
|
|
1220
|
+
return;
|
|
1221
|
+
if (isFullscreen(element))
|
|
1222
|
+
await element.ownerDocument.exitFullscreen();
|
|
1223
|
+
else
|
|
1224
|
+
await element.requestFullscreen();
|
|
1225
|
+
}
|
|
1226
|
+
return { fullscreen, toggleFullscreen };
|
|
1205
1227
|
}
|
|
1206
1228
|
|
|
1207
1229
|
// 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";
|
|
1210
1230
|
function timeLabel(seconds2, padMinutes = false) {
|
|
1211
1231
|
const whole = Math.floor(seconds2);
|
|
1212
1232
|
const minutes = String(Math.floor(whole / 60));
|
|
1213
1233
|
return `${padMinutes ? minutes.padStart(2, "0") : minutes}:${String(whole % 60).padStart(2, "0")}`;
|
|
1214
1234
|
}
|
|
1215
|
-
function PlaybackControls({ playing, muted, time, duration: duration3, size = "medium", disabled, onTogglePlay, onToggleMute, onSeek, onFullscreen, fullscreenLabel = "
|
|
1216
|
-
const slider =
|
|
1235
|
+
function PlaybackControls({ playing, muted, time, duration: duration3, size = "medium", disabled, onTogglePlay, onToggleMute, onSeek, onFullscreen, fullscreen = false, fullscreenLabel = fullscreen ? "Exit fullscreen" : "Enter fullscreen", actions, appearance = "on-content", timeDisplay = "combined", renderTimeline }) {
|
|
1236
|
+
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) });
|
|
1217
1237
|
return _jsxs17("div", { className: "vx-playback-controls", role: "group", "aria-label": "Playback controls", "data-size": size, "data-appearance": appearance, style: {
|
|
1218
1238
|
"--vx-playback-fraction": duration3 > 0 ? Math.min(1, Math.max(0, time / duration3)) : 0
|
|
1219
|
-
}, children: [
|
|
1239
|
+
}, 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(duration3, true) : `${timeLabel(time)} / ${timeLabel(duration3)}` }), _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 })] });
|
|
1220
1240
|
}
|
|
1221
1241
|
|
|
1222
1242
|
// packages/ui-system/dist/workspace-theme.js
|
|
1223
|
-
import { jsx as
|
|
1224
|
-
import { useEffect as
|
|
1243
|
+
import { jsx as _jsx21, jsxs as _jsxs18 } from "react/jsx-runtime";
|
|
1244
|
+
import { useEffect as useEffect8, useState as useState14 } from "react";
|
|
1225
1245
|
var key = "vivix.studio.theme";
|
|
1226
1246
|
var event = "vivix-studio-theme";
|
|
1227
1247
|
function readPreference() {
|
|
@@ -1236,7 +1256,7 @@ function readPreference() {
|
|
|
1236
1256
|
function useWorkspaceTheme() {
|
|
1237
1257
|
const [preference, setPreference] = useState14(readPreference);
|
|
1238
1258
|
const [system, setSystem] = useState14(() => globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light");
|
|
1239
|
-
|
|
1259
|
+
useEffect8(() => {
|
|
1240
1260
|
const query = globalThis.matchMedia?.("(prefers-color-scheme: dark)");
|
|
1241
1261
|
const synchronize = () => setPreference(readPreference());
|
|
1242
1262
|
const systemChanged = () => setSystem(query?.matches ? "dark" : "light");
|
|
@@ -1262,14 +1282,14 @@ function useWorkspaceTheme() {
|
|
|
1262
1282
|
|
|
1263
1283
|
// packages/ui-system/dist/duration.js
|
|
1264
1284
|
function formatDurationSeconds(durationMs) {
|
|
1265
|
-
return (Math.round(durationMs / 100) / 10).toFixed(1);
|
|
1285
|
+
return (Math.round(durationMs / 100) / 10).toFixed(1).replace(/\.0$/, "");
|
|
1266
1286
|
}
|
|
1267
1287
|
|
|
1268
1288
|
// packages/ui-system/dist/view-skeleton.js
|
|
1269
|
-
import { jsx as
|
|
1289
|
+
import { jsx as _jsx22, Fragment as _Fragment9, jsxs as _jsxs19 } from "react/jsx-runtime";
|
|
1270
1290
|
function ViewSkeleton({ layout = "list", label = "Loading project", heading = true }) {
|
|
1271
1291
|
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 &&
|
|
1292
|
+
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)) })] });
|
|
1273
1293
|
}
|
|
1274
1294
|
|
|
1275
1295
|
// packages/ads-workbench/src/client.tsx
|
|
@@ -1644,6 +1664,7 @@ function AdPlayer({
|
|
|
1644
1664
|
}) {
|
|
1645
1665
|
const video = React2.useRef(null);
|
|
1646
1666
|
const frame = React2.useRef(null);
|
|
1667
|
+
const { fullscreen, toggleFullscreen } = useFullscreen(frame);
|
|
1647
1668
|
const pendingSeek = React2.useRef(null);
|
|
1648
1669
|
const playAfterLoad = React2.useRef(null);
|
|
1649
1670
|
const transitioning = React2.useRef(false);
|
|
@@ -1782,10 +1803,8 @@ function AdPlayer({
|
|
|
1782
1803
|
const next = sequencePosition(entries, seconds2 * 1e3);
|
|
1783
1804
|
show(next.index, next.sourceMs, playing);
|
|
1784
1805
|
},
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
void frame.current.requestFullscreen().catch((error) => onError(error.message));
|
|
1788
|
-
}
|
|
1806
|
+
fullscreen,
|
|
1807
|
+
onFullscreen: () => void toggleFullscreen().catch((error) => onError(error.message))
|
|
1789
1808
|
}
|
|
1790
1809
|
));
|
|
1791
1810
|
}
|
|
@@ -2177,7 +2196,7 @@ function AdFilmVersions({
|
|
|
2177
2196
|
onClick: () => choose(film.source.objectId)
|
|
2178
2197
|
},
|
|
2179
2198
|
/* @__PURE__ */ React6.createElement(AdAssetCover, { asset, version, resolve }),
|
|
2180
|
-
/* @__PURE__ */ React6.createElement("span", null, film.title.split(" \xB7 ")[0]),
|
|
2199
|
+
selected === film.source.objectId && /* @__PURE__ */ React6.createElement("span", null, film.title.split(" \xB7 ")[0]),
|
|
2181
2200
|
version?.payload.durationMs > 0 && /* @__PURE__ */ React6.createElement("small", null, formatDurationSeconds(version.payload.durationMs), "s")
|
|
2182
2201
|
);
|
|
2183
2202
|
}))))), /* @__PURE__ */ React6.createElement("footer", null, films.length, " versions"));
|
|
@@ -2308,7 +2327,6 @@ function AssetCard({
|
|
|
2308
2327
|
);
|
|
2309
2328
|
}
|
|
2310
2329
|
function AdProjectAssets(props) {
|
|
2311
|
-
const [query, setQuery] = React7.useState("");
|
|
2312
2330
|
const { tab, onTabChange } = props;
|
|
2313
2331
|
const [filters, setFilters] = React7.useState({});
|
|
2314
2332
|
const [selecting, setSelecting] = React7.useState(false);
|
|
@@ -2389,7 +2407,7 @@ function AdProjectAssets(props) {
|
|
|
2389
2407
|
props.favoriteRefs.has(selectedVersion(a)?.versionId) ? "Favorited" : "Not favorited"
|
|
2390
2408
|
) && 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
2409
|
(ref) => ref.objectId === a.objectId
|
|
2392
|
-
)))
|
|
2410
|
+
)))
|
|
2393
2411
|
).sort(
|
|
2394
2412
|
(a, b) => (refOrder.get(a.objectId) ?? Infinity) - (refOrder.get(b.objectId) ?? Infinity) || (a.data.orderKey ?? Infinity) - (b.data.orderKey ?? Infinity)
|
|
2395
2413
|
);
|
|
@@ -2399,6 +2417,7 @@ function AdProjectAssets(props) {
|
|
|
2399
2417
|
"div",
|
|
2400
2418
|
{
|
|
2401
2419
|
className: "ad-library",
|
|
2420
|
+
"data-empty": !items.length || void 0,
|
|
2402
2421
|
onKeyDown: (event2) => {
|
|
2403
2422
|
if (selecting && !busy && !deleteOpen && event2.key === "Escape") {
|
|
2404
2423
|
event2.preventDefault();
|
|
@@ -2407,7 +2426,7 @@ function AdProjectAssets(props) {
|
|
|
2407
2426
|
}
|
|
2408
2427
|
}
|
|
2409
2428
|
},
|
|
2410
|
-
/* @__PURE__ */ React7.createElement("div", { className: "ad-library-bar vx-asset-library-toolbar" }, /* @__PURE__ */ React7.createElement("nav", { "aria-label": "Asset categories" }, ["All", "Products", "Models", "Videos"].map((name) => /* @__PURE__ */ React7.createElement(
|
|
2429
|
+
/* @__PURE__ */ React7.createElement("div", { className: "ad-library-bar vx-asset-library-toolbar", "data-project-assets": true }, /* @__PURE__ */ React7.createElement("nav", { "aria-label": "Asset categories" }, ["All", "Products", "Models", "Videos"].map((name) => /* @__PURE__ */ React7.createElement(
|
|
2411
2430
|
"button",
|
|
2412
2431
|
{
|
|
2413
2432
|
key: name,
|
|
@@ -2444,7 +2463,7 @@ function AdProjectAssets(props) {
|
|
|
2444
2463
|
cancelRef: cancelSelection,
|
|
2445
2464
|
onCancel: finishSelection
|
|
2446
2465
|
}
|
|
2447
|
-
) : /* @__PURE__ */ React7.createElement("div", { className: "vx-asset-library-controls" }, /* @__PURE__ */ React7.createElement(
|
|
2466
|
+
) : /* @__PURE__ */ React7.createElement("div", { className: "vx-asset-library-controls" }, /* @__PURE__ */ React7.createElement(
|
|
2448
2467
|
Button,
|
|
2449
2468
|
{
|
|
2450
2469
|
ref: selectButton,
|
|
@@ -2520,7 +2539,7 @@ function AdProjectAssets(props) {
|
|
|
2520
2539
|
}
|
|
2521
2540
|
}
|
|
2522
2541
|
)),
|
|
2523
|
-
grid ? /* @__PURE__ */ React7.createElement("div", { className: "ad-project-assets vx-asset-grid" }, items.map((asset) => /* @__PURE__ */ React7.createElement(
|
|
2542
|
+
!items.length ? null : grid ? /* @__PURE__ */ React7.createElement("div", { className: "ad-project-assets vx-asset-grid" }, items.map((asset) => /* @__PURE__ */ React7.createElement(
|
|
2524
2543
|
AssetCard,
|
|
2525
2544
|
{
|
|
2526
2545
|
...props,
|
|
@@ -2767,6 +2786,27 @@ function adAgentPrompt(brief, clip, projectId, asset, includeFixedIdentities = t
|
|
|
2767
2786
|
"Keep every result on this clip as a new candidate. Preserve the existing selection unless I explicitly choose another candidate."
|
|
2768
2787
|
].filter(Boolean).join("\n");
|
|
2769
2788
|
}
|
|
2789
|
+
function adStoryboardPrompt(brief, clips, projectId, assets) {
|
|
2790
|
+
if (!clips.length) return adAgentPrompt(brief, void 0, projectId);
|
|
2791
|
+
return [
|
|
2792
|
+
adAgentPrompt(brief, void 0, projectId),
|
|
2793
|
+
...clips.map((clip, index) => {
|
|
2794
|
+
const asset = assets.find((item) => item.objectId === clip.assetId);
|
|
2795
|
+
const selected = asset?.data.adoptedVersionId;
|
|
2796
|
+
const edit = clip.edits.find((item) => item.sourceVersionId === selected);
|
|
2797
|
+
return [
|
|
2798
|
+
`Shot ${index + 1}: ${clip.script.title || `Shot ${index + 1}`} (Clip asset: ${clip.assetId})`,
|
|
2799
|
+
clip.script.visual && `Visual: ${clip.script.visual}`,
|
|
2800
|
+
clip.script.voiceover && `Voiceover: ${clip.script.voiceover}`,
|
|
2801
|
+
clip.script.onScreenText && `On-screen text: ${clip.script.onScreenText}`,
|
|
2802
|
+
clip.script.cta && `CTA: ${clip.script.cta}`,
|
|
2803
|
+
`Planned duration: ${duration2(clip.script.plannedDurationMs)}`,
|
|
2804
|
+
`Selected fixed candidate: ${selected && asset ? JSON.stringify({ storeId: asset.storeId, objectId: asset.objectId, versionId: selected }) : "None"}`,
|
|
2805
|
+
`Selected saved edit: ${edit ? JSON.stringify(edit.editRef) : "None"}`
|
|
2806
|
+
].filter(Boolean).join("\n");
|
|
2807
|
+
})
|
|
2808
|
+
].join("\n\n");
|
|
2809
|
+
}
|
|
2770
2810
|
function selectedGenerationTaskId(asset) {
|
|
2771
2811
|
const version = asset.versions.find((item) => item.versionId === asset.data.adoptedVersionId);
|
|
2772
2812
|
return version?.payload.generation?.taskId || version?.taskId || null;
|
|
@@ -2891,7 +2931,7 @@ var adsCss = `
|
|
|
2891
2931
|
|
|
2892
2932
|
.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
2933
|
|
|
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
|
|
2934
|
+
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
2935
|
.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
2936
|
.ad-story-media .ad-player{display:grid;grid-template-rows:minmax(0,1fr) auto;aspect-ratio:16/9}
|
|
2897
2937
|
.ad-story-media .ad-screen{height:auto;min-height:0;max-height:none}
|
|
@@ -3307,7 +3347,7 @@ function AdsWorkbench({
|
|
|
3307
3347
|
async function copy2(prompt) {
|
|
3308
3348
|
try {
|
|
3309
3349
|
await navigator.clipboard.writeText(prompt);
|
|
3310
|
-
setNotice("Prompt copied.
|
|
3350
|
+
setNotice("Prompt copied. Paste it into your Agent chat.");
|
|
3311
3351
|
} catch {
|
|
3312
3352
|
setCopyText(prompt);
|
|
3313
3353
|
}
|
|
@@ -4111,6 +4151,7 @@ function AdsWorkbench({
|
|
|
4111
4151
|
Button,
|
|
4112
4152
|
{
|
|
4113
4153
|
label: "Export",
|
|
4154
|
+
leadingIcon: "export",
|
|
4114
4155
|
width: "hug",
|
|
4115
4156
|
disabled: busy || !ad || !ExportDialog,
|
|
4116
4157
|
onClick: (event2) => {
|
|
@@ -4226,19 +4267,7 @@ function AdsWorkbench({
|
|
|
4226
4267
|
scenes: storyboardScenes,
|
|
4227
4268
|
canAdd: !busy && !!ad,
|
|
4228
4269
|
onAdd: addScene,
|
|
4229
|
-
onCopy: () => ad && void copy2(
|
|
4230
|
-
[
|
|
4231
|
-
adAgentPrompt(ad.data.brief, void 0, projectId),
|
|
4232
|
-
...ad.data.clips.map(
|
|
4233
|
-
(item) => adAgentPrompt(
|
|
4234
|
-
ad.data.brief,
|
|
4235
|
-
item,
|
|
4236
|
-
projectId,
|
|
4237
|
-
assets.find((asset2) => asset2.objectId === item.assetId)
|
|
4238
|
-
)
|
|
4239
|
-
)
|
|
4240
|
-
].join("\n\n")
|
|
4241
|
-
)
|
|
4270
|
+
onCopy: () => ad && void copy2(adStoryboardPrompt(ad.data.brief, ad.data.clips, projectId, assets))
|
|
4242
4271
|
}
|
|
4243
4272
|
) : /* @__PURE__ */ React8.createElement("section", { className: "ad-panel ad-storyboard" }, /* @__PURE__ */ React8.createElement("div", { className: "ad-section-heading" }, /* @__PURE__ */ React8.createElement("h1", null, "Storyboard")), /* @__PURE__ */ React8.createElement("div", { className: "ad-empty" }, /* @__PURE__ */ React8.createElement("h2", null, "Storyboard"), /* @__PURE__ */ React8.createElement("p", null, "Enable and configure the Advertising Storyboard plugin to edit shots.")))), !loadingProject && page === "compare" && (CompareView ? /* @__PURE__ */ React8.createElement(
|
|
4244
4273
|
CompareView,
|