@burdenoff/fe-libs 2026.1029.8 → 2026.1029.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/shared/assistant/i18nManifest.d.ts +27 -0
- package/dist/shared/assistant/i18nManifest.js +27 -0
- package/dist/shared/assistant/index.d.ts +9 -0
- package/dist/shared/assistant/speech/speechFeed.d.ts +4 -3
- package/dist/shared/assistant/speech/speechFeed.js +3 -2
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +11 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.js +233 -127
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts +13 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +1632 -1605
- package/dist/shared/assistant/ui/AssistantConversationList.d.ts +17 -1
- package/dist/shared/assistant/ui/AssistantConversationList.js +304 -274
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +11 -0
- package/dist/shared/assistant/ui/AssistantOverlay.js +106 -90
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +140 -137
- package/dist/shared/assistant/ui/closeGuard.d.ts +21 -0
- package/dist/shared/assistant/ui/closeGuard.js +8 -0
- package/dist/shared/assistant/ui/compact/AssistantCompactHeader.d.ts +38 -0
- package/dist/shared/assistant/ui/compact/AssistantCompactHeader.js +89 -0
- package/dist/shared/assistant/ui/compact/AssistantConversationMenu.d.ts +29 -0
- package/dist/shared/assistant/ui/compact/AssistantConversationMenu.js +87 -0
- package/dist/shared/assistant/ui/compact/AssistantDiscardDraftDialog.d.ts +19 -0
- package/dist/shared/assistant/ui/compact/AssistantDiscardDraftDialog.js +38 -0
- package/dist/shared/assistant/ui/compact/AssistantMenuView.d.ts +42 -0
- package/dist/shared/assistant/ui/compact/AssistantMenuView.js +285 -0
- package/dist/shared/assistant/ui/compact/AssistantVoiceLanguageSettings.d.ts +24 -0
- package/dist/shared/assistant/ui/compact/AssistantVoiceLanguageSettings.js +68 -0
- package/dist/shared/assistant/ui/compact/AssistantWaitingChangeRow.d.ts +21 -0
- package/dist/shared/assistant/ui/compact/AssistantWaitingChangeRow.js +34 -0
- package/dist/shared/assistant/ui/compact/compactChrome.d.ts +75 -0
- package/dist/shared/assistant/ui/compact/compactChrome.js +39 -0
- package/dist/shared/assistant/ui/compact/waitingChange.d.ts +49 -0
- package/dist/shared/assistant/ui/compact/waitingChange.js +12 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +19 -18
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +261 -224
- package/dist/shared/assistant/ui/useVoiceSession.js +13 -8
- package/dist/shared/assistant/useAssistantKeyboardShortcuts.d.ts +16 -2
- package/dist/shared/assistant/useAssistantKeyboardShortcuts.js +28 -16
- package/dist/shared-assistant.js +42 -33
- package/package.json +1 -1
|
@@ -18,6 +18,17 @@ export interface AssistantOverlayContextValue {
|
|
|
18
18
|
*/
|
|
19
19
|
panelInsetPx: number;
|
|
20
20
|
keys: AssistantOverlayKeys;
|
|
21
|
+
/**
|
|
22
|
+
* BOFF-10177 (N1): let the open panel ask before it is closed. The guard runs
|
|
23
|
+
* for every request to CLOSE from outside the panel (the launcher, the
|
|
24
|
+
* shortcut, the toggle event, Escape with focus outside it, `close()`), and
|
|
25
|
+
* returns true when it took the request, which it then answers itself, by
|
|
26
|
+
* asking the person and calling `close()` again once they have said yes.
|
|
27
|
+
* Returns an unregister function. Only the compact panel registers one, so
|
|
28
|
+
* with none, every path below closes exactly as before. Optional so a host
|
|
29
|
+
* that builds this value itself keeps compiling.
|
|
30
|
+
*/
|
|
31
|
+
registerCloseGuard?: (guard: () => boolean) => () => void;
|
|
21
32
|
}
|
|
22
33
|
/** The overlay state in force, or null when no provider is mounted. */
|
|
23
34
|
export declare function useAssistantOverlayOrNull(): AssistantOverlayContextValue | null;
|
|
@@ -4,134 +4,147 @@ import { assistantPanelOwnsEscape as n } from "./panelOverlays.js";
|
|
|
4
4
|
import { AssistantPreviewBridgeHost as r } from "../preview/bridgeHost.js";
|
|
5
5
|
import { ASSISTANT_DOCK_WIDTH_VAR as i, ASSISTANT_OVERLAY_DESKTOP_QUERY as a, ASSISTANT_OVERLAY_TOP_VAR as o, ASSISTANT_PANEL_INSET_VAR as s, ASSISTANT_SHEET_BOTTOM_VAR as c, assistantLauncherBottom as l, assistantLauncherRight as u, assistantOverlayClassName as d, assistantOverlayEscapeAction as f, assistantOverlayKeys as p, assistantQuotaKindOf as m, closestAround as h, createAssistantNavigate as g, isAssistantToggleShortcut as _, nextAssistantOpenState as v, publishedAssistantDockWidth as y, publishedAssistantPanelInset as b, readAssistantOverlayFlag as x, requestedAssistantOpenState as S, writeAssistantOverlayFlag as C } from "./assistantOverlayState.js";
|
|
6
6
|
import { useAssistantServerHistory as w } from "../history/useAssistantServerHistory.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { AssistantCloseGuardContext as T } from "./closeGuard.js";
|
|
8
|
+
import { AIAssistantPanel as E } from "./AIAssistantPanel.js";
|
|
9
|
+
import { createContext as D, useCallback as O, useContext as k, useEffect as A, useMemo as j, useRef as M, useState as N, useSyncExternalStore as P } from "react";
|
|
10
|
+
import { Sparkles as F } from "lucide-react";
|
|
11
|
+
import { jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
11
12
|
//#region src/shared/assistant/ui/AssistantOverlay.tsx
|
|
12
|
-
var
|
|
13
|
-
function R() {
|
|
14
|
-
return O(L);
|
|
15
|
-
}
|
|
13
|
+
var R = D(null);
|
|
16
14
|
function z() {
|
|
17
|
-
return
|
|
15
|
+
return k(R);
|
|
18
16
|
}
|
|
19
17
|
function B() {
|
|
20
|
-
return
|
|
18
|
+
return k(R)?.dockWidthPx ?? 0;
|
|
19
|
+
}
|
|
20
|
+
function V() {
|
|
21
|
+
return k(R)?.panelInsetPx ?? 0;
|
|
21
22
|
}
|
|
22
|
-
var
|
|
23
|
-
function
|
|
23
|
+
var H = () => typeof window > "u" ? void 0 : window.sessionStorage, U = () => typeof window > "u" ? void 0 : window.localStorage;
|
|
24
|
+
function W(e) {
|
|
24
25
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
|
|
25
26
|
let t = window.matchMedia(a);
|
|
26
27
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function G() {
|
|
29
30
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(min-width: 640px)").matches;
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
32
|
+
function K() {
|
|
33
|
+
return P(W, G, () => !1);
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
let r =
|
|
36
|
-
|
|
35
|
+
function q(t, n) {
|
|
36
|
+
let r = M(n);
|
|
37
|
+
A(() => {
|
|
37
38
|
r.current = n;
|
|
38
|
-
}, [n]),
|
|
39
|
+
}, [n]), A(() => {
|
|
39
40
|
if (!t || typeof window > "u") return;
|
|
40
41
|
let n = e(t), i = (e) => r.current(m(e), e);
|
|
41
42
|
return window.addEventListener(n, i), () => window.removeEventListener(n, i);
|
|
42
43
|
}, [t]);
|
|
43
44
|
}
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
let r =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
var J = () => {};
|
|
46
|
+
function Y({ keyPrefix: e, quota: t, children: n }) {
|
|
47
|
+
let r = j(() => p(e), [e]), [a, o] = N(() => x(H, r.openStorageKey)), [c, l] = N(() => x(U, r.dockStorageKey)), u = M(null), d = M(a);
|
|
48
|
+
A(() => {
|
|
49
|
+
d.current = a;
|
|
50
|
+
}, [a]);
|
|
51
|
+
let f = O(() => u.current?.() === !0, []), m = O((e) => (u.current = e, () => {
|
|
52
|
+
u.current === e && (u.current = null);
|
|
53
|
+
}), []), h = O(() => o(!0), []), g = O(() => {
|
|
54
|
+
f() || o(!1);
|
|
55
|
+
}, [f]), w = O(() => {
|
|
56
|
+
d.current && f() || o((e) => !e);
|
|
57
|
+
}, [f]), T = O(() => l((e) => !e), []);
|
|
58
|
+
A(() => {
|
|
59
|
+
C(H, r.openStorageKey, a);
|
|
60
|
+
}, [r.openStorageKey, a]), A(() => {
|
|
61
|
+
C(U, r.dockStorageKey, c);
|
|
62
|
+
}, [r.dockStorageKey, c]), A(() => {
|
|
52
63
|
if (typeof window > "u") return;
|
|
53
64
|
let e = (e) => {
|
|
54
65
|
let t = S(e);
|
|
55
|
-
o((e) => v(e, t));
|
|
66
|
+
d.current && !v(!0, t) && u.current?.() === !0 || o((e) => v(e, t));
|
|
56
67
|
};
|
|
57
68
|
return window.addEventListener(r.toggleEvent, e), () => window.removeEventListener(r.toggleEvent, e);
|
|
58
|
-
}, [r.toggleEvent]),
|
|
69
|
+
}, [r.toggleEvent]), A(() => {
|
|
59
70
|
if (typeof document > "u") return;
|
|
60
71
|
let e = (e) => {
|
|
61
|
-
_(e) && (e.preventDefault(), o((e) => !e));
|
|
72
|
+
_(e) && (e.preventDefault(), !(d.current && u.current?.() === !0) && o((e) => !e));
|
|
62
73
|
};
|
|
63
74
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
64
|
-
}, []),
|
|
65
|
-
let
|
|
75
|
+
}, []), q(t?.product ?? null, t?.onExhausted ?? J);
|
|
76
|
+
let E = K(), D = y({
|
|
66
77
|
isOpen: a,
|
|
67
78
|
docked: c,
|
|
68
|
-
isDesktop:
|
|
69
|
-
}),
|
|
79
|
+
isDesktop: E
|
|
80
|
+
}), k = b({
|
|
70
81
|
isOpen: a,
|
|
71
82
|
docked: c,
|
|
72
|
-
isDesktop:
|
|
83
|
+
isDesktop: E
|
|
73
84
|
});
|
|
74
|
-
|
|
85
|
+
A(() => {
|
|
75
86
|
if (typeof document > "u") return;
|
|
76
87
|
let e = document.documentElement.style;
|
|
77
|
-
return e.setProperty(i, `${
|
|
88
|
+
return e.setProperty(i, `${D}px`), () => {
|
|
78
89
|
e.removeProperty(i);
|
|
79
90
|
};
|
|
80
|
-
}, [
|
|
91
|
+
}, [D]), A(() => {
|
|
81
92
|
if (typeof document > "u") return;
|
|
82
93
|
let e = document.documentElement.style;
|
|
83
|
-
return e.setProperty(s, `${
|
|
94
|
+
return e.setProperty(s, `${k}px`), () => {
|
|
84
95
|
e.removeProperty(s);
|
|
85
96
|
};
|
|
86
|
-
}, [
|
|
87
|
-
let
|
|
97
|
+
}, [k]);
|
|
98
|
+
let P = j(() => ({
|
|
88
99
|
isOpen: a,
|
|
89
|
-
open:
|
|
90
|
-
close:
|
|
91
|
-
toggle:
|
|
100
|
+
open: h,
|
|
101
|
+
close: g,
|
|
102
|
+
toggle: w,
|
|
92
103
|
docked: c,
|
|
93
|
-
toggleDock:
|
|
94
|
-
dockWidthPx:
|
|
95
|
-
panelInsetPx:
|
|
96
|
-
keys: r
|
|
104
|
+
toggleDock: T,
|
|
105
|
+
dockWidthPx: D,
|
|
106
|
+
panelInsetPx: k,
|
|
107
|
+
keys: r,
|
|
108
|
+
registerCloseGuard: m
|
|
97
109
|
}), [
|
|
98
110
|
a,
|
|
99
|
-
|
|
100
|
-
d,
|
|
101
|
-
f,
|
|
102
|
-
c,
|
|
103
|
-
m,
|
|
111
|
+
h,
|
|
104
112
|
g,
|
|
105
113
|
w,
|
|
106
|
-
|
|
114
|
+
c,
|
|
115
|
+
T,
|
|
116
|
+
D,
|
|
117
|
+
k,
|
|
118
|
+
r,
|
|
119
|
+
m
|
|
107
120
|
]);
|
|
108
|
-
return /* @__PURE__ */
|
|
109
|
-
value:
|
|
121
|
+
return /* @__PURE__ */ I(R.Provider, {
|
|
122
|
+
value: P,
|
|
110
123
|
children: n
|
|
111
124
|
});
|
|
112
125
|
}
|
|
113
|
-
var
|
|
126
|
+
var X = (e, t) => /* @__PURE__ */ I(E, {
|
|
114
127
|
...e,
|
|
115
128
|
...t
|
|
116
129
|
});
|
|
117
|
-
function
|
|
118
|
-
let t =
|
|
119
|
-
return t ? /* @__PURE__ */
|
|
130
|
+
function Z(e) {
|
|
131
|
+
let t = z();
|
|
132
|
+
return t ? /* @__PURE__ */ I(Q, {
|
|
120
133
|
state: t,
|
|
121
134
|
...e
|
|
122
135
|
}) : null;
|
|
123
136
|
}
|
|
124
|
-
function
|
|
125
|
-
let { isOpen: S, close: C, toggle:
|
|
137
|
+
function Q({ state: e, panelId: i = "ai-assistant", panelProps: a, renderPanel: s, navigate: p, isShellLessTarget: m, topOffsetPx: _ = 56, launcherIcon: v, launcherBottomInset: y = "1.5rem", showLauncher: b = !0, closeOnEscape: x = !0 }) {
|
|
138
|
+
let { isOpen: S, close: C, toggle: E, docked: D, toggleDock: O, dockWidthPx: k } = e, M = t();
|
|
126
139
|
w(a?.serverHistory === !0);
|
|
127
|
-
let [
|
|
140
|
+
let [P, R] = N(!1), z = j(() => p ? g({
|
|
128
141
|
navigate: p,
|
|
129
142
|
isShellLessTarget: m,
|
|
130
|
-
isDesktop:
|
|
131
|
-
collapseSheet: () =>
|
|
143
|
+
isDesktop: G,
|
|
144
|
+
collapseSheet: () => R(!1),
|
|
132
145
|
openInNewTab: (e) => window.open(e, "_blank", "noopener,noreferrer")
|
|
133
146
|
}) : void 0, [p, m]);
|
|
134
|
-
|
|
147
|
+
A(() => {
|
|
135
148
|
if (!S || !x) return;
|
|
136
149
|
let e = (e) => {
|
|
137
150
|
f({
|
|
@@ -149,53 +162,56 @@ function Z({ state: e, panelId: i = "ai-assistant", panelProps: a, renderPanel:
|
|
|
149
162
|
C,
|
|
150
163
|
x
|
|
151
164
|
]);
|
|
152
|
-
let
|
|
165
|
+
let B = {
|
|
153
166
|
panelId: i,
|
|
154
167
|
visible: !0,
|
|
155
168
|
onClose: C,
|
|
156
|
-
docked:
|
|
157
|
-
onToggleDock:
|
|
158
|
-
onNavigate:
|
|
169
|
+
docked: D,
|
|
170
|
+
onToggleDock: O,
|
|
171
|
+
onNavigate: z,
|
|
159
172
|
isShellLessTarget: m
|
|
160
|
-
},
|
|
173
|
+
}, V = M("overlay.launcher", "AI Assistant"), H = {
|
|
161
174
|
[o]: `${_}px`,
|
|
162
175
|
[c]: "var(--mobile-tabbar-height, 0px)"
|
|
163
176
|
};
|
|
164
|
-
return /* @__PURE__ */
|
|
177
|
+
return /* @__PURE__ */ L(r, {
|
|
165
178
|
preview: a?.preview,
|
|
166
|
-
children: [S && /* @__PURE__ */
|
|
179
|
+
children: [S && /* @__PURE__ */ L("div", {
|
|
167
180
|
className: d({
|
|
168
|
-
expanded:
|
|
169
|
-
docked:
|
|
181
|
+
expanded: P,
|
|
182
|
+
docked: D
|
|
170
183
|
}),
|
|
171
|
-
style:
|
|
184
|
+
style: H,
|
|
172
185
|
"data-testid": "assistant-overlay",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ I("button", {
|
|
174
187
|
type: "button",
|
|
175
|
-
onClick: () =>
|
|
188
|
+
onClick: () => R((e) => !e),
|
|
176
189
|
className: "flex w-full shrink-0 justify-center pt-2 pb-1 sm:hidden",
|
|
177
|
-
"aria-label":
|
|
178
|
-
"aria-expanded":
|
|
190
|
+
"aria-label": P ? M("sheet.collapse", "Shrink the assistant") : M("sheet.expand", "Expand the assistant"),
|
|
191
|
+
"aria-expanded": P,
|
|
179
192
|
"data-testid": "assistant-sheet-handle",
|
|
180
|
-
children: /* @__PURE__ */
|
|
181
|
-
}), /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ I("span", { className: "h-1.5 w-10 rounded-full bg-border-strong" })
|
|
194
|
+
}), /* @__PURE__ */ I("div", {
|
|
182
195
|
className: "flex min-h-0 flex-1 flex-col",
|
|
183
|
-
children:
|
|
196
|
+
children: /* @__PURE__ */ I(T.Provider, {
|
|
197
|
+
value: e.registerCloseGuard ?? null,
|
|
198
|
+
children: s ? s(B) : X(a, B)
|
|
199
|
+
})
|
|
184
200
|
})]
|
|
185
|
-
}), b && /* @__PURE__ */
|
|
201
|
+
}), b && /* @__PURE__ */ I("button", {
|
|
186
202
|
type: "button",
|
|
187
|
-
onClick:
|
|
188
|
-
title:
|
|
189
|
-
"aria-label":
|
|
203
|
+
onClick: E,
|
|
204
|
+
title: M("overlay.launcherTitle", "AI Assistant ({{shortcut}})", { shortcut: "Ctrl+Shift+A" }),
|
|
205
|
+
"aria-label": V,
|
|
190
206
|
"aria-haspopup": "dialog",
|
|
191
207
|
"aria-expanded": S,
|
|
192
208
|
"data-testid": "assistant-fab",
|
|
193
209
|
style: {
|
|
194
210
|
bottom: l(y),
|
|
195
|
-
right: u(
|
|
211
|
+
right: u(k)
|
|
196
212
|
},
|
|
197
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 " + (S ? "hidden sm:inline-flex" : "inline-flex"),
|
|
198
|
-
children: v ?? /* @__PURE__ */ F
|
|
214
|
+
children: v ?? /* @__PURE__ */ I(F, {
|
|
199
215
|
className: "size-6",
|
|
200
216
|
"aria-hidden": "true"
|
|
201
217
|
})
|
|
@@ -203,4 +219,4 @@ function Z({ state: e, panelId: i = "ai-assistant", panelProps: a, renderPanel:
|
|
|
203
219
|
});
|
|
204
220
|
}
|
|
205
221
|
//#endregion
|
|
206
|
-
export {
|
|
222
|
+
export { Z as AssistantOverlay, Y as AssistantOverlayProvider, B as useAssistantDockWidth, z as useAssistantOverlayOrNull, V as useAssistantPanelInset, q as useAssistantQuotaExhausted };
|