@burdenoff/fe-libs 2026.1115.10 → 2026.1115.12
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/avatar/live/createLiveAvatarSeam.d.ts +8 -1
- package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.js +126 -123
- package/dist/shared/assistant/avatar/live/liveAvatarController.d.ts +7 -0
- package/dist/shared/assistant/avatar/live/liveAvatarController.js +3 -2
- 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/assistantLiveAvatarSeam.d.ts +26 -0
- package/dist/shared/assistant/ui/assistantLiveAvatarSeam.js +87 -79
- 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/AssistantHandsFreeInterruptToggle.d.ts +4 -0
- package/dist/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.js +22 -22
- 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/useVoiceSession.js +223 -223
- 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/assistant/voice/handsfree/handsFreeController.js +79 -79
- package/dist/shared/assistant/voice/handsfree/handsFreeSetting.d.ts +6 -1
- package/dist/shared/assistant/voice/handsfree/handsFreeSetting.js +2 -2
- package/dist/shared/assistant/voice/handsfree/playbackReference.d.ts +45 -3
- package/dist/shared/assistant/voice/handsfree/playbackReference.js +62 -15
- package/dist/shared-assistant.js +371 -370
- 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 };
|
|
@@ -21,5 +21,9 @@ import { FC } from 'react';
|
|
|
21
21
|
* drops out of the Tab order and keyboard and screen-reader users would skip
|
|
22
22
|
* the control and the reason with it (the avatar toggle keeps its focus the
|
|
23
23
|
* same way). Without an avatar it is exactly what it was.
|
|
24
|
+
*
|
|
25
|
+
* ★ P5 (BOFF-12936): where the avatar's voice is the echo gate's reference
|
|
26
|
+
* (`useLiveAvatarEchoReference`), the avatar blocks nothing here: the control
|
|
27
|
+
* works as it does without an avatar.
|
|
24
28
|
*/
|
|
25
29
|
export declare const AssistantHandsFreeInterruptToggle: FC;
|
|
@@ -3,45 +3,45 @@ import { useAssistantTr as t } from "../../i18n.js";
|
|
|
3
3
|
import { useAssistantStore as n } from "../../store.js";
|
|
4
4
|
import { isMicCaptureSupported as r } from "../../voice/handsfree/micCapture.js";
|
|
5
5
|
import { isSpeechRecognitionSupported as i } from "../../voice/useVoiceInput.js";
|
|
6
|
-
import {
|
|
7
|
-
import { useId as
|
|
8
|
-
import { Mic as
|
|
9
|
-
import { Fragment as
|
|
6
|
+
import { useLiveAvatarEchoReference as a, useLiveAvatarOn as o } from "../assistantLiveAvatarSeam.js";
|
|
7
|
+
import { useId as s } from "react";
|
|
8
|
+
import { Mic as c } from "lucide-react";
|
|
9
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
10
|
// src/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.tsx
|
|
11
|
-
var
|
|
12
|
-
let
|
|
11
|
+
var f = () => {
|
|
12
|
+
let f = t(), p = e(), m = o(), h = a(), g = m && !h, _ = s(), v = n((e) => e.handsFreeInterrupt), y = n((e) => e.setHandsFreeInterrupt);
|
|
13
13
|
if (!i() && !r()) return null;
|
|
14
|
-
let
|
|
14
|
+
let b = /* @__PURE__ */ d("label", {
|
|
15
15
|
className: "flex items-center gap-2.5 px-3 py-2 text-xs text-text-primary focus-within:ring-2 focus-within:ring-inset focus-within:ring-border-strong",
|
|
16
|
-
title:
|
|
16
|
+
title: f("voice.handsFreeHint", "Let the assistant listen while it answers, so you can speak over it to correct it. Works best with headphones. You can always tap to interrupt."),
|
|
17
17
|
"data-testid": "assistant-hands-free-interrupt",
|
|
18
18
|
children: [
|
|
19
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ u(c, {
|
|
20
20
|
className: "size-3.5 flex-shrink-0 text-text-secondary",
|
|
21
21
|
"aria-hidden": "true"
|
|
22
22
|
}),
|
|
23
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ u("span", {
|
|
24
24
|
className: "flex-1",
|
|
25
|
-
children:
|
|
25
|
+
children: f("voice.handsFreeLabel", "Hands-free interrupt (beta)")
|
|
26
26
|
}),
|
|
27
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ u("input", {
|
|
28
28
|
type: "checkbox",
|
|
29
|
-
checked:
|
|
29
|
+
checked: v,
|
|
30
30
|
onChange: (e) => {
|
|
31
|
-
|
|
31
|
+
g || y(e.target.checked);
|
|
32
32
|
},
|
|
33
|
-
"aria-disabled":
|
|
34
|
-
"aria-describedby":
|
|
35
|
-
className:
|
|
33
|
+
"aria-disabled": g ? "true" : void 0,
|
|
34
|
+
"aria-describedby": g ? _ : void 0,
|
|
35
|
+
className: g ? "size-4 accent-current aria-disabled:cursor-default aria-disabled:opacity-60" : "size-4 accent-current",
|
|
36
36
|
"data-testid": "assistant-hands-free-interrupt-checkbox"
|
|
37
37
|
})
|
|
38
38
|
]
|
|
39
39
|
});
|
|
40
|
-
return
|
|
41
|
-
id:
|
|
40
|
+
return g ? /* @__PURE__ */ d(l, { children: [b, /* @__PURE__ */ u("p", {
|
|
41
|
+
id: _,
|
|
42
42
|
className: "px-3 pb-2 text-[11px] text-text-muted",
|
|
43
43
|
"data-testid": "assistant-hands-free-interrupt-avatar",
|
|
44
|
-
children:
|
|
45
|
-
})] }) :
|
|
44
|
+
children: p.handsFreeOff
|
|
45
|
+
})] }) : b;
|
|
46
46
|
};
|
|
47
|
-
export {
|
|
47
|
+
export { f as AssistantHandsFreeInterruptToggle };
|
|
@@ -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;
|