@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.
Files changed (37) hide show
  1. package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.d.ts +8 -1
  2. package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.js +126 -123
  3. package/dist/shared/assistant/avatar/live/liveAvatarController.d.ts +7 -0
  4. package/dist/shared/assistant/avatar/live/liveAvatarController.js +3 -2
  5. package/dist/shared/assistant/index.d.ts +1 -0
  6. package/dist/shared/assistant/ui/AssistantAvatar.js +18 -14
  7. package/dist/shared/assistant/ui/AssistantChatArea.js +1 -0
  8. package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +5 -0
  9. package/dist/shared/assistant/ui/AssistantMessageItem.js +57 -56
  10. package/dist/shared/assistant/ui/AssistantMessageList.js +57 -44
  11. package/dist/shared/assistant/ui/AssistantTurnActivity.d.ts +2 -0
  12. package/dist/shared/assistant/ui/AssistantTurnActivity.js +20 -17
  13. package/dist/shared/assistant/ui/assistantLiveAvatarSeam.d.ts +26 -0
  14. package/dist/shared/assistant/ui/assistantLiveAvatarSeam.js +87 -79
  15. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +5 -0
  16. package/dist/shared/assistant/ui/composer/AssistantComposer.js +348 -343
  17. package/dist/shared/assistant/ui/composer/AssistantDictation.js +57 -56
  18. package/dist/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.d.ts +4 -0
  19. package/dist/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.js +22 -22
  20. package/dist/shared/assistant/ui/composer/pageBoxClass.d.ts +13 -0
  21. package/dist/shared/assistant/ui/composer/pageBoxClass.js +5 -0
  22. package/dist/shared/assistant/ui/useVoiceSession.js +223 -223
  23. package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.js +41 -35
  24. package/dist/shared/assistant/ui/voice/AssistantVoiceSessionButton.js +13 -12
  25. package/dist/shared/assistant/ui/voice/LiveWaveform.js +28 -27
  26. package/dist/shared/assistant/voice/handsfree/handsFreeController.js +79 -79
  27. package/dist/shared/assistant/voice/handsfree/handsFreeSetting.d.ts +6 -1
  28. package/dist/shared/assistant/voice/handsfree/handsFreeSetting.js +2 -2
  29. package/dist/shared/assistant/voice/handsfree/playbackReference.d.ts +45 -3
  30. package/dist/shared/assistant/voice/handsfree/playbackReference.js +62 -15
  31. package/dist/shared-assistant.js +371 -370
  32. package/package.json +1 -1
  33. package/src/shared/styles/app-shell.css +5 -0
  34. package/src/shared/tokens/build/semantic.css +12 -0
  35. package/src/shared/tokens/build/tailwind.preset.js +5 -0
  36. package/src/shared/tokens/build/themes.css +14 -0
  37. 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 { focusWasDropped as n } from "../../../hooks/useReturnFocus.js";
4
- import { formatClock as r } from "../voice/formatClock.js";
5
- import { LiveWaveform as i } from "../voice/LiveWaveform.js";
6
- import { useEffect as a, useRef as o } from "react";
7
- import { Check as s, Loader2 as c, X as l } from "lucide-react";
8
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
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 f = ({ phase: t, before: n, take: r, interim: i, after: a }) => {
11
+ var p = ({ phase: t, before: n, take: r, interim: i, after: a }) => {
11
12
  let o = e(), s = r || i;
12
- return /* @__PURE__ */ d("div", {
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__ */ d("span", { children: [n.replace(/\s+$/, ""), " "] }) : null,
18
- r ? /* @__PURE__ */ u("span", {
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__ */ d("span", {
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__ */ u("span", {
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__ */ d("span", { children: [" ", a.replace(/^\s+/, "")] }) : null
33
+ a ? /* @__PURE__ */ f("span", { children: [" ", a.replace(/^\s+/, "")] }) : null
33
34
  ]
34
35
  });
35
- }, p = ({ phase: n, seconds: r, level: i, onCancel: a, onFinish: o, focusRing: s }) => {
36
- let l = e(), f = t();
37
- return n === "transcribing" ? /* @__PURE__ */ d("div", {
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__ */ u(c, {
43
- className: `size-4 text-status-warning-bg${f ? "" : " motion-safe:animate-spin"}`,
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__ */ u("span", { children: l("dictation.transcribing", "Turning speech into text") })]
46
- }) : /* @__PURE__ */ u(m, {
47
- listening: n === "listening",
48
- seconds: r,
49
- level: i,
50
- onCancel: a,
51
- onFinish: o,
52
- focusRing: s
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
- }, m = ({ listening: t, seconds: c, level: f, onCancel: p, onFinish: m, focusRing: h }) => {
55
- let g = e(), _ = o(null);
56
- return a(() => {
57
- typeof document < "u" && n(document) && _.current?.focus();
58
- }, []), /* @__PURE__ */ d("div", {
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__ */ u("span", {
64
+ /* @__PURE__ */ d("span", {
64
65
  "aria-hidden": "true",
65
- className: `ms-2.5 size-2.5 shrink-0 rounded-full ${t ? "bg-status-warning-bg" : "bg-text-muted"}`,
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__ */ u(i, {
69
- source: f,
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__ */ u("span", { className: "min-w-0 flex-1" }),
74
- /* @__PURE__ */ u("span", {
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: r(c)
79
+ children: i(l)
79
80
  }),
80
- /* @__PURE__ */ u("button", {
81
- ref: _,
81
+ /* @__PURE__ */ d("button", {
82
+ ref: y,
82
83
  type: "button",
83
- onClick: p,
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 ${h}`,
85
- "aria-label": g("composer.dictationCancel", "Cancel dictation"),
86
- title: g("composer.dictationCancel", "Cancel dictation"),
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(l, {
89
+ children: /* @__PURE__ */ d(u, {
89
90
  className: "size-5",
90
91
  "aria-hidden": "true"
91
92
  })
92
93
  }),
93
- /* @__PURE__ */ u("button", {
94
+ /* @__PURE__ */ d("button", {
94
95
  type: "button",
95
- onClick: m,
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 ${h}`,
98
- "aria-label": g("composer.dictationDone", "Finish dictation"),
99
- title: g("composer.dictationDone", "Finish dictation"),
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__ */ u(s, {
104
+ children: /* @__PURE__ */ d(c, {
104
105
  className: "size-5",
105
106
  "aria-hidden": "true"
106
107
  })
107
108
  })
108
109
  ]
109
110
  });
110
- }, h = ({ message: t, onTryAgain: n }) => {
111
+ }, g = ({ message: t, onTryAgain: n }) => {
111
112
  let r = e();
112
- return /* @__PURE__ */ d("div", {
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__ */ u("p", {
116
+ children: [/* @__PURE__ */ d("p", {
116
117
  className: "text-status-warning-text",
117
118
  children: t
118
- }), /* @__PURE__ */ u("button", {
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 { p as DictationControls, f as DictationLiveText, h as MicBlockedNotice };
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 { useLiveAvatarOn as a } from "../assistantLiveAvatarSeam.js";
7
- import { useId as o } from "react";
8
- import { Mic as s } from "lucide-react";
9
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
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 d = () => {
12
- let d = t(), f = e(), p = a(), m = o(), h = n((e) => e.handsFreeInterrupt), g = n((e) => e.setHandsFreeInterrupt);
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 _ = /* @__PURE__ */ u("label", {
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: d("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."),
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__ */ l(s, {
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__ */ l("span", {
23
+ /* @__PURE__ */ u("span", {
24
24
  className: "flex-1",
25
- children: d("voice.handsFreeLabel", "Hands-free interrupt (beta)")
25
+ children: f("voice.handsFreeLabel", "Hands-free interrupt (beta)")
26
26
  }),
27
- /* @__PURE__ */ l("input", {
27
+ /* @__PURE__ */ u("input", {
28
28
  type: "checkbox",
29
- checked: h,
29
+ checked: v,
30
30
  onChange: (e) => {
31
- p || g(e.target.checked);
31
+ g || y(e.target.checked);
32
32
  },
33
- "aria-disabled": p ? "true" : void 0,
34
- "aria-describedby": p ? m : void 0,
35
- className: p ? "size-4 accent-current aria-disabled:cursor-default aria-disabled:opacity-60" : "size-4 accent-current",
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 p ? /* @__PURE__ */ u(c, { children: [_, /* @__PURE__ */ l("p", {
41
- id: m,
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: f.handsFreeOff
45
- })] }) : _;
44
+ children: p.handsFreeOff
45
+ })] }) : b;
46
46
  };
47
- export { d as AssistantHandsFreeInterruptToggle };
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;
@@ -0,0 +1,5 @@
1
+ // src/shared/assistant/ui/composer/pageBoxClass.ts
2
+ function e(e, t) {
3
+ return e ? [t.hearing ? "boff-hearing-box" : t.quiet ? "" : "boff-glow-box", t.entrance ? "boff-rise boff-delay-3" : ""].filter(Boolean).join(" ") : "";
4
+ }
5
+ export { e as pageBoxClass };