@opengeni/react 3.7.0-canary.5 → 3.7.0-canary.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/README.md +43 -3
- package/dist/artifacts.js +7 -7
- package/dist/{browser-viewer-NTD6UIPR.js → browser-viewer-SS46LUAC.js} +3 -3
- package/dist/chat.d.ts +37 -0
- package/dist/chat.js +315 -0
- package/dist/chat.js.map +1 -0
- package/dist/{chunk-LUYB4SRW.js → chunk-3HIF5IFC.js} +1048 -2439
- package/dist/chunk-3HIF5IFC.js.map +1 -0
- package/dist/{chunk-3IY6UZI6.js → chunk-BQGIXRKV.js} +288 -396
- package/dist/chunk-BQGIXRKV.js.map +1 -0
- package/dist/{chunk-MOWYEBCQ.js → chunk-BXJOQFCD.js} +5 -4
- package/dist/chunk-BXJOQFCD.js.map +1 -0
- package/dist/{chunk-BV5A4OTE.js → chunk-ELIYWBZR.js} +4 -4
- package/dist/chunk-F2CFHN3Y.js +1415 -0
- package/dist/chunk-F2CFHN3Y.js.map +1 -0
- package/dist/chunk-HQV2I5HV.js +124 -0
- package/dist/chunk-HQV2I5HV.js.map +1 -0
- package/dist/{chunk-JT33KZZN.js → chunk-R4KRSFGA.js} +11 -20
- package/dist/chunk-R4KRSFGA.js.map +1 -0
- package/dist/{chunk-KWEZ4MPF.js → chunk-UMECRJRV.js} +63 -60
- package/dist/chunk-UMECRJRV.js.map +1 -0
- package/dist/{chunk-24M4YBCL.js → chunk-VEPNNDNG.js} +4 -4
- package/dist/{chunk-WMGF4Z7X.js → chunk-VRBL3F5E.js} +23 -3
- package/dist/{chunk-WMGF4Z7X.js.map → chunk-VRBL3F5E.js.map} +1 -1
- package/dist/components/model-policy-picker.d.ts +4 -0
- package/dist/components/sandbox-files.d.ts +3 -1
- package/dist/composer.js +6 -5
- package/dist/{computer-viewer-7TEZC6Y2.js → computer-viewer-FWEZISW4.js} +3 -3
- package/dist/hooks/use-session-events.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +92 -36
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +8 -8
- package/dist/{model-policy-picker-menu-R6WXNWJL.js → model-policy-picker-menu-3R336DP2.js} +4 -4
- package/dist/model-policy.d.ts +2 -0
- package/dist/model-policy.js +3 -1
- package/dist/realtime.js +5 -5
- package/dist/session-ui.js +11 -8
- package/dist/session.js +1 -1
- package/package.json +6 -2
- package/src/chat.tsx +393 -0
- package/src/components/model-policy-picker-menu.tsx +92 -71
- package/src/components/model-policy-picker.tsx +21 -18
- package/src/components/sandbox-files.tsx +90 -14
- package/src/components/sandbox-workspace.tsx +16 -1
- package/src/hooks/use-session-events.ts +3 -0
- package/src/hooks/use-session.ts +10 -3
- package/src/index.ts +1 -0
- package/src/model-policy.ts +26 -2
- package/styles/compiled.css +40 -8
- package/styles/tokens.css +2 -2
- package/dist/chunk-3IY6UZI6.js.map +0 -1
- package/dist/chunk-JT33KZZN.js.map +0 -1
- package/dist/chunk-KWEZ4MPF.js.map +0 -1
- package/dist/chunk-LUYB4SRW.js.map +0 -1
- package/dist/chunk-MOWYEBCQ.js.map +0 -1
- /package/dist/{browser-viewer-NTD6UIPR.js.map → browser-viewer-SS46LUAC.js.map} +0 -0
- /package/dist/{chunk-BV5A4OTE.js.map → chunk-ELIYWBZR.js.map} +0 -0
- /package/dist/{chunk-24M4YBCL.js.map → chunk-VEPNNDNG.js.map} +0 -0
- /package/dist/{computer-viewer-7TEZC6Y2.js.map → computer-viewer-FWEZISW4.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-R6WXNWJL.js.map → model-policy-picker-menu-3R336DP2.js.map} +0 -0
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ComposerResponsiveContext,
|
|
3
|
-
usePortalTokenStyle
|
|
4
|
-
} from "./chunk-VZTQ73XT.js";
|
|
5
1
|
import {
|
|
6
2
|
shouldSteerOnKey,
|
|
7
3
|
shouldSubmitOnKey
|
|
@@ -11,142 +7,42 @@ import {
|
|
|
11
7
|
formatBytes,
|
|
12
8
|
formatRelativeTime
|
|
13
9
|
} from "./chunk-PLYRL5ER.js";
|
|
10
|
+
import {
|
|
11
|
+
Tooltip,
|
|
12
|
+
TooltipContent,
|
|
13
|
+
TooltipProvider,
|
|
14
|
+
TooltipTrigger
|
|
15
|
+
} from "./chunk-HQV2I5HV.js";
|
|
16
|
+
import {
|
|
17
|
+
ComposerResponsiveContext,
|
|
18
|
+
usePortalTokenStyle
|
|
19
|
+
} from "./chunk-VZTQ73XT.js";
|
|
14
20
|
import {
|
|
15
21
|
groupPickerRowsByBillingClass
|
|
16
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VRBL3F5E.js";
|
|
17
23
|
import {
|
|
18
24
|
cn
|
|
19
25
|
} from "./chunk-22KP6LR5.js";
|
|
20
26
|
|
|
21
|
-
// src/components/tooltip.tsx
|
|
22
|
-
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
23
|
-
import {
|
|
24
|
-
createContext,
|
|
25
|
-
useContext,
|
|
26
|
-
useLayoutEffect,
|
|
27
|
-
useMemo,
|
|
28
|
-
useRef,
|
|
29
|
-
useState
|
|
30
|
-
} from "react";
|
|
31
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
32
|
-
var TooltipSourceContext = createContext(null);
|
|
33
|
-
function TooltipProvider({
|
|
34
|
-
delayDuration = 300,
|
|
35
|
-
...props
|
|
36
|
-
}) {
|
|
37
|
-
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, ...props });
|
|
38
|
-
}
|
|
39
|
-
function Tooltip({ children, ...props }) {
|
|
40
|
-
const { onOpenChange, ...rootProps } = props;
|
|
41
|
-
const sourceRef = useRef(null);
|
|
42
|
-
const sourcePublishedRef = useRef(false);
|
|
43
|
-
const [source, setSource] = useState(null);
|
|
44
|
-
const ref = useRef((node) => {
|
|
45
|
-
sourceRef.current = node;
|
|
46
|
-
if (sourcePublishedRef.current) setSource(node);
|
|
47
|
-
}).current;
|
|
48
|
-
useLayoutEffect(() => {
|
|
49
|
-
if (rootProps.open === true || rootProps.defaultOpen === true) {
|
|
50
|
-
sourcePublishedRef.current = true;
|
|
51
|
-
setSource(sourceRef.current);
|
|
52
|
-
}
|
|
53
|
-
}, [rootProps.defaultOpen, rootProps.open]);
|
|
54
|
-
const sourceContext = useMemo(() => ({ source, ref }), [ref, source]);
|
|
55
|
-
return /* @__PURE__ */ jsx(TooltipSourceContext.Provider, { value: sourceContext, children: /* @__PURE__ */ jsx(
|
|
56
|
-
TooltipPrimitive.Root,
|
|
57
|
-
{
|
|
58
|
-
"data-slot": "tooltip",
|
|
59
|
-
onOpenChange: (open) => {
|
|
60
|
-
if (open) {
|
|
61
|
-
sourcePublishedRef.current = true;
|
|
62
|
-
setSource(sourceRef.current);
|
|
63
|
-
}
|
|
64
|
-
onOpenChange?.(open);
|
|
65
|
-
},
|
|
66
|
-
...rootProps,
|
|
67
|
-
children
|
|
68
|
-
}
|
|
69
|
-
) });
|
|
70
|
-
}
|
|
71
|
-
function TooltipTrigger({
|
|
72
|
-
asChild = true,
|
|
73
|
-
...props
|
|
74
|
-
}) {
|
|
75
|
-
const sourceRef = useContext(TooltipSourceContext);
|
|
76
|
-
return /* @__PURE__ */ jsx(
|
|
77
|
-
TooltipPrimitive.Trigger,
|
|
78
|
-
{
|
|
79
|
-
"data-slot": "tooltip-trigger",
|
|
80
|
-
asChild,
|
|
81
|
-
ref: (node) => {
|
|
82
|
-
sourceRef?.ref(node);
|
|
83
|
-
},
|
|
84
|
-
...props
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
var tooltipSurfaceStyle = {
|
|
89
|
-
backgroundColor: "var(--og-color-fg)",
|
|
90
|
-
color: "var(--og-color-bg)"
|
|
91
|
-
};
|
|
92
|
-
function TooltipContent({
|
|
93
|
-
className,
|
|
94
|
-
sideOffset = 6,
|
|
95
|
-
children,
|
|
96
|
-
style,
|
|
97
|
-
...props
|
|
98
|
-
}) {
|
|
99
|
-
const source = useContext(TooltipSourceContext);
|
|
100
|
-
const portalStyle = usePortalTokenStyle(source?.source ?? null);
|
|
101
|
-
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
102
|
-
TooltipPrimitive.Content,
|
|
103
|
-
{
|
|
104
|
-
"data-slot": "tooltip-content",
|
|
105
|
-
sideOffset,
|
|
106
|
-
className: cn(
|
|
107
|
-
"og-root z-50 w-fit max-w-xs origin-[var(--radix-tooltip-content-transform-origin)]",
|
|
108
|
-
"rounded-og-md px-2.5 py-1.5 text-og-xs leading-4 text-balance shadow-og-md",
|
|
109
|
-
"animate-og-enter data-[state=closed]:opacity-0 data-[state=closed]:transition-opacity",
|
|
110
|
-
className
|
|
111
|
-
),
|
|
112
|
-
style: { ...portalStyle, ...tooltipSurfaceStyle, ...style },
|
|
113
|
-
...props,
|
|
114
|
-
children: [
|
|
115
|
-
children,
|
|
116
|
-
/* @__PURE__ */ jsx(
|
|
117
|
-
TooltipPrimitive.Arrow,
|
|
118
|
-
{
|
|
119
|
-
className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",
|
|
120
|
-
style: {
|
|
121
|
-
backgroundColor: "var(--og-color-fg)",
|
|
122
|
-
fill: "var(--og-color-fg)"
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
)
|
|
126
|
-
]
|
|
127
|
-
}
|
|
128
|
-
) });
|
|
129
|
-
}
|
|
130
|
-
|
|
131
27
|
// src/timeline/screenshot-lightbox.tsx
|
|
132
28
|
import { DownloadIcon, XIcon } from "lucide-react";
|
|
133
29
|
import { AnimatePresence, motion } from "motion/react";
|
|
134
30
|
import {
|
|
135
|
-
createContext
|
|
31
|
+
createContext,
|
|
136
32
|
useCallback,
|
|
137
|
-
useContext
|
|
33
|
+
useContext,
|
|
138
34
|
useEffect,
|
|
139
|
-
useMemo
|
|
140
|
-
useState
|
|
35
|
+
useMemo,
|
|
36
|
+
useState
|
|
141
37
|
} from "react";
|
|
142
38
|
import { Dialog } from "radix-ui";
|
|
143
|
-
import { Fragment, jsx
|
|
144
|
-
var LightboxContext =
|
|
39
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
40
|
+
var LightboxContext = createContext(null);
|
|
145
41
|
function useLightbox() {
|
|
146
|
-
return
|
|
42
|
+
return useContext(LightboxContext) ?? NOOP;
|
|
147
43
|
}
|
|
148
44
|
function useLightboxOptional() {
|
|
149
|
-
return
|
|
45
|
+
return useContext(LightboxContext);
|
|
150
46
|
}
|
|
151
47
|
var NOOP = { open: () => {
|
|
152
48
|
} };
|
|
@@ -166,16 +62,16 @@ function createLightboxSourceOwner() {
|
|
|
166
62
|
};
|
|
167
63
|
}
|
|
168
64
|
function LightboxProvider({ children }) {
|
|
169
|
-
const ancestor =
|
|
65
|
+
const ancestor = useContext(LightboxContext);
|
|
170
66
|
if (ancestor) {
|
|
171
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
172
68
|
}
|
|
173
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ jsx(LightboxRoot, { children });
|
|
174
70
|
}
|
|
175
71
|
function LightboxRoot({ children }) {
|
|
176
|
-
const [state, setState] =
|
|
177
|
-
const [tokenSource, setTokenSource] =
|
|
178
|
-
const sourceOwner =
|
|
72
|
+
const [state, setState] = useState(null);
|
|
73
|
+
const [tokenSource, setTokenSource] = useState(null);
|
|
74
|
+
const sourceOwner = useMemo(() => createLightboxSourceOwner(), []);
|
|
179
75
|
const portalStyle = usePortalTokenStyle(tokenSource);
|
|
180
76
|
const releaseCurrentSource = useCallback(() => {
|
|
181
77
|
sourceOwner.release();
|
|
@@ -200,11 +96,11 @@ function LightboxRoot({ children }) {
|
|
|
200
96
|
setState(null);
|
|
201
97
|
setTokenSource(null);
|
|
202
98
|
}, [releaseCurrentSource]);
|
|
203
|
-
const controller =
|
|
204
|
-
return /* @__PURE__ */
|
|
99
|
+
const controller = useMemo(() => ({ open }), [open]);
|
|
100
|
+
return /* @__PURE__ */ jsxs(LightboxContext.Provider, { value: controller, children: [
|
|
205
101
|
children,
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ jsx(Dialog.Root, { open: state !== null, onOpenChange: (next) => !next && close(), children: /* @__PURE__ */ jsx(AnimatePresence, { children: state !== null ? /* @__PURE__ */ jsxs(Dialog.Portal, { forceMount: true, children: [
|
|
103
|
+
/* @__PURE__ */ jsx(Dialog.Overlay, { asChild: true, forceMount: true, children: /* @__PURE__ */ jsx(
|
|
208
104
|
motion.div,
|
|
209
105
|
{
|
|
210
106
|
initial: { opacity: 0 },
|
|
@@ -215,14 +111,14 @@ function LightboxRoot({ children }) {
|
|
|
215
111
|
style: portalStyle
|
|
216
112
|
}
|
|
217
113
|
) }),
|
|
218
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ jsx(
|
|
219
115
|
Dialog.Content,
|
|
220
116
|
{
|
|
221
117
|
asChild: true,
|
|
222
118
|
forceMount: true,
|
|
223
119
|
"aria-label": state.label,
|
|
224
120
|
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
225
|
-
children: /* @__PURE__ */
|
|
121
|
+
children: /* @__PURE__ */ jsxs(
|
|
226
122
|
motion.div,
|
|
227
123
|
{
|
|
228
124
|
initial: { opacity: 0, scale: 0.98 },
|
|
@@ -237,11 +133,11 @@ function LightboxRoot({ children }) {
|
|
|
237
133
|
className: "og-root fixed inset-0 z-50 flex items-center justify-center p-6 sm:p-12",
|
|
238
134
|
style: portalStyle,
|
|
239
135
|
children: [
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ jsx(Dialog.Title, { className: "sr-only", children: state.label }),
|
|
137
|
+
/* @__PURE__ */ jsx(Dialog.Description, { className: "sr-only", children: state.caption ?? `Expanded ${state.label.toLowerCase()}` }),
|
|
138
|
+
/* @__PURE__ */ jsxs("figure", { className: "m-0 flex max-h-full max-w-5xl flex-col items-center gap-3", children: [
|
|
139
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex min-h-0 w-fit max-w-full", children: [
|
|
140
|
+
/* @__PURE__ */ jsx(
|
|
245
141
|
"img",
|
|
246
142
|
{
|
|
247
143
|
src: state.src,
|
|
@@ -249,7 +145,7 @@ function LightboxRoot({ children }) {
|
|
|
249
145
|
className: "min-h-0 max-h-[82vh] w-auto max-w-full rounded-og-md border border-white/10 object-contain shadow-og-lg"
|
|
250
146
|
}
|
|
251
147
|
),
|
|
252
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ jsx(
|
|
253
149
|
ScreenshotLightboxControls,
|
|
254
150
|
{
|
|
255
151
|
src: state.src,
|
|
@@ -258,7 +154,7 @@ function LightboxRoot({ children }) {
|
|
|
258
154
|
}
|
|
259
155
|
)
|
|
260
156
|
] }),
|
|
261
|
-
state.caption ? /* @__PURE__ */
|
|
157
|
+
state.caption ? /* @__PURE__ */ jsx("figcaption", { className: "max-w-2xl text-center font-og-mono text-og-xs text-white/55", children: state.caption }) : /* @__PURE__ */ jsx("figcaption", { className: "font-og-mono text-og-xs uppercase tracking-[0.1em] text-white/35", children: "Esc or click outside to close" })
|
|
262
158
|
] })
|
|
263
159
|
]
|
|
264
160
|
}
|
|
@@ -273,8 +169,8 @@ function ScreenshotLightboxControls({
|
|
|
273
169
|
downloadFilename,
|
|
274
170
|
controlLabels
|
|
275
171
|
}) {
|
|
276
|
-
return /* @__PURE__ */
|
|
277
|
-
downloadFilename ? /* @__PURE__ */
|
|
172
|
+
return /* @__PURE__ */ jsxs("div", { className: "absolute -right-3 -top-3 flex items-center gap-2", children: [
|
|
173
|
+
downloadFilename ? /* @__PURE__ */ jsx(
|
|
278
174
|
"a",
|
|
279
175
|
{
|
|
280
176
|
href: src,
|
|
@@ -285,10 +181,10 @@ function ScreenshotLightboxControls({
|
|
|
285
181
|
"transition-colors hover:border-white/30 hover:text-white"
|
|
286
182
|
),
|
|
287
183
|
"aria-label": controlLabels?.download ?? `Download ${downloadFilename}`,
|
|
288
|
-
children: /* @__PURE__ */
|
|
184
|
+
children: /* @__PURE__ */ jsx(DownloadIcon, { className: "size-4" })
|
|
289
185
|
}
|
|
290
186
|
) : null,
|
|
291
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ jsx(
|
|
292
188
|
Dialog.Close,
|
|
293
189
|
{
|
|
294
190
|
className: cn(
|
|
@@ -297,7 +193,7 @@ function ScreenshotLightboxControls({
|
|
|
297
193
|
"transition-colors hover:border-white/30 hover:text-white"
|
|
298
194
|
),
|
|
299
195
|
"aria-label": controlLabels?.close ?? "Close",
|
|
300
|
-
children: /* @__PURE__ */
|
|
196
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "size-4" })
|
|
301
197
|
}
|
|
302
198
|
)
|
|
303
199
|
] });
|
|
@@ -495,20 +391,20 @@ function clearErrorMessage(cause) {
|
|
|
495
391
|
}
|
|
496
392
|
|
|
497
393
|
// src/hooks/use-slash-commands.ts
|
|
498
|
-
import { useCallback as useCallback2, useMemo as
|
|
394
|
+
import { useCallback as useCallback2, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
499
395
|
function useSlashCommands(options) {
|
|
500
396
|
const { commands, context, handlers, value, setValue } = options;
|
|
501
|
-
const [highlight, setHighlight] =
|
|
502
|
-
const [dismissedValue, setDismissedValue] =
|
|
397
|
+
const [highlight, setHighlight] = useState2(0);
|
|
398
|
+
const [dismissedValue, setDismissedValue] = useState2(null);
|
|
503
399
|
const dismissed = dismissedValue !== null && dismissedValue === value;
|
|
504
|
-
const navigatedRef =
|
|
505
|
-
const navTokenRef =
|
|
400
|
+
const navigatedRef = useRef(false);
|
|
401
|
+
const navTokenRef = useRef(value);
|
|
506
402
|
if (navTokenRef.current !== value) {
|
|
507
403
|
navTokenRef.current = value;
|
|
508
404
|
navigatedRef.current = false;
|
|
509
405
|
}
|
|
510
|
-
const parsed =
|
|
511
|
-
const filterCtx =
|
|
406
|
+
const parsed = useMemo2(() => parseCommandLine(value), [value]);
|
|
407
|
+
const filterCtx = useMemo2(
|
|
512
408
|
() => ({
|
|
513
409
|
sessionId: context?.sessionId ?? null,
|
|
514
410
|
status: context?.status ?? null,
|
|
@@ -516,13 +412,13 @@ function useSlashCommands(options) {
|
|
|
516
412
|
}),
|
|
517
413
|
[context?.sessionId, context?.status, context?.permissions]
|
|
518
414
|
);
|
|
519
|
-
const activeCommand =
|
|
415
|
+
const activeCommand = useMemo2(() => {
|
|
520
416
|
if (!parsed || !parsed.hasTrailingSpace) {
|
|
521
417
|
return null;
|
|
522
418
|
}
|
|
523
419
|
return matchCommand(commands, value);
|
|
524
420
|
}, [commands, value, parsed]);
|
|
525
|
-
const items =
|
|
421
|
+
const items = useMemo2(() => {
|
|
526
422
|
if (!parsed) {
|
|
527
423
|
return [];
|
|
528
424
|
}
|
|
@@ -577,7 +473,7 @@ function useSlashCommands(options) {
|
|
|
577
473
|
autocomplete(command);
|
|
578
474
|
}
|
|
579
475
|
}, [items, clampedHighlight, autocomplete]);
|
|
580
|
-
const runningRef =
|
|
476
|
+
const runningRef = useRef(false);
|
|
581
477
|
const runResolved = useCallback2(
|
|
582
478
|
async (command, executionOptions) => {
|
|
583
479
|
if (!parsed || runningRef.current) {
|
|
@@ -705,7 +601,7 @@ function errorMessage2(cause) {
|
|
|
705
601
|
|
|
706
602
|
// src/components/command-palette.tsx
|
|
707
603
|
import { AnimatePresence as AnimatePresence2, motion as motion2 } from "motion/react";
|
|
708
|
-
import { jsx as
|
|
604
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
709
605
|
function CommandPalette({
|
|
710
606
|
open,
|
|
711
607
|
items,
|
|
@@ -717,7 +613,7 @@ function CommandPalette({
|
|
|
717
613
|
label = "Slash commands",
|
|
718
614
|
dangerLabel = "danger"
|
|
719
615
|
}) {
|
|
720
|
-
return /* @__PURE__ */
|
|
616
|
+
return /* @__PURE__ */ jsx2(AnimatePresence2, { children: open ? /* @__PURE__ */ jsxs2(
|
|
721
617
|
motion2.div,
|
|
722
618
|
{
|
|
723
619
|
initial: { opacity: 0, y: 6, scale: 0.99 },
|
|
@@ -729,7 +625,7 @@ function CommandPalette({
|
|
|
729
625
|
"rounded-og-lg border border-og-border bg-og-surface-2 shadow-og-sm"
|
|
730
626
|
),
|
|
731
627
|
children: [
|
|
732
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ jsx2(
|
|
733
629
|
"ul",
|
|
734
630
|
{
|
|
735
631
|
id: listboxId,
|
|
@@ -739,7 +635,7 @@ function CommandPalette({
|
|
|
739
635
|
children: items.map((command, index) => {
|
|
740
636
|
const selected = index === highlight;
|
|
741
637
|
const hint = argHint(command.args);
|
|
742
|
-
return /* @__PURE__ */
|
|
638
|
+
return /* @__PURE__ */ jsxs2(
|
|
743
639
|
"li",
|
|
744
640
|
{
|
|
745
641
|
id: `${listboxId}-option-${index}`,
|
|
@@ -756,8 +652,8 @@ function CommandPalette({
|
|
|
756
652
|
selected ? "bg-og-accent/15 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-3"
|
|
757
653
|
),
|
|
758
654
|
children: [
|
|
759
|
-
/* @__PURE__ */
|
|
760
|
-
/* @__PURE__ */
|
|
655
|
+
/* @__PURE__ */ jsxs2("span", { className: "flex min-w-0 items-baseline gap-1.5", children: [
|
|
656
|
+
/* @__PURE__ */ jsxs2(
|
|
761
657
|
"span",
|
|
762
658
|
{
|
|
763
659
|
className: cn(
|
|
@@ -770,11 +666,11 @@ function CommandPalette({
|
|
|
770
666
|
]
|
|
771
667
|
}
|
|
772
668
|
),
|
|
773
|
-
hint ? /* @__PURE__ */
|
|
669
|
+
hint ? /* @__PURE__ */ jsx2("span", { className: "truncate font-mono text-[11px] text-og-fg-subtle", children: hint }) : null
|
|
774
670
|
] }),
|
|
775
|
-
/* @__PURE__ */
|
|
776
|
-
command.danger ? /* @__PURE__ */
|
|
777
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ jsxs2("span", { className: "ml-auto flex items-center gap-1.5", children: [
|
|
672
|
+
command.danger ? /* @__PURE__ */ jsx2("span", { className: "rounded-og-xs bg-og-status-failed/15 px-1 text-[10px] uppercase tracking-wide text-og-status-failed", children: dangerLabel }) : null,
|
|
673
|
+
/* @__PURE__ */ jsx2("span", { className: "og-command-description truncate text-[12px] text-og-fg-subtle max-sm:hidden", children: command.description })
|
|
778
674
|
] })
|
|
779
675
|
]
|
|
780
676
|
},
|
|
@@ -783,7 +679,7 @@ function CommandPalette({
|
|
|
783
679
|
})
|
|
784
680
|
}
|
|
785
681
|
),
|
|
786
|
-
argHintText ? /* @__PURE__ */
|
|
682
|
+
argHintText ? /* @__PURE__ */ jsx2("div", { className: "border-t border-og-border px-3 py-1.5 font-mono text-[11px] text-og-fg-subtle", children: argHintText }) : null
|
|
787
683
|
]
|
|
788
684
|
}
|
|
789
685
|
) : null });
|
|
@@ -791,8 +687,8 @@ function CommandPalette({
|
|
|
791
687
|
|
|
792
688
|
// src/components/model-picker.tsx
|
|
793
689
|
import { ChevronDownIcon } from "lucide-react";
|
|
794
|
-
import { useId, useMemo as
|
|
795
|
-
import { jsx as
|
|
690
|
+
import { useId, useMemo as useMemo3 } from "react";
|
|
691
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
796
692
|
var EMPTY_CLIENT_MODELS = [];
|
|
797
693
|
function isCodexClientModel(model) {
|
|
798
694
|
return model.id.startsWith("codex/") || model.source === "codex";
|
|
@@ -837,22 +733,22 @@ function ModelPicker({
|
|
|
837
733
|
codexOnly = false
|
|
838
734
|
}) {
|
|
839
735
|
const selectId = useId();
|
|
840
|
-
const effectiveRows =
|
|
736
|
+
const effectiveRows = useMemo3(
|
|
841
737
|
() => rows && rows.length > 0 ? applyCodexOnlyRows(rows, codexOnly) : [],
|
|
842
738
|
[rows, codexOnly]
|
|
843
739
|
);
|
|
844
|
-
const billingGroups =
|
|
740
|
+
const billingGroups = useMemo3(
|
|
845
741
|
() => effectiveRows.length > 0 ? groupPickerRowsByBillingClass(effectiveRows) : [],
|
|
846
742
|
[effectiveRows]
|
|
847
743
|
);
|
|
848
|
-
const providerGroupList =
|
|
744
|
+
const providerGroupList = useMemo3(() => providerGroups(models, codexOnly), [models, codexOnly]);
|
|
849
745
|
const useBillingGroups = Boolean(effectiveRows.length);
|
|
850
746
|
if (models.length === 0 && effectiveRows.length === 0) {
|
|
851
747
|
return null;
|
|
852
748
|
}
|
|
853
|
-
return /* @__PURE__ */
|
|
854
|
-
/* @__PURE__ */
|
|
855
|
-
/* @__PURE__ */
|
|
749
|
+
return /* @__PURE__ */ jsxs3("span", { className: cn("relative inline-flex items-center", className), children: [
|
|
750
|
+
/* @__PURE__ */ jsx3("label", { htmlFor: selectId, className: "sr-only", children: label }),
|
|
751
|
+
/* @__PURE__ */ jsx3(
|
|
856
752
|
"select",
|
|
857
753
|
{
|
|
858
754
|
id: selectId,
|
|
@@ -867,10 +763,10 @@ function ModelPicker({
|
|
|
867
763
|
"focus:outline-hidden focus-visible:outline-hidden",
|
|
868
764
|
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
869
765
|
),
|
|
870
|
-
children: useBillingGroups ? billingGroups.map((group) => /* @__PURE__ */
|
|
766
|
+
children: useBillingGroups ? billingGroups.map((group) => /* @__PURE__ */ jsx3("optgroup", { label: group.label, children: group.rows.map((row) => /* @__PURE__ */ jsx3("option", { value: row.id, disabled: !row.selectable, children: row.unavailableReason ? `${row.label} (${row.unavailableReason})` : row.label }, row.id)) }, group.billingClass)) : providerGroupList.map((group) => /* @__PURE__ */ jsx3("optgroup", { label: group.label, children: group.models.map((model) => /* @__PURE__ */ jsx3("option", { value: model.id, disabled: model.optionDisabled, children: model.label }, model.id)) }, group.label))
|
|
871
767
|
}
|
|
872
768
|
),
|
|
873
|
-
/* @__PURE__ */
|
|
769
|
+
/* @__PURE__ */ jsx3(
|
|
874
770
|
ChevronDownIcon,
|
|
875
771
|
{
|
|
876
772
|
"aria-hidden": true,
|
|
@@ -896,18 +792,18 @@ import {
|
|
|
896
792
|
import { AnimatePresence as AnimatePresence3, motion as motion3 } from "motion/react";
|
|
897
793
|
import {
|
|
898
794
|
cloneElement,
|
|
899
|
-
createContext as
|
|
795
|
+
createContext as createContext2,
|
|
900
796
|
forwardRef,
|
|
901
797
|
useCallback as useCallback3,
|
|
902
|
-
useContext as
|
|
798
|
+
useContext as useContext2,
|
|
903
799
|
useEffect as useEffect2,
|
|
904
800
|
useId as useId2,
|
|
905
|
-
useLayoutEffect
|
|
906
|
-
useMemo as
|
|
907
|
-
useRef as
|
|
908
|
-
useState as
|
|
801
|
+
useLayoutEffect,
|
|
802
|
+
useMemo as useMemo4,
|
|
803
|
+
useRef as useRef2,
|
|
804
|
+
useState as useState3
|
|
909
805
|
} from "react";
|
|
910
|
-
import { Fragment as Fragment2, jsx as
|
|
806
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
911
807
|
function ComposerTip({
|
|
912
808
|
tip,
|
|
913
809
|
children
|
|
@@ -1055,28 +951,28 @@ function useChatComposerController({
|
|
|
1055
951
|
onPaste,
|
|
1056
952
|
messages: messageOverrides
|
|
1057
953
|
}) {
|
|
1058
|
-
const messages =
|
|
954
|
+
const messages = useMemo4(
|
|
1059
955
|
() => ({ ...defaultChatComposerMessages, ...messageOverrides }),
|
|
1060
956
|
[messageOverrides]
|
|
1061
957
|
);
|
|
1062
958
|
const id = useId2();
|
|
1063
|
-
const rootRef =
|
|
1064
|
-
const textareaRef =
|
|
1065
|
-
const pauseButtonRef =
|
|
1066
|
-
const fileInputRef =
|
|
959
|
+
const rootRef = useRef2(null);
|
|
960
|
+
const textareaRef = useRef2(null);
|
|
961
|
+
const pauseButtonRef = useRef2(null);
|
|
962
|
+
const fileInputRef = useRef2(null);
|
|
1067
963
|
const listboxId = useId2();
|
|
1068
964
|
const paused = effectiveControl?.state === "paused";
|
|
1069
|
-
const [controlDetailsOpen, setControlDetailsOpen] =
|
|
1070
|
-
const [paletteMounted, setPaletteMounted] =
|
|
1071
|
-
const [submitting, setSubmitting] =
|
|
1072
|
-
const submittingRef =
|
|
1073
|
-
const controlOperationRef =
|
|
965
|
+
const [controlDetailsOpen, setControlDetailsOpen] = useState3(false);
|
|
966
|
+
const [paletteMounted, setPaletteMounted] = useState3(false);
|
|
967
|
+
const [submitting, setSubmitting] = useState3(false);
|
|
968
|
+
const submittingRef = useRef2(false);
|
|
969
|
+
const controlOperationRef = useRef2(false);
|
|
1074
970
|
const deliveryValue = delivery.value;
|
|
1075
971
|
const setDeliveryValue = delivery.setValue;
|
|
1076
|
-
const mountedRef =
|
|
1077
|
-
const deliveredValueRef =
|
|
1078
|
-
const liveValueRef =
|
|
1079
|
-
const [renderedValue, setRenderedValue] =
|
|
972
|
+
const mountedRef = useRef2(true);
|
|
973
|
+
const deliveredValueRef = useRef2(deliveryValue);
|
|
974
|
+
const liveValueRef = useRef2(deliveryValue);
|
|
975
|
+
const [renderedValue, setRenderedValue] = useState3(deliveryValue);
|
|
1080
976
|
const deliveryChanged = deliveryValue !== deliveredValueRef.current;
|
|
1081
977
|
if (deliveryChanged) {
|
|
1082
978
|
deliveredValueRef.current = deliveryValue;
|
|
@@ -1091,7 +987,7 @@ function useChatComposerController({
|
|
|
1091
987
|
[setDeliveryValue]
|
|
1092
988
|
);
|
|
1093
989
|
const visibleValue = deliveryChanged ? deliveryValue : renderedValue;
|
|
1094
|
-
|
|
990
|
+
useLayoutEffect(() => {
|
|
1095
991
|
if (renderedValue !== liveValueRef.current) {
|
|
1096
992
|
setRenderedValue(liveValueRef.current);
|
|
1097
993
|
}
|
|
@@ -1122,7 +1018,7 @@ function useChatComposerController({
|
|
|
1122
1018
|
}, [id, paused]);
|
|
1123
1019
|
const blockedByAttachment = attachments?.hasUnresolved === true;
|
|
1124
1020
|
const hasReadyAttachment = (attachments?.readyResources.length ?? 0) > 0;
|
|
1125
|
-
const [dragging, setDragging] =
|
|
1021
|
+
const [dragging, setDragging] = useState3(false);
|
|
1126
1022
|
const dragCarriesFiles = (event) => event.dataTransfer !== null && [...event.dataTransfer.types].includes("Files");
|
|
1127
1023
|
const handleDragOver = useCallback3(
|
|
1128
1024
|
(event) => {
|
|
@@ -1149,10 +1045,10 @@ function useChatComposerController({
|
|
|
1149
1045
|
},
|
|
1150
1046
|
[attachments]
|
|
1151
1047
|
);
|
|
1152
|
-
const [notice, setNotice] =
|
|
1153
|
-
const [helpOpen, setHelpOpen] =
|
|
1154
|
-
const [confirmState, setConfirmState] =
|
|
1155
|
-
const pendingConfirm =
|
|
1048
|
+
const [notice, setNotice] = useState3(null);
|
|
1049
|
+
const [helpOpen, setHelpOpen] = useState3(false);
|
|
1050
|
+
const [confirmState, setConfirmState] = useState3(null);
|
|
1051
|
+
const pendingConfirm = useRef2(null);
|
|
1156
1052
|
const settleConfirmation = useCallback3((confirmed) => {
|
|
1157
1053
|
const resolve = pendingConfirm.current;
|
|
1158
1054
|
pendingConfirm.current = null;
|
|
@@ -1166,7 +1062,7 @@ function useChatComposerController({
|
|
|
1166
1062
|
},
|
|
1167
1063
|
[]
|
|
1168
1064
|
);
|
|
1169
|
-
const resizeInputRafRef =
|
|
1065
|
+
const resizeInputRafRef = useRef2(null);
|
|
1170
1066
|
const resizeInput = useCallback3(() => {
|
|
1171
1067
|
if (resizeInputRafRef.current !== null) {
|
|
1172
1068
|
return;
|
|
@@ -1190,7 +1086,7 @@ function useChatComposerController({
|
|
|
1190
1086
|
},
|
|
1191
1087
|
[]
|
|
1192
1088
|
);
|
|
1193
|
-
const handlers =
|
|
1089
|
+
const handlers = useMemo4(
|
|
1194
1090
|
() => ({
|
|
1195
1091
|
notice: (next) => {
|
|
1196
1092
|
setNotice(next);
|
|
@@ -1272,7 +1168,7 @@ function useChatComposerController({
|
|
|
1272
1168
|
},
|
|
1273
1169
|
[attachments]
|
|
1274
1170
|
);
|
|
1275
|
-
const helpCommands =
|
|
1171
|
+
const helpCommands = useMemo4(
|
|
1276
1172
|
() => commands.filter((command) => {
|
|
1277
1173
|
if (command.permission && commandContext) {
|
|
1278
1174
|
const permissions = commandContext.permissions;
|
|
@@ -1383,9 +1279,9 @@ function useChatComposerController({
|
|
|
1383
1279
|
value: visibleValue
|
|
1384
1280
|
};
|
|
1385
1281
|
}
|
|
1386
|
-
var ComposerContext =
|
|
1282
|
+
var ComposerContext = createContext2(null);
|
|
1387
1283
|
function useComposerController() {
|
|
1388
|
-
const controller =
|
|
1284
|
+
const controller = useContext2(ComposerContext);
|
|
1389
1285
|
if (!controller) throw new Error("useChatComposer must be used inside <Composer.Root>");
|
|
1390
1286
|
return controller;
|
|
1391
1287
|
}
|
|
@@ -1396,12 +1292,12 @@ function isRecord(value) {
|
|
|
1396
1292
|
return typeof value === "object" && value !== null;
|
|
1397
1293
|
}
|
|
1398
1294
|
var Root = forwardRef(function ComposerRoot({ controller, children, className, style, responsiveBasis = "viewport", ...props }, forwardedRef) {
|
|
1399
|
-
const responsiveRootRef =
|
|
1400
|
-
const responsiveContext =
|
|
1295
|
+
const responsiveRootRef = useRef2(null);
|
|
1296
|
+
const responsiveContext = useMemo4(
|
|
1401
1297
|
() => ({ responsiveBasis, rootRef: responsiveRootRef }),
|
|
1402
1298
|
[responsiveBasis]
|
|
1403
1299
|
);
|
|
1404
|
-
return /* @__PURE__ */
|
|
1300
|
+
return /* @__PURE__ */ jsx4(ComposerContext.Provider, { value: controller, children: /* @__PURE__ */ jsx4(ComposerResponsiveContext.Provider, { value: responsiveContext, children: /* @__PURE__ */ jsx4(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxs4(
|
|
1405
1301
|
"div",
|
|
1406
1302
|
{
|
|
1407
1303
|
...props,
|
|
@@ -1412,13 +1308,13 @@ var Root = forwardRef(function ComposerRoot({ controller, children, className, s
|
|
|
1412
1308
|
style: { paddingBottom: "env(safe-area-inset-bottom)", ...style },
|
|
1413
1309
|
children: [
|
|
1414
1310
|
children,
|
|
1415
|
-
/* @__PURE__ */
|
|
1311
|
+
/* @__PURE__ */ jsx4(ComposerAnnouncements, {})
|
|
1416
1312
|
]
|
|
1417
1313
|
}
|
|
1418
1314
|
) }) }) });
|
|
1419
1315
|
});
|
|
1420
1316
|
var Frame = forwardRef(function ComposerFrame({ className, ...props }, ref) {
|
|
1421
|
-
return /* @__PURE__ */
|
|
1317
|
+
return /* @__PURE__ */ jsx4("div", { ...props, ref, className: cn("relative", className) });
|
|
1422
1318
|
});
|
|
1423
1319
|
function CommandPalette2({ className }) {
|
|
1424
1320
|
const controller = useComposerController();
|
|
@@ -1428,7 +1324,7 @@ function CommandPalette2({ className }) {
|
|
|
1428
1324
|
return () => setPaletteMounted(false);
|
|
1429
1325
|
}, [setPaletteMounted]);
|
|
1430
1326
|
if (!controller.paletteEnabled) return null;
|
|
1431
|
-
return /* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ jsx4("div", { className, children: /* @__PURE__ */ jsx4(
|
|
1432
1328
|
CommandPalette,
|
|
1433
1329
|
{
|
|
1434
1330
|
open: controller.palette.open && controller.confirmState === null,
|
|
@@ -1448,7 +1344,7 @@ function CommandPalette2({ className }) {
|
|
|
1448
1344
|
}
|
|
1449
1345
|
var Surface = forwardRef(function ComposerSurface({ className, children, ...props }, ref) {
|
|
1450
1346
|
const controller = useComposerController();
|
|
1451
|
-
return /* @__PURE__ */
|
|
1347
|
+
return /* @__PURE__ */ jsxs4(
|
|
1452
1348
|
"div",
|
|
1453
1349
|
{
|
|
1454
1350
|
...props,
|
|
@@ -1464,7 +1360,7 @@ var Surface = forwardRef(function ComposerSurface({ className, children, ...prop
|
|
|
1464
1360
|
className
|
|
1465
1361
|
),
|
|
1466
1362
|
children: [
|
|
1467
|
-
controller.dragging ? /* @__PURE__ */
|
|
1363
|
+
controller.dragging ? /* @__PURE__ */ jsx4(
|
|
1468
1364
|
"div",
|
|
1469
1365
|
{
|
|
1470
1366
|
"aria-hidden": true,
|
|
@@ -1472,8 +1368,8 @@ var Surface = forwardRef(function ComposerSurface({ className, children, ...prop
|
|
|
1472
1368
|
"pointer-events-none absolute inset-0 z-10 flex items-center justify-center",
|
|
1473
1369
|
"rounded-og-lg bg-og-surface-1/85 text-og-menu font-medium text-og-accent backdrop-blur-[1px]"
|
|
1474
1370
|
),
|
|
1475
|
-
children: /* @__PURE__ */
|
|
1476
|
-
/* @__PURE__ */
|
|
1371
|
+
children: /* @__PURE__ */ jsxs4("span", { className: "inline-flex items-center gap-2", children: [
|
|
1372
|
+
/* @__PURE__ */ jsx4(PaperclipIcon, { className: "size-4" }),
|
|
1477
1373
|
controller.messages.dropFiles
|
|
1478
1374
|
] })
|
|
1479
1375
|
}
|
|
@@ -1486,7 +1382,7 @@ var Surface = forwardRef(function ComposerSurface({ className, children, ...prop
|
|
|
1486
1382
|
function PausedState() {
|
|
1487
1383
|
const controller = useComposerController();
|
|
1488
1384
|
if (!controller.paused || !controller.effectiveControl || !controller.hasControl) return null;
|
|
1489
|
-
return /* @__PURE__ */
|
|
1385
|
+
return /* @__PURE__ */ jsx4(
|
|
1490
1386
|
WorkstreamPausedStrip,
|
|
1491
1387
|
{
|
|
1492
1388
|
control: controller.effectiveControl,
|
|
@@ -1506,7 +1402,7 @@ function PausedState() {
|
|
|
1506
1402
|
function RestoredResources() {
|
|
1507
1403
|
const controller = useComposerController();
|
|
1508
1404
|
if (controller.restoredResources.length === 0 || !controller.removeRestoredResource) return null;
|
|
1509
|
-
return /* @__PURE__ */
|
|
1405
|
+
return /* @__PURE__ */ jsx4(
|
|
1510
1406
|
RestoredResourceChips,
|
|
1511
1407
|
{
|
|
1512
1408
|
resources: controller.restoredResources,
|
|
@@ -1518,7 +1414,7 @@ function RestoredResources() {
|
|
|
1518
1414
|
function Attachments() {
|
|
1519
1415
|
const controller = useComposerController();
|
|
1520
1416
|
if (!controller.attachments || controller.attachments.attachments.length === 0) return null;
|
|
1521
|
-
return /* @__PURE__ */
|
|
1417
|
+
return /* @__PURE__ */ jsx4(
|
|
1522
1418
|
AttachmentChips,
|
|
1523
1419
|
{
|
|
1524
1420
|
attachments: controller.attachments.attachments,
|
|
@@ -1532,7 +1428,7 @@ function Attachments() {
|
|
|
1532
1428
|
}
|
|
1533
1429
|
var Input = forwardRef(function ComposerInput({ rows = 1, placeholder, className, "aria-label": ariaLabel, autoFocus = false, ...props }, forwardedRef) {
|
|
1534
1430
|
const controller = useComposerController();
|
|
1535
|
-
const autoFocusedRef =
|
|
1431
|
+
const autoFocusedRef = useRef2(false);
|
|
1536
1432
|
const paletteOpen = controller.paletteEnabled && controller.paletteMounted && controller.palette.open;
|
|
1537
1433
|
useEffect2(() => {
|
|
1538
1434
|
if (!autoFocus || controller.disabled || autoFocusedRef.current) return;
|
|
@@ -1544,7 +1440,7 @@ var Input = forwardRef(function ComposerInput({ rows = 1, placeholder, className
|
|
|
1544
1440
|
});
|
|
1545
1441
|
return () => window.cancelAnimationFrame(frame);
|
|
1546
1442
|
}, [autoFocus, controller.disabled, controller.textareaRef]);
|
|
1547
|
-
return /* @__PURE__ */
|
|
1443
|
+
return /* @__PURE__ */ jsx4(
|
|
1548
1444
|
"textarea",
|
|
1549
1445
|
{
|
|
1550
1446
|
...props,
|
|
@@ -1575,7 +1471,7 @@ function Confirmation() {
|
|
|
1575
1471
|
const controller = useComposerController();
|
|
1576
1472
|
const command = controller.confirmState?.command;
|
|
1577
1473
|
if (!command || !controller.confirmState) return null;
|
|
1578
|
-
return /* @__PURE__ */
|
|
1474
|
+
return /* @__PURE__ */ jsx4(
|
|
1579
1475
|
ConfirmBar,
|
|
1580
1476
|
{
|
|
1581
1477
|
command,
|
|
@@ -1587,7 +1483,7 @@ function Confirmation() {
|
|
|
1587
1483
|
);
|
|
1588
1484
|
}
|
|
1589
1485
|
var Footer = forwardRef(function ComposerFooter({ className, ...props }, ref) {
|
|
1590
|
-
return /* @__PURE__ */
|
|
1486
|
+
return /* @__PURE__ */ jsx4(
|
|
1591
1487
|
"div",
|
|
1592
1488
|
{
|
|
1593
1489
|
...props,
|
|
@@ -1603,7 +1499,7 @@ var Footer = forwardRef(function ComposerFooter({ className, ...props }, ref) {
|
|
|
1603
1499
|
});
|
|
1604
1500
|
var Controls = forwardRef(
|
|
1605
1501
|
function ComposerControls({ className, ...props }, ref) {
|
|
1606
|
-
return /* @__PURE__ */
|
|
1502
|
+
return /* @__PURE__ */ jsx4(
|
|
1607
1503
|
"span",
|
|
1608
1504
|
{
|
|
1609
1505
|
...props,
|
|
@@ -1619,7 +1515,7 @@ var Controls = forwardRef(
|
|
|
1619
1515
|
);
|
|
1620
1516
|
var Hint = forwardRef(function ComposerHint({ className, children, ...props }, ref) {
|
|
1621
1517
|
const controller = useComposerController();
|
|
1622
|
-
return /* @__PURE__ */
|
|
1518
|
+
return /* @__PURE__ */ jsx4(
|
|
1623
1519
|
"span",
|
|
1624
1520
|
{
|
|
1625
1521
|
...props,
|
|
@@ -1633,7 +1529,7 @@ var Hint = forwardRef(function ComposerHint({ className, children, ...props }, r
|
|
|
1633
1529
|
);
|
|
1634
1530
|
});
|
|
1635
1531
|
var Actions = forwardRef(function ComposerActions({ className, ...props }, ref) {
|
|
1636
|
-
return /* @__PURE__ */
|
|
1532
|
+
return /* @__PURE__ */ jsx4(
|
|
1637
1533
|
"span",
|
|
1638
1534
|
{
|
|
1639
1535
|
...props,
|
|
@@ -1651,8 +1547,8 @@ var AttachButton = forwardRef(
|
|
|
1651
1547
|
const controller = useComposerController();
|
|
1652
1548
|
if (!controller.attachments) return null;
|
|
1653
1549
|
const tip = title ?? controller.messages.attachFiles;
|
|
1654
|
-
return /* @__PURE__ */
|
|
1655
|
-
/* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1551
|
+
/* @__PURE__ */ jsx4(
|
|
1656
1552
|
"input",
|
|
1657
1553
|
{
|
|
1658
1554
|
ref: controller.fileInputRef,
|
|
@@ -1664,7 +1560,7 @@ var AttachButton = forwardRef(
|
|
|
1664
1560
|
onChange: controller.handleFileChange
|
|
1665
1561
|
}
|
|
1666
1562
|
),
|
|
1667
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
|
|
1668
1564
|
"button",
|
|
1669
1565
|
{
|
|
1670
1566
|
...props,
|
|
@@ -1679,7 +1575,7 @@ var AttachButton = forwardRef(
|
|
|
1679
1575
|
"disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:size-11",
|
|
1680
1576
|
className
|
|
1681
1577
|
),
|
|
1682
|
-
children: children ?? /* @__PURE__ */
|
|
1578
|
+
children: children ?? /* @__PURE__ */ jsx4(PaperclipIcon, { className: "size-4" })
|
|
1683
1579
|
}
|
|
1684
1580
|
) })
|
|
1685
1581
|
] });
|
|
@@ -1695,7 +1591,7 @@ function ModelPicker2({
|
|
|
1695
1591
|
codexOnly
|
|
1696
1592
|
}) {
|
|
1697
1593
|
const controller = useComposerController();
|
|
1698
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ jsx4(
|
|
1699
1595
|
ModelPicker,
|
|
1700
1596
|
{
|
|
1701
1597
|
models,
|
|
@@ -1715,7 +1611,7 @@ var PauseButton = forwardRef(
|
|
|
1715
1611
|
if (!controller.effectiveControl || controller.paused || !controller.hasControl) return null;
|
|
1716
1612
|
const busy = controller.pausing || controller.resuming;
|
|
1717
1613
|
const tip = title ?? controller.messages.pauseTitle;
|
|
1718
|
-
return /* @__PURE__ */
|
|
1614
|
+
return /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
|
|
1719
1615
|
"button",
|
|
1720
1616
|
{
|
|
1721
1617
|
...props,
|
|
@@ -1731,7 +1627,7 @@ var PauseButton = forwardRef(
|
|
|
1731
1627
|
"disabled:opacity-50",
|
|
1732
1628
|
className
|
|
1733
1629
|
),
|
|
1734
|
-
children: children ?? (busy ? /* @__PURE__ */
|
|
1630
|
+
children: children ?? (busy ? /* @__PURE__ */ jsx4(LoaderCircleIcon, { className: "size-3.5 animate-og-spin" }) : /* @__PURE__ */ jsx4(PauseIcon, { className: "size-3.5 fill-current" }))
|
|
1735
1631
|
}
|
|
1736
1632
|
) });
|
|
1737
1633
|
}
|
|
@@ -1740,7 +1636,7 @@ var SendButton = forwardRef(
|
|
|
1740
1636
|
function ComposerSendButton({ className, "aria-label": ariaLabel, title, children, ...props }, ref) {
|
|
1741
1637
|
const controller = useComposerController();
|
|
1742
1638
|
const tip = title ?? (controller.paused ? controller.messages.sendAndResumeTitle : controller.messages.sendTitle);
|
|
1743
|
-
return /* @__PURE__ */
|
|
1639
|
+
return /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
|
|
1744
1640
|
"button",
|
|
1745
1641
|
{
|
|
1746
1642
|
...props,
|
|
@@ -1758,14 +1654,14 @@ var SendButton = forwardRef(
|
|
|
1758
1654
|
"disabled:cursor-not-allowed disabled:bg-og-surface-3 disabled:text-og-fg-subtle disabled:shadow-none",
|
|
1759
1655
|
className
|
|
1760
1656
|
),
|
|
1761
|
-
children: children ?? (controller.sending ? /* @__PURE__ */
|
|
1657
|
+
children: children ?? (controller.sending ? /* @__PURE__ */ jsx4(LoaderCircleIcon, { className: "size-4 animate-og-spin" }) : /* @__PURE__ */ jsx4(ArrowUpIcon, { className: "size-4" }))
|
|
1762
1658
|
}
|
|
1763
1659
|
) });
|
|
1764
1660
|
}
|
|
1765
1661
|
);
|
|
1766
1662
|
function Help() {
|
|
1767
1663
|
const controller = useComposerController();
|
|
1768
|
-
return /* @__PURE__ */
|
|
1664
|
+
return /* @__PURE__ */ jsx4(AnimatePresence3, { children: controller.helpOpen ? /* @__PURE__ */ jsx4(
|
|
1769
1665
|
HelpPanel,
|
|
1770
1666
|
{
|
|
1771
1667
|
commands: controller.helpCommands,
|
|
@@ -1776,8 +1672,8 @@ function Help() {
|
|
|
1776
1672
|
}
|
|
1777
1673
|
function Status() {
|
|
1778
1674
|
const controller = useComposerController();
|
|
1779
|
-
return /* @__PURE__ */
|
|
1780
|
-
/* @__PURE__ */
|
|
1675
|
+
return /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1676
|
+
/* @__PURE__ */ jsx4(AnimatePresence3, { children: controller.activeNotice ? /* @__PURE__ */ jsx4(
|
|
1781
1677
|
motion3.p,
|
|
1782
1678
|
{
|
|
1783
1679
|
initial: { opacity: 0, height: 0 },
|
|
@@ -1790,9 +1686,9 @@ function Status() {
|
|
|
1790
1686
|
children: controller.activeNotice.message
|
|
1791
1687
|
}
|
|
1792
1688
|
) : null }),
|
|
1793
|
-
controller.draftConflict ? /* @__PURE__ */
|
|
1794
|
-
/* @__PURE__ */
|
|
1795
|
-
/* @__PURE__ */
|
|
1689
|
+
controller.draftConflict ? /* @__PURE__ */ jsxs4("div", { className: "mt-1.5 flex flex-wrap items-center gap-2 px-1 text-og-xs text-og-status-failed", children: [
|
|
1690
|
+
/* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1", children: controller.messages.draftConflict }),
|
|
1691
|
+
/* @__PURE__ */ jsx4(
|
|
1796
1692
|
"button",
|
|
1797
1693
|
{
|
|
1798
1694
|
type: "button",
|
|
@@ -1801,7 +1697,7 @@ function Status() {
|
|
|
1801
1697
|
children: controller.messages.useOtherDraft
|
|
1802
1698
|
}
|
|
1803
1699
|
),
|
|
1804
|
-
/* @__PURE__ */
|
|
1700
|
+
/* @__PURE__ */ jsx4(
|
|
1805
1701
|
"button",
|
|
1806
1702
|
{
|
|
1807
1703
|
type: "button",
|
|
@@ -1815,9 +1711,9 @@ function Status() {
|
|
|
1815
1711
|
}
|
|
1816
1712
|
function ComposerAnnouncements() {
|
|
1817
1713
|
const controller = useComposerController();
|
|
1818
|
-
return /* @__PURE__ */
|
|
1819
|
-
controller.activeNotice ? /* @__PURE__ */
|
|
1820
|
-
controller.draftConflict ? /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ jsxs4("div", { className: "sr-only", children: [
|
|
1715
|
+
controller.activeNotice ? /* @__PURE__ */ jsx4("p", { role: controller.activeNotice.tone === "error" ? "alert" : "status", children: controller.activeNotice.message }) : null,
|
|
1716
|
+
controller.draftConflict ? /* @__PURE__ */ jsx4("p", { role: "alert", children: controller.messages.draftConflict }) : null
|
|
1821
1717
|
] });
|
|
1822
1718
|
}
|
|
1823
1719
|
function mergeRefs(...refs) {
|
|
@@ -1847,10 +1743,10 @@ function WorkstreamPausedStrip({
|
|
|
1847
1743
|
const broaderOptions = control.resumeOptions.filter(
|
|
1848
1744
|
(option) => option !== primary && option.scope !== "selected" && (option.scope !== "workspace" || canControlWorkspace)
|
|
1849
1745
|
);
|
|
1850
|
-
return /* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
1852
|
-
/* @__PURE__ */
|
|
1853
|
-
/* @__PURE__ */
|
|
1746
|
+
return /* @__PURE__ */ jsxs4("div", { className: "border-b border-og-status-waiting/25 bg-og-status-waiting/[0.07]", children: [
|
|
1747
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2 px-3 py-2", children: [
|
|
1748
|
+
/* @__PURE__ */ jsx4(PauseIcon, { className: "size-3.5 shrink-0 text-og-status-waiting" }),
|
|
1749
|
+
/* @__PURE__ */ jsxs4(
|
|
1854
1750
|
"button",
|
|
1855
1751
|
{
|
|
1856
1752
|
type: "button",
|
|
@@ -1858,12 +1754,12 @@ function WorkstreamPausedStrip({
|
|
|
1858
1754
|
onClick: () => onOpenChange(!open),
|
|
1859
1755
|
"aria-expanded": open,
|
|
1860
1756
|
children: [
|
|
1861
|
-
/* @__PURE__ */
|
|
1862
|
-
/* @__PURE__ */
|
|
1757
|
+
/* @__PURE__ */ jsx4("span", { className: "block truncate text-og-xs font-medium text-og-fg", children: cause }),
|
|
1758
|
+
/* @__PURE__ */ jsx4("span", { className: "block truncate text-[11px] text-og-fg-muted", children: queuedAheadCount > 0 ? messages.queuedAhead(queuedAheadCount) : sending ? messages.resumingAndSending : messages.nextMessageResumes })
|
|
1863
1759
|
]
|
|
1864
1760
|
}
|
|
1865
1761
|
),
|
|
1866
|
-
/* @__PURE__ */
|
|
1762
|
+
/* @__PURE__ */ jsxs4(
|
|
1867
1763
|
"button",
|
|
1868
1764
|
{
|
|
1869
1765
|
type: "button",
|
|
@@ -1872,47 +1768,47 @@ function WorkstreamPausedStrip({
|
|
|
1872
1768
|
disabled: busy,
|
|
1873
1769
|
onClick: onResume,
|
|
1874
1770
|
children: [
|
|
1875
|
-
busy ? /* @__PURE__ */
|
|
1876
|
-
/* @__PURE__ */
|
|
1877
|
-
/* @__PURE__ */
|
|
1771
|
+
busy ? /* @__PURE__ */ jsx4(LoaderCircleIcon, { className: "size-3.5 animate-og-spin" }) : /* @__PURE__ */ jsx4(PlayIcon, { className: "size-3.5 fill-current" }),
|
|
1772
|
+
/* @__PURE__ */ jsx4("span", { className: "og-composer-resume-label-long hidden min-[400px]:inline", children: messages.resumeThisWorkstream }),
|
|
1773
|
+
/* @__PURE__ */ jsx4("span", { className: "og-composer-resume-label-short min-[400px]:hidden", children: messages.resumeShort })
|
|
1878
1774
|
]
|
|
1879
1775
|
}
|
|
1880
1776
|
),
|
|
1881
|
-
/* @__PURE__ */
|
|
1777
|
+
/* @__PURE__ */ jsx4(
|
|
1882
1778
|
"button",
|
|
1883
1779
|
{
|
|
1884
1780
|
type: "button",
|
|
1885
1781
|
className: "inline-flex size-8 shrink-0 items-center justify-center rounded-og-md text-og-fg-muted hover:bg-og-surface-2 pointer-coarse:size-11",
|
|
1886
1782
|
onClick: () => onOpenChange(!open),
|
|
1887
1783
|
"aria-label": open ? messages.hidePauseDetails : messages.showPauseDetails,
|
|
1888
|
-
children: /* @__PURE__ */
|
|
1784
|
+
children: /* @__PURE__ */ jsx4(ChevronDownIcon2, { className: cn("size-3.5 transition-transform", open && "rotate-180") })
|
|
1889
1785
|
}
|
|
1890
1786
|
)
|
|
1891
1787
|
] }),
|
|
1892
|
-
open ? /* @__PURE__ */
|
|
1893
|
-
/* @__PURE__ */
|
|
1788
|
+
open ? /* @__PURE__ */ jsxs4("div", { className: "border-t border-og-status-waiting/20 px-3 pb-3 pt-2", children: [
|
|
1789
|
+
/* @__PURE__ */ jsx4("ul", { className: "grid gap-2", "aria-label": messages.pauseReasonsLabel, children: control.blockers.map((entry, index) => /* @__PURE__ */ jsxs4(
|
|
1894
1790
|
"li",
|
|
1895
1791
|
{
|
|
1896
1792
|
className: "text-og-xs",
|
|
1897
1793
|
children: [
|
|
1898
|
-
/* @__PURE__ */
|
|
1899
|
-
blockerHref(entry, controlLinks) ? /* @__PURE__ */
|
|
1794
|
+
/* @__PURE__ */ jsx4("span", { className: "font-medium text-og-fg", children: index === 0 ? messages.pausedByLabel : messages.alsoPausedByLabel }),
|
|
1795
|
+
blockerHref(entry, controlLinks) ? /* @__PURE__ */ jsx4(
|
|
1900
1796
|
"a",
|
|
1901
1797
|
{
|
|
1902
1798
|
href: blockerHref(entry, controlLinks),
|
|
1903
1799
|
className: "font-medium text-og-fg underline decoration-og-border-strong underline-offset-2 hover:text-og-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-ring/40",
|
|
1904
1800
|
children: entry.displayName
|
|
1905
1801
|
}
|
|
1906
|
-
) : /* @__PURE__ */
|
|
1907
|
-
entry.reason ? /* @__PURE__ */
|
|
1802
|
+
) : /* @__PURE__ */ jsx4("span", { className: "font-medium text-og-fg", children: entry.displayName }),
|
|
1803
|
+
entry.reason ? /* @__PURE__ */ jsxs4("span", { className: "text-og-fg-muted", children: [
|
|
1908
1804
|
" \xB7 ",
|
|
1909
1805
|
entry.reason
|
|
1910
1806
|
] }) : null,
|
|
1911
|
-
entry.actor ? /* @__PURE__ */
|
|
1807
|
+
entry.actor ? /* @__PURE__ */ jsxs4("span", { className: "text-og-fg-subtle", children: [
|
|
1912
1808
|
" \xB7 ",
|
|
1913
1809
|
entry.actor
|
|
1914
1810
|
] }) : null,
|
|
1915
|
-
entry.changedAt ? /* @__PURE__ */
|
|
1811
|
+
entry.changedAt ? /* @__PURE__ */ jsxs4("span", { className: "text-og-fg-subtle", children: [
|
|
1916
1812
|
" ",
|
|
1917
1813
|
"\xB7 ",
|
|
1918
1814
|
messages.formatRelativeTime(entry.changedAt)
|
|
@@ -1921,11 +1817,11 @@ function WorkstreamPausedStrip({
|
|
|
1921
1817
|
},
|
|
1922
1818
|
`${entry.kind}-${entry.sessionId ?? "workspace"}-${entry.revision}`
|
|
1923
1819
|
)) }),
|
|
1924
|
-
broaderOptions.length > 0 ? /* @__PURE__ */
|
|
1820
|
+
broaderOptions.length > 0 ? /* @__PURE__ */ jsx4("div", { className: "mt-2 flex flex-wrap gap-1.5", children: broaderOptions.map((option) => /* @__PURE__ */ jsx4(
|
|
1925
1821
|
ComposerTip,
|
|
1926
1822
|
{
|
|
1927
1823
|
tip: option.impactCopy,
|
|
1928
|
-
children: /* @__PURE__ */
|
|
1824
|
+
children: /* @__PURE__ */ jsxs4(
|
|
1929
1825
|
"button",
|
|
1930
1826
|
{
|
|
1931
1827
|
type: "button",
|
|
@@ -1933,8 +1829,8 @@ function WorkstreamPausedStrip({
|
|
|
1933
1829
|
onClick: () => onResumeOption(option),
|
|
1934
1830
|
className: "rounded-og-md border border-og-border bg-og-surface-1 px-2 py-1 text-og-xs text-og-fg-muted hover:bg-og-surface-2 hover:text-og-fg pointer-coarse:min-h-10",
|
|
1935
1831
|
children: [
|
|
1936
|
-
/* @__PURE__ */
|
|
1937
|
-
/* @__PURE__ */
|
|
1832
|
+
/* @__PURE__ */ jsx4("span", { className: "block font-medium", children: option.scope === "workspace" ? messages.resumeWorkspace : messages.resumeFromSession }),
|
|
1833
|
+
/* @__PURE__ */ jsx4("span", { className: "block text-[10px] text-og-fg-subtle", children: option.selectedStateAfter === "active" ? messages.sessionCanRun : messages.stillPausedBy(
|
|
1938
1834
|
option.remainingPrimaryBlocker?.displayName ?? messages.narrowerPause
|
|
1939
1835
|
) })
|
|
1940
1836
|
]
|
|
@@ -1955,26 +1851,26 @@ function RestoredResourceChips({
|
|
|
1955
1851
|
messages,
|
|
1956
1852
|
onRemove
|
|
1957
1853
|
}) {
|
|
1958
|
-
return /* @__PURE__ */
|
|
1854
|
+
return /* @__PURE__ */ jsx4(
|
|
1959
1855
|
"div",
|
|
1960
1856
|
{
|
|
1961
1857
|
className: "flex flex-wrap gap-1.5 border-b border-og-border px-3 py-2",
|
|
1962
1858
|
"aria-label": messages.restoredResourcesLabel,
|
|
1963
|
-
children: resources.map((resource, index) => /* @__PURE__ */
|
|
1859
|
+
children: resources.map((resource, index) => /* @__PURE__ */ jsxs4(
|
|
1964
1860
|
"span",
|
|
1965
1861
|
{
|
|
1966
1862
|
className: "inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-og-md border border-og-border bg-og-surface-2 px-2 py-1 text-og-xs text-og-fg-muted",
|
|
1967
1863
|
children: [
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
-
/* @__PURE__ */
|
|
1970
|
-
/* @__PURE__ */
|
|
1864
|
+
/* @__PURE__ */ jsx4(FileIcon, { className: "size-3 shrink-0" }),
|
|
1865
|
+
/* @__PURE__ */ jsx4("span", { className: "truncate", children: resource.kind === "file" ? messages.restoredFile(resource.fileId) : resource.uri }),
|
|
1866
|
+
/* @__PURE__ */ jsx4(
|
|
1971
1867
|
"button",
|
|
1972
1868
|
{
|
|
1973
1869
|
type: "button",
|
|
1974
1870
|
className: "shrink-0 hover:text-og-fg",
|
|
1975
1871
|
onClick: () => onRemove(index),
|
|
1976
1872
|
"aria-label": messages.removeRestoredResource(index),
|
|
1977
|
-
children: /* @__PURE__ */
|
|
1873
|
+
children: /* @__PURE__ */ jsx4(XIcon2, { className: "size-3" })
|
|
1978
1874
|
}
|
|
1979
1875
|
)
|
|
1980
1876
|
]
|
|
@@ -1991,14 +1887,14 @@ function ConfirmBar({
|
|
|
1991
1887
|
onConfirm,
|
|
1992
1888
|
returnFocusRef
|
|
1993
1889
|
}) {
|
|
1994
|
-
const confirmRef =
|
|
1890
|
+
const confirmRef = useRef2(null);
|
|
1995
1891
|
const descriptionId = useId2();
|
|
1996
1892
|
useEffect2(() => {
|
|
1997
1893
|
const returnTo = returnFocusRef?.current ?? null;
|
|
1998
1894
|
confirmRef.current?.focus();
|
|
1999
1895
|
return () => returnTo?.focus();
|
|
2000
1896
|
}, [returnFocusRef]);
|
|
2001
|
-
return /* @__PURE__ */
|
|
1897
|
+
return /* @__PURE__ */ jsxs4(
|
|
2002
1898
|
"div",
|
|
2003
1899
|
{
|
|
2004
1900
|
role: "alertdialog",
|
|
@@ -2014,9 +1910,9 @@ function ConfirmBar({
|
|
|
2014
1910
|
},
|
|
2015
1911
|
className: "flex items-end justify-between gap-2 px-2.5 pb-2.5 pt-1",
|
|
2016
1912
|
children: [
|
|
2017
|
-
/* @__PURE__ */
|
|
2018
|
-
/* @__PURE__ */
|
|
2019
|
-
/* @__PURE__ */
|
|
1913
|
+
/* @__PURE__ */ jsx4("span", { id: descriptionId, className: "min-w-0 flex-1 px-1.5 text-og-sm text-og-status-failed", children: messages.confirmDescription(command) }),
|
|
1914
|
+
/* @__PURE__ */ jsxs4("span", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
1915
|
+
/* @__PURE__ */ jsx4(
|
|
2020
1916
|
"button",
|
|
2021
1917
|
{
|
|
2022
1918
|
type: "button",
|
|
@@ -2025,7 +1921,7 @@ function ConfirmBar({
|
|
|
2025
1921
|
children: messages.cancel
|
|
2026
1922
|
}
|
|
2027
1923
|
),
|
|
2028
|
-
/* @__PURE__ */
|
|
1924
|
+
/* @__PURE__ */ jsx4(
|
|
2029
1925
|
"button",
|
|
2030
1926
|
{
|
|
2031
1927
|
ref: confirmRef,
|
|
@@ -2049,9 +1945,9 @@ function AttachmentChips({
|
|
|
2049
1945
|
onLoadPreview
|
|
2050
1946
|
}) {
|
|
2051
1947
|
const lightbox = useLightboxOptional();
|
|
2052
|
-
const previewRequest =
|
|
2053
|
-
const [previewLoadingId, setPreviewLoadingId] =
|
|
2054
|
-
const [previewErrorId, setPreviewErrorId] =
|
|
1948
|
+
const previewRequest = useRef2(null);
|
|
1949
|
+
const [previewLoadingId, setPreviewLoadingId] = useState3(null);
|
|
1950
|
+
const [previewErrorId, setPreviewErrorId] = useState3(null);
|
|
2055
1951
|
useEffect2(() => () => previewRequest.current?.abort(), [onLoadPreview]);
|
|
2056
1952
|
async function openPreview(attachment, source, canLoadPreview) {
|
|
2057
1953
|
previewRequest.current?.abort();
|
|
@@ -2092,7 +1988,7 @@ function AttachmentChips({
|
|
|
2092
1988
|
releaseSource
|
|
2093
1989
|
);
|
|
2094
1990
|
}
|
|
2095
|
-
return /* @__PURE__ */
|
|
1991
|
+
return /* @__PURE__ */ jsx4("div", { className: "flex flex-wrap gap-2 px-3 py-2", children: attachments.map((attachment) => {
|
|
2096
1992
|
const failed = attachment.status === "failed";
|
|
2097
1993
|
const secureContextRequired = attachment.errorCode === "secure_context_required";
|
|
2098
1994
|
const previewFailed = previewErrorId === attachment.id;
|
|
@@ -2101,7 +1997,7 @@ function AttachmentChips({
|
|
|
2101
1997
|
lightbox && onLoadPreview && attachment.status === "ready" && attachment.file && attachment.contentType.startsWith("image/")
|
|
2102
1998
|
);
|
|
2103
1999
|
const statusText = previewFailed ? messages.previewUnavailable ?? "Preview unavailable" : attachment.status === "uploading" ? messages.uploading : failed ? attachment.error || messages.uploadFailed : messages.formatBytes(attachment.sizeBytes);
|
|
2104
|
-
return /* @__PURE__ */
|
|
2000
|
+
return /* @__PURE__ */ jsxs4(
|
|
2105
2001
|
"div",
|
|
2106
2002
|
{
|
|
2107
2003
|
className: cn(
|
|
@@ -2112,7 +2008,7 @@ function AttachmentChips({
|
|
|
2112
2008
|
) : "max-w-[240px] border-og-border bg-og-surface-2"
|
|
2113
2009
|
),
|
|
2114
2010
|
children: [
|
|
2115
|
-
lightbox && (attachment.previewUrl || canLoadPreview) ? /* @__PURE__ */
|
|
2011
|
+
lightbox && (attachment.previewUrl || canLoadPreview) ? /* @__PURE__ */ jsx4(
|
|
2116
2012
|
"button",
|
|
2117
2013
|
{
|
|
2118
2014
|
type: "button",
|
|
@@ -2124,46 +2020,46 @@ function AttachmentChips({
|
|
|
2124
2020
|
"aria-busy": previewLoading || void 0,
|
|
2125
2021
|
disabled: previewLoading,
|
|
2126
2022
|
onClick: (event) => void openPreview(attachment, event.currentTarget, canLoadPreview),
|
|
2127
|
-
children: attachment.previewUrl ? /* @__PURE__ */
|
|
2023
|
+
children: attachment.previewUrl ? /* @__PURE__ */ jsx4(
|
|
2128
2024
|
"img",
|
|
2129
2025
|
{
|
|
2130
2026
|
src: attachment.previewUrl,
|
|
2131
2027
|
alt: "",
|
|
2132
2028
|
className: "h-full w-full object-cover transition-opacity hover:opacity-80"
|
|
2133
2029
|
}
|
|
2134
|
-
) : previewLoading ? /* @__PURE__ */
|
|
2030
|
+
) : previewLoading ? /* @__PURE__ */ jsx4(LoaderCircleIcon, { className: "size-4 animate-og-spin text-og-fg-muted" }) : /* @__PURE__ */ jsx4(ImageIcon, { className: "size-4 text-og-fg-muted" })
|
|
2135
2031
|
}
|
|
2136
|
-
) : attachment.previewUrl ? /* @__PURE__ */
|
|
2032
|
+
) : attachment.previewUrl ? /* @__PURE__ */ jsx4(
|
|
2137
2033
|
"img",
|
|
2138
2034
|
{
|
|
2139
2035
|
src: attachment.previewUrl,
|
|
2140
2036
|
alt: "",
|
|
2141
2037
|
className: "size-8 shrink-0 rounded object-cover"
|
|
2142
2038
|
}
|
|
2143
|
-
) : attachment.contentType.startsWith("image/") ? /* @__PURE__ */
|
|
2144
|
-
/* @__PURE__ */
|
|
2145
|
-
/* @__PURE__ */
|
|
2146
|
-
secureContextRequired ? /* @__PURE__ */
|
|
2039
|
+
) : attachment.contentType.startsWith("image/") ? /* @__PURE__ */ jsx4(ImageIcon, { className: "size-4 shrink-0 text-og-fg-muted" }) : /* @__PURE__ */ jsx4(FileIcon, { className: "size-4 shrink-0 text-og-fg-muted" }),
|
|
2040
|
+
/* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
|
|
2041
|
+
/* @__PURE__ */ jsx4("div", { className: "truncate font-medium text-og-fg", children: attachment.name }),
|
|
2042
|
+
secureContextRequired ? /* @__PURE__ */ jsx4("div", { className: "break-words text-og-xs leading-4 text-og-status-failed", children: statusText }) : failed || previewFailed ? /* @__PURE__ */ jsx4(ComposerTip, { tip: statusText, children: /* @__PURE__ */ jsx4("div", { className: "truncate text-og-xs text-og-status-failed", children: statusText }) }) : /* @__PURE__ */ jsx4("div", { className: "truncate text-og-xs text-og-fg-subtle", children: statusText })
|
|
2147
2043
|
] }),
|
|
2148
|
-
attachment.status === "uploading" ? /* @__PURE__ */
|
|
2149
|
-
failed && !secureContextRequired && onRetry ? /* @__PURE__ */
|
|
2044
|
+
attachment.status === "uploading" ? /* @__PURE__ */ jsx4(LoaderCircleIcon, { className: "size-3.5 shrink-0 animate-og-spin" }) : null,
|
|
2045
|
+
failed && !secureContextRequired && onRetry ? /* @__PURE__ */ jsx4(ComposerTip, { tip: messages.retryUpload, children: /* @__PURE__ */ jsx4(
|
|
2150
2046
|
"button",
|
|
2151
2047
|
{
|
|
2152
2048
|
type: "button",
|
|
2153
2049
|
onClick: () => onRetry(attachment.id),
|
|
2154
2050
|
className: "shrink-0 rounded-og-xs p-1 text-og-fg-muted hover:bg-og-surface-1 hover:text-og-fg pointer-coarse:size-10",
|
|
2155
2051
|
"aria-label": messages.retryAttachment(attachment.name),
|
|
2156
|
-
children: /* @__PURE__ */
|
|
2052
|
+
children: /* @__PURE__ */ jsx4(RotateCwIcon, { className: "size-3.5" })
|
|
2157
2053
|
}
|
|
2158
2054
|
) }) : null,
|
|
2159
|
-
/* @__PURE__ */
|
|
2055
|
+
/* @__PURE__ */ jsx4(
|
|
2160
2056
|
"button",
|
|
2161
2057
|
{
|
|
2162
2058
|
type: "button",
|
|
2163
2059
|
onClick: () => onRemove(attachment.id),
|
|
2164
2060
|
className: "shrink-0 rounded-og-xs p-1 text-og-fg-muted hover:bg-og-surface-1 hover:text-og-fg pointer-coarse:size-10",
|
|
2165
2061
|
"aria-label": messages.removeAttachment(attachment.name),
|
|
2166
|
-
children: /* @__PURE__ */
|
|
2062
|
+
children: /* @__PURE__ */ jsx4(XIcon2, { className: "size-3.5" })
|
|
2167
2063
|
}
|
|
2168
2064
|
)
|
|
2169
2065
|
]
|
|
@@ -2177,7 +2073,7 @@ function HelpPanel({
|
|
|
2177
2073
|
messages,
|
|
2178
2074
|
onClose
|
|
2179
2075
|
}) {
|
|
2180
|
-
return /* @__PURE__ */
|
|
2076
|
+
return /* @__PURE__ */ jsxs4(
|
|
2181
2077
|
motion3.div,
|
|
2182
2078
|
{
|
|
2183
2079
|
initial: { opacity: 0, height: 0 },
|
|
@@ -2185,9 +2081,9 @@ function HelpPanel({
|
|
|
2185
2081
|
exit: { opacity: 0, height: 0 },
|
|
2186
2082
|
className: "mt-2 overflow-hidden rounded-og-lg border border-og-border bg-og-surface-2",
|
|
2187
2083
|
children: [
|
|
2188
|
-
/* @__PURE__ */
|
|
2189
|
-
/* @__PURE__ */
|
|
2190
|
-
/* @__PURE__ */
|
|
2084
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between border-b border-og-border px-3 py-1.5", children: [
|
|
2085
|
+
/* @__PURE__ */ jsx4("span", { className: "text-og-sm font-medium text-og-fg", children: messages.commands }),
|
|
2086
|
+
/* @__PURE__ */ jsx4(
|
|
2191
2087
|
"button",
|
|
2192
2088
|
{
|
|
2193
2089
|
type: "button",
|
|
@@ -2197,16 +2093,16 @@ function HelpPanel({
|
|
|
2197
2093
|
}
|
|
2198
2094
|
)
|
|
2199
2095
|
] }),
|
|
2200
|
-
/* @__PURE__ */
|
|
2096
|
+
/* @__PURE__ */ jsx4("ul", { className: "py-1", children: commands.map((command) => {
|
|
2201
2097
|
const hint = argHint(command.args);
|
|
2202
|
-
return /* @__PURE__ */
|
|
2203
|
-
/* @__PURE__ */
|
|
2098
|
+
return /* @__PURE__ */ jsxs4("li", { className: "flex items-baseline gap-2 px-3 py-1", children: [
|
|
2099
|
+
/* @__PURE__ */ jsxs4("span", { className: "font-mono text-og-sm text-og-accent", children: [
|
|
2204
2100
|
"/",
|
|
2205
2101
|
command.name,
|
|
2206
|
-
hint ? /* @__PURE__ */
|
|
2102
|
+
hint ? /* @__PURE__ */ jsx4("span", { className: "ml-1 text-og-fg-subtle", children: hint }) : null
|
|
2207
2103
|
] }),
|
|
2208
|
-
/* @__PURE__ */
|
|
2209
|
-
command.danger ? /* @__PURE__ */
|
|
2104
|
+
/* @__PURE__ */ jsx4("span", { className: "text-og-sm text-og-fg-muted", children: command.description }),
|
|
2105
|
+
command.danger ? /* @__PURE__ */ jsx4("span", { className: "ml-auto rounded-og-xs bg-og-status-failed/15 px-1 text-og-xs uppercase tracking-wide text-og-status-failed", children: messages.danger }) : null
|
|
2210
2106
|
] }, command.name);
|
|
2211
2107
|
}) })
|
|
2212
2108
|
]
|
|
@@ -2564,7 +2460,7 @@ import {
|
|
|
2564
2460
|
authorizeTranscriptionAdapter,
|
|
2565
2461
|
createTranscriptionSessionRequest
|
|
2566
2462
|
} from "@opengeni/sdk";
|
|
2567
|
-
import { useCallback as useCallback4, useEffect as useEffect3, useMemo as
|
|
2463
|
+
import { useCallback as useCallback4, useEffect as useEffect3, useMemo as useMemo5, useRef as useRef3, useState as useState4 } from "react";
|
|
2568
2464
|
var INITIAL_TRANSCRIPTION_CONTROL_STATE = {
|
|
2569
2465
|
status: "idle",
|
|
2570
2466
|
generation: 0,
|
|
@@ -2726,12 +2622,12 @@ function useTranscription({
|
|
|
2726
2622
|
lifecycleTimeouts,
|
|
2727
2623
|
onDiagnostic
|
|
2728
2624
|
}) {
|
|
2729
|
-
const [state, setState] =
|
|
2730
|
-
const stateRef =
|
|
2731
|
-
const valueRef =
|
|
2732
|
-
const sessionRef =
|
|
2733
|
-
const pendingStartRef =
|
|
2734
|
-
const activePolicyRef =
|
|
2625
|
+
const [state, setState] = useState4(INITIAL_TRANSCRIPTION_CONTROL_STATE);
|
|
2626
|
+
const stateRef = useRef3(state);
|
|
2627
|
+
const valueRef = useRef3(value);
|
|
2628
|
+
const sessionRef = useRef3(null);
|
|
2629
|
+
const pendingStartRef = useRef3(null);
|
|
2630
|
+
const activePolicyRef = useRef3(null);
|
|
2735
2631
|
valueRef.current = value;
|
|
2736
2632
|
const startTimeoutMs = normalizeTimeout(
|
|
2737
2633
|
lifecycleTimeouts?.startMs,
|
|
@@ -2751,15 +2647,15 @@ function useTranscription({
|
|
|
2751
2647
|
},
|
|
2752
2648
|
[onDiagnostic]
|
|
2753
2649
|
);
|
|
2754
|
-
const cleanupRuntimeRef =
|
|
2650
|
+
const cleanupRuntimeRef = useRef3({ cleanupTimeoutMs, reportDiagnostic });
|
|
2755
2651
|
useEffect3(() => {
|
|
2756
2652
|
cleanupRuntimeRef.current = { cleanupTimeoutMs, reportDiagnostic };
|
|
2757
2653
|
}, [cleanupTimeoutMs, reportDiagnostic]);
|
|
2758
|
-
const policyRevision =
|
|
2654
|
+
const policyRevision = useMemo5(
|
|
2759
2655
|
() => transcriptionPolicyRevision(policy, selection),
|
|
2760
2656
|
[policy, selection]
|
|
2761
2657
|
);
|
|
2762
|
-
const authorization =
|
|
2658
|
+
const authorization = useMemo5(
|
|
2763
2659
|
() => adapter ? authorizeTranscriptionAdapter(policy, adapter.descriptor, selection) : null,
|
|
2764
2660
|
[adapter, policy, selection]
|
|
2765
2661
|
);
|
|
@@ -3125,7 +3021,7 @@ function transcriptionPolicyRevision(policy, selection) {
|
|
|
3125
3021
|
|
|
3126
3022
|
// src/hooks/use-voice-input.ts
|
|
3127
3023
|
import { OpenGeniApiError } from "@opengeni/sdk";
|
|
3128
|
-
import { useCallback as useCallback5, useEffect as useEffect4, useRef as
|
|
3024
|
+
import { useCallback as useCallback5, useEffect as useEffect4, useRef as useRef4, useState as useState5 } from "react";
|
|
3129
3025
|
|
|
3130
3026
|
// src/voice-recording-owner.ts
|
|
3131
3027
|
var VOICE_RECORDING_OWNER_SESSION_KEY = "opengeni.voice-recording-owner.v1";
|
|
@@ -3349,44 +3245,44 @@ function useVoiceInput({
|
|
|
3349
3245
|
now = currentDate,
|
|
3350
3246
|
automaticRetryDelayMilliseconds
|
|
3351
3247
|
}) {
|
|
3352
|
-
const [status, setStatus] =
|
|
3353
|
-
const [error, setError] =
|
|
3354
|
-
const [stream, setStream] =
|
|
3355
|
-
const [recordingId, setRecordingId] =
|
|
3356
|
-
const [durationSeconds, setDurationSeconds] =
|
|
3357
|
-
const [locallySaved, setLocallySaved] =
|
|
3358
|
-
const [storageAvailable, setStorageAvailable] =
|
|
3248
|
+
const [status, setStatus] = useState5("idle");
|
|
3249
|
+
const [error, setError] = useState5(null);
|
|
3250
|
+
const [stream, setStream] = useState5(null);
|
|
3251
|
+
const [recordingId, setRecordingId] = useState5(null);
|
|
3252
|
+
const [durationSeconds, setDurationSeconds] = useState5(0);
|
|
3253
|
+
const [locallySaved, setLocallySaved] = useState5(false);
|
|
3254
|
+
const [storageAvailable, setStorageAvailable] = useState5(
|
|
3359
3255
|
() => Boolean(createRecordingStore) || typeof globalThis.indexedDB !== "undefined"
|
|
3360
3256
|
);
|
|
3361
|
-
const createRecordingStoreRef =
|
|
3257
|
+
const createRecordingStoreRef = useRef4(createRecordingStore);
|
|
3362
3258
|
createRecordingStoreRef.current = createRecordingStore;
|
|
3363
|
-
const nowRef =
|
|
3259
|
+
const nowRef = useRef4(now);
|
|
3364
3260
|
nowRef.current = now;
|
|
3365
3261
|
const readNow = useCallback5(() => nowRef.current(), []);
|
|
3366
|
-
const generationRef =
|
|
3367
|
-
const workspaceIdRef =
|
|
3368
|
-
const ownerIdRef =
|
|
3369
|
-
const ownerLeaseRef =
|
|
3370
|
-
const ownerIdPromiseRef =
|
|
3371
|
-
const createOwnerIdRef =
|
|
3372
|
-
const recorderRef =
|
|
3373
|
-
const streamRef =
|
|
3374
|
-
const timerRef =
|
|
3375
|
-
const automaticRetryTimerRef =
|
|
3376
|
-
const automaticRetryAttemptRef =
|
|
3377
|
-
const ownerHeartbeatTimerRef =
|
|
3378
|
-
const controllerRef =
|
|
3379
|
-
const valueRef =
|
|
3380
|
-
const storeRef =
|
|
3381
|
-
const storePromiseRef =
|
|
3382
|
-
const ownsStoreRef =
|
|
3383
|
-
const manifestRef =
|
|
3384
|
-
const persistenceQueueRef =
|
|
3385
|
-
const persistenceErrorRef =
|
|
3386
|
-
const captureLimitErrorRef =
|
|
3387
|
-
const captureSettledRef =
|
|
3388
|
-
const resolveCaptureSettledRef =
|
|
3389
|
-
const statusRef =
|
|
3262
|
+
const generationRef = useRef4(0);
|
|
3263
|
+
const workspaceIdRef = useRef4(workspaceId);
|
|
3264
|
+
const ownerIdRef = useRef4(null);
|
|
3265
|
+
const ownerLeaseRef = useRef4(null);
|
|
3266
|
+
const ownerIdPromiseRef = useRef4(null);
|
|
3267
|
+
const createOwnerIdRef = useRef4(createOwnerId);
|
|
3268
|
+
const recorderRef = useRef4(null);
|
|
3269
|
+
const streamRef = useRef4(null);
|
|
3270
|
+
const timerRef = useRef4(null);
|
|
3271
|
+
const automaticRetryTimerRef = useRef4(null);
|
|
3272
|
+
const automaticRetryAttemptRef = useRef4(0);
|
|
3273
|
+
const ownerHeartbeatTimerRef = useRef4(null);
|
|
3274
|
+
const controllerRef = useRef4(null);
|
|
3275
|
+
const valueRef = useRef4(value);
|
|
3276
|
+
const storeRef = useRef4(null);
|
|
3277
|
+
const storePromiseRef = useRef4(null);
|
|
3278
|
+
const ownsStoreRef = useRef4(false);
|
|
3279
|
+
const manifestRef = useRef4(null);
|
|
3280
|
+
const persistenceQueueRef = useRef4(Promise.resolve());
|
|
3281
|
+
const persistenceErrorRef = useRef4(null);
|
|
3282
|
+
const captureLimitErrorRef = useRef4(null);
|
|
3283
|
+
const captureSettledRef = useRef4(Promise.resolve());
|
|
3284
|
+
const resolveCaptureSettledRef = useRef4(null);
|
|
3285
|
+
const statusRef = useRef4(status);
|
|
3390
3286
|
valueRef.current = value;
|
|
3391
3287
|
statusRef.current = status;
|
|
3392
3288
|
workspaceIdRef.current = workspaceId;
|
|
@@ -3710,7 +3606,7 @@ function useVoiceInput({
|
|
|
3710
3606
|
workspaceId
|
|
3711
3607
|
]
|
|
3712
3608
|
);
|
|
3713
|
-
const finalizePersistedRecordingRef =
|
|
3609
|
+
const finalizePersistedRecordingRef = useRef4(finalizePersistedRecording);
|
|
3714
3610
|
finalizePersistedRecordingRef.current = finalizePersistedRecording;
|
|
3715
3611
|
const clientAvailable = client !== null && client !== void 0;
|
|
3716
3612
|
useEffect4(() => {
|
|
@@ -4486,12 +4382,12 @@ import {
|
|
|
4486
4382
|
XIcon as XIcon3
|
|
4487
4383
|
} from "lucide-react";
|
|
4488
4384
|
import { AnimatePresence as AnimatePresence4, motion as motion4 } from "motion/react";
|
|
4489
|
-
import { useEffect as useEffect5, useState as
|
|
4490
|
-
import { Fragment as Fragment3, jsx as
|
|
4385
|
+
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
4386
|
+
import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
4491
4387
|
function Tip({ tip, children }) {
|
|
4492
|
-
return /* @__PURE__ */
|
|
4493
|
-
/* @__PURE__ */
|
|
4494
|
-
/* @__PURE__ */
|
|
4388
|
+
return /* @__PURE__ */ jsxs5(Tooltip, { children: [
|
|
4389
|
+
/* @__PURE__ */ jsx5(TooltipTrigger, { asChild: true, children }),
|
|
4390
|
+
/* @__PURE__ */ jsx5(TooltipContent, { side: "top", children: tip })
|
|
4495
4391
|
] });
|
|
4496
4392
|
}
|
|
4497
4393
|
var defaultMessages = {
|
|
@@ -4575,7 +4471,7 @@ function ComposerTranscriptionControl({
|
|
|
4575
4471
|
}
|
|
4576
4472
|
void transcription.start();
|
|
4577
4473
|
}
|
|
4578
|
-
return /* @__PURE__ */
|
|
4474
|
+
return /* @__PURE__ */ jsx5(AnimatePresence4, { initial: false, children: suppressed ? null : /* @__PURE__ */ jsx5(
|
|
4579
4475
|
motion4.span,
|
|
4580
4476
|
{
|
|
4581
4477
|
initial: { opacity: 0, width: 0 },
|
|
@@ -4591,8 +4487,8 @@ function ComposerTranscriptionControl({
|
|
|
4591
4487
|
),
|
|
4592
4488
|
"data-transcription-status": status,
|
|
4593
4489
|
"data-transcription-capturing": capturing ? "" : void 0,
|
|
4594
|
-
children: /* @__PURE__ */
|
|
4595
|
-
/* @__PURE__ */
|
|
4490
|
+
children: /* @__PURE__ */ jsxs5("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
|
|
4491
|
+
/* @__PURE__ */ jsx5(AnimatePresence4, { mode: "popLayout", initial: false, children: recoverable ? /* @__PURE__ */ jsxs5(
|
|
4596
4492
|
motion4.span,
|
|
4597
4493
|
{
|
|
4598
4494
|
initial: { opacity: 0, scale: 0.96 },
|
|
@@ -4604,12 +4500,12 @@ function ComposerTranscriptionControl({
|
|
|
4604
4500
|
"bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11"
|
|
4605
4501
|
),
|
|
4606
4502
|
children: [
|
|
4607
|
-
/* @__PURE__ */
|
|
4608
|
-
/* @__PURE__ */
|
|
4503
|
+
/* @__PURE__ */ jsx5("span", { className: "og-transcription-recovered-label max-w-44 truncate text-og-xs text-og-fg-muted max-sm:max-w-28", children: savedTranscript ? errorMessage3 ?? messages.recoveredTranscript : retrying ? messages.retrying : status === "error" ? errorMessage3 ?? messages.errorRetryable : messages.recovered }),
|
|
4504
|
+
/* @__PURE__ */ jsx5(
|
|
4609
4505
|
Tip,
|
|
4610
4506
|
{
|
|
4611
4507
|
tip: savedTranscript ? messages.insertRecoveredTranscript : retrying ? messages.pauseRetrying : messages.retry,
|
|
4612
|
-
children: /* @__PURE__ */
|
|
4508
|
+
children: /* @__PURE__ */ jsx5(
|
|
4613
4509
|
"button",
|
|
4614
4510
|
{
|
|
4615
4511
|
type: "button",
|
|
@@ -4620,12 +4516,12 @@ function ComposerTranscriptionControl({
|
|
|
4620
4516
|
"bg-og-fg text-og-bg transition-colors duration-150 motion-reduce:transition-none",
|
|
4621
4517
|
"hover:bg-og-fg-muted pointer-coarse:size-11"
|
|
4622
4518
|
),
|
|
4623
|
-
children: savedTranscript ? /* @__PURE__ */
|
|
4519
|
+
children: savedTranscript ? /* @__PURE__ */ jsx5(ClipboardPasteIcon, { className: "size-3.5" }) : retrying ? /* @__PURE__ */ jsx5(SquareIcon, { className: "size-3.5" }) : /* @__PURE__ */ jsx5(RefreshCwIcon, { className: "size-3.5" })
|
|
4624
4520
|
}
|
|
4625
4521
|
)
|
|
4626
4522
|
}
|
|
4627
4523
|
),
|
|
4628
|
-
/* @__PURE__ */
|
|
4524
|
+
/* @__PURE__ */ jsx5(Tip, { tip: messages.discardRecovered, children: /* @__PURE__ */ jsx5(
|
|
4629
4525
|
"button",
|
|
4630
4526
|
{
|
|
4631
4527
|
type: "button",
|
|
@@ -4636,13 +4532,13 @@ function ComposerTranscriptionControl({
|
|
|
4636
4532
|
"text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
|
|
4637
4533
|
"hover:bg-og-surface-3 hover:text-og-status-failed pointer-coarse:size-11"
|
|
4638
4534
|
),
|
|
4639
|
-
children: /* @__PURE__ */
|
|
4535
|
+
children: /* @__PURE__ */ jsx5(Trash2Icon, { className: "size-3.5" })
|
|
4640
4536
|
}
|
|
4641
4537
|
) })
|
|
4642
4538
|
]
|
|
4643
4539
|
},
|
|
4644
4540
|
"recovered"
|
|
4645
|
-
) : active ? /* @__PURE__ */
|
|
4541
|
+
) : active ? /* @__PURE__ */ jsxs5(
|
|
4646
4542
|
motion4.span,
|
|
4647
4543
|
{
|
|
4648
4544
|
initial: { opacity: 0, scale: 0.96 },
|
|
@@ -4654,21 +4550,21 @@ function ComposerTranscriptionControl({
|
|
|
4654
4550
|
"bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11"
|
|
4655
4551
|
),
|
|
4656
4552
|
children: [
|
|
4657
|
-
status === "requesting-permission" ? /* @__PURE__ */
|
|
4553
|
+
status === "requesting-permission" ? /* @__PURE__ */ jsx5(
|
|
4658
4554
|
LoaderCircleIcon2,
|
|
4659
4555
|
{
|
|
4660
4556
|
className: "size-3.5 shrink-0 text-og-fg-muted animate-og-spin motion-reduce:animate-none",
|
|
4661
4557
|
"aria-hidden": true
|
|
4662
4558
|
}
|
|
4663
|
-
) : /* @__PURE__ */
|
|
4664
|
-
status === "recording" ? /* @__PURE__ */
|
|
4559
|
+
) : /* @__PURE__ */ jsxs5("span", { className: "flex items-center gap-1.5", children: [
|
|
4560
|
+
status === "recording" ? /* @__PURE__ */ jsx5(
|
|
4665
4561
|
"span",
|
|
4666
4562
|
{
|
|
4667
4563
|
"aria-hidden": true,
|
|
4668
4564
|
className: "size-1.5 shrink-0 rounded-full bg-og-status-failed animate-og-pulse motion-reduce:animate-none"
|
|
4669
4565
|
}
|
|
4670
4566
|
) : null,
|
|
4671
|
-
/* @__PURE__ */
|
|
4567
|
+
/* @__PURE__ */ jsx5(
|
|
4672
4568
|
VoiceWaveform,
|
|
4673
4569
|
{
|
|
4674
4570
|
stream: status === "recording" ? transcription.stream : null,
|
|
@@ -4676,8 +4572,8 @@ function ComposerTranscriptionControl({
|
|
|
4676
4572
|
}
|
|
4677
4573
|
)
|
|
4678
4574
|
] }),
|
|
4679
|
-
status === "recording" ? /* @__PURE__ */
|
|
4680
|
-
/* @__PURE__ */
|
|
4575
|
+
status === "recording" ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
4576
|
+
/* @__PURE__ */ jsx5(Tip, { tip: messages.cancel, children: /* @__PURE__ */ jsx5(
|
|
4681
4577
|
"button",
|
|
4682
4578
|
{
|
|
4683
4579
|
type: "button",
|
|
@@ -4689,10 +4585,10 @@ function ComposerTranscriptionControl({
|
|
|
4689
4585
|
"text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
|
|
4690
4586
|
"hover:bg-og-surface-3 hover:text-og-fg pointer-coarse:size-11"
|
|
4691
4587
|
),
|
|
4692
|
-
children: /* @__PURE__ */
|
|
4588
|
+
children: /* @__PURE__ */ jsx5(XIcon3, { className: "size-3.5" })
|
|
4693
4589
|
}
|
|
4694
4590
|
) }),
|
|
4695
|
-
/* @__PURE__ */
|
|
4591
|
+
/* @__PURE__ */ jsx5(Tip, { tip: messages.stop, children: /* @__PURE__ */ jsx5(
|
|
4696
4592
|
"button",
|
|
4697
4593
|
{
|
|
4698
4594
|
type: "button",
|
|
@@ -4703,14 +4599,14 @@ function ComposerTranscriptionControl({
|
|
|
4703
4599
|
"bg-og-fg text-og-bg transition-colors duration-150 motion-reduce:transition-none",
|
|
4704
4600
|
"hover:bg-og-fg-muted pointer-coarse:size-11"
|
|
4705
4601
|
),
|
|
4706
|
-
children: /* @__PURE__ */
|
|
4602
|
+
children: /* @__PURE__ */ jsx5(SquareIcon, { className: "size-2.5 fill-current" })
|
|
4707
4603
|
}
|
|
4708
4604
|
) })
|
|
4709
|
-
] }) : status === "transcribing" || status === "saving" ? /* @__PURE__ */
|
|
4605
|
+
] }) : status === "transcribing" || status === "saving" ? /* @__PURE__ */ jsx5("span", { className: "og-shimmer-text px-1.5 text-og-xs font-medium whitespace-nowrap", children: status === "saving" ? messages.saving : messages.transcribing }) : /* @__PURE__ */ jsx5("span", { className: "px-1.5 text-og-xs text-og-fg-muted whitespace-nowrap", children: messages.requestingPermission })
|
|
4710
4606
|
]
|
|
4711
4607
|
},
|
|
4712
4608
|
status === "transcribing" || status === "saving" ? "processing" : "capture"
|
|
4713
|
-
) : /* @__PURE__ */
|
|
4609
|
+
) : /* @__PURE__ */ jsx5(Tip, { tip: idleLabel, children: /* @__PURE__ */ jsx5(
|
|
4714
4610
|
motion4.button,
|
|
4715
4611
|
{
|
|
4716
4612
|
type: "button",
|
|
@@ -4728,10 +4624,10 @@ function ComposerTranscriptionControl({
|
|
|
4728
4624
|
"text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
|
|
4729
4625
|
unavailableMessage ? "cursor-not-allowed opacity-45" : "hover:bg-og-surface-2 hover:text-og-fg"
|
|
4730
4626
|
),
|
|
4731
|
-
children: /* @__PURE__ */
|
|
4627
|
+
children: /* @__PURE__ */ jsx5(MicIcon, { className: "size-4" })
|
|
4732
4628
|
}
|
|
4733
4629
|
) }, "idle") }),
|
|
4734
|
-
status === "error" && errorMessage3 && !recoverable ? /* @__PURE__ */
|
|
4630
|
+
status === "error" && errorMessage3 && !recoverable ? /* @__PURE__ */ jsx5(Tip, { tip: errorMessage3, children: /* @__PURE__ */ jsx5(
|
|
4735
4631
|
"span",
|
|
4736
4632
|
{
|
|
4737
4633
|
"aria-hidden": "true",
|
|
@@ -4739,7 +4635,7 @@ function ComposerTranscriptionControl({
|
|
|
4739
4635
|
children: errorMessage3
|
|
4740
4636
|
}
|
|
4741
4637
|
) }) : null,
|
|
4742
|
-
/* @__PURE__ */
|
|
4638
|
+
/* @__PURE__ */ jsx5(
|
|
4743
4639
|
"span",
|
|
4744
4640
|
{
|
|
4745
4641
|
className: "sr-only",
|
|
@@ -4757,8 +4653,8 @@ function VoiceWaveform({
|
|
|
4757
4653
|
stream,
|
|
4758
4654
|
mode
|
|
4759
4655
|
}) {
|
|
4760
|
-
const [levels, setLevels] =
|
|
4761
|
-
const [live, setLive] =
|
|
4656
|
+
const [levels, setLevels] = useState6(() => restingLevels(WAVEFORM_BARS));
|
|
4657
|
+
const [live, setLive] = useState6(false);
|
|
4762
4658
|
useEffect5(() => {
|
|
4763
4659
|
if (!stream || mode !== "recording") {
|
|
4764
4660
|
setLive(false);
|
|
@@ -4807,7 +4703,7 @@ function VoiceWaveform({
|
|
|
4807
4703
|
void context?.close();
|
|
4808
4704
|
};
|
|
4809
4705
|
}, [stream, mode]);
|
|
4810
|
-
return /* @__PURE__ */
|
|
4706
|
+
return /* @__PURE__ */ jsx5(
|
|
4811
4707
|
"span",
|
|
4812
4708
|
{
|
|
4813
4709
|
"aria-hidden": true,
|
|
@@ -4815,7 +4711,7 @@ function VoiceWaveform({
|
|
|
4815
4711
|
className: "flex h-4 w-[3.75rem] items-center justify-center gap-px",
|
|
4816
4712
|
children: WAVEFORM_BAR_KEYS.map((key, index) => {
|
|
4817
4713
|
const level = levels[index] ?? 0;
|
|
4818
|
-
return /* @__PURE__ */
|
|
4714
|
+
return /* @__PURE__ */ jsx5(
|
|
4819
4715
|
"span",
|
|
4820
4716
|
{
|
|
4821
4717
|
className: cn(
|
|
@@ -4866,10 +4762,6 @@ function transcriptionErrorMessage(code, messages) {
|
|
|
4866
4762
|
}
|
|
4867
4763
|
|
|
4868
4764
|
export {
|
|
4869
|
-
TooltipProvider,
|
|
4870
|
-
Tooltip,
|
|
4871
|
-
TooltipTrigger,
|
|
4872
|
-
TooltipContent,
|
|
4873
4765
|
useLightbox,
|
|
4874
4766
|
useLightboxOptional,
|
|
4875
4767
|
LightboxProvider,
|
|
@@ -4926,4 +4818,4 @@ export {
|
|
|
4926
4818
|
useVoiceInput,
|
|
4927
4819
|
ComposerTranscriptionControl
|
|
4928
4820
|
};
|
|
4929
|
-
//# sourceMappingURL=chunk-
|
|
4821
|
+
//# sourceMappingURL=chunk-BQGIXRKV.js.map
|