@burdenoff/fe-libs 2026.930.2 → 2026.930.3
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/preview/AssistantPreviewOverlay.d.ts.map +1 -1
- package/dist/shared/assistant/preview/AssistantPreviewOverlay.js +26 -25
- package/dist/shared/assistant/preview/types.d.ts +34 -4
- package/dist/shared/assistant/preview/types.d.ts.map +1 -1
- package/dist/shared/assistant/preview/types.js +6 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +5 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AIAssistantPanel.js +67 -66
- package/dist/shared/assistant/ui/AssistantEmptyState.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantEmptyState.js +24 -18
- package/dist/shared/assistant/ui/AssistantHeader.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantHeader.js +45 -44
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +14 -1
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantOverlay.js +105 -90
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts +38 -0
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts.map +1 -1
- package/dist/shared/assistant/ui/assistantOverlayState.js +14 -10
- package/dist/shared/assistant/ui/composer/AssistantAttachmentButton.d.ts +9 -0
- package/dist/shared/assistant/ui/composer/AssistantAttachmentButton.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantAttachmentButton.js +37 -33
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +2 -1
- package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.d.ts +16 -0
- package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.js +27 -24
- package/dist/shared-assistant.js +73 -72
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantPreviewOverlay.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/preview/AssistantPreviewOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAA6B,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantPreviewOverlay.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/preview/AssistantPreviewOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAA6B,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AA8E3E,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CA+F/D,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useAssistantTr as e } from "../i18n.js";
|
|
2
2
|
import { useAssistantStore as t } from "../store.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { hasAssistantPreviewSurface as n } from "./types.js";
|
|
4
|
+
import { useAssistantPreview as r } from "./context.js";
|
|
5
|
+
import { useOverlayFocus as i } from "../ui/useOverlayFocus.js";
|
|
6
|
+
import { Component as a } from "react";
|
|
7
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
8
|
//#region src/shared/assistant/preview/AssistantPreviewOverlay.tsx
|
|
8
|
-
var
|
|
9
|
+
var l = class extends a {
|
|
9
10
|
state = {
|
|
10
11
|
failed: !1,
|
|
11
12
|
shownFor: this.props.resetKey
|
|
@@ -25,44 +26,44 @@ var c = class extends i {
|
|
|
25
26
|
render() {
|
|
26
27
|
return this.state.failed ? this.props.fallback : this.props.children;
|
|
27
28
|
}
|
|
28
|
-
},
|
|
29
|
-
let
|
|
29
|
+
}, u = ({ controller: e }) => /* @__PURE__ */ s(o, { children: e.render() }), d = ({ onClose: a }) => {
|
|
30
|
+
let o = r(), d = e(), f = t((e) => {
|
|
30
31
|
let t = e.activeConversationId, n = t ? e.processingByConversationId[t]?.messageId : null;
|
|
31
32
|
return !t || !n ? "idle" : `${t}:${n}#${e.conversations.find((e) => e.id === t)?.updatedAt ?? ""}`;
|
|
32
|
-
}),
|
|
33
|
-
return
|
|
34
|
-
ref:
|
|
33
|
+
}), p = i("assistant-toggle-preview");
|
|
34
|
+
return n(o) ? /* @__PURE__ */ c("div", {
|
|
35
|
+
ref: p,
|
|
35
36
|
tabIndex: -1,
|
|
36
37
|
className: "absolute inset-0 z-10 flex flex-col bg-bg-surface outline-none animate-in slide-in-from-right-2 fade-in duration-200",
|
|
37
38
|
role: "region",
|
|
38
|
-
"aria-label":
|
|
39
|
+
"aria-label": o.label ?? d("preview.title", "Preview"),
|
|
39
40
|
"data-testid": "assistant-preview",
|
|
40
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ c("div", {
|
|
41
42
|
className: "flex items-center justify-between border-b border-border-default px-3 py-2",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
43
|
+
children: [/* @__PURE__ */ s("span", {
|
|
43
44
|
className: "text-sm font-medium text-text-primary",
|
|
44
|
-
children:
|
|
45
|
-
}), /* @__PURE__ */
|
|
45
|
+
children: o.label ?? d("preview.title", "Preview")
|
|
46
|
+
}), /* @__PURE__ */ s("button", {
|
|
46
47
|
type: "button",
|
|
47
|
-
onClick:
|
|
48
|
+
onClick: a,
|
|
48
49
|
className: "rounded-md px-2 py-1 text-xs text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
49
|
-
"aria-label":
|
|
50
|
+
"aria-label": d("preview.close", "Close preview"),
|
|
50
51
|
"data-testid": "assistant-preview-close",
|
|
51
|
-
children:
|
|
52
|
+
children: d("preview.close", "Close preview")
|
|
52
53
|
})]
|
|
53
|
-
}), /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ s("div", {
|
|
54
55
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
-
resetKey:
|
|
57
|
-
fallback: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ s(l, {
|
|
57
|
+
resetKey: f,
|
|
58
|
+
fallback: /* @__PURE__ */ s("p", {
|
|
58
59
|
className: "p-4 text-sm text-text-muted",
|
|
59
60
|
"data-testid": "assistant-preview-failed",
|
|
60
|
-
children:
|
|
61
|
+
children: d("preview.failed", "The preview could not be displayed.")
|
|
61
62
|
}),
|
|
62
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ s(u, { controller: o })
|
|
63
64
|
})
|
|
64
65
|
})]
|
|
65
66
|
}) : null;
|
|
66
67
|
};
|
|
67
68
|
//#endregion
|
|
68
|
-
export {
|
|
69
|
+
export { d as AssistantPreviewOverlay };
|
|
@@ -124,22 +124,32 @@ export type AssistantPreviewEvent = {
|
|
|
124
124
|
* DIFFERENT hook layout while the overlay is open is the classic
|
|
125
125
|
* "rendered more hooks than during the previous render" error. Keep one
|
|
126
126
|
* renderer per mounted preview, and branch inside it rather than swapping it.
|
|
127
|
+
* The same goes for adding or dropping `render` itself: decide once whether
|
|
128
|
+
* the controller is headless.
|
|
127
129
|
*
|
|
128
130
|
* Neither is enforced by the type system: a named function passed as a callback
|
|
129
131
|
* satisfies the hooks lint, so nothing warns.
|
|
130
132
|
*/
|
|
131
133
|
export interface AssistantPreviewController {
|
|
132
134
|
/**
|
|
133
|
-
* The product's own preview surface. Returns JSX and
|
|
134
|
-
* so it may use hooks like any component body.
|
|
135
|
+
* The product's own preview surface, drawn INSIDE the panel. Returns JSX and
|
|
136
|
+
* is called during render, so it may use hooks like any component body.
|
|
135
137
|
*
|
|
136
138
|
* ★ It is rendered as an OVERLAY over a still-mounted chat area — never as an
|
|
137
139
|
* alternate view. Swapping the panel's body would unmount `AssistantChatArea`
|
|
138
140
|
* and take the voice session, the in-flight turn, draft attachments and the
|
|
139
141
|
* composer draft with it, while turn status lives on in the zustand store:
|
|
140
142
|
* split-brain rather than a clean stop.
|
|
143
|
+
*
|
|
144
|
+
* ★★ OPTIONAL (BOFF-7799). Omit it when the product draws its preview on the
|
|
145
|
+
* page and wants only the events. BigConsole did exactly that, but `render`
|
|
146
|
+
* was required, so it also supplied an in-panel copy. The panel then offered a
|
|
147
|
+
* "Build preview" toggle for that copy, even with no run in the tab; it showed
|
|
148
|
+
* an empty rail captioned "Done", and opening it made the page copy stand
|
|
149
|
+
* down. Without `render` the panel shows no toggle, never opens the overlay
|
|
150
|
+
* and never publishes `data-assistant-overlay="preview"`.
|
|
141
151
|
*/
|
|
142
|
-
render
|
|
152
|
+
render?: () => ReactNode;
|
|
143
153
|
/**
|
|
144
154
|
* Run-scoped progress. Optional: a product may want the surface without the
|
|
145
155
|
* stream.
|
|
@@ -148,7 +158,27 @@ export interface AssistantPreviewController {
|
|
|
148
158
|
* never disturb the assistant, and must never cause a retry.
|
|
149
159
|
*/
|
|
150
160
|
onEvent?: (event: AssistantPreviewEvent) => void;
|
|
151
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* Toggle label. Product-neutral English fallback if omitted. Unused by a
|
|
163
|
+
* headless controller, which has no toggle.
|
|
164
|
+
*/
|
|
152
165
|
label?: string;
|
|
153
166
|
}
|
|
167
|
+
/** A controller that draws a surface inside the panel: one with `render`. */
|
|
168
|
+
export type AssistantPreviewSurfaceController = AssistantPreviewController & {
|
|
169
|
+
render: () => ReactNode;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Does this controller put a surface in the panel?
|
|
173
|
+
*
|
|
174
|
+
* ★★ ONE PREDICATE for the header's toggle, the panel's open flag and the
|
|
175
|
+
* overlay. If they each tested `render` themselves, one of them would drift and
|
|
176
|
+
* the panel could offer a toggle that opens nothing, or publish an overlay
|
|
177
|
+
* nobody can see (which Escape and every host would then believe is open).
|
|
178
|
+
*
|
|
179
|
+
* `null` and `undefined` answer false, like a controller with no `render`: in
|
|
180
|
+
* both cases there is nothing to draw. Only the bridge still cares about the
|
|
181
|
+
* difference, since a headless controller still gets events.
|
|
182
|
+
*/
|
|
183
|
+
export declare function hasAssistantPreviewSurface(controller: AssistantPreviewController | null | undefined): controller is AssistantPreviewSurfaceController;
|
|
154
184
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/preview/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/preview/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,mBAAmB,CAAA;CAAE,GAC3C;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,mBAAmB,CAAC;IACzB;;;;;;;;OAQG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACrC,GACD;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,GAAG,EAAE,mBAAmB,CAAC;IACzB;;;;;;;;OAQG;IACH,OAAO,EAAE,UAAU,GAAG,OAAO,GAAG,WAAW,CAAC;IAC5C;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEN;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,EAAE,MAAM,SAAS,CAAC;IAEzB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAEjD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,6EAA6E;AAC7E,MAAM,MAAM,iCAAiC,GAAG,0BAA0B,GAAG;IAC3E,MAAM,EAAE,MAAM,SAAS,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,0BAA0B,GAAG,IAAI,GAAG,SAAS,GACxD,UAAU,IAAI,iCAAiC,CAEjD"}
|
|
@@ -57,6 +57,11 @@ export type AIAssistantPanelProps = PanelProps & {
|
|
|
57
57
|
* ★ Absence is the off-switch — no controller, no toggle, no overlay and no
|
|
58
58
|
* events. There is deliberately no second flag that could disagree with it.
|
|
59
59
|
*
|
|
60
|
+
* ★★ A controller with no `render` is HEADLESS (BOFF-7799): its events flow
|
|
61
|
+
* as usual, but there is no toggle and no overlay, and the panel never
|
|
62
|
+
* publishes `data-assistant-overlay="preview"`. That is a product that draws
|
|
63
|
+
* its preview on the page and needs no second copy in here.
|
|
64
|
+
*
|
|
60
65
|
* ★★ Passed through `AssistantOverlay`'s `panelProps`, its events keep flowing
|
|
61
66
|
* after the panel closes: the overlay runs the bridge, and this panel then
|
|
62
67
|
* runs none for the same controller (BOFF-7367, see `bridgeHost.tsx`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIAssistantPanel.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AIAssistantPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAU,KAAK,EAAE,EAAY,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAMtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIvE,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AAkBrC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AIAssistantPanel.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AIAssistantPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAU,KAAK,EAAE,EAAY,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAMtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIvE,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AAkBrC,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,kBAAkB,CAAC;AAK1B,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG;IAC/C,gEAAgE;IAChE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B;;;;;;;;;OASG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,EAAE,0BAA0B,CAAC;IACrC;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA0PtD,CAAC"}
|
|
@@ -6,95 +6,96 @@ import { useAssistantStore as i } from "../store.js";
|
|
|
6
6
|
import { AssistantSpeechProvider as a } from "./AssistantSpeechProvider.js";
|
|
7
7
|
import { AssistantConnectSourceProvider as o } from "./composer/connectSource.js";
|
|
8
8
|
import { ASSISTANT_OVERLAY_ATTR as s, ASSISTANT_PANEL_ATTR as c, activePanelOverlay as l, escapeDismisses as u, nextPanelOverlays as d } from "./panelOverlays.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
9
|
+
import { hasAssistantPreviewSurface as f } from "../preview/types.js";
|
|
10
|
+
import { AssistantPreviewProvider as p } from "../preview/context.js";
|
|
11
|
+
import { useAssistantPreviewBridge as m } from "../preview/useAssistantPreviewBridge.js";
|
|
12
|
+
import { panelOwnedPreviewBridge as h, useHostedAssistantPreviewBridge as g } from "../preview/bridgeHostContext.js";
|
|
13
|
+
import { AssistantPreviewOverlay as _ } from "../preview/AssistantPreviewOverlay.js";
|
|
14
|
+
import { AssistantHeader as v } from "./AssistantHeader.js";
|
|
15
|
+
import { AssistantConversationList as y } from "./AssistantConversationList.js";
|
|
16
|
+
import { useAssistantServerHistory as b } from "../history/useAssistantServerHistory.js";
|
|
17
|
+
import { useFilesServiceWarmup as x } from "../../../storage/warmFilesService.js";
|
|
18
|
+
import { useAssistantHeartbeat as S } from "../useAssistantHeartbeat.js";
|
|
19
|
+
import { useAssistantKeyboardShortcuts as C } from "../useAssistantKeyboardShortcuts.js";
|
|
20
|
+
import { AssistantChatArea as w } from "./AssistantChatArea.js";
|
|
21
|
+
import { useRef as T, useState as E } from "react";
|
|
22
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
22
23
|
//#region src/shared/assistant/ui/AIAssistantPanel.tsx
|
|
23
|
-
var
|
|
24
|
+
var k = ({ onClose: k, visible: A, docked: j, onToggleDock: M, writeAccess: N, onNavigate: ee, connectSourceHref: P, onConnectSource: F, preview: I, serverHistory: L = !1 }) => {
|
|
24
25
|
let R = n();
|
|
25
|
-
|
|
26
|
-
let [z, B] =
|
|
27
|
-
z && !
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
let
|
|
31
|
-
e(
|
|
32
|
-
let { conversations:
|
|
33
|
-
historyOpen:
|
|
34
|
-
previewOpen:
|
|
35
|
-
}),
|
|
26
|
+
b(L);
|
|
27
|
+
let [z, B] = E(!1), V = f(I);
|
|
28
|
+
z && !V && B(!1);
|
|
29
|
+
let H = z && V;
|
|
30
|
+
m(h(I, g()));
|
|
31
|
+
let U = T(null);
|
|
32
|
+
e(U);
|
|
33
|
+
let { conversations: W, activeConversationId: G, conversationListOpen: K, setConversationListOpen: q, createConversation: J } = i(), Y = K || H, X = l({
|
|
34
|
+
historyOpen: K,
|
|
35
|
+
previewOpen: H
|
|
36
|
+
}), Z = (e) => {
|
|
36
37
|
let t = d({
|
|
37
|
-
historyOpen:
|
|
38
|
-
previewOpen:
|
|
38
|
+
historyOpen: K,
|
|
39
|
+
previewOpen: H
|
|
39
40
|
}, e);
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
return
|
|
45
|
-
panelRef:
|
|
41
|
+
q(t.historyOpen), B(t.previewOpen);
|
|
42
|
+
}, Q = W.find((e) => e.id === G);
|
|
43
|
+
S(Q?.backendSessionId ?? null, Q?.mode ?? null, A ?? !0), x(A ?? !0);
|
|
44
|
+
let $ = t(A !== !1);
|
|
45
|
+
return C({
|
|
46
|
+
panelRef: U,
|
|
46
47
|
onClose: () => {
|
|
47
48
|
if (u({
|
|
48
|
-
historyOpen:
|
|
49
|
-
previewOpen:
|
|
49
|
+
historyOpen: K,
|
|
50
|
+
previewOpen: H
|
|
50
51
|
}) === "overlay") {
|
|
51
|
-
|
|
52
|
+
q(!1), B(!1);
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
+
k();
|
|
55
56
|
}
|
|
56
|
-
}), /* @__PURE__ */
|
|
57
|
-
visible:
|
|
58
|
-
children: /* @__PURE__ */
|
|
57
|
+
}), /* @__PURE__ */ D(a, {
|
|
58
|
+
visible: A ?? !0,
|
|
59
|
+
children: /* @__PURE__ */ D(p, {
|
|
59
60
|
value: I,
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
-
value:
|
|
62
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ D(r, {
|
|
62
|
+
value: ee,
|
|
63
|
+
children: /* @__PURE__ */ D(o, {
|
|
63
64
|
value: P,
|
|
64
65
|
onOpen: F,
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
-
ref:
|
|
66
|
+
children: /* @__PURE__ */ O("div", {
|
|
67
|
+
ref: U,
|
|
67
68
|
className: "relative flex h-full w-full flex-col bg-bg-surface",
|
|
68
69
|
role: "complementary",
|
|
69
70
|
"aria-label": R("panel.ariaLabel", "AI Assistant"),
|
|
70
71
|
"data-testid": "ai-assistant-panel",
|
|
71
72
|
[c]: "",
|
|
72
|
-
...
|
|
73
|
+
...X ? { [s]: X } : {},
|
|
73
74
|
tabIndex: -1,
|
|
74
75
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ D("div", {
|
|
76
77
|
className: "contents",
|
|
77
|
-
inert:
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
-
contextLabel:
|
|
80
|
-
onNewConversation: () =>
|
|
81
|
-
onOpenHistory: () =>
|
|
82
|
-
historyOpen:
|
|
83
|
-
onTogglePreview: () =>
|
|
84
|
-
previewOpen:
|
|
85
|
-
onClose:
|
|
86
|
-
docked:
|
|
87
|
-
onToggleDock:
|
|
78
|
+
inert: Y || void 0,
|
|
79
|
+
children: /* @__PURE__ */ D(v, {
|
|
80
|
+
contextLabel: $,
|
|
81
|
+
onNewConversation: () => J(),
|
|
82
|
+
onOpenHistory: () => Z("history"),
|
|
83
|
+
historyOpen: K,
|
|
84
|
+
onTogglePreview: () => Z("preview"),
|
|
85
|
+
previewOpen: H,
|
|
86
|
+
onClose: k,
|
|
87
|
+
docked: j,
|
|
88
|
+
onToggleDock: M
|
|
88
89
|
})
|
|
89
90
|
}),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
/* @__PURE__ */
|
|
91
|
+
K && /* @__PURE__ */ D(y, {}),
|
|
92
|
+
H && /* @__PURE__ */ D(_, { onClose: () => B(!1) }),
|
|
93
|
+
/* @__PURE__ */ D("div", {
|
|
93
94
|
className: "contents",
|
|
94
|
-
inert:
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
-
visible:
|
|
97
|
-
writeAccess:
|
|
95
|
+
inert: Y || void 0,
|
|
96
|
+
children: /* @__PURE__ */ D(w, {
|
|
97
|
+
visible: A ?? !0,
|
|
98
|
+
writeAccess: N
|
|
98
99
|
})
|
|
99
100
|
})
|
|
100
101
|
]
|
|
@@ -105,4 +106,4 @@ var O = ({ onClose: O, visible: k, docked: A, onToggleDock: j, writeAccess: M, o
|
|
|
105
106
|
});
|
|
106
107
|
};
|
|
107
108
|
//#endregion
|
|
108
|
-
export {
|
|
109
|
+
export { k as AIAssistantPanel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantEmptyState.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantEmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantEmptyState.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantEmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMtE,UAAU,KAAK;IACb,IAAI,EAAE,aAAa,CAAC;IACpB;;;OAGG;IACH,iBAAiB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1E;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IACxC;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,KAAK,CA8FzC,CAAC"}
|
|
@@ -1,42 +1,48 @@
|
|
|
1
1
|
import { resolveModeConfig as e, useAssistantPageLabel as t, useAssistantProduct as n } from "../product.js";
|
|
2
2
|
import { useAssistantTr as r } from "../i18n.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { hasConnectSource as i, useAssistantConnectSource as a } from "./composer/connectSource.js";
|
|
4
|
+
import { AssistantConnectSourceItem as o } from "./composer/AssistantConnectSourceItem.js";
|
|
5
|
+
import { Sparkles as s } from "lucide-react";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
7
|
//#region src/shared/assistant/ui/AssistantEmptyState.tsx
|
|
6
|
-
var
|
|
7
|
-
let
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
var u = ({ mode: u, onSuggestionClick: d, suggestions: f, explainsAuto: p = !1 }) => {
|
|
9
|
+
let m = r(), { modes: h } = n(), g = e(h, u), _ = t(), v = f ?? (g?.suggestions.slice(0, 4) ?? []).map((e) => ({ text: e })), y = i(a());
|
|
10
|
+
return /* @__PURE__ */ l("div", {
|
|
9
11
|
className: "flex flex-1 flex-col items-center justify-center overflow-y-auto px-6 py-8 text-center",
|
|
10
12
|
children: [
|
|
11
|
-
/* @__PURE__ */
|
|
13
|
+
/* @__PURE__ */ c("div", {
|
|
12
14
|
className: "flex size-12 items-center justify-center rounded-2xl bg-gradient-to-br from-action-primary-bg/25 to-action-primary-bg/5 text-action-primary-bg shadow-sm",
|
|
13
|
-
children: /* @__PURE__ */
|
|
15
|
+
children: /* @__PURE__ */ c(s, { className: "size-6" })
|
|
14
16
|
}),
|
|
15
|
-
/* @__PURE__ */
|
|
17
|
+
/* @__PURE__ */ c("h2", {
|
|
16
18
|
className: "mt-5 text-2xl font-semibold leading-tight tracking-tight text-text-primary",
|
|
17
|
-
children:
|
|
19
|
+
children: m("empty.title", "How can I help?")
|
|
18
20
|
}),
|
|
19
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ c("p", {
|
|
20
22
|
className: "mt-2 max-w-[16rem] text-[13px] leading-relaxed text-text-muted",
|
|
21
|
-
children:
|
|
23
|
+
children: _ ? m("empty.subtitle", "You're viewing {{page}}. Ask about it, or pick a suggestion below.", { page: _ }) : m("empty.subtitleNoPage", "Ask me anything, or pick a suggestion below.")
|
|
22
24
|
}),
|
|
23
|
-
|
|
25
|
+
p ? /* @__PURE__ */ c("p", {
|
|
24
26
|
className: "mt-2 max-w-[18rem] text-[12px] leading-relaxed text-text-muted",
|
|
25
27
|
"data-testid": "assistant-auto-explainer",
|
|
26
|
-
children:
|
|
28
|
+
children: m("modeSelector.autoHint", "Answers your questions, and proposes changes for you to approve")
|
|
27
29
|
}) : null,
|
|
28
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ c("div", {
|
|
29
31
|
className: "mt-6 flex flex-wrap items-center justify-center gap-2",
|
|
30
|
-
children:
|
|
32
|
+
children: v.map((e) => /* @__PURE__ */ c("button", {
|
|
31
33
|
type: "button",
|
|
32
|
-
onClick: () =>
|
|
34
|
+
onClick: () => d(e.text, e.intent),
|
|
33
35
|
className: "rounded-full border border-border-subtle bg-bg-surface px-3.5 py-2 text-[13px] leading-tight text-text-primary shadow-sm transition-[color,background-color,border-color,box-shadow] hover:border-action-primary-bg/40 hover:bg-bg-elevated hover:shadow-md",
|
|
34
36
|
"data-testid": "assistant-suggestion",
|
|
35
37
|
children: e.text
|
|
36
38
|
}, e.text))
|
|
37
|
-
})
|
|
39
|
+
}),
|
|
40
|
+
y ? /* @__PURE__ */ c("div", {
|
|
41
|
+
className: "mt-5",
|
|
42
|
+
children: /* @__PURE__ */ c(o, { presentation: "action" })
|
|
43
|
+
}) : null
|
|
38
44
|
]
|
|
39
45
|
});
|
|
40
46
|
};
|
|
41
47
|
//#endregion
|
|
42
|
-
export {
|
|
48
|
+
export { u as AssistantEmptyState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantHeader.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantHeader.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAehC,UAAU,KAAK;IACb,qEAAqE;IACrE;;;;;;;OAOG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,gFAAgF;IAChF,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,KAAK,CA+IrC,CAAC"}
|
|
@@ -1,81 +1,82 @@
|
|
|
1
1
|
import { useAssistantTr as e } from "../i18n.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { hasAssistantPreviewSurface as t } from "../preview/types.js";
|
|
3
|
+
import { useAssistantPreview as n } from "../preview/context.js";
|
|
4
|
+
import { AssistantMoreMenu as r } from "./AssistantMoreMenu.js";
|
|
5
|
+
import { Eye as i, History as a, PanelBottom as o, PanelRight as s, Plus as c, Sparkles as l, X as u } from "lucide-react";
|
|
6
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
6
7
|
//#region src/shared/assistant/ui/AssistantHeader.tsx
|
|
7
|
-
var
|
|
8
|
-
let
|
|
9
|
-
return /* @__PURE__ */
|
|
8
|
+
var m = ({ contextLabel: m, onNewConversation: h, onOpenHistory: g, historyOpen: _, onTogglePreview: v, previewOpen: y, onClose: b, docked: x, onToggleDock: S }) => {
|
|
9
|
+
let C = e(), w = n();
|
|
10
|
+
return /* @__PURE__ */ p("div", {
|
|
10
11
|
className: "flex items-center gap-2 border-b border-border-default bg-bg-elevated px-3 py-2.5",
|
|
11
|
-
children: [/* @__PURE__ */
|
|
12
|
+
children: [/* @__PURE__ */ p("div", {
|
|
12
13
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
13
|
-
children: [/* @__PURE__ */
|
|
14
|
+
children: [/* @__PURE__ */ f("span", {
|
|
14
15
|
className: "flex size-7 flex-shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-action-primary-bg/25 to-action-primary-bg/5 text-action-primary-bg",
|
|
15
|
-
children: /* @__PURE__ */
|
|
16
|
-
}), /* @__PURE__ */
|
|
16
|
+
children: /* @__PURE__ */ f(l, { className: "size-4" })
|
|
17
|
+
}), /* @__PURE__ */ p("span", {
|
|
17
18
|
className: "min-w-0 flex-1",
|
|
18
|
-
children: [/* @__PURE__ */
|
|
19
|
+
children: [/* @__PURE__ */ f("span", {
|
|
19
20
|
className: "block truncate text-[14px] font-semibold leading-tight text-text-primary",
|
|
20
|
-
children:
|
|
21
|
-
}), /* @__PURE__ */
|
|
21
|
+
children: C("header.title", "AI Assistant")
|
|
22
|
+
}), /* @__PURE__ */ p("span", {
|
|
22
23
|
className: "block truncate text-[11px] leading-tight text-text-muted",
|
|
23
|
-
children: [
|
|
24
|
+
children: [C("header.ready", "Ready"), m && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("span", {
|
|
24
25
|
"aria-hidden": "true",
|
|
25
26
|
children: " · "
|
|
26
|
-
}),
|
|
27
|
+
}), C("header.context", "Context: {{page}}", { page: m })] })]
|
|
27
28
|
})]
|
|
28
29
|
})]
|
|
29
|
-
}), /* @__PURE__ */
|
|
30
|
+
}), /* @__PURE__ */ p("div", {
|
|
30
31
|
className: "flex flex-shrink-0 items-center gap-0.5",
|
|
31
32
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ f("button", {
|
|
33
34
|
type: "button",
|
|
34
|
-
onClick:
|
|
35
|
+
onClick: h,
|
|
35
36
|
className: "rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
36
|
-
"aria-label":
|
|
37
|
+
"aria-label": C("header.newConversation", "New conversation"),
|
|
37
38
|
"data-testid": "assistant-new-conversation",
|
|
38
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ f(c, { className: "size-4" })
|
|
39
40
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ f("button", {
|
|
41
42
|
type: "button",
|
|
42
|
-
onClick:
|
|
43
|
-
className: `rounded-lg p-1.5 transition-colors ${
|
|
44
|
-
"aria-label":
|
|
45
|
-
"aria-pressed":
|
|
43
|
+
onClick: g,
|
|
44
|
+
className: `rounded-lg p-1.5 transition-colors ${_ ? "bg-action-primary-bg/15 text-action-primary-bg" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"}`,
|
|
45
|
+
"aria-label": C("header.history", "Conversation history"),
|
|
46
|
+
"aria-pressed": _,
|
|
46
47
|
"data-testid": "assistant-open-history",
|
|
47
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ f(a, { className: "size-4" })
|
|
48
49
|
}),
|
|
49
|
-
|
|
50
|
+
t(w) && v && /* @__PURE__ */ f("button", {
|
|
50
51
|
type: "button",
|
|
51
|
-
onClick:
|
|
52
|
-
className: `rounded-lg p-1.5 transition-colors ${
|
|
53
|
-
"aria-label":
|
|
54
|
-
"aria-pressed": !!
|
|
52
|
+
onClick: v,
|
|
53
|
+
className: `rounded-lg p-1.5 transition-colors ${y ? "bg-action-primary-bg/15 text-action-primary-bg" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"}`,
|
|
54
|
+
"aria-label": w.label ?? C("header.preview", "Preview"),
|
|
55
|
+
"aria-pressed": !!y,
|
|
55
56
|
"data-testid": "assistant-toggle-preview",
|
|
56
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ f(i, { className: "size-4" })
|
|
57
58
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
59
|
+
/* @__PURE__ */ f(r, {}),
|
|
60
|
+
S && /* @__PURE__ */ f("button", {
|
|
60
61
|
type: "button",
|
|
61
|
-
onClick:
|
|
62
|
+
onClick: S,
|
|
62
63
|
className: "hidden rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary sm:inline-flex",
|
|
63
|
-
"aria-label":
|
|
64
|
-
"aria-pressed":
|
|
64
|
+
"aria-label": x ? C("header.float", "Float chat window") : C("header.dock", "Dock to side panel"),
|
|
65
|
+
"aria-pressed": x,
|
|
65
66
|
"data-testid": "assistant-toggle-dock",
|
|
66
|
-
children:
|
|
67
|
+
children: f(x ? o : s, { className: "size-4" })
|
|
67
68
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ f("button", {
|
|
69
70
|
type: "button",
|
|
70
|
-
onClick:
|
|
71
|
+
onClick: b,
|
|
71
72
|
className: "rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
72
|
-
"aria-label":
|
|
73
|
+
"aria-label": C("header.close", "Close assistant"),
|
|
73
74
|
"data-testid": "assistant-close",
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ f(u, { className: "size-4" })
|
|
75
76
|
})
|
|
76
77
|
]
|
|
77
78
|
})]
|
|
78
79
|
});
|
|
79
80
|
};
|
|
80
81
|
//#endregion
|
|
81
|
-
export {
|
|
82
|
+
export { m as AssistantHeader };
|
|
@@ -12,6 +12,11 @@ export interface AssistantOverlayContextValue {
|
|
|
12
12
|
toggleDock: () => void;
|
|
13
13
|
/** Width the docked panel takes from the page right now, in px (0 if none). */
|
|
14
14
|
dockWidthPx: number;
|
|
15
|
+
/**
|
|
16
|
+
* How far the open assistant reaches in from the page's right edge, in px:
|
|
17
|
+
* docked or floating, 0 when closed or on a phone (BOFF-7799).
|
|
18
|
+
*/
|
|
19
|
+
panelInsetPx: number;
|
|
15
20
|
keys: AssistantOverlayKeys;
|
|
16
21
|
}
|
|
17
22
|
/** The overlay state in force, or null when no provider is mounted. */
|
|
@@ -22,6 +27,13 @@ export declare function useAssistantOverlayOrNull(): AssistantOverlayContextValu
|
|
|
22
27
|
* published as `var(--assistant-dock-width)` on `<html>` for CSS consumers.
|
|
23
28
|
*/
|
|
24
29
|
export declare function useAssistantDockWidth(): number;
|
|
30
|
+
/**
|
|
31
|
+
* How far, in px, the open assistant reaches in from the right of the page,
|
|
32
|
+
* docked OR floating: 0 when it is closed, on a phone, or not mounted at all.
|
|
33
|
+
* The same value is published as `var(--assistant-panel-inset)` on `<html>`.
|
|
34
|
+
* See `ASSISTANT_PANEL_INSET_VAR` for why it differs from the dock width.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useAssistantPanelInset(): number;
|
|
25
37
|
/**
|
|
26
38
|
* Listen for `<product>:quota-exhausted` and hand each wall to the product.
|
|
27
39
|
*
|
|
@@ -62,7 +74,8 @@ export interface AssistantOverlayProviderProps {
|
|
|
62
74
|
* the panel's own close and dock buttons) without each path remembering to
|
|
63
75
|
* persist.
|
|
64
76
|
*
|
|
65
|
-
* Mount ONE per page: the published dock width
|
|
77
|
+
* Mount ONE per page: the published dock width and panel inset are single
|
|
78
|
+
* `<html>` variables.
|
|
66
79
|
*/
|
|
67
80
|
export declare function AssistantOverlayProvider({ keyPrefix, quota, children, }: AssistantOverlayProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
68
81
|
/** What the overlay hands the panel it renders. */
|