@burdenoff/fe-libs 2026.1113.9 → 2026.1113.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.
Files changed (30) hide show
  1. package/dist/shared/assistant/index.d.ts +4 -0
  2. package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +7 -0
  3. package/dist/shared/assistant/ui/AIAssistantPanel.js +278 -250
  4. package/dist/shared/assistant/ui/AssistantChatArea.js +1243 -1241
  5. package/dist/shared/assistant/ui/AssistantConversationList.js +253 -252
  6. package/dist/shared/assistant/ui/AssistantHeader.d.ts +2 -1
  7. package/dist/shared/assistant/ui/AssistantHeader.js +1 -1
  8. package/dist/shared/assistant/ui/AssistantMessageList.js +48 -47
  9. package/dist/shared/assistant/ui/AssistantOverlay.d.ts +46 -2
  10. package/dist/shared/assistant/ui/AssistantOverlay.js +359 -307
  11. package/dist/shared/assistant/ui/AssistantPageHost.d.ts +11 -0
  12. package/dist/shared/assistant/ui/AssistantPageHost.js +17 -0
  13. package/dist/shared/assistant/ui/assistantPageLayout.d.ts +13 -0
  14. package/dist/shared/assistant/ui/assistantPageLayout.js +8 -0
  15. package/dist/shared/assistant/ui/assistantPageSurface.d.ts +11 -0
  16. package/dist/shared/assistant/ui/assistantPageSurface.js +10 -0
  17. package/dist/shared/assistant/ui/avatar/AssistantCompactAvatar.d.ts +6 -0
  18. package/dist/shared/assistant/ui/avatar/AssistantCompactAvatar.js +77 -71
  19. package/dist/shared/assistant/ui/compact/AssistantCompactHeader.d.ts +2 -1
  20. package/dist/shared/assistant/ui/compact/AssistantCompactHeader.js +2 -2
  21. package/dist/shared/assistant/ui/compact/AssistantMenuView.d.ts +5 -2
  22. package/dist/shared/assistant/ui/compact/AssistantMenuView.js +132 -131
  23. package/dist/shared/assistant/ui/compact/AssistantPageBar.d.ts +13 -0
  24. package/dist/shared/assistant/ui/compact/AssistantPageBar.js +46 -0
  25. package/dist/shared/assistant/ui/compact/AssistantViewSwitch.d.ts +5 -0
  26. package/dist/shared/assistant/ui/compact/AssistantViewSwitch.js +11 -11
  27. package/dist/shared/assistant/ui/composer/AssistantCompactFooter.js +15 -11
  28. package/dist/shared/assistant/ui/composer/AssistantComposer.js +258 -257
  29. package/dist/shared-assistant.js +71 -67
  30. package/package.json +1 -1
@@ -24,7 +24,8 @@ interface Props {
24
24
  */
25
25
  onTogglePreview?: () => void;
26
26
  previewOpen?: boolean;
27
- onClose: () => void;
27
+ /** Absent (a page hosts the panel, BOFF-13461): no Close button. */
28
+ onClose?: () => void;
28
29
  docked?: boolean;
29
30
  onToggleDock?: () => void;
30
31
  }
@@ -67,7 +67,7 @@ var g = ({ contextLabel: g, onNewConversation: _, onOpenHistory: v, historyOpen:
67
67
  "data-testid": "assistant-toggle-dock",
68
68
  children: m(C ? c : l, { className: "size-4" })
69
69
  }),
70
- /* @__PURE__ */ m("button", {
70
+ S && /* @__PURE__ */ m("button", {
71
71
  type: "button",
72
72
  onClick: S,
73
73
  className: "rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
@@ -4,69 +4,70 @@ import { useAssistantTr as n } from "../i18n.js";
4
4
  import { useLiveOverlay as r } from "../liveOverlay.js";
5
5
  import { approvalFollowUpReplyIds as i, approvedPendingWriteIds as a, goAheadSentReplyIds as o } from "../liveTurns.js";
6
6
  import { scrollToEndWithin as s } from "./scrollWithin.js";
7
- import { useEffect as c, useRef as l } from "react";
8
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
7
+ import { PAGE_SCROLL_GUTTER as c, useAssistantPageLayout as l } from "./assistantPageLayout.js";
8
+ import { useEffect as u, useRef as d } from "react";
9
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
10
  // src/shared/assistant/ui/AssistantMessageList.tsx
10
- var f = 250, p = ({ onApprovePendingWrite: f, approvingWriteRef: p = null, approvableMessageId: m = null, retryableMessageId: h = null, messages: g, processing: _, streamingMessageId: v, failedMessageId: y, onRetry: b, renderWriteProposals: x, hidesLegacyWriteCard: S, renderUiOffers: C, onStopTurn: w, stopTurnLabel: T }) => {
11
- let E = n(), D = (() => {
12
- for (let e = g.length - 1; e >= 0; --e) if (g[e].role === "assistant") return g[e].id;
11
+ var m = 250, h = ({ onApprovePendingWrite: m, approvingWriteRef: h = null, approvableMessageId: g = null, retryableMessageId: _ = null, messages: v, processing: y, streamingMessageId: b, failedMessageId: x, onRetry: S, renderWriteProposals: C, hidesLegacyWriteCard: w, renderUiOffers: T, onStopTurn: E, stopTurnLabel: D }) => {
12
+ let O = n(), k = l(), A = (() => {
13
+ for (let e = v.length - 1; e >= 0; --e) if (v[e].role === "assistant") return v[e].id;
13
14
  return null;
14
- })(), O = a(g), k = o(g), A = i(g), j = l(null);
15
- c(() => {
16
- let e = j.current;
15
+ })(), j = a(v), M = o(v), N = i(v), P = d(null);
16
+ u(() => {
17
+ let e = P.current;
17
18
  if (e && e.scrollHeight - e.scrollTop - e.clientHeight < 100) {
18
19
  let n = t();
19
20
  s(e, { behavior: n ? "auto" : "smooth" });
20
21
  }
21
- }, [g, v]);
22
- let M = r((e) => e.byMessageId), N = v === null ? null : M[v]?.content ?? null, P = l(0), F = l(null);
23
- return c(() => {
24
- if (N === null) return;
22
+ }, [v, b]);
23
+ let F = r((e) => e.byMessageId), I = b === null ? null : F[b]?.content ?? null, L = d(0), R = d(null);
24
+ return u(() => {
25
+ if (I === null) return;
25
26
  let e = () => {
26
- F.current = null, P.current = Date.now();
27
- let e = j.current;
27
+ R.current = null, L.current = Date.now();
28
+ let e = P.current;
28
29
  e && e.scrollHeight - e.scrollTop - e.clientHeight < 100 && s(e, { behavior: "auto" });
29
- }, t = P.current + 250 - Date.now();
30
- t <= 0 ? e() : F.current === null && (F.current = setTimeout(e, t));
31
- }, [N]), c(() => () => {
32
- F.current !== null && clearTimeout(F.current);
33
- }, []), c(() => {
34
- j.current && s(j.current, { behavior: "instant" });
35
- }, []), /* @__PURE__ */ d("div", {
36
- ref: j,
37
- className: "scrollbar-slim flex-1 space-y-4 overflow-y-auto p-3",
30
+ }, t = L.current + 250 - Date.now();
31
+ t <= 0 ? e() : R.current === null && (R.current = setTimeout(e, t));
32
+ }, [I]), u(() => () => {
33
+ R.current !== null && clearTimeout(R.current);
34
+ }, []), u(() => {
35
+ P.current && s(P.current, { behavior: "instant" });
36
+ }, []), /* @__PURE__ */ p("div", {
37
+ ref: P,
38
+ className: k ? `scrollbar-slim flex-1 space-y-4 overflow-y-auto py-3 ${c}` : "scrollbar-slim flex-1 space-y-4 overflow-y-auto p-3",
38
39
  role: "log",
39
40
  "aria-live": "polite",
40
41
  "aria-relevant": "additions",
41
- "aria-busy": v !== null,
42
- "aria-label": E("messageList.ariaLabel", "Conversation messages"),
43
- children: [g.map((t) => {
44
- let n = O.has(t.id), r = !n && (t.id === m || t.id === v);
45
- return /* @__PURE__ */ u(e, {
46
- onApprovePendingWrite: r ? f : void 0,
47
- approvingWriteRef: p,
42
+ "aria-busy": b !== null,
43
+ "aria-label": O("messageList.ariaLabel", "Conversation messages"),
44
+ children: [v.map((t) => {
45
+ let n = j.has(t.id), r = !n && (t.id === g || t.id === b);
46
+ return /* @__PURE__ */ f(e, {
47
+ onApprovePendingWrite: r ? m : void 0,
48
+ approvingWriteRef: h,
48
49
  pendingWriteApproved: n,
49
- pendingWriteGoAheadSent: k.has(t.id),
50
+ pendingWriteGoAheadSent: M.has(t.id),
50
51
  pendingWriteExpired: !n && !r,
51
- message: t.id === v && N !== null ? {
52
+ message: t.id === b && I !== null ? {
52
53
  ...t,
53
- content: N
54
+ content: I
54
55
  } : t,
55
- processing: _,
56
- isStreaming: t.id === v,
57
- isFailed: t.id === y,
58
- isLastAssistant: t.id === h,
59
- isNewestAssistant: t.id === D,
60
- onRetry: A.has(t.id) ? void 0 : b,
61
- legacyWriteCardHidden: S?.(t) ?? !1,
62
- writeProposals: x?.(t),
63
- uiOffers: C?.(t),
64
- ...t.id === v && w !== void 0 ? {
65
- onStopTurn: w,
66
- stopTurnLabel: T
56
+ processing: y,
57
+ isStreaming: t.id === b,
58
+ isFailed: t.id === x,
59
+ isLastAssistant: t.id === _,
60
+ isNewestAssistant: t.id === A,
61
+ onRetry: N.has(t.id) ? void 0 : S,
62
+ legacyWriteCardHidden: w?.(t) ?? !1,
63
+ writeProposals: C?.(t),
64
+ uiOffers: T?.(t),
65
+ ...t.id === b && E !== void 0 ? {
66
+ onStopTurn: E,
67
+ stopTurnLabel: D
67
68
  } : {}
68
69
  }, t.id);
69
- }), /* @__PURE__ */ u("div", {})]
70
+ }), /* @__PURE__ */ f("div", {})]
70
71
  });
71
72
  };
72
- export { p as AssistantMessageList, f as LIVE_SCROLL_GAP_MS };
73
+ export { h as AssistantMessageList, m as LIVE_SCROLL_GAP_MS };
@@ -83,6 +83,34 @@ export interface AssistantOverlayContextValue {
83
83
  windowView?: AssistantWindowView | null;
84
84
  /** The person picked a view: remember it. A no-op in classic. */
85
85
  setWindowView?: (view: AssistantWindowView) => void;
86
+ /**
87
+ * BOFF-13461: register a page that hosts the assistant (`AssistantPageHost`
88
+ * calls it with its element). Returns the unregister. Present only when the
89
+ * provider was given `pageSurface`; absent, no page can host it.
90
+ */
91
+ registerPageHost?: (element: HTMLElement) => () => void;
92
+ /**
93
+ * BOFF-13461: a page is hosting the assistant now. While it is, `isOpen`,
94
+ * `surface`, `minimized`, `fullOpen` and `docked` still describe the
95
+ * overlay's OWN surfaces, which the page leaves as they were and which show
96
+ * again when it unmounts. False (or absent) without `pageSurface`.
97
+ */
98
+ pageHosted?: boolean;
99
+ /** BOFF-13461: the stable root the panel renders into (with `pageSurface` only). */
100
+ pagePanelRoot?: HTMLElement | null;
101
+ /**
102
+ * BOFF-13461: the latest request for the hosted panel to take focus: a host
103
+ * that mounted (`force` false: only where focus was dropped) or a request to
104
+ * open the assistant while a page hosts it (`force` true). Null when none.
105
+ */
106
+ pageFocusRequest?: AssistantPageFocusRequest | null;
107
+ }
108
+ /** BOFF-13461: see `AssistantOverlayContextValue.pageFocusRequest`. */
109
+ export interface AssistantPageFocusRequest {
110
+ /** Increases with each request. */
111
+ seq: number;
112
+ /** Take focus even from a control the person moved to. */
113
+ force: boolean;
86
114
  }
87
115
  /** The overlay state in force, or null when no provider is mounted. */
88
116
  export declare function useAssistantOverlayOrNull(): AssistantOverlayContextValue | null;
@@ -140,6 +168,15 @@ export interface AssistantOverlayProviderProps {
140
168
  * `presentation="compact"` itself, so the two cannot disagree.
141
169
  */
142
170
  presentation?: AssistantPresentation;
171
+ /**
172
+ * BOFF-13461: let a page host the ONE assistant (`AssistantPageHost`). Read
173
+ * at mount. With it, the overlay renders its panel through one stable root
174
+ * that it moves between its own container and a mounted host, so the same
175
+ * instance (a draft, its attachments, a turn in flight, a running avatar)
176
+ * goes into the page and back. Absent or false: no page can host it, and the
177
+ * overlay renders exactly as before.
178
+ */
179
+ pageSurface?: boolean;
143
180
  children: ReactNode;
144
181
  }
145
182
  /**
@@ -155,7 +192,7 @@ export interface AssistantOverlayProviderProps {
155
192
  * Mount ONE per page: the published dock width and panel inset are single
156
193
  * `<html>` variables.
157
194
  */
158
- export declare function AssistantOverlayProvider({ keyPrefix, quota, presentation, children, }: AssistantOverlayProviderProps): import('react').JSX.Element;
195
+ export declare function AssistantOverlayProvider({ keyPrefix, quota, presentation, pageSurface, children, }: AssistantOverlayProviderProps): import('react').JSX.Element;
159
196
  /** What the overlay hands the panel it renders. */
160
197
  export interface AssistantOverlayPanelProps {
161
198
  panelId: string;
@@ -191,6 +228,13 @@ export interface AssistantOverlayPanelProps {
191
228
  windowView?: AssistantWindowView | null;
192
229
  /** A view was picked: remember it. */
193
230
  onWindowViewChange?: (view: AssistantWindowView) => void;
231
+ /**
232
+ * BOFF-13461: a page hosts this panel (`AssistantPageHost`): it fills the
233
+ * host, shows no dock, close, minimize or expand control, and Escape does not
234
+ * close it. Absent unless a page hosts it, so a product's `renderPanel`
235
+ * wrapper that spreads these passes exactly what it passed before.
236
+ */
237
+ pageHosted?: boolean;
194
238
  }
195
239
  /**
196
240
  * The props the overlay itself decides, which a product's `panelProps` may not
@@ -198,7 +242,7 @@ export interface AssistantOverlayPanelProps {
198
242
  * accepted in `panelProps` (Slice 2), and the overlay's value is merged over
199
243
  * them only in the compact presentation.
200
244
  */
201
- type AssistantOverlayOwnedPanelProp = 'panelId' | 'visible' | 'onClose' | 'docked' | 'onToggleDock' | 'onNavigate' | 'isShellLessTarget' | 'surface' | 'onOpenFull' | 'avatarSettingsRequest' | 'onMinimize' | 'windowView' | 'onWindowViewChange';
245
+ type AssistantOverlayOwnedPanelProp = 'panelId' | 'visible' | 'onClose' | 'docked' | 'onToggleDock' | 'onNavigate' | 'isShellLessTarget' | 'surface' | 'onOpenFull' | 'avatarSettingsRequest' | 'onMinimize' | 'windowView' | 'onWindowViewChange' | 'pageHosted';
202
246
  export interface AssistantOverlayProps {
203
247
  /** Panel id handed to the panel. */
204
248
  panelId?: string;