@burdenoff/fe-libs 2026.1114.14 → 2026.1114.15
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.
|
@@ -38,106 +38,106 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
38
38
|
D.current = e, typeof b == "function" ? b(e) : b && (b.current = e);
|
|
39
39
|
}, [b]), [O, k] = f(""), [A, Ze] = f(!1), [j, Qe] = f(!1), $e = d(!1), [M, N] = f(null), [et, P] = f(null), [F, I] = f(null), [tt, nt] = f(y);
|
|
40
40
|
tt === y ? F !== null && y && We != null && We !== F && I(null) : (nt(y), y ? (P(null), I(null)) : F !== null && (P(F), I(null)));
|
|
41
|
-
let rt = d(!1),
|
|
41
|
+
let rt = d(!1), it = d(null), at = d(!1), ot = d(!1), st = d(null), ct = d(!1), L = d(0), { attachments: R, isBusy: lt, preparingCount: ut, sendBlocker: dt, rejection: ft, addFiles: z, remove: pt, retry: mt, clear: ht, clearRejection: gt, canAddMore: _t, commit: vt, cancelCommit: yt } = ee({ perFileChars: Fe }), B = O.trim() !== "" || R.length > 0, bt = d(!1), V = d(!1);
|
|
42
42
|
l(() => {
|
|
43
|
-
|
|
44
|
-
}, [
|
|
45
|
-
|
|
43
|
+
B && !bt.current ? (bt.current = !0, Re?.()) : B || (bt.current = !1);
|
|
44
|
+
}, [B, Re]), l(() => {
|
|
45
|
+
B || (V.current = !1), ze?.({
|
|
46
46
|
text: O,
|
|
47
|
-
hasAttachments:
|
|
48
|
-
dictated:
|
|
47
|
+
hasAttachments: R.length > 0,
|
|
48
|
+
dictated: V.current
|
|
49
49
|
});
|
|
50
50
|
}, [
|
|
51
51
|
O,
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
R.length,
|
|
53
|
+
B,
|
|
54
54
|
ze
|
|
55
55
|
]);
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
}, []),
|
|
59
|
-
onFinalize: (e) =>
|
|
60
|
-
onEnded: () =>
|
|
61
|
-
language:
|
|
62
|
-
deviceId:
|
|
63
|
-
}),
|
|
64
|
-
|
|
65
|
-
}, []),
|
|
56
|
+
let H = c((e) => {
|
|
57
|
+
V.current = !0, k((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
|
|
58
|
+
}, []), xt = o((e) => e.assistantLanguage), St = we(() => a(xt, w), [xt, w]), Ct = d(H), wt = d(() => void 0), Tt = o((e) => e.micDeviceId), U = s({
|
|
59
|
+
onFinalize: (e) => Ct.current(e),
|
|
60
|
+
onEnded: () => wt.current(),
|
|
61
|
+
language: St.tag,
|
|
62
|
+
deviceId: Tt
|
|
63
|
+
}), Et = c(() => {
|
|
64
|
+
V.current = !0;
|
|
65
|
+
}, []), W = ue({
|
|
66
66
|
enabled: E,
|
|
67
|
-
voice:
|
|
67
|
+
voice: U,
|
|
68
68
|
text: O,
|
|
69
69
|
setText: k,
|
|
70
70
|
textareaRef: D,
|
|
71
|
-
markDictated:
|
|
72
|
-
deviceId:
|
|
73
|
-
}),
|
|
71
|
+
markDictated: Et,
|
|
72
|
+
deviceId: Tt
|
|
73
|
+
}), Dt = W.addFinal, Ot = he();
|
|
74
74
|
l(() => {
|
|
75
|
-
|
|
75
|
+
Ct.current = E ? Dt : H;
|
|
76
76
|
}, [
|
|
77
77
|
E,
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
Dt,
|
|
79
|
+
H
|
|
80
80
|
]);
|
|
81
|
-
let
|
|
81
|
+
let kt = W.recogniserEnded;
|
|
82
82
|
l(() => {
|
|
83
|
-
|
|
84
|
-
}, [E,
|
|
85
|
-
let
|
|
83
|
+
wt.current = E ? kt : () => void 0;
|
|
84
|
+
}, [E, kt]);
|
|
85
|
+
let G = U.isActive, At = U.interim, jt = U.stop, Mt = W.keepAndStop;
|
|
86
86
|
l(() => {
|
|
87
|
-
Be &&
|
|
87
|
+
Be && G && (E ? Mt() : (At.trim() !== "" && H(At.trim()), jt()));
|
|
88
88
|
}, [
|
|
89
89
|
Be,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
G,
|
|
91
|
+
At,
|
|
92
|
+
jt,
|
|
93
|
+
H,
|
|
94
94
|
E,
|
|
95
|
-
|
|
95
|
+
Mt
|
|
96
96
|
]), l(() => {
|
|
97
97
|
Ve?.({
|
|
98
98
|
committing: j,
|
|
99
|
-
dictating:
|
|
99
|
+
dictating: G
|
|
100
100
|
});
|
|
101
101
|
}, [
|
|
102
102
|
Ve,
|
|
103
103
|
j,
|
|
104
|
-
|
|
104
|
+
G
|
|
105
105
|
]);
|
|
106
|
-
let
|
|
106
|
+
let Nt = oe((e) => e.pending), Pt = Nt ? S("askAbout.placeholder", "Ask about {{name}}…", { name: Nt.label }) : Ne ?? S("composer.placeholder", "Ask me anything…"), Ft = oe((e) => e.focusRequested), It = (e) => {
|
|
107
107
|
k(e), requestAnimationFrame(() => {
|
|
108
108
|
let t = D.current;
|
|
109
109
|
t && (t.focus({ preventScroll: !0 }), t.setSelectionRange(e.length, e.length));
|
|
110
110
|
});
|
|
111
111
|
};
|
|
112
112
|
l(() => {
|
|
113
|
-
if (!
|
|
113
|
+
if (!Ft || T) return;
|
|
114
114
|
let e = D.current;
|
|
115
115
|
e && (e.focus({ preventScroll: !0 }), oe.getState().actions.composerFocused());
|
|
116
|
-
}, [
|
|
117
|
-
let
|
|
118
|
-
|
|
119
|
-
let
|
|
120
|
-
l(() => (
|
|
121
|
-
|
|
116
|
+
}, [Ft, T]);
|
|
117
|
+
let K = O.trim(), q = te(R), Lt = R.filter((e) => e.status === "error"), J = (K.length > 0 || q.length > 0) && !T && !j && dt === null, Rt = q.some((e) => !(e.fileId && e.downloadUrl) && !e.inlineOnly), zt = d(T);
|
|
118
|
+
zt.current = T;
|
|
119
|
+
let Y = d(!0);
|
|
120
|
+
l(() => (Y.current = !0, () => {
|
|
121
|
+
Y.current = !1;
|
|
122
122
|
}), []), Ce(() => {
|
|
123
123
|
let e = D.current;
|
|
124
124
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, Oe)}px`);
|
|
125
125
|
}, [O]);
|
|
126
|
-
let
|
|
127
|
-
if (!
|
|
128
|
-
|
|
126
|
+
let X = c(async () => {
|
|
127
|
+
if (!J || $e.current) return;
|
|
128
|
+
U.isActive && U.stop();
|
|
129
129
|
let e = O.trim();
|
|
130
130
|
N(null);
|
|
131
|
-
let t = E && ke(
|
|
132
|
-
if (!
|
|
133
|
-
|
|
131
|
+
let t = E && ke(st.current);
|
|
132
|
+
if (!Rt) {
|
|
133
|
+
ct.current = t, g(e, q), k(""), ht();
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
let n = o.getState().activeConversationId;
|
|
137
137
|
$e.current = !0, Qe(!0);
|
|
138
138
|
try {
|
|
139
|
-
let r = await
|
|
140
|
-
if (!
|
|
139
|
+
let r = await vt();
|
|
140
|
+
if (!Y.current) {
|
|
141
141
|
r.ok && await r.rollback();
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
@@ -148,8 +148,8 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
148
148
|
});
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
|
-
if (
|
|
152
|
-
await r.rollback(),
|
|
151
|
+
if (zt.current) {
|
|
152
|
+
await r.rollback(), Y.current && N({
|
|
153
153
|
kind: "busy",
|
|
154
154
|
failures: []
|
|
155
155
|
});
|
|
@@ -157,55 +157,55 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
157
157
|
}
|
|
158
158
|
let i = o.getState();
|
|
159
159
|
if (i.activeConversationId !== n || n !== null && !i.conversations.some((e) => e.id === n)) {
|
|
160
|
-
await r.rollback(),
|
|
160
|
+
await r.rollback(), Y.current && N({
|
|
161
161
|
kind: "moved",
|
|
162
162
|
failures: []
|
|
163
163
|
});
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
ct.current = t, g(e, te(r.attachments)), r.handedOver(), k(""), ht();
|
|
167
167
|
} finally {
|
|
168
|
-
$e.current = !1,
|
|
168
|
+
$e.current = !1, Y.current && Qe(!1);
|
|
169
169
|
}
|
|
170
170
|
}, [
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
J,
|
|
172
|
+
Rt,
|
|
173
|
+
vt,
|
|
174
174
|
g,
|
|
175
175
|
O,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
q,
|
|
177
|
+
ht,
|
|
178
|
+
U,
|
|
179
179
|
E
|
|
180
|
-
]),
|
|
181
|
-
|
|
182
|
-
}, [
|
|
183
|
-
|
|
180
|
+
]), Bt = c(() => {
|
|
181
|
+
yt(), D.current?.focus();
|
|
182
|
+
}, [yt]), Z = c(() => {
|
|
183
|
+
zt.current ? rt.current = !0 : D.current?.focus();
|
|
184
184
|
}, []), Vt = c(() => {
|
|
185
|
-
if (
|
|
185
|
+
if (ot.current) return;
|
|
186
186
|
let e = Ue?.() ?? null;
|
|
187
|
-
e !== null && (
|
|
188
|
-
}, [Ue,
|
|
187
|
+
e !== null && (ot.current = !0, I(e)), Z();
|
|
188
|
+
}, [Ue, Z]);
|
|
189
189
|
l(() => {
|
|
190
190
|
!T && rt.current && (rt.current = !1, D.current?.focus());
|
|
191
191
|
}, [T]);
|
|
192
192
|
let Ht = c((e) => {
|
|
193
193
|
if (e !== null) {
|
|
194
|
-
|
|
194
|
+
it.current = e;
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
|
-
let t =
|
|
198
|
-
|
|
197
|
+
let t = it.current;
|
|
198
|
+
it.current = null, t !== null && t.ownerDocument.activeElement === t && (at.current = !0);
|
|
199
199
|
}, []), Q = E && y && Ue !== void 0;
|
|
200
200
|
Ce(() => {
|
|
201
|
-
!Q &&
|
|
202
|
-
}, [Q,
|
|
203
|
-
F === null && (
|
|
201
|
+
!Q && at.current && (at.current = !1, Z());
|
|
202
|
+
}, [Q, Z]), l(() => {
|
|
203
|
+
F === null && (ot.current = !1);
|
|
204
204
|
}, [F]), Ce(() => {
|
|
205
205
|
if (!Q) return;
|
|
206
|
-
let e =
|
|
207
|
-
if (
|
|
208
|
-
let t =
|
|
206
|
+
let e = ct.current;
|
|
207
|
+
if (ct.current = !1, !e) return;
|
|
208
|
+
let t = it.current;
|
|
209
209
|
if (t === null) return;
|
|
210
210
|
let n = t.ownerDocument, r = n.activeElement;
|
|
211
211
|
(r === null || r === n.body || r === D.current) && t.focus({ preventScroll: !0 });
|
|
@@ -215,31 +215,31 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
215
215
|
}, []);
|
|
216
216
|
l(() => {
|
|
217
217
|
N(null);
|
|
218
|
-
}, [
|
|
218
|
+
}, [R.length]);
|
|
219
219
|
let Wt = (t) => {
|
|
220
220
|
if (t.kind === "busy") return S("attachments.saveBusy", "The assistant started another reply, so nothing was sent. Your message and files are still here.");
|
|
221
221
|
if (t.kind === "moved") return S("attachments.saveMoved", "You switched conversations while the files were being saved, so nothing was sent. Your message and files are still here.");
|
|
222
222
|
let { failures: n } = t;
|
|
223
223
|
if (n.some((e) => e.code === ne.editorAccessRequired)) return e(S, w);
|
|
224
224
|
if (n.some((e) => e.code === ne.quotaExceeded || e.code === ne.quotaNotProvisioned)) return `${S("attachments.quotaFull", "File storage is full or not set up for this workspace, so the attachments couldn't be saved. Nothing was sent.")} ${S("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
|
|
225
|
-
let r = n[0], i =
|
|
225
|
+
let r = n[0], i = R.find((e) => e.id === r?.id)?.filename ?? "";
|
|
226
226
|
return `${n.length <= 1 ? S("attachments.saveFailedOne", "{{name}} couldn't be saved, so nothing was sent.", { name: i }) : S("attachments.saveFailedMany", "{{count}} attachments couldn't be saved, so nothing was sent.", { count: n.length })} ${S("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
|
|
227
227
|
}, Gt = c((e) => {
|
|
228
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(),
|
|
229
|
-
}, [
|
|
230
|
-
e.key === "Escape" ? be(e) && e.stopPropagation() : ye(e) && (e.preventDefault(), P(null),
|
|
231
|
-
}, [
|
|
228
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), X());
|
|
229
|
+
}, [X]), Kt = c((e) => {
|
|
230
|
+
e.key === "Escape" ? be(e) && e.stopPropagation() : ye(e) && (e.preventDefault(), P(null), X());
|
|
231
|
+
}, [X]), qt = c((e) => {
|
|
232
232
|
let t = Array.from(e.clipboardData?.files ?? []);
|
|
233
|
-
t.length !== 0 && (e.preventDefault(),
|
|
234
|
-
}, [
|
|
235
|
-
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (
|
|
233
|
+
t.length !== 0 && (e.preventDefault(), z(t));
|
|
234
|
+
}, [z]), Jt = c((e) => {
|
|
235
|
+
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (L.current += 1, Ze(!0));
|
|
236
236
|
}, []), Yt = c(() => {
|
|
237
|
-
|
|
237
|
+
L.current = Math.max(0, L.current - 1), L.current === 0 && Ze(!1);
|
|
238
238
|
}, []), Xt = c((e) => {
|
|
239
239
|
Array.from(e.dataTransfer?.types ?? []).includes("Files") && e.preventDefault();
|
|
240
240
|
}, []), Zt = c((e) => {
|
|
241
|
-
e.preventDefault(),
|
|
242
|
-
}, [
|
|
241
|
+
e.preventDefault(), L.current = 0, Ze(!1), z(e.dataTransfer?.files ?? null);
|
|
242
|
+
}, [z]), Qt = (e) => {
|
|
243
243
|
switch (e) {
|
|
244
244
|
case "too-many": return S("attachments.tooMany", "You can attach up to {{max}} files per message.", { max: 5 });
|
|
245
245
|
case "too-large": return S("attachments.tooLarge", "That file is larger than 10 MB.");
|
|
@@ -249,16 +249,16 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
249
249
|
case "too-large-to-save": return S("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
250
|
}
|
|
251
251
|
}, $ = (() => {
|
|
252
|
-
switch (
|
|
252
|
+
switch (U.error) {
|
|
253
253
|
case "not-allowed": return S("voice.denied", "Microphone access is blocked. Allow it in your browser settings to dictate.");
|
|
254
254
|
case "audio-capture": return S("voice.noMic", "No microphone was found.");
|
|
255
255
|
case "network": return S("voice.network", "Speech recognition is offline right now.");
|
|
256
|
-
case "language-not-supported": return S("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language: i(
|
|
256
|
+
case "language-not-supported": return S("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language: i(U.language, w) });
|
|
257
257
|
case "unknown": return S("voice.failed", "Dictation stopped unexpectedly.");
|
|
258
258
|
default: return null;
|
|
259
259
|
}
|
|
260
260
|
})(), $t = (e, n, r = !1) => j ? /* @__PURE__ */ m(t, {
|
|
261
|
-
onDismiss:
|
|
261
|
+
onDismiss: Bt,
|
|
262
262
|
children: /* @__PURE__ */ h("p", {
|
|
263
263
|
className: "flex items-center justify-center gap-2 text-text-muted",
|
|
264
264
|
"data-testid": "assistant-commit-status",
|
|
@@ -270,7 +270,7 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
270
270
|
/* @__PURE__ */ m("span", { children: S("attachments.saving", "Saving your attachments…") }),
|
|
271
271
|
/* @__PURE__ */ m("button", {
|
|
272
272
|
type: "button",
|
|
273
|
-
onClick:
|
|
273
|
+
onClick: Bt,
|
|
274
274
|
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
275
|
"data-testid": "assistant-commit-cancel",
|
|
276
276
|
children: S("attachments.cancelSaving", "Cancel")
|
|
@@ -282,28 +282,28 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
282
282
|
role: "alert",
|
|
283
283
|
"data-testid": "assistant-commit-failed",
|
|
284
284
|
children: Wt(M)
|
|
285
|
-
}) : !r &&
|
|
285
|
+
}) : !r && U.isStarting && !U.isListening ? /* @__PURE__ */ m("p", {
|
|
286
286
|
className: "text-text-muted",
|
|
287
287
|
"data-testid": "assistant-voice-starting",
|
|
288
288
|
children: S("voice.starting", "Starting the microphone…")
|
|
289
|
-
}) : !r &&
|
|
289
|
+
}) : !r && U.isListening ? /* @__PURE__ */ h("p", {
|
|
290
290
|
className: "text-status-error-text",
|
|
291
291
|
"data-testid": "assistant-voice-status",
|
|
292
|
-
children: [/* @__PURE__ */ m(ce, {}),
|
|
292
|
+
children: [/* @__PURE__ */ m(ce, {}), U.interim || S("voice.listening", "Listening… speak now, tap the square to stop")]
|
|
293
293
|
}) : $ ? /* @__PURE__ */ m("p", {
|
|
294
294
|
className: "text-status-error-text",
|
|
295
295
|
"data-testid": "assistant-voice-error",
|
|
296
296
|
children: $
|
|
297
|
-
}) :
|
|
297
|
+
}) : ft ? /* @__PURE__ */ m("button", {
|
|
298
298
|
type: "button",
|
|
299
|
-
onClick:
|
|
299
|
+
onClick: gt,
|
|
300
300
|
className: "text-status-error-text underline-offset-2 hover:underline",
|
|
301
301
|
"data-testid": "assistant-attachment-rejection",
|
|
302
|
-
children: Qt(
|
|
303
|
-
}) :
|
|
302
|
+
children: Qt(ft)
|
|
303
|
+
}) : dt === "failed" ? /* @__PURE__ */ m("p", {
|
|
304
304
|
className: "text-status-error-text",
|
|
305
305
|
"data-testid": "assistant-attachment-blocked",
|
|
306
|
-
children:
|
|
306
|
+
children: Lt.length === 1 ? S("attachments.blockedOne", "{{name}} didn't upload. Retry or remove it before sending.", { name: Lt[0].filename }) : S("attachments.blockedMany", "{{count}} attachments didn't upload. Retry or remove them before sending.", { count: Lt.length })
|
|
307
307
|
}) : n ? /* @__PURE__ */ m("p", {
|
|
308
308
|
className: "text-text-muted",
|
|
309
309
|
"data-testid": "assistant-stopping-status",
|
|
@@ -317,9 +317,9 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
317
317
|
children: S("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
|
|
318
318
|
});
|
|
319
319
|
if (E) {
|
|
320
|
-
let e = v !== void 0 &&
|
|
320
|
+
let e = v !== void 0 && K.length === 0 && R.length === 0 && !U.isActive, n = S("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach"), r = U.isSupported && !x && W.phase !== "idle", i = U.error === "not-allowed" || U.error === "audio-capture", a = !!(j || M || $ || ft || dt === "failed" || et !== null || F !== null), o = W.nothingHeard && !a, s = "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)]";
|
|
321
321
|
return /* @__PURE__ */ m(Ae, { children: (ee) => /* @__PURE__ */ h("div", {
|
|
322
|
-
ref:
|
|
322
|
+
ref: st,
|
|
323
323
|
className: `${C ? `flex-shrink-0 px-3 pt-1.5 ${xe}` : "flex-shrink-0 px-3 pt-1.5"}${Ye ? " hidden" : ""}`,
|
|
324
324
|
children: [
|
|
325
325
|
Ke,
|
|
@@ -340,14 +340,14 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
340
340
|
i && $ && !j && !M ? /* @__PURE__ */ m(pe, {
|
|
341
341
|
message: $,
|
|
342
342
|
onTryAgain: () => {
|
|
343
|
-
|
|
343
|
+
U.clearError(), W.start();
|
|
344
344
|
}
|
|
345
345
|
}) : o ? /* @__PURE__ */ m("p", {
|
|
346
346
|
className: "text-text-secondary",
|
|
347
347
|
"data-testid": "assistant-dictation-nothing-heard",
|
|
348
348
|
children: S("dictation.nothingHeard", "Nothing was heard. Check the microphone and try again.")
|
|
349
349
|
}) : a ? $t(et !== null, F !== null, !0) : null,
|
|
350
|
-
r &&
|
|
350
|
+
r && U.isListening ? /* @__PURE__ */ m("span", {
|
|
351
351
|
className: "sr-only",
|
|
352
352
|
"data-testid": "assistant-dictation-announced",
|
|
353
353
|
children: S("voiceSession.listening", "Listening…")
|
|
@@ -365,8 +365,8 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
365
365
|
onDragLeave: Yt,
|
|
366
366
|
onDragOver: Xt,
|
|
367
367
|
onDrop: Zt,
|
|
368
|
-
className: `flex flex-col rounded-3xl border transition-colors ${r &&
|
|
369
|
-
"data-dictating": r ?
|
|
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)]"} ${Je ? "bg-bg-surface" : "bg-bg-elevated"} ${r && W.phase !== "transcribing" ? "" : A ? "border-dashed border-[var(--color-focus-ring)]" : "border-[var(--color-text-muted)]"}`,
|
|
369
|
+
"data-dictating": r ? W.phase : void 0,
|
|
370
370
|
"data-testid": "assistant-composer",
|
|
371
371
|
"data-presentation": "compact",
|
|
372
372
|
children: [
|
|
@@ -374,14 +374,14 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
374
374
|
className: "px-3 pt-3 empty:hidden",
|
|
375
375
|
children: /* @__PURE__ */ h(De, { children: [/* @__PURE__ */ m(ae, {
|
|
376
376
|
disabled: j,
|
|
377
|
-
showSuggestions:
|
|
378
|
-
onSuggest:
|
|
377
|
+
showSuggestions: K.length === 0,
|
|
378
|
+
onSuggest: It
|
|
379
379
|
}), /* @__PURE__ */ m(ie, {
|
|
380
|
-
attachments:
|
|
381
|
-
onRemove:
|
|
382
|
-
onRetry:
|
|
380
|
+
attachments: R,
|
|
381
|
+
onRemove: pt,
|
|
382
|
+
onRetry: mt,
|
|
383
383
|
disabled: T || j,
|
|
384
|
-
preparingCount:
|
|
384
|
+
preparingCount: ut
|
|
385
385
|
})] })
|
|
386
386
|
}),
|
|
387
387
|
/* @__PURE__ */ m("textarea", {
|
|
@@ -393,7 +393,7 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
393
393
|
disabled: T,
|
|
394
394
|
readOnly: j,
|
|
395
395
|
"aria-busy": j || void 0,
|
|
396
|
-
placeholder: A ? S("composer.dropHere", "Drop files to attach") :
|
|
396
|
+
placeholder: A ? S("composer.dropHere", "Drop files to attach") : Pt,
|
|
397
397
|
rows: 1,
|
|
398
398
|
className: `min-h-10 w-full resize-none bg-transparent px-4 pb-1 pt-3 text-base leading-6 text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50${r ? " hidden" : ""}`,
|
|
399
399
|
"aria-describedby": ee,
|
|
@@ -402,29 +402,29 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
402
402
|
"data-testid": "assistant-input"
|
|
403
403
|
}),
|
|
404
404
|
r ? /* @__PURE__ */ m(fe, {
|
|
405
|
-
phase:
|
|
406
|
-
before:
|
|
407
|
-
take:
|
|
408
|
-
interim:
|
|
409
|
-
after:
|
|
405
|
+
phase: W.phase,
|
|
406
|
+
before: W.before,
|
|
407
|
+
take: W.take,
|
|
408
|
+
interim: W.interim,
|
|
409
|
+
after: W.after
|
|
410
410
|
}) : null,
|
|
411
|
-
r ?
|
|
412
|
-
phase:
|
|
413
|
-
seconds:
|
|
414
|
-
level:
|
|
415
|
-
onCancel:
|
|
416
|
-
onFinish:
|
|
411
|
+
r ? W.phase === "transcribing" ? /* @__PURE__ */ m(de, {
|
|
412
|
+
phase: W.phase,
|
|
413
|
+
seconds: W.seconds,
|
|
414
|
+
level: W.level,
|
|
415
|
+
onCancel: W.cancel,
|
|
416
|
+
onFinish: W.finish,
|
|
417
417
|
focusRing: s
|
|
418
418
|
}) : /* @__PURE__ */ m(t, {
|
|
419
|
-
onDismiss:
|
|
419
|
+
onDismiss: W.cancel,
|
|
420
420
|
children: /* @__PURE__ */ m("div", {
|
|
421
421
|
className: "contents",
|
|
422
422
|
children: /* @__PURE__ */ m(de, {
|
|
423
|
-
phase:
|
|
424
|
-
seconds:
|
|
425
|
-
level:
|
|
426
|
-
onCancel:
|
|
427
|
-
onFinish:
|
|
423
|
+
phase: W.phase,
|
|
424
|
+
seconds: W.seconds,
|
|
425
|
+
level: W.level,
|
|
426
|
+
onCancel: W.cancel,
|
|
427
|
+
onFinish: W.finish,
|
|
428
428
|
focusRing: s
|
|
429
429
|
})
|
|
430
430
|
})
|
|
@@ -433,8 +433,8 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
433
433
|
"data-testid": "assistant-composer-controls",
|
|
434
434
|
children: [
|
|
435
435
|
/* @__PURE__ */ m(re, {
|
|
436
|
-
onFiles:
|
|
437
|
-
canAddMore:
|
|
436
|
+
onFiles: z,
|
|
437
|
+
canAddMore: _t,
|
|
438
438
|
disabled: T || j,
|
|
439
439
|
compact: !0,
|
|
440
440
|
capMenuHeight: !0
|
|
@@ -452,24 +452,18 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
452
452
|
C ? /* @__PURE__ */ m("span", {
|
|
453
453
|
className: "ms-1 hidden min-w-0 truncate text-xs text-text-secondary sm:block",
|
|
454
454
|
"data-testid": "assistant-mic-summary",
|
|
455
|
-
children: i ? S("dictation.noMicrophone", "No microphone available") :
|
|
455
|
+
children: i ? S("dictation.noMicrophone", "No microphone available") : Ot
|
|
456
456
|
}) : null,
|
|
457
457
|
/* @__PURE__ */ m("div", { className: "min-w-0 flex-1" }),
|
|
458
|
-
|
|
459
|
-
onDictate:
|
|
458
|
+
U.isSupported && !x ? C ? /* @__PURE__ */ m(me, {
|
|
459
|
+
onDictate: W.start,
|
|
460
460
|
blocked: i,
|
|
461
461
|
disabled: T || j
|
|
462
462
|
}) : /* @__PURE__ */ m(se, {
|
|
463
463
|
compact: !0,
|
|
464
|
-
isListening:
|
|
465
|
-
isStarting:
|
|
466
|
-
onToggle:
|
|
467
|
-
disabled: T || j
|
|
468
|
-
}) : null,
|
|
469
|
-
C && v !== void 0 && !G.isActive && !i ? /* @__PURE__ */ m(le, {
|
|
470
|
-
secondary: !0,
|
|
471
|
-
invisible: x,
|
|
472
|
-
onStart: v,
|
|
464
|
+
isListening: U.isListening,
|
|
465
|
+
isStarting: U.isStarting,
|
|
466
|
+
onToggle: W.start,
|
|
473
467
|
disabled: T || j
|
|
474
468
|
}) : null,
|
|
475
469
|
Q ? /* @__PURE__ */ m("button", {
|
|
@@ -489,7 +483,7 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
489
483
|
className: "size-4 motion-safe:animate-spin",
|
|
490
484
|
"aria-hidden": "true"
|
|
491
485
|
})
|
|
492
|
-
}) : e && !C ? /* @__PURE__ */ m(le, {
|
|
486
|
+
}) : e && !(C && i) ? /* @__PURE__ */ m(le, {
|
|
493
487
|
compact: !0,
|
|
494
488
|
invisible: x,
|
|
495
489
|
onStart: v,
|
|
@@ -497,13 +491,13 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
497
491
|
}) : /* @__PURE__ */ m("button", {
|
|
498
492
|
type: "button",
|
|
499
493
|
onClick: () => {
|
|
500
|
-
P(null),
|
|
494
|
+
P(null), X();
|
|
501
495
|
},
|
|
502
|
-
disabled: !
|
|
503
|
-
className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${s} ${
|
|
496
|
+
disabled: !J,
|
|
497
|
+
className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${s} ${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)]"}`,
|
|
504
498
|
"aria-label": S("chatInput.send", "Send message"),
|
|
505
499
|
"data-testid": "assistant-send",
|
|
506
|
-
children: je ||
|
|
500
|
+
children: je || lt || j ? /* @__PURE__ */ m(p, {
|
|
507
501
|
className: "size-5 motion-safe:animate-spin",
|
|
508
502
|
"aria-hidden": "true"
|
|
509
503
|
}) : /* @__PURE__ */ m(Te, {
|
|
@@ -531,21 +525,21 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
531
525
|
children: [
|
|
532
526
|
/* @__PURE__ */ h(De, { children: [/* @__PURE__ */ m(ae, {
|
|
533
527
|
disabled: j,
|
|
534
|
-
showSuggestions:
|
|
535
|
-
onSuggest:
|
|
528
|
+
showSuggestions: K.length === 0,
|
|
529
|
+
onSuggest: It
|
|
536
530
|
}), /* @__PURE__ */ m(ie, {
|
|
537
|
-
attachments:
|
|
538
|
-
onRemove:
|
|
539
|
-
onRetry:
|
|
531
|
+
attachments: R,
|
|
532
|
+
onRemove: pt,
|
|
533
|
+
onRetry: mt,
|
|
540
534
|
disabled: T || j,
|
|
541
|
-
preparingCount:
|
|
535
|
+
preparingCount: ut
|
|
542
536
|
})] }),
|
|
543
537
|
/* @__PURE__ */ h("div", {
|
|
544
538
|
className: "flex items-end gap-2",
|
|
545
539
|
children: [
|
|
546
540
|
/* @__PURE__ */ m(re, {
|
|
547
|
-
onFiles:
|
|
548
|
-
canAddMore:
|
|
541
|
+
onFiles: z,
|
|
542
|
+
canAddMore: _t,
|
|
549
543
|
disabled: T || j,
|
|
550
544
|
showLabel: !0
|
|
551
545
|
}),
|
|
@@ -558,29 +552,29 @@ var Ae = ({ children: e }) => e(u()), g = ({ writeAccessDenied: u = !1, onSend:
|
|
|
558
552
|
disabled: T,
|
|
559
553
|
readOnly: j,
|
|
560
554
|
"aria-busy": j || void 0,
|
|
561
|
-
placeholder: A ? S("composer.dropHere", "Drop files to attach") :
|
|
555
|
+
placeholder: A ? S("composer.dropHere", "Drop files to attach") : Pt,
|
|
562
556
|
rows: 1,
|
|
563
557
|
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",
|
|
564
558
|
"aria-label": S("chatInput.ariaLabel", "Message input"),
|
|
565
559
|
"data-testid": "assistant-input"
|
|
566
560
|
}),
|
|
567
|
-
|
|
568
|
-
isListening:
|
|
569
|
-
isStarting:
|
|
570
|
-
onToggle:
|
|
561
|
+
U.isSupported && /* @__PURE__ */ m(se, {
|
|
562
|
+
isListening: U.isListening,
|
|
563
|
+
isStarting: U.isStarting,
|
|
564
|
+
onToggle: U.toggle,
|
|
571
565
|
disabled: T || j
|
|
572
566
|
}),
|
|
573
|
-
v &&
|
|
567
|
+
v && K.length === 0 && R.length === 0 && !U.isActive ? /* @__PURE__ */ m(le, {
|
|
574
568
|
onStart: v,
|
|
575
569
|
disabled: T || j
|
|
576
570
|
}) : /* @__PURE__ */ m("button", {
|
|
577
571
|
type: "button",
|
|
578
|
-
onClick: () => void
|
|
579
|
-
disabled: !
|
|
580
|
-
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 ${
|
|
572
|
+
onClick: () => void X(),
|
|
573
|
+
disabled: !J,
|
|
574
|
+
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"}`,
|
|
581
575
|
"aria-label": S("chatInput.send", "Send message"),
|
|
582
576
|
"data-testid": "assistant-send",
|
|
583
|
-
children: je ||
|
|
577
|
+
children: je || lt || j ? /* @__PURE__ */ m(p, { className: "size-4 motion-safe:animate-spin" }) : /* @__PURE__ */ m(Te, { className: "size-4" })
|
|
584
578
|
})
|
|
585
579
|
]
|
|
586
580
|
}),
|
|
@@ -23,9 +23,4 @@ export declare const AssistantVoiceSessionButton: FC<{
|
|
|
23
23
|
compact?: boolean;
|
|
24
24
|
/** Keep the compact opener mounted for focus return while its session is live. */
|
|
25
25
|
invisible?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* ★ BOFF-13461 (page): a secondary circle beside Send, the wave in the
|
|
28
|
-
* assistant's blue, as the operator's design draws it.
|
|
29
|
-
*/
|
|
30
|
-
secondary?: boolean;
|
|
31
26
|
}>;
|
|
@@ -2,17 +2,17 @@ import { useAssistantTr as e } from "../../i18n.js";
|
|
|
2
2
|
import { AudioLines as t } from "lucide-react";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
// src/shared/assistant/ui/voice/AssistantVoiceSessionButton.tsx
|
|
5
|
-
var r = ({ onStart: r, disabled: i = !1, compact: a = !1, invisible: o = !1
|
|
6
|
-
let
|
|
5
|
+
var r = ({ onStart: r, disabled: i = !1, compact: a = !1, invisible: o = !1 }) => {
|
|
6
|
+
let s = e();
|
|
7
7
|
return /* @__PURE__ */ n("button", {
|
|
8
8
|
type: "button",
|
|
9
9
|
onClick: r,
|
|
10
10
|
disabled: i,
|
|
11
|
-
className:
|
|
12
|
-
"aria-label":
|
|
13
|
-
title:
|
|
11
|
+
className: a ? `flex size-11 shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:cursor-not-allowed disabled:opacity-50 sm:size-10${o ? " invisible" : ""}` : "flex size-9 flex-shrink-0 items-center justify-center rounded-full bg-bg-elevated text-text-secondary shadow-sm transition-all hover:scale-105 hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:scale-100",
|
|
12
|
+
"aria-label": s("voiceSession.start", "Start a voice conversation"),
|
|
13
|
+
title: s("voiceSession.start", "Start a voice conversation"),
|
|
14
14
|
"data-testid": "assistant-voice-session-start",
|
|
15
|
-
children: /* @__PURE__ */ n(t, { className: a
|
|
15
|
+
children: /* @__PURE__ */ n(t, { className: a ? "size-5" : "size-4" })
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
export { r as AssistantVoiceSessionButton };
|