@burdenoff/fe-libs 2026.1115.7 → 2026.1115.9
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/i18nManifest.d.ts +6 -4
- package/dist/shared/assistant/i18nManifest.js +6 -4
- package/dist/shared/assistant/index.d.ts +1 -0
- package/dist/shared/assistant/ui/AssistantChatArea.js +1108 -1107
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +16 -6
- package/dist/shared/assistant/voice/phraseGate.js +2 -0
- package/dist/shared/assistant/voice/revealSpoken.d.ts +14 -0
- package/dist/shared/assistant/voice/revealSpoken.js +28 -0
- package/dist/shared/assistant/voice/speakableText.d.ts +27 -3
- package/dist/shared/assistant/voice/speakableText.js +149 -120
- package/dist/shared/assistant/voice/speechLabels.js +28 -16
- package/dist/shared/providers/shell/I18nProvider.d.ts +2 -1
- package/dist/shared/providers/shell/I18nProvider.js +42 -42
- package/dist/shared-assistant.js +396 -395
- package/package.json +1 -1
|
@@ -1,60 +1,72 @@
|
|
|
1
1
|
// src/shared/assistant/voice/speechLabels.ts
|
|
2
2
|
var e = {
|
|
3
3
|
en: {
|
|
4
|
-
codeBlock: "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
codeBlock: "There’s a code example on screen",
|
|
5
|
+
codeBlockAgain: "There’s another code example on screen",
|
|
6
|
+
image: "an image",
|
|
7
|
+
link: "a link",
|
|
8
|
+
linkTo: "a link to {{site}}",
|
|
9
|
+
largeTable: "There’s a table on screen with {{rows}} rows: {{headers}}",
|
|
8
10
|
truncated: "The rest of this message is not read aloud",
|
|
9
11
|
nestedItem: "Sub-item {{ordinal}}",
|
|
10
12
|
emailAt: "at",
|
|
11
13
|
emailDot: "dot"
|
|
12
14
|
},
|
|
13
15
|
ta: {
|
|
14
|
-
codeBlock: "நிரல்
|
|
16
|
+
codeBlock: "திரையில் ஒரு நிரல் எடுத்துக்காட்டு உள்ளது",
|
|
17
|
+
codeBlockAgain: "திரையில் மற்றொரு நிரல் எடுத்துக்காட்டு உள்ளது",
|
|
15
18
|
image: "படம்",
|
|
16
19
|
link: "இணைப்பு",
|
|
17
|
-
|
|
20
|
+
linkTo: "{{site}} இணைப்பு",
|
|
21
|
+
largeTable: "திரையில் {{rows}} வரிசைகள் கொண்ட அட்டவணை உள்ளது: {{headers}}",
|
|
18
22
|
truncated: "இந்தச் செய்தியின் மீதமுள்ள பகுதி வாசிக்கப்படவில்லை",
|
|
19
23
|
nestedItem: "துணை உருப்படி {{ordinal}}",
|
|
20
24
|
emailAt: "அட்",
|
|
21
25
|
emailDot: "புள்ளி"
|
|
22
26
|
},
|
|
23
27
|
hi: {
|
|
24
|
-
codeBlock: "कोड
|
|
28
|
+
codeBlock: "स्क्रीन पर एक कोड उदाहरण है",
|
|
29
|
+
codeBlockAgain: "स्क्रीन पर एक और कोड उदाहरण है",
|
|
25
30
|
image: "छवि",
|
|
26
31
|
link: "लिंक",
|
|
27
|
-
|
|
32
|
+
linkTo: "{{site}} का लिंक",
|
|
33
|
+
largeTable: "स्क्रीन पर {{rows}} पंक्तियों वाली एक तालिका है: {{headers}}",
|
|
28
34
|
truncated: "इस संदेश का शेष भाग नहीं पढ़ा जाता",
|
|
29
35
|
nestedItem: "उप-आइटम {{ordinal}}",
|
|
30
36
|
emailAt: "ऐट",
|
|
31
37
|
emailDot: "डॉट"
|
|
32
38
|
},
|
|
33
39
|
ar: {
|
|
34
|
-
codeBlock: "
|
|
40
|
+
codeBlock: "يوجد مثال برمجي على الشاشة",
|
|
41
|
+
codeBlockAgain: "يوجد مثال برمجي آخر على الشاشة",
|
|
35
42
|
image: "صورة",
|
|
36
43
|
link: "رابط",
|
|
37
|
-
|
|
44
|
+
linkTo: "رابط إلى {{site}}",
|
|
45
|
+
largeTable: "يوجد على الشاشة جدول من {{rows}} صفوف: {{headers}}",
|
|
38
46
|
truncated: "لا تتم قراءة بقية هذه الرسالة بصوت عالٍ",
|
|
39
47
|
nestedItem: "عنصر فرعي {{ordinal}}",
|
|
40
48
|
emailAt: "أت",
|
|
41
49
|
emailDot: "نقطة"
|
|
42
50
|
},
|
|
43
51
|
es: {
|
|
44
|
-
codeBlock: "
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
codeBlock: "Hay un ejemplo de código en pantalla",
|
|
53
|
+
codeBlockAgain: "Hay otro ejemplo de código en pantalla",
|
|
54
|
+
image: "una imagen",
|
|
55
|
+
link: "un enlace",
|
|
56
|
+
linkTo: "un enlace a {{site}}",
|
|
57
|
+
largeTable: "En pantalla hay una tabla con {{rows}} filas: {{headers}}",
|
|
48
58
|
truncated: "El resto de este mensaje no se lee en voz alta",
|
|
49
59
|
nestedItem: "Subelemento {{ordinal}}",
|
|
50
60
|
emailAt: "arroba",
|
|
51
61
|
emailDot: "punto"
|
|
52
62
|
},
|
|
53
63
|
zh: {
|
|
54
|
-
codeBlock: "
|
|
64
|
+
codeBlock: "屏幕上有一个代码示例",
|
|
65
|
+
codeBlockAgain: "屏幕上还有一个代码示例",
|
|
55
66
|
image: "图片",
|
|
56
67
|
link: "链接",
|
|
57
|
-
|
|
68
|
+
linkTo: "指向 {{site}} 的链接",
|
|
69
|
+
largeTable: "屏幕上有一个 {{rows}} 行的表格:{{headers}}",
|
|
58
70
|
truncated: "此消息的其余部分不会朗读",
|
|
59
71
|
nestedItem: "子项 {{ordinal}}",
|
|
60
72
|
emailAt: "at",
|
|
@@ -117,7 +117,8 @@ export interface I18nProviderProps {
|
|
|
117
117
|
/**
|
|
118
118
|
* For a non-English locale with `persistence` and NO cached dictionary (a first visit or an
|
|
119
119
|
* evicted cache), keep holding the first paint until the downloaded dictionary arrives, capped
|
|
120
|
-
* at this long, then fall back to English (BOFF-9536).
|
|
120
|
+
* at this long, then fall back to English (BOFF-9536). Ignored when `translations` already
|
|
121
|
+
* carries words for that locale: the app can paint it at once. 0 (the default) releases the hold as
|
|
121
122
|
* soon as the cache turns out empty, so English shows until the download lands.
|
|
122
123
|
*/
|
|
123
124
|
coldCacheHoldMs?: number;
|
|
@@ -73,8 +73,8 @@ function w(e, t) {
|
|
|
73
73
|
let n = p(t);
|
|
74
74
|
return Object.entries(e).some(([e, t]) => t === "loading" && p(e) === n);
|
|
75
75
|
}
|
|
76
|
-
function T({ children: r, defaultLocale: i = "en", translations: f = ee, storageKey: m = b, profileId: S, fetchTranslations: T, loadTranslations: E, cacheScope: D = "", persistence: O = null, firstPaintHoldMs: k = 0, coldCacheHoldMs:
|
|
77
|
-
let [
|
|
76
|
+
function T({ children: r, defaultLocale: i = "en", translations: f = ee, storageKey: m = b, profileId: S, fetchTranslations: T, loadTranslations: E, cacheScope: D = "", persistence: O = null, firstPaintHoldMs: k = 0, coldCacheHoldMs: te = 0, directionMode: A = "off", showChildrenWhileLoading: ne = !0, loadingComponent: j }) {
|
|
77
|
+
let [M, N] = l(() => x(S, m, i)), P = s(() => {
|
|
78
78
|
if (E) return E;
|
|
79
79
|
if (T) return async (e) => {
|
|
80
80
|
let t = await T(e);
|
|
@@ -83,38 +83,38 @@ function T({ children: r, defaultLocale: i = "en", translations: f = ee, storage
|
|
|
83
83
|
complete: y(t)
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
|
-
}, [E, T]), [
|
|
87
|
-
let e = _.translations.get(v(D,
|
|
88
|
-
return e ? { [
|
|
89
|
-
}), [
|
|
90
|
-
if (!
|
|
91
|
-
let e = _.translations.has(v(D,
|
|
92
|
-
return { [
|
|
93
|
-
}), [
|
|
86
|
+
}, [E, T]), [F, re] = l(() => {
|
|
87
|
+
let e = _.translations.get(v(D, M));
|
|
88
|
+
return e ? { [M]: e.translations } : {};
|
|
89
|
+
}), [I, ie] = l(() => {
|
|
90
|
+
if (!P) return {};
|
|
91
|
+
let e = _.translations.has(v(D, M));
|
|
92
|
+
return { [M]: e ? "ready" : "loading" };
|
|
93
|
+
}), [ae, L] = l(null), [R] = l(() => y(f[M]) ? 0 : te), z = Math.max(k, R), [B, V] = l(() => typeof window < "u" && !!P && !!O && z > 0 && p(M) !== "en" && !_.translations.has(v(D, M)));
|
|
94
94
|
o(() => {
|
|
95
95
|
if (!B) return;
|
|
96
96
|
let e = setTimeout(() => V(!1), z);
|
|
97
97
|
return () => clearTimeout(e);
|
|
98
98
|
}, [B, z]);
|
|
99
99
|
let H = c(/* @__PURE__ */ new Map()), U = c(/* @__PURE__ */ new Set()), W = c(_.version), G = a((e, t) => {
|
|
100
|
-
|
|
100
|
+
ie((n) => n[e] === t ? n : {
|
|
101
101
|
...n,
|
|
102
102
|
[e]: t
|
|
103
103
|
});
|
|
104
104
|
}, []), K = a((e, t, n) => {
|
|
105
|
-
H.current.set(e, n),
|
|
105
|
+
H.current.set(e, n), re((n) => n[e] === t ? n : {
|
|
106
106
|
...n,
|
|
107
107
|
[e]: t
|
|
108
108
|
});
|
|
109
109
|
}, []), q = s(() => {
|
|
110
110
|
let e = { ...f };
|
|
111
|
-
for (let [t, n] of Object.entries(
|
|
111
|
+
for (let [t, n] of Object.entries(F)) if (n && Object.keys(n).length > 0) {
|
|
112
112
|
let r = t;
|
|
113
113
|
e[r] = C(f[r], n);
|
|
114
114
|
}
|
|
115
115
|
return e;
|
|
116
|
-
}, [f,
|
|
117
|
-
if (!
|
|
116
|
+
}, [f, F]), J = a(async (e) => {
|
|
117
|
+
if (!P) return;
|
|
118
118
|
W.current !== _.version && (U.current.clear(), H.current.clear(), W.current = _.version);
|
|
119
119
|
let t = v(D, e), r = _.translations.get(t);
|
|
120
120
|
if (r) {
|
|
@@ -122,13 +122,13 @@ function T({ children: r, defaultLocale: i = "en", translations: f = ee, storage
|
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
if (U.current.has(t)) return;
|
|
125
|
-
U.current.add(t), G(e, "loading"),
|
|
125
|
+
U.current.add(t), G(e, "loading"), L(null);
|
|
126
126
|
let i = !1, a = !1, o = !1, s = O ? O.read(D, e).catch(() => null) : Promise.resolve(null);
|
|
127
127
|
s.then((t) => {
|
|
128
|
-
i || !t || !y(t.translations) ? (i || a ||
|
|
128
|
+
i || !t || !y(t.translations) ? (i || a || R <= 0) && V(!1) : (o = !0, K(e, t.translations, t.hash), a && G(e, "ready"), V(!1));
|
|
129
129
|
});
|
|
130
130
|
try {
|
|
131
|
-
let r = await
|
|
131
|
+
let r = await P(e);
|
|
132
132
|
if (a = !0, r.complete && y(r.translations) || await s, r.complete && y(r.translations)) {
|
|
133
133
|
let a = n(r.translations);
|
|
134
134
|
if (_.attempted.add(t), _.translations.set(t, {
|
|
@@ -143,34 +143,34 @@ function T({ children: r, defaultLocale: i = "en", translations: f = ee, storage
|
|
|
143
143
|
}
|
|
144
144
|
} else o ? G(e, "ready") : y(r.translations) ? (K(e, r.translations, n(r.translations)), G(e, "ready")) : G(e, "failed");
|
|
145
145
|
} catch (t) {
|
|
146
|
-
a = !0, console.error(`[I18nProvider] Failed to fetch translations for ${e}:`, t),
|
|
146
|
+
a = !0, console.error(`[I18nProvider] Failed to fetch translations for ${e}:`, t), L(t instanceof Error ? t.message : "Failed to fetch translations"), await s, G(e, o ? "ready" : "failed");
|
|
147
147
|
} finally {
|
|
148
148
|
U.current.delete(t), V(!1);
|
|
149
149
|
}
|
|
150
150
|
}, [
|
|
151
151
|
K,
|
|
152
152
|
D,
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
R,
|
|
154
|
+
P,
|
|
155
155
|
G,
|
|
156
156
|
O
|
|
157
157
|
]);
|
|
158
158
|
o(() => {
|
|
159
|
-
|
|
159
|
+
P && J(M);
|
|
160
160
|
}, [
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
P,
|
|
162
|
+
M,
|
|
163
163
|
J
|
|
164
164
|
]), o(() => {
|
|
165
165
|
let e = x(S, m, i);
|
|
166
|
-
|
|
166
|
+
N(e), document.documentElement.setAttribute("lang", e);
|
|
167
167
|
}, [
|
|
168
168
|
S,
|
|
169
169
|
m,
|
|
170
170
|
i
|
|
171
171
|
]);
|
|
172
172
|
let Y = a((e) => {
|
|
173
|
-
if (
|
|
173
|
+
if (N(e), P) {
|
|
174
174
|
let t = _.translations.get(v(D, e));
|
|
175
175
|
t ? (H.current.get(e) !== t.hash && K(e, t.translations, t.hash), G(e, "ready")) : G(e, "loading");
|
|
176
176
|
}
|
|
@@ -178,18 +178,18 @@ function T({ children: r, defaultLocale: i = "en", translations: f = ee, storage
|
|
|
178
178
|
}, [
|
|
179
179
|
K,
|
|
180
180
|
D,
|
|
181
|
-
|
|
181
|
+
P,
|
|
182
182
|
G,
|
|
183
183
|
m,
|
|
184
184
|
S
|
|
185
|
-
]), X = h(
|
|
185
|
+
]), X = h(A, M);
|
|
186
186
|
o(() => {
|
|
187
|
-
if (
|
|
187
|
+
if (A === "off" || typeof document > "u") return;
|
|
188
188
|
let e = document.documentElement, t = e.getAttribute("dir");
|
|
189
189
|
return e.setAttribute("dir", X), () => {
|
|
190
190
|
t === null ? e.removeAttribute("dir") : e.setAttribute("dir", t);
|
|
191
191
|
};
|
|
192
|
-
}, [
|
|
192
|
+
}, [A, X]);
|
|
193
193
|
let Z = a((n, r, a) => {
|
|
194
194
|
let o, s;
|
|
195
195
|
if (typeof r == "string") o = r, s = a;
|
|
@@ -197,35 +197,35 @@ function T({ children: r, defaultLocale: i = "en", translations: f = ee, storage
|
|
|
197
197
|
let { defaultValue: e, ...t } = r;
|
|
198
198
|
typeof e == "string" ? o = e : typeof e == "number" && (o = String(e)), s = t;
|
|
199
199
|
}
|
|
200
|
-
let c = t(q[
|
|
200
|
+
let c = t(q[M], n) ?? (M === i ? void 0 : t(q[i], n)) ?? (i === "en" ? void 0 : t(q.en, n)) ?? o ?? n;
|
|
201
201
|
return s ? e(c, s) : c;
|
|
202
202
|
}, [
|
|
203
|
-
|
|
203
|
+
M,
|
|
204
204
|
q,
|
|
205
205
|
i
|
|
206
|
-
]), Q = Object.values(
|
|
207
|
-
locale:
|
|
208
|
-
translations: q[
|
|
206
|
+
]), Q = Object.values(I).includes("loading"), $ = a((e) => w(I, e), [I]), oe = s(() => ({
|
|
207
|
+
locale: M,
|
|
208
|
+
translations: q[M] || {},
|
|
209
209
|
setLocale: Y,
|
|
210
210
|
t: Z,
|
|
211
211
|
isLoading: Q,
|
|
212
|
-
error:
|
|
213
|
-
localeStatus:
|
|
212
|
+
error: ae,
|
|
213
|
+
localeStatus: I,
|
|
214
214
|
isLocaleLoading: $,
|
|
215
215
|
dir: X
|
|
216
216
|
}), [
|
|
217
|
-
|
|
217
|
+
M,
|
|
218
218
|
q,
|
|
219
219
|
Y,
|
|
220
220
|
Z,
|
|
221
221
|
Q,
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
ae,
|
|
223
|
+
I,
|
|
224
224
|
$,
|
|
225
225
|
X
|
|
226
226
|
]);
|
|
227
|
-
return B ? /* @__PURE__ */ d(u, { children:
|
|
228
|
-
value:
|
|
227
|
+
return B ? /* @__PURE__ */ d(u, { children: j ?? null }) : $(M) && !ne && j && !y(F[M]) ? /* @__PURE__ */ d(u, { children: j }) : /* @__PURE__ */ d(g.Provider, {
|
|
228
|
+
value: oe,
|
|
229
229
|
children: r
|
|
230
230
|
});
|
|
231
231
|
}
|