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