@burdenoff/fe-libs 2026.1023.3 → 2026.1023.5
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/createSandboxAssistantTransport.js +1 -1
- package/dist/shared/assistant/pageContextKeys.d.ts +14 -1
- package/dist/shared/assistant/pageContextKeys.js +11 -2
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +13 -0
- package/dist/shared/assistant/ui/AssistantOverlay.js +103 -96
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts +17 -0
- package/dist/shared/assistant/ui/assistantOverlayState.js +18 -14
- package/dist/shared/assistant/ui/voice/VoiceMiniController.js +1 -1
- package/dist/shared/components/assistantWidget/AssistantWidget.d.ts +14 -0
- package/dist/shared-assistant.js +297 -297
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ import { assistantUsageLedger as _, hasPendingUsageReports as v, reportUsageWith
|
|
|
11
11
|
var S = 42e4, C = 400, w = 2e3, T = 5e3;
|
|
12
12
|
function E() {
|
|
13
13
|
return typeof window > "u" ? {} : {
|
|
14
|
-
currentUrl: window.location.
|
|
14
|
+
currentUrl: `${window.location.origin}${window.location.pathname}`,
|
|
15
15
|
currentPage: window.location.pathname.split("/").filter(Boolean).slice(0, 3).join("/") || "home",
|
|
16
16
|
viewportSize: `${window.innerWidth}x${window.innerHeight}`
|
|
17
17
|
};
|
|
@@ -35,9 +35,22 @@ export type AssistantPageContextKey = (typeof ASSISTANT_MODEL_CONTEXT_KEYS)[numb
|
|
|
35
35
|
export declare const ASSISTANT_PAGE_CONTEXT_KEYS: readonly AssistantPageContextKey[];
|
|
36
36
|
/** Whether the sandbox reads `key` from `pageContext`. */
|
|
37
37
|
export declare function isAssistantPageContextKey(key: string): key is AssistantPageContextKey;
|
|
38
|
+
/**
|
|
39
|
+
* `currentUrl` without the parts that carry credentials (G87): the query string,
|
|
40
|
+
* the fragment, and any `user:password@` userinfo.
|
|
41
|
+
*
|
|
42
|
+
* Straight after sign-in a shell URL holds live tokens in its `#sso=` fragment,
|
|
43
|
+
* and share links hold bearer tokens in their query string. Hosts are expected
|
|
44
|
+
* to send origin + path already; this is the backstop for one that forwards
|
|
45
|
+
* `window.location.href`. The cut is unconditional rather than a deny-list of
|
|
46
|
+
* parameter names, so a new token parameter cannot slip past it.
|
|
47
|
+
*/
|
|
48
|
+
export declare function credentialFreeContextUrl(value: string): string;
|
|
38
49
|
/**
|
|
39
50
|
* The part of a host's page context that goes on the wire: only allow-listed
|
|
40
|
-
* keys, with their values untouched
|
|
51
|
+
* keys, with their values untouched — except `currentUrl`, which loses its
|
|
52
|
+
* query string, fragment and userinfo (`credentialFreeContextUrl`).
|
|
53
|
+
* `undefined` stays `undefined`, so a turn
|
|
41
54
|
* with no context still produces the body it always did; a context with no
|
|
42
55
|
* allow-listed key becomes `{}`, which the sandbox treats as "no context".
|
|
43
56
|
*
|
|
@@ -37,10 +37,19 @@ function i(e) {
|
|
|
37
37
|
return r.has(e);
|
|
38
38
|
}
|
|
39
39
|
function a(e) {
|
|
40
|
+
let t = e.split(/[?#]/, 1)[0] ?? "", n;
|
|
41
|
+
try {
|
|
42
|
+
n = new URL(t);
|
|
43
|
+
} catch {
|
|
44
|
+
return t;
|
|
45
|
+
}
|
|
46
|
+
return n.username === "" && n.password === "" ? t : `${n.origin}${n.pathname}`;
|
|
47
|
+
}
|
|
48
|
+
function o(e) {
|
|
40
49
|
if (e === void 0) return;
|
|
41
50
|
let t = {};
|
|
42
|
-
for (let [n, i] of Object.entries(e)) r.has(n) && (t[n] = i);
|
|
51
|
+
for (let [n, i] of Object.entries(e)) r.has(n) && (t[n] = n === "currentUrl" && typeof i == "string" ? a(i) : i);
|
|
43
52
|
return t;
|
|
44
53
|
}
|
|
45
54
|
//#endregion
|
|
46
|
-
export { e as ASSISTANT_MODEL_CONTEXT_KEYS, n as ASSISTANT_PAGE_CONTEXT_KEYS, t as ASSISTANT_REDACTED_CONTEXT_ID_KEYS, a as filterAssistantPageContext, i as isAssistantPageContextKey };
|
|
55
|
+
export { e as ASSISTANT_MODEL_CONTEXT_KEYS, n as ASSISTANT_PAGE_CONTEXT_KEYS, t as ASSISTANT_REDACTED_CONTEXT_ID_KEYS, a as credentialFreeContextUrl, o as filterAssistantPageContext, i as isAssistantPageContextKey };
|
|
@@ -128,6 +128,19 @@ export interface AssistantOverlayProps {
|
|
|
128
128
|
launcherBottomInset?: string;
|
|
129
129
|
/** Hide the launcher when the product opens the assistant from its own chrome. */
|
|
130
130
|
showLauncher?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Let the overlay close itself on Escape. Default `true`.
|
|
133
|
+
*
|
|
134
|
+
* ★ A host that already decides Escape for the assistant passes `false` and
|
|
135
|
+
* closes it through `useAssistantOverlayOrNull().close`. VibeControls does:
|
|
136
|
+
* its `useAssistantEscape` records the key on `window` in the capture phase
|
|
137
|
+
* and decides once the whole dispatch is over (BOFF-8677), with the same
|
|
138
|
+
* `assistantOverlayEscapeAction`, so a layer opened after the assistant, or
|
|
139
|
+
* a page listener on `window`, still gets the key first. Two listeners
|
|
140
|
+
* deciding the same key would let the earlier one close the assistant under
|
|
141
|
+
* a layer that had not reacted yet.
|
|
142
|
+
*/
|
|
143
|
+
closeOnEscape?: boolean;
|
|
131
144
|
}
|
|
132
145
|
/**
|
|
133
146
|
* The launcher and the window. Renders nothing without an
|
|
@@ -2,193 +2,200 @@ 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 { 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,
|
|
6
|
-
import { useAssistantServerHistory as
|
|
7
|
-
import { AIAssistantPanel as
|
|
8
|
-
import { createContext as
|
|
9
|
-
import { Sparkles as
|
|
10
|
-
import { jsx as
|
|
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
|
+
import { useAssistantServerHistory as w } from "../history/useAssistantServerHistory.js";
|
|
7
|
+
import { AIAssistantPanel as T } from "./AIAssistantPanel.js";
|
|
8
|
+
import { createContext as E, useCallback as D, useContext as O, useEffect as k, useMemo as A, useRef as j, useState as M, useSyncExternalStore as N } from "react";
|
|
9
|
+
import { Sparkles as P } from "lucide-react";
|
|
10
|
+
import { jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
11
11
|
//#region src/shared/assistant/ui/AssistantOverlay.tsx
|
|
12
|
-
var
|
|
13
|
-
function L() {
|
|
14
|
-
return D(I);
|
|
15
|
-
}
|
|
12
|
+
var L = E(null);
|
|
16
13
|
function R() {
|
|
17
|
-
return
|
|
14
|
+
return O(L);
|
|
18
15
|
}
|
|
19
16
|
function z() {
|
|
20
|
-
return
|
|
17
|
+
return O(L)?.dockWidthPx ?? 0;
|
|
18
|
+
}
|
|
19
|
+
function B() {
|
|
20
|
+
return O(L)?.panelInsetPx ?? 0;
|
|
21
21
|
}
|
|
22
|
-
var
|
|
23
|
-
function
|
|
22
|
+
var V = () => typeof window > "u" ? void 0 : window.sessionStorage, H = () => typeof window > "u" ? void 0 : window.localStorage;
|
|
23
|
+
function U(e) {
|
|
24
24
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
|
|
25
25
|
let t = window.matchMedia(a);
|
|
26
26
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function W() {
|
|
29
29
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(min-width: 640px)").matches;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function G() {
|
|
32
|
+
return N(U, W, () => !1);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
let r =
|
|
36
|
-
|
|
34
|
+
function K(t, n) {
|
|
35
|
+
let r = j(n);
|
|
36
|
+
k(() => {
|
|
37
37
|
r.current = n;
|
|
38
|
-
}, [n]),
|
|
38
|
+
}, [n]), k(() => {
|
|
39
39
|
if (!t || typeof window > "u") return;
|
|
40
|
-
let n = e(t), i = (e) => r.current(
|
|
40
|
+
let n = e(t), i = (e) => r.current(m(e), e);
|
|
41
41
|
return window.addEventListener(n, i), () => window.removeEventListener(n, i);
|
|
42
42
|
}, [t]);
|
|
43
43
|
}
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
let r =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, [r.openStorageKey, a]),
|
|
50
|
-
|
|
51
|
-
}, [r.dockStorageKey, c]),
|
|
44
|
+
var q = () => {};
|
|
45
|
+
function J({ keyPrefix: e, quota: t, children: n }) {
|
|
46
|
+
let r = A(() => p(e), [e]), [a, o] = M(() => x(V, r.openStorageKey)), [c, l] = M(() => x(H, r.dockStorageKey)), u = D(() => o(!0), []), d = D(() => o(!1), []), f = D(() => o((e) => !e), []), m = D(() => l((e) => !e), []);
|
|
47
|
+
k(() => {
|
|
48
|
+
C(V, r.openStorageKey, a);
|
|
49
|
+
}, [r.openStorageKey, a]), k(() => {
|
|
50
|
+
C(H, r.dockStorageKey, c);
|
|
51
|
+
}, [r.dockStorageKey, c]), k(() => {
|
|
52
52
|
if (typeof window > "u") return;
|
|
53
53
|
let e = (e) => {
|
|
54
|
-
let t =
|
|
55
|
-
o((e) =>
|
|
54
|
+
let t = S(e);
|
|
55
|
+
o((e) => v(e, t));
|
|
56
56
|
};
|
|
57
57
|
return window.addEventListener(r.toggleEvent, e), () => window.removeEventListener(r.toggleEvent, e);
|
|
58
|
-
}, [r.toggleEvent]),
|
|
58
|
+
}, [r.toggleEvent]), k(() => {
|
|
59
59
|
if (typeof document > "u") return;
|
|
60
60
|
let e = (e) => {
|
|
61
|
-
|
|
61
|
+
_(e) && (e.preventDefault(), o((e) => !e));
|
|
62
62
|
};
|
|
63
63
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
64
|
-
}, []),
|
|
65
|
-
let h =
|
|
64
|
+
}, []), K(t?.product ?? null, t?.onExhausted ?? q);
|
|
65
|
+
let h = G(), g = y({
|
|
66
66
|
isOpen: a,
|
|
67
67
|
docked: c,
|
|
68
68
|
isDesktop: h
|
|
69
|
-
}), w =
|
|
69
|
+
}), w = b({
|
|
70
70
|
isOpen: a,
|
|
71
71
|
docked: c,
|
|
72
72
|
isDesktop: h
|
|
73
73
|
});
|
|
74
|
-
|
|
74
|
+
k(() => {
|
|
75
75
|
if (typeof document > "u") return;
|
|
76
76
|
let e = document.documentElement.style;
|
|
77
|
-
return e.setProperty(i, `${
|
|
77
|
+
return e.setProperty(i, `${g}px`), () => {
|
|
78
78
|
e.removeProperty(i);
|
|
79
79
|
};
|
|
80
|
-
}, [
|
|
80
|
+
}, [g]), k(() => {
|
|
81
81
|
if (typeof document > "u") return;
|
|
82
82
|
let e = document.documentElement.style;
|
|
83
83
|
return e.setProperty(s, `${w}px`), () => {
|
|
84
84
|
e.removeProperty(s);
|
|
85
85
|
};
|
|
86
86
|
}, [w]);
|
|
87
|
-
let T =
|
|
87
|
+
let T = A(() => ({
|
|
88
88
|
isOpen: a,
|
|
89
89
|
open: u,
|
|
90
90
|
close: d,
|
|
91
|
-
toggle:
|
|
91
|
+
toggle: f,
|
|
92
92
|
docked: c,
|
|
93
93
|
toggleDock: m,
|
|
94
|
-
dockWidthPx:
|
|
94
|
+
dockWidthPx: g,
|
|
95
95
|
panelInsetPx: w,
|
|
96
96
|
keys: r
|
|
97
97
|
}), [
|
|
98
98
|
a,
|
|
99
99
|
u,
|
|
100
100
|
d,
|
|
101
|
-
|
|
101
|
+
f,
|
|
102
102
|
c,
|
|
103
103
|
m,
|
|
104
|
-
|
|
104
|
+
g,
|
|
105
105
|
w,
|
|
106
106
|
r
|
|
107
107
|
]);
|
|
108
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ F(L.Provider, {
|
|
109
109
|
value: T,
|
|
110
110
|
children: n
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
var
|
|
113
|
+
var Y = (e, t) => /* @__PURE__ */ F(T, {
|
|
114
114
|
...e,
|
|
115
115
|
...t
|
|
116
116
|
});
|
|
117
|
-
function
|
|
118
|
-
let t =
|
|
119
|
-
return t ? /* @__PURE__ */
|
|
117
|
+
function X(e) {
|
|
118
|
+
let t = R();
|
|
119
|
+
return t ? /* @__PURE__ */ F(Z, {
|
|
120
120
|
state: t,
|
|
121
121
|
...e
|
|
122
122
|
}) : null;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
let { isOpen:
|
|
126
|
-
|
|
127
|
-
let [
|
|
128
|
-
navigate:
|
|
129
|
-
isShellLessTarget:
|
|
130
|
-
isDesktop:
|
|
131
|
-
collapseSheet: () =>
|
|
124
|
+
function Z({ 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 }) {
|
|
125
|
+
let { isOpen: S, close: C, toggle: T, docked: E, toggleDock: D, dockWidthPx: O } = e, j = t();
|
|
126
|
+
w(a?.serverHistory === !0);
|
|
127
|
+
let [N, L] = M(!1), R = A(() => p ? g({
|
|
128
|
+
navigate: p,
|
|
129
|
+
isShellLessTarget: m,
|
|
130
|
+
isDesktop: W,
|
|
131
|
+
collapseSheet: () => L(!1),
|
|
132
132
|
openInNewTab: (e) => window.open(e, "_blank", "noopener,noreferrer")
|
|
133
|
-
}) : void 0, [
|
|
134
|
-
|
|
135
|
-
if (!
|
|
133
|
+
}) : void 0, [p, m]);
|
|
134
|
+
k(() => {
|
|
135
|
+
if (!S || !x) return;
|
|
136
136
|
let e = (e) => {
|
|
137
|
-
|
|
137
|
+
f({
|
|
138
138
|
key: e.key,
|
|
139
|
-
isOpen:
|
|
139
|
+
isOpen: S,
|
|
140
140
|
alreadyHandled: e.defaultPrevented,
|
|
141
141
|
dialogOpen: document.querySelector("[role=\"dialog\"],[role=\"alertdialog\"],dialog[open]") !== null,
|
|
142
|
-
pressedInsideDialog:
|
|
142
|
+
pressedInsideDialog: h(e.target, "[role=\"dialog\"],[role=\"alertdialog\"],dialog[open]") !== null,
|
|
143
143
|
panelOwnsEscape: n()
|
|
144
|
-
}) === "close" && (e.preventDefault(),
|
|
144
|
+
}) === "close" && (e.preventDefault(), C());
|
|
145
145
|
};
|
|
146
146
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
147
|
-
}, [
|
|
148
|
-
|
|
147
|
+
}, [
|
|
148
|
+
S,
|
|
149
|
+
C,
|
|
150
|
+
x
|
|
151
|
+
]);
|
|
152
|
+
let z = {
|
|
149
153
|
panelId: i,
|
|
150
154
|
visible: !0,
|
|
151
|
-
onClose:
|
|
152
|
-
docked:
|
|
153
|
-
onToggleDock:
|
|
154
|
-
onNavigate:
|
|
155
|
-
isShellLessTarget:
|
|
156
|
-
},
|
|
157
|
-
[o]: `${
|
|
155
|
+
onClose: C,
|
|
156
|
+
docked: E,
|
|
157
|
+
onToggleDock: D,
|
|
158
|
+
onNavigate: R,
|
|
159
|
+
isShellLessTarget: m
|
|
160
|
+
}, B = j("overlay.launcher", "AI Assistant"), V = {
|
|
161
|
+
[o]: `${_}px`,
|
|
158
162
|
[c]: "var(--mobile-tabbar-height, 0px)"
|
|
159
163
|
};
|
|
160
|
-
return /* @__PURE__ */
|
|
164
|
+
return /* @__PURE__ */ I(r, {
|
|
161
165
|
preview: a?.preview,
|
|
162
|
-
children: [
|
|
163
|
-
className:
|
|
164
|
-
expanded:
|
|
165
|
-
docked:
|
|
166
|
+
children: [S && /* @__PURE__ */ I("div", {
|
|
167
|
+
className: d({
|
|
168
|
+
expanded: N,
|
|
169
|
+
docked: E
|
|
166
170
|
}),
|
|
167
|
-
style:
|
|
171
|
+
style: V,
|
|
168
172
|
"data-testid": "assistant-overlay",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
173
|
+
children: [/* @__PURE__ */ F("button", {
|
|
170
174
|
type: "button",
|
|
171
|
-
onClick: () =>
|
|
175
|
+
onClick: () => L((e) => !e),
|
|
172
176
|
className: "flex w-full shrink-0 justify-center pt-2 pb-1 sm:hidden",
|
|
173
|
-
"aria-label":
|
|
174
|
-
"aria-expanded":
|
|
177
|
+
"aria-label": N ? j("sheet.collapse", "Shrink the assistant") : j("sheet.expand", "Expand the assistant"),
|
|
178
|
+
"aria-expanded": N,
|
|
175
179
|
"data-testid": "assistant-sheet-handle",
|
|
176
|
-
children: /* @__PURE__ */
|
|
177
|
-
}), /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ F("span", { className: "h-1.5 w-10 rounded-full bg-border-strong" })
|
|
181
|
+
}), /* @__PURE__ */ F("div", {
|
|
178
182
|
className: "flex min-h-0 flex-1 flex-col",
|
|
179
|
-
children: s ? s(
|
|
183
|
+
children: s ? s(z) : Y(a, z)
|
|
180
184
|
})]
|
|
181
|
-
}),
|
|
185
|
+
}), b && /* @__PURE__ */ F("button", {
|
|
182
186
|
type: "button",
|
|
183
|
-
onClick:
|
|
184
|
-
title:
|
|
185
|
-
"aria-label":
|
|
187
|
+
onClick: T,
|
|
188
|
+
title: j("overlay.launcherTitle", "AI Assistant ({{shortcut}})", { shortcut: "Ctrl+Shift+A" }),
|
|
189
|
+
"aria-label": B,
|
|
186
190
|
"aria-haspopup": "dialog",
|
|
187
|
-
"aria-expanded":
|
|
191
|
+
"aria-expanded": S,
|
|
188
192
|
"data-testid": "assistant-fab",
|
|
189
|
-
style: {
|
|
190
|
-
|
|
191
|
-
|
|
193
|
+
style: {
|
|
194
|
+
bottom: l(y),
|
|
195
|
+
right: u(O)
|
|
196
|
+
},
|
|
197
|
+
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(P, {
|
|
192
199
|
className: "size-6",
|
|
193
200
|
"aria-hidden": "true"
|
|
194
201
|
})
|
|
@@ -196,4 +203,4 @@ function X({ state: e, panelId: i = "ai-assistant", panelProps: a, renderPanel:
|
|
|
196
203
|
});
|
|
197
204
|
}
|
|
198
205
|
//#endregion
|
|
199
|
-
export {
|
|
206
|
+
export { X as AssistantOverlay, J as AssistantOverlayProvider, z as useAssistantDockWidth, R as useAssistantOverlayOrNull, B as useAssistantPanelInset, K as useAssistantQuotaExhausted };
|
|
@@ -124,6 +124,23 @@ export declare function aboveAssistantBottomChrome(inset: string): string;
|
|
|
124
124
|
export declare const ASSISTANT_LAUNCHER_LIFT_VAR = "--assistant-launcher-lift";
|
|
125
125
|
/** The launcher's CSS `bottom`: clears the chrome, then the page's own lift. */
|
|
126
126
|
export declare function assistantLauncherBottom(inset: string): string;
|
|
127
|
+
/** The launcher's gap from the right edge of the viewport (`right-6`). */
|
|
128
|
+
export declare const ASSISTANT_LAUNCHER_RIGHT_INSET = "1.5rem";
|
|
129
|
+
/**
|
|
130
|
+
* The launcher's CSS `right`: its 1.5rem gap, plus the docked panel's width
|
|
131
|
+
* while the panel is docked and open on a desktop viewport.
|
|
132
|
+
*
|
|
133
|
+
* ★★ The launcher stays visible on desktop while the panel is open, and the
|
|
134
|
+
* docked panel is flush right. With a fixed `right-6` the launcher sat UNDER
|
|
135
|
+
* the docked panel (z-30 against z-50): invisible, and the dock covered the
|
|
136
|
+
* page-discussion and other floating buttons a host stacks above it.
|
|
137
|
+
* VibeControls' own overlay fixed this (and HealthyBowl hit the same defect,
|
|
138
|
+
* BOFF-7534); it lives here so every product shell gets it. Floating needs no
|
|
139
|
+
* offset: the window rises from the launcher by design. Pass the published
|
|
140
|
+
* dock width (`publishedAssistantDockWidth`), which is already 0 when closed,
|
|
141
|
+
* floating or on a phone.
|
|
142
|
+
*/
|
|
143
|
+
export declare function assistantLauncherRight(dockWidthPx: number): string;
|
|
127
144
|
/** Width of the docked side panel. Must match `sm:w-[440px]` below. */
|
|
128
145
|
export declare const ASSISTANT_DOCK_WIDTH_PX = 440;
|
|
129
146
|
/**
|
|
@@ -37,23 +37,27 @@ var f = "--assistant-launcher-lift";
|
|
|
37
37
|
function p(e) {
|
|
38
38
|
return `calc(var(${f}, 0px) + ${d(e)})`;
|
|
39
39
|
}
|
|
40
|
-
var m =
|
|
41
|
-
function
|
|
40
|
+
var m = "1.5rem";
|
|
41
|
+
function h(e) {
|
|
42
|
+
return e > 0 ? `calc(${m} + ${e}px)` : m;
|
|
43
|
+
}
|
|
44
|
+
var g = 440, _ = "--assistant-dock-width", v = "--assistant-sheet-bottom", y = "--assistant-overlay-top", b = 56, x = "(min-width: 640px)";
|
|
45
|
+
function S(e) {
|
|
42
46
|
return e.isOpen && e.docked && e.isDesktop ? 440 : 0;
|
|
43
47
|
}
|
|
44
|
-
var
|
|
45
|
-
function
|
|
48
|
+
var C = 520, w = 24, T = "--assistant-panel-inset";
|
|
49
|
+
function E(e) {
|
|
46
50
|
return !e.isOpen || !e.isDesktop ? 0 : e.docked ? 440 : 544;
|
|
47
51
|
}
|
|
48
|
-
var
|
|
49
|
-
function
|
|
52
|
+
var D = "fixed z-50 flex flex-col overflow-hidden border border-border-default bg-bg-surface shadow-2xl inset-x-0 bottom-[var(--assistant-sheet-bottom,0px)] top-auto rounded-t-2xl animate-in slide-in-from-bottom-4 fade-in duration-200", O = "h-[60vh] max-h-[60vh]", k = "h-[88vh] max-h-[88vh]", A = "sm:inset-auto sm:top-auto sm:bottom-24 sm:right-6 sm:rounded-2xl sm:h-[680px] sm:max-h-[calc(100vh-6rem-var(--assistant-overlay-top,56px)-0.5rem)] sm:w-[520px] sm:max-w-[calc(100vw-2rem)]", j = "sm:left-auto sm:right-0 sm:top-[var(--assistant-overlay-top)] sm:bottom-0 sm:rounded-none sm:h-auto sm:max-h-none sm:w-[440px] sm:max-w-[calc(100vw-2rem)]";
|
|
53
|
+
function M(e) {
|
|
50
54
|
return [
|
|
51
|
-
|
|
52
|
-
e.expanded ?
|
|
53
|
-
e.docked ?
|
|
55
|
+
D,
|
|
56
|
+
e.expanded ? k : O,
|
|
57
|
+
e.docked ? j : A
|
|
54
58
|
].join(" ");
|
|
55
59
|
}
|
|
56
|
-
function
|
|
60
|
+
function N(t) {
|
|
57
61
|
return (n, r) => {
|
|
58
62
|
if (t.isShellLessTarget?.(n)) return t.openInNewTab(n), { kind: "new-tab" };
|
|
59
63
|
let i = e(r);
|
|
@@ -64,22 +68,22 @@ function j(t) {
|
|
|
64
68
|
} : (t.navigate(n), t.isDesktop() || t.collapseSheet(), { kind: "routed" });
|
|
65
69
|
};
|
|
66
70
|
}
|
|
67
|
-
function
|
|
71
|
+
function P(e) {
|
|
68
72
|
if (typeof CustomEvent > "u" || !(e instanceof CustomEvent)) return "generic";
|
|
69
73
|
let t = e.detail;
|
|
70
74
|
return typeof t != "object" || !t || !("kind" in t) ? "generic" : t.kind === "sandbox" || t.kind === "ai-credits" ? t.kind : "generic";
|
|
71
75
|
}
|
|
72
|
-
function
|
|
76
|
+
function F(e, t) {
|
|
73
77
|
try {
|
|
74
78
|
return e()?.getItem(t) === "1";
|
|
75
79
|
} catch {
|
|
76
80
|
return !1;
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
|
-
function
|
|
83
|
+
function I(e, t, n) {
|
|
80
84
|
try {
|
|
81
85
|
e()?.setItem(t, n ? "1" : "0");
|
|
82
86
|
} catch {}
|
|
83
87
|
}
|
|
84
88
|
//#endregion
|
|
85
|
-
export { u as ASSISTANT_BOTTOM_CHROME_CLEARANCE, o as ASSISTANT_DIALOG_SELECTOR,
|
|
89
|
+
export { u as ASSISTANT_BOTTOM_CHROME_CLEARANCE, o as ASSISTANT_DIALOG_SELECTOR, j as ASSISTANT_DOCKED_DESKTOP_CLASS, g as ASSISTANT_DOCK_WIDTH_PX, _ as ASSISTANT_DOCK_WIDTH_VAR, A as ASSISTANT_FLOATING_DESKTOP_CLASS, w as ASSISTANT_FLOATING_RIGHT_PX, C as ASSISTANT_FLOATING_WIDTH_PX, f as ASSISTANT_LAUNCHER_LIFT_VAR, m as ASSISTANT_LAUNCHER_RIGHT_INSET, b as ASSISTANT_OVERLAY_DEFAULT_TOP_PX, x as ASSISTANT_OVERLAY_DESKTOP_QUERY, y as ASSISTANT_OVERLAY_TOP_VAR, T as ASSISTANT_PANEL_INSET_VAR, D as ASSISTANT_SHEET_BASE_CLASS, v as ASSISTANT_SHEET_BOTTOM_VAR, O as ASSISTANT_SHEET_COMPACT_CLASS, k as ASSISTANT_SHEET_EXPANDED_CLASS, i as ASSISTANT_TOGGLE_SHORTCUT_LABEL, d as aboveAssistantBottomChrome, p as assistantLauncherBottom, h as assistantLauncherRight, M as assistantOverlayClassName, l as assistantOverlayEscapeAction, t as assistantOverlayKeys, P as assistantQuotaKindOf, s as closestAround, N as createAssistantNavigate, a as isAssistantToggleShortcut, r as nextAssistantOpenState, S as publishedAssistantDockWidth, E as publishedAssistantPanelInset, F as readAssistantOverlayFlag, n as requestedAssistantOpenState, I as writeAssistantOverlayFlag };
|
|
@@ -28,7 +28,7 @@ var f = " self-stretch justify-end pb-8.5 [container-type:size] [@container_(min
|
|
|
28
28
|
rotating: v
|
|
29
29
|
})]
|
|
30
30
|
}), p === "mic-error" ? /* @__PURE__ */ u("p", {
|
|
31
|
-
className: "
|
|
31
|
+
className: "break-words text-xs text-status-warning",
|
|
32
32
|
role: "alert",
|
|
33
33
|
"data-testid": "assistant-voice-mini-error",
|
|
34
34
|
children: b
|
|
@@ -88,4 +88,18 @@ export interface AssistantWidgetProps {
|
|
|
88
88
|
}
|
|
89
89
|
/** External toggle hook so command palettes / plugins can open the widget. */
|
|
90
90
|
export declare const ASSISTANT_WIDGET_TOGGLE_EVENT = "bf:toggle-assistant-widget";
|
|
91
|
+
/**
|
|
92
|
+
* The legacy floating chat widget.
|
|
93
|
+
*
|
|
94
|
+
* @deprecated Mount the shared assistant instead: `AssistantProductProvider`
|
|
95
|
+
* (from `@burdenoff/fe-libs/shared/assistant/product`) around
|
|
96
|
+
* `AssistantOverlayProvider` + `AssistantOverlay` (from
|
|
97
|
+
* `@burdenoff/fe-libs/shared/assistant/ui/AssistantOverlay`), keyed by the
|
|
98
|
+
* active organization. That panel brings history, attachments, voice, the
|
|
99
|
+
* confirm-before-write flow and the product seam; this widget has none of them
|
|
100
|
+
* and takes a product-supplied transport instead. FluidGrids
|
|
101
|
+
* (`FluidGridsAssistant.tsx`) and VibeControls (`AIAssistantOverlay.tsx`) are
|
|
102
|
+
* the reference hosts. Kept, not removed, while the product shells that still
|
|
103
|
+
* render it move over.
|
|
104
|
+
*/
|
|
91
105
|
export declare const AssistantWidget: FC<AssistantWidgetProps>;
|