@tangle-network/agent-app 0.46.5 → 0.46.7
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/{chunk-LEGZX5MQ.js → chunk-OOE2TPY2.js} +6 -2
- package/dist/chunk-OOE2TPY2.js.map +1 -0
- package/dist/studio/generation.d.ts +10 -2
- package/dist/studio/index.js +3 -1
- package/dist/studio-react/composer-option-controls.d.ts +10 -3
- package/dist/studio-react/generation-notice.d.ts +3 -4
- package/dist/studio-react/index.js +132 -53
- package/dist/studio-react/index.js.map +1 -1
- package/dist/studio-react/studio-generation-screen.d.ts +8 -0
- package/dist/theme/tokens.css +0 -2
- package/package.json +1 -1
- package/dist/chunk-LEGZX5MQ.js.map +0 -1
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
hashSeed,
|
|
17
17
|
imageToVideoSibling,
|
|
18
18
|
isLocalGeneration,
|
|
19
|
+
laneUnavailable,
|
|
19
20
|
latestBatchOf,
|
|
20
21
|
mergeGenerationPages,
|
|
21
22
|
mergeLiveGeneration,
|
|
22
23
|
mergeLoaderAndLive,
|
|
23
|
-
modelMessage,
|
|
24
24
|
normalizeImageCount,
|
|
25
25
|
normalizeVaultPath,
|
|
26
26
|
optimisticGeneration,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
textToVideoSibling,
|
|
35
35
|
userSafeGenerationMessage,
|
|
36
36
|
validateCustomImageSize
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-OOE2TPY2.js";
|
|
38
38
|
import {
|
|
39
39
|
useInfiniteScroll
|
|
40
40
|
} from "../chunk-KKBTPZIE.js";
|
|
@@ -108,7 +108,22 @@ function useStudioGenerations(loaderGenerations, options = {}) {
|
|
|
108
108
|
|
|
109
109
|
// src/studio-react/studio-composer.tsx
|
|
110
110
|
import { useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
|
|
111
|
-
import {
|
|
111
|
+
import {
|
|
112
|
+
AudioLines,
|
|
113
|
+
ArrowUp,
|
|
114
|
+
Clock,
|
|
115
|
+
Copy,
|
|
116
|
+
Gauge,
|
|
117
|
+
Image as ImageIcon,
|
|
118
|
+
Mic,
|
|
119
|
+
Monitor,
|
|
120
|
+
Ratio,
|
|
121
|
+
Scaling,
|
|
122
|
+
SlidersHorizontal,
|
|
123
|
+
Sparkles,
|
|
124
|
+
TriangleAlert as TriangleAlert2,
|
|
125
|
+
Video
|
|
126
|
+
} from "lucide-react";
|
|
112
127
|
|
|
113
128
|
// src/studio-react/composer-option-controls.tsx
|
|
114
129
|
import {
|
|
@@ -117,9 +132,10 @@ import {
|
|
|
117
132
|
useId,
|
|
118
133
|
useState as useState2
|
|
119
134
|
} from "react";
|
|
120
|
-
import { ImagePlus, Volume2, VolumeX, X } from "lucide-react";
|
|
135
|
+
import { ImagePlus, TriangleAlert, Volume2, VolumeX, X } from "lucide-react";
|
|
121
136
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
122
137
|
var PILL = "inline-flex h-7 flex-none items-center gap-1.5 whitespace-nowrap rounded-full border border-border bg-card px-2.5 text-[12.5px] font-medium text-foreground transition hover:bg-accent";
|
|
138
|
+
var PILL_LABEL = "[text-box:trim-both_cap_alphabetic]";
|
|
123
139
|
var MENU_PANEL = `flex min-w-[184px] flex-col overflow-y-auto rounded-xl border border-border bg-popover p-1 text-popover-foreground ${OVERLAY_SHADOW}`;
|
|
124
140
|
var MENU_HEADER = "px-2.5 pb-1 pt-1.5 text-[10.5px] font-semibold uppercase tracking-[0.08em] text-muted-foreground";
|
|
125
141
|
function menuRowClass(selected) {
|
|
@@ -223,28 +239,34 @@ function MenuRows({
|
|
|
223
239
|
choices,
|
|
224
240
|
onSelect
|
|
225
241
|
}) {
|
|
226
|
-
return choices.map((choice) =>
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
242
|
+
return choices.map((choice) => {
|
|
243
|
+
const Icon = choice.icon;
|
|
244
|
+
return /* @__PURE__ */ jsxs(
|
|
245
|
+
"button",
|
|
246
|
+
{
|
|
247
|
+
type: "button",
|
|
248
|
+
role: "menuitemradio",
|
|
249
|
+
"aria-checked": choice.value === value,
|
|
250
|
+
onClick: () => onSelect(choice.value),
|
|
251
|
+
className: menuRowClass(choice.value === value),
|
|
252
|
+
children: [
|
|
253
|
+
Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": true, className: "h-3.5 w-3.5 shrink-0", strokeWidth: 1.5 }),
|
|
254
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: choice.label }),
|
|
255
|
+
choice.value === value && /* @__PURE__ */ jsx(CheckGlyph, { className: "ml-auto h-3.5 w-3.5 shrink-0 text-primary" })
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
String(choice.value)
|
|
259
|
+
);
|
|
260
|
+
});
|
|
241
261
|
}
|
|
242
262
|
function MenuPill({
|
|
243
263
|
label,
|
|
244
264
|
value,
|
|
245
265
|
choices,
|
|
246
266
|
onSelect,
|
|
247
|
-
className
|
|
267
|
+
className,
|
|
268
|
+
icon: Icon,
|
|
269
|
+
trigger = "pill"
|
|
248
270
|
}) {
|
|
249
271
|
const [open, setOpen] = useState2(false);
|
|
250
272
|
const { containerRef, triggerRef, panelRef, triggerProps } = usePopover(open, setOpen);
|
|
@@ -260,10 +282,11 @@ function MenuPill({
|
|
|
260
282
|
title: label,
|
|
261
283
|
"aria-label": label,
|
|
262
284
|
onClick: () => setOpen(!open),
|
|
263
|
-
className: `${PILL} ${className ?? ""}`,
|
|
285
|
+
className: `${trigger === "text" ? "inline-flex h-7 flex-none items-center gap-1 whitespace-nowrap rounded-full px-2 text-[12.5px] font-medium text-primary transition hover:bg-accent" : PILL} ${className ?? ""}`,
|
|
264
286
|
children: [
|
|
265
|
-
/* @__PURE__ */ jsx(
|
|
266
|
-
/* @__PURE__ */ jsx(
|
|
287
|
+
Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": true, className: "h-3.5 w-3.5 shrink-0 text-muted-foreground", strokeWidth: 1.5 }),
|
|
288
|
+
/* @__PURE__ */ jsx("span", { className: PILL_LABEL, children: selected?.label ?? "\u2014" }),
|
|
289
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: `h-3 w-3 shrink-0 ${trigger === "text" ? "text-primary" : "text-muted-foreground"}` })
|
|
267
290
|
]
|
|
268
291
|
}
|
|
269
292
|
),
|
|
@@ -300,7 +323,8 @@ function OptionPill({
|
|
|
300
323
|
choices,
|
|
301
324
|
onSelect,
|
|
302
325
|
bandRef,
|
|
303
|
-
custom
|
|
326
|
+
custom,
|
|
327
|
+
icon: Icon
|
|
304
328
|
}) {
|
|
305
329
|
const [open, setOpen] = useState2(false);
|
|
306
330
|
const [customOpen, setCustomOpen] = useState2(false);
|
|
@@ -327,7 +351,8 @@ function OptionPill({
|
|
|
327
351
|
},
|
|
328
352
|
className: PILL,
|
|
329
353
|
children: [
|
|
330
|
-
/* @__PURE__ */ jsx(
|
|
354
|
+
Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": true, className: "h-3.5 w-3.5 shrink-0 text-muted-foreground", strokeWidth: 1.5 }),
|
|
355
|
+
/* @__PURE__ */ jsx("span", { className: PILL_LABEL, children: selected?.label ?? "\u2014" }),
|
|
331
356
|
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground" })
|
|
332
357
|
]
|
|
333
358
|
}
|
|
@@ -452,7 +477,7 @@ function AudioTogglePill({ on, onToggle }) {
|
|
|
452
477
|
className: `${PILL} ${on ? "" : "text-muted-foreground"}`,
|
|
453
478
|
children: [
|
|
454
479
|
on ? /* @__PURE__ */ jsx(Volume2, { className: "h-4 w-4 shrink-0", strokeWidth: 1.5 }) : /* @__PURE__ */ jsx(VolumeX, { className: "h-4 w-4 shrink-0", strokeWidth: 1.5 }),
|
|
455
|
-
/* @__PURE__ */ jsx("span", { children: on ? "Audio on" : "Audio off" })
|
|
480
|
+
/* @__PURE__ */ jsx("span", { className: PILL_LABEL, children: on ? "Audio on" : "Audio off" })
|
|
456
481
|
]
|
|
457
482
|
}
|
|
458
483
|
);
|
|
@@ -473,7 +498,7 @@ function ReferencePill({
|
|
|
473
498
|
if (url) {
|
|
474
499
|
return /* @__PURE__ */ jsxs("div", { className: `${PILL} border-primary bg-primary/10 pr-1.5 text-primary hover:bg-primary/10`, children: [
|
|
475
500
|
/* @__PURE__ */ jsx("img", { src: url, alt: "", className: "h-[18px] w-[18px] shrink-0 rounded-[5px] object-cover" }),
|
|
476
|
-
/* @__PURE__ */ jsx("span", { children: "Reference" }),
|
|
501
|
+
/* @__PURE__ */ jsx("span", { className: PILL_LABEL, children: "Reference" }),
|
|
477
502
|
/* @__PURE__ */ jsx(
|
|
478
503
|
"button",
|
|
479
504
|
{
|
|
@@ -517,7 +542,7 @@ function ReferencePill({
|
|
|
517
542
|
className: PILL,
|
|
518
543
|
children: [
|
|
519
544
|
/* @__PURE__ */ jsx(ImagePlus, { className: "h-4 w-4 shrink-0 text-muted-foreground", strokeWidth: 1.5 }),
|
|
520
|
-
/* @__PURE__ */ jsx("span", { children: "Reference image" })
|
|
545
|
+
/* @__PURE__ */ jsx("span", { className: PILL_LABEL, children: "Reference image" })
|
|
521
546
|
]
|
|
522
547
|
}
|
|
523
548
|
),
|
|
@@ -578,6 +603,7 @@ function ModelPill({
|
|
|
578
603
|
value,
|
|
579
604
|
displayName,
|
|
580
605
|
provider,
|
|
606
|
+
unavailable,
|
|
581
607
|
onSelect,
|
|
582
608
|
bandRef
|
|
583
609
|
}) {
|
|
@@ -593,12 +619,13 @@ function ModelPill({
|
|
|
593
619
|
...triggerProps,
|
|
594
620
|
"aria-controls": open ? panelId : void 0,
|
|
595
621
|
title: "Model",
|
|
596
|
-
"aria-label": `Model: ${displayName}`,
|
|
622
|
+
"aria-label": `Model: ${displayName}${unavailable ? " (unavailable)" : ""}`,
|
|
597
623
|
onClick: () => setOpen(!open),
|
|
598
|
-
className: PILL
|
|
624
|
+
className: `${PILL}${unavailable ? " border-warning/50" : ""}`,
|
|
599
625
|
children: [
|
|
626
|
+
unavailable && /* @__PURE__ */ jsx(TriangleAlert, { "aria-hidden": true, className: "h-3.5 w-3.5 shrink-0 text-warning", strokeWidth: 2 }),
|
|
600
627
|
provider && /* @__PURE__ */ jsx(ProviderLogo, { provider, size: 14 }),
|
|
601
|
-
/* @__PURE__ */ jsx("span", { className:
|
|
628
|
+
/* @__PURE__ */ jsx("span", { className: `max-w-[168px] truncate ${PILL_LABEL}`, children: displayName }),
|
|
602
629
|
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground" })
|
|
603
630
|
]
|
|
604
631
|
}
|
|
@@ -621,16 +648,18 @@ function ModelPill({
|
|
|
621
648
|
type: "button",
|
|
622
649
|
role: "menuitemradio",
|
|
623
650
|
"aria-checked": model.id === value,
|
|
624
|
-
disabled: model.status === "unavailable",
|
|
625
651
|
onClick: () => {
|
|
626
652
|
onSelect(model.id);
|
|
627
653
|
setOpen(false);
|
|
628
654
|
},
|
|
629
|
-
className:
|
|
655
|
+
className: menuRowClass(model.id === value),
|
|
630
656
|
children: [
|
|
631
|
-
model.provider && /* @__PURE__ */ jsx(ProviderLogo, { provider: model.provider, size: 14 }),
|
|
632
|
-
/* @__PURE__ */ jsx("span", { className:
|
|
633
|
-
model.status
|
|
657
|
+
model.provider && /* @__PURE__ */ jsx("span", { className: model.status === "unavailable" ? "opacity-45" : void 0, children: /* @__PURE__ */ jsx(ProviderLogo, { provider: model.provider, size: 14 }) }),
|
|
658
|
+
/* @__PURE__ */ jsx("span", { className: `truncate${model.status === "unavailable" ? " opacity-45" : ""}`, children: model.name || model.id }),
|
|
659
|
+
model.status === "unavailable" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
660
|
+
/* @__PURE__ */ jsx("span", { className: "ml-auto shrink-0 text-[11px] text-warning", children: "Unavailable" }),
|
|
661
|
+
/* @__PURE__ */ jsx(TriangleAlert, { "aria-hidden": true, className: "h-3.5 w-3.5 shrink-0 text-warning", strokeWidth: 2 })
|
|
662
|
+
] }) : model.status === "limited" && /* @__PURE__ */ jsx("span", { className: "ml-auto shrink-0 text-[11px] capitalize text-muted-foreground", children: model.status }),
|
|
634
663
|
model.id === value && /* @__PURE__ */ jsx(CheckGlyph, { className: `${model.status === "available" ? "ml-auto " : ""}h-3.5 w-3.5 shrink-0 text-primary` })
|
|
635
664
|
]
|
|
636
665
|
},
|
|
@@ -679,6 +708,17 @@ var PARAM_LABELS = {
|
|
|
679
708
|
voice: "Voice",
|
|
680
709
|
speed: "Speed"
|
|
681
710
|
};
|
|
711
|
+
var PARAM_ICONS = {
|
|
712
|
+
size: Scaling,
|
|
713
|
+
quality: Sparkles,
|
|
714
|
+
n: Copy,
|
|
715
|
+
duration: Clock,
|
|
716
|
+
resolution: Monitor,
|
|
717
|
+
aspect_ratio: Ratio,
|
|
718
|
+
mode: SlidersHorizontal,
|
|
719
|
+
voice: Mic,
|
|
720
|
+
speed: Gauge
|
|
721
|
+
};
|
|
682
722
|
var SPEED_PRESETS = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 4];
|
|
683
723
|
function choicesFor(param, meta) {
|
|
684
724
|
const { min, max } = meta;
|
|
@@ -696,7 +736,7 @@ function visibleParams(type, options) {
|
|
|
696
736
|
}
|
|
697
737
|
function defaultModelId(type, catalog, curated) {
|
|
698
738
|
const preferred = preferredModelId(type, catalog);
|
|
699
|
-
if (preferred && curated.some((model) => model.id === preferred)) return preferred;
|
|
739
|
+
if (preferred && curated.some((model) => model.id === preferred && model.status !== "unavailable")) return preferred;
|
|
700
740
|
return curated.find((model) => model.status !== "unavailable")?.id ?? curated[0]?.id ?? "";
|
|
701
741
|
}
|
|
702
742
|
function StudioComposer({
|
|
@@ -748,9 +788,21 @@ function StudioComposer({
|
|
|
748
788
|
const laneModels = useMemo2(() => catalog?.models[type] ?? [], [catalog, type]);
|
|
749
789
|
const curatedModels = useMemo2(() => curateComposerModels(type, laneModels), [laneModels, type]);
|
|
750
790
|
const retained = selectedModels[type];
|
|
751
|
-
const retainedUsable = retained !== void 0 && (!catalog || Boolean(textToVideoSibling(retained)) || curatedModels.some((model) => model.id === retained
|
|
791
|
+
const retainedUsable = retained !== void 0 && (!catalog || Boolean(textToVideoSibling(retained)) || curatedModels.some((model) => model.id === retained));
|
|
752
792
|
const modelId = retainedUsable ? retained : defaultModelId(type, catalog, curatedModels);
|
|
753
793
|
const modelOption = laneModels.find((model) => model.id === modelId);
|
|
794
|
+
useEffect3(() => {
|
|
795
|
+
setSelectedModels((current) => {
|
|
796
|
+
const retainedId = current[type];
|
|
797
|
+
if (!retainedId || !catalog) return current;
|
|
798
|
+
if (textToVideoSibling(retainedId)) return current;
|
|
799
|
+
const row = (catalog.models[type] ?? []).find((model) => model.id === retainedId);
|
|
800
|
+
if (!row || row.status !== "unavailable") return current;
|
|
801
|
+
const next = { ...current };
|
|
802
|
+
delete next[type];
|
|
803
|
+
return next;
|
|
804
|
+
});
|
|
805
|
+
}, [catalog, type]);
|
|
754
806
|
const options = useMemo2(
|
|
755
807
|
() => modelId ? resolveComposerOptions({
|
|
756
808
|
type,
|
|
@@ -776,6 +828,7 @@ function StudioComposer({
|
|
|
776
828
|
const unlistedSibling = !modelOption && Boolean(textToVideoSibling(modelId));
|
|
777
829
|
const referenceSupported = type === "video" && Boolean(imageToVideoSibling(modelId) ?? textToVideoSibling(modelId));
|
|
778
830
|
const modelReady = (Boolean(modelOption) || unlistedSibling) && modelOption?.status !== "unavailable" && !catalogLoading && !catalogError;
|
|
831
|
+
const laneDown = Boolean(catalog) && !catalogLoading && !catalogError && laneUnavailable(curatedModels);
|
|
779
832
|
const canSubmit = Boolean(workspaceId) && modelReady && Boolean(prompt.trim()) && !isSubmitting;
|
|
780
833
|
function selectModel(id) {
|
|
781
834
|
setSelectedModels((current) => ({ ...current, [type]: id }));
|
|
@@ -804,10 +857,7 @@ function StudioComposer({
|
|
|
804
857
|
if (!workspaceId || submitLockRef.current || isSubmitting) return;
|
|
805
858
|
const promptText = prompt.trim();
|
|
806
859
|
if (!promptText) return;
|
|
807
|
-
if (!modelReady)
|
|
808
|
-
if (!catalogLoading) setError("Select an available model");
|
|
809
|
-
return;
|
|
810
|
-
}
|
|
860
|
+
if (!modelReady) return;
|
|
811
861
|
submitLockRef.current = true;
|
|
812
862
|
setIsSubmitting(true);
|
|
813
863
|
setError(null);
|
|
@@ -879,16 +929,19 @@ function StudioComposer({
|
|
|
879
929
|
setIsSubmitting(false);
|
|
880
930
|
}
|
|
881
931
|
}
|
|
882
|
-
const
|
|
883
|
-
const
|
|
884
|
-
const
|
|
932
|
+
const notice = catalogError ?? error;
|
|
933
|
+
const laneLabel = SEGMENTS.find((segment) => segment.type === type).label;
|
|
934
|
+
const laneDownMessage = curatedModels.length > 0 ? `${laneLabel} models are temporarily unavailable` : `No ${laneLabel.toLowerCase()} models are available`;
|
|
885
935
|
return /* @__PURE__ */ jsxs2(
|
|
886
936
|
"section",
|
|
887
937
|
{
|
|
888
938
|
"data-variant": variant,
|
|
889
939
|
className: `rounded-[14px] border border-border bg-card px-2.5 pb-[9px] pt-2 shadow-sm transition focus-within:border-primary focus-within:ring-[3px] focus-within:ring-ring/30 ${className ?? ""}`,
|
|
890
940
|
children: [
|
|
891
|
-
/* @__PURE__ */
|
|
941
|
+
laneDown ? /* @__PURE__ */ jsxs2("p", { className: "flex min-h-0 items-center gap-2 px-1.5 pb-3 pt-1.5 text-[13px] font-medium text-warning", children: [
|
|
942
|
+
/* @__PURE__ */ jsx2(TriangleAlert2, { "aria-hidden": true, className: "h-4 w-4 shrink-0", strokeWidth: 2 }),
|
|
943
|
+
/* @__PURE__ */ jsx2("span", { children: laneDownMessage })
|
|
944
|
+
] }) : /* @__PURE__ */ jsx2(
|
|
892
945
|
"textarea",
|
|
893
946
|
{
|
|
894
947
|
value: prompt,
|
|
@@ -914,6 +967,7 @@ function StudioComposer({
|
|
|
914
967
|
value: modelId,
|
|
915
968
|
displayName: modelOption?.name || modelId || "Select a model",
|
|
916
969
|
provider: modelOption?.provider,
|
|
970
|
+
unavailable: modelOption?.status === "unavailable",
|
|
917
971
|
onSelect: chooseModel,
|
|
918
972
|
bandRef
|
|
919
973
|
}
|
|
@@ -922,6 +976,7 @@ function StudioComposer({
|
|
|
922
976
|
OptionPill,
|
|
923
977
|
{
|
|
924
978
|
label: PARAM_LABELS[param] ?? param,
|
|
979
|
+
icon: PARAM_ICONS[param] ?? SlidersHorizontal,
|
|
925
980
|
value: values[param],
|
|
926
981
|
choices: choicesForPill(param, options?.[param], values[param]),
|
|
927
982
|
onSelect: (value) => setOption(param, value),
|
|
@@ -973,7 +1028,7 @@ function StudioComposer({
|
|
|
973
1028
|
}
|
|
974
1029
|
)
|
|
975
1030
|
] }),
|
|
976
|
-
notice && /* @__PURE__ */ jsx2("p", { className:
|
|
1031
|
+
notice && /* @__PURE__ */ jsx2("p", { className: "px-1.5 pt-1.5 text-[12px] text-destructive", children: notice })
|
|
977
1032
|
]
|
|
978
1033
|
}
|
|
979
1034
|
);
|
|
@@ -1001,8 +1056,8 @@ function GenerationNoticeChip({ className }) {
|
|
|
1001
1056
|
return /* @__PURE__ */ jsxs3(
|
|
1002
1057
|
"p",
|
|
1003
1058
|
{
|
|
1004
|
-
className: `inline-block rounded-full
|
|
1005
|
-
style: { background: "var(--studio-notice-bg)"
|
|
1059
|
+
className: `inline-block rounded-full px-3.5 py-1.5 text-center text-[12px] leading-relaxed text-muted-foreground ${className ?? ""}`,
|
|
1060
|
+
style: { background: "var(--studio-notice-bg)" },
|
|
1006
1061
|
children: [
|
|
1007
1062
|
/* @__PURE__ */ jsx3(Info, { className: "mr-1.5 inline-block h-[14px] w-[14px] align-[-2px] text-primary", strokeWidth: 1.5, "aria-hidden": true }),
|
|
1008
1063
|
"Each prompt starts a new generation \u2014 this chat does not remember the last one."
|
|
@@ -2172,6 +2227,7 @@ function StudioToast({ record, leave }) {
|
|
|
2172
2227
|
function StudioToastProvider({ children }) {
|
|
2173
2228
|
const [toasts, setToasts] = useState8([]);
|
|
2174
2229
|
const [dockLift, setDockLift] = useState8(null);
|
|
2230
|
+
const [mounted, setMounted] = useState8(false);
|
|
2175
2231
|
const sequence = useRef7(0);
|
|
2176
2232
|
const dismissed = useRef7(/* @__PURE__ */ new Set());
|
|
2177
2233
|
const records = useRef7(/* @__PURE__ */ new Map());
|
|
@@ -2196,9 +2252,10 @@ function StudioToastProvider({ children }) {
|
|
|
2196
2252
|
}, []);
|
|
2197
2253
|
const dismiss = useCallback5((id) => leave(id, "dismissed"), [leave]);
|
|
2198
2254
|
const value = useMemo5(() => ({ toast, dismiss, setDockLift }), [dismiss, toast]);
|
|
2255
|
+
useEffect9(() => setMounted(true), []);
|
|
2199
2256
|
return /* @__PURE__ */ jsxs8(StudioToastContext.Provider, { value, children: [
|
|
2200
2257
|
children,
|
|
2201
|
-
|
|
2258
|
+
mounted && createPortal3(
|
|
2202
2259
|
/* @__PURE__ */ jsx9(
|
|
2203
2260
|
"div",
|
|
2204
2261
|
{
|
|
@@ -2653,7 +2710,18 @@ import {
|
|
|
2653
2710
|
useMemo as useMemo9,
|
|
2654
2711
|
useState as useState13
|
|
2655
2712
|
} from "react";
|
|
2656
|
-
import {
|
|
2713
|
+
import {
|
|
2714
|
+
ArrowLeft as ArrowLeft2,
|
|
2715
|
+
AudioLines as AudioLines2,
|
|
2716
|
+
Download as Download3,
|
|
2717
|
+
FolderPlus as FolderPlus3,
|
|
2718
|
+
Image,
|
|
2719
|
+
LayoutGrid,
|
|
2720
|
+
Search,
|
|
2721
|
+
Trash2 as Trash23,
|
|
2722
|
+
Video as Video2,
|
|
2723
|
+
X as X4
|
|
2724
|
+
} from "lucide-react";
|
|
2657
2725
|
|
|
2658
2726
|
// src/studio-react/use-generation-history.ts
|
|
2659
2727
|
import { useCallback as useCallback10, useEffect as useEffect13, useMemo as useMemo8, useRef as useRef11, useState as useState12 } from "react";
|
|
@@ -2798,6 +2866,16 @@ var MORE_SKELETONS = 4;
|
|
|
2798
2866
|
var BAR = "flex min-h-[44px] flex-wrap items-center justify-between gap-3 px-6 pb-[18px] pt-0.5 max-[900px]:px-4";
|
|
2799
2867
|
var SEARCH_INPUT = "h-8 w-[260px] max-w-[52vw] rounded-full border border-border bg-card pl-8 pr-3 text-[13px] text-foreground outline-none placeholder:text-muted-foreground focus:border-primary focus:ring-[3px] focus:ring-ring/30 max-[640px]:w-full max-[640px]:max-w-none";
|
|
2800
2868
|
var OUTLINE_PILL = "inline-flex h-8 items-center gap-1.5 rounded-full border border-border px-3 text-[12.5px] font-medium hover:bg-accent disabled:cursor-not-allowed disabled:opacity-40";
|
|
2869
|
+
var FILTER_ICONS = {
|
|
2870
|
+
all: LayoutGrid,
|
|
2871
|
+
image: Image,
|
|
2872
|
+
video: Video2,
|
|
2873
|
+
speech: AudioLines2
|
|
2874
|
+
};
|
|
2875
|
+
var FILTER_CHOICES = MEDIA_TYPE_FILTERS.map((choice) => ({
|
|
2876
|
+
...choice,
|
|
2877
|
+
icon: FILTER_ICONS[choice.value]
|
|
2878
|
+
}));
|
|
2801
2879
|
var TYPE_NOUNS = {
|
|
2802
2880
|
image: "images",
|
|
2803
2881
|
video: "videos",
|
|
@@ -3048,8 +3126,9 @@ function StudioHistoryScreen({
|
|
|
3048
3126
|
{
|
|
3049
3127
|
label: "Filter by media type",
|
|
3050
3128
|
value: type,
|
|
3051
|
-
choices:
|
|
3052
|
-
onSelect: setType
|
|
3129
|
+
choices: FILTER_CHOICES,
|
|
3130
|
+
onSelect: setType,
|
|
3131
|
+
trigger: "text"
|
|
3053
3132
|
}
|
|
3054
3133
|
)
|
|
3055
3134
|
] })
|