@burdenoff/fe-libs 2026.1029.11 → 2026.1030.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/assistant/i18nManifest.d.ts +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
|
@@ -2,27 +2,27 @@ import { DropdownMenu as e, DropdownMenuContent as t, DropdownMenuRadioGroup as
|
|
|
2
2
|
import { focusWasDropped as a } from "../../../hooks/useReturnFocus.js";
|
|
3
3
|
import { useAssistantTr as o } from "../../i18n.js";
|
|
4
4
|
import { AUTO_WRITE_MODE as s } from "../../autoRouting.js";
|
|
5
|
-
import { assistantModeShortDescriptionKey as
|
|
6
|
-
import { AUTO_MODE_OPTION_ID as
|
|
7
|
-
import { TAB_STOP_SELECTOR as
|
|
8
|
-
import { useCallback as p, useId as m, useRef as h, useState as
|
|
9
|
-
import { ChevronDown as
|
|
10
|
-
import { Fragment as
|
|
5
|
+
import { assistantModeShortDescriptionKey as c, translateProductCopy as l } from "../../productCopy.js";
|
|
6
|
+
import { AUTO_MODE_OPTION_ID as u, assistantModeMeta as d } from "./AssistantModeSelector.js";
|
|
7
|
+
import { TAB_STOP_SELECTOR as ee, modeMenuItemKey as te, modeMenuOpenIndex as ne, modeMenuTriggerKey as f, nextTabStop as re } from "./modeMenuKeys.js";
|
|
8
|
+
import { useCallback as p, useId as m, useRef as h, useState as ie } from "react";
|
|
9
|
+
import { ChevronDown as ae, Wand2 as oe } from "lucide-react";
|
|
10
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
11
11
|
//#region src/shared/assistant/ui/composer/AssistantModeMenu.tsx
|
|
12
|
-
function
|
|
13
|
-
return e(`mode.${t.id}`, t.label ||
|
|
12
|
+
function y(e, t) {
|
|
13
|
+
return e(`mode.${t.id}`, t.label || d(t).fallback);
|
|
14
14
|
}
|
|
15
|
-
var
|
|
16
|
-
function
|
|
15
|
+
var se = "[data-radix-focus-guard],[data-radix-menu-content]";
|
|
16
|
+
function b(e) {
|
|
17
17
|
if (e.disabled === !0 || e.getAttribute("type") === "hidden" || e.closest("[inert],[hidden]")) return !0;
|
|
18
18
|
let t = e.checkVisibility;
|
|
19
19
|
return typeof t == "function" ? !t.call(e) : !1;
|
|
20
20
|
}
|
|
21
|
-
var x = ({ mode: x, availableModes: S, onModeChange: C, auto: w, disabled: T = !1, disabledReason: E = null }) => {
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
let
|
|
25
|
-
if (e ===
|
|
21
|
+
var x = ({ mode: x, availableModes: S, onModeChange: C, auto: w, disabled: T = !1, disabledReason: E = null, readOnly: D = !1 }) => {
|
|
22
|
+
let O = o(), k = m(), A = m(), [j, M] = ie(!1);
|
|
23
|
+
j && T && M(!1);
|
|
24
|
+
let N = h(null), P = h([]), F = h("checked"), I = h(!1), L = w !== void 0, R = [...L ? [u] : [], ...S.map((e) => e.id)], z = w?.active ? u : x, B = R.indexOf(z), V = !!w?.active && x === "api-calls", H = S.find((e) => e.id === s), U = O("modeSelector.auto", "Auto"), W = O("modeSelector.autoHint", "Answers your questions, and proposes changes for you to approve"), G = S.find((e) => e.id === x), K = V && H ? y(O, H) : null, q = w?.active ? K ? `${U} · ${K}` : U : y(O, G ?? { id: x }), J = p((e) => {
|
|
25
|
+
if (e === z) return;
|
|
26
26
|
if (e === ":auto") {
|
|
27
27
|
w?.onSelect();
|
|
28
28
|
return;
|
|
@@ -33,9 +33,9 @@ var x = ({ mode: x, availableModes: S, onModeChange: C, auto: w, disabled: T = !
|
|
|
33
33
|
w,
|
|
34
34
|
S,
|
|
35
35
|
C,
|
|
36
|
-
|
|
36
|
+
z
|
|
37
37
|
]), ce = p((e) => {
|
|
38
|
-
e && T || (e ?
|
|
38
|
+
e && T || (e ? I.current = !0 : F.current = "checked", M(e));
|
|
39
39
|
}, [T]), le = p((e) => {
|
|
40
40
|
let t = f(e.key);
|
|
41
41
|
if (t !== null) {
|
|
@@ -43,131 +43,131 @@ var x = ({ mode: x, availableModes: S, onModeChange: C, auto: w, disabled: T = !
|
|
|
43
43
|
e.preventDefault();
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
F.current = t, e.key === "ArrowUp" && (e.preventDefault(), I.current = !0, M(!0));
|
|
47
47
|
}
|
|
48
|
-
}, [T]),
|
|
48
|
+
}, [T]), ue = p((e) => {
|
|
49
49
|
T && e.preventDefault();
|
|
50
50
|
}, [T]), Y = p((e) => {
|
|
51
|
-
let t =
|
|
52
|
-
if (
|
|
53
|
-
let n = t.ownerDocument, r = Array.from(n.querySelectorAll(
|
|
51
|
+
let t = N.current;
|
|
52
|
+
if (M(!1), !t) return;
|
|
53
|
+
let n = t.ownerDocument, r = Array.from(n.querySelectorAll(ee)).filter((e) => !P.current.includes(e) && !e.closest(se)), i = r.indexOf(t);
|
|
54
54
|
(r[i < 0 ? -1 : re(r.map((e) => ({
|
|
55
55
|
tabIndex: e.tabIndex,
|
|
56
|
-
unreachable:
|
|
56
|
+
unreachable: b(e)
|
|
57
57
|
})), i, e)] ?? t).focus();
|
|
58
58
|
}, []), X = p((e) => {
|
|
59
59
|
if (e.defaultPrevented) return;
|
|
60
|
-
let t =
|
|
60
|
+
let t = P.current.slice(0, R.length), n = t.findIndex((t) => t !== null && t === e.target), r = te(e.key, {
|
|
61
61
|
shiftKey: e.shiftKey,
|
|
62
62
|
index: n,
|
|
63
|
-
count:
|
|
63
|
+
count: R.length
|
|
64
64
|
});
|
|
65
65
|
r.kind === "move" ? (e.preventDefault(), t[r.index]?.focus()) : r.kind === "tab-out" && (e.preventDefault(), Y(r.direction));
|
|
66
|
-
}, [
|
|
67
|
-
if (!
|
|
68
|
-
|
|
69
|
-
let t = ne(
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
let t =
|
|
66
|
+
}, [R.length, Y]), de = p((e) => {
|
|
67
|
+
if (!I.current || e.target !== e.currentTarget) return;
|
|
68
|
+
I.current = !1, e.preventDefault();
|
|
69
|
+
let t = ne(F.current, B, R.length);
|
|
70
|
+
F.current = "checked", P.current[t]?.focus();
|
|
71
|
+
}, [B, R.length]), fe = p((e) => {
|
|
72
|
+
let t = N.current;
|
|
73
73
|
t && !a(t.ownerDocument) && e.preventDefault();
|
|
74
|
-
}, []),
|
|
75
|
-
|
|
76
|
-
}, [
|
|
77
|
-
if (
|
|
78
|
-
if (
|
|
74
|
+
}, []), pe = p((e) => {
|
|
75
|
+
N.current?.focus(), J(e);
|
|
76
|
+
}, [J]);
|
|
77
|
+
if (R.length === 0) return null;
|
|
78
|
+
if (R.length === 1 || D) return /* @__PURE__ */ _("span", {
|
|
79
79
|
className: "inline-flex h-9 items-center px-3 text-sm text-text-secondary",
|
|
80
80
|
"data-testid": "assistant-mode-static",
|
|
81
|
-
children:
|
|
81
|
+
children: O("modeMenu.staticLabel", "Mode: {{mode}}", { mode: q })
|
|
82
82
|
});
|
|
83
|
-
let Z = E === "replying" ?
|
|
84
|
-
|
|
83
|
+
let Z = E === "replying" ? O("modeMenu.disabledReplying", "Mode can't change while the assistant is replying. Stop the reply to change it.") : O("modeMenu.disabledBusy", "Mode can't change right now."), me = w?.active ? oe : d({ id: x }).icon, Q = "min-h-11 items-start gap-0 py-2 pr-3", $ = (e) => (t) => {
|
|
84
|
+
P.current[e] = t;
|
|
85
85
|
};
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
open:
|
|
86
|
+
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v(e, {
|
|
87
|
+
open: j,
|
|
88
88
|
onOpenChange: ce,
|
|
89
89
|
modal: !1,
|
|
90
|
-
children: [/* @__PURE__ */
|
|
90
|
+
children: [/* @__PURE__ */ _(i, {
|
|
91
91
|
asChild: !0,
|
|
92
|
-
children: /* @__PURE__ */
|
|
93
|
-
ref:
|
|
92
|
+
children: /* @__PURE__ */ v("button", {
|
|
93
|
+
ref: N,
|
|
94
94
|
type: "button",
|
|
95
|
-
"aria-label":
|
|
95
|
+
"aria-label": O("modeMenu.trigger", "Assistant mode: {{mode}}", { mode: q }),
|
|
96
96
|
"aria-disabled": T || void 0,
|
|
97
|
-
"aria-describedby": T ?
|
|
97
|
+
"aria-describedby": T ? k : void 0,
|
|
98
98
|
title: T ? Z : void 0,
|
|
99
99
|
onKeyDown: le,
|
|
100
|
-
onPointerDown:
|
|
100
|
+
onPointerDown: ue,
|
|
101
101
|
className: `inline-flex h-9 min-w-0 items-center gap-2 rounded-full pl-3 pr-2 text-sm font-medium text-text-primary transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${T ? "cursor-not-allowed opacity-50" : "hover:bg-bg-surface"}`,
|
|
102
102
|
"data-testid": "assistant-mode-selector",
|
|
103
103
|
children: [
|
|
104
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ _(me, {
|
|
105
105
|
className: "size-4 shrink-0 text-text-secondary",
|
|
106
106
|
"aria-hidden": "true"
|
|
107
107
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ _("span", {
|
|
109
109
|
className: "truncate",
|
|
110
|
-
children:
|
|
110
|
+
children: q
|
|
111
111
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ _(ae, {
|
|
113
113
|
className: "size-4 shrink-0 text-text-muted",
|
|
114
114
|
"aria-hidden": "true"
|
|
115
115
|
})
|
|
116
116
|
]
|
|
117
117
|
})
|
|
118
|
-
}), /* @__PURE__ */
|
|
118
|
+
}), /* @__PURE__ */ _(t, {
|
|
119
119
|
side: "top",
|
|
120
120
|
align: "start",
|
|
121
121
|
sideOffset: 8,
|
|
122
122
|
collisionPadding: 8,
|
|
123
|
-
onFocus:
|
|
124
|
-
onCloseAutoFocus:
|
|
123
|
+
onFocus: de,
|
|
124
|
+
onCloseAutoFocus: fe,
|
|
125
125
|
onKeyDown: X,
|
|
126
126
|
className: "w-72 max-w-[calc(100vw-2rem)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto",
|
|
127
127
|
"data-testid": "assistant-mode-menu",
|
|
128
|
-
children: /* @__PURE__ */
|
|
129
|
-
value:
|
|
130
|
-
onValueChange:
|
|
131
|
-
children: [
|
|
128
|
+
children: /* @__PURE__ */ v(n, {
|
|
129
|
+
value: z,
|
|
130
|
+
onValueChange: pe,
|
|
131
|
+
children: [L ? /* @__PURE__ */ _(r, {
|
|
132
132
|
ref: $(0),
|
|
133
|
-
value:
|
|
133
|
+
value: u,
|
|
134
134
|
onKeyDown: X,
|
|
135
|
-
"aria-labelledby": `${
|
|
136
|
-
"aria-describedby": `${
|
|
135
|
+
"aria-labelledby": `${A}-label-0`,
|
|
136
|
+
"aria-describedby": `${A}-description-0`,
|
|
137
137
|
className: Q,
|
|
138
138
|
"data-testid": "assistant-mode-auto",
|
|
139
|
-
"data-auto-routed":
|
|
140
|
-
children: /* @__PURE__ */
|
|
139
|
+
"data-auto-routed": V ? s : void 0,
|
|
140
|
+
children: /* @__PURE__ */ v("span", {
|
|
141
141
|
className: "flex min-w-0 flex-col",
|
|
142
|
-
children: [/* @__PURE__ */
|
|
143
|
-
id: `${
|
|
142
|
+
children: [/* @__PURE__ */ _("span", {
|
|
143
|
+
id: `${A}-label-0`,
|
|
144
144
|
className: "font-medium",
|
|
145
|
-
children:
|
|
146
|
-
}), /* @__PURE__ */
|
|
147
|
-
id: `${
|
|
145
|
+
children: U
|
|
146
|
+
}), /* @__PURE__ */ _("span", {
|
|
147
|
+
id: `${A}-description-0`,
|
|
148
148
|
className: "text-xs text-text-secondary",
|
|
149
149
|
"data-testid": "assistant-mode-description",
|
|
150
|
-
children:
|
|
150
|
+
children: W
|
|
151
151
|
})]
|
|
152
152
|
})
|
|
153
153
|
}) : null, S.map((e, t) => {
|
|
154
|
-
let n = t + +!!
|
|
155
|
-
return /* @__PURE__ */
|
|
154
|
+
let n = t + +!!L, i = e.shortDescription?.trim() ? l(O, c(e.id), e.shortDescription) : null;
|
|
155
|
+
return /* @__PURE__ */ _(r, {
|
|
156
156
|
ref: $(n),
|
|
157
157
|
value: e.id,
|
|
158
158
|
onKeyDown: X,
|
|
159
|
-
"aria-labelledby": `${
|
|
160
|
-
"aria-describedby": i ? `${
|
|
159
|
+
"aria-labelledby": `${A}-label-${n}`,
|
|
160
|
+
"aria-describedby": i ? `${A}-description-${n}` : void 0,
|
|
161
161
|
className: Q,
|
|
162
162
|
"data-testid": `assistant-mode-option-${e.id}`,
|
|
163
|
-
children: /* @__PURE__ */
|
|
163
|
+
children: /* @__PURE__ */ v("span", {
|
|
164
164
|
className: "flex min-w-0 flex-col",
|
|
165
|
-
children: [/* @__PURE__ */
|
|
166
|
-
id: `${
|
|
165
|
+
children: [/* @__PURE__ */ _("span", {
|
|
166
|
+
id: `${A}-label-${n}`,
|
|
167
167
|
className: "font-medium",
|
|
168
|
-
children:
|
|
169
|
-
}), i ? /* @__PURE__ */
|
|
170
|
-
id: `${
|
|
168
|
+
children: y(O, e)
|
|
169
|
+
}), i ? /* @__PURE__ */ _("span", {
|
|
170
|
+
id: `${A}-description-${n}`,
|
|
171
171
|
className: "text-xs text-text-secondary",
|
|
172
172
|
"data-testid": "assistant-mode-description",
|
|
173
173
|
children: i
|
|
@@ -177,12 +177,12 @@ var x = ({ mode: x, availableModes: S, onModeChange: C, auto: w, disabled: T = !
|
|
|
177
177
|
})]
|
|
178
178
|
})
|
|
179
179
|
})]
|
|
180
|
-
}), T ? /* @__PURE__ */
|
|
181
|
-
id:
|
|
180
|
+
}), T ? /* @__PURE__ */ _("span", {
|
|
181
|
+
id: k,
|
|
182
182
|
className: "sr-only",
|
|
183
183
|
"data-testid": "assistant-mode-disabled-reason",
|
|
184
184
|
children: Z
|
|
185
185
|
}) : null] });
|
|
186
186
|
};
|
|
187
187
|
//#endregion
|
|
188
|
-
export { x as AssistantModeMenu,
|
|
188
|
+
export { x as AssistantModeMenu, y as assistantModeOptionName };
|
|
@@ -86,6 +86,12 @@ interface Props {
|
|
|
86
86
|
proposalChip?: {
|
|
87
87
|
label: string;
|
|
88
88
|
onOpen: () => void;
|
|
89
|
+
/**
|
|
90
|
+
* BOFF-10180 (compact layout only): what is waiting, said beside the button
|
|
91
|
+
* ("1 change(s) waiting for your approval"), so the button's own words can
|
|
92
|
+
* be its destination ("Review in full assistant").
|
|
93
|
+
*/
|
|
94
|
+
status?: string;
|
|
89
95
|
} | null;
|
|
90
96
|
/** The waiting change's card, while the person has it open from the chip. */
|
|
91
97
|
proposalTray?: {
|
|
@@ -104,6 +110,31 @@ interface Props {
|
|
|
104
110
|
* session reports nothing.
|
|
105
111
|
*/
|
|
106
112
|
onViewChange?: (view: VoiceView) => void;
|
|
113
|
+
/**
|
|
114
|
+
* ★ BOFF-10180 (Slice 5): the view SHOWN, controlled by the caller. Absent,
|
|
115
|
+
* the session keeps its own size state exactly as before (mini, then panel,
|
|
116
|
+
* then full), and nothing below changes.
|
|
117
|
+
*
|
|
118
|
+
* - `compact`: the Quick assistant window's layout. The session fills the
|
|
119
|
+
* window in one column: stage, status and caption; Stop speaking or Mute and
|
|
120
|
+
* End voice; Show/Hide transcript; Attach; the waiting-change chip. Nothing
|
|
121
|
+
* about it resizes: the window is a fixed size, so attaching a file does not
|
|
122
|
+
* grow it, and the stepper is not drawn.
|
|
123
|
+
* - `mini`, `panel`, `full`: that view, with no stepper.
|
|
124
|
+
*
|
|
125
|
+
* ★ HANDOFF: when the control ends, the session was handed to the full
|
|
126
|
+
* assistant, and it keeps going as the SAME instance: a `compact` view becomes
|
|
127
|
+
* the `panel` view, and any other view stays what it was. Nothing remounts.
|
|
128
|
+
*/
|
|
129
|
+
view?: VoiceView | 'compact';
|
|
130
|
+
/**
|
|
131
|
+
* ★ BOFF-10180 (N3, compact presentation): "Started a voice conversation. Your
|
|
132
|
+
* chat is in History." — said when this session moved into a conversation of
|
|
133
|
+
* its own beside a typed chat. A polite status; shown while the session lives.
|
|
134
|
+
* `undefined` (every classic session): nothing is rendered, not even the
|
|
135
|
+
* status region.
|
|
136
|
+
*/
|
|
137
|
+
startedCue?: string | null;
|
|
107
138
|
}
|
|
108
139
|
/**
|
|
109
140
|
* Full-screen voice conversation (BOFF-7120).
|