@burdenoff/fe-libs 2026.1114.9 → 2026.1114.11

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.
@@ -1,25 +1,28 @@
1
1
  import { cn as e } from "../../../shared-utils.js";
2
2
  import { useAssistantOverlayOrNull as t } from "./AssistantOverlay.js";
3
3
  import { offerAssistantPageStart as n, useAssistantPageStartSlot as r } from "./assistantPageStart.js";
4
- import { useCallback as i, useEffect as a } from "react";
5
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
6
- import { createPortal as l } from "react-dom";
4
+ import { offerAssistantPageSettings as i } from "./assistantPageSettings.js";
5
+ import { useCallback as a, useEffect as o } from "react";
6
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
7
+ import { createPortal as u } from "react-dom";
7
8
  // src/shared/assistant/ui/AssistantPageHost.tsx
8
- function u({ className: u, fallback: d = null, start: f }) {
9
- let p = t()?.registerPageHost, m = p !== void 0 && f !== void 0;
10
- a(() => m ? n() : void 0, [m]);
11
- let h = r("above"), g = r("below"), _ = i((e) => {
12
- if (e && p) return p(e);
13
- }, [p]);
14
- return p ? /* @__PURE__ */ c(o, { children: [
15
- /* @__PURE__ */ s("div", {
16
- ref: _,
17
- className: e("flex min-h-0 flex-col", u),
9
+ function d({ className: d, fallback: f = null, start: p, view: m = "chat" }) {
10
+ let h = t()?.registerPageHost, g = h !== void 0 && p !== void 0 && m === "chat";
11
+ o(() => g ? n() : void 0, [g]);
12
+ let _ = h !== void 0 && m === "settings";
13
+ o(() => _ ? i() : void 0, [_]);
14
+ let v = r("above"), y = r("below"), b = a((e) => {
15
+ if (e && h) return h(e);
16
+ }, [h]);
17
+ return h ? /* @__PURE__ */ l(s, { children: [
18
+ /* @__PURE__ */ c("div", {
19
+ ref: b,
20
+ className: e("flex min-h-0 flex-col", d),
18
21
  "data-testid": "assistant-page-host",
19
22
  "data-assistant-page-host": ""
20
23
  }),
21
- m && h && f?.above ? l(f.above, h) : null,
22
- m && g && f?.below ? l(f.below, g) : null
23
- ] }) : /* @__PURE__ */ s(o, { children: d });
24
+ g && v && p?.above ? u(p.above, v) : null,
25
+ g && y && p?.below ? u(p.below, y) : null
26
+ ] }) : /* @__PURE__ */ c(s, { children: f });
24
27
  }
25
- export { u as AssistantPageHost };
28
+ export { d as AssistantPageHost };
@@ -0,0 +1,4 @@
1
+ /** A page shows the settings view while it is mounted. Returns the release (idempotent). */
2
+ export declare function offerAssistantPageSettings(): () => void;
3
+ /** True while a mounted page asks for the settings view. */
4
+ export declare function useAssistantPageSettings(): boolean;
@@ -0,0 +1,22 @@
1
+ import { useSyncExternalStore as e } from "react";
2
+ // src/shared/assistant/ui/assistantPageSettings.ts
3
+ var t = 0, n = /* @__PURE__ */ new Set();
4
+ function r() {
5
+ for (let e of [...n]) e();
6
+ }
7
+ function i(e) {
8
+ return n.add(e), () => {
9
+ n.delete(e);
10
+ };
11
+ }
12
+ function a() {
13
+ t += 1, r();
14
+ let e = !1;
15
+ return () => {
16
+ e || (e = !0, --t, r());
17
+ };
18
+ }
19
+ function o() {
20
+ return e(i, () => t > 0, () => !1);
21
+ }
22
+ export { a as offerAssistantPageSettings, o as useAssistantPageSettings };
@@ -5,184 +5,185 @@ import { assistantHistory as r } from "../../history/historyEngine.js";
5
5
  import { useAssistantHistoryStatus as i } from "../../history/historyStatus.js";
6
6
  import { useAssistantProduct as a } from "../../product.js";
7
7
  import { useAssistantStore as o } from "../../store.js";
8
- import { resolveLanguagePair as s } from "../../voice/languagePair.js";
9
- import { AssistantConversationList as ee } from "../AssistantConversationList.js";
10
- import { assistantModeOptionName as te } from "../composer/AssistantModeMenu.js";
8
+ import { resolveLanguagePair as ee } from "../../voice/languagePair.js";
9
+ import { AssistantConversationList as te } from "../AssistantConversationList.js";
10
+ import { assistantModeOptionName as s } from "../composer/AssistantModeMenu.js";
11
11
  import { useOverlayFocus as c } from "../useOverlayFocus.js";
12
- import { fieldOwnsEscape as l, menuViewEscape as u, recentConversations as d } from "./compactChrome.js";
13
- import { useAssistantNavigate as f } from "../AssistantMarkdownRenderer.js";
14
- import { AssistantVoiceLanguageSettings as ne } from "./AssistantVoiceLanguageSettings.js";
15
- import { PAGE_VIEW_GUTTER as re, useAssistantPageLayout as ie } from "../assistantPageLayout.js";
16
- import { useEffect as p, useLayoutEffect as m, useMemo as ae, useRef as h, useState as oe } from "react";
17
- import { ArrowLeft as g, ChevronRight as _, History as se, Languages as ce, PanelRight as v, Plus as le, UserRound as ue, X as y } from "lucide-react";
18
- import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
12
+ import { fieldOwnsEscape as l, menuViewEscape as u, recentConversations as ne } from "./compactChrome.js";
13
+ import { useAssistantNavigate as re } from "../AssistantMarkdownRenderer.js";
14
+ import { AssistantVoiceLanguageSettings as ie } from "./AssistantVoiceLanguageSettings.js";
15
+ import { AssistantPanelLayoutField as ae } from "./AssistantPanelLayoutField.js";
16
+ import { PAGE_VIEW_GUTTER as oe, useAssistantPageLayout as d } from "../assistantPageLayout.js";
17
+ import { useEffect as f, useLayoutEffect as p, useMemo as se, useRef as m, useState as h } from "react";
18
+ import { ArrowLeft as g, ChevronRight as _, History as ce, Languages as le, Plus as ue, UserRound as de, X as v } from "lucide-react";
19
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
19
20
  // src/shared/assistant/ui/compact/AssistantMenuView.tsx
20
- var C = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", w = `flex size-10 shrink-0 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary ${C}`, T = `flex min-h-11 w-full items-center gap-3 px-4 py-2 text-start text-sm text-text-primary transition-colors hover:bg-bg-sunken ${C} focus-visible:ring-inset`, de = typeof document > "u" ? p : m, E = ({ icon: e, label: t, trailing: n, onClick: r, buttonRef: i, testId: a, describedBy: o }) => /* @__PURE__ */ S("button", {
21
+ var S = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", C = `flex size-10 shrink-0 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary ${S}`, w = `flex min-h-11 w-full items-center gap-3 px-4 py-2 text-start text-sm text-text-primary transition-colors hover:bg-bg-sunken ${S} focus-visible:ring-inset`, fe = typeof document > "u" ? f : p, T = ({ icon: e, label: t, trailing: n, onClick: r, buttonRef: i, testId: a, describedBy: o }) => /* @__PURE__ */ x("button", {
21
22
  ref: i,
22
23
  type: "button",
23
24
  onClick: r,
24
- className: T,
25
+ className: w,
25
26
  "aria-describedby": o,
26
27
  "data-testid": a,
27
28
  children: [
28
- /* @__PURE__ */ x("span", {
29
+ /* @__PURE__ */ b("span", {
29
30
  className: "flex size-5 shrink-0 items-center justify-center text-text-secondary",
30
31
  children: e
31
32
  }),
32
- /* @__PURE__ */ x("span", {
33
+ /* @__PURE__ */ b("span", {
33
34
  className: "min-w-0 flex-1 truncate",
34
35
  children: t
35
36
  }),
36
37
  n
37
38
  ]
38
- }), D = ({ id: e, children: t }) => /* @__PURE__ */ x("h3", {
39
+ }), E = ({ id: e, children: t }) => /* @__PURE__ */ b("h3", {
39
40
  id: e,
40
41
  className: "px-4 pb-1 pt-4 text-xs font-semibold uppercase tracking-wide text-text-muted",
41
42
  children: t
42
- }), fe = ({ title: e, tr: t, onBack: n, backRef: r }) => /* @__PURE__ */ S("div", {
43
+ }), pe = ({ title: e, tr: t, onBack: n, backRef: r }) => /* @__PURE__ */ x("div", {
43
44
  className: "flex items-center gap-1 border-b border-border-default bg-bg-elevated px-2 py-2",
44
- children: [/* @__PURE__ */ x("button", {
45
+ children: [/* @__PURE__ */ b("button", {
45
46
  ref: r,
46
47
  type: "button",
47
48
  onClick: n,
48
- className: w,
49
+ className: C,
49
50
  "aria-label": t("menuView.back", "Back"),
50
51
  "data-testid": "assistant-menu-subview-back",
51
- children: /* @__PURE__ */ x(g, {
52
+ children: /* @__PURE__ */ b(g, {
52
53
  className: "size-5",
53
54
  "aria-hidden": "true"
54
55
  })
55
- }), /* @__PURE__ */ x("h2", {
56
+ }), /* @__PURE__ */ b("h2", {
56
57
  className: "min-w-0 flex-1 truncate text-base font-semibold text-text-primary",
57
58
  children: e
58
59
  })]
59
- }), O = ({ id: p, onClose: m, onRequestClosePanel: O, onNewConversation: pe, AvatarSettings: k, initialView: A = "root", docked: j, onToggleDock: M }) => {
60
- let N = n(), P = ie(), { locale: F } = t(), { modes: I } = a(), { conversations: L, activeConversationId: R, assistantLanguage: z, replyLanguage: me, setActiveConversation: he, setMode: ge } = o(), _e = i((e) => e.product !== null), [B, V] = oe(A === "avatar" && k ? "avatar" : "root");
61
- B === "avatar" && !k && V("root");
62
- let ve = f(), H = h(null), U = h(null), ye = c("assistant-menu"), W = h(null), G = h(null), K = h(null), q = h(null), J = h(A === "avatar" ? "avatar" : "back"), Y = (e) => {
60
+ }), D = ({ id: f, onClose: p, onRequestClosePanel: D, onNewConversation: me, AvatarSettings: O, initialView: k = "root", docked: A, onToggleDock: j }) => {
61
+ let M = n(), N = d(), { locale: P } = t(), { modes: F } = a(), { conversations: I, activeConversationId: L, assistantLanguage: R, replyLanguage: z, setActiveConversation: he, setMode: ge } = o(), _e = i((e) => e.product !== null), [B, V] = h(k === "avatar" && O ? "avatar" : "root");
62
+ B === "avatar" && !O && V("root");
63
+ let ve = re(), H = m(null), U = m(null), ye = c("assistant-menu"), W = m(null), G = m(null), K = m(null), q = m(null), J = m(k === "avatar" ? "avatar" : "back"), Y = (e) => {
63
64
  J.current = e, V(e);
64
65
  }, X = () => V("root");
65
- de(() => {
66
+ fe(() => {
66
67
  B !== "history" && (B === "avatar" ? H.current?.focus({ preventScroll: !0 }) : B === "voice-language" ? G.current?.focus({ preventScroll: !0 }) : (((J.current === "voice-language" ? K.current : J.current === "history" ? q.current : J.current === "avatar" ? U.current : null) ?? W.current)?.focus({ preventScroll: !0 }), J.current = "back"));
67
68
  }, [B]);
68
- let Z = ae(() => d(L), [L]), be = N("history.untitled", "Untitled conversation"), xe = (e) => {
69
- if (_e) r.openConversation(e, { modes: I });
69
+ let Z = se(() => ne(I), [I]), be = M("history.untitled", "Untitled conversation"), xe = (e) => {
70
+ if (_e) r.openConversation(e, { modes: F });
70
71
  else {
71
- let t = L.find((t) => t.id === e);
72
+ let t = I.find((t) => t.id === e);
72
73
  he(e), t && ge(t.mode);
73
74
  }
74
- m();
75
- }, Se = s(z, me, F).input.label, Q = `${p}-settings`, $ = `${p}-recent`;
76
- return /* @__PURE__ */ x(e, {
75
+ p();
76
+ }, Se = ee(R, z, P).input.label, Q = `${f}-settings`, $ = `${f}-recent`;
77
+ return /* @__PURE__ */ b(e, {
77
78
  onDismiss: () => {
78
- B === "history" && l(document.activeElement) || (u(B) === "back" ? X() : m());
79
+ B === "history" && l(document.activeElement) || (u(B) === "back" ? X() : p());
79
80
  },
80
- children: /* @__PURE__ */ x("div", {
81
+ children: /* @__PURE__ */ b("div", {
81
82
  ref: ye,
82
- id: p,
83
+ id: f,
83
84
  tabIndex: -1,
84
85
  role: "region",
85
- "aria-label": N("menuView.title", "Assistant menu"),
86
- className: `absolute inset-0 z-10 flex flex-col bg-bg-surface outline-none animate-in slide-in-from-left-2 fade-in duration-200 motion-reduce:animate-none${P ? ` ${re}` : ""}`,
86
+ "aria-label": M("menuView.title", "Assistant menu"),
87
+ className: `absolute inset-0 z-10 flex flex-col bg-bg-surface outline-none animate-in slide-in-from-left-2 fade-in duration-200 motion-reduce:animate-none${N ? ` ${oe}` : ""}`,
87
88
  "data-testid": "assistant-menu-view",
88
89
  "data-menu-view": B,
89
- children: B === "root" ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ S("div", {
90
+ children: B === "root" ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("div", {
90
91
  className: "flex items-center gap-1 border-b border-border-default bg-bg-elevated px-2 py-2",
91
92
  children: [
92
- /* @__PURE__ */ S("button", {
93
+ /* @__PURE__ */ x("button", {
93
94
  ref: W,
94
95
  type: "button",
95
- onClick: m,
96
- className: `flex min-h-10 items-center gap-1.5 rounded-button px-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken ${C}`,
96
+ onClick: p,
97
+ className: `flex min-h-10 items-center gap-1.5 rounded-button px-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken ${S}`,
97
98
  "data-testid": "assistant-menu-back",
98
- children: [/* @__PURE__ */ x(g, {
99
+ children: [/* @__PURE__ */ b(g, {
99
100
  className: "size-5",
100
101
  "aria-hidden": "true"
101
- }), N("menuView.backToConversation", "Back to conversation")]
102
+ }), M("menuView.backToConversation", "Back to conversation")]
102
103
  }),
103
- /* @__PURE__ */ x("h2", {
104
+ /* @__PURE__ */ b("h2", {
104
105
  className: "sr-only",
105
- children: N("menuView.title", "Assistant menu")
106
+ children: M("menuView.title", "Assistant menu")
106
107
  }),
107
- /* @__PURE__ */ x("span", { className: "flex-1" }),
108
- O ? /* @__PURE__ */ x("button", {
108
+ /* @__PURE__ */ b("span", { className: "flex-1" }),
109
+ D ? /* @__PURE__ */ b("button", {
109
110
  type: "button",
110
- onClick: O,
111
- className: w,
112
- "aria-label": N("header.close", "Close assistant"),
111
+ onClick: D,
112
+ className: C,
113
+ "aria-label": M("header.close", "Close assistant"),
113
114
  "data-testid": "assistant-menu-close",
114
- children: /* @__PURE__ */ x(y, {
115
+ children: /* @__PURE__ */ b(v, {
115
116
  className: "size-5",
116
117
  "aria-hidden": "true"
117
118
  })
118
119
  }) : null
119
120
  ]
120
- }), /* @__PURE__ */ S("div", {
121
+ }), /* @__PURE__ */ x("div", {
121
122
  className: "scrollbar-slim min-h-0 flex-1 overflow-y-auto pb-2",
122
123
  children: [
123
- /* @__PURE__ */ S("button", {
124
+ /* @__PURE__ */ x("button", {
124
125
  type: "button",
125
- onClick: pe,
126
- className: `${T} mt-2`,
126
+ onClick: me,
127
+ className: `${w} mt-2`,
127
128
  "aria-keyshortcuts": "Control+Shift+N Meta+Shift+N",
128
129
  "data-testid": "assistant-new-conversation",
129
130
  children: [
130
- /* @__PURE__ */ x("span", {
131
+ /* @__PURE__ */ b("span", {
131
132
  className: "flex size-5 shrink-0 items-center justify-center text-text-secondary",
132
- children: /* @__PURE__ */ x(le, {
133
+ children: /* @__PURE__ */ b(ue, {
133
134
  className: "size-5",
134
135
  "aria-hidden": "true"
135
136
  })
136
137
  }),
137
- /* @__PURE__ */ x("span", {
138
+ /* @__PURE__ */ b("span", {
138
139
  className: "min-w-0 flex-1 truncate",
139
- children: N("header.newConversation", "New conversation")
140
+ children: M("header.newConversation", "New conversation")
140
141
  }),
141
- /* @__PURE__ */ x("kbd", {
142
+ /* @__PURE__ */ b("kbd", {
142
143
  className: "shrink-0 text-xs text-text-muted",
143
144
  children: "Ctrl+Shift+N"
144
145
  })
145
146
  ]
146
147
  }),
147
- /* @__PURE__ */ S("section", {
148
+ /* @__PURE__ */ x("section", {
148
149
  "aria-labelledby": $,
149
150
  "data-testid": "assistant-menu-recent",
150
151
  children: [
151
- /* @__PURE__ */ x(D, {
152
+ /* @__PURE__ */ b(E, {
152
153
  id: $,
153
- children: N("menuView.recent", "Recent")
154
+ children: M("menuView.recent", "Recent")
154
155
  }),
155
- Z.length === 0 ? /* @__PURE__ */ x("p", {
156
+ Z.length === 0 ? /* @__PURE__ */ b("p", {
156
157
  className: "px-4 py-2 text-sm text-text-muted",
157
- children: N("conversations.empty", "No conversations yet")
158
- }) : /* @__PURE__ */ x("ul", { children: Z.map((e) => {
159
- let t = I.find((t) => t.id === e.mode);
160
- return /* @__PURE__ */ x("li", { children: /* @__PURE__ */ x("button", {
158
+ children: M("conversations.empty", "No conversations yet")
159
+ }) : /* @__PURE__ */ b("ul", { children: Z.map((e) => {
160
+ let t = F.find((t) => t.id === e.mode);
161
+ return /* @__PURE__ */ b("li", { children: /* @__PURE__ */ b("button", {
161
162
  type: "button",
162
163
  onClick: () => xe(e.id),
163
- className: `${T} ${e.id === R ? "bg-bg-elevated" : ""}`,
164
- "aria-current": e.id === R ? "true" : void 0,
164
+ className: `${w} ${e.id === L ? "bg-bg-elevated" : ""}`,
165
+ "aria-current": e.id === L ? "true" : void 0,
165
166
  "data-testid": "assistant-menu-recent-row",
166
- children: /* @__PURE__ */ S("span", {
167
+ children: /* @__PURE__ */ x("span", {
167
168
  className: "min-w-0 flex-1",
168
- children: [/* @__PURE__ */ x("span", {
169
+ children: [/* @__PURE__ */ b("span", {
169
170
  className: "block truncate",
170
171
  children: e.title || be
171
- }), t ? /* @__PURE__ */ x("span", {
172
+ }), t ? /* @__PURE__ */ b("span", {
172
173
  className: "block truncate text-xs text-text-muted",
173
- children: te(N, t)
174
+ children: s(M, t)
174
175
  }) : null]
175
176
  })
176
177
  }) }, e.id);
177
178
  }) }),
178
- /* @__PURE__ */ x(E, {
179
+ /* @__PURE__ */ b(T, {
179
180
  buttonRef: q,
180
- icon: /* @__PURE__ */ x(se, {
181
+ icon: /* @__PURE__ */ b(ce, {
181
182
  className: "size-5",
182
183
  "aria-hidden": "true"
183
184
  }),
184
- label: N("menuView.viewAllHistory", "View all history"),
185
- trailing: /* @__PURE__ */ x(_, {
185
+ label: M("menuView.viewAllHistory", "View all history"),
186
+ trailing: /* @__PURE__ */ b(_, {
186
187
  className: "size-4 text-text-muted",
187
188
  "aria-hidden": "true"
188
189
  }),
@@ -191,38 +192,38 @@ var C = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color
191
192
  })
192
193
  ]
193
194
  }),
194
- /* @__PURE__ */ S("section", {
195
+ /* @__PURE__ */ x("section", {
195
196
  "aria-labelledby": Q,
196
197
  "data-testid": "assistant-menu-settings",
197
198
  children: [
198
- /* @__PURE__ */ x(D, {
199
+ /* @__PURE__ */ b(E, {
199
200
  id: Q,
200
- children: N("menuView.settings", "Settings")
201
+ children: M("menuView.settings", "Settings")
201
202
  }),
202
- /* @__PURE__ */ x(E, {
203
+ /* @__PURE__ */ b(T, {
203
204
  buttonRef: K,
204
- icon: /* @__PURE__ */ x(ce, {
205
+ icon: /* @__PURE__ */ b(le, {
205
206
  className: "size-5",
206
207
  "aria-hidden": "true"
207
208
  }),
208
- label: N("menuView.voiceLanguage", "Voice & language"),
209
- trailing: /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("span", {
209
+ label: M("menuView.voiceLanguage", "Voice & language"),
210
+ trailing: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
210
211
  className: "max-w-[40%] truncate text-xs text-text-muted",
211
212
  children: Se
212
- }), /* @__PURE__ */ x(_, {
213
+ }), /* @__PURE__ */ b(_, {
213
214
  className: "size-4 shrink-0 text-text-muted",
214
215
  "aria-hidden": "true"
215
216
  })] }),
216
217
  onClick: () => Y("voice-language"),
217
218
  testId: "assistant-menu-voice-language-row"
218
219
  }),
219
- k ? /* @__PURE__ */ x(E, {
220
- icon: /* @__PURE__ */ x(ue, {
220
+ O ? /* @__PURE__ */ b(T, {
221
+ icon: /* @__PURE__ */ b(de, {
221
222
  className: "size-5",
222
223
  "aria-hidden": "true"
223
224
  }),
224
- label: N("menuView.avatar", "Avatar"),
225
- trailing: /* @__PURE__ */ x(_, {
225
+ label: M("menuView.avatar", "Avatar"),
226
+ trailing: /* @__PURE__ */ b(_, {
226
227
  className: "size-4 text-text-muted",
227
228
  "aria-hidden": "true"
228
229
  }),
@@ -230,97 +231,71 @@ var C = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color
230
231
  onClick: () => Y("avatar"),
231
232
  testId: "assistant-menu-avatar-row"
232
233
  }) : null,
233
- M ? /* @__PURE__ */ S("fieldset", {
234
- className: "hidden min-w-0 border-0 px-4 py-2 sm:block",
235
- "data-testid": "assistant-menu-panel-layout",
236
- children: [/* @__PURE__ */ S("legend", {
237
- className: "flex items-center gap-3 py-1 text-sm text-text-primary",
238
- children: [/* @__PURE__ */ x(v, {
239
- className: "size-5 shrink-0 text-text-secondary",
240
- "aria-hidden": "true"
241
- }), N("menuView.panelLayout", "Panel layout")]
242
- }), [[
243
- !0,
244
- N("menuView.layoutDocked", "Docked side panel"),
245
- "docked"
246
- ], [
247
- !1,
248
- N("menuView.layoutFloating", "Floating window"),
249
- "floating"
250
- ]].map(([e, t, n]) => /* @__PURE__ */ S("label", {
251
- className: "flex min-h-11 cursor-pointer items-center gap-3 ps-8 text-sm text-text-primary focus-within:ring-2 focus-within:ring-[var(--color-focus-ring)]",
252
- children: [/* @__PURE__ */ x("input", {
253
- type: "radio",
254
- name: `${p}-layout`,
255
- checked: !!j === e,
256
- onChange: () => {
257
- !!j !== e && M();
258
- },
259
- className: "size-4 accent-current",
260
- "data-testid": `assistant-panel-layout-${n}`
261
- }), t]
262
- }, n))]
234
+ j ? /* @__PURE__ */ b(ae, {
235
+ groupName: `${f}-layout`,
236
+ docked: A,
237
+ onToggleDock: j
263
238
  }) : null
264
239
  ]
265
240
  })
266
241
  ]
267
- })] }) : B === "avatar" && k ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ S("div", {
242
+ })] }) : B === "avatar" && O ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("div", {
268
243
  className: "flex shrink-0 items-center gap-1 border-b border-border-default bg-bg-elevated px-1 py-2",
269
244
  children: [
270
- /* @__PURE__ */ x("button", {
245
+ /* @__PURE__ */ b("button", {
271
246
  type: "button",
272
247
  onClick: X,
273
- className: `${w} size-11`,
274
- "aria-label": N("menuView.back", "Back"),
248
+ className: `${C} size-11`,
249
+ "aria-label": M("menuView.back", "Back"),
275
250
  "data-testid": "assistant-menu-subview-back",
276
- children: /* @__PURE__ */ x(g, {
251
+ children: /* @__PURE__ */ b(g, {
277
252
  className: "size-5",
278
253
  "aria-hidden": "true"
279
254
  })
280
255
  }),
281
- /* @__PURE__ */ S("div", {
256
+ /* @__PURE__ */ x("div", {
282
257
  className: "min-w-0 flex-1",
283
- children: [/* @__PURE__ */ x("p", {
258
+ children: [/* @__PURE__ */ b("p", {
284
259
  className: "text-xs text-text-secondary",
285
- children: N("menuView.settings", "Settings")
286
- }), /* @__PURE__ */ x("h2", {
260
+ children: M("menuView.settings", "Settings")
261
+ }), /* @__PURE__ */ b("h2", {
287
262
  ref: H,
288
263
  tabIndex: -1,
289
264
  className: "text-base font-semibold text-text-primary outline-none",
290
265
  "data-testid": "assistant-avatar-settings-heading",
291
- children: N("menuView.avatar", "Avatar")
266
+ children: M("menuView.avatar", "Avatar")
292
267
  })]
293
268
  }),
294
- O ? /* @__PURE__ */ x("button", {
269
+ D ? /* @__PURE__ */ b("button", {
295
270
  type: "button",
296
- onClick: O,
297
- className: `${w} size-11`,
298
- "aria-label": N("header.close", "Close assistant"),
271
+ onClick: D,
272
+ className: `${C} size-11`,
273
+ "aria-label": M("header.close", "Close assistant"),
299
274
  "data-testid": "assistant-avatar-settings-close",
300
- children: /* @__PURE__ */ x(y, {
275
+ children: /* @__PURE__ */ b(v, {
301
276
  className: "size-5",
302
277
  "aria-hidden": "true"
303
278
  })
304
279
  }) : null
305
280
  ]
306
- }), /* @__PURE__ */ x("div", {
281
+ }), /* @__PURE__ */ b("div", {
307
282
  className: "scrollbar-slim min-h-0 min-w-0 flex-1 overflow-y-auto",
308
283
  "data-testid": "assistant-avatar-settings-scroll",
309
- children: /* @__PURE__ */ x(k, { navigate: ve })
310
- })] }) : B === "voice-language" ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(fe, {
311
- title: N("menuView.voiceLanguage", "Voice & language"),
312
- tr: N,
284
+ children: /* @__PURE__ */ b(O, { navigate: ve })
285
+ })] }) : B === "voice-language" ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(pe, {
286
+ title: M("menuView.voiceLanguage", "Voice & language"),
287
+ tr: M,
313
288
  onBack: X,
314
289
  backRef: G
315
- }), /* @__PURE__ */ x("div", {
290
+ }), /* @__PURE__ */ b("div", {
316
291
  className: "scrollbar-slim min-h-0 flex-1 overflow-y-auto",
317
- children: /* @__PURE__ */ x(ne, {})
318
- })] }) : /* @__PURE__ */ x(ee, {
292
+ children: /* @__PURE__ */ b(ie, {})
293
+ })] }) : /* @__PURE__ */ b(te, {
319
294
  presentation: "compact",
320
295
  onBack: X,
321
- onDone: m
296
+ onDone: p
322
297
  })
323
298
  })
324
299
  });
325
300
  };
326
- export { O as AssistantMenuView };
301
+ export { D as AssistantMenuView };
@@ -1,9 +1,5 @@
1
- import { FC, ReactNode, Ref } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  export interface AssistantPageBarProps {
3
- menuOpen: boolean;
4
- menuViewId?: string;
5
- onOpenMenu: () => void;
6
- menuButtonRef?: Ref<HTMLButtonElement>;
7
3
  conversationMenu: ReactNode;
8
4
  onTogglePreview?: () => void;
9
5
  previewOpen?: boolean;
@@ -1,45 +1,27 @@
1
1
  import { useAssistantTr as e } from "../../i18n.js";
2
2
  import { useAssistantPreview as t } from "../../preview/context.js";
3
3
  import { hasAssistantPreviewSurface as n } from "../../preview/types.js";
4
- import { Eye as r, Menu as i } from "lucide-react";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
+ import { Eye as r } from "lucide-react";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  // src/shared/assistant/ui/compact/AssistantPageBar.tsx
7
- var s = "flex size-10 shrink-0 items-center justify-center rounded-button transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", c = "text-text-secondary hover:bg-bg-sunken hover:text-text-primary", l = "bg-action-primary-bg/15 text-action-primary-bg", u = ({ menuOpen: u, menuViewId: d, onOpenMenu: f, menuButtonRef: p, conversationMenu: m, onTogglePreview: h, previewOpen: g }) => {
8
- let _ = e(), v = t();
9
- return /* @__PURE__ */ o("div", {
10
- className: "flex min-h-14 shrink-0 items-center gap-1 px-2 py-2 sm:px-3",
7
+ var o = "flex size-10 shrink-0 items-center justify-center rounded-button transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", s = "text-text-secondary hover:bg-bg-sunken hover:text-text-primary", c = "bg-action-primary-bg/15 text-action-primary-bg", l = ({ conversationMenu: l, onTogglePreview: u, previewOpen: d }) => {
8
+ let f = e(), p = t();
9
+ return /* @__PURE__ */ a("div", {
10
+ className: "flex min-h-12 shrink-0 items-center justify-end gap-1 px-2 py-1 sm:px-3",
11
11
  "data-testid": "assistant-page-bar",
12
12
  "data-presentation": "page",
13
- children: [
14
- /* @__PURE__ */ a("button", {
15
- ref: p,
16
- type: "button",
17
- onClick: f,
18
- className: `${s} ${c}`,
19
- "aria-label": _("header.menu", "Assistant menu"),
20
- "aria-expanded": u,
21
- "aria-controls": u ? d : void 0,
22
- "data-testid": "assistant-menu",
23
- children: /* @__PURE__ */ a(i, {
24
- className: "size-5",
25
- "aria-hidden": "true"
26
- })
27
- }),
28
- /* @__PURE__ */ a("span", { className: "flex-1" }),
29
- n(v) && h ? /* @__PURE__ */ a("button", {
30
- type: "button",
31
- onClick: h,
32
- className: `${s} ${g ? l : c}`,
33
- "aria-label": v.label ?? _("header.preview", "Preview"),
34
- "aria-pressed": !!g,
35
- "data-testid": "assistant-toggle-preview",
36
- children: /* @__PURE__ */ a(r, {
37
- className: "size-5",
38
- "aria-hidden": "true"
39
- })
40
- }) : null,
41
- m
42
- ]
13
+ children: [n(p) && u ? /* @__PURE__ */ i("button", {
14
+ type: "button",
15
+ onClick: u,
16
+ className: `${o} ${d ? c : s}`,
17
+ "aria-label": p.label ?? f("header.preview", "Preview"),
18
+ "aria-pressed": !!d,
19
+ "data-testid": "assistant-toggle-preview",
20
+ children: /* @__PURE__ */ i(r, {
21
+ className: "size-5",
22
+ "aria-hidden": "true"
23
+ })
24
+ }) : null, l]
43
25
  });
44
26
  };
45
- export { u as AssistantPageBar };
27
+ export { l as AssistantPageBar };
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ export interface AssistantPanelLayoutFieldProps {
3
+ /** The radio group's name: unique per instance. */
4
+ readonly groupName: string;
5
+ readonly docked: boolean | undefined;
6
+ readonly onToggleDock: () => void;
7
+ }
8
+ export declare const AssistantPanelLayoutField: FC<AssistantPanelLayoutFieldProps>;