@burdenoff/fe-libs 2026.1029.11 → 2026.1030.2
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/connections/ConnectionDetailsTab.d.ts +4 -1
- package/dist/connections/ConnectionDetailsTab.js +18 -15
- package/dist/connections/ConnectionDialog.d.ts +8 -2
- package/dist/connections/ConnectionDialog.js +18 -17
- package/dist/connections/ConnectionDialogPanel.d.ts +3 -1
- package/dist/connections/ConnectionDialogPanel.js +141 -135
- package/dist/connections/ShareConnectionDialog.d.ts +23 -0
- package/dist/connections/ShareConnectionDialog.js +146 -0
- package/dist/connections/SharePanels.d.ts +32 -0
- package/dist/connections/SharePanels.js +158 -0
- package/dist/connections/VisibilityChoice.d.ts +12 -0
- package/dist/connections/VisibilityChoice.js +60 -0
- package/dist/connections/api.d.ts +12 -1
- package/dist/connections/api.js +1 -1
- package/dist/connections/connectionFlow.d.ts +6 -1
- package/dist/connections/connectionFlow.js +1 -1
- package/dist/connections/index.d.ts +4 -1
- package/dist/connections/sharingApi.d.ts +28 -0
- package/dist/connections/sharingApi.js +215 -0
- package/dist/connections/types.d.ts +31 -0
- package/dist/connections/useConnectionSharingDraft.d.ts +40 -0
- package/dist/connections/useConnectionSharingDraft.js +93 -0
- package/dist/connections.js +12 -9
- package/dist/shared/assistant/i18nManifest.d.ts +18 -0
- package/dist/shared/assistant/i18nManifest.js +18 -0
- package/dist/shared/assistant/index.d.ts +4 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +9 -1
- package/dist/shared/assistant/ui/AIAssistantPanel.js +194 -174
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts +33 -0
- package/dist/shared/assistant/ui/AssistantChatArea.js +1463 -1397
- package/dist/shared/assistant/ui/AssistantLanguageMenu.d.ts +9 -1
- package/dist/shared/assistant/ui/AssistantLanguageMenu.js +22 -22
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +16 -2
- package/dist/shared/assistant/ui/AssistantOverlay.js +219 -200
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts +16 -2
- package/dist/shared/assistant/ui/assistantOverlayState.js +57 -40
- package/dist/shared/assistant/ui/compact/AssistantConversationMenu.js +53 -52
- package/dist/shared/assistant/ui/compact/AssistantDiscardDraftDialog.js +3 -4
- package/dist/shared/assistant/ui/compact/AssistantLanguagePill.d.ts +29 -0
- package/dist/shared/assistant/ui/compact/AssistantLanguagePill.js +98 -0
- package/dist/shared/assistant/ui/compact/AssistantVoiceReady.d.ts +31 -0
- package/dist/shared/assistant/ui/compact/AssistantVoiceReady.js +41 -0
- package/dist/shared/assistant/ui/compact/AssistantWaitingChangeRow.d.ts +6 -0
- package/dist/shared/assistant/ui/compact/AssistantWaitingChangeRow.js +5 -5
- package/dist/shared/assistant/ui/compact/AssistantWindowHeader.d.ts +22 -5
- package/dist/shared/assistant/ui/compact/AssistantWindowHeader.js +45 -31
- package/dist/shared/assistant/ui/compact/windowView.d.ts +50 -0
- package/dist/shared/assistant/ui/compact/windowView.js +31 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +6 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +90 -89
- package/dist/shared/assistant/ui/composer/AssistantModeMenu.d.ts +6 -0
- package/dist/shared/assistant/ui/composer/AssistantModeMenu.js +83 -83
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +31 -0
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +270 -166
- package/dist/shared/assistant/ui/voice/VoiceStage.d.ts +8 -0
- package/dist/shared/assistant/ui/voice/VoiceStage.js +10 -10
- package/dist/shared/assistant/voice/voiceStartedCue.d.ts +11 -0
- package/dist/shared/assistant/voice/voiceStartedCue.js +7 -0
- package/dist/shared-assistant.js +266 -262
- package/dist/ui/modal-shell.d.ts +6 -1
- package/dist/ui/modal-shell.js +7 -6
- package/package.json +1 -1
|
@@ -1,70 +1,77 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useAssistantControl as
|
|
3
|
-
import { useAssistantTr as
|
|
4
|
-
import { micIsInterrupt as
|
|
5
|
-
import { VOICE_THINKING_LABEL as a, composeVoiceStatus as
|
|
6
|
-
import { spokenSoFar as
|
|
7
|
-
import { useAvatarCopy as
|
|
8
|
-
import { ASSISTANT_PANEL_ATTR as
|
|
9
|
-
import { useLiveAvatarHandsFreeGuard as
|
|
10
|
-
import { AssistantAttachmentButton as
|
|
11
|
-
import { AssistantAttachmentChips as
|
|
12
|
-
import { AssistantVoiceOrb as
|
|
13
|
-
import { VoiceMiniController as
|
|
14
|
-
import { VoiceStage as
|
|
15
|
-
import { VoiceTranscriptDrawer as
|
|
16
|
-
import { escapeBelongsToLayerAbove as
|
|
17
|
-
import { HandsFreePrivacyNotice as
|
|
18
|
-
import { useCallback as
|
|
19
|
-
import { Maximize2 as
|
|
20
|
-
import { jsx as
|
|
1
|
+
import { focusWasDropped as e, useReturnFocus as t } from "../../../hooks/useReturnFocus.js";
|
|
2
|
+
import { useAssistantControl as n } from "../../appControls/useAssistantControl.js";
|
|
3
|
+
import { useAssistantTr as r } from "../../i18n.js";
|
|
4
|
+
import { micIsInterrupt as i, showsAssistantCaption as ee, voiceStageState as te } from "../../voice/voiceStageState.js";
|
|
5
|
+
import { VOICE_THINKING_LABEL as a, composeVoiceStatus as o, voiceStatusSuffix as s } from "../../voice/voiceStatus.js";
|
|
6
|
+
import { spokenSoFar as c } from "../../voice/voiceSession.js";
|
|
7
|
+
import { useAvatarCopy as l } from "../../avatar/useAvatarCopy.js";
|
|
8
|
+
import { ASSISTANT_PANEL_ATTR as ne, ASSISTANT_VOICE_SESSION_ATTR as re } from "../panelOverlays.js";
|
|
9
|
+
import { useLiveAvatarHandsFreeGuard as ie, useLiveAvatarTab as ae, useLiveAvatarVoiceView as oe } from "../assistantLiveAvatarSeam.js";
|
|
10
|
+
import { AssistantAttachmentButton as se } from "../composer/AssistantAttachmentButton.js";
|
|
11
|
+
import { AssistantAttachmentChips as ce } from "../composer/AssistantAttachmentChips.js";
|
|
12
|
+
import { AssistantVoiceOrb as le } from "./AssistantVoiceOrb.js";
|
|
13
|
+
import { VoiceMiniController as ue } from "./VoiceMiniController.js";
|
|
14
|
+
import { VoiceStage as de } from "./VoiceStage.js";
|
|
15
|
+
import { VoiceTranscriptDrawer as fe } from "./VoiceTranscriptDrawer.js";
|
|
16
|
+
import { escapeBelongsToLayerAbove as pe, voiceSessionEscapeAction as me } from "./voiceSessionEscape.js";
|
|
17
|
+
import { HandsFreePrivacyNotice as he } from "./HandsFreePrivacyNotice.js";
|
|
18
|
+
import { useCallback as ge, useEffect as u, useMemo as _e, useRef as d, useState as f } from "react";
|
|
19
|
+
import { Maximize2 as ve, Mic as ye, MicOff as be, Minimize2 as xe, ScrollText as Se, ShieldAlert as Ce, Square as we, X as p } from "lucide-react";
|
|
20
|
+
import { Fragment as Te, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
21
21
|
//#region src/shared/assistant/ui/voice/AssistantVoiceSession.tsx
|
|
22
|
-
var
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
var g = ({ session: g, turns: Oe = [], onSaveTranscript: Ae, onContinueInChat: je, notice: _ = null, privacyNotice: v = null, spoken: Me, onInterrupt: Ne, onToggleMute: y, attachments: Pe = [], onAttachFiles: b, onRemoveAttachment: Fe, onRetryAttachment: Ie, canAttachMore: Le = !0, preparingAttachments: Re = 0, attachmentsLocked: x = !1, attachmentNotice: S = null, spokenChunks: ze = null, onEnd: C, capturing: Be = !0, interrupting: Ve = !1, awaitingEndpoint: He = !1, holding: w = !1, correcting: Ue = !1, onLetMeFinish: We, onImDone: Ge, proposalChip: T = null, proposalTray: E = null, renderAfterTurn: Ke, onViewChange: qe, view: D, startedCue: O }) => {
|
|
23
|
+
let k = r(), { muted: A, error: j } = g, M = d(null), N = d(null), [Je, P] = f("mini"), Ye = D !== void 0, F = D === "compact", [I, Xe] = f(D);
|
|
24
|
+
I !== D && (Xe(D), D === void 0 && I !== void 0 && P(I === "compact" ? "panel" : I));
|
|
25
|
+
let Ze = D === void 0 ? Je : D === "compact" ? "panel" : D, L = ae().open, [Qe, $e] = f(L);
|
|
26
|
+
Qe !== L && ($e(L), L && Je !== "mini" && P("mini"));
|
|
27
|
+
let R = oe(Ze, g.phase === "ended"), et = ie();
|
|
28
|
+
u(() => {
|
|
29
|
+
qe?.(R);
|
|
30
|
+
}, [qe, R]);
|
|
31
|
+
let tt = l(), z = R === "full", B = R === "mini", V = R === "mini" ? "panel" : R === "panel" ? "full" : "mini", [H, U] = f(!1);
|
|
32
|
+
n("assistant.transcript", _e(() => ({ run: () => H ? { status: "already" } : (U(!0), { status: "done" }) }), [H]));
|
|
33
|
+
let W = E !== null && !B, G = d(!1), K = d(y);
|
|
34
|
+
K.current = y;
|
|
35
|
+
let q = ge(() => {
|
|
36
|
+
g.phase !== "listening" && g.phase !== "thinking" || A || G.current || c(g) || (G.current = !0, K.current());
|
|
37
|
+
}, [A, g]), J = ge(() => {
|
|
36
38
|
G.current && (G.current = !1, K.current());
|
|
37
|
-
}, []),
|
|
38
|
-
|
|
39
|
+
}, []), nt = q;
|
|
40
|
+
u(() => {
|
|
39
41
|
let e = () => {
|
|
40
42
|
document.visibilityState === "hidden" ? q() : J();
|
|
41
43
|
};
|
|
42
44
|
return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
|
|
43
|
-
}, [q, J]),
|
|
45
|
+
}, [q, J]), u(() => {
|
|
44
46
|
let e = J;
|
|
45
47
|
return window.addEventListener("focus", e), () => {
|
|
46
48
|
window.removeEventListener("focus", e), G.current = !1;
|
|
47
49
|
};
|
|
48
|
-
}, []),
|
|
49
|
-
document.activeElement?.closest("[data-hands-free-notice]") ||
|
|
50
|
-
}, []),
|
|
50
|
+
}, []), u(() => {
|
|
51
|
+
document.activeElement?.closest("[data-hands-free-notice]") || M.current?.focus();
|
|
52
|
+
}, []), t(N, { fallbackSelector: `[${ne}]` });
|
|
53
|
+
let rt = d(F);
|
|
54
|
+
u(() => {
|
|
55
|
+
let t = rt.current;
|
|
56
|
+
rt.current = F, !(!t || F || !e(document)) && (N.current?.querySelector("[data-testid=\"assistant-voice-transcript-close\"]") ?? M.current)?.focus({ preventScroll: !0 });
|
|
57
|
+
}, [F]), u(() => {
|
|
51
58
|
let e = (e) => {
|
|
52
59
|
if (e.key === "Escape") {
|
|
53
|
-
let t =
|
|
60
|
+
let t = me({
|
|
54
61
|
defaultPrevented: e.defaultPrevented,
|
|
55
|
-
layerAbove:
|
|
62
|
+
layerAbove: pe({
|
|
56
63
|
target: e.target,
|
|
57
|
-
session:
|
|
64
|
+
session: N.current,
|
|
58
65
|
doc: document
|
|
59
66
|
}),
|
|
60
67
|
transcriptOpen: H
|
|
61
68
|
});
|
|
62
69
|
if (t === "ignore") return;
|
|
63
|
-
e.preventDefault(), t === "close-transcript" ? U(!1) :
|
|
70
|
+
e.preventDefault(), t === "close-transcript" ? U(!1) : v ? v.decline() : W ? E?.onClose() : C();
|
|
64
71
|
return;
|
|
65
72
|
}
|
|
66
73
|
if (e.key !== "Tab" || !z) return;
|
|
67
|
-
let t = (H ?
|
|
74
|
+
let t = (H ? N.current?.querySelector("[data-testid=\"assistant-voice-transcript\"]") : N.current)?.querySelectorAll("button:not([disabled])");
|
|
68
75
|
if (!t || t.length === 0) return;
|
|
69
76
|
let n = t[0], r = t[t.length - 1];
|
|
70
77
|
!n || !r || (e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus()));
|
|
@@ -75,228 +82,325 @@ var f = ({ session: f, turns: m = [], onSaveTranscript: Ee, onContinueInChat: De
|
|
|
75
82
|
z,
|
|
76
83
|
H,
|
|
77
84
|
W,
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
E,
|
|
86
|
+
v
|
|
80
87
|
]);
|
|
81
|
-
let Y =
|
|
82
|
-
letMeFinish:
|
|
83
|
-
imDone:
|
|
84
|
-
} : null,
|
|
85
|
-
|
|
86
|
-
if (
|
|
88
|
+
let Y = _ !== null && j === null, X = et && _ === null && j === null, it = c(g), Z = We && Ge && g.phase === "listening" && !A && j === null ? {
|
|
89
|
+
letMeFinish: We,
|
|
90
|
+
imDone: Ge
|
|
91
|
+
} : null, at = Z !== null;
|
|
92
|
+
u(() => {
|
|
93
|
+
if (at) return;
|
|
87
94
|
let e = document.activeElement;
|
|
88
|
-
(!e || e === document.body) &&
|
|
89
|
-
}, [
|
|
90
|
-
let Q =
|
|
91
|
-
snapshot:
|
|
92
|
-
capturing:
|
|
93
|
-
interrupting:
|
|
94
|
-
awaitingEndpoint:
|
|
95
|
-
}),
|
|
95
|
+
(!e || e === document.body) && M.current?.focus();
|
|
96
|
+
}, [at]);
|
|
97
|
+
let Q = te({
|
|
98
|
+
snapshot: g,
|
|
99
|
+
capturing: Be,
|
|
100
|
+
interrupting: Ve,
|
|
101
|
+
awaitingEndpoint: He
|
|
102
|
+
}), ot = (() => {
|
|
96
103
|
switch (Q) {
|
|
97
|
-
case "connecting": return
|
|
98
|
-
case "endpoint-grace": return
|
|
99
|
-
case "interrupting": return
|
|
100
|
-
case "thinking": return
|
|
101
|
-
case "speaking": return
|
|
104
|
+
case "connecting": return k("voiceSession.connecting", "Starting the microphone…");
|
|
105
|
+
case "endpoint-grace": return k("voiceSession.endpointGrace", "Still listening — take your time");
|
|
106
|
+
case "interrupting": return k("voiceSession.interrupting", "Stopped — go ahead");
|
|
107
|
+
case "thinking": return k(a.key, a.fallback);
|
|
108
|
+
case "speaking": return k("voiceSession.speaking", "Speaking — tap to stop");
|
|
102
109
|
case "mic-error":
|
|
103
110
|
case "ended": return "";
|
|
104
|
-
case "listening": return
|
|
111
|
+
case "listening": return A ? k("voiceSession.muted", "Microphone off") : k("voiceSession.listening", "Listening…");
|
|
105
112
|
default: return Q;
|
|
106
113
|
}
|
|
107
|
-
})(),
|
|
108
|
-
tr:
|
|
114
|
+
})(), st = !A && (Q === "listening" || Q === "endpoint-grace"), ct = st && w ? k("voiceSession.holding", "Take your time — tap “I’m done” when you finish") : st && Ue ? k("voiceSession.correcting", "Stopped that answer — listening to your correction") : ot, $ = s({
|
|
115
|
+
tr: k,
|
|
109
116
|
stage: Q,
|
|
110
|
-
muted:
|
|
111
|
-
label:
|
|
112
|
-
}),
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
ref:
|
|
115
|
-
className: `flex flex-col items-center justify-between bg-bg-sunken ${
|
|
117
|
+
muted: A,
|
|
118
|
+
label: ct
|
|
119
|
+
}), lt = o(ct, $), ut = Q === "thinking";
|
|
120
|
+
return /* @__PURE__ */ h("div", {
|
|
121
|
+
ref: N,
|
|
122
|
+
className: `flex flex-col ${F ? "items-stretch" : "items-center"} justify-between ${F ? "bg-bg-elevated" : "bg-bg-sunken"} ${F ? "absolute inset-0 z-20 px-3 pb-3 pt-2" : R === "full" ? "fixed inset-x-0 bottom-0 top-14 z-[60] px-6 py-8" : R === "panel" ? "absolute inset-0 z-20 px-4 py-6" : "absolute inset-x-0 bottom-0 z-20 min-h-[11.25rem] border-t border-border-subtle px-3 py-3 shadow-lg"}`,
|
|
116
123
|
role: "dialog",
|
|
117
124
|
"aria-modal": z || void 0,
|
|
118
|
-
"aria-label":
|
|
125
|
+
"aria-label": k("voiceSession.title", "Voice conversation"),
|
|
119
126
|
"data-testid": "assistant-voice-session",
|
|
120
|
-
[
|
|
127
|
+
[re]: "",
|
|
121
128
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
ref:
|
|
129
|
+
F ? null : /* @__PURE__ */ h("button", {
|
|
130
|
+
ref: M,
|
|
124
131
|
type: "button",
|
|
125
132
|
onClick: C,
|
|
126
133
|
className: `absolute ${z ? "right-6 top-6 h-14 gap-2 px-5 text-base" : B ? "right-12 top-2 h-8 gap-1.5 px-2.5 text-xs" : "right-3 top-3 h-11 gap-2 px-4 text-sm"} flex items-center justify-center rounded-full border border-border-default bg-bg-elevated text-text-secondary hover:bg-bg-sunken transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
|
|
127
|
-
title:
|
|
134
|
+
title: k("voiceSession.end", "End the voice conversation"),
|
|
128
135
|
"data-testid": "assistant-voice-end",
|
|
129
|
-
children: [/* @__PURE__ */
|
|
136
|
+
children: [/* @__PURE__ */ m(p, {
|
|
130
137
|
className: z ? "size-6" : B ? "size-4" : "size-5",
|
|
131
138
|
"aria-hidden": "true"
|
|
132
|
-
}), /* @__PURE__ */
|
|
139
|
+
}), /* @__PURE__ */ m("span", {
|
|
133
140
|
className: `truncate whitespace-nowrap font-medium ${B ? "max-w-[3.5rem] text-xs" : "max-w-[7rem]"}`,
|
|
134
|
-
children:
|
|
141
|
+
children: k("voiceSession.endShort", "End")
|
|
135
142
|
})]
|
|
136
143
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
className: `flex flex-col items-center ${B ? `px-3 ${Y || X ||
|
|
144
|
+
/* @__PURE__ */ h("div", {
|
|
145
|
+
className: `flex flex-col items-center ${F ? "min-h-[1.5rem]" : B ? `px-3 ${Y || X || S ? "pt-9 pb-2" : ""}` : `min-h-[1.5rem] ${Y || X || S ? z ? "pt-14" : "pt-10" : ""}`}`,
|
|
139
146
|
children: [
|
|
140
|
-
Y ? /* @__PURE__ */
|
|
147
|
+
Y ? /* @__PURE__ */ m("p", {
|
|
141
148
|
className: "max-w-xs text-center text-xs text-status-warning",
|
|
142
149
|
"data-testid": "assistant-voice-notice",
|
|
143
|
-
children:
|
|
150
|
+
children: Ee(_, k)
|
|
144
151
|
}) : null,
|
|
145
|
-
X ? /* @__PURE__ */
|
|
152
|
+
X ? /* @__PURE__ */ m("p", {
|
|
146
153
|
className: "max-w-xs text-center text-xs text-text-secondary",
|
|
147
154
|
"data-testid": "assistant-voice-avatar-hands-free",
|
|
148
|
-
children:
|
|
155
|
+
children: tt.handsFreeOff
|
|
149
156
|
}) : null,
|
|
150
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ m("span", {
|
|
151
158
|
className: "sr-only start-0 top-0",
|
|
152
159
|
role: "status",
|
|
153
160
|
"aria-live": "polite",
|
|
154
161
|
"aria-atomic": "true",
|
|
155
162
|
"data-testid": "assistant-voice-notice-announced",
|
|
156
|
-
children: Y &&
|
|
163
|
+
children: Y && De(_) ? Ee(_, k) : X ? tt.handsFreeOff : null
|
|
157
164
|
}),
|
|
158
|
-
|
|
165
|
+
S ? /* @__PURE__ */ m("p", {
|
|
159
166
|
className: "max-w-xs text-center text-xs text-status-warning",
|
|
160
167
|
role: "status",
|
|
161
168
|
"aria-live": "polite",
|
|
162
169
|
"data-testid": "assistant-voice-attachment-notice",
|
|
163
|
-
children:
|
|
164
|
-
}) : null
|
|
170
|
+
children: S
|
|
171
|
+
}) : null,
|
|
172
|
+
O === void 0 ? null : /* @__PURE__ */ h(Te, { children: [O ? /* @__PURE__ */ m("p", {
|
|
173
|
+
className: "max-w-xs text-center text-xs text-text-secondary",
|
|
174
|
+
"data-testid": "assistant-voice-started-cue",
|
|
175
|
+
children: O
|
|
176
|
+
}) : null, /* @__PURE__ */ m("span", {
|
|
177
|
+
className: "sr-only start-0 top-0",
|
|
178
|
+
role: "status",
|
|
179
|
+
"aria-live": "polite",
|
|
180
|
+
"aria-atomic": "true",
|
|
181
|
+
"data-testid": "assistant-voice-started-cue-announced",
|
|
182
|
+
children: O
|
|
183
|
+
})] })
|
|
165
184
|
]
|
|
166
185
|
}),
|
|
167
186
|
(() => {
|
|
168
|
-
let e = /* @__PURE__ */
|
|
169
|
-
session:
|
|
187
|
+
let e = /* @__PURE__ */ m(le, {
|
|
188
|
+
session: g,
|
|
170
189
|
compact: B,
|
|
171
190
|
connecting: Q === "connecting",
|
|
172
|
-
onPress:
|
|
173
|
-
label:
|
|
174
|
-
}), t = Z ? /* @__PURE__ */
|
|
191
|
+
onPress: i(Q) ? Ne : y,
|
|
192
|
+
label: i(Q) ? k("voiceSession.interrupt", "Stop the assistant and speak") : A ? k("voiceSession.unmute", "Turn the microphone on") : k("voiceSession.mute", "Turn the microphone off")
|
|
193
|
+
}), t = Z ? /* @__PURE__ */ m("button", {
|
|
175
194
|
type: "button",
|
|
176
195
|
onClick: w ? Z.imDone : Z.letMeFinish,
|
|
177
196
|
className: `flex items-center justify-center rounded-full border font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${B ? "h-7 px-3 text-xs" : z ? "h-11 px-6 text-base" : "h-9 px-4 text-sm"} ${w ? "border-transparent bg-action-primary-bg text-action-primary-text hover:opacity-90" : "border-border-default bg-bg-elevated text-text-secondary hover:bg-bg-sunken"}`,
|
|
178
|
-
title: w ?
|
|
197
|
+
title: w ? k("voiceSession.imDoneHint", "Send what you said now") : k("voiceSession.letMeFinishHint", "Pause sending until you tap “I’m done”"),
|
|
179
198
|
"data-testid": "assistant-voice-hold",
|
|
180
199
|
"data-holding": w ? "true" : "false",
|
|
181
|
-
children: w ?
|
|
182
|
-
}) : null, n =
|
|
200
|
+
children: w ? k("voiceSession.imDone", "I’m done") : k("voiceSession.letMeFinish", "Let me finish")
|
|
201
|
+
}) : null, n = i(Q), r = n ? Ne : y, te = g.phase === "idle" || g.phase === "ended" || j !== null || Q === "connecting" || !r, a = F ? /* @__PURE__ */ h("button", {
|
|
202
|
+
type: "button",
|
|
203
|
+
onClick: r,
|
|
204
|
+
disabled: te,
|
|
205
|
+
className: "flex h-11 items-center justify-center gap-2 rounded-full border border-border-default bg-bg-elevated px-6 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:cursor-default disabled:text-text-muted disabled:hover:bg-bg-elevated",
|
|
206
|
+
"data-testid": "assistant-voice-primary",
|
|
207
|
+
"data-state": Q,
|
|
208
|
+
"data-muted": A || void 0,
|
|
209
|
+
children: [n ? /* @__PURE__ */ m(we, {
|
|
210
|
+
className: "size-4 fill-current",
|
|
211
|
+
"aria-hidden": "true"
|
|
212
|
+
}) : m(A ? be : ye, {
|
|
213
|
+
className: "size-4",
|
|
214
|
+
"aria-hidden": "true"
|
|
215
|
+
}), n ? k("window.stopSpeaking", "Stop speaking") : A ? k("window.unmute", "Unmute") : k("window.mute", "Mute")]
|
|
216
|
+
}) : null, o = t ? /* @__PURE__ */ h("div", {
|
|
183
217
|
className: "flex flex-col items-center gap-2",
|
|
184
218
|
children: [e, t]
|
|
185
|
-
}) : e,
|
|
186
|
-
|
|
187
|
-
|
|
219
|
+
}) : e, s = F ? /* @__PURE__ */ h("div", {
|
|
220
|
+
className: "flex flex-col items-center gap-2",
|
|
221
|
+
children: [t, a]
|
|
222
|
+
}) : void 0, c = ee(Q) ? Me : it || null, l = j === null ? null : ke(j, k);
|
|
223
|
+
return B ? /* @__PURE__ */ m(ue, {
|
|
224
|
+
spokenChunks: ze,
|
|
188
225
|
state: Q,
|
|
189
|
-
caption:
|
|
190
|
-
statusText:
|
|
226
|
+
caption: c,
|
|
227
|
+
statusText: lt,
|
|
191
228
|
statusSuffix: $,
|
|
192
|
-
rotateStatus:
|
|
193
|
-
errorText:
|
|
194
|
-
control:
|
|
195
|
-
}) : /* @__PURE__ */
|
|
229
|
+
rotateStatus: ut,
|
|
230
|
+
errorText: l,
|
|
231
|
+
control: o
|
|
232
|
+
}) : /* @__PURE__ */ m(de, {
|
|
196
233
|
state: Q,
|
|
197
|
-
userCaption:
|
|
198
|
-
spokenChunks:
|
|
199
|
-
assistantCaption:
|
|
234
|
+
userCaption: it || null,
|
|
235
|
+
spokenChunks: ze,
|
|
236
|
+
assistantCaption: Me,
|
|
200
237
|
expanded: z,
|
|
201
|
-
statusText:
|
|
238
|
+
statusText: lt,
|
|
202
239
|
statusSuffix: $,
|
|
203
|
-
rotateStatus:
|
|
204
|
-
errorText:
|
|
205
|
-
control:
|
|
240
|
+
rotateStatus: ut,
|
|
241
|
+
errorText: l,
|
|
242
|
+
control: o,
|
|
243
|
+
compact: F || void 0,
|
|
244
|
+
compactControl: s
|
|
206
245
|
});
|
|
207
246
|
})(),
|
|
208
|
-
|
|
247
|
+
T && !W && !F ? /* @__PURE__ */ m("div", {
|
|
209
248
|
className: B ? "absolute left-20 right-36 top-2 flex justify-center" : `flex w-full justify-center ${z ? "max-w-[calc(100%-12rem)]" : "max-w-[calc(100%-8rem)]"}`,
|
|
210
|
-
children: /* @__PURE__ */
|
|
249
|
+
children: /* @__PURE__ */ m("button", {
|
|
211
250
|
type: "button",
|
|
212
251
|
onClick: () => {
|
|
213
|
-
|
|
252
|
+
P("panel"), T.onOpen();
|
|
214
253
|
},
|
|
215
254
|
className: `max-w-full truncate rounded-full border border-border-default bg-bg-elevated font-medium text-text-primary transition-colors hover:bg-bg-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${B ? "h-8 px-3 text-xs" : "h-10 px-4 text-sm"}`,
|
|
216
255
|
"data-testid": "assistant-voice-proposal-chip",
|
|
217
|
-
children:
|
|
256
|
+
children: T.label
|
|
218
257
|
})
|
|
219
258
|
}) : null,
|
|
220
|
-
|
|
259
|
+
T && F ? /* @__PURE__ */ h("div", {
|
|
260
|
+
className: "flex min-h-11 w-full items-center gap-2 rounded-xl border border-status-warning bg-status-warning/10 px-3 py-1",
|
|
261
|
+
"data-testid": "assistant-voice-proposal-chip-row",
|
|
262
|
+
children: [
|
|
263
|
+
/* @__PURE__ */ m(Ce, {
|
|
264
|
+
className: "size-4 shrink-0 text-status-warning",
|
|
265
|
+
"aria-hidden": "true"
|
|
266
|
+
}),
|
|
267
|
+
T.status ? /* @__PURE__ */ m("p", {
|
|
268
|
+
role: "status",
|
|
269
|
+
"aria-live": "polite",
|
|
270
|
+
className: "min-w-0 flex-1 text-sm text-text-primary",
|
|
271
|
+
"data-testid": "assistant-voice-proposal-status",
|
|
272
|
+
children: T.status
|
|
273
|
+
}) : /* @__PURE__ */ m("span", { className: "flex-1" }),
|
|
274
|
+
/* @__PURE__ */ m("button", {
|
|
275
|
+
type: "button",
|
|
276
|
+
onClick: T.onOpen,
|
|
277
|
+
className: "min-h-9 shrink-0 rounded-button px-3 text-sm font-medium text-action-primary-bg transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
278
|
+
"data-testid": "assistant-voice-proposal-chip",
|
|
279
|
+
children: T.label
|
|
280
|
+
})
|
|
281
|
+
]
|
|
282
|
+
}) : null,
|
|
283
|
+
E && W ? /* @__PURE__ */ h("div", {
|
|
221
284
|
className: `absolute z-10 flex flex-col gap-2 overflow-y-auto rounded-lg border border-border-subtle bg-bg-elevated shadow-lg ${z ? "inset-x-6 bottom-24 top-24 mx-auto max-w-xl p-4" : "inset-x-3 bottom-16 top-16 p-3"}`,
|
|
222
285
|
"data-testid": "assistant-voice-proposal-tray",
|
|
223
|
-
children: [/* @__PURE__ */
|
|
286
|
+
children: [/* @__PURE__ */ m("div", {
|
|
224
287
|
className: "flex justify-end",
|
|
225
|
-
children: /* @__PURE__ */
|
|
288
|
+
children: /* @__PURE__ */ m("button", {
|
|
226
289
|
type: "button",
|
|
227
|
-
onClick:
|
|
290
|
+
onClick: E.onClose,
|
|
228
291
|
className: "flex size-8 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
229
|
-
"aria-label":
|
|
292
|
+
"aria-label": E.closeLabel,
|
|
230
293
|
"data-testid": "assistant-voice-proposal-tray-close",
|
|
231
|
-
children: /* @__PURE__ */
|
|
294
|
+
children: /* @__PURE__ */ m(p, {
|
|
232
295
|
className: "size-4",
|
|
233
296
|
"aria-hidden": "true"
|
|
234
297
|
})
|
|
235
298
|
})
|
|
236
|
-
}),
|
|
299
|
+
}), E.content]
|
|
237
300
|
}) : null,
|
|
238
|
-
|
|
239
|
-
view:
|
|
240
|
-
onContinue:
|
|
241
|
-
onNotNow:
|
|
301
|
+
v ? /* @__PURE__ */ m(he, {
|
|
302
|
+
view: R,
|
|
303
|
+
onContinue: v.accept,
|
|
304
|
+
onNotNow: v.decline
|
|
242
305
|
}) : null,
|
|
243
|
-
H ? /* @__PURE__ */
|
|
244
|
-
turns:
|
|
306
|
+
H ? /* @__PURE__ */ m(fe, {
|
|
307
|
+
turns: Oe,
|
|
245
308
|
onClose: () => U(!1),
|
|
246
|
-
onSave:
|
|
247
|
-
onContinueInChat:
|
|
248
|
-
renderAfterTurn:
|
|
309
|
+
onSave: Ae,
|
|
310
|
+
onContinueInChat: je,
|
|
311
|
+
renderAfterTurn: Ke
|
|
249
312
|
}) : null,
|
|
250
|
-
|
|
313
|
+
b && !F ? /* @__PURE__ */ m("div", {
|
|
251
314
|
className: `absolute ${z ? "left-6 top-6" : B ? "left-11 top-2" : "left-3 top-3"}`,
|
|
252
|
-
children: /* @__PURE__ */
|
|
315
|
+
children: /* @__PURE__ */ m(se, {
|
|
253
316
|
onFiles: (e) => {
|
|
254
|
-
|
|
317
|
+
b(e), Ye || P((e) => e === "mini" ? "panel" : e);
|
|
255
318
|
},
|
|
256
|
-
onPickerOpen:
|
|
319
|
+
onPickerOpen: nt,
|
|
257
320
|
direction: "down",
|
|
258
|
-
canAddMore:
|
|
259
|
-
disabled:
|
|
321
|
+
canAddMore: Le,
|
|
322
|
+
disabled: x
|
|
260
323
|
})
|
|
261
324
|
}) : null,
|
|
262
|
-
(
|
|
263
|
-
className: `absolute ${z ? "bottom-24 left-24 right-24" : "bottom-16 left-16 right-16"}`,
|
|
325
|
+
(Pe.length > 0 || Re > 0) && !B ? /* @__PURE__ */ m("div", {
|
|
326
|
+
className: F ? "w-full" : `absolute ${z ? "bottom-24 left-24 right-24" : "bottom-16 left-16 right-16"}`,
|
|
264
327
|
"data-testid": "assistant-voice-attachments",
|
|
265
|
-
children: /* @__PURE__ */
|
|
266
|
-
attachments:
|
|
267
|
-
onRemove:
|
|
268
|
-
onRetry:
|
|
269
|
-
preparingCount:
|
|
270
|
-
disabled:
|
|
328
|
+
children: /* @__PURE__ */ m(ce, {
|
|
329
|
+
attachments: Pe,
|
|
330
|
+
onRemove: Fe ?? (() => void 0),
|
|
331
|
+
onRetry: Ie ?? (() => void 0),
|
|
332
|
+
preparingCount: Re,
|
|
333
|
+
disabled: x
|
|
271
334
|
})
|
|
272
335
|
}) : null,
|
|
273
|
-
/* @__PURE__ */
|
|
336
|
+
F ? null : /* @__PURE__ */ m("button", {
|
|
274
337
|
type: "button",
|
|
275
338
|
onClick: () => U((e) => !e),
|
|
276
339
|
className: `absolute ${z ? "bottom-6 right-6 size-14" : B ? "right-2 top-2 size-8" : "bottom-3 right-3 size-11"} flex items-center justify-center rounded-full bg-bg-elevated text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
|
|
277
340
|
"aria-pressed": H,
|
|
278
|
-
"aria-label":
|
|
341
|
+
"aria-label": k("voiceSession.transcriptTitle", "Voice transcript"),
|
|
279
342
|
"data-testid": "assistant-voice-transcript-toggle",
|
|
280
|
-
children: /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ m(Se, { className: z ? "size-6" : B ? "size-4" : "size-5" })
|
|
281
344
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
345
|
+
Ye ? null : /* @__PURE__ */ m("button", {
|
|
283
346
|
type: "button",
|
|
284
|
-
onClick: () =>
|
|
347
|
+
onClick: () => P(V),
|
|
285
348
|
className: `absolute ${z ? "bottom-6 left-6 size-14" : B ? "left-2 top-2 size-8" : "bottom-3 left-3 size-11"} flex items-center justify-center rounded-full bg-bg-elevated text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
|
|
286
|
-
"aria-label": V === "panel" ?
|
|
349
|
+
"aria-label": V === "panel" ? k("voiceSession.expandPanel", "Show the conversation in the panel") : V === "full" ? k("voiceSession.expand", "Expand the conversation to full screen") : k("voiceSession.collapse", "Shrink to the compact controller"),
|
|
287
350
|
"data-testid": "assistant-voice-expand",
|
|
288
|
-
children: z ? /* @__PURE__ */
|
|
289
|
-
})
|
|
351
|
+
children: z ? /* @__PURE__ */ m(xe, { className: "size-5" }) : /* @__PURE__ */ m(ve, { className: B ? "size-4" : "size-5" })
|
|
352
|
+
}),
|
|
353
|
+
F ? /* @__PURE__ */ h("div", {
|
|
354
|
+
className: "flex w-full items-center gap-2 pt-2",
|
|
355
|
+
"data-testid": "assistant-voice-controls",
|
|
356
|
+
children: [
|
|
357
|
+
b ? /* @__PURE__ */ m(se, {
|
|
358
|
+
onFiles: (e) => b(e),
|
|
359
|
+
onPickerOpen: nt,
|
|
360
|
+
direction: "up",
|
|
361
|
+
canAddMore: Le,
|
|
362
|
+
disabled: x
|
|
363
|
+
}) : null,
|
|
364
|
+
/* @__PURE__ */ h("button", {
|
|
365
|
+
type: "button",
|
|
366
|
+
onClick: () => U((e) => !e),
|
|
367
|
+
className: "flex h-10 min-w-0 flex-1 items-center justify-center gap-2 rounded-full border border-border-default bg-bg-elevated px-3 text-sm text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
368
|
+
"aria-expanded": H,
|
|
369
|
+
"data-testid": "assistant-voice-transcript-toggle",
|
|
370
|
+
children: [/* @__PURE__ */ m(Se, {
|
|
371
|
+
className: "size-4 shrink-0",
|
|
372
|
+
"aria-hidden": "true"
|
|
373
|
+
}), /* @__PURE__ */ m("span", {
|
|
374
|
+
className: "truncate",
|
|
375
|
+
children: H ? k("window.hideTranscript", "Hide transcript") : k("window.showTranscript", "Show transcript")
|
|
376
|
+
})]
|
|
377
|
+
}),
|
|
378
|
+
/* @__PURE__ */ h("button", {
|
|
379
|
+
ref: M,
|
|
380
|
+
type: "button",
|
|
381
|
+
onClick: C,
|
|
382
|
+
className: "flex h-10 min-w-0 flex-1 items-center justify-center gap-2 rounded-full border border-status-error-border bg-status-error-bg-subtle px-3 text-sm font-medium text-status-error-text transition-colors hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
383
|
+
"data-testid": "assistant-voice-end",
|
|
384
|
+
children: [/* @__PURE__ */ m(p, {
|
|
385
|
+
className: "size-4 shrink-0",
|
|
386
|
+
"aria-hidden": "true"
|
|
387
|
+
}), /* @__PURE__ */ m("span", {
|
|
388
|
+
className: "truncate",
|
|
389
|
+
children: k("window.endVoice", "End voice")
|
|
390
|
+
})]
|
|
391
|
+
})
|
|
392
|
+
]
|
|
393
|
+
}) : null
|
|
290
394
|
]
|
|
291
395
|
});
|
|
292
396
|
};
|
|
293
|
-
function
|
|
294
|
-
return typeof e == "string" ?
|
|
397
|
+
function Ee(e, t) {
|
|
398
|
+
return typeof e == "string" ? Oe(e, t) : e.text;
|
|
295
399
|
}
|
|
296
|
-
function
|
|
400
|
+
function De(e) {
|
|
297
401
|
return e !== null && (typeof e != "string" || e === "reply-not-heard");
|
|
298
402
|
}
|
|
299
|
-
function
|
|
403
|
+
function Oe(e, t) {
|
|
300
404
|
switch (e) {
|
|
301
405
|
case "network": return t("voiceSession.noticeNetwork", "Speech recognition lost its connection. Check your network — it will retry.");
|
|
302
406
|
case "not-capturing": return t("voiceSession.noticeNotCapturing", "The microphone did not start. Check that this site is allowed to use it, then try again.");
|
|
@@ -308,7 +412,7 @@ function m(e, t) {
|
|
|
308
412
|
default: return e;
|
|
309
413
|
}
|
|
310
414
|
}
|
|
311
|
-
function
|
|
415
|
+
function ke(e, t) {
|
|
312
416
|
switch (e) {
|
|
313
417
|
case "mic-denied": return t("voiceSession.micDenied", "Microphone access is blocked. Allow it in your browser settings to talk.");
|
|
314
418
|
case "no-speech-support": return t("voiceSession.noSpeechSupport", "This browser cannot listen. Try a different browser, or type instead.");
|
|
@@ -317,4 +421,4 @@ function Te(e, t) {
|
|
|
317
421
|
}
|
|
318
422
|
}
|
|
319
423
|
//#endregion
|
|
320
|
-
export {
|
|
424
|
+
export { g as AssistantVoiceSession };
|
|
@@ -48,6 +48,14 @@ interface Props {
|
|
|
48
48
|
chunks: string[];
|
|
49
49
|
index: number;
|
|
50
50
|
} | null;
|
|
51
|
+
/**
|
|
52
|
+
* BOFF-10180: the Quick assistant window's stage. Nothing sits in its corners, so
|
|
53
|
+
* the side reserve the docked and full stages keep for them is not kept: the
|
|
54
|
+
* column is the whole 360 px less its padding. Absent: as before.
|
|
55
|
+
*/
|
|
56
|
+
compact?: boolean;
|
|
57
|
+
/** With `compact`: the control drawn in place of `control` (named buttons, not the orb). */
|
|
58
|
+
compactControl?: ReactNode;
|
|
51
59
|
}
|
|
52
60
|
export declare const VoiceStage: FC<Props>;
|
|
53
61
|
export {};
|