@burdenoff/fe-libs 2026.1029.10 → 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 +22 -0
- package/dist/shared/assistant/i18nManifest.js +22 -0
- package/dist/shared/assistant/index.d.ts +6 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +26 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.js +197 -160
- 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 +91 -3
- package/dist/shared/assistant/ui/AssistantOverlay.js +347 -127
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts +224 -0
- package/dist/shared/assistant/ui/assistantOverlayState.js +116 -29
- 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 +36 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowHeader.js +68 -0
- 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/AssistantAttachmentButton.d.ts +8 -0
- package/dist/shared/assistant/ui/composer/AssistantAttachmentButton.js +34 -34
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +6 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +92 -90
- 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/useAssistantVisualViewport.d.ts +3 -0
- package/dist/shared/assistant/ui/useAssistantVisualViewport.js +24 -0
- 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 -260
- package/dist/ui/modal-shell.d.ts +6 -1
- package/dist/ui/modal-shell.js +7 -6
- package/package.json +1 -1
|
@@ -2,216 +2,436 @@ import { quotaExhaustedEventName as e } from "../quota.js";
|
|
|
2
2
|
import { useAssistantTr as t } from "../i18n.js";
|
|
3
3
|
import { assistantPanelOwnsEscape as n } from "./panelOverlays.js";
|
|
4
4
|
import { AssistantPreviewBridgeHost as r } from "../preview/bridgeHost.js";
|
|
5
|
-
import {
|
|
6
|
-
import { useAssistantServerHistory as
|
|
7
|
-
import { AssistantCloseGuardContext as
|
|
8
|
-
import { AIAssistantPanel as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { ASSISTANT_COMPACT_DOCKED_DEFAULT_QUERY as i, ASSISTANT_DOCK_WIDTH_VAR as a, ASSISTANT_OVERLAY_DESKTOP_QUERY as o, ASSISTANT_OVERLAY_TOP_VAR as s, ASSISTANT_PANEL_INSET_VAR as c, ASSISTANT_SHEET_BOTTOM_VAR as l, ASSISTANT_WINDOW_BOTTOM_VAR as u, assistantCompactLauncherVisibility as d, assistantCompactOverlayClassName as f, assistantCompactOverlayKeys as p, assistantLauncherBottom as ee, assistantLauncherRight as m, assistantOverlayClassName as te, assistantOverlayEscapeAction as ne, assistantOverlayKeys as re, assistantQuotaKindOf as h, assistantWindowBottom as g, closestAround as ie, createAssistantNavigate as ae, isAssistantSurface as oe, isAssistantToggleShortcut as se, nextAssistantOpenState as _, publishedAssistantDockWidth as v, publishedAssistantPanelInset as ce, publishedCompactDockWidth as le, publishedCompactPanelInset as y, readAssistantLayoutChoice as ue, readAssistantLegacyDockChoice as de, readAssistantOverlayFlag as b, readAssistantWindowView as x, requestedAssistantOpenState as S, resolveCompactDocked as fe, writeAssistantLayoutChoice as C, writeAssistantOverlayFlag as w, writeAssistantWindowView as pe } from "./assistantOverlayState.js";
|
|
6
|
+
import { useAssistantServerHistory as T } from "../history/useAssistantServerHistory.js";
|
|
7
|
+
import { AssistantCloseGuardContext as E } from "./closeGuard.js";
|
|
8
|
+
import { AIAssistantPanel as D } from "./AIAssistantPanel.js";
|
|
9
|
+
import { useAssistantVisualViewport as me } from "./useAssistantVisualViewport.js";
|
|
10
|
+
import { createContext as O, useCallback as k, useContext as A, useEffect as j, useMemo as M, useRef as N, useState as P, useSyncExternalStore as F } from "react";
|
|
11
|
+
import { Sparkles as he } from "lucide-react";
|
|
11
12
|
import { jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
12
13
|
//#region src/shared/assistant/ui/AssistantOverlay.tsx
|
|
13
|
-
var R =
|
|
14
|
+
var R = O(null);
|
|
14
15
|
function z() {
|
|
15
|
-
return
|
|
16
|
+
return A(R);
|
|
16
17
|
}
|
|
17
18
|
function B() {
|
|
18
|
-
return
|
|
19
|
+
return A(R)?.dockWidthPx ?? 0;
|
|
19
20
|
}
|
|
20
21
|
function V() {
|
|
21
|
-
return
|
|
22
|
+
return A(R)?.panelInsetPx ?? 0;
|
|
22
23
|
}
|
|
23
24
|
var H = () => typeof window > "u" ? void 0 : window.sessionStorage, U = () => typeof window > "u" ? void 0 : window.localStorage;
|
|
24
25
|
function W(e) {
|
|
25
26
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
|
|
26
|
-
let t = window.matchMedia(
|
|
27
|
+
let t = window.matchMedia(o);
|
|
27
28
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
28
29
|
}
|
|
29
30
|
function G() {
|
|
30
31
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(min-width: 640px)").matches;
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
33
|
+
function ge() {
|
|
34
|
+
return F(W, G, () => !1);
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
let r =
|
|
37
|
-
|
|
36
|
+
function K(t, n) {
|
|
37
|
+
let r = N(n);
|
|
38
|
+
j(() => {
|
|
38
39
|
r.current = n;
|
|
39
|
-
}, [n]),
|
|
40
|
+
}, [n]), j(() => {
|
|
40
41
|
if (!t || typeof window > "u") return;
|
|
41
|
-
let n = e(t), i = (e) => r.current(
|
|
42
|
+
let n = e(t), i = (e) => r.current(h(e), e);
|
|
42
43
|
return window.addEventListener(n, i), () => window.removeEventListener(n, i);
|
|
43
44
|
}, [t]);
|
|
44
45
|
}
|
|
45
|
-
var
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}, [
|
|
46
|
+
var _e = () => {};
|
|
47
|
+
function q(e) {
|
|
48
|
+
if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
|
|
49
|
+
let t = window.matchMedia(i);
|
|
50
|
+
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
51
|
+
}
|
|
52
|
+
function J() {
|
|
53
|
+
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(i).matches;
|
|
54
|
+
}
|
|
55
|
+
var Y = () => () => {}, X = () => !1;
|
|
56
|
+
function ve(e) {
|
|
57
|
+
return F(e ? q : Y, e ? J : X, X);
|
|
58
|
+
}
|
|
59
|
+
function Z({ keyPrefix: e, quota: t, presentation: n = "classic", children: r }) {
|
|
60
|
+
let i = M(() => re(e), [e]), o = M(() => p(e), [e]), s = n === "compact", l = N(s);
|
|
61
|
+
j(() => {
|
|
62
|
+
l.current = s;
|
|
63
|
+
}, [s]);
|
|
64
|
+
let [u, d] = P(() => b(H, i.openStorageKey)), [f, ee] = P(() => b(U, i.dockStorageKey)), [m, te] = P(() => {
|
|
65
|
+
if (!s) return "panel";
|
|
66
|
+
try {
|
|
67
|
+
let e = H()?.getItem(o.surfaceStorageKey);
|
|
68
|
+
return oe(e) ? e : "panel";
|
|
69
|
+
} catch {
|
|
70
|
+
return "panel";
|
|
71
|
+
}
|
|
72
|
+
}), [ne, h] = P(() => s && b(H, o.minimizedStorageKey)), g = s && u && m === "window" && ne, [ie, ae] = P(!1), T = s && u && m === "panel" && ie, [E, D] = P(() => s ? x(U, o.windowViewStorageKey) : null), me = k((e) => {
|
|
73
|
+
l.current && D(e);
|
|
74
|
+
}, []), [O] = P(() => s ? {
|
|
75
|
+
explicit: ue(U, o.layoutStorageKey),
|
|
76
|
+
legacy: de(U, i.dockStorageKey)
|
|
77
|
+
} : {
|
|
78
|
+
explicit: null,
|
|
79
|
+
legacy: null
|
|
80
|
+
}), [A, F] = P(null), he = ve(s), L = s ? fe({
|
|
81
|
+
explicit: A ?? O.explicit,
|
|
82
|
+
legacy: O.legacy,
|
|
83
|
+
wideViewport: he
|
|
84
|
+
}) : f, z = N(L);
|
|
85
|
+
j(() => {
|
|
86
|
+
z.current = L;
|
|
87
|
+
}, [L]);
|
|
88
|
+
let B = N(null), V = N(u);
|
|
89
|
+
j(() => {
|
|
90
|
+
V.current = u;
|
|
91
|
+
}, [u]);
|
|
92
|
+
let W = N(!1), G = u && (!s || m === "panel" && !g);
|
|
93
|
+
j(() => {
|
|
94
|
+
W.current = G;
|
|
95
|
+
}, [G]);
|
|
96
|
+
let q = k(() => {
|
|
97
|
+
let e = B.current?.() === !0;
|
|
98
|
+
return e && l.current && h(!1), e;
|
|
99
|
+
}, []), J = k((e) => (B.current = e, () => {
|
|
100
|
+
B.current === e && (B.current = null);
|
|
101
|
+
}), []), Y = k(() => {
|
|
102
|
+
d(!0), te("panel"), h(!1);
|
|
103
|
+
}, []), X = k(() => {
|
|
104
|
+
d(!1), h(!1), ae(!1);
|
|
105
|
+
}, []), Z = k(() => {
|
|
106
|
+
l.current ? Y() : d(!0);
|
|
107
|
+
}, [Y]), ye = k(() => {
|
|
108
|
+
q() || (l.current ? X() : d(!1));
|
|
109
|
+
}, [q, X]), be = k(() => {
|
|
110
|
+
if (l.current) {
|
|
111
|
+
if (W.current) {
|
|
112
|
+
if (q()) return;
|
|
113
|
+
X();
|
|
114
|
+
} else Y();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
V.current && q() || d((e) => !e);
|
|
118
|
+
}, [
|
|
119
|
+
q,
|
|
120
|
+
X,
|
|
121
|
+
Y
|
|
122
|
+
]), xe = k(() => {
|
|
123
|
+
if (l.current) {
|
|
124
|
+
let e = z.current ? "floating" : "docked";
|
|
125
|
+
z.current = e === "docked", F(e);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
ee((e) => !e);
|
|
129
|
+
}, []), Se = Z, Ce = k(() => {
|
|
130
|
+
if (!l.current) {
|
|
131
|
+
d(!0);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
W.current || (d(!0), te("window"), h(!1));
|
|
135
|
+
}, []), we = k(() => {
|
|
136
|
+
!l.current || !V.current || W.current || h(!0);
|
|
137
|
+
}, []);
|
|
138
|
+
j(() => {
|
|
139
|
+
w(H, i.openStorageKey, u);
|
|
140
|
+
}, [i.openStorageKey, u]), j(() => {
|
|
141
|
+
s || w(U, i.dockStorageKey, f);
|
|
142
|
+
}, [
|
|
143
|
+
s,
|
|
144
|
+
i.dockStorageKey,
|
|
145
|
+
f
|
|
146
|
+
]), j(() => {
|
|
147
|
+
!s || A === null || C(U, o.layoutStorageKey, A);
|
|
148
|
+
}, [
|
|
149
|
+
s,
|
|
150
|
+
o.layoutStorageKey,
|
|
151
|
+
A
|
|
152
|
+
]), j(() => {
|
|
153
|
+
!s || E === null || pe(U, o.windowViewStorageKey, E);
|
|
154
|
+
}, [
|
|
155
|
+
s,
|
|
156
|
+
o.windowViewStorageKey,
|
|
157
|
+
E
|
|
158
|
+
]), j(() => {
|
|
159
|
+
if (s) try {
|
|
160
|
+
H()?.setItem(o.surfaceStorageKey, m);
|
|
161
|
+
} catch {}
|
|
162
|
+
}, [
|
|
163
|
+
s,
|
|
164
|
+
o.surfaceStorageKey,
|
|
165
|
+
m
|
|
166
|
+
]), j(() => {
|
|
167
|
+
s && w(H, o.minimizedStorageKey, g);
|
|
168
|
+
}, [
|
|
169
|
+
s,
|
|
170
|
+
o.minimizedStorageKey,
|
|
171
|
+
g
|
|
172
|
+
]), j(() => {
|
|
63
173
|
if (typeof window > "u") return;
|
|
64
174
|
let e = (e) => {
|
|
65
175
|
let t = S(e);
|
|
66
|
-
|
|
176
|
+
if (l.current) {
|
|
177
|
+
t === !0 ? Y() : t === !1 ? V.current && !q() && X() : W.current ? q() || X() : Y();
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
V.current && !_(!0, t) && B.current?.() === !0 || d((e) => _(e, t));
|
|
67
181
|
};
|
|
68
|
-
return window.addEventListener(
|
|
69
|
-
}, [
|
|
182
|
+
return window.addEventListener(i.toggleEvent, e), () => window.removeEventListener(i.toggleEvent, e);
|
|
183
|
+
}, [
|
|
184
|
+
i.toggleEvent,
|
|
185
|
+
Y,
|
|
186
|
+
X,
|
|
187
|
+
q
|
|
188
|
+
]), j(() => {
|
|
70
189
|
if (typeof document > "u") return;
|
|
71
190
|
let e = (e) => {
|
|
72
|
-
|
|
191
|
+
if (se(e)) {
|
|
192
|
+
if (e.preventDefault(), l.current) {
|
|
193
|
+
W.current ? q() || X() : Y();
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
V.current && B.current?.() === !0 || d((e) => !e);
|
|
197
|
+
}
|
|
73
198
|
};
|
|
74
199
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
75
|
-
}, [
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
isOpen:
|
|
82
|
-
docked:
|
|
83
|
-
isDesktop:
|
|
200
|
+
}, [
|
|
201
|
+
Y,
|
|
202
|
+
X,
|
|
203
|
+
q
|
|
204
|
+
]), K(t?.product ?? null, t?.onExhausted ?? _e);
|
|
205
|
+
let Q = ge(), $ = s ? le({
|
|
206
|
+
isOpen: u,
|
|
207
|
+
docked: L,
|
|
208
|
+
isDesktop: Q,
|
|
209
|
+
surface: m,
|
|
210
|
+
expanded: T
|
|
211
|
+
}) : v({
|
|
212
|
+
isOpen: u,
|
|
213
|
+
docked: f,
|
|
214
|
+
isDesktop: Q
|
|
215
|
+
}), Te = s ? y({
|
|
216
|
+
isOpen: u,
|
|
217
|
+
docked: L,
|
|
218
|
+
isDesktop: Q,
|
|
219
|
+
surface: m,
|
|
220
|
+
expanded: T
|
|
221
|
+
}) : ce({
|
|
222
|
+
isOpen: u,
|
|
223
|
+
docked: f,
|
|
224
|
+
isDesktop: Q
|
|
84
225
|
});
|
|
85
|
-
|
|
226
|
+
j(() => {
|
|
86
227
|
if (typeof document > "u") return;
|
|
87
228
|
let e = document.documentElement.style;
|
|
88
|
-
return e.setProperty(
|
|
89
|
-
e.removeProperty(
|
|
229
|
+
return e.setProperty(a, `${$}px`), () => {
|
|
230
|
+
e.removeProperty(a);
|
|
90
231
|
};
|
|
91
|
-
}, [
|
|
232
|
+
}, [$]), j(() => {
|
|
92
233
|
if (typeof document > "u") return;
|
|
93
234
|
let e = document.documentElement.style;
|
|
94
|
-
return e.setProperty(
|
|
95
|
-
e.removeProperty(
|
|
235
|
+
return e.setProperty(c, `${Te}px`), () => {
|
|
236
|
+
e.removeProperty(c);
|
|
96
237
|
};
|
|
97
|
-
}, [
|
|
98
|
-
let
|
|
99
|
-
isOpen:
|
|
100
|
-
open:
|
|
101
|
-
close:
|
|
102
|
-
toggle:
|
|
103
|
-
docked:
|
|
104
|
-
toggleDock:
|
|
105
|
-
dockWidthPx:
|
|
106
|
-
panelInsetPx:
|
|
107
|
-
keys:
|
|
108
|
-
registerCloseGuard:
|
|
238
|
+
}, [Te]);
|
|
239
|
+
let Ee = M(() => ({
|
|
240
|
+
isOpen: u,
|
|
241
|
+
open: Z,
|
|
242
|
+
close: ye,
|
|
243
|
+
toggle: be,
|
|
244
|
+
docked: L,
|
|
245
|
+
toggleDock: xe,
|
|
246
|
+
dockWidthPx: $,
|
|
247
|
+
panelInsetPx: Te,
|
|
248
|
+
keys: i,
|
|
249
|
+
registerCloseGuard: J,
|
|
250
|
+
presentation: n,
|
|
251
|
+
surface: m,
|
|
252
|
+
minimized: g,
|
|
253
|
+
fullOpen: G,
|
|
254
|
+
openFull: Se,
|
|
255
|
+
openWindow: Ce,
|
|
256
|
+
minimize: we,
|
|
257
|
+
expanded: T,
|
|
258
|
+
setExpanded: ae,
|
|
259
|
+
windowView: s ? E : null,
|
|
260
|
+
setWindowView: me
|
|
109
261
|
}), [
|
|
110
|
-
|
|
111
|
-
|
|
262
|
+
u,
|
|
263
|
+
Z,
|
|
264
|
+
ye,
|
|
265
|
+
be,
|
|
266
|
+
L,
|
|
267
|
+
xe,
|
|
268
|
+
$,
|
|
269
|
+
Te,
|
|
270
|
+
i,
|
|
271
|
+
J,
|
|
272
|
+
n,
|
|
273
|
+
m,
|
|
112
274
|
g,
|
|
113
|
-
|
|
114
|
-
|
|
275
|
+
G,
|
|
276
|
+
Se,
|
|
277
|
+
Ce,
|
|
278
|
+
we,
|
|
115
279
|
T,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
m
|
|
280
|
+
s,
|
|
281
|
+
E,
|
|
282
|
+
me
|
|
120
283
|
]);
|
|
121
284
|
return /* @__PURE__ */ I(R.Provider, {
|
|
122
|
-
value:
|
|
123
|
-
children:
|
|
285
|
+
value: Ee,
|
|
286
|
+
children: r
|
|
124
287
|
});
|
|
125
288
|
}
|
|
126
|
-
var
|
|
289
|
+
var ye = (e, t) => /* @__PURE__ */ I(D, {
|
|
127
290
|
...e,
|
|
128
291
|
...t
|
|
129
292
|
});
|
|
130
|
-
function
|
|
293
|
+
function be(e) {
|
|
131
294
|
let t = z();
|
|
132
|
-
return t ? /* @__PURE__ */ I(
|
|
295
|
+
return t ? /* @__PURE__ */ I(xe, {
|
|
133
296
|
state: t,
|
|
134
297
|
...e
|
|
135
298
|
}) : null;
|
|
136
299
|
}
|
|
137
|
-
function
|
|
138
|
-
let { isOpen:
|
|
139
|
-
|
|
140
|
-
let [
|
|
141
|
-
|
|
142
|
-
|
|
300
|
+
function xe({ state: e, panelId: i = "ai-assistant", panelProps: a, renderPanel: o, navigate: c, isShellLessTarget: p, topOffsetPx: re = 56, launcherIcon: h, launcherBottomInset: oe = "1.5rem", showLauncher: se = !0, closeOnEscape: _ = !0 }) {
|
|
301
|
+
let { isOpen: v, close: ce, toggle: le, docked: y, toggleDock: ue, dockWidthPx: de } = e, b = e.presentation === "compact", { surface: x, minimized: S, setExpanded: fe } = e, C = t();
|
|
302
|
+
T(a?.serverHistory === !0);
|
|
303
|
+
let [w, pe] = P(!1), D = N(null), O = N(null), A = ge(), [F, R] = P(0), [z, B] = P(0);
|
|
304
|
+
j(() => {
|
|
305
|
+
F !== 0 && D.current?.querySelector("[data-testid=\"assistant-input\"]")?.focus({ preventScroll: !0 });
|
|
306
|
+
}, [F]), j(() => {
|
|
307
|
+
z !== 0 && D.current?.querySelector("[data-testid=\"assistant-window-view-chat\"]")?.focus({ preventScroll: !0 });
|
|
308
|
+
}, [z]), me(D, b && v && !S && !A);
|
|
309
|
+
let V = N(a?.onExpandedChange);
|
|
310
|
+
j(() => {
|
|
311
|
+
V.current = a?.onExpandedChange;
|
|
312
|
+
});
|
|
313
|
+
let H = k((e) => {
|
|
314
|
+
fe(e), V.current?.(e);
|
|
315
|
+
}, [fe]), U = M(() => c ? ae({
|
|
316
|
+
navigate: c,
|
|
317
|
+
isShellLessTarget: p,
|
|
143
318
|
isDesktop: G,
|
|
144
|
-
collapseSheet: () =>
|
|
319
|
+
collapseSheet: () => pe(!1),
|
|
145
320
|
openInNewTab: (e) => window.open(e, "_blank", "noopener,noreferrer")
|
|
146
|
-
}) : void 0, [
|
|
147
|
-
|
|
148
|
-
if (!
|
|
321
|
+
}) : void 0, [c, p]), W = b && x === "window" ? e.minimize : ce;
|
|
322
|
+
j(() => {
|
|
323
|
+
if (!v || !_ || S) return;
|
|
149
324
|
let e = (e) => {
|
|
150
|
-
|
|
325
|
+
ne({
|
|
151
326
|
key: e.key,
|
|
152
|
-
isOpen:
|
|
327
|
+
isOpen: v,
|
|
153
328
|
alreadyHandled: e.defaultPrevented,
|
|
154
329
|
dialogOpen: document.querySelector("[role=\"dialog\"],[role=\"alertdialog\"],dialog[open]") !== null,
|
|
155
|
-
pressedInsideDialog:
|
|
330
|
+
pressedInsideDialog: ie(e.target, "[role=\"dialog\"],[role=\"alertdialog\"],dialog[open]") !== null,
|
|
156
331
|
panelOwnsEscape: n()
|
|
157
|
-
}) === "close" && (e.preventDefault(),
|
|
332
|
+
}) === "close" && (e.preventDefault(), W());
|
|
158
333
|
};
|
|
159
334
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
160
335
|
}, [
|
|
336
|
+
v,
|
|
161
337
|
S,
|
|
162
|
-
|
|
163
|
-
|
|
338
|
+
W,
|
|
339
|
+
_
|
|
164
340
|
]);
|
|
165
|
-
let
|
|
341
|
+
let K = N(S);
|
|
342
|
+
j(() => {
|
|
343
|
+
if (b && S && !K.current) {
|
|
344
|
+
let e = document.activeElement;
|
|
345
|
+
(!e || e === document.body || D.current?.contains(e)) && O.current?.focus({ preventScroll: !0 });
|
|
346
|
+
}
|
|
347
|
+
K.current = S;
|
|
348
|
+
}, [b, S]);
|
|
349
|
+
let _e = {
|
|
166
350
|
panelId: i,
|
|
167
|
-
visible: !
|
|
168
|
-
onClose:
|
|
169
|
-
docked:
|
|
170
|
-
onToggleDock:
|
|
171
|
-
onNavigate:
|
|
172
|
-
isShellLessTarget:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
351
|
+
visible: !S,
|
|
352
|
+
onClose: ce,
|
|
353
|
+
docked: y,
|
|
354
|
+
onToggleDock: ue,
|
|
355
|
+
onNavigate: U,
|
|
356
|
+
isShellLessTarget: p,
|
|
357
|
+
...b ? {
|
|
358
|
+
presentation: "compact",
|
|
359
|
+
surface: x,
|
|
360
|
+
onOpenFull: e.openFull,
|
|
361
|
+
onMinimize: e.minimize,
|
|
362
|
+
onExpandedChange: H,
|
|
363
|
+
windowView: e.windowView,
|
|
364
|
+
onWindowViewChange: e.setWindowView
|
|
365
|
+
} : {}
|
|
366
|
+
}, q = b ? C("overlay.launcherQuick", "Open quick assistant") : C("overlay.launcher", "AI Assistant"), J = {
|
|
367
|
+
[s]: `${re}px`,
|
|
368
|
+
[l]: "var(--mobile-tabbar-height, 0px)"
|
|
369
|
+
}, Y = {
|
|
370
|
+
...J,
|
|
371
|
+
[u]: g(oe)
|
|
372
|
+
}, X = b ? d({
|
|
373
|
+
isOpen: v,
|
|
374
|
+
surface: x,
|
|
375
|
+
minimized: S
|
|
376
|
+
}) : v ? "desktop-only" : "always", ve = (t) => {
|
|
377
|
+
!b || e.fullOpen ? le() : v && !S ? e.minimize() : (e.openWindow(), A || t.detail === 0 ? R((e) => e + 1) : B((e) => e + 1));
|
|
176
378
|
};
|
|
177
379
|
return /* @__PURE__ */ L(r, {
|
|
178
380
|
preview: a?.preview,
|
|
179
|
-
children: [
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
381
|
+
children: [v && /* @__PURE__ */ L("div", {
|
|
382
|
+
ref: D,
|
|
383
|
+
className: b ? f({
|
|
384
|
+
surface: x,
|
|
385
|
+
minimized: S,
|
|
386
|
+
docked: y,
|
|
387
|
+
expanded: e.expanded,
|
|
388
|
+
sheetExpanded: w
|
|
389
|
+
}) : te({
|
|
390
|
+
expanded: w,
|
|
391
|
+
docked: y
|
|
183
392
|
}),
|
|
184
|
-
style:
|
|
393
|
+
style: b ? Y : J,
|
|
185
394
|
"data-testid": "assistant-overlay",
|
|
395
|
+
...b ? {
|
|
396
|
+
id: i,
|
|
397
|
+
"data-surface": x,
|
|
398
|
+
...S ? {
|
|
399
|
+
hidden: !0,
|
|
400
|
+
inert: !0,
|
|
401
|
+
"data-minimized": ""
|
|
402
|
+
} : {}
|
|
403
|
+
} : {},
|
|
186
404
|
children: [/* @__PURE__ */ I("button", {
|
|
187
405
|
type: "button",
|
|
188
|
-
onClick: () =>
|
|
406
|
+
onClick: () => pe((e) => !e),
|
|
189
407
|
className: "flex w-full shrink-0 justify-center pt-2 pb-1 sm:hidden",
|
|
190
|
-
"aria-label":
|
|
191
|
-
"aria-expanded":
|
|
408
|
+
"aria-label": w ? C("sheet.collapse", "Shrink the assistant") : C("sheet.expand", "Expand the assistant"),
|
|
409
|
+
"aria-expanded": w,
|
|
192
410
|
"data-testid": "assistant-sheet-handle",
|
|
193
411
|
children: /* @__PURE__ */ I("span", { className: "h-1.5 w-10 rounded-full bg-border-strong" })
|
|
194
412
|
}), /* @__PURE__ */ I("div", {
|
|
195
413
|
className: "flex min-h-0 flex-1 flex-col",
|
|
196
|
-
children: /* @__PURE__ */ I(
|
|
414
|
+
children: /* @__PURE__ */ I(E.Provider, {
|
|
197
415
|
value: e.registerCloseGuard ?? null,
|
|
198
|
-
children:
|
|
416
|
+
children: o ? o(_e) : ye(a, _e)
|
|
199
417
|
})
|
|
200
418
|
})]
|
|
201
|
-
}),
|
|
419
|
+
}), se && /* @__PURE__ */ I("button", {
|
|
420
|
+
ref: O,
|
|
202
421
|
type: "button",
|
|
203
|
-
onClick:
|
|
204
|
-
title:
|
|
205
|
-
"aria-label":
|
|
206
|
-
"aria-haspopup": "dialog",
|
|
207
|
-
"aria-expanded": S,
|
|
422
|
+
onClick: ve,
|
|
423
|
+
title: b ? q : C("overlay.launcherTitle", "AI Assistant ({{shortcut}})", { shortcut: "Ctrl+Shift+A" }),
|
|
424
|
+
"aria-label": q,
|
|
425
|
+
"aria-haspopup": b ? void 0 : "dialog",
|
|
426
|
+
"aria-expanded": b ? v && !S : v,
|
|
427
|
+
...b && v ? { "aria-controls": i } : {},
|
|
208
428
|
"data-testid": "assistant-fab",
|
|
209
429
|
style: {
|
|
210
|
-
bottom:
|
|
211
|
-
right:
|
|
430
|
+
bottom: ee(oe),
|
|
431
|
+
right: m(de)
|
|
212
432
|
},
|
|
213
|
-
className: "fixed z-30 size-14 items-center justify-center rounded-full border border-border-strong bg-[var(--color-accent-soft)] text-action-primary-bg shadow-float transition-colors duration-200 hover:border-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] cursor-pointer " + (
|
|
214
|
-
children:
|
|
433
|
+
className: "fixed z-30 size-14 items-center justify-center rounded-full border border-border-strong bg-[var(--color-accent-soft)] text-action-primary-bg shadow-float transition-colors duration-200 hover:border-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] cursor-pointer " + (X === "hidden" ? "hidden" : X === "desktop-only" ? "hidden sm:inline-flex" : "inline-flex"),
|
|
434
|
+
children: h ?? /* @__PURE__ */ I(he, {
|
|
215
435
|
className: "size-6",
|
|
216
436
|
"aria-hidden": "true"
|
|
217
437
|
})
|
|
@@ -219,4 +439,4 @@ function Q({ state: e, panelId: i = "ai-assistant", panelProps: a, renderPanel:
|
|
|
219
439
|
});
|
|
220
440
|
}
|
|
221
441
|
//#endregion
|
|
222
|
-
export {
|
|
442
|
+
export { be as AssistantOverlay, Z as AssistantOverlayProvider, B as useAssistantDockWidth, z as useAssistantOverlayOrNull, V as useAssistantPanelInset, K as useAssistantQuotaExhausted };
|