@opengeni/react 5.0.4 → 5.0.5-canary.1
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 +3 -0
- package/dist/{chunk-SCZ6SUBW.js → chunk-H63SQTGI.js} +1258 -1837
- package/dist/chunk-H63SQTGI.js.map +1 -0
- package/dist/chunk-HQV2I5HV.js +124 -0
- package/dist/chunk-HQV2I5HV.js.map +1 -0
- package/dist/chunk-M2HNWZYR.js +835 -0
- package/dist/chunk-M2HNWZYR.js.map +1 -0
- package/dist/{chunk-Z7WBDB4E.js → chunk-V3WX3TQG.js} +283 -391
- package/dist/chunk-V3WX3TQG.js.map +1 -0
- package/dist/components/message-timeline.d.ts +3 -1
- package/dist/components/sandbox-workspace.d.ts +5 -0
- package/dist/composer.js +2 -1
- package/dist/connect-chooser.d.ts +1 -0
- package/dist/connect-panel.d.ts +2 -1
- package/dist/connect.d.ts +7 -0
- package/dist/connect.js +792 -183
- package/dist/connect.js.map +1 -1
- package/dist/connection-catalog.d.ts +33 -0
- package/dist/connection-installed.d.ts +15 -0
- package/dist/connection-logo.d.ts +6 -0
- package/dist/connection-type-picker.d.ts +6 -0
- package/dist/device-authorization.d.ts +9 -1
- package/dist/index.js +39 -12
- package/dist/index.js.map +1 -1
- package/dist/plugin-details.d.ts +14 -0
- package/dist/plugin-discovery.d.ts +14 -0
- package/dist/session-ui.d.ts +3 -0
- package/dist/session-ui.js +113 -2
- package/dist/session-ui.js.map +1 -1
- package/dist/skill-discovery.d.ts +29 -0
- package/dist/timeline/activity-rail.d.ts +3 -1
- package/dist/timeline/genie-loading.d.ts +24 -0
- package/dist/timeline/startup-preference.d.ts +3 -0
- package/dist/timeline/startup-timings.d.ts +4 -0
- package/package.json +4 -3
- package/src/components/message-timeline.tsx +127 -20
- package/src/components/sandbox-workspace.tsx +29 -0
- package/src/connect-chooser.tsx +81 -21
- package/src/connect-panel.tsx +7 -1
- package/src/connect.ts +21 -0
- package/src/connection-catalog.tsx +153 -0
- package/src/connection-installed.tsx +45 -0
- package/src/connection-logo.tsx +29 -0
- package/src/connection-type-picker.tsx +36 -0
- package/src/device-authorization.tsx +9 -1
- package/src/hooks/use-codex-accounts.ts +1 -0
- package/src/plugin-details.tsx +182 -0
- package/src/plugin-discovery.tsx +161 -0
- package/src/session-ui.ts +3 -0
- package/src/skill-discovery.tsx +152 -0
- package/src/timeline/activity-rail.tsx +75 -4
- package/src/timeline/genie-loading.tsx +112 -0
- package/src/timeline/startup-preference.ts +33 -0
- package/src/timeline/startup-timings.tsx +145 -0
- package/src/timeline/turn-summary.tsx +8 -3
- package/styles/compiled.css +73 -0
- package/styles/connect.css +149 -1
- package/styles/index.css +15 -0
- package/dist/chunk-SCZ6SUBW.js.map +0 -1
- package/dist/chunk-Z7WBDB4E.js.map +0 -1
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip,
|
|
3
|
+
TooltipContent,
|
|
4
|
+
TooltipProvider,
|
|
5
|
+
TooltipTrigger
|
|
6
|
+
} from "./chunk-HQV2I5HV.js";
|
|
1
7
|
import {
|
|
2
8
|
ComposerResponsiveContext,
|
|
3
9
|
usePortalTokenStyle
|
|
@@ -18,135 +24,25 @@ 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
|
|
@@ -1056,28 +952,28 @@ function useChatComposerController({
|
|
|
1056
952
|
onPaste,
|
|
1057
953
|
messages: messageOverrides
|
|
1058
954
|
}) {
|
|
1059
|
-
const messages =
|
|
955
|
+
const messages = useMemo4(
|
|
1060
956
|
() => ({ ...defaultChatComposerMessages, ...messageOverrides }),
|
|
1061
957
|
[messageOverrides]
|
|
1062
958
|
);
|
|
1063
959
|
const id = useId2();
|
|
1064
|
-
const rootRef =
|
|
1065
|
-
const textareaRef =
|
|
1066
|
-
const pauseButtonRef =
|
|
1067
|
-
const fileInputRef =
|
|
960
|
+
const rootRef = useRef2(null);
|
|
961
|
+
const textareaRef = useRef2(null);
|
|
962
|
+
const pauseButtonRef = useRef2(null);
|
|
963
|
+
const fileInputRef = useRef2(null);
|
|
1068
964
|
const listboxId = useId2();
|
|
1069
965
|
const paused = effectiveControl?.state === "paused";
|
|
1070
|
-
const [controlDetailsOpen, setControlDetailsOpen] =
|
|
1071
|
-
const [paletteMounted, setPaletteMounted] =
|
|
1072
|
-
const [submitting, setSubmitting] =
|
|
1073
|
-
const submittingRef =
|
|
1074
|
-
const controlOperationRef =
|
|
966
|
+
const [controlDetailsOpen, setControlDetailsOpen] = useState3(false);
|
|
967
|
+
const [paletteMounted, setPaletteMounted] = useState3(false);
|
|
968
|
+
const [submitting, setSubmitting] = useState3(false);
|
|
969
|
+
const submittingRef = useRef2(false);
|
|
970
|
+
const controlOperationRef = useRef2(false);
|
|
1075
971
|
const deliveryValue = delivery.value;
|
|
1076
972
|
const setDeliveryValue = delivery.setValue;
|
|
1077
|
-
const mountedRef =
|
|
1078
|
-
const deliveredValueRef =
|
|
1079
|
-
const liveValueRef =
|
|
1080
|
-
const [renderedValue, setRenderedValue] =
|
|
973
|
+
const mountedRef = useRef2(true);
|
|
974
|
+
const deliveredValueRef = useRef2(deliveryValue);
|
|
975
|
+
const liveValueRef = useRef2(deliveryValue);
|
|
976
|
+
const [renderedValue, setRenderedValue] = useState3(deliveryValue);
|
|
1081
977
|
const deliveryChanged = deliveryValue !== deliveredValueRef.current;
|
|
1082
978
|
if (deliveryChanged) {
|
|
1083
979
|
deliveredValueRef.current = deliveryValue;
|
|
@@ -1092,7 +988,7 @@ function useChatComposerController({
|
|
|
1092
988
|
[setDeliveryValue]
|
|
1093
989
|
);
|
|
1094
990
|
const visibleValue = deliveryChanged ? deliveryValue : renderedValue;
|
|
1095
|
-
|
|
991
|
+
useLayoutEffect(() => {
|
|
1096
992
|
if (renderedValue !== liveValueRef.current) {
|
|
1097
993
|
setRenderedValue(liveValueRef.current);
|
|
1098
994
|
}
|
|
@@ -1123,7 +1019,7 @@ function useChatComposerController({
|
|
|
1123
1019
|
}, [id, paused]);
|
|
1124
1020
|
const blockedByAttachment = attachments?.hasUnresolved === true;
|
|
1125
1021
|
const hasReadyAttachment = (attachments?.readyResources.length ?? 0) > 0;
|
|
1126
|
-
const [dragging, setDragging] =
|
|
1022
|
+
const [dragging, setDragging] = useState3(false);
|
|
1127
1023
|
const dragCarriesFiles = (event) => event.dataTransfer !== null && [...event.dataTransfer.types].includes("Files");
|
|
1128
1024
|
const handleDragOver = useCallback3(
|
|
1129
1025
|
(event) => {
|
|
@@ -1150,10 +1046,10 @@ function useChatComposerController({
|
|
|
1150
1046
|
},
|
|
1151
1047
|
[attachments]
|
|
1152
1048
|
);
|
|
1153
|
-
const [notice, setNotice] =
|
|
1154
|
-
const [helpOpen, setHelpOpen] =
|
|
1155
|
-
const [confirmState, setConfirmState] =
|
|
1156
|
-
const pendingConfirm =
|
|
1049
|
+
const [notice, setNotice] = useState3(null);
|
|
1050
|
+
const [helpOpen, setHelpOpen] = useState3(false);
|
|
1051
|
+
const [confirmState, setConfirmState] = useState3(null);
|
|
1052
|
+
const pendingConfirm = useRef2(null);
|
|
1157
1053
|
const settleConfirmation = useCallback3((confirmed) => {
|
|
1158
1054
|
const resolve = pendingConfirm.current;
|
|
1159
1055
|
pendingConfirm.current = null;
|
|
@@ -1167,7 +1063,7 @@ function useChatComposerController({
|
|
|
1167
1063
|
},
|
|
1168
1064
|
[]
|
|
1169
1065
|
);
|
|
1170
|
-
const resizeInputRafRef =
|
|
1066
|
+
const resizeInputRafRef = useRef2(null);
|
|
1171
1067
|
const resizeInput = useCallback3(() => {
|
|
1172
1068
|
if (resizeInputRafRef.current !== null) {
|
|
1173
1069
|
return;
|
|
@@ -1191,7 +1087,7 @@ function useChatComposerController({
|
|
|
1191
1087
|
},
|
|
1192
1088
|
[]
|
|
1193
1089
|
);
|
|
1194
|
-
const handlers =
|
|
1090
|
+
const handlers = useMemo4(
|
|
1195
1091
|
() => ({
|
|
1196
1092
|
notice: (next) => {
|
|
1197
1093
|
setNotice(next);
|
|
@@ -1284,7 +1180,7 @@ function useChatComposerController({
|
|
|
1284
1180
|
},
|
|
1285
1181
|
[attachments]
|
|
1286
1182
|
);
|
|
1287
|
-
const helpCommands =
|
|
1183
|
+
const helpCommands = useMemo4(
|
|
1288
1184
|
() => commands.filter((command) => {
|
|
1289
1185
|
if (command.permission && commandContext) {
|
|
1290
1186
|
const permissions = commandContext.permissions;
|
|
@@ -1401,9 +1297,9 @@ function useChatComposerController({
|
|
|
1401
1297
|
value: visibleValue
|
|
1402
1298
|
};
|
|
1403
1299
|
}
|
|
1404
|
-
var ComposerContext =
|
|
1300
|
+
var ComposerContext = createContext2(null);
|
|
1405
1301
|
function useComposerController() {
|
|
1406
|
-
const controller =
|
|
1302
|
+
const controller = useContext2(ComposerContext);
|
|
1407
1303
|
if (!controller) throw new Error("useChatComposer must be used inside <Composer.Root>");
|
|
1408
1304
|
return controller;
|
|
1409
1305
|
}
|
|
@@ -1414,12 +1310,12 @@ function isRecord(value) {
|
|
|
1414
1310
|
return typeof value === "object" && value !== null;
|
|
1415
1311
|
}
|
|
1416
1312
|
var Root = forwardRef(function ComposerRoot({ controller, children, className, style, responsiveBasis = "viewport", ...props }, forwardedRef) {
|
|
1417
|
-
const responsiveRootRef =
|
|
1418
|
-
const responsiveContext =
|
|
1313
|
+
const responsiveRootRef = useRef2(null);
|
|
1314
|
+
const responsiveContext = useMemo4(
|
|
1419
1315
|
() => ({ responsiveBasis, rootRef: responsiveRootRef }),
|
|
1420
1316
|
[responsiveBasis]
|
|
1421
1317
|
);
|
|
1422
|
-
return /* @__PURE__ */
|
|
1318
|
+
return /* @__PURE__ */ jsx4(ComposerContext.Provider, { value: controller, children: /* @__PURE__ */ jsx4(ComposerResponsiveContext.Provider, { value: responsiveContext, children: /* @__PURE__ */ jsx4(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxs4(
|
|
1423
1319
|
"div",
|
|
1424
1320
|
{
|
|
1425
1321
|
...props,
|
|
@@ -1430,13 +1326,13 @@ var Root = forwardRef(function ComposerRoot({ controller, children, className, s
|
|
|
1430
1326
|
style: { paddingBottom: "env(safe-area-inset-bottom)", ...style },
|
|
1431
1327
|
children: [
|
|
1432
1328
|
children,
|
|
1433
|
-
/* @__PURE__ */
|
|
1329
|
+
/* @__PURE__ */ jsx4(ComposerAnnouncements, {})
|
|
1434
1330
|
]
|
|
1435
1331
|
}
|
|
1436
1332
|
) }) }) });
|
|
1437
1333
|
});
|
|
1438
1334
|
var Frame = forwardRef(function ComposerFrame({ className, ...props }, ref) {
|
|
1439
|
-
return /* @__PURE__ */
|
|
1335
|
+
return /* @__PURE__ */ jsx4("div", { ...props, ref, className: cn("relative", className) });
|
|
1440
1336
|
});
|
|
1441
1337
|
function CommandPalette2({ className }) {
|
|
1442
1338
|
const controller = useComposerController();
|
|
@@ -1446,7 +1342,7 @@ function CommandPalette2({ className }) {
|
|
|
1446
1342
|
return () => setPaletteMounted(false);
|
|
1447
1343
|
}, [setPaletteMounted]);
|
|
1448
1344
|
if (!controller.paletteEnabled) return null;
|
|
1449
|
-
return /* @__PURE__ */
|
|
1345
|
+
return /* @__PURE__ */ jsx4("div", { className, children: /* @__PURE__ */ jsx4(
|
|
1450
1346
|
CommandPalette,
|
|
1451
1347
|
{
|
|
1452
1348
|
open: controller.palette.open && controller.confirmState === null,
|
|
@@ -1466,7 +1362,7 @@ function CommandPalette2({ className }) {
|
|
|
1466
1362
|
}
|
|
1467
1363
|
var Surface = forwardRef(function ComposerSurface({ className, children, ...props }, ref) {
|
|
1468
1364
|
const controller = useComposerController();
|
|
1469
|
-
return /* @__PURE__ */
|
|
1365
|
+
return /* @__PURE__ */ jsxs4(
|
|
1470
1366
|
"div",
|
|
1471
1367
|
{
|
|
1472
1368
|
...props,
|
|
@@ -1482,7 +1378,7 @@ var Surface = forwardRef(function ComposerSurface({ className, children, ...prop
|
|
|
1482
1378
|
className
|
|
1483
1379
|
),
|
|
1484
1380
|
children: [
|
|
1485
|
-
controller.dragging ? /* @__PURE__ */
|
|
1381
|
+
controller.dragging ? /* @__PURE__ */ jsx4(
|
|
1486
1382
|
"div",
|
|
1487
1383
|
{
|
|
1488
1384
|
"aria-hidden": true,
|
|
@@ -1490,8 +1386,8 @@ var Surface = forwardRef(function ComposerSurface({ className, children, ...prop
|
|
|
1490
1386
|
"pointer-events-none absolute inset-0 z-10 flex items-center justify-center",
|
|
1491
1387
|
"rounded-og-lg bg-og-surface-1/85 text-og-menu font-medium text-og-accent backdrop-blur-[1px]"
|
|
1492
1388
|
),
|
|
1493
|
-
children: /* @__PURE__ */
|
|
1494
|
-
/* @__PURE__ */
|
|
1389
|
+
children: /* @__PURE__ */ jsxs4("span", { className: "inline-flex items-center gap-2", children: [
|
|
1390
|
+
/* @__PURE__ */ jsx4(PaperclipIcon, { className: "size-4" }),
|
|
1495
1391
|
controller.messages.dropFiles
|
|
1496
1392
|
] })
|
|
1497
1393
|
}
|
|
@@ -1504,7 +1400,7 @@ var Surface = forwardRef(function ComposerSurface({ className, children, ...prop
|
|
|
1504
1400
|
function PausedState() {
|
|
1505
1401
|
const controller = useComposerController();
|
|
1506
1402
|
if (!controller.paused || !controller.effectiveControl || !controller.hasControl) return null;
|
|
1507
|
-
return /* @__PURE__ */
|
|
1403
|
+
return /* @__PURE__ */ jsx4(
|
|
1508
1404
|
WorkstreamPausedStrip,
|
|
1509
1405
|
{
|
|
1510
1406
|
control: controller.effectiveControl,
|
|
@@ -1524,7 +1420,7 @@ function PausedState() {
|
|
|
1524
1420
|
function RestoredResources() {
|
|
1525
1421
|
const controller = useComposerController();
|
|
1526
1422
|
if (controller.restoredResources.length === 0 || !controller.removeRestoredResource) return null;
|
|
1527
|
-
return /* @__PURE__ */
|
|
1423
|
+
return /* @__PURE__ */ jsx4(
|
|
1528
1424
|
RestoredResourceChips,
|
|
1529
1425
|
{
|
|
1530
1426
|
resources: controller.restoredResources,
|
|
@@ -1536,7 +1432,7 @@ function RestoredResources() {
|
|
|
1536
1432
|
function Attachments() {
|
|
1537
1433
|
const controller = useComposerController();
|
|
1538
1434
|
if (!controller.attachments || controller.attachments.attachments.length === 0) return null;
|
|
1539
|
-
return /* @__PURE__ */
|
|
1435
|
+
return /* @__PURE__ */ jsx4(
|
|
1540
1436
|
AttachmentChips,
|
|
1541
1437
|
{
|
|
1542
1438
|
attachments: controller.attachments.attachments,
|
|
@@ -1550,7 +1446,7 @@ function Attachments() {
|
|
|
1550
1446
|
}
|
|
1551
1447
|
var Input = forwardRef(function ComposerInput({ rows = 1, placeholder, className, "aria-label": ariaLabel, autoFocus = false, ...props }, forwardedRef) {
|
|
1552
1448
|
const controller = useComposerController();
|
|
1553
|
-
const autoFocusedRef =
|
|
1449
|
+
const autoFocusedRef = useRef2(false);
|
|
1554
1450
|
const paletteOpen = controller.paletteEnabled && controller.paletteMounted && controller.palette.open;
|
|
1555
1451
|
useEffect2(() => {
|
|
1556
1452
|
if (!autoFocus || controller.disabled || autoFocusedRef.current) return;
|
|
@@ -1562,7 +1458,7 @@ var Input = forwardRef(function ComposerInput({ rows = 1, placeholder, className
|
|
|
1562
1458
|
});
|
|
1563
1459
|
return () => window.cancelAnimationFrame(frame);
|
|
1564
1460
|
}, [autoFocus, controller.disabled, controller.textareaRef]);
|
|
1565
|
-
return /* @__PURE__ */
|
|
1461
|
+
return /* @__PURE__ */ jsx4(
|
|
1566
1462
|
"textarea",
|
|
1567
1463
|
{
|
|
1568
1464
|
...props,
|
|
@@ -1593,7 +1489,7 @@ function Confirmation() {
|
|
|
1593
1489
|
const controller = useComposerController();
|
|
1594
1490
|
const command = controller.confirmState?.command;
|
|
1595
1491
|
if (!command || !controller.confirmState) return null;
|
|
1596
|
-
return /* @__PURE__ */
|
|
1492
|
+
return /* @__PURE__ */ jsx4(
|
|
1597
1493
|
ConfirmBar,
|
|
1598
1494
|
{
|
|
1599
1495
|
command,
|
|
@@ -1605,7 +1501,7 @@ function Confirmation() {
|
|
|
1605
1501
|
);
|
|
1606
1502
|
}
|
|
1607
1503
|
var Footer = forwardRef(function ComposerFooter({ className, ...props }, ref) {
|
|
1608
|
-
return /* @__PURE__ */
|
|
1504
|
+
return /* @__PURE__ */ jsx4(
|
|
1609
1505
|
"div",
|
|
1610
1506
|
{
|
|
1611
1507
|
...props,
|
|
@@ -1621,7 +1517,7 @@ var Footer = forwardRef(function ComposerFooter({ className, ...props }, ref) {
|
|
|
1621
1517
|
});
|
|
1622
1518
|
var Controls = forwardRef(
|
|
1623
1519
|
function ComposerControls({ className, ...props }, ref) {
|
|
1624
|
-
return /* @__PURE__ */
|
|
1520
|
+
return /* @__PURE__ */ jsx4(
|
|
1625
1521
|
"span",
|
|
1626
1522
|
{
|
|
1627
1523
|
...props,
|
|
@@ -1637,7 +1533,7 @@ var Controls = forwardRef(
|
|
|
1637
1533
|
);
|
|
1638
1534
|
var Hint = forwardRef(function ComposerHint({ className, children, ...props }, ref) {
|
|
1639
1535
|
const controller = useComposerController();
|
|
1640
|
-
return /* @__PURE__ */
|
|
1536
|
+
return /* @__PURE__ */ jsx4(
|
|
1641
1537
|
"span",
|
|
1642
1538
|
{
|
|
1643
1539
|
...props,
|
|
@@ -1651,7 +1547,7 @@ var Hint = forwardRef(function ComposerHint({ className, children, ...props }, r
|
|
|
1651
1547
|
);
|
|
1652
1548
|
});
|
|
1653
1549
|
var Actions = forwardRef(function ComposerActions({ className, ...props }, ref) {
|
|
1654
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ jsx4(
|
|
1655
1551
|
"span",
|
|
1656
1552
|
{
|
|
1657
1553
|
...props,
|
|
@@ -1669,8 +1565,8 @@ var AttachButton = forwardRef(
|
|
|
1669
1565
|
const controller = useComposerController();
|
|
1670
1566
|
if (!controller.attachments) return null;
|
|
1671
1567
|
const tip = title ?? controller.messages.attachFiles;
|
|
1672
|
-
return /* @__PURE__ */
|
|
1673
|
-
/* @__PURE__ */
|
|
1568
|
+
return /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1569
|
+
/* @__PURE__ */ jsx4(
|
|
1674
1570
|
"input",
|
|
1675
1571
|
{
|
|
1676
1572
|
ref: controller.fileInputRef,
|
|
@@ -1682,7 +1578,7 @@ var AttachButton = forwardRef(
|
|
|
1682
1578
|
onChange: controller.handleFileChange
|
|
1683
1579
|
}
|
|
1684
1580
|
),
|
|
1685
|
-
/* @__PURE__ */
|
|
1581
|
+
/* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
|
|
1686
1582
|
"button",
|
|
1687
1583
|
{
|
|
1688
1584
|
...props,
|
|
@@ -1697,7 +1593,7 @@ var AttachButton = forwardRef(
|
|
|
1697
1593
|
"disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:size-11",
|
|
1698
1594
|
className
|
|
1699
1595
|
),
|
|
1700
|
-
children: children ?? /* @__PURE__ */
|
|
1596
|
+
children: children ?? /* @__PURE__ */ jsx4(PaperclipIcon, { className: "size-4" })
|
|
1701
1597
|
}
|
|
1702
1598
|
) })
|
|
1703
1599
|
] });
|
|
@@ -1713,7 +1609,7 @@ function ModelPicker2({
|
|
|
1713
1609
|
codexOnly
|
|
1714
1610
|
}) {
|
|
1715
1611
|
const controller = useComposerController();
|
|
1716
|
-
return /* @__PURE__ */
|
|
1612
|
+
return /* @__PURE__ */ jsx4(
|
|
1717
1613
|
ModelPicker,
|
|
1718
1614
|
{
|
|
1719
1615
|
models,
|
|
@@ -1733,7 +1629,7 @@ var PauseButton = forwardRef(
|
|
|
1733
1629
|
if (!controller.effectiveControl || controller.paused || !controller.hasControl) return null;
|
|
1734
1630
|
const busy = controller.pausing || controller.resuming;
|
|
1735
1631
|
const tip = title ?? controller.messages.pauseTitle;
|
|
1736
|
-
return /* @__PURE__ */
|
|
1632
|
+
return /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
|
|
1737
1633
|
"button",
|
|
1738
1634
|
{
|
|
1739
1635
|
...props,
|
|
@@ -1749,7 +1645,7 @@ var PauseButton = forwardRef(
|
|
|
1749
1645
|
"disabled:opacity-50",
|
|
1750
1646
|
className
|
|
1751
1647
|
),
|
|
1752
|
-
children: children ?? (busy ? /* @__PURE__ */
|
|
1648
|
+
children: children ?? (busy ? /* @__PURE__ */ jsx4(LoaderCircleIcon, { className: "size-3.5 animate-og-spin" }) : /* @__PURE__ */ jsx4(PauseIcon, { className: "size-3.5 fill-current" }))
|
|
1753
1649
|
}
|
|
1754
1650
|
) });
|
|
1755
1651
|
}
|
|
@@ -1758,7 +1654,7 @@ var SendButton = forwardRef(
|
|
|
1758
1654
|
function ComposerSendButton({ className, "aria-label": ariaLabel, title, children, ...props }, ref) {
|
|
1759
1655
|
const controller = useComposerController();
|
|
1760
1656
|
const tip = title ?? (controller.submitBlocker === "annotations" ? controller.messages.annotationNotesRequired : controller.paused ? controller.messages.sendAndResumeTitle : controller.messages.sendTitle);
|
|
1761
|
-
return /* @__PURE__ */
|
|
1657
|
+
return /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
|
|
1762
1658
|
"button",
|
|
1763
1659
|
{
|
|
1764
1660
|
...props,
|
|
@@ -1776,14 +1672,14 @@ var SendButton = forwardRef(
|
|
|
1776
1672
|
"disabled:cursor-not-allowed disabled:bg-og-surface-3 disabled:text-og-fg-subtle disabled:shadow-none",
|
|
1777
1673
|
className
|
|
1778
1674
|
),
|
|
1779
|
-
children: children ?? (controller.sending ? /* @__PURE__ */
|
|
1675
|
+
children: children ?? (controller.sending ? /* @__PURE__ */ jsx4(LoaderCircleIcon, { className: "size-4 animate-og-spin" }) : /* @__PURE__ */ jsx4(ArrowUpIcon, { className: "size-4" }))
|
|
1780
1676
|
}
|
|
1781
1677
|
) });
|
|
1782
1678
|
}
|
|
1783
1679
|
);
|
|
1784
1680
|
function Help() {
|
|
1785
1681
|
const controller = useComposerController();
|
|
1786
|
-
return /* @__PURE__ */
|
|
1682
|
+
return /* @__PURE__ */ jsx4(AnimatePresence3, { children: controller.helpOpen ? /* @__PURE__ */ jsx4(
|
|
1787
1683
|
HelpPanel,
|
|
1788
1684
|
{
|
|
1789
1685
|
commands: controller.helpCommands,
|
|
@@ -1794,8 +1690,8 @@ function Help() {
|
|
|
1794
1690
|
}
|
|
1795
1691
|
function Status() {
|
|
1796
1692
|
const controller = useComposerController();
|
|
1797
|
-
return /* @__PURE__ */
|
|
1798
|
-
/* @__PURE__ */
|
|
1693
|
+
return /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1694
|
+
/* @__PURE__ */ jsx4(AnimatePresence3, { children: controller.activeNotice ? /* @__PURE__ */ jsx4(
|
|
1799
1695
|
motion3.p,
|
|
1800
1696
|
{
|
|
1801
1697
|
initial: { opacity: 0, height: 0 },
|
|
@@ -1808,9 +1704,9 @@ function Status() {
|
|
|
1808
1704
|
children: controller.activeNotice.message
|
|
1809
1705
|
}
|
|
1810
1706
|
) : null }),
|
|
1811
|
-
controller.draftConflict ? /* @__PURE__ */
|
|
1812
|
-
/* @__PURE__ */
|
|
1813
|
-
/* @__PURE__ */
|
|
1707
|
+
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: [
|
|
1708
|
+
/* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1", children: controller.messages.draftConflict }),
|
|
1709
|
+
/* @__PURE__ */ jsx4(
|
|
1814
1710
|
"button",
|
|
1815
1711
|
{
|
|
1816
1712
|
type: "button",
|
|
@@ -1819,7 +1715,7 @@ function Status() {
|
|
|
1819
1715
|
children: controller.messages.useOtherDraft
|
|
1820
1716
|
}
|
|
1821
1717
|
),
|
|
1822
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ jsx4(
|
|
1823
1719
|
"button",
|
|
1824
1720
|
{
|
|
1825
1721
|
type: "button",
|
|
@@ -1833,9 +1729,9 @@ function Status() {
|
|
|
1833
1729
|
}
|
|
1834
1730
|
function ComposerAnnouncements() {
|
|
1835
1731
|
const controller = useComposerController();
|
|
1836
|
-
return /* @__PURE__ */
|
|
1837
|
-
controller.activeNotice ? /* @__PURE__ */
|
|
1838
|
-
controller.draftConflict ? /* @__PURE__ */
|
|
1732
|
+
return /* @__PURE__ */ jsxs4("div", { className: "sr-only", children: [
|
|
1733
|
+
controller.activeNotice ? /* @__PURE__ */ jsx4("p", { role: controller.activeNotice.tone === "error" ? "alert" : "status", children: controller.activeNotice.message }) : null,
|
|
1734
|
+
controller.draftConflict ? /* @__PURE__ */ jsx4("p", { role: "alert", children: controller.messages.draftConflict }) : null
|
|
1839
1735
|
] });
|
|
1840
1736
|
}
|
|
1841
1737
|
function mergeRefs(...refs) {
|
|
@@ -1865,10 +1761,10 @@ function WorkstreamPausedStrip({
|
|
|
1865
1761
|
const broaderOptions = control.resumeOptions.filter(
|
|
1866
1762
|
(option) => option !== primary && option.scope !== "selected" && (option.scope !== "workspace" || canControlWorkspace)
|
|
1867
1763
|
);
|
|
1868
|
-
return /* @__PURE__ */
|
|
1869
|
-
/* @__PURE__ */
|
|
1870
|
-
/* @__PURE__ */
|
|
1871
|
-
/* @__PURE__ */
|
|
1764
|
+
return /* @__PURE__ */ jsxs4("div", { className: "border-b border-og-status-waiting/25 bg-og-status-waiting/[0.07]", children: [
|
|
1765
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2 px-3 py-2", children: [
|
|
1766
|
+
/* @__PURE__ */ jsx4(PauseIcon, { className: "size-3.5 shrink-0 text-og-status-waiting" }),
|
|
1767
|
+
/* @__PURE__ */ jsxs4(
|
|
1872
1768
|
"button",
|
|
1873
1769
|
{
|
|
1874
1770
|
type: "button",
|
|
@@ -1876,12 +1772,12 @@ function WorkstreamPausedStrip({
|
|
|
1876
1772
|
onClick: () => onOpenChange(!open),
|
|
1877
1773
|
"aria-expanded": open,
|
|
1878
1774
|
children: [
|
|
1879
|
-
/* @__PURE__ */
|
|
1880
|
-
/* @__PURE__ */
|
|
1775
|
+
/* @__PURE__ */ jsx4("span", { className: "block truncate text-og-xs font-medium text-og-fg", children: cause }),
|
|
1776
|
+
/* @__PURE__ */ jsx4("span", { className: "block truncate text-[11px] text-og-fg-muted", children: queuedAheadCount > 0 ? messages.queuedAhead(queuedAheadCount) : sending ? messages.resumingAndSending : messages.nextMessageResumes })
|
|
1881
1777
|
]
|
|
1882
1778
|
}
|
|
1883
1779
|
),
|
|
1884
|
-
/* @__PURE__ */
|
|
1780
|
+
/* @__PURE__ */ jsxs4(
|
|
1885
1781
|
"button",
|
|
1886
1782
|
{
|
|
1887
1783
|
type: "button",
|
|
@@ -1890,47 +1786,47 @@ function WorkstreamPausedStrip({
|
|
|
1890
1786
|
disabled: busy,
|
|
1891
1787
|
onClick: onResume,
|
|
1892
1788
|
children: [
|
|
1893
|
-
busy ? /* @__PURE__ */
|
|
1894
|
-
/* @__PURE__ */
|
|
1895
|
-
/* @__PURE__ */
|
|
1789
|
+
busy ? /* @__PURE__ */ jsx4(LoaderCircleIcon, { className: "size-3.5 animate-og-spin" }) : /* @__PURE__ */ jsx4(PlayIcon, { className: "size-3.5 fill-current" }),
|
|
1790
|
+
/* @__PURE__ */ jsx4("span", { className: "og-composer-resume-label-long hidden min-[400px]:inline", children: messages.resumeThisWorkstream }),
|
|
1791
|
+
/* @__PURE__ */ jsx4("span", { className: "og-composer-resume-label-short min-[400px]:hidden", children: messages.resumeShort })
|
|
1896
1792
|
]
|
|
1897
1793
|
}
|
|
1898
1794
|
),
|
|
1899
|
-
/* @__PURE__ */
|
|
1795
|
+
/* @__PURE__ */ jsx4(
|
|
1900
1796
|
"button",
|
|
1901
1797
|
{
|
|
1902
1798
|
type: "button",
|
|
1903
1799
|
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",
|
|
1904
1800
|
onClick: () => onOpenChange(!open),
|
|
1905
1801
|
"aria-label": open ? messages.hidePauseDetails : messages.showPauseDetails,
|
|
1906
|
-
children: /* @__PURE__ */
|
|
1802
|
+
children: /* @__PURE__ */ jsx4(ChevronDownIcon2, { className: cn("size-3.5 transition-transform", open && "rotate-180") })
|
|
1907
1803
|
}
|
|
1908
1804
|
)
|
|
1909
1805
|
] }),
|
|
1910
|
-
open ? /* @__PURE__ */
|
|
1911
|
-
/* @__PURE__ */
|
|
1806
|
+
open ? /* @__PURE__ */ jsxs4("div", { className: "border-t border-og-status-waiting/20 px-3 pb-3 pt-2", children: [
|
|
1807
|
+
/* @__PURE__ */ jsx4("ul", { className: "grid gap-2", "aria-label": messages.pauseReasonsLabel, children: control.blockers.map((entry, index) => /* @__PURE__ */ jsxs4(
|
|
1912
1808
|
"li",
|
|
1913
1809
|
{
|
|
1914
1810
|
className: "text-og-xs",
|
|
1915
1811
|
children: [
|
|
1916
|
-
/* @__PURE__ */
|
|
1917
|
-
blockerHref(entry, controlLinks) ? /* @__PURE__ */
|
|
1812
|
+
/* @__PURE__ */ jsx4("span", { className: "font-medium text-og-fg", children: index === 0 ? messages.pausedByLabel : messages.alsoPausedByLabel }),
|
|
1813
|
+
blockerHref(entry, controlLinks) ? /* @__PURE__ */ jsx4(
|
|
1918
1814
|
"a",
|
|
1919
1815
|
{
|
|
1920
1816
|
href: blockerHref(entry, controlLinks),
|
|
1921
1817
|
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",
|
|
1922
1818
|
children: entry.displayName
|
|
1923
1819
|
}
|
|
1924
|
-
) : /* @__PURE__ */
|
|
1925
|
-
entry.reason ? /* @__PURE__ */
|
|
1820
|
+
) : /* @__PURE__ */ jsx4("span", { className: "font-medium text-og-fg", children: entry.displayName }),
|
|
1821
|
+
entry.reason ? /* @__PURE__ */ jsxs4("span", { className: "text-og-fg-muted", children: [
|
|
1926
1822
|
" \xB7 ",
|
|
1927
1823
|
entry.reason
|
|
1928
1824
|
] }) : null,
|
|
1929
|
-
entry.actor ? /* @__PURE__ */
|
|
1825
|
+
entry.actor ? /* @__PURE__ */ jsxs4("span", { className: "text-og-fg-subtle", children: [
|
|
1930
1826
|
" \xB7 ",
|
|
1931
1827
|
entry.actor
|
|
1932
1828
|
] }) : null,
|
|
1933
|
-
entry.changedAt ? /* @__PURE__ */
|
|
1829
|
+
entry.changedAt ? /* @__PURE__ */ jsxs4("span", { className: "text-og-fg-subtle", children: [
|
|
1934
1830
|
" ",
|
|
1935
1831
|
"\xB7 ",
|
|
1936
1832
|
messages.formatRelativeTime(entry.changedAt)
|
|
@@ -1939,11 +1835,11 @@ function WorkstreamPausedStrip({
|
|
|
1939
1835
|
},
|
|
1940
1836
|
`${entry.kind}-${entry.sessionId ?? "workspace"}-${entry.revision}`
|
|
1941
1837
|
)) }),
|
|
1942
|
-
broaderOptions.length > 0 ? /* @__PURE__ */
|
|
1838
|
+
broaderOptions.length > 0 ? /* @__PURE__ */ jsx4("div", { className: "mt-2 flex flex-wrap gap-1.5", children: broaderOptions.map((option) => /* @__PURE__ */ jsx4(
|
|
1943
1839
|
ComposerTip,
|
|
1944
1840
|
{
|
|
1945
1841
|
tip: option.impactCopy,
|
|
1946
|
-
children: /* @__PURE__ */
|
|
1842
|
+
children: /* @__PURE__ */ jsxs4(
|
|
1947
1843
|
"button",
|
|
1948
1844
|
{
|
|
1949
1845
|
type: "button",
|
|
@@ -1951,8 +1847,8 @@ function WorkstreamPausedStrip({
|
|
|
1951
1847
|
onClick: () => onResumeOption(option),
|
|
1952
1848
|
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",
|
|
1953
1849
|
children: [
|
|
1954
|
-
/* @__PURE__ */
|
|
1955
|
-
/* @__PURE__ */
|
|
1850
|
+
/* @__PURE__ */ jsx4("span", { className: "block font-medium", children: option.scope === "workspace" ? messages.resumeWorkspace : messages.resumeFromSession }),
|
|
1851
|
+
/* @__PURE__ */ jsx4("span", { className: "block text-[10px] text-og-fg-subtle", children: option.selectedStateAfter === "active" ? messages.sessionCanRun : messages.stillPausedBy(
|
|
1956
1852
|
option.remainingPrimaryBlocker?.displayName ?? messages.narrowerPause
|
|
1957
1853
|
) })
|
|
1958
1854
|
]
|
|
@@ -1973,26 +1869,26 @@ function RestoredResourceChips({
|
|
|
1973
1869
|
messages,
|
|
1974
1870
|
onRemove
|
|
1975
1871
|
}) {
|
|
1976
|
-
return /* @__PURE__ */
|
|
1872
|
+
return /* @__PURE__ */ jsx4(
|
|
1977
1873
|
"div",
|
|
1978
1874
|
{
|
|
1979
1875
|
className: "flex flex-wrap gap-1.5 border-b border-og-border px-3 py-2",
|
|
1980
1876
|
"aria-label": messages.restoredResourcesLabel,
|
|
1981
|
-
children: resources.map((resource, index) => /* @__PURE__ */
|
|
1877
|
+
children: resources.map((resource, index) => /* @__PURE__ */ jsxs4(
|
|
1982
1878
|
"span",
|
|
1983
1879
|
{
|
|
1984
1880
|
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",
|
|
1985
1881
|
children: [
|
|
1986
|
-
/* @__PURE__ */
|
|
1987
|
-
/* @__PURE__ */
|
|
1988
|
-
/* @__PURE__ */
|
|
1882
|
+
/* @__PURE__ */ jsx4(FileIcon, { className: "size-3 shrink-0" }),
|
|
1883
|
+
/* @__PURE__ */ jsx4("span", { className: "truncate", children: resource.kind === "file" ? messages.restoredFile(resource.fileId) : resource.uri }),
|
|
1884
|
+
/* @__PURE__ */ jsx4(
|
|
1989
1885
|
"button",
|
|
1990
1886
|
{
|
|
1991
1887
|
type: "button",
|
|
1992
1888
|
className: "shrink-0 hover:text-og-fg",
|
|
1993
1889
|
onClick: () => onRemove(index),
|
|
1994
1890
|
"aria-label": messages.removeRestoredResource(index),
|
|
1995
|
-
children: /* @__PURE__ */
|
|
1891
|
+
children: /* @__PURE__ */ jsx4(XIcon2, { className: "size-3" })
|
|
1996
1892
|
}
|
|
1997
1893
|
)
|
|
1998
1894
|
]
|
|
@@ -2009,14 +1905,14 @@ function ConfirmBar({
|
|
|
2009
1905
|
onConfirm,
|
|
2010
1906
|
returnFocusRef
|
|
2011
1907
|
}) {
|
|
2012
|
-
const confirmRef =
|
|
1908
|
+
const confirmRef = useRef2(null);
|
|
2013
1909
|
const descriptionId = useId2();
|
|
2014
1910
|
useEffect2(() => {
|
|
2015
1911
|
const returnTo = returnFocusRef?.current ?? null;
|
|
2016
1912
|
confirmRef.current?.focus();
|
|
2017
1913
|
return () => returnTo?.focus();
|
|
2018
1914
|
}, [returnFocusRef]);
|
|
2019
|
-
return /* @__PURE__ */
|
|
1915
|
+
return /* @__PURE__ */ jsxs4(
|
|
2020
1916
|
"div",
|
|
2021
1917
|
{
|
|
2022
1918
|
role: "alertdialog",
|
|
@@ -2032,9 +1928,9 @@ function ConfirmBar({
|
|
|
2032
1928
|
},
|
|
2033
1929
|
className: "flex items-end justify-between gap-2 px-2.5 pb-2.5 pt-1",
|
|
2034
1930
|
children: [
|
|
2035
|
-
/* @__PURE__ */
|
|
2036
|
-
/* @__PURE__ */
|
|
2037
|
-
/* @__PURE__ */
|
|
1931
|
+
/* @__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) }),
|
|
1932
|
+
/* @__PURE__ */ jsxs4("span", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
1933
|
+
/* @__PURE__ */ jsx4(
|
|
2038
1934
|
"button",
|
|
2039
1935
|
{
|
|
2040
1936
|
type: "button",
|
|
@@ -2043,7 +1939,7 @@ function ConfirmBar({
|
|
|
2043
1939
|
children: messages.cancel
|
|
2044
1940
|
}
|
|
2045
1941
|
),
|
|
2046
|
-
/* @__PURE__ */
|
|
1942
|
+
/* @__PURE__ */ jsx4(
|
|
2047
1943
|
"button",
|
|
2048
1944
|
{
|
|
2049
1945
|
ref: confirmRef,
|
|
@@ -2067,9 +1963,9 @@ function AttachmentChips({
|
|
|
2067
1963
|
onLoadPreview
|
|
2068
1964
|
}) {
|
|
2069
1965
|
const lightbox = useLightboxOptional();
|
|
2070
|
-
const previewRequest =
|
|
2071
|
-
const [previewLoadingId, setPreviewLoadingId] =
|
|
2072
|
-
const [previewErrorId, setPreviewErrorId] =
|
|
1966
|
+
const previewRequest = useRef2(null);
|
|
1967
|
+
const [previewLoadingId, setPreviewLoadingId] = useState3(null);
|
|
1968
|
+
const [previewErrorId, setPreviewErrorId] = useState3(null);
|
|
2073
1969
|
useEffect2(() => () => previewRequest.current?.abort(), [onLoadPreview]);
|
|
2074
1970
|
async function openPreview(attachment, source, canLoadPreview) {
|
|
2075
1971
|
previewRequest.current?.abort();
|
|
@@ -2110,7 +2006,7 @@ function AttachmentChips({
|
|
|
2110
2006
|
releaseSource
|
|
2111
2007
|
);
|
|
2112
2008
|
}
|
|
2113
|
-
return /* @__PURE__ */
|
|
2009
|
+
return /* @__PURE__ */ jsx4("div", { className: "flex flex-wrap gap-2 px-3 py-2", children: attachments.map((attachment) => {
|
|
2114
2010
|
const failed = attachment.status === "failed";
|
|
2115
2011
|
const secureContextRequired = attachment.errorCode === "secure_context_required";
|
|
2116
2012
|
const previewFailed = previewErrorId === attachment.id;
|
|
@@ -2119,7 +2015,7 @@ function AttachmentChips({
|
|
|
2119
2015
|
lightbox && onLoadPreview && attachment.status === "ready" && attachment.file && attachment.contentType.startsWith("image/")
|
|
2120
2016
|
);
|
|
2121
2017
|
const statusText = previewFailed ? messages.previewUnavailable ?? "Preview unavailable" : attachment.status === "uploading" ? messages.uploading : failed ? attachment.error || messages.uploadFailed : messages.formatBytes(attachment.sizeBytes);
|
|
2122
|
-
return /* @__PURE__ */
|
|
2018
|
+
return /* @__PURE__ */ jsxs4(
|
|
2123
2019
|
"div",
|
|
2124
2020
|
{
|
|
2125
2021
|
className: cn(
|
|
@@ -2130,7 +2026,7 @@ function AttachmentChips({
|
|
|
2130
2026
|
) : "max-w-[240px] border-og-border bg-og-surface-2"
|
|
2131
2027
|
),
|
|
2132
2028
|
children: [
|
|
2133
|
-
lightbox && (attachment.previewUrl || canLoadPreview) ? /* @__PURE__ */
|
|
2029
|
+
lightbox && (attachment.previewUrl || canLoadPreview) ? /* @__PURE__ */ jsx4(
|
|
2134
2030
|
"button",
|
|
2135
2031
|
{
|
|
2136
2032
|
type: "button",
|
|
@@ -2142,46 +2038,46 @@ function AttachmentChips({
|
|
|
2142
2038
|
"aria-busy": previewLoading || void 0,
|
|
2143
2039
|
disabled: previewLoading,
|
|
2144
2040
|
onClick: (event) => void openPreview(attachment, event.currentTarget, canLoadPreview),
|
|
2145
|
-
children: attachment.previewUrl ? /* @__PURE__ */
|
|
2041
|
+
children: attachment.previewUrl ? /* @__PURE__ */ jsx4(
|
|
2146
2042
|
"img",
|
|
2147
2043
|
{
|
|
2148
2044
|
src: attachment.previewUrl,
|
|
2149
2045
|
alt: "",
|
|
2150
2046
|
className: "h-full w-full object-cover transition-opacity hover:opacity-80"
|
|
2151
2047
|
}
|
|
2152
|
-
) : previewLoading ? /* @__PURE__ */
|
|
2048
|
+
) : previewLoading ? /* @__PURE__ */ jsx4(LoaderCircleIcon, { className: "size-4 animate-og-spin text-og-fg-muted" }) : /* @__PURE__ */ jsx4(ImageIcon, { className: "size-4 text-og-fg-muted" })
|
|
2153
2049
|
}
|
|
2154
|
-
) : attachment.previewUrl ? /* @__PURE__ */
|
|
2050
|
+
) : attachment.previewUrl ? /* @__PURE__ */ jsx4(
|
|
2155
2051
|
"img",
|
|
2156
2052
|
{
|
|
2157
2053
|
src: attachment.previewUrl,
|
|
2158
2054
|
alt: "",
|
|
2159
2055
|
className: "size-8 shrink-0 rounded object-cover"
|
|
2160
2056
|
}
|
|
2161
|
-
) : attachment.contentType.startsWith("image/") ? /* @__PURE__ */
|
|
2162
|
-
/* @__PURE__ */
|
|
2163
|
-
/* @__PURE__ */
|
|
2164
|
-
secureContextRequired ? /* @__PURE__ */
|
|
2057
|
+
) : 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" }),
|
|
2058
|
+
/* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
|
|
2059
|
+
/* @__PURE__ */ jsx4("div", { className: "truncate font-medium text-og-fg", children: attachment.name }),
|
|
2060
|
+
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 })
|
|
2165
2061
|
] }),
|
|
2166
|
-
attachment.status === "uploading" ? /* @__PURE__ */
|
|
2167
|
-
failed && !secureContextRequired && onRetry ? /* @__PURE__ */
|
|
2062
|
+
attachment.status === "uploading" ? /* @__PURE__ */ jsx4(LoaderCircleIcon, { className: "size-3.5 shrink-0 animate-og-spin" }) : null,
|
|
2063
|
+
failed && !secureContextRequired && onRetry ? /* @__PURE__ */ jsx4(ComposerTip, { tip: messages.retryUpload, children: /* @__PURE__ */ jsx4(
|
|
2168
2064
|
"button",
|
|
2169
2065
|
{
|
|
2170
2066
|
type: "button",
|
|
2171
2067
|
onClick: () => onRetry(attachment.id),
|
|
2172
2068
|
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",
|
|
2173
2069
|
"aria-label": messages.retryAttachment(attachment.name),
|
|
2174
|
-
children: /* @__PURE__ */
|
|
2070
|
+
children: /* @__PURE__ */ jsx4(RotateCwIcon, { className: "size-3.5" })
|
|
2175
2071
|
}
|
|
2176
2072
|
) }) : null,
|
|
2177
|
-
/* @__PURE__ */
|
|
2073
|
+
/* @__PURE__ */ jsx4(
|
|
2178
2074
|
"button",
|
|
2179
2075
|
{
|
|
2180
2076
|
type: "button",
|
|
2181
2077
|
onClick: () => onRemove(attachment.id),
|
|
2182
2078
|
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",
|
|
2183
2079
|
"aria-label": messages.removeAttachment(attachment.name),
|
|
2184
|
-
children: /* @__PURE__ */
|
|
2080
|
+
children: /* @__PURE__ */ jsx4(XIcon2, { className: "size-3.5" })
|
|
2185
2081
|
}
|
|
2186
2082
|
)
|
|
2187
2083
|
]
|
|
@@ -2195,7 +2091,7 @@ function HelpPanel({
|
|
|
2195
2091
|
messages,
|
|
2196
2092
|
onClose
|
|
2197
2093
|
}) {
|
|
2198
|
-
return /* @__PURE__ */
|
|
2094
|
+
return /* @__PURE__ */ jsxs4(
|
|
2199
2095
|
motion3.div,
|
|
2200
2096
|
{
|
|
2201
2097
|
initial: { opacity: 0, height: 0 },
|
|
@@ -2203,9 +2099,9 @@ function HelpPanel({
|
|
|
2203
2099
|
exit: { opacity: 0, height: 0 },
|
|
2204
2100
|
className: "mt-2 overflow-hidden rounded-og-lg border border-og-border bg-og-surface-2",
|
|
2205
2101
|
children: [
|
|
2206
|
-
/* @__PURE__ */
|
|
2207
|
-
/* @__PURE__ */
|
|
2208
|
-
/* @__PURE__ */
|
|
2102
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between border-b border-og-border px-3 py-1.5", children: [
|
|
2103
|
+
/* @__PURE__ */ jsx4("span", { className: "text-og-sm font-medium text-og-fg", children: messages.commands }),
|
|
2104
|
+
/* @__PURE__ */ jsx4(
|
|
2209
2105
|
"button",
|
|
2210
2106
|
{
|
|
2211
2107
|
type: "button",
|
|
@@ -2215,16 +2111,16 @@ function HelpPanel({
|
|
|
2215
2111
|
}
|
|
2216
2112
|
)
|
|
2217
2113
|
] }),
|
|
2218
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ jsx4("ul", { className: "py-1", children: commands.map((command) => {
|
|
2219
2115
|
const hint = argHint(command.args);
|
|
2220
|
-
return /* @__PURE__ */
|
|
2221
|
-
/* @__PURE__ */
|
|
2116
|
+
return /* @__PURE__ */ jsxs4("li", { className: "flex items-baseline gap-2 px-3 py-1", children: [
|
|
2117
|
+
/* @__PURE__ */ jsxs4("span", { className: "font-mono text-og-sm text-og-accent", children: [
|
|
2222
2118
|
"/",
|
|
2223
2119
|
command.name,
|
|
2224
|
-
hint ? /* @__PURE__ */
|
|
2120
|
+
hint ? /* @__PURE__ */ jsx4("span", { className: "ml-1 text-og-fg-subtle", children: hint }) : null
|
|
2225
2121
|
] }),
|
|
2226
|
-
/* @__PURE__ */
|
|
2227
|
-
command.danger ? /* @__PURE__ */
|
|
2122
|
+
/* @__PURE__ */ jsx4("span", { className: "text-og-sm text-og-fg-muted", children: command.description }),
|
|
2123
|
+
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
|
|
2228
2124
|
] }, command.name);
|
|
2229
2125
|
}) })
|
|
2230
2126
|
]
|
|
@@ -2582,7 +2478,7 @@ import {
|
|
|
2582
2478
|
authorizeTranscriptionAdapter,
|
|
2583
2479
|
createTranscriptionSessionRequest
|
|
2584
2480
|
} from "@opengeni/sdk";
|
|
2585
|
-
import { useCallback as useCallback4, useEffect as useEffect3, useMemo as
|
|
2481
|
+
import { useCallback as useCallback4, useEffect as useEffect3, useMemo as useMemo5, useRef as useRef3, useState as useState4 } from "react";
|
|
2586
2482
|
var INITIAL_TRANSCRIPTION_CONTROL_STATE = {
|
|
2587
2483
|
status: "idle",
|
|
2588
2484
|
generation: 0,
|
|
@@ -2744,12 +2640,12 @@ function useTranscription({
|
|
|
2744
2640
|
lifecycleTimeouts,
|
|
2745
2641
|
onDiagnostic
|
|
2746
2642
|
}) {
|
|
2747
|
-
const [state, setState] =
|
|
2748
|
-
const stateRef =
|
|
2749
|
-
const valueRef =
|
|
2750
|
-
const sessionRef =
|
|
2751
|
-
const pendingStartRef =
|
|
2752
|
-
const activePolicyRef =
|
|
2643
|
+
const [state, setState] = useState4(INITIAL_TRANSCRIPTION_CONTROL_STATE);
|
|
2644
|
+
const stateRef = useRef3(state);
|
|
2645
|
+
const valueRef = useRef3(value);
|
|
2646
|
+
const sessionRef = useRef3(null);
|
|
2647
|
+
const pendingStartRef = useRef3(null);
|
|
2648
|
+
const activePolicyRef = useRef3(null);
|
|
2753
2649
|
valueRef.current = value;
|
|
2754
2650
|
const startTimeoutMs = normalizeTimeout(
|
|
2755
2651
|
lifecycleTimeouts?.startMs,
|
|
@@ -2769,15 +2665,15 @@ function useTranscription({
|
|
|
2769
2665
|
},
|
|
2770
2666
|
[onDiagnostic]
|
|
2771
2667
|
);
|
|
2772
|
-
const cleanupRuntimeRef =
|
|
2668
|
+
const cleanupRuntimeRef = useRef3({ cleanupTimeoutMs, reportDiagnostic });
|
|
2773
2669
|
useEffect3(() => {
|
|
2774
2670
|
cleanupRuntimeRef.current = { cleanupTimeoutMs, reportDiagnostic };
|
|
2775
2671
|
}, [cleanupTimeoutMs, reportDiagnostic]);
|
|
2776
|
-
const policyRevision =
|
|
2672
|
+
const policyRevision = useMemo5(
|
|
2777
2673
|
() => transcriptionPolicyRevision(policy, selection),
|
|
2778
2674
|
[policy, selection]
|
|
2779
2675
|
);
|
|
2780
|
-
const authorization =
|
|
2676
|
+
const authorization = useMemo5(
|
|
2781
2677
|
() => adapter ? authorizeTranscriptionAdapter(policy, adapter.descriptor, selection) : null,
|
|
2782
2678
|
[adapter, policy, selection]
|
|
2783
2679
|
);
|
|
@@ -3143,7 +3039,7 @@ function transcriptionPolicyRevision(policy, selection) {
|
|
|
3143
3039
|
|
|
3144
3040
|
// src/hooks/use-voice-input.ts
|
|
3145
3041
|
import { OpenGeniApiError } from "@opengeni/sdk";
|
|
3146
|
-
import { useCallback as useCallback5, useEffect as useEffect4, useRef as
|
|
3042
|
+
import { useCallback as useCallback5, useEffect as useEffect4, useRef as useRef4, useState as useState5 } from "react";
|
|
3147
3043
|
|
|
3148
3044
|
// src/voice-recording-owner.ts
|
|
3149
3045
|
var VOICE_RECORDING_OWNER_SESSION_KEY = "opengeni.voice-recording-owner.v1";
|
|
@@ -3367,44 +3263,44 @@ function useVoiceInput({
|
|
|
3367
3263
|
now = currentDate,
|
|
3368
3264
|
automaticRetryDelayMilliseconds
|
|
3369
3265
|
}) {
|
|
3370
|
-
const [status, setStatus] =
|
|
3371
|
-
const [error, setError] =
|
|
3372
|
-
const [stream, setStream] =
|
|
3373
|
-
const [recordingId, setRecordingId] =
|
|
3374
|
-
const [durationSeconds, setDurationSeconds] =
|
|
3375
|
-
const [locallySaved, setLocallySaved] =
|
|
3376
|
-
const [storageAvailable, setStorageAvailable] =
|
|
3266
|
+
const [status, setStatus] = useState5("idle");
|
|
3267
|
+
const [error, setError] = useState5(null);
|
|
3268
|
+
const [stream, setStream] = useState5(null);
|
|
3269
|
+
const [recordingId, setRecordingId] = useState5(null);
|
|
3270
|
+
const [durationSeconds, setDurationSeconds] = useState5(0);
|
|
3271
|
+
const [locallySaved, setLocallySaved] = useState5(false);
|
|
3272
|
+
const [storageAvailable, setStorageAvailable] = useState5(
|
|
3377
3273
|
() => Boolean(createRecordingStore) || typeof globalThis.indexedDB !== "undefined"
|
|
3378
3274
|
);
|
|
3379
|
-
const createRecordingStoreRef =
|
|
3275
|
+
const createRecordingStoreRef = useRef4(createRecordingStore);
|
|
3380
3276
|
createRecordingStoreRef.current = createRecordingStore;
|
|
3381
|
-
const nowRef =
|
|
3277
|
+
const nowRef = useRef4(now);
|
|
3382
3278
|
nowRef.current = now;
|
|
3383
3279
|
const readNow = useCallback5(() => nowRef.current(), []);
|
|
3384
|
-
const generationRef =
|
|
3385
|
-
const workspaceIdRef =
|
|
3386
|
-
const ownerIdRef =
|
|
3387
|
-
const ownerLeaseRef =
|
|
3388
|
-
const ownerIdPromiseRef =
|
|
3389
|
-
const createOwnerIdRef =
|
|
3390
|
-
const recorderRef =
|
|
3391
|
-
const streamRef =
|
|
3392
|
-
const timerRef =
|
|
3393
|
-
const automaticRetryTimerRef =
|
|
3394
|
-
const automaticRetryAttemptRef =
|
|
3395
|
-
const ownerHeartbeatTimerRef =
|
|
3396
|
-
const controllerRef =
|
|
3397
|
-
const valueRef =
|
|
3398
|
-
const storeRef =
|
|
3399
|
-
const storePromiseRef =
|
|
3400
|
-
const ownsStoreRef =
|
|
3401
|
-
const manifestRef =
|
|
3402
|
-
const persistenceQueueRef =
|
|
3403
|
-
const persistenceErrorRef =
|
|
3404
|
-
const captureLimitErrorRef =
|
|
3405
|
-
const captureSettledRef =
|
|
3406
|
-
const resolveCaptureSettledRef =
|
|
3407
|
-
const statusRef =
|
|
3280
|
+
const generationRef = useRef4(0);
|
|
3281
|
+
const workspaceIdRef = useRef4(workspaceId);
|
|
3282
|
+
const ownerIdRef = useRef4(null);
|
|
3283
|
+
const ownerLeaseRef = useRef4(null);
|
|
3284
|
+
const ownerIdPromiseRef = useRef4(null);
|
|
3285
|
+
const createOwnerIdRef = useRef4(createOwnerId);
|
|
3286
|
+
const recorderRef = useRef4(null);
|
|
3287
|
+
const streamRef = useRef4(null);
|
|
3288
|
+
const timerRef = useRef4(null);
|
|
3289
|
+
const automaticRetryTimerRef = useRef4(null);
|
|
3290
|
+
const automaticRetryAttemptRef = useRef4(0);
|
|
3291
|
+
const ownerHeartbeatTimerRef = useRef4(null);
|
|
3292
|
+
const controllerRef = useRef4(null);
|
|
3293
|
+
const valueRef = useRef4(value);
|
|
3294
|
+
const storeRef = useRef4(null);
|
|
3295
|
+
const storePromiseRef = useRef4(null);
|
|
3296
|
+
const ownsStoreRef = useRef4(false);
|
|
3297
|
+
const manifestRef = useRef4(null);
|
|
3298
|
+
const persistenceQueueRef = useRef4(Promise.resolve());
|
|
3299
|
+
const persistenceErrorRef = useRef4(null);
|
|
3300
|
+
const captureLimitErrorRef = useRef4(null);
|
|
3301
|
+
const captureSettledRef = useRef4(Promise.resolve());
|
|
3302
|
+
const resolveCaptureSettledRef = useRef4(null);
|
|
3303
|
+
const statusRef = useRef4(status);
|
|
3408
3304
|
valueRef.current = value;
|
|
3409
3305
|
statusRef.current = status;
|
|
3410
3306
|
workspaceIdRef.current = workspaceId;
|
|
@@ -3728,7 +3624,7 @@ function useVoiceInput({
|
|
|
3728
3624
|
workspaceId
|
|
3729
3625
|
]
|
|
3730
3626
|
);
|
|
3731
|
-
const finalizePersistedRecordingRef =
|
|
3627
|
+
const finalizePersistedRecordingRef = useRef4(finalizePersistedRecording);
|
|
3732
3628
|
finalizePersistedRecordingRef.current = finalizePersistedRecording;
|
|
3733
3629
|
const clientAvailable = client !== null && client !== void 0;
|
|
3734
3630
|
useEffect4(() => {
|
|
@@ -4504,12 +4400,12 @@ import {
|
|
|
4504
4400
|
XIcon as XIcon3
|
|
4505
4401
|
} from "lucide-react";
|
|
4506
4402
|
import { AnimatePresence as AnimatePresence4, motion as motion4 } from "motion/react";
|
|
4507
|
-
import { useEffect as useEffect5, useState as
|
|
4508
|
-
import { Fragment as Fragment3, jsx as
|
|
4403
|
+
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
4404
|
+
import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
4509
4405
|
function Tip({ tip, children }) {
|
|
4510
|
-
return /* @__PURE__ */
|
|
4511
|
-
/* @__PURE__ */
|
|
4512
|
-
/* @__PURE__ */
|
|
4406
|
+
return /* @__PURE__ */ jsxs5(Tooltip, { children: [
|
|
4407
|
+
/* @__PURE__ */ jsx5(TooltipTrigger, { asChild: true, children }),
|
|
4408
|
+
/* @__PURE__ */ jsx5(TooltipContent, { side: "top", children: tip })
|
|
4513
4409
|
] });
|
|
4514
4410
|
}
|
|
4515
4411
|
var defaultMessages = {
|
|
@@ -4593,7 +4489,7 @@ function ComposerTranscriptionControl({
|
|
|
4593
4489
|
}
|
|
4594
4490
|
void transcription.start();
|
|
4595
4491
|
}
|
|
4596
|
-
return /* @__PURE__ */
|
|
4492
|
+
return /* @__PURE__ */ jsx5(AnimatePresence4, { initial: false, children: suppressed ? null : /* @__PURE__ */ jsx5(
|
|
4597
4493
|
motion4.span,
|
|
4598
4494
|
{
|
|
4599
4495
|
initial: { opacity: 0, width: 0 },
|
|
@@ -4609,8 +4505,8 @@ function ComposerTranscriptionControl({
|
|
|
4609
4505
|
),
|
|
4610
4506
|
"data-transcription-status": status,
|
|
4611
4507
|
"data-transcription-capturing": capturing ? "" : void 0,
|
|
4612
|
-
children: /* @__PURE__ */
|
|
4613
|
-
/* @__PURE__ */
|
|
4508
|
+
children: /* @__PURE__ */ jsxs5("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
|
|
4509
|
+
/* @__PURE__ */ jsx5(AnimatePresence4, { mode: "popLayout", initial: false, children: recoverable ? /* @__PURE__ */ jsxs5(
|
|
4614
4510
|
motion4.span,
|
|
4615
4511
|
{
|
|
4616
4512
|
initial: { opacity: 0, scale: 0.96 },
|
|
@@ -4622,12 +4518,12 @@ function ComposerTranscriptionControl({
|
|
|
4622
4518
|
"bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11"
|
|
4623
4519
|
),
|
|
4624
4520
|
children: [
|
|
4625
|
-
/* @__PURE__ */
|
|
4626
|
-
/* @__PURE__ */
|
|
4521
|
+
/* @__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 }),
|
|
4522
|
+
/* @__PURE__ */ jsx5(
|
|
4627
4523
|
Tip,
|
|
4628
4524
|
{
|
|
4629
4525
|
tip: savedTranscript ? messages.insertRecoveredTranscript : retrying ? messages.pauseRetrying : messages.retry,
|
|
4630
|
-
children: /* @__PURE__ */
|
|
4526
|
+
children: /* @__PURE__ */ jsx5(
|
|
4631
4527
|
"button",
|
|
4632
4528
|
{
|
|
4633
4529
|
type: "button",
|
|
@@ -4638,12 +4534,12 @@ function ComposerTranscriptionControl({
|
|
|
4638
4534
|
"bg-og-fg text-og-bg transition-colors duration-150 motion-reduce:transition-none",
|
|
4639
4535
|
"hover:bg-og-fg-muted pointer-coarse:size-11"
|
|
4640
4536
|
),
|
|
4641
|
-
children: savedTranscript ? /* @__PURE__ */
|
|
4537
|
+
children: savedTranscript ? /* @__PURE__ */ jsx5(ClipboardPasteIcon, { className: "size-3.5" }) : retrying ? /* @__PURE__ */ jsx5(SquareIcon, { className: "size-3.5" }) : /* @__PURE__ */ jsx5(RefreshCwIcon, { className: "size-3.5" })
|
|
4642
4538
|
}
|
|
4643
4539
|
)
|
|
4644
4540
|
}
|
|
4645
4541
|
),
|
|
4646
|
-
/* @__PURE__ */
|
|
4542
|
+
/* @__PURE__ */ jsx5(Tip, { tip: messages.discardRecovered, children: /* @__PURE__ */ jsx5(
|
|
4647
4543
|
"button",
|
|
4648
4544
|
{
|
|
4649
4545
|
type: "button",
|
|
@@ -4654,13 +4550,13 @@ function ComposerTranscriptionControl({
|
|
|
4654
4550
|
"text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
|
|
4655
4551
|
"hover:bg-og-surface-3 hover:text-og-status-failed pointer-coarse:size-11"
|
|
4656
4552
|
),
|
|
4657
|
-
children: /* @__PURE__ */
|
|
4553
|
+
children: /* @__PURE__ */ jsx5(Trash2Icon, { className: "size-3.5" })
|
|
4658
4554
|
}
|
|
4659
4555
|
) })
|
|
4660
4556
|
]
|
|
4661
4557
|
},
|
|
4662
4558
|
"recovered"
|
|
4663
|
-
) : active ? /* @__PURE__ */
|
|
4559
|
+
) : active ? /* @__PURE__ */ jsxs5(
|
|
4664
4560
|
motion4.span,
|
|
4665
4561
|
{
|
|
4666
4562
|
initial: { opacity: 0, scale: 0.96 },
|
|
@@ -4672,21 +4568,21 @@ function ComposerTranscriptionControl({
|
|
|
4672
4568
|
"bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11"
|
|
4673
4569
|
),
|
|
4674
4570
|
children: [
|
|
4675
|
-
status === "requesting-permission" ? /* @__PURE__ */
|
|
4571
|
+
status === "requesting-permission" ? /* @__PURE__ */ jsx5(
|
|
4676
4572
|
LoaderCircleIcon2,
|
|
4677
4573
|
{
|
|
4678
4574
|
className: "size-3.5 shrink-0 text-og-fg-muted animate-og-spin motion-reduce:animate-none",
|
|
4679
4575
|
"aria-hidden": true
|
|
4680
4576
|
}
|
|
4681
|
-
) : /* @__PURE__ */
|
|
4682
|
-
status === "recording" ? /* @__PURE__ */
|
|
4577
|
+
) : /* @__PURE__ */ jsxs5("span", { className: "flex items-center gap-1.5", children: [
|
|
4578
|
+
status === "recording" ? /* @__PURE__ */ jsx5(
|
|
4683
4579
|
"span",
|
|
4684
4580
|
{
|
|
4685
4581
|
"aria-hidden": true,
|
|
4686
4582
|
className: "size-1.5 shrink-0 rounded-full bg-og-status-failed animate-og-pulse motion-reduce:animate-none"
|
|
4687
4583
|
}
|
|
4688
4584
|
) : null,
|
|
4689
|
-
/* @__PURE__ */
|
|
4585
|
+
/* @__PURE__ */ jsx5(
|
|
4690
4586
|
VoiceWaveform,
|
|
4691
4587
|
{
|
|
4692
4588
|
stream: status === "recording" ? transcription.stream : null,
|
|
@@ -4694,8 +4590,8 @@ function ComposerTranscriptionControl({
|
|
|
4694
4590
|
}
|
|
4695
4591
|
)
|
|
4696
4592
|
] }),
|
|
4697
|
-
status === "recording" ? /* @__PURE__ */
|
|
4698
|
-
/* @__PURE__ */
|
|
4593
|
+
status === "recording" ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
4594
|
+
/* @__PURE__ */ jsx5(Tip, { tip: messages.cancel, children: /* @__PURE__ */ jsx5(
|
|
4699
4595
|
"button",
|
|
4700
4596
|
{
|
|
4701
4597
|
type: "button",
|
|
@@ -4707,10 +4603,10 @@ function ComposerTranscriptionControl({
|
|
|
4707
4603
|
"text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
|
|
4708
4604
|
"hover:bg-og-surface-3 hover:text-og-fg pointer-coarse:size-11"
|
|
4709
4605
|
),
|
|
4710
|
-
children: /* @__PURE__ */
|
|
4606
|
+
children: /* @__PURE__ */ jsx5(XIcon3, { className: "size-3.5" })
|
|
4711
4607
|
}
|
|
4712
4608
|
) }),
|
|
4713
|
-
/* @__PURE__ */
|
|
4609
|
+
/* @__PURE__ */ jsx5(Tip, { tip: messages.stop, children: /* @__PURE__ */ jsx5(
|
|
4714
4610
|
"button",
|
|
4715
4611
|
{
|
|
4716
4612
|
type: "button",
|
|
@@ -4721,14 +4617,14 @@ function ComposerTranscriptionControl({
|
|
|
4721
4617
|
"bg-og-fg text-og-bg transition-colors duration-150 motion-reduce:transition-none",
|
|
4722
4618
|
"hover:bg-og-fg-muted pointer-coarse:size-11"
|
|
4723
4619
|
),
|
|
4724
|
-
children: /* @__PURE__ */
|
|
4620
|
+
children: /* @__PURE__ */ jsx5(SquareIcon, { className: "size-2.5 fill-current" })
|
|
4725
4621
|
}
|
|
4726
4622
|
) })
|
|
4727
|
-
] }) : status === "transcribing" || status === "saving" ? /* @__PURE__ */
|
|
4623
|
+
] }) : 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 })
|
|
4728
4624
|
]
|
|
4729
4625
|
},
|
|
4730
4626
|
status === "transcribing" || status === "saving" ? "processing" : "capture"
|
|
4731
|
-
) : /* @__PURE__ */
|
|
4627
|
+
) : /* @__PURE__ */ jsx5(Tip, { tip: idleLabel, children: /* @__PURE__ */ jsx5(
|
|
4732
4628
|
motion4.button,
|
|
4733
4629
|
{
|
|
4734
4630
|
type: "button",
|
|
@@ -4746,10 +4642,10 @@ function ComposerTranscriptionControl({
|
|
|
4746
4642
|
"text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
|
|
4747
4643
|
unavailableMessage ? "cursor-not-allowed opacity-45" : "hover:bg-og-surface-2 hover:text-og-fg"
|
|
4748
4644
|
),
|
|
4749
|
-
children: /* @__PURE__ */
|
|
4645
|
+
children: /* @__PURE__ */ jsx5(MicIcon, { className: "size-4" })
|
|
4750
4646
|
}
|
|
4751
4647
|
) }, "idle") }),
|
|
4752
|
-
status === "error" && errorMessage3 && !recoverable ? /* @__PURE__ */
|
|
4648
|
+
status === "error" && errorMessage3 && !recoverable ? /* @__PURE__ */ jsx5(Tip, { tip: errorMessage3, children: /* @__PURE__ */ jsx5(
|
|
4753
4649
|
"span",
|
|
4754
4650
|
{
|
|
4755
4651
|
"aria-hidden": "true",
|
|
@@ -4757,7 +4653,7 @@ function ComposerTranscriptionControl({
|
|
|
4757
4653
|
children: errorMessage3
|
|
4758
4654
|
}
|
|
4759
4655
|
) }) : null,
|
|
4760
|
-
/* @__PURE__ */
|
|
4656
|
+
/* @__PURE__ */ jsx5(
|
|
4761
4657
|
"span",
|
|
4762
4658
|
{
|
|
4763
4659
|
className: "sr-only",
|
|
@@ -4775,8 +4671,8 @@ function VoiceWaveform({
|
|
|
4775
4671
|
stream,
|
|
4776
4672
|
mode
|
|
4777
4673
|
}) {
|
|
4778
|
-
const [levels, setLevels] =
|
|
4779
|
-
const [live, setLive] =
|
|
4674
|
+
const [levels, setLevels] = useState6(() => restingLevels(WAVEFORM_BARS));
|
|
4675
|
+
const [live, setLive] = useState6(false);
|
|
4780
4676
|
useEffect5(() => {
|
|
4781
4677
|
if (!stream || mode !== "recording") {
|
|
4782
4678
|
setLive(false);
|
|
@@ -4825,7 +4721,7 @@ function VoiceWaveform({
|
|
|
4825
4721
|
void context?.close();
|
|
4826
4722
|
};
|
|
4827
4723
|
}, [stream, mode]);
|
|
4828
|
-
return /* @__PURE__ */
|
|
4724
|
+
return /* @__PURE__ */ jsx5(
|
|
4829
4725
|
"span",
|
|
4830
4726
|
{
|
|
4831
4727
|
"aria-hidden": true,
|
|
@@ -4833,7 +4729,7 @@ function VoiceWaveform({
|
|
|
4833
4729
|
className: "flex h-4 w-[3.75rem] items-center justify-center gap-px",
|
|
4834
4730
|
children: WAVEFORM_BAR_KEYS.map((key, index) => {
|
|
4835
4731
|
const level = levels[index] ?? 0;
|
|
4836
|
-
return /* @__PURE__ */
|
|
4732
|
+
return /* @__PURE__ */ jsx5(
|
|
4837
4733
|
"span",
|
|
4838
4734
|
{
|
|
4839
4735
|
className: cn(
|
|
@@ -4884,10 +4780,6 @@ function transcriptionErrorMessage(code, messages) {
|
|
|
4884
4780
|
}
|
|
4885
4781
|
|
|
4886
4782
|
export {
|
|
4887
|
-
TooltipProvider,
|
|
4888
|
-
Tooltip,
|
|
4889
|
-
TooltipTrigger,
|
|
4890
|
-
TooltipContent,
|
|
4891
4783
|
useLightbox,
|
|
4892
4784
|
useLightboxOptional,
|
|
4893
4785
|
LightboxProvider,
|
|
@@ -4944,4 +4836,4 @@ export {
|
|
|
4944
4836
|
useVoiceInput,
|
|
4945
4837
|
ComposerTranscriptionControl
|
|
4946
4838
|
};
|
|
4947
|
-
//# sourceMappingURL=chunk-
|
|
4839
|
+
//# sourceMappingURL=chunk-V3WX3TQG.js.map
|