@burdenoff/fe-libs 2026.1115.11 → 2026.1115.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/assistant/index.d.ts +1 -0
- package/dist/shared/assistant/ui/AssistantAvatar.js +18 -14
- package/dist/shared/assistant/ui/AssistantChatArea.js +1 -0
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +5 -0
- package/dist/shared/assistant/ui/AssistantMessageItem.js +57 -56
- package/dist/shared/assistant/ui/AssistantMessageList.js +57 -44
- package/dist/shared/assistant/ui/AssistantTurnActivity.d.ts +2 -0
- package/dist/shared/assistant/ui/AssistantTurnActivity.js +20 -17
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +5 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +348 -343
- package/dist/shared/assistant/ui/composer/AssistantDictation.js +57 -56
- package/dist/shared/assistant/ui/composer/pageBoxClass.d.ts +13 -0
- package/dist/shared/assistant/ui/composer/pageBoxClass.js +5 -0
- package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.js +41 -35
- package/dist/shared/assistant/ui/voice/AssistantVoiceSessionButton.js +13 -12
- package/dist/shared/assistant/ui/voice/LiveWaveform.js +28 -27
- package/dist/shared/providers/shell/ProfileI18nBridge.js +40 -45
- package/dist/shared/providers/shell/exportedDictionary.d.ts +35 -0
- package/dist/shared/providers/shell/exportedDictionary.js +68 -0
- package/dist/shared/utils/backendErrors.js +2 -1
- package/dist/shared-assistant.js +254 -253
- package/package.json +1 -1
- package/src/shared/styles/app-shell.css +5 -0
- package/src/shared/tokens/build/semantic.css +12 -0
- package/src/shared/tokens/build/tailwind.preset.js +5 -0
- package/src/shared/tokens/build/themes.css +14 -0
- package/src/shared/tokens/tokens.css +268 -0
|
@@ -1,121 +1,122 @@
|
|
|
1
1
|
import { useAssistantTr as e } from "../../i18n.js";
|
|
2
2
|
import { usePrefersReducedMotion as t } from "../usePrefersReducedMotion.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { useAssistantPageLayout as n } from "../assistantPageLayout.js";
|
|
4
|
+
import { focusWasDropped as r } from "../../../hooks/useReturnFocus.js";
|
|
5
|
+
import { formatClock as i } from "../voice/formatClock.js";
|
|
6
|
+
import { LiveWaveform as a } from "../voice/LiveWaveform.js";
|
|
7
|
+
import { useEffect as o, useRef as s } from "react";
|
|
8
|
+
import { Check as c, Loader2 as l, X as u } from "lucide-react";
|
|
9
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
10
|
// src/shared/assistant/ui/composer/AssistantDictation.tsx
|
|
10
|
-
var
|
|
11
|
+
var p = ({ phase: t, before: n, take: r, interim: i, after: a }) => {
|
|
11
12
|
let o = e(), s = r || i;
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ f("div", {
|
|
13
14
|
className: `min-h-10 whitespace-pre-wrap break-words px-4 pb-1 pt-3 text-base leading-6 ${t === "transcribing" ? "text-text-muted" : "text-text-primary"}`,
|
|
14
15
|
"data-testid": "assistant-dictation-text",
|
|
15
16
|
"data-phase": t,
|
|
16
17
|
children: [
|
|
17
|
-
n ? /* @__PURE__ */
|
|
18
|
-
r ? /* @__PURE__ */
|
|
18
|
+
n ? /* @__PURE__ */ f("span", { children: [n.replace(/\s+$/, ""), " "] }) : null,
|
|
19
|
+
r ? /* @__PURE__ */ d("span", {
|
|
19
20
|
"data-testid": "assistant-dictation-take",
|
|
20
21
|
children: r
|
|
21
22
|
}) : null,
|
|
22
|
-
i ? /* @__PURE__ */
|
|
23
|
+
i ? /* @__PURE__ */ f("span", {
|
|
23
24
|
className: "text-text-muted",
|
|
24
25
|
"data-testid": "assistant-dictation-interim",
|
|
25
26
|
children: [r ? " " : "", i]
|
|
26
27
|
}) : null,
|
|
27
|
-
!s && t !== "transcribing" ? /* @__PURE__ */
|
|
28
|
+
!s && t !== "transcribing" ? /* @__PURE__ */ d("span", {
|
|
28
29
|
className: "text-text-muted",
|
|
29
30
|
"data-testid": "assistant-dictation-prompt",
|
|
30
31
|
children: t === "starting" ? o("voice.starting", "Starting the microphone…") : o("dictation.startSpeaking", "Listening. Start speaking.")
|
|
31
32
|
}) : null,
|
|
32
|
-
a ? /* @__PURE__ */
|
|
33
|
+
a ? /* @__PURE__ */ f("span", { children: [" ", a.replace(/^\s+/, "")] }) : null
|
|
33
34
|
]
|
|
34
35
|
});
|
|
35
|
-
},
|
|
36
|
-
let
|
|
37
|
-
return
|
|
36
|
+
}, m = ({ phase: r, seconds: i, level: a, onCancel: o, onFinish: s, focusRing: c }) => {
|
|
37
|
+
let u = e(), p = t(), m = n();
|
|
38
|
+
return r === "transcribing" ? /* @__PURE__ */ f("div", {
|
|
38
39
|
role: "status",
|
|
39
40
|
className: "flex h-11 items-center gap-2.5 px-3 pb-1.5 text-sm text-text-secondary sm:h-10",
|
|
40
41
|
"data-testid": "assistant-composer-controls",
|
|
41
42
|
"data-dictating": "transcribing",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
43
|
-
className: `size-4 text-status-warning-bg${
|
|
43
|
+
children: [/* @__PURE__ */ d(l, {
|
|
44
|
+
className: `size-4 text-status-warning-bg${m ? " boff-text-listening" : ""}${p ? "" : " motion-safe:animate-spin"}`,
|
|
44
45
|
"aria-hidden": "true"
|
|
45
|
-
}), /* @__PURE__ */
|
|
46
|
-
}) : /* @__PURE__ */
|
|
47
|
-
listening:
|
|
48
|
-
seconds:
|
|
49
|
-
level:
|
|
50
|
-
onCancel:
|
|
51
|
-
onFinish:
|
|
52
|
-
focusRing:
|
|
46
|
+
}), /* @__PURE__ */ d("span", { children: u("dictation.transcribing", "Turning speech into text") })]
|
|
47
|
+
}) : /* @__PURE__ */ d(h, {
|
|
48
|
+
listening: r === "listening",
|
|
49
|
+
seconds: i,
|
|
50
|
+
level: a,
|
|
51
|
+
onCancel: o,
|
|
52
|
+
onFinish: s,
|
|
53
|
+
focusRing: c
|
|
53
54
|
});
|
|
54
|
-
},
|
|
55
|
-
let
|
|
56
|
-
return
|
|
57
|
-
typeof document < "u" &&
|
|
58
|
-
}, []), /* @__PURE__ */
|
|
55
|
+
}, h = ({ listening: t, seconds: l, level: p, onCancel: m, onFinish: h, focusRing: g }) => {
|
|
56
|
+
let _ = e(), v = n(), y = s(null);
|
|
57
|
+
return o(() => {
|
|
58
|
+
typeof document < "u" && r(document) && y.current?.focus();
|
|
59
|
+
}, []), /* @__PURE__ */ f("div", {
|
|
59
60
|
className: "flex flex-nowrap items-center gap-2 px-1.5 pb-1.5 pt-1",
|
|
60
61
|
"data-testid": "assistant-composer-controls",
|
|
61
62
|
"data-dictating": "true",
|
|
62
63
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ d("span", {
|
|
64
65
|
"aria-hidden": "true",
|
|
65
|
-
className: `ms-2.5 size-2.5 shrink-0 rounded-full ${t ?
|
|
66
|
+
className: `ms-2.5 size-2.5 shrink-0 rounded-full ${t ? `bg-status-warning-bg${v ? " boff-bg-listening" : ""}` : "bg-text-muted"}`,
|
|
66
67
|
"data-testid": "assistant-dictation-dot"
|
|
67
68
|
}),
|
|
68
|
-
t ? /* @__PURE__ */
|
|
69
|
-
source:
|
|
69
|
+
t ? /* @__PURE__ */ d(a, {
|
|
70
|
+
source: p,
|
|
70
71
|
tone: "listening",
|
|
71
72
|
className: "h-8 min-w-0 flex-1",
|
|
72
73
|
testId: "assistant-dictation-waveform"
|
|
73
|
-
}) : /* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
}) : /* @__PURE__ */ d("span", { className: "min-w-0 flex-1" }),
|
|
75
|
+
/* @__PURE__ */ d("span", {
|
|
75
76
|
className: "shrink-0 text-xs tabular-nums text-text-secondary",
|
|
76
77
|
"aria-hidden": "true",
|
|
77
78
|
"data-testid": "assistant-dictation-time",
|
|
78
|
-
children:
|
|
79
|
+
children: i(l)
|
|
79
80
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
ref:
|
|
81
|
+
/* @__PURE__ */ d("button", {
|
|
82
|
+
ref: y,
|
|
82
83
|
type: "button",
|
|
83
|
-
onClick:
|
|
84
|
-
className: `flex size-11 shrink-0 items-center justify-center rounded-full border border-border-default text-text-primary transition-colors hover:bg-bg-sunken sm:size-10 ${
|
|
85
|
-
"aria-label":
|
|
86
|
-
title:
|
|
84
|
+
onClick: m,
|
|
85
|
+
className: `flex size-11 shrink-0 items-center justify-center rounded-full border border-border-default text-text-primary transition-colors hover:bg-bg-sunken sm:size-10 ${g}`,
|
|
86
|
+
"aria-label": _("composer.dictationCancel", "Cancel dictation"),
|
|
87
|
+
title: _("composer.dictationCancel", "Cancel dictation"),
|
|
87
88
|
"data-testid": "assistant-voice-cancel",
|
|
88
|
-
children: /* @__PURE__ */ u
|
|
89
|
+
children: /* @__PURE__ */ d(u, {
|
|
89
90
|
className: "size-5",
|
|
90
91
|
"aria-hidden": "true"
|
|
91
92
|
})
|
|
92
93
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ d("button", {
|
|
94
95
|
type: "button",
|
|
95
|
-
onClick:
|
|
96
|
+
onClick: h,
|
|
96
97
|
disabled: !t,
|
|
97
|
-
className: `flex size-11 shrink-0 items-center justify-center rounded-full border border-status-warning-bg bg-status-warning-bg-subtle text-status-warning-text transition-colors hover:bg-status-warning-bg/20 disabled:cursor-default disabled:opacity-50 sm:size-10 ${
|
|
98
|
-
"aria-label":
|
|
99
|
-
title:
|
|
98
|
+
className: `flex size-11 shrink-0 items-center justify-center rounded-full border border-status-warning-bg bg-status-warning-bg-subtle text-status-warning-text${v ? " boff-finish-listening" : ""} transition-colors hover:bg-status-warning-bg/20 disabled:cursor-default disabled:opacity-50 sm:size-10 ${g}`,
|
|
99
|
+
"aria-label": _("composer.dictationDone", "Finish dictation"),
|
|
100
|
+
title: _("composer.dictationDone", "Finish dictation"),
|
|
100
101
|
"aria-pressed": "true",
|
|
101
102
|
"data-testid": "assistant-voice",
|
|
102
103
|
"data-state": t ? "listening" : "starting",
|
|
103
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ d(c, {
|
|
104
105
|
className: "size-5",
|
|
105
106
|
"aria-hidden": "true"
|
|
106
107
|
})
|
|
107
108
|
})
|
|
108
109
|
]
|
|
109
110
|
});
|
|
110
|
-
},
|
|
111
|
+
}, g = ({ message: t, onTryAgain: n }) => {
|
|
111
112
|
let r = e();
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
+
return /* @__PURE__ */ f("div", {
|
|
113
114
|
className: "flex items-center justify-between gap-3 px-1 text-start",
|
|
114
115
|
"data-testid": "assistant-mic-blocked",
|
|
115
|
-
children: [/* @__PURE__ */
|
|
116
|
+
children: [/* @__PURE__ */ d("p", {
|
|
116
117
|
className: "text-status-warning-text",
|
|
117
118
|
children: t
|
|
118
|
-
}), /* @__PURE__ */
|
|
119
|
+
}), /* @__PURE__ */ d("button", {
|
|
119
120
|
type: "button",
|
|
120
121
|
onClick: n,
|
|
121
122
|
className: "h-11 shrink-0 rounded-full border border-border-default px-3 text-sm font-medium sm:h-9 text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
@@ -124,4 +125,4 @@ var f = ({ phase: t, before: n, take: r, interim: i, after: a }) => {
|
|
|
124
125
|
})]
|
|
125
126
|
});
|
|
126
127
|
};
|
|
127
|
-
export {
|
|
128
|
+
export { m as DictationControls, p as DictationLiveText, g as MicBlockedNotice };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ★ BOFF-14753: the page's box (the /assistant page only; the panel keeps its look).
|
|
3
|
+
* Depth and a soft accent glow that brightens while typing (M2); orange while the
|
|
4
|
+
* microphone hears (the voice colour rule); nothing while read-only (either way) or a file is
|
|
5
|
+
* dragged over (those keep their own border); and the start page's rise (M1).
|
|
6
|
+
* The classes live in fe-libs `tokens.css`, unlayered, so they win over the
|
|
7
|
+
* composer's Tailwind utilities without `!important`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function pageBoxClass(pageLayout: boolean, state: {
|
|
10
|
+
hearing: boolean;
|
|
11
|
+
quiet: boolean;
|
|
12
|
+
entrance: boolean;
|
|
13
|
+
}): string;
|
|
@@ -15,18 +15,24 @@ function _(e, t) {
|
|
|
15
15
|
return e === "mic-error" ? "error" : t ? "off" : e === "listening" || e === "endpoint-grace" || e === "interrupting" ? "hearing" : e === "speaking" ? "talking" : "waiting";
|
|
16
16
|
}
|
|
17
17
|
var v = {
|
|
18
|
-
hearing: "
|
|
19
|
-
talking: "
|
|
20
|
-
waiting: "
|
|
18
|
+
hearing: "boff-dock boff-dock--listening",
|
|
19
|
+
talking: "boff-dock boff-dock--speaking",
|
|
20
|
+
waiting: "boff-dock boff-dock--thinking",
|
|
21
21
|
off: "border-border-default",
|
|
22
22
|
error: "border-status-error-bg"
|
|
23
23
|
}, y = {
|
|
24
|
-
hearing: "
|
|
25
|
-
talking: "
|
|
26
|
-
waiting: "
|
|
24
|
+
hearing: "boff-orb boff-orb--listening boff-ripple",
|
|
25
|
+
talking: "boff-orb boff-orb--speaking boff-ripple boff-ripple--fill",
|
|
26
|
+
waiting: "boff-orb boff-orb--thinking",
|
|
27
27
|
off: "bg-bg-sunken text-text-muted",
|
|
28
28
|
error: "bg-status-error-bg-subtle text-status-error-text"
|
|
29
|
-
}, b =
|
|
29
|
+
}, b = {
|
|
30
|
+
hearing: "boff-text-listening",
|
|
31
|
+
talking: "boff-text-speaking",
|
|
32
|
+
waiting: "boff-text-thinking",
|
|
33
|
+
off: "",
|
|
34
|
+
error: ""
|
|
35
|
+
}, x = ({ level: e }) => {
|
|
30
36
|
let t = r(), n = u([]);
|
|
31
37
|
return l(() => {
|
|
32
38
|
if (t) return;
|
|
@@ -53,22 +59,22 @@ var v = {
|
|
|
53
59
|
className: "h-full w-[3px] origin-center scale-y-[0.35] rounded-full bg-current transition-transform duration-75"
|
|
54
60
|
}, e))
|
|
55
61
|
});
|
|
56
|
-
},
|
|
62
|
+
}, S = ({ tone: e, level: t }) => {
|
|
57
63
|
let n = r();
|
|
58
64
|
return /* @__PURE__ */ h("span", {
|
|
59
65
|
"aria-hidden": "true",
|
|
60
66
|
className: `flex size-11 shrink-0 items-center justify-center rounded-full ${y[e]}`,
|
|
61
67
|
"data-testid": "assistant-voice-circle",
|
|
62
68
|
"data-tone": e,
|
|
63
|
-
children: e === "hearing" || e === "talking" ? /* @__PURE__ */ h(
|
|
69
|
+
children: e === "hearing" || e === "talking" ? /* @__PURE__ */ h(x, { level: t }) : e === "off" || e === "error" ? /* @__PURE__ */ h(p, { className: "size-5" }) : /* @__PURE__ */ h(f, { className: `size-5${n ? "" : " motion-safe:animate-spin"}` })
|
|
64
70
|
});
|
|
65
71
|
};
|
|
66
|
-
function
|
|
72
|
+
function C(e, t) {
|
|
67
73
|
if (t.heard) return t.heard;
|
|
68
74
|
let n = e("voiceDock.listeningCaption", "Go ahead, I am listening.");
|
|
69
75
|
return t.stage === "listening" && t.stageText === e("voiceSession.listening", "Listening…") ? n : t.stageText || n;
|
|
70
76
|
}
|
|
71
|
-
function
|
|
77
|
+
function w(e, t) {
|
|
72
78
|
let { stage: n } = t;
|
|
73
79
|
return n === "mic-error" ? {
|
|
74
80
|
title: e("voiceDock.problem", "Microphone problem"),
|
|
@@ -87,20 +93,20 @@ function C(e, t) {
|
|
|
87
93
|
caption: t.bargeIn ? e("voiceDock.speakingCaption", "Speak or tap Interrupt to cut in.") : e("voiceDock.speakingCaptionTap", "Tap Interrupt to cut in.")
|
|
88
94
|
} : {
|
|
89
95
|
title: e("voiceDock.listening", "Listening"),
|
|
90
|
-
caption:
|
|
96
|
+
caption: C(e, t)
|
|
91
97
|
};
|
|
92
98
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
99
|
+
function T(t) {
|
|
100
|
+
return w(e(), t);
|
|
95
101
|
}
|
|
96
|
-
function
|
|
102
|
+
function E() {
|
|
97
103
|
let [e, t] = d(0);
|
|
98
104
|
return l(() => {
|
|
99
105
|
let e = Date.now(), n = setInterval(() => t(Math.floor((Date.now() - e) / 1e3)), 1e3);
|
|
100
106
|
return () => clearInterval(n);
|
|
101
107
|
}, []), e;
|
|
102
108
|
}
|
|
103
|
-
function
|
|
109
|
+
function D(e) {
|
|
104
110
|
let t = u(null);
|
|
105
111
|
l(() => {
|
|
106
112
|
if (typeof document < "u") return t.current = document.title, () => {
|
|
@@ -110,7 +116,7 @@ function E(e) {
|
|
|
110
116
|
typeof document < "u" && t.current !== null && (document.title = `${e} · ${t.current}`);
|
|
111
117
|
}, [e]);
|
|
112
118
|
}
|
|
113
|
-
var
|
|
119
|
+
var O = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r }) => /* @__PURE__ */ g(m, { children: [
|
|
114
120
|
/* @__PURE__ */ g("div", {
|
|
115
121
|
className: "flex flex-col items-center gap-1 px-1 text-center text-xs empty:hidden [&:not(:empty)]:pb-1.5",
|
|
116
122
|
"data-testid": "assistant-voice-page-notices",
|
|
@@ -150,7 +156,7 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
|
|
|
150
156
|
"data-testid": "assistant-voice-started-cue-announced",
|
|
151
157
|
children: r
|
|
152
158
|
})
|
|
153
|
-
] }),
|
|
159
|
+
] }), k = "flex h-11 shrink-0 items-center justify-center gap-1.5 rounded-full border px-4 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:cursor-default disabled:opacity-50 sm:h-10", A = `${k} border-border-default bg-bg-elevated text-text-primary hover:bg-bg-sunken`, j = (t) => {
|
|
154
160
|
let n = e(), { muted: r, stage: a, hold: o, onAttachFiles: s, endRef: c, onEnd: d, onInterrupt: f, onToggleMute: p } = t, m = a === "speaking" && !r, _ = u(null), v = u(!1);
|
|
155
161
|
return l(() => {
|
|
156
162
|
!m && v.current && (v.current = !1, _.current?.focus());
|
|
@@ -164,7 +170,7 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
|
|
|
164
170
|
onClick: p,
|
|
165
171
|
disabled: t.muteDisabled,
|
|
166
172
|
"aria-pressed": r,
|
|
167
|
-
className:
|
|
173
|
+
className: A,
|
|
168
174
|
"data-testid": "assistant-voice-mute",
|
|
169
175
|
children: r ? n("window.unmute", "Unmute") : n("window.mute", "Mute")
|
|
170
176
|
}),
|
|
@@ -179,14 +185,14 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
|
|
|
179
185
|
onBlur: () => {
|
|
180
186
|
v.current = !1;
|
|
181
187
|
},
|
|
182
|
-
className:
|
|
188
|
+
className: A,
|
|
183
189
|
"data-testid": "assistant-voice-interrupt",
|
|
184
190
|
children: n("voiceDock.interrupt", "Interrupt")
|
|
185
191
|
}) : null,
|
|
186
192
|
o ? /* @__PURE__ */ h("button", {
|
|
187
193
|
type: "button",
|
|
188
194
|
onClick: o.onPress,
|
|
189
|
-
className: o.holding ? `${
|
|
195
|
+
className: o.holding ? `${k} border-transparent bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover` : A,
|
|
190
196
|
title: o.holding ? n("voiceSession.imDoneHint", "Send what you said now") : n("voiceSession.letMeFinishHint", "Pause sending until you tap “I’m done”"),
|
|
191
197
|
"data-testid": "assistant-voice-hold",
|
|
192
198
|
"data-holding": o.holding ? "true" : "false",
|
|
@@ -205,17 +211,17 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
|
|
|
205
211
|
ref: c,
|
|
206
212
|
type: "button",
|
|
207
213
|
onClick: d,
|
|
208
|
-
className: `${
|
|
214
|
+
className: `${k} basis-full border-transparent bg-text-primary text-bg-elevated hover:opacity-90 sm:basis-auto`,
|
|
209
215
|
title: n("voiceSession.end", "End the voice conversation"),
|
|
210
216
|
"data-testid": "assistant-voice-end",
|
|
211
217
|
children: n("voiceDock.end", "End voice chat")
|
|
212
218
|
})
|
|
213
219
|
]
|
|
214
220
|
});
|
|
215
|
-
},
|
|
216
|
-
let i = e(), { rootRef: l, stage: u, muted: d, attachments: f, preparingAttachments: p, attachmentsLocked: m } = r, y = _(u, d),
|
|
217
|
-
|
|
218
|
-
let
|
|
221
|
+
}, M = (r) => {
|
|
222
|
+
let i = e(), { rootRef: l, stage: u, muted: d, attachments: f, preparingAttachments: p, attachmentsLocked: m } = r, y = _(u, d), x = T(r), C = E();
|
|
223
|
+
D(x.title);
|
|
224
|
+
let w = f.length > 0 || p > 0;
|
|
219
225
|
return /* @__PURE__ */ g("div", {
|
|
220
226
|
ref: l,
|
|
221
227
|
role: "region",
|
|
@@ -225,14 +231,14 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
|
|
|
225
231
|
"data-presentation": "page",
|
|
226
232
|
[n]: "",
|
|
227
233
|
children: [
|
|
228
|
-
/* @__PURE__ */ h(
|
|
234
|
+
/* @__PURE__ */ h(O, { ...r }),
|
|
229
235
|
/* @__PURE__ */ g("div", {
|
|
230
236
|
className: `flex flex-col gap-1 rounded-3xl border bg-bg-elevated transition-colors ${v[y]}`,
|
|
231
237
|
"data-testid": "assistant-voice-page-bar",
|
|
232
238
|
"data-state": u,
|
|
233
239
|
"data-tone": y,
|
|
234
240
|
children: [
|
|
235
|
-
|
|
241
|
+
w ? /* @__PURE__ */ h("div", {
|
|
236
242
|
className: "px-3 pt-3",
|
|
237
243
|
"data-testid": "assistant-voice-attachments",
|
|
238
244
|
children: /* @__PURE__ */ h(a, {
|
|
@@ -246,27 +252,27 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
|
|
|
246
252
|
/* @__PURE__ */ g("div", {
|
|
247
253
|
className: "flex items-center gap-3 px-3 pt-3",
|
|
248
254
|
children: [
|
|
249
|
-
/* @__PURE__ */ h(
|
|
255
|
+
/* @__PURE__ */ h(S, {
|
|
250
256
|
tone: y,
|
|
251
257
|
level: r.level
|
|
252
258
|
}),
|
|
253
259
|
/* @__PURE__ */ g("div", {
|
|
254
260
|
className: "min-w-0 flex-1",
|
|
255
261
|
children: [/* @__PURE__ */ h("p", {
|
|
256
|
-
className:
|
|
262
|
+
className: `text-base font-semibold text-text-primary ${b[y]}`,
|
|
257
263
|
"data-testid": "assistant-voice-title",
|
|
258
|
-
children:
|
|
264
|
+
children: x.title
|
|
259
265
|
}), /* @__PURE__ */ h("p", {
|
|
260
266
|
className: `line-clamp-2 text-sm ${r.heard ? "text-text-primary" : "text-text-secondary"}`,
|
|
261
267
|
"data-testid": r.heard ? "assistant-voice-heard" : "assistant-voice-caption-line",
|
|
262
|
-
children:
|
|
268
|
+
children: x.caption
|
|
263
269
|
})]
|
|
264
270
|
}),
|
|
265
271
|
/* @__PURE__ */ h("span", {
|
|
266
272
|
className: "shrink-0 self-start text-xs tabular-nums text-text-secondary",
|
|
267
273
|
"aria-hidden": "true",
|
|
268
274
|
"data-testid": "assistant-voice-time",
|
|
269
|
-
children: o(
|
|
275
|
+
children: o(C)
|
|
270
276
|
})
|
|
271
277
|
]
|
|
272
278
|
}),
|
|
@@ -276,7 +282,7 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
|
|
|
276
282
|
rotating: r.rotateStatus,
|
|
277
283
|
className: "sr-only"
|
|
278
284
|
}),
|
|
279
|
-
/* @__PURE__ */ h(
|
|
285
|
+
/* @__PURE__ */ h(j, { ...r })
|
|
280
286
|
]
|
|
281
287
|
}),
|
|
282
288
|
r.privacyNotice ? /* @__PURE__ */ h(s, {
|
|
@@ -287,4 +293,4 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
|
|
|
287
293
|
]
|
|
288
294
|
});
|
|
289
295
|
};
|
|
290
|
-
export {
|
|
296
|
+
export { M as AssistantPageVoiceBar };
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { useAssistantTr as e } from "../../i18n.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useAssistantPageLayout as t } from "../assistantPageLayout.js";
|
|
3
|
+
import { AudioLines as n } from "lucide-react";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
5
|
// src/shared/assistant/ui/voice/AssistantVoiceSessionButton.tsx
|
|
5
|
-
var
|
|
6
|
-
let
|
|
7
|
-
return /* @__PURE__ */
|
|
6
|
+
var i = ({ onStart: i, disabled: a = !1, compact: o = !1, invisible: s = !1 }) => {
|
|
7
|
+
let c = e(), l = t();
|
|
8
|
+
return /* @__PURE__ */ r("button", {
|
|
8
9
|
type: "button",
|
|
9
|
-
onClick:
|
|
10
|
-
disabled:
|
|
11
|
-
className:
|
|
12
|
-
"aria-label":
|
|
13
|
-
title:
|
|
10
|
+
onClick: i,
|
|
11
|
+
disabled: a,
|
|
12
|
+
className: o ? `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${l ? " boff-voice-start" : ""}${s ? " 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",
|
|
13
|
+
"aria-label": c("voiceSession.start", "Start a voice conversation"),
|
|
14
|
+
title: c("voiceSession.start", "Start a voice conversation"),
|
|
14
15
|
"data-testid": "assistant-voice-session-start",
|
|
15
|
-
children: /* @__PURE__ */ n
|
|
16
|
+
children: /* @__PURE__ */ r(n, { className: o ? "size-5" : "size-4" })
|
|
16
17
|
});
|
|
17
18
|
};
|
|
18
|
-
export {
|
|
19
|
+
export { i as AssistantVoiceSessionButton };
|
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
import { pushLevel as e } from "../../voice/liveLevel.js";
|
|
2
2
|
import { usePrefersReducedMotion as t } from "../usePrefersReducedMotion.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useAssistantPageLayout as n } from "../assistantPageLayout.js";
|
|
4
|
+
import { useEffect as r, useRef as i } from "react";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
5
6
|
// src/shared/assistant/ui/voice/LiveWaveform.tsx
|
|
6
|
-
var
|
|
7
|
-
let
|
|
8
|
-
return
|
|
9
|
-
let t =
|
|
7
|
+
var o = 3, s = 2, c = 2, l = ({ source: l, tone: u, className: d = "", testId: f }) => {
|
|
8
|
+
let p = t(), m = n(), h = i(null), g = i(null);
|
|
9
|
+
return r(() => {
|
|
10
|
+
let t = h.current, n = g.current;
|
|
10
11
|
if (!t || !n) return;
|
|
11
12
|
let r = typeof n.getContext == "function" ? n.getContext("2d") : null;
|
|
12
13
|
if (!r) return;
|
|
13
|
-
let i = 0,
|
|
14
|
-
if (i === 0 ||
|
|
14
|
+
let i = 0, a = 0, u = 0, d = [], f = "", m = () => {
|
|
15
|
+
if (i === 0 || a === 0) return;
|
|
15
16
|
let e = typeof window > "u" ? 1 : window.devicePixelRatio || 1;
|
|
16
|
-
r.setTransform(e, 0, 0, e, 0, 0), r.clearRect(0, 0, i,
|
|
17
|
-
let t = u * 5 -
|
|
17
|
+
r.setTransform(e, 0, 0, e, 0, 0), r.clearRect(0, 0, i, a), r.fillStyle = f;
|
|
18
|
+
let t = u * 5 - s, n = i - t;
|
|
18
19
|
for (let e = 0; e < u; e += 1) {
|
|
19
|
-
let t =
|
|
20
|
-
typeof r.roundRect == "function" ? (r.beginPath(), r.roundRect(
|
|
20
|
+
let t = p ? 0 : d[e] ?? 0, i = Math.max(c, t * a), s = n + e * 5, l = (a - i) / 2, u = Math.min(o / 2, i / 2);
|
|
21
|
+
typeof r.roundRect == "function" ? (r.beginPath(), r.roundRect(s, l, o, i, u), r.fill()) : r.fillRect(s, l, o, i);
|
|
21
22
|
}
|
|
22
23
|
}, _ = () => {
|
|
23
24
|
let e = t.getBoundingClientRect(), r = typeof window > "u" ? 1 : window.devicePixelRatio || 1;
|
|
24
|
-
for (i = Math.max(0, Math.floor(e.width)),
|
|
25
|
-
|
|
25
|
+
for (i = Math.max(0, Math.floor(e.width)), a = Math.max(0, Math.floor(e.height)), n.width = Math.round(i * r), n.height = Math.round(a * r), n.style.width = `${i}px`, n.style.height = `${a}px`, u = Math.max(0, Math.floor((i + s) / 5)), d = d.length > u ? d.slice(d.length - u) : d; d.length < u;) d.unshift(0);
|
|
26
|
+
f = typeof getComputedStyle == "function" ? getComputedStyle(n).color : "", m();
|
|
26
27
|
};
|
|
27
28
|
_();
|
|
28
29
|
let v = typeof ResizeObserver > "u" ? null : new ResizeObserver(_);
|
|
29
30
|
v?.observe(t);
|
|
30
|
-
let y =
|
|
31
|
-
|
|
31
|
+
let y = l.subscribe((t) => {
|
|
32
|
+
p || (d = e(d, t, u), m());
|
|
32
33
|
});
|
|
33
34
|
return () => {
|
|
34
35
|
y(), v?.disconnect();
|
|
35
36
|
};
|
|
36
37
|
}, [
|
|
37
|
-
c,
|
|
38
38
|
l,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
u,
|
|
40
|
+
p
|
|
41
|
+
]), /* @__PURE__ */ a("div", {
|
|
42
|
+
ref: h,
|
|
43
|
+
className: `relative min-w-0 overflow-hidden ${d}`,
|
|
43
44
|
"aria-hidden": "true",
|
|
44
|
-
"data-testid":
|
|
45
|
-
"data-tone":
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
-
ref:
|
|
48
|
-
className: `absolute inset-0 ${
|
|
45
|
+
"data-testid": f,
|
|
46
|
+
"data-tone": u,
|
|
47
|
+
children: /* @__PURE__ */ a("canvas", {
|
|
48
|
+
ref: g,
|
|
49
|
+
className: `absolute inset-0 ${u === "speaking" ? "text-status-info-bg" : "text-status-warning-bg"}${m ? u === "speaking" ? " boff-text-speaking" : " boff-text-listening" : ""}`
|
|
49
50
|
})
|
|
50
51
|
});
|
|
51
52
|
};
|
|
52
|
-
export {
|
|
53
|
+
export { l as LiveWaveform };
|