@burdenoff/fe-libs 2026.1115.11 → 2026.1115.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/assistant/index.d.ts +1 -0
- package/dist/shared/assistant/ui/AssistantAvatar.js +18 -14
- package/dist/shared/assistant/ui/AssistantChatArea.js +1 -0
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +5 -0
- package/dist/shared/assistant/ui/AssistantMessageItem.js +57 -56
- package/dist/shared/assistant/ui/AssistantMessageList.js +57 -44
- package/dist/shared/assistant/ui/AssistantTurnActivity.d.ts +2 -0
- package/dist/shared/assistant/ui/AssistantTurnActivity.js +20 -17
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +5 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +348 -343
- package/dist/shared/assistant/ui/composer/AssistantDictation.js +57 -56
- package/dist/shared/assistant/ui/composer/pageBoxClass.d.ts +13 -0
- package/dist/shared/assistant/ui/composer/pageBoxClass.js +5 -0
- package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.js +41 -35
- package/dist/shared/assistant/ui/voice/AssistantVoiceSessionButton.js +13 -12
- package/dist/shared/assistant/ui/voice/LiveWaveform.js +28 -27
- package/dist/shared-assistant.js +254 -253
- package/package.json +1 -1
- package/src/shared/styles/app-shell.css +5 -0
- package/src/shared/tokens/build/semantic.css +12 -0
- package/src/shared/tokens/build/tailwind.preset.js +5 -0
- package/src/shared/tokens/build/themes.css +14 -0
- package/src/shared/tokens/tokens.css +268 -0
|
@@ -3,504 +3,509 @@ import { EscapeLayer as t } from "../../../components/EscapeLayer.js";
|
|
|
3
3
|
import { useI18n as n } from "../../../providers/shell/I18nProvider.js";
|
|
4
4
|
import { useAssistantTr as r } from "../../i18n.js";
|
|
5
5
|
import { languageDisplayName as i } from "../../voice/speechVoices.js";
|
|
6
|
-
import { resolveAssistantLanguage as
|
|
7
|
-
import { useAssistantStore as
|
|
8
|
-
import { useVoiceInput as
|
|
9
|
-
import { useAssistantAttachments as
|
|
10
|
-
import { getSendableAttachments as
|
|
11
|
-
import { ATTACHMENT_COMMIT_CODES as
|
|
12
|
-
import { AssistantAttachmentButton as
|
|
13
|
-
import { AssistantAttachmentChips as
|
|
14
|
-
import { AssistantFocusChip as
|
|
15
|
-
import { useAskAboutStore as
|
|
16
|
-
import { AssistantVoiceButton as
|
|
17
|
-
import { AssistantVoiceSessionButton as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
6
|
+
import { resolveAssistantLanguage as ee } from "../../voice/languages.js";
|
|
7
|
+
import { useAssistantStore as a } from "../../store.js";
|
|
8
|
+
import { useVoiceInput as o } from "../../voice/useVoiceInput.js";
|
|
9
|
+
import { useAssistantAttachments as te } from "../../useAssistantAttachments.js";
|
|
10
|
+
import { getSendableAttachments as ne } from "../../attachments.js";
|
|
11
|
+
import { ATTACHMENT_COMMIT_CODES as re } from "../../attachmentCommit.js";
|
|
12
|
+
import { AssistantAttachmentButton as ie } from "./AssistantAttachmentButton.js";
|
|
13
|
+
import { AssistantAttachmentChips as ae } from "./AssistantAttachmentChips.js";
|
|
14
|
+
import { AssistantFocusChip as oe } from "./AssistantFocusChip.js";
|
|
15
|
+
import { useAskAboutStore as se } from "../../askAbout/askAboutStore.js";
|
|
16
|
+
import { AssistantVoiceButton as ce, ListeningDot as le } from "./AssistantVoiceButton.js";
|
|
17
|
+
import { AssistantVoiceSessionButton as ue } from "../voice/AssistantVoiceSessionButton.js";
|
|
18
|
+
import { pageBoxClass as de } from "./pageBoxClass.js";
|
|
19
|
+
import { useCompactDictation as fe } from "./useCompactDictation.js";
|
|
20
|
+
import { DictationControls as pe, DictationLiveText as me, MicBlockedNotice as he } from "./AssistantDictation.js";
|
|
21
|
+
import { AssistantMicMenu as ge } from "./AssistantMicMenu.js";
|
|
22
|
+
import { AssistantModeSelector as _e } from "./AssistantModeSelector.js";
|
|
23
|
+
import { AssistantModeMenu as ve } from "./AssistantModeMenu.js";
|
|
24
|
+
import { AssistantViewSwitchRow as ye } from "../compact/AssistantViewSwitchRow.js";
|
|
25
|
+
import { compactEnterSends as be, isImeComposingEnter as xe } from "./imeEnter.js";
|
|
26
|
+
import { PAGE_COLUMN as Se, useAssistantPageLayout as Ce } from "../assistantPageLayout.js";
|
|
27
|
+
import { useCallback as s, useEffect as c, useId as l, useLayoutEffect as we, useMemo as Te, useRef as u, useState as d } from "react";
|
|
28
|
+
import { ArrowUp as Ee, Loader2 as De, Square as Oe } from "lucide-react";
|
|
29
|
+
import { Fragment as ke, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
29
30
|
// src/shared/assistant/ui/composer/AssistantComposer.tsx
|
|
30
|
-
var
|
|
31
|
-
function
|
|
31
|
+
var Ae = 200;
|
|
32
|
+
function je(e) {
|
|
32
33
|
if (!e) return !1;
|
|
33
34
|
let t = e.ownerDocument.activeElement;
|
|
34
35
|
return !t || t === e.ownerDocument.body ? !1 : e.contains(t) ? !0 : e.closest("[data-assistant-panel]")?.contains(t) ?? !1;
|
|
35
36
|
}
|
|
36
|
-
var
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
B && !
|
|
44
|
-
}, [B,
|
|
45
|
-
B || (V.current = !1),
|
|
46
|
-
text:
|
|
37
|
+
var Me = ({ children: e }) => e(l()), m = ({ writeAccessDenied: l = !1, onSend: m, disabled: Ne = !1, readOnly: Pe = !1, placeholder: Fe, mode: Ie, availableModes: h, attachmentCharsPerFile: Le, onModeChange: Re, auto: ze, onStartVoiceSession: g, onDraftStart: Be, onDraftChange: Ve, suspendDictation: He = !1, entrance: Ue = !1, onVoiceStateChange: We, presentation: Ge = "classic", turnInFlight: _ = !1, onStop: Ke, turnId: qe, modeDisabledReason: Je = null, inputRef: v, aboveCard: Ye, viewSwitch: Xe, modeReadOnly: Ze = !1, voiceSessionActive: y = !1, concealed: Qe = !1 }) => {
|
|
38
|
+
let b = r(), x = Ce(), { locale: S } = n(), C = Ne || Pe, w = Ge === "compact", T = u(null), $e = s((e) => {
|
|
39
|
+
T.current = e, typeof v == "function" ? v(e) : v && (v.current = e);
|
|
40
|
+
}, [v]), [E, D] = d(""), [O, et] = d(!1), [k, tt] = d(!1), nt = u(!1), [A, j] = d(null), [rt, M] = d(null), [N, P] = d(null), [it, at] = d(_);
|
|
41
|
+
it === _ ? N !== null && _ && qe != null && qe !== N && P(null) : (at(_), _ ? (M(null), P(null)) : N !== null && (M(N), P(null)));
|
|
42
|
+
let ot = u(!1), F = u(null), st = u(!1), ct = u(!1), lt = u(null), I = u(!1), L = u(0), { attachments: R, isBusy: ut, preparingCount: dt, sendBlocker: ft, rejection: pt, addFiles: z, remove: mt, retry: ht, clear: gt, clearRejection: _t, canAddMore: vt, commit: yt, cancelCommit: bt } = te({ perFileChars: Le }), B = E.trim() !== "" || R.length > 0, xt = u(!1), V = u(!1);
|
|
43
|
+
c(() => {
|
|
44
|
+
B && !xt.current ? (xt.current = !0, Be?.()) : B || (xt.current = !1);
|
|
45
|
+
}, [B, Be]), c(() => {
|
|
46
|
+
B || (V.current = !1), Ve?.({
|
|
47
|
+
text: E,
|
|
47
48
|
hasAttachments: R.length > 0,
|
|
48
49
|
dictated: V.current
|
|
49
50
|
});
|
|
50
51
|
}, [
|
|
51
|
-
|
|
52
|
+
E,
|
|
52
53
|
R.length,
|
|
53
54
|
B,
|
|
54
|
-
|
|
55
|
+
Ve
|
|
55
56
|
]);
|
|
56
|
-
let H =
|
|
57
|
-
V.current = !0,
|
|
58
|
-
}, []),
|
|
59
|
-
onFinalize: (e) =>
|
|
60
|
-
onEnded: () =>
|
|
61
|
-
language:
|
|
62
|
-
deviceId:
|
|
63
|
-
}),
|
|
57
|
+
let H = s((e) => {
|
|
58
|
+
V.current = !0, D((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
|
|
59
|
+
}, []), St = a((e) => e.assistantLanguage), Ct = Te(() => ee(St, S), [St, S]), wt = u(H), Tt = u(() => void 0), Et = a((e) => e.micDeviceId), U = o({
|
|
60
|
+
onFinalize: (e) => wt.current(e),
|
|
61
|
+
onEnded: () => Tt.current(),
|
|
62
|
+
language: Ct.tag,
|
|
63
|
+
deviceId: Et
|
|
64
|
+
}), Dt = s(() => {
|
|
64
65
|
V.current = !0;
|
|
65
|
-
}, []), W =
|
|
66
|
-
enabled:
|
|
66
|
+
}, []), W = fe({
|
|
67
|
+
enabled: w,
|
|
67
68
|
voice: U,
|
|
68
|
-
text:
|
|
69
|
-
setText:
|
|
70
|
-
textareaRef:
|
|
71
|
-
markDictated:
|
|
72
|
-
deviceId:
|
|
73
|
-
}),
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
text: E,
|
|
70
|
+
setText: D,
|
|
71
|
+
textareaRef: T,
|
|
72
|
+
markDictated: Dt,
|
|
73
|
+
deviceId: Et
|
|
74
|
+
}), Ot = W.addFinal;
|
|
75
|
+
c(() => {
|
|
76
|
+
wt.current = w ? Ot : H;
|
|
76
77
|
}, [
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
w,
|
|
79
|
+
Ot,
|
|
79
80
|
H
|
|
80
81
|
]);
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}, [
|
|
85
|
-
let G = U.isActive,
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
let kt = W.recogniserEnded;
|
|
83
|
+
c(() => {
|
|
84
|
+
Tt.current = w ? kt : () => void 0;
|
|
85
|
+
}, [w, kt]);
|
|
86
|
+
let G = U.isActive, At = U.interim, jt = U.stop, Mt = W.keepAndStop;
|
|
87
|
+
c(() => {
|
|
88
|
+
He && G && (w ? Mt() : (At.trim() !== "" && H(At.trim()), jt()));
|
|
88
89
|
}, [
|
|
89
|
-
|
|
90
|
+
He,
|
|
90
91
|
G,
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
At,
|
|
93
|
+
jt,
|
|
93
94
|
H,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
]),
|
|
97
|
-
|
|
98
|
-
committing:
|
|
95
|
+
w,
|
|
96
|
+
Mt
|
|
97
|
+
]), c(() => {
|
|
98
|
+
We?.({
|
|
99
|
+
committing: k,
|
|
99
100
|
dictating: G
|
|
100
101
|
});
|
|
101
102
|
}, [
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
We,
|
|
104
|
+
k,
|
|
104
105
|
G
|
|
105
106
|
]);
|
|
106
|
-
let
|
|
107
|
-
|
|
108
|
-
let t =
|
|
107
|
+
let Nt = se((e) => e.pending), Pt = Nt ? b("askAbout.placeholder", "Ask about {{name}}…", { name: Nt.label }) : Fe ?? b("composer.placeholder", "Ask me anything…"), Ft = se((e) => e.focusRequested), It = (e) => {
|
|
108
|
+
D(e), requestAnimationFrame(() => {
|
|
109
|
+
let t = T.current;
|
|
109
110
|
t && (t.focus({ preventScroll: !0 }), t.setSelectionRange(e.length, e.length));
|
|
110
111
|
});
|
|
111
112
|
};
|
|
112
|
-
|
|
113
|
-
if (!
|
|
114
|
-
let e =
|
|
115
|
-
e && (e.focus({ preventScroll: !0 }),
|
|
116
|
-
}, [
|
|
117
|
-
let K =
|
|
118
|
-
|
|
119
|
-
let Y =
|
|
120
|
-
|
|
113
|
+
c(() => {
|
|
114
|
+
if (!Ft || C) return;
|
|
115
|
+
let e = T.current;
|
|
116
|
+
e && (e.focus({ preventScroll: !0 }), se.getState().actions.composerFocused());
|
|
117
|
+
}, [Ft, C]);
|
|
118
|
+
let K = E.trim(), q = ne(R), Lt = R.filter((e) => e.status === "error"), J = (K.length > 0 || q.length > 0) && !C && !k && ft === null, Rt = q.some((e) => !(e.fileId && e.downloadUrl) && !e.inlineOnly), zt = u(C);
|
|
119
|
+
zt.current = C;
|
|
120
|
+
let Y = u(!0);
|
|
121
|
+
c(() => (Y.current = !0, () => {
|
|
121
122
|
Y.current = !1;
|
|
122
|
-
}), []),
|
|
123
|
-
let e =
|
|
124
|
-
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight,
|
|
125
|
-
}, [
|
|
126
|
-
let X =
|
|
127
|
-
if (!J ||
|
|
123
|
+
}), []), we(() => {
|
|
124
|
+
let e = T.current;
|
|
125
|
+
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, Ae)}px`);
|
|
126
|
+
}, [E]);
|
|
127
|
+
let X = s(async () => {
|
|
128
|
+
if (!J || nt.current) return;
|
|
128
129
|
U.isActive && U.stop();
|
|
129
|
-
let e =
|
|
130
|
-
|
|
131
|
-
let t =
|
|
132
|
-
if (!
|
|
133
|
-
|
|
130
|
+
let e = E.trim();
|
|
131
|
+
j(null);
|
|
132
|
+
let t = w && je(lt.current);
|
|
133
|
+
if (!Rt) {
|
|
134
|
+
I.current = t, m(e, q), D(""), gt();
|
|
134
135
|
return;
|
|
135
136
|
}
|
|
136
|
-
let n =
|
|
137
|
-
|
|
137
|
+
let n = a.getState().activeConversationId;
|
|
138
|
+
nt.current = !0, tt(!0);
|
|
138
139
|
try {
|
|
139
|
-
let r = await
|
|
140
|
+
let r = await yt();
|
|
140
141
|
if (!Y.current) {
|
|
141
142
|
r.ok && await r.rollback();
|
|
142
143
|
return;
|
|
143
144
|
}
|
|
144
145
|
if (!r.ok) {
|
|
145
|
-
r.cancelled ||
|
|
146
|
+
r.cancelled || j({
|
|
146
147
|
kind: "failed",
|
|
147
148
|
failures: r.failures
|
|
148
149
|
});
|
|
149
150
|
return;
|
|
150
151
|
}
|
|
151
|
-
if (
|
|
152
|
-
await r.rollback(), Y.current &&
|
|
152
|
+
if (zt.current) {
|
|
153
|
+
await r.rollback(), Y.current && j({
|
|
153
154
|
kind: "busy",
|
|
154
155
|
failures: []
|
|
155
156
|
});
|
|
156
157
|
return;
|
|
157
158
|
}
|
|
158
|
-
let i =
|
|
159
|
+
let i = a.getState();
|
|
159
160
|
if (i.activeConversationId !== n || n !== null && !i.conversations.some((e) => e.id === n)) {
|
|
160
|
-
await r.rollback(), Y.current &&
|
|
161
|
+
await r.rollback(), Y.current && j({
|
|
161
162
|
kind: "moved",
|
|
162
163
|
failures: []
|
|
163
164
|
});
|
|
164
165
|
return;
|
|
165
166
|
}
|
|
166
|
-
|
|
167
|
+
I.current = t, m(e, ne(r.attachments)), r.handedOver(), D(""), gt();
|
|
167
168
|
} finally {
|
|
168
|
-
|
|
169
|
+
nt.current = !1, Y.current && tt(!1);
|
|
169
170
|
}
|
|
170
171
|
}, [
|
|
171
172
|
J,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
Rt,
|
|
174
|
+
yt,
|
|
175
|
+
m,
|
|
176
|
+
E,
|
|
176
177
|
q,
|
|
177
|
-
|
|
178
|
+
gt,
|
|
178
179
|
U,
|
|
179
|
-
|
|
180
|
-
]),
|
|
181
|
-
|
|
182
|
-
}, [
|
|
183
|
-
|
|
184
|
-
}, []),
|
|
185
|
-
if (
|
|
186
|
-
let e =
|
|
187
|
-
e !== null && (
|
|
188
|
-
}, [
|
|
189
|
-
|
|
190
|
-
!
|
|
191
|
-
}, [
|
|
192
|
-
let
|
|
180
|
+
w
|
|
181
|
+
]), Bt = s(() => {
|
|
182
|
+
bt(), T.current?.focus();
|
|
183
|
+
}, [bt]), Z = s(() => {
|
|
184
|
+
zt.current ? ot.current = !0 : T.current?.focus();
|
|
185
|
+
}, []), Vt = s(() => {
|
|
186
|
+
if (ct.current) return;
|
|
187
|
+
let e = Ke?.() ?? null;
|
|
188
|
+
e !== null && (ct.current = !0, P(e)), Z();
|
|
189
|
+
}, [Ke, Z]);
|
|
190
|
+
c(() => {
|
|
191
|
+
!C && ot.current && (ot.current = !1, T.current?.focus());
|
|
192
|
+
}, [C]);
|
|
193
|
+
let Ht = s((e) => {
|
|
193
194
|
if (e !== null) {
|
|
194
|
-
|
|
195
|
+
F.current = e;
|
|
195
196
|
return;
|
|
196
197
|
}
|
|
197
|
-
let t =
|
|
198
|
-
|
|
199
|
-
}, []), Q =
|
|
200
|
-
|
|
201
|
-
!Q &&
|
|
202
|
-
}, [Q, Z]),
|
|
203
|
-
|
|
204
|
-
}, [
|
|
198
|
+
let t = F.current;
|
|
199
|
+
F.current = null, t !== null && t.ownerDocument.activeElement === t && (st.current = !0);
|
|
200
|
+
}, []), Q = w && _ && Ke !== void 0;
|
|
201
|
+
we(() => {
|
|
202
|
+
!Q && st.current && (st.current = !1, Z());
|
|
203
|
+
}, [Q, Z]), c(() => {
|
|
204
|
+
N === null && (ct.current = !1);
|
|
205
|
+
}, [N]), we(() => {
|
|
205
206
|
if (!Q) return;
|
|
206
|
-
let e =
|
|
207
|
-
if (
|
|
208
|
-
let t =
|
|
207
|
+
let e = I.current;
|
|
208
|
+
if (I.current = !1, !e) return;
|
|
209
|
+
let t = F.current;
|
|
209
210
|
if (t === null) return;
|
|
210
211
|
let n = t.ownerDocument, r = n.activeElement;
|
|
211
|
-
(r === null || r === n.body || r ===
|
|
212
|
+
(r === null || r === n.body || r === T.current) && t.focus({ preventScroll: !0 });
|
|
212
213
|
}, [Q]);
|
|
213
|
-
let
|
|
214
|
-
|
|
214
|
+
let Ut = s((e) => {
|
|
215
|
+
D(e), M(null);
|
|
215
216
|
}, []);
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
c(() => {
|
|
218
|
+
j(null);
|
|
218
219
|
}, [R.length]);
|
|
219
|
-
let
|
|
220
|
-
if (t.kind === "busy") return
|
|
221
|
-
if (t.kind === "moved") return
|
|
220
|
+
let Wt = (t) => {
|
|
221
|
+
if (t.kind === "busy") return b("attachments.saveBusy", "The assistant started another reply, so nothing was sent. Your message and files are still here.");
|
|
222
|
+
if (t.kind === "moved") return b("attachments.saveMoved", "You switched conversations while the files were being saved, so nothing was sent. Your message and files are still here.");
|
|
222
223
|
let { failures: n } = t;
|
|
223
|
-
if (n.some((e) => e.code ===
|
|
224
|
-
if (n.some((e) => e.code ===
|
|
224
|
+
if (n.some((e) => e.code === re.editorAccessRequired)) return e(b, S);
|
|
225
|
+
if (n.some((e) => e.code === re.quotaExceeded || e.code === re.quotaNotProvisioned)) return `${b("attachments.quotaFull", "File storage is full or not set up for this workspace, so the attachments couldn't be saved. Nothing was sent.")} ${b("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
|
|
225
226
|
let r = n[0], i = R.find((e) => e.id === r?.id)?.filename ?? "";
|
|
226
|
-
return `${n.length <= 1 ?
|
|
227
|
-
},
|
|
227
|
+
return `${n.length <= 1 ? b("attachments.saveFailedOne", "{{name}} couldn't be saved, so nothing was sent.", { name: i }) : b("attachments.saveFailedMany", "{{count}} attachments couldn't be saved, so nothing was sent.", { count: n.length })} ${b("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
|
|
228
|
+
}, Gt = s((e) => {
|
|
228
229
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), X());
|
|
229
|
-
}, [X]),
|
|
230
|
-
e.key === "Escape" ?
|
|
231
|
-
}, [X]),
|
|
230
|
+
}, [X]), Kt = s((e) => {
|
|
231
|
+
e.key === "Escape" ? xe(e) && e.stopPropagation() : be(e) && (e.preventDefault(), M(null), X());
|
|
232
|
+
}, [X]), qt = s((e) => {
|
|
232
233
|
let t = Array.from(e.clipboardData?.files ?? []);
|
|
233
234
|
t.length !== 0 && (e.preventDefault(), z(t));
|
|
234
|
-
}, [z]),
|
|
235
|
-
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (L.current += 1,
|
|
236
|
-
}, []),
|
|
237
|
-
L.current = Math.max(0, L.current - 1), L.current === 0 &&
|
|
238
|
-
}, []),
|
|
235
|
+
}, [z]), Jt = s((e) => {
|
|
236
|
+
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (L.current += 1, et(!0));
|
|
237
|
+
}, []), Yt = s(() => {
|
|
238
|
+
L.current = Math.max(0, L.current - 1), L.current === 0 && et(!1);
|
|
239
|
+
}, []), Xt = s((e) => {
|
|
239
240
|
Array.from(e.dataTransfer?.types ?? []).includes("Files") && e.preventDefault();
|
|
240
|
-
}, []),
|
|
241
|
-
e.preventDefault(), L.current = 0,
|
|
242
|
-
}, [z]),
|
|
241
|
+
}, []), Zt = s((e) => {
|
|
242
|
+
e.preventDefault(), L.current = 0, et(!1), z(e.dataTransfer?.files ?? null);
|
|
243
|
+
}, [z]), Qt = (e) => {
|
|
243
244
|
switch (e) {
|
|
244
|
-
case "too-many": return
|
|
245
|
-
case "too-large": return
|
|
246
|
-
case "empty": return
|
|
247
|
-
case "unreadable": return
|
|
248
|
-
case "unsupported-image": return
|
|
249
|
-
case "too-large-to-save": return
|
|
245
|
+
case "too-many": return b("attachments.tooMany", "You can attach up to {{max}} files per message.", { max: 5 });
|
|
246
|
+
case "too-large": return b("attachments.tooLarge", "That file is larger than 10 MB.");
|
|
247
|
+
case "empty": return b("attachments.empty", "That file is empty.");
|
|
248
|
+
case "unreadable": return b("attachments.unreadable", "That file could not be read.");
|
|
249
|
+
case "unsupported-image": return b("attachments.unsupportedImage", "This device can't read that image format, so it can't be resized to send. Save it as JPEG and try again.");
|
|
250
|
+
case "too-large-to-save": return b("attachments.tooLargeToSave", "That file is over 5 MB, so it can't be saved to Files, and no text could be read from it.");
|
|
250
251
|
}
|
|
251
252
|
}, $ = (() => {
|
|
252
253
|
switch (U.error) {
|
|
253
|
-
case "not-allowed": return
|
|
254
|
-
case "audio-capture": return
|
|
255
|
-
case "network": return
|
|
256
|
-
case "language-not-supported": return
|
|
257
|
-
case "unknown": return
|
|
254
|
+
case "not-allowed": return b("voice.denied", "Microphone access is blocked. Allow it in your browser settings to dictate.");
|
|
255
|
+
case "audio-capture": return b("voice.noMic", "No microphone was found.");
|
|
256
|
+
case "network": return b("voice.network", "Speech recognition is offline right now.");
|
|
257
|
+
case "language-not-supported": return b("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language: i(U.language, S) });
|
|
258
|
+
case "unknown": return b("voice.failed", "Dictation stopped unexpectedly.");
|
|
258
259
|
default: return null;
|
|
259
260
|
}
|
|
260
|
-
})(),
|
|
261
|
-
onDismiss:
|
|
262
|
-
children: /* @__PURE__ */
|
|
261
|
+
})(), $t = (e, n, r = !1) => k ? /* @__PURE__ */ f(t, {
|
|
262
|
+
onDismiss: Bt,
|
|
263
|
+
children: /* @__PURE__ */ p("p", {
|
|
263
264
|
className: "flex items-center justify-center gap-2 text-text-muted",
|
|
264
265
|
"data-testid": "assistant-commit-status",
|
|
265
266
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ f(De, {
|
|
267
268
|
className: "size-3 motion-safe:animate-spin",
|
|
268
269
|
"aria-hidden": "true"
|
|
269
270
|
}),
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ f("span", { children: b("attachments.saving", "Saving your attachments…") }),
|
|
272
|
+
/* @__PURE__ */ f("button", {
|
|
272
273
|
type: "button",
|
|
273
|
-
onClick:
|
|
274
|
+
onClick: Bt,
|
|
274
275
|
className: "rounded text-text-primary underline underline-offset-2 hover:text-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
275
276
|
"data-testid": "assistant-commit-cancel",
|
|
276
|
-
children:
|
|
277
|
+
children: b("attachments.cancelSaving", "Cancel")
|
|
277
278
|
})
|
|
278
279
|
]
|
|
279
280
|
})
|
|
280
|
-
}) :
|
|
281
|
+
}) : A ? /* @__PURE__ */ f("p", {
|
|
281
282
|
className: "text-status-error-text",
|
|
282
283
|
role: "alert",
|
|
283
284
|
"data-testid": "assistant-commit-failed",
|
|
284
|
-
children:
|
|
285
|
-
}) : !r && U.isStarting && !U.isListening ? /* @__PURE__ */
|
|
285
|
+
children: Wt(A)
|
|
286
|
+
}) : !r && U.isStarting && !U.isListening ? /* @__PURE__ */ f("p", {
|
|
286
287
|
className: "text-text-muted",
|
|
287
288
|
"data-testid": "assistant-voice-starting",
|
|
288
|
-
children:
|
|
289
|
-
}) : !r && U.isListening ? /* @__PURE__ */
|
|
289
|
+
children: b("voice.starting", "Starting the microphone…")
|
|
290
|
+
}) : !r && U.isListening ? /* @__PURE__ */ p("p", {
|
|
290
291
|
className: "text-status-error-text",
|
|
291
292
|
"data-testid": "assistant-voice-status",
|
|
292
|
-
children: [/* @__PURE__ */
|
|
293
|
-
}) : $ ? /* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ f(le, {}), U.interim || b("voice.listening", "Listening… speak now, tap the square to stop")]
|
|
294
|
+
}) : $ ? /* @__PURE__ */ f("p", {
|
|
294
295
|
className: "text-status-error-text",
|
|
295
296
|
"data-testid": "assistant-voice-error",
|
|
296
297
|
children: $
|
|
297
|
-
}) :
|
|
298
|
+
}) : pt ? /* @__PURE__ */ f("button", {
|
|
298
299
|
type: "button",
|
|
299
|
-
onClick:
|
|
300
|
+
onClick: _t,
|
|
300
301
|
className: "text-status-error-text underline-offset-2 hover:underline",
|
|
301
302
|
"data-testid": "assistant-attachment-rejection",
|
|
302
|
-
children:
|
|
303
|
-
}) :
|
|
303
|
+
children: Qt(pt)
|
|
304
|
+
}) : ft === "failed" ? /* @__PURE__ */ f("p", {
|
|
304
305
|
className: "text-status-error-text",
|
|
305
306
|
"data-testid": "assistant-attachment-blocked",
|
|
306
|
-
children:
|
|
307
|
-
}) : n ? /* @__PURE__ */
|
|
307
|
+
children: Lt.length === 1 ? b("attachments.blockedOne", "{{name}} didn't upload. Retry or remove it before sending.", { name: Lt[0].filename }) : b("attachments.blockedMany", "{{count}} attachments didn't upload. Retry or remove them before sending.", { count: Lt.length })
|
|
308
|
+
}) : n ? /* @__PURE__ */ f("p", {
|
|
308
309
|
className: "text-text-muted",
|
|
309
310
|
"data-testid": "assistant-stopping-status",
|
|
310
|
-
children:
|
|
311
|
-
}) : e ? /* @__PURE__ */
|
|
311
|
+
children: b("composer.stopping", "Stopping the reply…")
|
|
312
|
+
}) : e ? /* @__PURE__ */ f("p", {
|
|
312
313
|
className: "text-text-muted",
|
|
313
314
|
"data-testid": "assistant-stop-status",
|
|
314
|
-
children:
|
|
315
|
-
}) : /* @__PURE__ */
|
|
315
|
+
children: b("composer.stopped", "Reply stopped.")
|
|
316
|
+
}) : /* @__PURE__ */ f("p", {
|
|
316
317
|
className: "text-text-muted",
|
|
317
|
-
children:
|
|
318
|
+
children: b("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
|
|
318
319
|
});
|
|
319
|
-
if (
|
|
320
|
-
let e =
|
|
321
|
-
return /* @__PURE__ */
|
|
322
|
-
ref:
|
|
323
|
-
className: `${
|
|
320
|
+
if (w) {
|
|
321
|
+
let e = g !== void 0 && K.length === 0 && R.length === 0 && !U.isActive, n = b("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach"), r = U.isSupported && !y && W.phase !== "idle", i = U.error === "not-allowed" || U.error === "audio-capture", ee = !!(k || A || $ || pt || ft === "failed" || rt !== null || N !== null), a = W.nothingHeard && !ee, o = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-elevated)]";
|
|
322
|
+
return /* @__PURE__ */ f(Me, { children: (te) => /* @__PURE__ */ p("div", {
|
|
323
|
+
ref: lt,
|
|
324
|
+
className: `${x ? `flex-shrink-0 px-3 pt-1.5 ${Se}` : "flex-shrink-0 px-3 pt-1.5"}${Qe ? " hidden" : ""}`,
|
|
324
325
|
children: [
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
voiceLive:
|
|
328
|
-
children:
|
|
326
|
+
Ye,
|
|
327
|
+
Xe ? /* @__PURE__ */ f(ye, {
|
|
328
|
+
voiceLive: y,
|
|
329
|
+
children: Xe
|
|
329
330
|
}) : null,
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
className:
|
|
331
|
+
/* @__PURE__ */ p("div", {
|
|
332
|
+
className: ee || a || l ? "mb-1.5 px-1 text-center text-xs" : "",
|
|
332
333
|
"aria-live": "polite",
|
|
333
334
|
"data-testid": "assistant-composer-status",
|
|
334
335
|
children: [
|
|
335
|
-
|
|
336
|
+
l ? /* @__PURE__ */ f("p", {
|
|
336
337
|
className: "text-status-warning",
|
|
337
338
|
"data-testid": "assistant-write-access-warning",
|
|
338
|
-
children:
|
|
339
|
+
children: b("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
|
|
339
340
|
}) : null,
|
|
340
|
-
i && $ && !
|
|
341
|
+
i && $ && !k && !A ? /* @__PURE__ */ f(he, {
|
|
341
342
|
message: $,
|
|
342
343
|
onTryAgain: () => {
|
|
343
344
|
U.clearError(), W.start();
|
|
344
345
|
}
|
|
345
|
-
}) :
|
|
346
|
+
}) : a ? /* @__PURE__ */ f("p", {
|
|
346
347
|
className: "text-text-secondary",
|
|
347
348
|
"data-testid": "assistant-dictation-nothing-heard",
|
|
348
|
-
children:
|
|
349
|
-
}) :
|
|
350
|
-
r && U.isListening ? /* @__PURE__ */
|
|
349
|
+
children: b("dictation.nothingHeard", "Nothing was heard. Check the microphone and try again.")
|
|
350
|
+
}) : ee ? $t(rt !== null, N !== null, !0) : null,
|
|
351
|
+
r && U.isListening ? /* @__PURE__ */ f("span", {
|
|
351
352
|
className: "sr-only",
|
|
352
353
|
"data-testid": "assistant-dictation-announced",
|
|
353
|
-
children:
|
|
354
|
+
children: b("voiceSession.listening", "Listening…")
|
|
354
355
|
}) : null
|
|
355
356
|
]
|
|
356
357
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
id:
|
|
358
|
+
/* @__PURE__ */ f("p", {
|
|
359
|
+
id: te,
|
|
359
360
|
hidden: !0,
|
|
360
361
|
"data-testid": "assistant-composer-hint",
|
|
361
362
|
children: n
|
|
362
363
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
onDragEnter:
|
|
365
|
-
onDragLeave:
|
|
366
|
-
onDragOver:
|
|
367
|
-
onDrop:
|
|
368
|
-
className: `flex flex-col rounded-3xl border transition-colors ${r && W.phase === "listening" ? "border-status-warning-bg ring-1 ring-status-warning-bg" : "focus-within:border-[var(--color-focus-ring)] focus-within:ring-1 focus-within:ring-[var(--color-focus-ring)]"} ${
|
|
364
|
+
/* @__PURE__ */ p("div", {
|
|
365
|
+
onDragEnter: Jt,
|
|
366
|
+
onDragLeave: Yt,
|
|
367
|
+
onDragOver: Xt,
|
|
368
|
+
onDrop: Zt,
|
|
369
|
+
className: `flex flex-col rounded-3xl border transition-colors ${r && W.phase === "listening" ? "border-status-warning-bg ring-1 ring-status-warning-bg" : "focus-within:border-[var(--color-focus-ring)] focus-within:ring-1 focus-within:ring-[var(--color-focus-ring)]"} ${Ze ? "bg-bg-surface" : "bg-bg-elevated"} ${r && W.phase !== "transcribing" ? "" : O ? "border-dashed border-[var(--color-focus-ring)]" : "border-[var(--color-text-muted)]"} ${de(x, {
|
|
370
|
+
hearing: r && W.phase === "listening",
|
|
371
|
+
quiet: Pe || Ze || O,
|
|
372
|
+
entrance: Ue
|
|
373
|
+
})}`,
|
|
369
374
|
"data-dictating": r ? W.phase : void 0,
|
|
370
375
|
"data-testid": "assistant-composer",
|
|
371
376
|
"data-presentation": "compact",
|
|
372
377
|
children: [
|
|
373
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ f("div", {
|
|
374
379
|
className: "px-3 pt-3 empty:hidden",
|
|
375
|
-
children: /* @__PURE__ */
|
|
376
|
-
disabled:
|
|
380
|
+
children: /* @__PURE__ */ p(ke, { children: [/* @__PURE__ */ f(oe, {
|
|
381
|
+
disabled: k,
|
|
377
382
|
showSuggestions: K.length === 0,
|
|
378
|
-
onSuggest:
|
|
379
|
-
}), /* @__PURE__ */
|
|
383
|
+
onSuggest: It
|
|
384
|
+
}), /* @__PURE__ */ f(ae, {
|
|
380
385
|
attachments: R,
|
|
381
|
-
onRemove:
|
|
382
|
-
onRetry:
|
|
383
|
-
disabled:
|
|
384
|
-
preparingCount:
|
|
386
|
+
onRemove: mt,
|
|
387
|
+
onRetry: ht,
|
|
388
|
+
disabled: C || k,
|
|
389
|
+
preparingCount: dt
|
|
385
390
|
})] })
|
|
386
391
|
}),
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
ref:
|
|
389
|
-
value:
|
|
390
|
-
onChange: (e) =>
|
|
391
|
-
onKeyDown:
|
|
392
|
-
onPaste:
|
|
393
|
-
disabled:
|
|
394
|
-
readOnly:
|
|
395
|
-
"aria-busy":
|
|
396
|
-
placeholder:
|
|
392
|
+
/* @__PURE__ */ f("textarea", {
|
|
393
|
+
ref: $e,
|
|
394
|
+
value: E,
|
|
395
|
+
onChange: (e) => Ut(e.target.value),
|
|
396
|
+
onKeyDown: Kt,
|
|
397
|
+
onPaste: qt,
|
|
398
|
+
disabled: C,
|
|
399
|
+
readOnly: k,
|
|
400
|
+
"aria-busy": k || void 0,
|
|
401
|
+
placeholder: O ? b("composer.dropHere", "Drop files to attach") : Pt,
|
|
397
402
|
rows: 1,
|
|
398
403
|
className: `scrollbar-slim scrollbar-box min-h-10 w-[calc(100%-0.375rem)] resize-none bg-transparent pb-1 pe-2.5 ps-4 pt-3 text-base leading-6 text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50${r ? " hidden" : ""}`,
|
|
399
|
-
"aria-describedby":
|
|
404
|
+
"aria-describedby": te,
|
|
400
405
|
title: n,
|
|
401
|
-
"aria-label":
|
|
406
|
+
"aria-label": b("chatInput.ariaLabel", "Message input"),
|
|
402
407
|
"data-testid": "assistant-input"
|
|
403
408
|
}),
|
|
404
|
-
r ? /* @__PURE__ */
|
|
409
|
+
r ? /* @__PURE__ */ f(me, {
|
|
405
410
|
phase: W.phase,
|
|
406
411
|
before: W.before,
|
|
407
412
|
take: W.take,
|
|
408
413
|
interim: W.interim,
|
|
409
414
|
after: W.after
|
|
410
415
|
}) : null,
|
|
411
|
-
r ? W.phase === "transcribing" ? /* @__PURE__ */
|
|
416
|
+
r ? W.phase === "transcribing" ? /* @__PURE__ */ f(pe, {
|
|
412
417
|
phase: W.phase,
|
|
413
418
|
seconds: W.seconds,
|
|
414
419
|
level: W.level,
|
|
415
420
|
onCancel: W.cancel,
|
|
416
421
|
onFinish: W.finish,
|
|
417
|
-
focusRing:
|
|
418
|
-
}) : /* @__PURE__ */
|
|
422
|
+
focusRing: o
|
|
423
|
+
}) : /* @__PURE__ */ f(t, {
|
|
419
424
|
onDismiss: W.cancel,
|
|
420
|
-
children: /* @__PURE__ */
|
|
425
|
+
children: /* @__PURE__ */ f("div", {
|
|
421
426
|
className: "contents",
|
|
422
|
-
children: /* @__PURE__ */
|
|
427
|
+
children: /* @__PURE__ */ f(pe, {
|
|
423
428
|
phase: W.phase,
|
|
424
429
|
seconds: W.seconds,
|
|
425
430
|
level: W.level,
|
|
426
431
|
onCancel: W.cancel,
|
|
427
432
|
onFinish: W.finish,
|
|
428
|
-
focusRing:
|
|
433
|
+
focusRing: o
|
|
429
434
|
})
|
|
430
435
|
})
|
|
431
|
-
}) : /* @__PURE__ */
|
|
436
|
+
}) : /* @__PURE__ */ p("div", {
|
|
432
437
|
className: "flex flex-nowrap items-center gap-1 px-1.5 pb-1.5 pt-1",
|
|
433
438
|
"data-testid": "assistant-composer-controls",
|
|
434
439
|
children: [
|
|
435
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ f(ie, {
|
|
436
441
|
onFiles: z,
|
|
437
|
-
canAddMore:
|
|
438
|
-
disabled:
|
|
442
|
+
canAddMore: vt,
|
|
443
|
+
disabled: C || k,
|
|
439
444
|
compact: !0,
|
|
440
445
|
capMenuHeight: !0
|
|
441
446
|
}),
|
|
442
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ f(ve, {
|
|
443
448
|
chip: !0,
|
|
444
|
-
readOnly:
|
|
445
|
-
mode:
|
|
446
|
-
availableModes:
|
|
447
|
-
onModeChange:
|
|
448
|
-
auto:
|
|
449
|
-
disabled:
|
|
450
|
-
disabledReason:
|
|
449
|
+
readOnly: Ze,
|
|
450
|
+
mode: Ie,
|
|
451
|
+
availableModes: h,
|
|
452
|
+
onModeChange: Re,
|
|
453
|
+
auto: ze,
|
|
454
|
+
disabled: C || k,
|
|
455
|
+
disabledReason: N === null ? _ ? "replying" : Je ?? "busy" : "busy"
|
|
451
456
|
}),
|
|
452
|
-
|
|
457
|
+
x && i ? /* @__PURE__ */ f("span", {
|
|
453
458
|
className: "ms-1 hidden min-w-0 truncate text-xs text-text-secondary sm:block",
|
|
454
459
|
"data-testid": "assistant-mic-summary",
|
|
455
|
-
children:
|
|
460
|
+
children: b("dictation.noMicrophone", "No microphone available")
|
|
456
461
|
}) : null,
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
U.isSupported && !
|
|
462
|
+
/* @__PURE__ */ f("div", { className: "min-w-0 flex-1" }),
|
|
463
|
+
U.isSupported && !y ? x ? /* @__PURE__ */ f(ge, {
|
|
459
464
|
onDictate: W.start,
|
|
460
465
|
blocked: i,
|
|
461
|
-
disabled:
|
|
462
|
-
}) : /* @__PURE__ */
|
|
466
|
+
disabled: C || k
|
|
467
|
+
}) : /* @__PURE__ */ f(ce, {
|
|
463
468
|
compact: !0,
|
|
464
469
|
isListening: U.isListening,
|
|
465
470
|
isStarting: U.isStarting,
|
|
466
471
|
onToggle: W.start,
|
|
467
|
-
disabled:
|
|
472
|
+
disabled: C || k
|
|
468
473
|
}) : null,
|
|
469
|
-
Q ? /* @__PURE__ */
|
|
470
|
-
ref:
|
|
474
|
+
Q ? /* @__PURE__ */ f("button", {
|
|
475
|
+
ref: Ht,
|
|
471
476
|
type: "button",
|
|
472
|
-
onClick:
|
|
473
|
-
className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover ${
|
|
474
|
-
"aria-label":
|
|
475
|
-
title:
|
|
476
|
-
"aria-disabled":
|
|
477
|
-
"aria-busy":
|
|
477
|
+
onClick: Vt,
|
|
478
|
+
className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover ${o} ${N === null ? "" : "cursor-default opacity-60"}`,
|
|
479
|
+
"aria-label": N === null ? b("composer.stop", "Stop the reply") : b("composer.stopping", "Stopping the reply…"),
|
|
480
|
+
title: N === null ? b("composer.stop", "Stop the reply") : b("composer.stopping", "Stopping the reply…"),
|
|
481
|
+
"aria-disabled": N === null ? void 0 : "true",
|
|
482
|
+
"aria-busy": N === null ? void 0 : "true",
|
|
478
483
|
"data-testid": "assistant-stop",
|
|
479
|
-
children:
|
|
484
|
+
children: N === null ? /* @__PURE__ */ f(Oe, {
|
|
480
485
|
className: "size-4 fill-current",
|
|
481
486
|
"aria-hidden": "true"
|
|
482
|
-
}) : /* @__PURE__ */
|
|
487
|
+
}) : /* @__PURE__ */ f(De, {
|
|
483
488
|
className: "size-4 motion-safe:animate-spin",
|
|
484
489
|
"aria-hidden": "true"
|
|
485
490
|
})
|
|
486
|
-
}) : e && !(
|
|
491
|
+
}) : e && !(x && i) ? /* @__PURE__ */ f(ue, {
|
|
487
492
|
compact: !0,
|
|
488
|
-
invisible:
|
|
489
|
-
onStart:
|
|
490
|
-
disabled:
|
|
491
|
-
}) : /* @__PURE__ */
|
|
493
|
+
invisible: y,
|
|
494
|
+
onStart: g,
|
|
495
|
+
disabled: C || k
|
|
496
|
+
}) : /* @__PURE__ */ f("button", {
|
|
492
497
|
type: "button",
|
|
493
498
|
onClick: () => {
|
|
494
|
-
|
|
499
|
+
M(null), X();
|
|
495
500
|
},
|
|
496
501
|
disabled: !J,
|
|
497
|
-
className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${
|
|
498
|
-
"aria-label":
|
|
502
|
+
className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${o} ${J ? "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover" : "bg-[var(--color-bg-disabled)] text-[var(--color-text-disabled)]"}`,
|
|
503
|
+
"aria-label": b("chatInput.send", "Send message"),
|
|
499
504
|
"data-testid": "assistant-send",
|
|
500
|
-
children:
|
|
505
|
+
children: Ne || ut || k ? /* @__PURE__ */ f(De, {
|
|
501
506
|
className: "size-5 motion-safe:animate-spin",
|
|
502
507
|
"aria-hidden": "true"
|
|
503
|
-
}) : /* @__PURE__ */
|
|
508
|
+
}) : /* @__PURE__ */ f(Ee, {
|
|
504
509
|
className: "size-5",
|
|
505
510
|
"aria-hidden": "true"
|
|
506
511
|
})
|
|
@@ -512,95 +517,95 @@ var ke = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
512
517
|
]
|
|
513
518
|
}) });
|
|
514
519
|
}
|
|
515
|
-
return /* @__PURE__ */
|
|
520
|
+
return /* @__PURE__ */ p("div", {
|
|
516
521
|
className: "flex-shrink-0 px-3 pb-3 pt-1.5",
|
|
517
522
|
children: [
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
onDragEnter:
|
|
520
|
-
onDragLeave:
|
|
521
|
-
onDragOver:
|
|
522
|
-
onDrop:
|
|
523
|
-
className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${
|
|
523
|
+
/* @__PURE__ */ p("div", {
|
|
524
|
+
onDragEnter: Jt,
|
|
525
|
+
onDragLeave: Yt,
|
|
526
|
+
onDragOver: Xt,
|
|
527
|
+
onDrop: Zt,
|
|
528
|
+
className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${O ? "border-action-primary-bg border-dashed bg-action-primary-bg/5" : "border-border-default bg-bg-sunken"}`,
|
|
524
529
|
"data-testid": "assistant-composer",
|
|
525
530
|
children: [
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
disabled:
|
|
531
|
+
/* @__PURE__ */ p(ke, { children: [/* @__PURE__ */ f(oe, {
|
|
532
|
+
disabled: k,
|
|
528
533
|
showSuggestions: K.length === 0,
|
|
529
|
-
onSuggest:
|
|
530
|
-
}), /* @__PURE__ */
|
|
534
|
+
onSuggest: It
|
|
535
|
+
}), /* @__PURE__ */ f(ae, {
|
|
531
536
|
attachments: R,
|
|
532
|
-
onRemove:
|
|
533
|
-
onRetry:
|
|
534
|
-
disabled:
|
|
535
|
-
preparingCount:
|
|
537
|
+
onRemove: mt,
|
|
538
|
+
onRetry: ht,
|
|
539
|
+
disabled: C || k,
|
|
540
|
+
preparingCount: dt
|
|
536
541
|
})] }),
|
|
537
|
-
/* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ p("div", {
|
|
538
543
|
className: "flex items-end gap-2",
|
|
539
544
|
children: [
|
|
540
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ f(ie, {
|
|
541
546
|
onFiles: z,
|
|
542
|
-
canAddMore:
|
|
543
|
-
disabled:
|
|
547
|
+
canAddMore: vt,
|
|
548
|
+
disabled: C || k,
|
|
544
549
|
showLabel: !0
|
|
545
550
|
}),
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
-
ref:
|
|
548
|
-
value:
|
|
549
|
-
onChange: (e) =>
|
|
550
|
-
onKeyDown:
|
|
551
|
-
onPaste:
|
|
552
|
-
disabled:
|
|
553
|
-
readOnly:
|
|
554
|
-
"aria-busy":
|
|
555
|
-
placeholder:
|
|
551
|
+
/* @__PURE__ */ f("textarea", {
|
|
552
|
+
ref: T,
|
|
553
|
+
value: E,
|
|
554
|
+
onChange: (e) => D(e.target.value),
|
|
555
|
+
onKeyDown: Gt,
|
|
556
|
+
onPaste: qt,
|
|
557
|
+
disabled: C,
|
|
558
|
+
readOnly: k,
|
|
559
|
+
"aria-busy": k || void 0,
|
|
560
|
+
placeholder: O ? b("composer.dropHere", "Drop files to attach") : Pt,
|
|
556
561
|
rows: 1,
|
|
557
562
|
className: "min-h-[36px] flex-1 resize-none self-center bg-transparent px-1 py-2 text-[15px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50",
|
|
558
|
-
"aria-label":
|
|
563
|
+
"aria-label": b("chatInput.ariaLabel", "Message input"),
|
|
559
564
|
"data-testid": "assistant-input"
|
|
560
565
|
}),
|
|
561
|
-
U.isSupported && /* @__PURE__ */
|
|
566
|
+
U.isSupported && /* @__PURE__ */ f(ce, {
|
|
562
567
|
isListening: U.isListening,
|
|
563
568
|
isStarting: U.isStarting,
|
|
564
569
|
onToggle: U.toggle,
|
|
565
|
-
disabled:
|
|
570
|
+
disabled: C || k
|
|
566
571
|
}),
|
|
567
|
-
|
|
568
|
-
onStart:
|
|
569
|
-
disabled:
|
|
570
|
-
}) : /* @__PURE__ */
|
|
572
|
+
g && K.length === 0 && R.length === 0 && !U.isActive ? /* @__PURE__ */ f(ue, {
|
|
573
|
+
onStart: g,
|
|
574
|
+
disabled: C || k
|
|
575
|
+
}) : /* @__PURE__ */ f("button", {
|
|
571
576
|
type: "button",
|
|
572
577
|
onClick: () => void X(),
|
|
573
578
|
disabled: !J,
|
|
574
579
|
className: `flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${J ? "bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover" : "bg-bg-elevated text-text-muted"}`,
|
|
575
|
-
"aria-label":
|
|
580
|
+
"aria-label": b("chatInput.send", "Send message"),
|
|
576
581
|
"data-testid": "assistant-send",
|
|
577
|
-
children:
|
|
582
|
+
children: Ne || ut || k ? /* @__PURE__ */ f(De, { className: "size-4 motion-safe:animate-spin" }) : /* @__PURE__ */ f(Ee, { className: "size-4" })
|
|
578
583
|
})
|
|
579
584
|
]
|
|
580
585
|
}),
|
|
581
|
-
(
|
|
586
|
+
(h.length > 1 || h.some((e) => e.writeCapable)) && /* @__PURE__ */ f("div", {
|
|
582
587
|
className: "mt-2 px-0.5",
|
|
583
|
-
children: /* @__PURE__ */
|
|
584
|
-
mode:
|
|
585
|
-
availableModes:
|
|
586
|
-
onModeChange:
|
|
587
|
-
disabled:
|
|
588
|
-
auto:
|
|
588
|
+
children: /* @__PURE__ */ f(_e, {
|
|
589
|
+
mode: Ie,
|
|
590
|
+
availableModes: h,
|
|
591
|
+
onModeChange: Re,
|
|
592
|
+
disabled: C || k,
|
|
593
|
+
auto: ze
|
|
589
594
|
})
|
|
590
595
|
})
|
|
591
596
|
]
|
|
592
597
|
}),
|
|
593
|
-
|
|
598
|
+
l ? /* @__PURE__ */ f("p", {
|
|
594
599
|
className: "mt-1.5 px-1 text-center text-[11px] text-status-warning",
|
|
595
600
|
"data-testid": "assistant-write-access-warning",
|
|
596
|
-
children:
|
|
601
|
+
children: b("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
|
|
597
602
|
}) : null,
|
|
598
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ f("div", {
|
|
599
604
|
className: "mt-1.5 px-1 text-center text-[11px]",
|
|
600
605
|
"aria-live": "polite",
|
|
601
|
-
children:
|
|
606
|
+
children: $t(!1, !1)
|
|
602
607
|
})
|
|
603
608
|
]
|
|
604
609
|
});
|
|
605
610
|
};
|
|
606
|
-
export {
|
|
611
|
+
export { m as AssistantComposer };
|