@burdenoff/fe-libs 2026.1114.10 → 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.
@@ -358,6 +358,7 @@ export * from './ui/AssistantPageHost';
358
358
  export * from './ui/assistantPageSurface';
359
359
  export * from './ui/assistantPageLayout';
360
360
  export * from './ui/assistantPageStart';
361
+ export * from './ui/assistantPageSettings';
361
362
  export * from './ui/assistantPanelLoader';
362
363
  export * from './ui/AssistantPanelPlaceholder';
363
364
  export * from './openui/generativeUi';
@@ -403,6 +404,8 @@ export * from './ui/closeGuard';
403
404
  export * from './ui/compact/compactChrome';
404
405
  export * from './ui/compact/AssistantCompactHeader';
405
406
  export * from './ui/compact/AssistantPageBar';
407
+ export * from './ui/compact/AssistantPanelLayoutField';
408
+ export * from './ui/compact/AssistantSettingsView';
406
409
  export * from './ui/compact/AssistantConversationMenu';
407
410
  export * from './ui/compact/AssistantDiscardDraftDialog';
408
411
  export * from './ui/compact/AssistantMenuView';
@@ -32,209 +32,211 @@ import { AssistantWindowHeader as Le } from "./compact/AssistantWindowHeader.js"
32
32
  import { AssistantPageBar as Re } from "./compact/AssistantPageBar.js";
33
33
  import { avatarViewSwitchIds as ze } from "./compact/AssistantViewSwitch.js";
34
34
  import { AssistantPageLayoutContext as Be } from "./assistantPageLayout.js";
35
- import { WINDOW_VOICE_IDLE as Ve, useAssistantWindowView as He } from "./compact/windowView.js";
36
- import { closeRequestAction as Ue, useCompactExpandOffered as We } from "./compact/compactChrome.js";
37
- import { useCallback as n, useEffect as r, useId as Ge, useLayoutEffect as Ke, useMemo as i, useRef as a, useState as o } from "react";
38
- import { Fragment as qe, jsx as s, jsxs as c } from "react/jsx-runtime";
35
+ import { useAssistantPageSettings as Ve } from "./assistantPageSettings.js";
36
+ import { AssistantSettingsView as He } from "./compact/AssistantSettingsView.js";
37
+ import { WINDOW_VOICE_IDLE as Ue, useAssistantWindowView as We } from "./compact/windowView.js";
38
+ import { closeRequestAction as Ge, useCompactExpandOffered as Ke } from "./compact/compactChrome.js";
39
+ import { useCallback as n, useEffect as r, useId as qe, useLayoutEffect as Je, useMemo as i, useRef as a, useState as o } from "react";
40
+ import { Fragment as Ye, jsx as s, jsxs as c } from "react/jsx-runtime";
39
41
  // src/shared/assistant/ui/AIAssistantPanel.tsx
40
- var Je = { backgroundColor: "var(--color-bg-elevated)" }, l = ({ onClose: l, visible: u, docked: Ye, onToggleDock: Xe, writeAccess: Ze, onNavigate: Qe, isShellLessTarget: $e, connectSourceHref: et, onConnectSource: tt, preview: nt, liveAvatar: d, presentation: f, onExpandedChange: p, surface: m, onOpenFull: h, avatarSettingsRequest: g, onMinimize: _, windowView: rt, onWindowViewChange: it, pageHosted: v = !1, serverHistory: at = !1 }) => {
41
- let ot = ke(), st = pe(d);
42
- Ae(at);
43
- let [ct, y] = o(!1), b = Oe(nt);
44
- ct && !b && y(!1);
45
- let x = ct && b, lt = Se();
46
- be(xe(nt, lt));
47
- let S = a(null);
48
- je(S);
49
- let { conversations: ut, activeConversationId: dt, conversationListOpen: C, setConversationListOpen: w, createConversation: T } = t(), E = f === "compact", D = E && m === "window", ft = E && v && !D, [pt, O] = o(!1), [mt, k] = o("root"), [ht, gt] = o(0), _t = a(0);
50
- pt && (!E || D || C || x) && O(!1);
51
- let A = E && pt, [vt, j] = o(!1), M = We(E && !D && !v && p !== void 0), [N, yt] = o(!1), P = M && N;
42
+ var Xe = { backgroundColor: "var(--color-bg-elevated)" }, l = ({ onClose: l, visible: u, docked: d, onToggleDock: f, writeAccess: Ze, onNavigate: Qe, isShellLessTarget: $e, connectSourceHref: et, onConnectSource: tt, preview: p, liveAvatar: m, presentation: h, onExpandedChange: g, surface: _, onOpenFull: v, avatarSettingsRequest: y, onMinimize: b, windowView: nt, onWindowViewChange: rt, pageHosted: x = !1, serverHistory: it = !1 }) => {
43
+ let at = ke(), ot = pe(m);
44
+ Ae(it);
45
+ let [st, S] = o(!1), C = Oe(p);
46
+ st && !C && S(!1);
47
+ let w = st && C, ct = Se();
48
+ be(xe(p, ct));
49
+ let T = a(null);
50
+ je(T);
51
+ let { conversations: lt, activeConversationId: ut, conversationListOpen: E, setConversationListOpen: D, createConversation: O } = t(), k = h === "compact", A = k && _ === "window", j = k && x && !A, dt = Ve(), M = j && dt, ft = t((e) => (e.conversations.find((t) => t.id === e.activeConversationId)?.messages.length ?? 0) > 0), [pt, N] = o(!1), [mt, P] = o("root"), [ht, gt] = o(0), _t = a(0);
52
+ pt && (!k || A || E || w) && N(!1);
53
+ let F = k && pt, [vt, I] = o(!1), L = Ke(k && !A && !x && g !== void 0), [R, yt] = o(!1), z = L && R;
52
54
  r(() => {
53
- N && !M && (yt(!1), p?.(!1));
55
+ R && !L && (yt(!1), g?.(!1));
54
56
  }, [
55
- N,
56
- M,
57
- p
57
+ R,
58
+ L,
59
+ g
58
60
  ]);
59
61
  let bt = () => {
60
- let e = !P;
61
- yt(e), p?.(e);
62
- }, xt = a(!1), St = a(p);
62
+ let e = !z;
63
+ yt(e), g?.(e);
64
+ }, xt = a(!1), St = a(g);
63
65
  r(() => {
64
- xt.current = P, St.current = p;
66
+ xt.current = z, St.current = g;
65
67
  }), r(() => () => {
66
68
  xt.current && St.current?.(!1);
67
69
  }, []);
68
- let F = C || x || A, I = d?.tab, L = me(I), [R, z] = o(!1), Ct = He({
69
- stored: rt ?? null,
70
- onRemember: it
70
+ let B = E || w || F || M, V = m?.tab, H = me(V), [U, W] = o(!1), Ct = We({
71
+ stored: nt ?? null,
72
+ onRemember: rt
71
73
  });
72
- if (!E) R && (!I || u === !1) && z(!1);
74
+ if (!k) U && (!V || u === !1) && W(!1);
73
75
  else {
74
- let e = !ft && Ct.view === "avatar" && I?.CompactView !== void 0 && u !== !1 && (L || R);
75
- e !== R && z(e);
76
+ let e = !j && Ct.view === "avatar" && V?.CompactView !== void 0 && u !== !1 && (H || U);
77
+ e !== U && W(e);
76
78
  }
77
- let wt = I !== void 0 && (L || R) && (!E || I.CompactView !== void 0), B = Ge(), V = Ge(), H = i(() => wt ? {
78
- chatTab: `${B}-chat-tab`,
79
- avatarTab: `${B}-avatar-tab`,
80
- chatPanel: `${B}-chat-panel`,
81
- avatarPanel: `${B}-avatar-panel`,
82
- leaveHint: `${B}-avatar-leave`
83
- } : null, [wt, B]), Tt = n(() => z(!1), []), U = a(null), W = Ct.select, G = n((e) => {
84
- U.current = e, W(e);
85
- }, [W]), K = a(null), Et = n((e) => {
86
- K.current = e;
87
- }, []), q = L ? I?.SettingsView : void 0, Dt = n(() => {
88
- D ? h?.({ menu: "settings/avatar" }) : q && (w(!1), y(!1), k("avatar"), gt((e) => e + 1), O(!0));
79
+ let wt = V !== void 0 && (H || U) && (!k || V.CompactView !== void 0), G = qe(), Tt = qe(), K = i(() => wt ? {
80
+ chatTab: `${G}-chat-tab`,
81
+ avatarTab: `${G}-avatar-tab`,
82
+ chatPanel: `${G}-chat-panel`,
83
+ avatarPanel: `${G}-avatar-panel`,
84
+ leaveHint: `${G}-avatar-leave`
85
+ } : null, [wt, G]), Et = n(() => W(!1), []), Dt = a(null), q = Ct.select, J = n((e) => {
86
+ Dt.current = e, q(e);
87
+ }, [q]), Ot = a(null), kt = n((e) => {
88
+ Ot.current = e;
89
+ }, []), Y = H ? V?.SettingsView : void 0, At = n(() => {
90
+ A ? v?.({ menu: "settings/avatar" }) : Y && (D(!1), S(!1), P("avatar"), gt((e) => e + 1), N(!0));
89
91
  }, [
90
- D,
91
- h,
92
- q,
93
- w
94
- ]), [Ot, kt] = o(0), J = i(() => E ? {
95
- surface: D ? "window" : "panel",
96
- view: R ? "avatar" : "chat",
97
- selectView: G,
98
- openSettings: Dt,
99
- focusRequest: Ot
92
+ A,
93
+ v,
94
+ Y,
95
+ D
96
+ ]), [jt, Mt] = o(0), Nt = i(() => k ? {
97
+ surface: A ? "window" : "panel",
98
+ view: U ? "avatar" : "chat",
99
+ selectView: J,
100
+ openSettings: At,
101
+ focusRequest: jt
100
102
  } : void 0, [
101
- E,
102
- D,
103
- R,
104
- G,
105
- Dt,
106
- Ot
107
- ]), At = i(() => ({
108
- open: R,
109
- close: E ? () => G("chat") : Tt,
110
- ids: H,
111
- covered: F,
112
- setReplyEscape: Et,
113
- ...J ? { compact: J } : {}
103
+ k,
104
+ A,
105
+ U,
106
+ J,
107
+ At,
108
+ jt
109
+ ]), Pt = i(() => ({
110
+ open: U,
111
+ close: k ? () => J("chat") : Et,
112
+ ids: K,
113
+ covered: B,
114
+ setReplyEscape: kt,
115
+ ...Nt ? { compact: Nt } : {}
114
116
  }), [
115
- R,
116
- E,
117
- G,
118
- Tt,
119
- H,
120
- F,
117
+ U,
118
+ k,
119
+ J,
121
120
  Et,
122
- J
123
- ]), jt = (e) => z(e === "avatar");
124
- Ke(() => {
125
- let e = U.current;
126
- if (e === null || (U.current = null, !H || e === "avatar" !== R)) return;
127
- let t = R ? ze(H).avatarTab : H.chatTab;
121
+ K,
122
+ B,
123
+ kt,
124
+ Nt
125
+ ]), Ft = (e) => W(e === "avatar");
126
+ Je(() => {
127
+ let e = Dt.current;
128
+ if (e === null || (Dt.current = null, !K || e === "avatar" !== U)) return;
129
+ let t = U ? ze(K).avatarTab : K.chatTab;
128
130
  document.getElementById(t)?.focus({ preventScroll: !0 });
129
131
  }), r(() => {
130
- E && g && _t.current !== g && (_t.current = g, q && !D && (w(!1), y(!1), k("avatar"), gt(g), O(!0)));
132
+ k && y && _t.current !== y && (_t.current = y, Y && !A && (D(!1), S(!1), P("avatar"), gt(y), N(!0)));
131
133
  }, [
132
- E,
133
- g,
134
- q,
135
- D,
136
- w
134
+ k,
135
+ y,
136
+ Y,
137
+ A,
138
+ D
137
139
  ]);
138
- let Mt = Te({
139
- historyOpen: C,
140
- previewOpen: x,
141
- avatarOpen: R
142
- }) ?? (A ? "menu" : null), Y = (e) => {
140
+ let It = Te({
141
+ historyOpen: E,
142
+ previewOpen: w,
143
+ avatarOpen: U
144
+ }) ?? (F ? "menu" : null), X = (e) => {
143
145
  let t = De({
144
- historyOpen: C,
145
- previewOpen: x
146
+ historyOpen: E,
147
+ previewOpen: w
146
148
  }, e);
147
- w(t.historyOpen), y(t.previewOpen);
148
- }, Nt = i(() => ({ run: () => C ? { status: "already" } : (w(!0), y(!1), { status: "done" }) }), [C, w]);
149
- le("assistant.history", Nt);
150
- let Pt = i(() => b ? {
149
+ D(t.historyOpen), S(t.previewOpen);
150
+ }, Lt = i(() => ({ run: () => E ? { status: "already" } : (D(!0), S(!1), { status: "done" }) }), [E, D]);
151
+ le("assistant.history", Lt);
152
+ let Rt = i(() => C ? {
151
153
  surface: "panel",
152
- run: () => x ? { status: "already" } : (w(!1), y(!0), { status: "done" }),
153
- close: () => x ? (y(!1), { status: "done" }) : { status: "already" }
154
+ run: () => w ? { status: "already" } : (D(!1), S(!0), { status: "done" }),
155
+ close: () => w ? (S(!1), { status: "done" }) : { status: "already" }
154
156
  } : null, [
155
- b,
156
- x,
157
- w
157
+ C,
158
+ w,
159
+ D
158
160
  ]);
159
- le("assistant.preview", Pt);
160
- let Ft = ut.find((e) => e.id === dt), It = Ft?.backendSessionId ?? null;
161
- te(It, Ft?.mode ?? null, u ?? !0), e(u ?? !0);
162
- let Lt = ne(u !== !1), X = Me(), Z = a(!1), Rt = n((e) => {
163
- Z.current = e;
164
- }, []), zt = a(!1), [Bt, Vt] = o(!1), Q = n(() => Ue({
165
- compact: E,
166
- unsent: Z.current,
167
- confirmed: zt.current
168
- }) !== "close" && (Vt(!0), !0), [E]);
161
+ le("assistant.preview", Rt);
162
+ let zt = lt.find((e) => e.id === ut), Bt = zt?.backendSessionId ?? null;
163
+ te(Bt, zt?.mode ?? null, u ?? !0), e(u ?? !0);
164
+ let Vt = ne(u !== !1), Z = Me(), Ht = a(!1), Ut = n((e) => {
165
+ Ht.current = e;
166
+ }, []), Wt = a(!1), [Gt, Kt] = o(!1), Q = n(() => Ge({
167
+ compact: k,
168
+ unsent: Ht.current,
169
+ confirmed: Wt.current
170
+ }) !== "close" && (Kt(!0), !0), [k]);
169
171
  r(() => {
170
- if (E && X) return X(Q);
172
+ if (k && Z) return Z(Q);
171
173
  }, [
172
- E,
173
- X,
174
+ k,
175
+ Z,
174
176
  Q
175
177
  ]);
176
- let $ = n(() => {
177
- v || (D && _ ? _() : Q() || l());
178
+ let qt = n(() => {
179
+ x || (A && b ? b() : Q() || l());
178
180
  }, [
179
- v,
180
- D,
181
- _,
181
+ x,
182
+ A,
183
+ b,
182
184
  Q,
183
185
  l
184
- ]), Ht = () => {
185
- zt.current = !0, Z.current = !1, Vt(!1);
186
+ ]), Jt = () => {
187
+ Wt.current = !0, Ht.current = !1, Kt(!1);
186
188
  try {
187
189
  l();
188
190
  } finally {
189
- zt.current = !1;
191
+ Wt.current = !1;
190
192
  }
191
- }, Ut = a(null), Wt = a(null), Gt = a(null), Kt = n(() => O(!1), []), [qt, Jt] = o(0), Yt = n(() => {
192
- T(), O(!1), w(!1), Jt((e) => e + 1);
193
- }, [T, w]), [Xt, Zt] = o(Ve), Qt = n((e) => {
194
- Zt((t) => t.live === e.live ? t : e);
195
- }, []), $t = he(I), en = n((e) => {
196
- h?.(), Xt.live || e?.review === !0 || (E && R ? kt((e) => e + 1) : Jt((e) => e + 1));
193
+ }, Yt = a(null), Xt = a(null), Zt = a(null), Qt = n(() => N(!1), []), [$t, en] = o(0), tn = n(() => {
194
+ O(), N(!1), D(!1), en((e) => e + 1);
195
+ }, [O, D]), [$, nn] = o(Ue), rn = n((e) => {
196
+ nn((t) => t.live === e.live ? t : e);
197
+ }, []), an = he(V), on = n((e) => {
198
+ v?.(), $.live || e?.review === !0 || (k && U ? Mt((e) => e + 1) : en((e) => e + 1));
197
199
  }, [
198
- h,
199
- Xt.live,
200
- E,
201
- R
202
- ]), tn = n(() => {
203
- W("chat"), Jt((e) => e + 1);
204
- }, [W]), nn = n(() => {
205
- O(!1), j(!0);
206
- }, []), rn = a(!1);
200
+ v,
201
+ $.live,
202
+ k,
203
+ U
204
+ ]), sn = n(() => {
205
+ q("chat"), en((e) => e + 1);
206
+ }, [q]), cn = n(() => {
207
+ N(!1), I(!0);
208
+ }, []), ln = a(!1);
207
209
  return r(() => {
208
- if (rn.current && !A) {
210
+ if (ln.current && !F) {
209
211
  let e = document.activeElement;
210
- e && e !== document.body && e !== S.current || Wt.current?.focus({ preventScroll: !0 });
212
+ e && e !== document.body && e !== T.current || Xt.current?.focus({ preventScroll: !0 });
211
213
  }
212
- rn.current = A;
213
- }, [A]), r(() => {
214
- qt > 0 && Ut.current?.focus({ preventScroll: !0 });
215
- }, [qt]), ee({
216
- panelRef: S,
217
- inputRef: E ? Ut : void 0,
218
- onNewConversation: E ? Yt : void 0,
219
- onOpenConversationMenu: E && !D ? nn : void 0,
214
+ ln.current = F;
215
+ }, [F]), r(() => {
216
+ $t > 0 && Yt.current?.focus({ preventScroll: !0 });
217
+ }, [$t]), ee({
218
+ panelRef: T,
219
+ inputRef: k ? Yt : void 0,
220
+ onNewConversation: k ? tn : void 0,
221
+ onOpenConversationMenu: k && !A ? cn : void 0,
220
222
  onClose: () => {
221
223
  let e = Ee({
222
- historyOpen: C,
223
- previewOpen: x,
224
- avatarOpen: R,
225
- tabReplySpeaking: K.current !== null
224
+ historyOpen: E,
225
+ previewOpen: w,
226
+ avatarOpen: U,
227
+ tabReplySpeaking: Ot.current !== null
226
228
  });
227
- e === "overlay" ? (w(!1), y(!1)) : e === "tab-reply" ? K.current?.() : e === "tab" && E ? G("chat") : e === "tab" ? (z(!1), H && document.getElementById(H.chatTab)?.focus()) : A ? O(!1) : $();
229
+ e === "overlay" ? (D(!1), S(!1)) : e === "tab-reply" ? Ot.current?.() : e === "tab" && k ? J("chat") : e === "tab" ? (W(!1), K && document.getElementById(K.chatTab)?.focus()) : F ? N(!1) : qt();
228
230
  }
229
231
  }), /* @__PURE__ */ s(ue, {
230
232
  visible: u ?? !0,
231
- engine: st,
233
+ engine: ot,
232
234
  children: /* @__PURE__ */ s(de, {
233
- value: d,
235
+ value: m,
234
236
  children: /* @__PURE__ */ s(fe.Provider, {
235
- value: At,
237
+ value: Pt,
236
238
  children: /* @__PURE__ */ s(ve, {
237
- value: nt,
239
+ value: p,
238
240
  children: /* @__PURE__ */ s(ae, {
239
241
  navigate: Qe,
240
242
  isShellLessTarget: $e,
@@ -242,110 +244,108 @@ var Je = { backgroundColor: "var(--color-bg-elevated)" }, l = ({ onClose: l, vis
242
244
  value: et,
243
245
  onOpen: tt,
244
246
  children: /* @__PURE__ */ s(se, { children: /* @__PURE__ */ s(ce, { children: /* @__PURE__ */ s(Be.Provider, {
245
- value: ft,
247
+ value: j,
246
248
  children: /* @__PURE__ */ c("div", {
247
- ref: S,
249
+ ref: T,
248
250
  className: "relative flex h-full w-full flex-col bg-bg-surface",
249
- style: D ? Je : void 0,
251
+ style: A ? Xe : void 0,
250
252
  role: "complementary",
251
- "aria-label": D ? ot("window.title", "Quick assistant") : ot("panel.ariaLabel", "AI Assistant"),
253
+ "aria-label": A ? at("window.title", "Quick assistant") : at("panel.ariaLabel", "AI Assistant"),
252
254
  "data-testid": "ai-assistant-panel",
253
255
  [we]: "",
254
- ...Mt ? { [Ce]: Mt } : {},
255
- ...E ? {
256
+ ...It ? { [Ce]: It } : {},
257
+ ...k ? {
256
258
  "data-presentation": "compact",
257
- ...m ? { "data-assistant-surface": m } : {},
258
- ...P ? { "data-assistant-expanded": "" } : {}
259
+ ..._ ? { "data-assistant-surface": _ } : {},
260
+ ...z ? { "data-assistant-expanded": "" } : {}
259
261
  } : {},
260
- ...v ? { "data-assistant-page-hosted": "" } : {},
262
+ ...x ? { "data-assistant-page-hosted": "" } : {},
261
263
  tabIndex: -1,
262
264
  children: [
263
265
  /* @__PURE__ */ c("div", {
264
266
  className: "contents",
265
- inert: F || void 0,
266
- children: [E ? /* @__PURE__ */ c(qe, { children: [D ? /* @__PURE__ */ s(Le, {
267
- voiceLive: Xt.live,
268
- avatarOn: $t,
269
- onOpenFull: en,
270
- onMinimize: () => _?.()
271
- }) : ft ? /* @__PURE__ */ s(Re, {
272
- menuOpen: A,
273
- menuViewId: V,
274
- onOpenMenu: () => {
275
- k("root"), O(!0);
276
- },
277
- menuButtonRef: Wt,
267
+ inert: B || void 0,
268
+ children: [k ? /* @__PURE__ */ c(Ye, { children: [A ? /* @__PURE__ */ s(Le, {
269
+ voiceLive: $.live,
270
+ avatarOn: an,
271
+ onOpenFull: on,
272
+ onMinimize: () => b?.()
273
+ }) : j ? ft && !M ? /* @__PURE__ */ s(Re, {
278
274
  conversationMenu: /* @__PURE__ */ s(Pe, {
279
275
  open: vt,
280
- onOpenChange: j,
281
- triggerRef: Gt
276
+ onOpenChange: I,
277
+ triggerRef: Zt
282
278
  }),
283
- onTogglePreview: () => Y("preview"),
284
- previewOpen: x
285
- }) : /* @__PURE__ */ s(Ne, {
286
- contextLabel: Lt,
287
- menuOpen: A,
288
- menuViewId: V,
279
+ onTogglePreview: () => X("preview"),
280
+ previewOpen: w
281
+ }) : null : /* @__PURE__ */ s(Ne, {
282
+ contextLabel: Vt,
283
+ menuOpen: F,
284
+ menuViewId: Tt,
289
285
  onOpenMenu: () => {
290
- k("root"), O(!0);
286
+ P("root"), N(!0);
291
287
  },
292
- menuButtonRef: Wt,
288
+ menuButtonRef: Xt,
293
289
  conversationMenu: /* @__PURE__ */ s(Pe, {
294
290
  open: vt,
295
- onOpenChange: j,
296
- triggerRef: Gt
291
+ onOpenChange: I,
292
+ triggerRef: Zt
297
293
  }),
298
- expandOffered: M,
299
- expanded: P,
294
+ expandOffered: L,
295
+ expanded: z,
300
296
  onToggleExpanded: bt,
301
- onTogglePreview: () => Y("preview"),
302
- previewOpen: x,
303
- onClose: v ? void 0 : $
297
+ onTogglePreview: () => X("preview"),
298
+ previewOpen: w,
299
+ onClose: x ? void 0 : qt
304
300
  }), /* @__PURE__ */ s(Fe, {
305
- open: Bt,
306
- onKeep: () => Vt(!1),
307
- onDiscard: Ht
301
+ open: Gt,
302
+ onKeep: () => Kt(!1),
303
+ onDiscard: Jt
308
304
  })] }) : /* @__PURE__ */ s(re, {
309
- contextLabel: Lt,
310
- onNewConversation: () => T(),
311
- onOpenHistory: () => Y("history"),
312
- historyOpen: C,
313
- onTogglePreview: () => Y("preview"),
314
- previewOpen: x,
315
- onClose: v ? void 0 : l,
316
- docked: Ye,
317
- onToggleDock: v ? void 0 : Xe
318
- }), H && !E ? /* @__PURE__ */ s(ge, {
319
- selected: R ? "avatar" : "chat",
320
- onSelect: jt,
321
- ids: H
305
+ contextLabel: Vt,
306
+ onNewConversation: () => O(),
307
+ onOpenHistory: () => X("history"),
308
+ historyOpen: E,
309
+ onTogglePreview: () => X("preview"),
310
+ previewOpen: w,
311
+ onClose: x ? void 0 : l,
312
+ docked: d,
313
+ onToggleDock: x ? void 0 : f
314
+ }), K && !k ? /* @__PURE__ */ s(ge, {
315
+ selected: U ? "avatar" : "chat",
316
+ onSelect: Ft,
317
+ ids: K
322
318
  }) : null]
323
319
  }),
324
- C ? /* @__PURE__ */ s(oe, { presentation: f }) : A ? /* @__PURE__ */ s(Ie, {
320
+ M ? /* @__PURE__ */ s(He, {
321
+ AvatarSettings: Y,
322
+ docked: d,
323
+ onToggleDock: f
324
+ }) : E ? /* @__PURE__ */ s(oe, { presentation: h }) : F ? /* @__PURE__ */ s(Ie, {
325
325
  initialView: mt,
326
- id: V,
327
- onClose: Kt,
328
- onRequestClosePanel: v ? void 0 : $,
329
- onNewConversation: Yt,
330
- AvatarSettings: q,
331
- docked: Ye,
332
- onToggleDock: v ? void 0 : Xe
326
+ id: Tt,
327
+ onClose: Qt,
328
+ onRequestClosePanel: x ? void 0 : qt,
329
+ onNewConversation: tn,
330
+ AvatarSettings: Y,
331
+ docked: d,
332
+ onToggleDock: x ? void 0 : f
333
333
  }, ht) : null,
334
- x && /* @__PURE__ */ s(ye, { onClose: () => y(!1) }),
334
+ w && /* @__PURE__ */ s(ye, { onClose: () => S(!1) }),
335
335
  /* @__PURE__ */ s("div", {
336
336
  className: "contents",
337
- inert: F || void 0,
337
+ inert: B || void 0,
338
338
  children: /* @__PURE__ */ s(ie, {
339
339
  visible: u ?? !0,
340
340
  writeAccess: Ze,
341
- presentation: f,
342
- inputRef: E ? Ut : void 0,
343
- onDraftDirtyChange: E ? Rt : void 0,
344
- ...D ? {
345
- surface: m,
346
- onWindowVoiceChange: Qt,
347
- onOpenFull: en,
348
- onContinuedInChat: tn
341
+ presentation: h,
342
+ inputRef: k ? Yt : void 0,
343
+ onDraftDirtyChange: k ? Ut : void 0,
344
+ ...A ? {
345
+ surface: _,
346
+ onWindowVoiceChange: rn,
347
+ onOpenFull: on,
348
+ onContinuedInChat: sn
349
349
  } : {}
350
350
  })
351
351
  })
@@ -16,5 +16,10 @@ export interface AssistantPageHostProps {
16
16
  fallback?: ReactNode;
17
17
  /** The page's own content for a new chat, around the message box. Absent: the assistant's own empty state. */
18
18
  start?: AssistantPageStart;
19
+ /**
20
+ * What the hosted panel shows: its chat (default), or only its settings (Voice & language, Avatar, Panel
21
+ * layout) over the kept chat, for a settings page (BOFF-13461: Settings › Assistant).
22
+ */
23
+ view?: 'chat' | 'settings';
19
24
  }
20
- export declare function AssistantPageHost({ className, fallback, start }: AssistantPageHostProps): import('react').JSX.Element;
25
+ export declare function AssistantPageHost({ className, fallback, start, view, }: AssistantPageHostProps): import('react').JSX.Element;
@@ -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;