@burdenoff/fe-libs 2026.910.4 → 2026.910.5
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/ui/AIAssistantPanel.js +6 -6
- package/dist/shared/assistant/ui/AssistantChatArea.js +358 -358
- package/dist/shared/assistant/ui/AssistantConversationList.js +16 -16
- package/dist/shared/assistant/ui/AssistantLanguageMenu.js +6 -6
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +21 -7
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.js +47 -37
- package/dist/shared/assistant/ui/AssistantMessageItem.js +16 -16
- package/dist/shared/assistant/ui/AssistantReplyLanguageSelector.js +5 -5
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +151 -151
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +6 -6
- package/dist/shared/assistant/ui/composer/AssistantLanguageSelector.js +4 -4
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +48 -48
- package/dist/shared/assistant/ui/voice/VoiceConversationView.js +8 -8
- package/dist/shared/components/assistantWidget/MessageContent.d.ts +11 -3
- package/dist/shared/components/assistantWidget/MessageContent.d.ts.map +1 -1
- package/dist/shared/components/assistantWidget/MessageContent.js +26 -27
- package/dist/shared-assistant.js +93 -93
- package/package.json +2 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useI18n as e } from "../../providers/shell/I18nProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { useAssistantTr as t } from "../i18n.js";
|
|
3
|
+
import { isVoiceTurn as n } from "../voice/turnVisibility.js";
|
|
4
|
+
import { getSpeechEngine as r } from "../speech/createSpeechEngine.js";
|
|
5
|
+
import { VOICE_LIST_TIMEOUT_MS as i, languageDisplayName as a, selectVoiceForLocale as o, speechGate as s, speechLangForLocale as c, voiceAvailability as ee, voicesForLocale as l } from "../voice/speechVoices.js";
|
|
6
|
+
import { chunkForSpeech as te, toSpeakableText as u } from "../voice/speakableText.js";
|
|
6
7
|
import { voicePreviewText as d } from "../voice/voicePreview.js";
|
|
7
|
-
import { findAssistantLanguage as
|
|
8
|
-
import { resolveLanguagePair as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { IDLE_PLAYBACK as ae, isSpeakingMessage as oe, publishedChunks as se, speechPlaybackReducer as ce } from "../voice/speechPlayback.js";
|
|
8
|
+
import { findAssistantLanguage as ne } from "../voice/languages.js";
|
|
9
|
+
import { resolveLanguagePair as re } from "../voice/languagePair.js";
|
|
10
|
+
import { speechLabelsFor as ie } from "../voice/speechLabels.js";
|
|
11
|
+
import { resolveSpeechLocale as ae } from "../voice/replyLanguage.js";
|
|
12
|
+
import { IDLE_PLAYBACK as oe, isSpeakingMessage as f, publishedChunks as se, speechPlaybackReducer as ce } from "../voice/speechPlayback.js";
|
|
13
13
|
import { useAssistantStore as p } from "../store.js";
|
|
14
14
|
import { isTurnInFlight as le } from "../turnState.js";
|
|
15
15
|
import { parseToolActivity as ue } from "./AssistantToolActivity.js";
|
|
@@ -51,33 +51,33 @@ var pe = {
|
|
|
51
51
|
function S() {
|
|
52
52
|
return g(x);
|
|
53
53
|
}
|
|
54
|
-
var C = ({ children: m, visible: g = !0, engine: S =
|
|
55
|
-
let C =
|
|
54
|
+
var C = ({ children: m, visible: g = !0, engine: S = r() }) => {
|
|
55
|
+
let C = t(), { locale: w } = e(), [T, E] = de(ce, oe), [D, O] = b(() => S.listVoices()), [k, he] = b(!1), [A, j] = b(() => /* @__PURE__ */ new Map()), M = y(0), N = y(null);
|
|
56
56
|
_(() => () => {
|
|
57
|
-
|
|
57
|
+
N.current !== null && clearTimeout(N.current);
|
|
58
58
|
}, []);
|
|
59
|
-
let [
|
|
60
|
-
|
|
61
|
-
}, []),
|
|
62
|
-
|
|
63
|
-
}, []),
|
|
59
|
+
let [P, F] = b(null), I = y(null), L = y(() => {}), R = h(() => {
|
|
60
|
+
I.current?.(), I.current = null;
|
|
61
|
+
}, []), z = p((e) => e.autoSpeakEnabled), B = p((e) => e.setAutoSpeak), [V, ge] = b(!1), H = y(!1), U = h((e) => {
|
|
62
|
+
H.current = e;
|
|
63
|
+
}, []), _e = p((e) => e.activeConversationId), W = v(() => S.isSupported(), [S]);
|
|
64
64
|
_(() => {
|
|
65
|
-
if (!
|
|
65
|
+
if (!W) return;
|
|
66
66
|
let e = () => {
|
|
67
|
-
O(S.listVoices()),
|
|
67
|
+
O(S.listVoices()), j((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
|
|
68
68
|
};
|
|
69
69
|
return e(), S.subscribeVoices(e);
|
|
70
|
-
}, [S,
|
|
71
|
-
let
|
|
70
|
+
}, [S, W]);
|
|
71
|
+
let ve = p((e) => e.assistantLanguage), ye = p((e) => e.replyLanguage), G = p((e) => e.preferredVoices), be = p((e) => e.setPreferredVoice), K = v(() => re(ve, ye, w).reply, [
|
|
72
|
+
ve,
|
|
72
73
|
ye,
|
|
73
|
-
be,
|
|
74
74
|
w
|
|
75
|
-
]),
|
|
76
|
-
|
|
75
|
+
]), q = K.code, J = h((e) => ne(e)?.tag ?? c(e), []), xe = h((e) => ne(e)?.rate ?? .9, []), Y = v(() => ee(W, D, K.tag, k), [
|
|
76
|
+
W,
|
|
77
77
|
D,
|
|
78
|
-
|
|
78
|
+
K,
|
|
79
79
|
k
|
|
80
|
-
]),
|
|
80
|
+
]), X = v(() => ({
|
|
81
81
|
codeBlock: C("speech.codeBlock", "Code block"),
|
|
82
82
|
image: C("speech.image", "image"),
|
|
83
83
|
link: C("speech.link", "link"),
|
|
@@ -86,219 +86,219 @@ var C = ({ children: m, visible: g = !0, engine: S = n() }) => {
|
|
|
86
86
|
nestedItem: C("speech.nestedItem", "Sub-item {{ordinal}}"),
|
|
87
87
|
emailAt: C("speech.emailAt", "at"),
|
|
88
88
|
emailDot: C("speech.emailDot", "dot")
|
|
89
|
-
}), [C]),
|
|
90
|
-
|
|
91
|
-
}, [
|
|
89
|
+
}), [C]), Z = h(() => {
|
|
90
|
+
R(), S.cancel(), E({ type: "stop" });
|
|
91
|
+
}, [R, S]), Se = h((e) => {
|
|
92
92
|
let t = S.listVoices().find((t) => t.name === e) ?? null;
|
|
93
|
-
t && (
|
|
93
|
+
t && (Z(), S.speak([d(q)], {
|
|
94
94
|
voice: t,
|
|
95
|
-
lang: q
|
|
95
|
+
lang: J(q)
|
|
96
96
|
}));
|
|
97
97
|
}, [
|
|
98
98
|
S,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
]),
|
|
103
|
-
|
|
104
|
-
let
|
|
105
|
-
if (!
|
|
106
|
-
if (
|
|
99
|
+
q,
|
|
100
|
+
Z,
|
|
101
|
+
J
|
|
102
|
+
]), Ce = h((e) => A.get(e) ?? null, [A]), we = h((e, t, n) => {
|
|
103
|
+
R();
|
|
104
|
+
let r = !1, a = () => {}, o = (i) => {
|
|
105
|
+
if (!r) {
|
|
106
|
+
if (r = !0, I.current = null, clearTimeout(s), a(), i.length === 0) {
|
|
107
107
|
he(!0);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
O(
|
|
110
|
+
O(i), L.current(e, t, i, n);
|
|
111
111
|
}
|
|
112
|
-
}, s = setTimeout(() => o(S.listVoices()),
|
|
113
|
-
a = S.subscribeVoices(() => o(S.listVoices())),
|
|
114
|
-
|
|
112
|
+
}, s = setTimeout(() => o(S.listVoices()), i);
|
|
113
|
+
a = S.subscribeVoices(() => o(S.listVoices())), I.current = () => {
|
|
114
|
+
r || (r = !0, clearTimeout(s), a(), I.current = null);
|
|
115
115
|
};
|
|
116
|
-
}, [
|
|
117
|
-
let
|
|
118
|
-
if (
|
|
116
|
+
}, [R, S]), Q = h((e, t, n, r) => {
|
|
117
|
+
let i = n;
|
|
118
|
+
if (i.length === 0) {
|
|
119
119
|
let e = S.listVoices();
|
|
120
|
-
e.length > 0 && (
|
|
120
|
+
e.length > 0 && (i = e, O(e));
|
|
121
121
|
}
|
|
122
|
-
let
|
|
123
|
-
if (
|
|
124
|
-
let t = C("speech.noVoiceForReply", "This reply is in {{language}}, and no {{language}} voice is installed on this device.", { language:
|
|
125
|
-
|
|
122
|
+
let c = J(r), l = s(ee(!0, i, r, k));
|
|
123
|
+
if (l === "block") {
|
|
124
|
+
let t = C("speech.noVoiceForReply", "This reply is in {{language}}, and no {{language}} voice is installed on this device.", { language: a(c, w) });
|
|
125
|
+
j((n) => new Map(n).set(e, t));
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
if (
|
|
129
|
-
|
|
128
|
+
if (l === "wait-for-voices") {
|
|
129
|
+
we(e, t, r);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
j((t) => {
|
|
133
133
|
if (!t.has(e)) return t;
|
|
134
134
|
let n = new Map(t);
|
|
135
135
|
return n.delete(e), n;
|
|
136
136
|
});
|
|
137
|
-
let
|
|
138
|
-
|
|
137
|
+
let u = M.current + 1;
|
|
138
|
+
M.current = u, E({
|
|
139
139
|
type: "start",
|
|
140
140
|
messageId: e,
|
|
141
|
-
requestId:
|
|
141
|
+
requestId: u
|
|
142
142
|
});
|
|
143
|
-
let
|
|
144
|
-
|
|
145
|
-
requestId:
|
|
146
|
-
chunks:
|
|
143
|
+
let d = te(t);
|
|
144
|
+
F({
|
|
145
|
+
requestId: u,
|
|
146
|
+
chunks: d,
|
|
147
147
|
index: -1
|
|
148
|
-
}),
|
|
149
|
-
|
|
150
|
-
}, me), S.speak(
|
|
151
|
-
voice:
|
|
152
|
-
lang:
|
|
153
|
-
rate:
|
|
148
|
+
}), N.current !== null && clearTimeout(N.current), N.current = setTimeout(() => {
|
|
149
|
+
F((e) => e?.requestId === u && e.index < 0 ? null : e);
|
|
150
|
+
}, me), S.speak(d, {
|
|
151
|
+
voice: o(i, c, G[r]),
|
|
152
|
+
lang: c,
|
|
153
|
+
rate: xe(r)
|
|
154
154
|
}, {
|
|
155
155
|
onChunkStart: (e) => {
|
|
156
|
-
|
|
156
|
+
M.current === u && N.current !== null && (clearTimeout(N.current), N.current = null), F((t) => t?.requestId === u ? {
|
|
157
157
|
...t,
|
|
158
158
|
index: e
|
|
159
|
-
} :
|
|
160
|
-
requestId:
|
|
161
|
-
chunks:
|
|
159
|
+
} : M.current === u ? {
|
|
160
|
+
requestId: u,
|
|
161
|
+
chunks: d,
|
|
162
162
|
index: e
|
|
163
163
|
} : t);
|
|
164
164
|
},
|
|
165
165
|
onEnd: () => E({
|
|
166
166
|
type: "finished",
|
|
167
|
-
requestId:
|
|
167
|
+
requestId: u
|
|
168
168
|
}),
|
|
169
169
|
onError: () => E({
|
|
170
170
|
type: "failed",
|
|
171
|
-
requestId:
|
|
171
|
+
requestId: u
|
|
172
172
|
})
|
|
173
173
|
});
|
|
174
174
|
}, [
|
|
175
175
|
S,
|
|
176
176
|
w,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
G,
|
|
178
|
+
xe,
|
|
179
|
+
J,
|
|
180
180
|
C,
|
|
181
181
|
k,
|
|
182
|
-
|
|
182
|
+
we
|
|
183
183
|
]);
|
|
184
184
|
_(() => {
|
|
185
|
-
|
|
186
|
-
}, [
|
|
187
|
-
let
|
|
188
|
-
if (!
|
|
189
|
-
let r =
|
|
190
|
-
i &&
|
|
185
|
+
L.current = Q;
|
|
186
|
+
}, [Q]);
|
|
187
|
+
let $ = h((e, t, n) => {
|
|
188
|
+
if (!W) return;
|
|
189
|
+
let r = ae(u(t, { labels: pe }), n ?? q), i = u(t, { labels: ie(r, X) });
|
|
190
|
+
i && Q(e, i, D, r);
|
|
191
191
|
}, [
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
W,
|
|
193
|
+
X,
|
|
194
|
+
q,
|
|
195
|
+
Q,
|
|
196
196
|
D
|
|
197
|
-
]),
|
|
198
|
-
if (
|
|
199
|
-
|
|
197
|
+
]), Te = h((e, t, n) => {
|
|
198
|
+
if (f(T, e)) {
|
|
199
|
+
Z();
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
|
-
|
|
202
|
+
$(e, t, n);
|
|
203
203
|
}, [
|
|
204
204
|
T,
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
$,
|
|
206
|
+
Z
|
|
207
207
|
]);
|
|
208
208
|
_(() => {
|
|
209
|
-
g ||
|
|
210
|
-
}, [g,
|
|
211
|
-
|
|
212
|
-
}, [
|
|
213
|
-
|
|
214
|
-
}, [
|
|
215
|
-
|
|
209
|
+
g || Z();
|
|
210
|
+
}, [g, Z]), _(() => {
|
|
211
|
+
Z(), j(/* @__PURE__ */ new Map());
|
|
212
|
+
}, [_e, Z]), _(() => {
|
|
213
|
+
j((e) => e.size === 0 ? e : /* @__PURE__ */ new Map()), Z();
|
|
214
|
+
}, [q, Z]), _(() => () => {
|
|
215
|
+
I.current?.(), I.current = null, S.cancel();
|
|
216
216
|
}, [S]), _(() => {
|
|
217
217
|
if (typeof window > "u") return;
|
|
218
218
|
let e = () => S.cancel();
|
|
219
219
|
return window.addEventListener("pagehide", e), () => window.removeEventListener("pagehide", e);
|
|
220
220
|
}, [S]), _(() => {
|
|
221
|
-
if (typeof document > "u" || !
|
|
221
|
+
if (typeof document > "u" || !W) return;
|
|
222
222
|
let e = () => {
|
|
223
223
|
if (document.visibilityState !== "visible") return;
|
|
224
224
|
let e = S.listVoices();
|
|
225
|
-
e.length > 0 &&
|
|
225
|
+
e.length > 0 && R(), O(e), he(!1), j((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
|
|
226
226
|
};
|
|
227
227
|
return document.addEventListener("visibilitychange", e), window.addEventListener("focus", e), () => {
|
|
228
228
|
document.removeEventListener("visibilitychange", e), window.removeEventListener("focus", e);
|
|
229
229
|
};
|
|
230
230
|
}, [
|
|
231
|
-
|
|
231
|
+
R,
|
|
232
232
|
S,
|
|
233
|
-
|
|
233
|
+
W
|
|
234
234
|
]);
|
|
235
|
-
let
|
|
235
|
+
let Ee = y($);
|
|
236
236
|
_(() => {
|
|
237
|
-
|
|
238
|
-
}, [
|
|
239
|
-
if (!(!
|
|
237
|
+
Ee.current = $;
|
|
238
|
+
}, [$]), _(() => {
|
|
239
|
+
if (!(!z && !V || !g || !W)) return p.subscribe((e, t) => {
|
|
240
240
|
let r = e.activeConversationId;
|
|
241
|
-
if (!r || r !==
|
|
242
|
-
let i = e.processingByConversationId[r], a =
|
|
241
|
+
if (!r || r !== t.activeConversationId) return;
|
|
242
|
+
let i = e.processingByConversationId[r], a = t.processingByConversationId[r];
|
|
243
243
|
if (i?.status !== "complete" || !le(a?.status)) return;
|
|
244
244
|
let o = i.messageId ?? a?.messageId ?? null;
|
|
245
245
|
if (!o) return;
|
|
246
246
|
let s = e.conversations.find((e) => e.id === r)?.messages.find((e) => e.id === o);
|
|
247
|
-
if (!s || s.role !== "assistant" ||
|
|
247
|
+
if (!s || s.role !== "assistant" || n(s) !== V || H.current) return;
|
|
248
248
|
let { text: c } = ue(s.content);
|
|
249
|
-
c.trim() &&
|
|
249
|
+
c.trim() && Ee.current(o, c, s.metadata?.lang);
|
|
250
250
|
});
|
|
251
251
|
}, [
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
z,
|
|
253
|
+
V,
|
|
254
|
+
W,
|
|
255
255
|
g
|
|
256
256
|
]);
|
|
257
|
-
let
|
|
257
|
+
let De = v(() => l(D, K.tag), [D, K]), Oe = v(() => o(D, K.tag, G[q]), [
|
|
258
258
|
D,
|
|
259
|
+
K,
|
|
259
260
|
G,
|
|
260
|
-
|
|
261
|
-
K
|
|
261
|
+
q
|
|
262
262
|
]), ke = v(() => ({
|
|
263
|
-
isSupported:
|
|
264
|
-
availability:
|
|
265
|
-
isBlocked:
|
|
266
|
-
disabledReason:
|
|
267
|
-
blockedFor:
|
|
268
|
-
voiceChoices:
|
|
269
|
-
spokenChunks: se(T,
|
|
270
|
-
activeVoiceName:
|
|
271
|
-
preferredVoiceName:
|
|
272
|
-
setVoice: (e) =>
|
|
263
|
+
isSupported: W,
|
|
264
|
+
availability: Y,
|
|
265
|
+
isBlocked: Y === "no-voices",
|
|
266
|
+
disabledReason: Y === "no-voices" ? C("speech.noVoicesOnDevice", "This device has no speech voices installed. Add one in your device speech or accessibility settings.") : null,
|
|
267
|
+
blockedFor: Ce,
|
|
268
|
+
voiceChoices: De,
|
|
269
|
+
spokenChunks: se(T, P),
|
|
270
|
+
activeVoiceName: Oe?.name ?? null,
|
|
271
|
+
preferredVoiceName: G[q] ?? null,
|
|
272
|
+
setVoice: (e) => be(q, e),
|
|
273
273
|
speakingMessageId: T.status === "speaking" ? T.messageId : null,
|
|
274
|
-
isSpeaking: (e) =>
|
|
275
|
-
toggle:
|
|
276
|
-
stop:
|
|
277
|
-
autoSpeakEnabled:
|
|
278
|
-
setAutoSpeak:
|
|
279
|
-
sessionSpeaking:
|
|
280
|
-
setSessionSpeaking:
|
|
281
|
-
setSessionMicOpen:
|
|
282
|
-
previewVoice:
|
|
274
|
+
isSpeaking: (e) => f(T, e),
|
|
275
|
+
toggle: Te,
|
|
276
|
+
stop: Z,
|
|
277
|
+
autoSpeakEnabled: z,
|
|
278
|
+
setAutoSpeak: B,
|
|
279
|
+
sessionSpeaking: V,
|
|
280
|
+
setSessionSpeaking: ge,
|
|
281
|
+
setSessionMicOpen: U,
|
|
282
|
+
previewVoice: Se
|
|
283
283
|
}), [
|
|
284
|
-
U,
|
|
285
|
-
J,
|
|
286
|
-
we,
|
|
287
|
-
Oe,
|
|
288
|
-
$,
|
|
289
284
|
W,
|
|
290
|
-
|
|
291
|
-
|
|
285
|
+
Y,
|
|
286
|
+
Ce,
|
|
287
|
+
De,
|
|
288
|
+
Oe,
|
|
289
|
+
G,
|
|
290
|
+
be,
|
|
291
|
+
q,
|
|
292
292
|
T,
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
R,
|
|
293
|
+
Te,
|
|
294
|
+
Z,
|
|
296
295
|
z,
|
|
297
296
|
B,
|
|
298
|
-
|
|
299
|
-
|
|
297
|
+
V,
|
|
298
|
+
U,
|
|
299
|
+
Se,
|
|
300
300
|
C,
|
|
301
|
-
|
|
301
|
+
P
|
|
302
302
|
]);
|
|
303
303
|
return /* @__PURE__ */ fe(x.Provider, {
|
|
304
304
|
value: ke,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useI18n as e } from "../../../providers/shell/I18nProvider.js";
|
|
2
2
|
import { useVoiceInput as t } from "../../voice/useVoiceInput.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useAssistantTr as ee } from "../../i18n.js";
|
|
4
|
+
import { languageDisplayName as n } from "../../voice/speechVoices.js";
|
|
5
|
+
import { resolveAssistantLanguage as r } from "../../voice/languages.js";
|
|
6
6
|
import { getSendableAttachments as i } from "../../attachments.js";
|
|
7
7
|
import { useAssistantStore as a } from "../../store.js";
|
|
8
8
|
import { AssistantAttachmentButton as o } from "./AssistantAttachmentButton.js";
|
|
@@ -16,11 +16,11 @@ import { ArrowUp as p, Loader2 as m } from "lucide-react";
|
|
|
16
16
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
17
17
|
//#region src/shared/assistant/ui/composer/AssistantComposer.tsx
|
|
18
18
|
var _ = 200, v = ({ writeAccessDenied: v = !1, onSend: y, disabled: b = !1, placeholder: x, mode: S, availableModes: C, onModeChange: ae, onStartVoiceSession: w }) => {
|
|
19
|
-
let T =
|
|
19
|
+
let T = ee(), { locale: E } = e(), D = d(null), [O, k] = f(""), [A, j] = f(!1), M = d(0), { attachments: N, isBusy: P, preparingCount: F, sendBlocker: I, rejection: L, addFiles: R, remove: z, retry: B, clear: V, clearRejection: H, canAddMore: U } = re(), oe = l((e) => {
|
|
20
20
|
k((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
|
|
21
21
|
}, []), W = a((e) => e.assistantLanguage), G = t({
|
|
22
22
|
onFinalize: oe,
|
|
23
|
-
language: u(() =>
|
|
23
|
+
language: u(() => r(W, E), [W, E]).tag
|
|
24
24
|
}), K = x ?? T("composer.placeholder", "Ask me anything…"), q = O.trim(), J = i(N), Y = N.filter((e) => e.status === "error"), X = (q.length > 0 || J.length > 0) && !b && I === null;
|
|
25
25
|
ie(() => {
|
|
26
26
|
let e = D.current;
|
|
@@ -61,7 +61,7 @@ var _ = 200, v = ({ writeAccessDenied: v = !1, onSend: y, disabled: b = !1, plac
|
|
|
61
61
|
case "not-allowed": return T("voice.denied", "Microphone access is blocked. Allow it in your browser settings to dictate.");
|
|
62
62
|
case "audio-capture": return T("voice.noMic", "No microphone was found.");
|
|
63
63
|
case "network": return T("voice.network", "Speech recognition is offline right now.");
|
|
64
|
-
case "language-not-supported": return T("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language:
|
|
64
|
+
case "language-not-supported": return T("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language: n(G.language, E) });
|
|
65
65
|
case "unknown": return T("voice.failed", "Dictation stopped unexpectedly.");
|
|
66
66
|
default: return null;
|
|
67
67
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useAssistantTr as e } from "../../i18n.js";
|
|
2
|
+
import { ASSISTANT_LANGUAGES as t } from "../../voice/languages.js";
|
|
3
3
|
import { Languages as n } from "lucide-react";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
//#region src/shared/assistant/ui/composer/AssistantLanguageSelector.tsx
|
|
6
6
|
var a = ({ current: a, selected: s, onChange: c, disabled: l = !1 }) => {
|
|
7
|
-
let u =
|
|
7
|
+
let u = e(), d = u("voice.languageLabel", "Language you speak to the assistant");
|
|
8
8
|
return /* @__PURE__ */ i("label", {
|
|
9
9
|
className: `relative flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] transition-colors focus-within:ring-2 focus-within:ring-border-strong ${l ? "cursor-not-allowed opacity-50" : "cursor-pointer text-text-muted hover:bg-bg-elevated hover:text-text-secondary"}`,
|
|
10
10
|
title: `${d}: ${a.label}`,
|
|
@@ -30,7 +30,7 @@ var a = ({ current: a, selected: s, onChange: c, disabled: l = !1 }) => {
|
|
|
30
30
|
children: [/* @__PURE__ */ r("option", {
|
|
31
31
|
value: o,
|
|
32
32
|
children: u("voice.languageFollowApp", "Same as interface")
|
|
33
|
-
}),
|
|
33
|
+
}), t.map((e) => /* @__PURE__ */ r("option", {
|
|
34
34
|
value: e.code,
|
|
35
35
|
children: e.label
|
|
36
36
|
}, e.code))]
|