@burdenoff/fe-libs 2026.1113.10 → 2026.1114.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/README.md +55 -8
- package/dist/node_modules/pdfjs-dist/build/pdf.js +21 -0
- package/dist/node_modules/pdfjs-dist/build/pdf.worker.min.js +21 -0
- package/dist/platform-pages/AcceptShareRoute.js +15 -16
- package/dist/platform-pages/AffiliatesPage.js +4 -5
- package/dist/shared/assistant/createSandboxAssistantTransport.js +0 -1
- package/dist/shared/assistant/index.d.ts +3 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.js +267 -241
- package/dist/shared/assistant/ui/AssistantChatArea.js +1243 -1241
- package/dist/shared/assistant/ui/AssistantConversationList.js +253 -252
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +4 -23
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.js +52 -55
- package/dist/shared/assistant/ui/AssistantMessageItem.js +37 -38
- package/dist/shared/assistant/ui/AssistantMessageList.js +48 -47
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +24 -25
- package/dist/shared/assistant/ui/assistantPageLayout.d.ts +13 -0
- package/dist/shared/assistant/ui/assistantPageLayout.js +8 -0
- package/dist/shared/assistant/ui/avatar/AssistantCompactAvatar.d.ts +6 -0
- package/dist/shared/assistant/ui/avatar/AssistantCompactAvatar.js +77 -71
- package/dist/shared/assistant/ui/compact/AssistantMenuView.js +130 -129
- package/dist/shared/assistant/ui/compact/AssistantPageBar.d.ts +13 -0
- package/dist/shared/assistant/ui/compact/AssistantPageBar.js +46 -0
- package/dist/shared/assistant/ui/compact/AssistantViewSwitch.d.ts +5 -0
- package/dist/shared/assistant/ui/compact/AssistantViewSwitch.js +11 -11
- package/dist/shared/assistant/ui/composer/AssistantCompactFooter.js +15 -11
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +258 -257
- package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.js +3 -3
- package/dist/shared/assistant/ui/composer/connectSource.js +1 -2
- package/dist/shared/assistant/uiActions/assistantHref.d.ts +2 -30
- package/dist/shared/assistant/uiActions/assistantHref.js +7 -43
- package/dist/shared/assistant/uiActions/assistantLinkNavigation.d.ts +12 -0
- package/dist/shared/assistant/uiActions/assistantLinkNavigation.js +42 -0
- package/dist/shared/assistant/uiActions/inAppLinks.js +9 -8
- package/dist/shared/components/ContextConversationWidget.js +6 -7
- package/dist/shared/components/assistantWidget/MessageContent.js +3 -4
- package/dist/shared/components/contextConversationWidget/Composer.js +9 -10
- package/dist/shared/components/contextConversationWidget/MessageItem.js +0 -1
- package/dist/shared/components/contextConversationWidget/NoWorkspaceCard.js +0 -1
- package/dist/shared/components/contextConversationWidget/PendingAttachmentsBar.js +0 -1
- package/dist/shared/components/contextConversationWidget/ReplyBanner.js +0 -1
- package/dist/shared/components/contextConversationWidget/WidgetHeader.js +8 -9
- package/dist/shared/hooks/usePushDeviceRegistration.js +9 -10
- package/dist/shared/hooks/useRecordProductVisit.js +8 -9
- package/dist/shared/tours/ToursContext.js +6 -7
- package/dist/shared-assistant.js +224 -221
- package/dist/shared-hooks.js +10 -12
- package/dist/shared-plugins.js +0 -1
- package/dist/shared-providers-shell.js +7 -8
- package/dist/shared.js +83 -87
- package/dist/third-party/pdfjs-dist/ATTRIBUTION.txt +54 -0
- package/dist/third-party/pdfjs-dist/LICENSE +177 -0
- package/dist/third-party/pdfjs-dist/manifest.json +19 -0
- package/dist/utils/index.js +1 -1
- package/package.json +29 -2
- package/dist/shared/actors/index.js +0 -3
- package/dist/shared/assistant/speech/index.js +0 -6
- package/dist/shared/plugins/iframe-mount/index.js +0 -5
|
@@ -5,183 +5,184 @@ import { assistantHistory as r } from "../../history/historyEngine.js";
|
|
|
5
5
|
import { useAssistantHistoryStatus as i } from "../../history/historyStatus.js";
|
|
6
6
|
import { useAssistantProduct as a } from "../../product.js";
|
|
7
7
|
import { useAssistantStore as o } from "../../store.js";
|
|
8
|
-
import { resolveLanguagePair as
|
|
9
|
-
import { AssistantConversationList as
|
|
10
|
-
import { assistantModeOptionName as
|
|
11
|
-
import { useOverlayFocus as
|
|
12
|
-
import { fieldOwnsEscape as
|
|
13
|
-
import { useAssistantNavigate as
|
|
14
|
-
import { AssistantVoiceLanguageSettings as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
8
|
+
import { resolveLanguagePair as s } from "../../voice/languagePair.js";
|
|
9
|
+
import { AssistantConversationList as ee } from "../AssistantConversationList.js";
|
|
10
|
+
import { assistantModeOptionName as te } from "../composer/AssistantModeMenu.js";
|
|
11
|
+
import { useOverlayFocus as c } from "../useOverlayFocus.js";
|
|
12
|
+
import { fieldOwnsEscape as l, menuViewEscape as u, recentConversations as d } from "./compactChrome.js";
|
|
13
|
+
import { useAssistantNavigate as f } from "../AssistantMarkdownRenderer.js";
|
|
14
|
+
import { AssistantVoiceLanguageSettings as ne } from "./AssistantVoiceLanguageSettings.js";
|
|
15
|
+
import { PAGE_VIEW_GUTTER as re, useAssistantPageLayout as ie } from "../assistantPageLayout.js";
|
|
16
|
+
import { useEffect as p, useLayoutEffect as m, useMemo as ae, useRef as h, useState as oe } from "react";
|
|
17
|
+
import { ArrowLeft as g, ChevronRight as _, History as se, Languages as ce, PanelRight as v, Plus as le, UserRound as ue, X as y } from "lucide-react";
|
|
18
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
18
19
|
// src/shared/assistant/ui/compact/AssistantMenuView.tsx
|
|
19
|
-
var
|
|
20
|
+
var C = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", w = `flex size-10 shrink-0 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary ${C}`, T = `flex min-h-11 w-full items-center gap-3 px-4 py-2 text-start text-sm text-text-primary transition-colors hover:bg-bg-sunken ${C} focus-visible:ring-inset`, de = typeof document > "u" ? p : m, E = ({ icon: e, label: t, trailing: n, onClick: r, buttonRef: i, testId: a, describedBy: o }) => /* @__PURE__ */ S("button", {
|
|
20
21
|
ref: i,
|
|
21
22
|
type: "button",
|
|
22
23
|
onClick: r,
|
|
23
|
-
className:
|
|
24
|
+
className: T,
|
|
24
25
|
"aria-describedby": o,
|
|
25
26
|
"data-testid": a,
|
|
26
27
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ x("span", {
|
|
28
29
|
className: "flex size-5 shrink-0 items-center justify-center text-text-secondary",
|
|
29
30
|
children: e
|
|
30
31
|
}),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ x("span", {
|
|
32
33
|
className: "min-w-0 flex-1 truncate",
|
|
33
34
|
children: t
|
|
34
35
|
}),
|
|
35
36
|
n
|
|
36
37
|
]
|
|
37
|
-
}),
|
|
38
|
+
}), D = ({ id: e, children: t }) => /* @__PURE__ */ x("h3", {
|
|
38
39
|
id: e,
|
|
39
40
|
className: "px-4 pb-1 pt-4 text-xs font-semibold uppercase tracking-wide text-text-muted",
|
|
40
41
|
children: t
|
|
41
|
-
}), fe = ({ title: e, tr: t, onBack: n, backRef: r }) => /* @__PURE__ */
|
|
42
|
+
}), fe = ({ title: e, tr: t, onBack: n, backRef: r }) => /* @__PURE__ */ S("div", {
|
|
42
43
|
className: "flex items-center gap-1 border-b border-border-default bg-bg-elevated px-2 py-2",
|
|
43
|
-
children: [/* @__PURE__ */
|
|
44
|
+
children: [/* @__PURE__ */ x("button", {
|
|
44
45
|
ref: r,
|
|
45
46
|
type: "button",
|
|
46
47
|
onClick: n,
|
|
47
|
-
className:
|
|
48
|
+
className: w,
|
|
48
49
|
"aria-label": t("menuView.back", "Back"),
|
|
49
50
|
"data-testid": "assistant-menu-subview-back",
|
|
50
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ x(g, {
|
|
51
52
|
className: "size-5",
|
|
52
53
|
"aria-hidden": "true"
|
|
53
54
|
})
|
|
54
|
-
}), /* @__PURE__ */
|
|
55
|
+
}), /* @__PURE__ */ x("h2", {
|
|
55
56
|
className: "min-w-0 flex-1 truncate text-base font-semibold text-text-primary",
|
|
56
57
|
children: e
|
|
57
58
|
})]
|
|
58
|
-
}),
|
|
59
|
-
let
|
|
60
|
-
B === "avatar" && !
|
|
61
|
-
let
|
|
59
|
+
}), O = ({ id: p, onClose: m, onRequestClosePanel: O, onNewConversation: pe, AvatarSettings: k, initialView: A = "root", docked: j, onToggleDock: M }) => {
|
|
60
|
+
let N = n(), P = ie(), { locale: F } = t(), { modes: I } = a(), { conversations: L, activeConversationId: R, assistantLanguage: z, replyLanguage: me, setActiveConversation: he, setMode: ge } = o(), _e = i((e) => e.product !== null), [B, V] = oe(A === "avatar" && k ? "avatar" : "root");
|
|
61
|
+
B === "avatar" && !k && V("root");
|
|
62
|
+
let ve = f(), H = h(null), U = h(null), ye = c("assistant-menu"), W = h(null), G = h(null), K = h(null), q = h(null), J = h(A === "avatar" ? "avatar" : "back"), Y = (e) => {
|
|
62
63
|
J.current = e, V(e);
|
|
63
64
|
}, X = () => V("root");
|
|
64
|
-
|
|
65
|
+
de(() => {
|
|
65
66
|
B !== "history" && (B === "avatar" ? H.current?.focus({ preventScroll: !0 }) : B === "voice-language" ? G.current?.focus({ preventScroll: !0 }) : (((J.current === "voice-language" ? K.current : J.current === "history" ? q.current : J.current === "avatar" ? U.current : null) ?? W.current)?.focus({ preventScroll: !0 }), J.current = "back"));
|
|
66
67
|
}, [B]);
|
|
67
|
-
let Z =
|
|
68
|
-
if (
|
|
68
|
+
let Z = ae(() => d(L), [L]), be = N("history.untitled", "Untitled conversation"), xe = (e) => {
|
|
69
|
+
if (_e) r.openConversation(e, { modes: I });
|
|
69
70
|
else {
|
|
70
|
-
let t =
|
|
71
|
-
|
|
71
|
+
let t = L.find((t) => t.id === e);
|
|
72
|
+
he(e), t && ge(t.mode);
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
return /* @__PURE__ */
|
|
74
|
+
m();
|
|
75
|
+
}, Se = s(z, me, F).input.label, Q = `${p}-settings`, $ = `${p}-recent`;
|
|
76
|
+
return /* @__PURE__ */ x(e, {
|
|
76
77
|
onDismiss: () => {
|
|
77
|
-
B === "history" &&
|
|
78
|
+
B === "history" && l(document.activeElement) || (u(B) === "back" ? X() : m());
|
|
78
79
|
},
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
-
ref:
|
|
81
|
-
id:
|
|
80
|
+
children: /* @__PURE__ */ x("div", {
|
|
81
|
+
ref: ye,
|
|
82
|
+
id: p,
|
|
82
83
|
tabIndex: -1,
|
|
83
84
|
role: "region",
|
|
84
|
-
"aria-label":
|
|
85
|
-
className:
|
|
85
|
+
"aria-label": N("menuView.title", "Assistant menu"),
|
|
86
|
+
className: `absolute inset-0 z-10 flex flex-col bg-bg-surface outline-none animate-in slide-in-from-left-2 fade-in duration-200 motion-reduce:animate-none${P ? ` ${re}` : ""}`,
|
|
86
87
|
"data-testid": "assistant-menu-view",
|
|
87
88
|
"data-menu-view": B,
|
|
88
|
-
children: B === "root" ? /* @__PURE__ */
|
|
89
|
+
children: B === "root" ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ S("div", {
|
|
89
90
|
className: "flex items-center gap-1 border-b border-border-default bg-bg-elevated px-2 py-2",
|
|
90
91
|
children: [
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ S("button", {
|
|
92
93
|
ref: W,
|
|
93
94
|
type: "button",
|
|
94
|
-
onClick:
|
|
95
|
-
className: `flex min-h-10 items-center gap-1.5 rounded-button px-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken ${
|
|
95
|
+
onClick: m,
|
|
96
|
+
className: `flex min-h-10 items-center gap-1.5 rounded-button px-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken ${C}`,
|
|
96
97
|
"data-testid": "assistant-menu-back",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ x(g, {
|
|
98
99
|
className: "size-5",
|
|
99
100
|
"aria-hidden": "true"
|
|
100
|
-
}),
|
|
101
|
+
}), N("menuView.backToConversation", "Back to conversation")]
|
|
101
102
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ x("h2", {
|
|
103
104
|
className: "sr-only",
|
|
104
|
-
children:
|
|
105
|
+
children: N("menuView.title", "Assistant menu")
|
|
105
106
|
}),
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
|
|
107
|
+
/* @__PURE__ */ x("span", { className: "flex-1" }),
|
|
108
|
+
O ? /* @__PURE__ */ x("button", {
|
|
108
109
|
type: "button",
|
|
109
|
-
onClick:
|
|
110
|
-
className:
|
|
111
|
-
"aria-label":
|
|
110
|
+
onClick: O,
|
|
111
|
+
className: w,
|
|
112
|
+
"aria-label": N("header.close", "Close assistant"),
|
|
112
113
|
"data-testid": "assistant-menu-close",
|
|
113
|
-
children: /* @__PURE__ */
|
|
114
|
+
children: /* @__PURE__ */ x(y, {
|
|
114
115
|
className: "size-5",
|
|
115
116
|
"aria-hidden": "true"
|
|
116
117
|
})
|
|
117
118
|
}) : null
|
|
118
119
|
]
|
|
119
|
-
}), /* @__PURE__ */
|
|
120
|
+
}), /* @__PURE__ */ S("div", {
|
|
120
121
|
className: "scrollbar-slim min-h-0 flex-1 overflow-y-auto pb-2",
|
|
121
122
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ S("button", {
|
|
123
124
|
type: "button",
|
|
124
125
|
onClick: pe,
|
|
125
|
-
className: `${
|
|
126
|
+
className: `${T} mt-2`,
|
|
126
127
|
"aria-keyshortcuts": "Control+Shift+N Meta+Shift+N",
|
|
127
128
|
"data-testid": "assistant-new-conversation",
|
|
128
129
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ x("span", {
|
|
130
131
|
className: "flex size-5 shrink-0 items-center justify-center text-text-secondary",
|
|
131
|
-
children: /* @__PURE__ */
|
|
132
|
+
children: /* @__PURE__ */ x(le, {
|
|
132
133
|
className: "size-5",
|
|
133
134
|
"aria-hidden": "true"
|
|
134
135
|
})
|
|
135
136
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ x("span", {
|
|
137
138
|
className: "min-w-0 flex-1 truncate",
|
|
138
|
-
children:
|
|
139
|
+
children: N("header.newConversation", "New conversation")
|
|
139
140
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ x("kbd", {
|
|
141
142
|
className: "shrink-0 text-xs text-text-muted",
|
|
142
143
|
children: "Ctrl+Shift+N"
|
|
143
144
|
})
|
|
144
145
|
]
|
|
145
146
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ S("section", {
|
|
147
148
|
"aria-labelledby": $,
|
|
148
149
|
"data-testid": "assistant-menu-recent",
|
|
149
150
|
children: [
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ x(D, {
|
|
151
152
|
id: $,
|
|
152
|
-
children:
|
|
153
|
+
children: N("menuView.recent", "Recent")
|
|
153
154
|
}),
|
|
154
|
-
Z.length === 0 ? /* @__PURE__ */
|
|
155
|
+
Z.length === 0 ? /* @__PURE__ */ x("p", {
|
|
155
156
|
className: "px-4 py-2 text-sm text-text-muted",
|
|
156
|
-
children:
|
|
157
|
-
}) : /* @__PURE__ */
|
|
158
|
-
let t =
|
|
159
|
-
return /* @__PURE__ */
|
|
157
|
+
children: N("conversations.empty", "No conversations yet")
|
|
158
|
+
}) : /* @__PURE__ */ x("ul", { children: Z.map((e) => {
|
|
159
|
+
let t = I.find((t) => t.id === e.mode);
|
|
160
|
+
return /* @__PURE__ */ x("li", { children: /* @__PURE__ */ x("button", {
|
|
160
161
|
type: "button",
|
|
161
|
-
onClick: () =>
|
|
162
|
-
className: `${
|
|
163
|
-
"aria-current": e.id ===
|
|
162
|
+
onClick: () => xe(e.id),
|
|
163
|
+
className: `${T} ${e.id === R ? "bg-bg-elevated" : ""}`,
|
|
164
|
+
"aria-current": e.id === R ? "true" : void 0,
|
|
164
165
|
"data-testid": "assistant-menu-recent-row",
|
|
165
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ S("span", {
|
|
166
167
|
className: "min-w-0 flex-1",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
168
|
+
children: [/* @__PURE__ */ x("span", {
|
|
168
169
|
className: "block truncate",
|
|
169
|
-
children: e.title ||
|
|
170
|
-
}), t ? /* @__PURE__ */
|
|
170
|
+
children: e.title || be
|
|
171
|
+
}), t ? /* @__PURE__ */ x("span", {
|
|
171
172
|
className: "block truncate text-xs text-text-muted",
|
|
172
|
-
children:
|
|
173
|
+
children: te(N, t)
|
|
173
174
|
}) : null]
|
|
174
175
|
})
|
|
175
176
|
}) }, e.id);
|
|
176
177
|
}) }),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ x(E, {
|
|
178
179
|
buttonRef: q,
|
|
179
|
-
icon: /* @__PURE__ */
|
|
180
|
+
icon: /* @__PURE__ */ x(se, {
|
|
180
181
|
className: "size-5",
|
|
181
182
|
"aria-hidden": "true"
|
|
182
183
|
}),
|
|
183
|
-
label:
|
|
184
|
-
trailing: /* @__PURE__ */
|
|
184
|
+
label: N("menuView.viewAllHistory", "View all history"),
|
|
185
|
+
trailing: /* @__PURE__ */ x(_, {
|
|
185
186
|
className: "size-4 text-text-muted",
|
|
186
187
|
"aria-hidden": "true"
|
|
187
188
|
}),
|
|
@@ -190,38 +191,38 @@ var b = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color
|
|
|
190
191
|
})
|
|
191
192
|
]
|
|
192
193
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ S("section", {
|
|
194
195
|
"aria-labelledby": Q,
|
|
195
196
|
"data-testid": "assistant-menu-settings",
|
|
196
197
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ x(D, {
|
|
198
199
|
id: Q,
|
|
199
|
-
children:
|
|
200
|
+
children: N("menuView.settings", "Settings")
|
|
200
201
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ x(E, {
|
|
202
203
|
buttonRef: K,
|
|
203
|
-
icon: /* @__PURE__ */
|
|
204
|
+
icon: /* @__PURE__ */ x(ce, {
|
|
204
205
|
className: "size-5",
|
|
205
206
|
"aria-hidden": "true"
|
|
206
207
|
}),
|
|
207
|
-
label:
|
|
208
|
-
trailing: /* @__PURE__ */
|
|
208
|
+
label: N("menuView.voiceLanguage", "Voice & language"),
|
|
209
|
+
trailing: /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("span", {
|
|
209
210
|
className: "max-w-[40%] truncate text-xs text-text-muted",
|
|
210
|
-
children:
|
|
211
|
-
}), /* @__PURE__ */
|
|
211
|
+
children: Se
|
|
212
|
+
}), /* @__PURE__ */ x(_, {
|
|
212
213
|
className: "size-4 shrink-0 text-text-muted",
|
|
213
214
|
"aria-hidden": "true"
|
|
214
215
|
})] }),
|
|
215
216
|
onClick: () => Y("voice-language"),
|
|
216
217
|
testId: "assistant-menu-voice-language-row"
|
|
217
218
|
}),
|
|
218
|
-
|
|
219
|
-
icon: /* @__PURE__ */
|
|
219
|
+
k ? /* @__PURE__ */ x(E, {
|
|
220
|
+
icon: /* @__PURE__ */ x(ue, {
|
|
220
221
|
className: "size-5",
|
|
221
222
|
"aria-hidden": "true"
|
|
222
223
|
}),
|
|
223
|
-
label:
|
|
224
|
-
trailing: /* @__PURE__ */
|
|
224
|
+
label: N("menuView.avatar", "Avatar"),
|
|
225
|
+
trailing: /* @__PURE__ */ x(_, {
|
|
225
226
|
className: "size-4 text-text-muted",
|
|
226
227
|
"aria-hidden": "true"
|
|
227
228
|
}),
|
|
@@ -229,31 +230,31 @@ var b = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color
|
|
|
229
230
|
onClick: () => Y("avatar"),
|
|
230
231
|
testId: "assistant-menu-avatar-row"
|
|
231
232
|
}) : null,
|
|
232
|
-
|
|
233
|
+
M ? /* @__PURE__ */ S("fieldset", {
|
|
233
234
|
className: "hidden min-w-0 border-0 px-4 py-2 sm:block",
|
|
234
235
|
"data-testid": "assistant-menu-panel-layout",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
236
|
+
children: [/* @__PURE__ */ S("legend", {
|
|
236
237
|
className: "flex items-center gap-3 py-1 text-sm text-text-primary",
|
|
237
|
-
children: [/* @__PURE__ */ v
|
|
238
|
+
children: [/* @__PURE__ */ x(v, {
|
|
238
239
|
className: "size-5 shrink-0 text-text-secondary",
|
|
239
240
|
"aria-hidden": "true"
|
|
240
|
-
}),
|
|
241
|
+
}), N("menuView.panelLayout", "Panel layout")]
|
|
241
242
|
}), [[
|
|
242
243
|
!0,
|
|
243
|
-
|
|
244
|
+
N("menuView.layoutDocked", "Docked side panel"),
|
|
244
245
|
"docked"
|
|
245
246
|
], [
|
|
246
247
|
!1,
|
|
247
|
-
|
|
248
|
+
N("menuView.layoutFloating", "Floating window"),
|
|
248
249
|
"floating"
|
|
249
|
-
]].map(([e, t, n]) => /* @__PURE__ */
|
|
250
|
+
]].map(([e, t, n]) => /* @__PURE__ */ S("label", {
|
|
250
251
|
className: "flex min-h-11 cursor-pointer items-center gap-3 ps-8 text-sm text-text-primary focus-within:ring-2 focus-within:ring-[var(--color-focus-ring)]",
|
|
251
|
-
children: [/* @__PURE__ */
|
|
252
|
+
children: [/* @__PURE__ */ x("input", {
|
|
252
253
|
type: "radio",
|
|
253
|
-
name: `${
|
|
254
|
-
checked: !!
|
|
254
|
+
name: `${p}-layout`,
|
|
255
|
+
checked: !!j === e,
|
|
255
256
|
onChange: () => {
|
|
256
|
-
!!
|
|
257
|
+
!!j !== e && M();
|
|
257
258
|
},
|
|
258
259
|
className: "size-4 accent-current",
|
|
259
260
|
"data-testid": `assistant-panel-layout-${n}`
|
|
@@ -263,63 +264,63 @@ var b = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color
|
|
|
263
264
|
]
|
|
264
265
|
})
|
|
265
266
|
]
|
|
266
|
-
})] }) : B === "avatar" &&
|
|
267
|
+
})] }) : B === "avatar" && k ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ S("div", {
|
|
267
268
|
className: "flex shrink-0 items-center gap-1 border-b border-border-default bg-bg-elevated px-1 py-2",
|
|
268
269
|
children: [
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ x("button", {
|
|
270
271
|
type: "button",
|
|
271
272
|
onClick: X,
|
|
272
|
-
className: `${
|
|
273
|
-
"aria-label":
|
|
273
|
+
className: `${w} size-11`,
|
|
274
|
+
"aria-label": N("menuView.back", "Back"),
|
|
274
275
|
"data-testid": "assistant-menu-subview-back",
|
|
275
|
-
children: /* @__PURE__ */
|
|
276
|
+
children: /* @__PURE__ */ x(g, {
|
|
276
277
|
className: "size-5",
|
|
277
278
|
"aria-hidden": "true"
|
|
278
279
|
})
|
|
279
280
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ S("div", {
|
|
281
282
|
className: "min-w-0 flex-1",
|
|
282
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ x("p", {
|
|
283
284
|
className: "text-xs text-text-secondary",
|
|
284
|
-
children:
|
|
285
|
-
}), /* @__PURE__ */
|
|
285
|
+
children: N("menuView.settings", "Settings")
|
|
286
|
+
}), /* @__PURE__ */ x("h2", {
|
|
286
287
|
ref: H,
|
|
287
288
|
tabIndex: -1,
|
|
288
289
|
className: "text-base font-semibold text-text-primary outline-none",
|
|
289
290
|
"data-testid": "assistant-avatar-settings-heading",
|
|
290
|
-
children:
|
|
291
|
+
children: N("menuView.avatar", "Avatar")
|
|
291
292
|
})]
|
|
292
293
|
}),
|
|
293
|
-
|
|
294
|
+
O ? /* @__PURE__ */ x("button", {
|
|
294
295
|
type: "button",
|
|
295
|
-
onClick:
|
|
296
|
-
className: `${
|
|
297
|
-
"aria-label":
|
|
296
|
+
onClick: O,
|
|
297
|
+
className: `${w} size-11`,
|
|
298
|
+
"aria-label": N("header.close", "Close assistant"),
|
|
298
299
|
"data-testid": "assistant-avatar-settings-close",
|
|
299
|
-
children: /* @__PURE__ */
|
|
300
|
+
children: /* @__PURE__ */ x(y, {
|
|
300
301
|
className: "size-5",
|
|
301
302
|
"aria-hidden": "true"
|
|
302
303
|
})
|
|
303
304
|
}) : null
|
|
304
305
|
]
|
|
305
|
-
}), /* @__PURE__ */
|
|
306
|
+
}), /* @__PURE__ */ x("div", {
|
|
306
307
|
className: "scrollbar-slim min-h-0 min-w-0 flex-1 overflow-y-auto",
|
|
307
308
|
"data-testid": "assistant-avatar-settings-scroll",
|
|
308
|
-
children: /* @__PURE__ */
|
|
309
|
-
})] }) : B === "voice-language" ? /* @__PURE__ */
|
|
310
|
-
title:
|
|
311
|
-
tr:
|
|
309
|
+
children: /* @__PURE__ */ x(k, { navigate: ve })
|
|
310
|
+
})] }) : B === "voice-language" ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(fe, {
|
|
311
|
+
title: N("menuView.voiceLanguage", "Voice & language"),
|
|
312
|
+
tr: N,
|
|
312
313
|
onBack: X,
|
|
313
314
|
backRef: G
|
|
314
|
-
}), /* @__PURE__ */
|
|
315
|
+
}), /* @__PURE__ */ x("div", {
|
|
315
316
|
className: "scrollbar-slim min-h-0 flex-1 overflow-y-auto",
|
|
316
|
-
children: /* @__PURE__ */
|
|
317
|
-
})] }) : /* @__PURE__ */
|
|
317
|
+
children: /* @__PURE__ */ x(ne, {})
|
|
318
|
+
})] }) : /* @__PURE__ */ x(ee, {
|
|
318
319
|
presentation: "compact",
|
|
319
320
|
onBack: X,
|
|
320
|
-
onDone:
|
|
321
|
+
onDone: m
|
|
321
322
|
})
|
|
322
323
|
})
|
|
323
324
|
});
|
|
324
325
|
};
|
|
325
|
-
export {
|
|
326
|
+
export { O as AssistantMenuView };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, ReactNode, Ref } from 'react';
|
|
2
|
+
export interface AssistantPageBarProps {
|
|
3
|
+
menuOpen: boolean;
|
|
4
|
+
menuViewId?: string;
|
|
5
|
+
onOpenMenu: () => void;
|
|
6
|
+
menuButtonRef?: Ref<HTMLButtonElement>;
|
|
7
|
+
/** The Chat | Avatar switch, or nothing where the avatar is not offered. */
|
|
8
|
+
viewSwitch?: ReactNode;
|
|
9
|
+
conversationMenu: ReactNode;
|
|
10
|
+
onTogglePreview?: () => void;
|
|
11
|
+
previewOpen?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const AssistantPageBar: FC<AssistantPageBarProps>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useAssistantTr as e } from "../../i18n.js";
|
|
2
|
+
import { useAssistantPreview as t } from "../../preview/context.js";
|
|
3
|
+
import { hasAssistantPreviewSurface as n } from "../../preview/types.js";
|
|
4
|
+
import { Eye as r, Menu as i } from "lucide-react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
// src/shared/assistant/ui/compact/AssistantPageBar.tsx
|
|
7
|
+
var s = "flex size-10 shrink-0 items-center justify-center rounded-button transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", c = "text-text-secondary hover:bg-bg-sunken hover:text-text-primary", l = "bg-action-primary-bg/15 text-action-primary-bg", u = ({ menuOpen: u, menuViewId: d, onOpenMenu: f, menuButtonRef: p, viewSwitch: m, conversationMenu: h, onTogglePreview: g, previewOpen: _ }) => {
|
|
8
|
+
let v = e(), y = t();
|
|
9
|
+
return /* @__PURE__ */ o("div", {
|
|
10
|
+
className: "flex min-h-14 shrink-0 items-center gap-1 px-2 py-2 sm:px-3",
|
|
11
|
+
"data-testid": "assistant-page-bar",
|
|
12
|
+
"data-presentation": "page",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ a("button", {
|
|
15
|
+
ref: p,
|
|
16
|
+
type: "button",
|
|
17
|
+
onClick: f,
|
|
18
|
+
className: `${s} ${c}`,
|
|
19
|
+
"aria-label": v("header.menu", "Assistant menu"),
|
|
20
|
+
"aria-expanded": u,
|
|
21
|
+
"aria-controls": u ? d : void 0,
|
|
22
|
+
"data-testid": "assistant-menu",
|
|
23
|
+
children: /* @__PURE__ */ a(i, {
|
|
24
|
+
className: "size-5",
|
|
25
|
+
"aria-hidden": "true"
|
|
26
|
+
})
|
|
27
|
+
}),
|
|
28
|
+
m ?? null,
|
|
29
|
+
/* @__PURE__ */ a("span", { className: "flex-1" }),
|
|
30
|
+
n(y) && g ? /* @__PURE__ */ a("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
onClick: g,
|
|
33
|
+
className: `${s} ${_ ? l : c}`,
|
|
34
|
+
"aria-label": y.label ?? v("header.preview", "Preview"),
|
|
35
|
+
"aria-pressed": !!_,
|
|
36
|
+
"data-testid": "assistant-toggle-preview",
|
|
37
|
+
children: /* @__PURE__ */ a(r, {
|
|
38
|
+
className: "size-5",
|
|
39
|
+
"aria-hidden": "true"
|
|
40
|
+
})
|
|
41
|
+
}) : null,
|
|
42
|
+
h
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
export { u as AssistantPageBar };
|
|
@@ -14,5 +14,10 @@ export interface AssistantViewSwitchProps {
|
|
|
14
14
|
readonly ids: LiveAvatarTabIds;
|
|
15
15
|
/** Where this instance sits: the composer (`chat`), or inside the Avatar view (`avatar`, ids with a suffix). */
|
|
16
16
|
readonly instance: 'chat' | 'avatar';
|
|
17
|
+
/**
|
|
18
|
+
* BOFF-13461: `bar` is the page's bar (`AssistantPageBar`), where it is the one instance (`chat` ids) and needs no row of its own.
|
|
19
|
+
* Absent or `row`: the centred row above the composer, as before.
|
|
20
|
+
*/
|
|
21
|
+
readonly placement?: 'row' | 'bar';
|
|
17
22
|
}
|
|
18
23
|
export declare const AssistantViewSwitch: FC<AssistantViewSwitchProps>;
|
|
@@ -11,17 +11,17 @@ function s(e) {
|
|
|
11
11
|
avatarTab: `${e.avatarTab}${o}`
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
var c = ["chat", "avatar"], l = "inline-flex h-11 min-w-24 items-center justify-center rounded-full px-5 text-base font-semibold transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] sm:h-10 sm:min-w-[5.75rem] sm:text-[15px]", u = ({ selected: o, onSelect: u, ids: d, instance: f }) => {
|
|
15
|
-
let
|
|
14
|
+
var c = ["chat", "avatar"], l = "inline-flex h-11 min-w-24 items-center justify-center rounded-full px-5 text-base font-semibold transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] sm:h-10 sm:min-w-[5.75rem] sm:text-[15px]", u = ({ selected: o, onSelect: u, ids: d, instance: f, placement: p = "row" }) => {
|
|
15
|
+
let m = e(), h = n(r()), g = i({}), _ = f === "avatar" ? s(d) : d, v = o === "avatar" && h, y = (e, n) => {
|
|
16
16
|
let r = getComputedStyle(e.currentTarget).direction === "rtl", i = t(e.key, c, n, r), a = c.find((e) => e === i);
|
|
17
|
-
a !== void 0 && (e.preventDefault(),
|
|
17
|
+
a !== void 0 && (e.preventDefault(), g.current[a]?.focus());
|
|
18
18
|
};
|
|
19
19
|
return /* @__PURE__ */ a("div", {
|
|
20
|
-
className: "flex shrink-0 justify-center px-3 pb-2.5 pt-1",
|
|
20
|
+
className: p === "bar" ? "flex shrink-0" : "flex shrink-0 justify-center px-3 pb-2.5 pt-1",
|
|
21
21
|
"data-testid": `assistant-view-switch-row-${f}`,
|
|
22
22
|
children: /* @__PURE__ */ a("div", {
|
|
23
23
|
role: "tablist",
|
|
24
|
-
"aria-label":
|
|
24
|
+
"aria-label": m.tabsLabel,
|
|
25
25
|
className: "inline-flex gap-0.5 rounded-full border border-action-primary-bg/45 bg-[var(--color-accent-soft)] p-1",
|
|
26
26
|
"data-testid": "assistant-view-switch",
|
|
27
27
|
"data-instance": f,
|
|
@@ -29,23 +29,23 @@ var c = ["chat", "avatar"], l = "inline-flex h-11 min-w-24 items-center justify-
|
|
|
29
29
|
let t = e === o, n = e === "chat";
|
|
30
30
|
return /* @__PURE__ */ a("button", {
|
|
31
31
|
ref: (t) => {
|
|
32
|
-
|
|
32
|
+
g.current[e] = t;
|
|
33
33
|
},
|
|
34
34
|
type: "button",
|
|
35
35
|
role: "tab",
|
|
36
|
-
id: n ?
|
|
36
|
+
id: n ? _.chatTab : _.avatarTab,
|
|
37
37
|
"aria-selected": t,
|
|
38
38
|
"aria-controls": n ? d.chatPanel : d.avatarPanel,
|
|
39
|
-
"aria-describedby": n &&
|
|
40
|
-
title: n &&
|
|
39
|
+
"aria-describedby": n && v ? d.leaveHint : void 0,
|
|
40
|
+
title: n && v ? m.tabLeaveHint : void 0,
|
|
41
41
|
tabIndex: t ? 0 : -1,
|
|
42
42
|
onClick: () => {
|
|
43
43
|
t || u(e);
|
|
44
44
|
},
|
|
45
|
-
onKeyDown: (t) =>
|
|
45
|
+
onKeyDown: (t) => y(t, e),
|
|
46
46
|
className: `${l} ${t ? "bg-bg-sunken text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
|
|
47
47
|
"data-testid": n ? "assistant-view-chat" : "assistant-view-avatar",
|
|
48
|
-
children: n ?
|
|
48
|
+
children: n ? m.tabChat : m.tabAvatar
|
|
49
49
|
}, e);
|
|
50
50
|
})
|
|
51
51
|
})
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { AssistantAiDisclaimer as e } from "../AssistantAiDisclaimer.js";
|
|
2
|
-
import {
|
|
2
|
+
import { PAGE_COLUMN as t, useAssistantPageLayout as n } from "../assistantPageLayout.js";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
4
|
// src/shared/assistant/ui/composer/AssistantCompactFooter.tsx
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})
|
|
13
|
-
|
|
5
|
+
var a = ({ children: a }) => {
|
|
6
|
+
let o = n();
|
|
7
|
+
return /* @__PURE__ */ r("div", {
|
|
8
|
+
className: o ? `mb-2 mt-1.5 shrink-0 px-3 ${t}` : "mx-3 mb-2 mt-1.5 shrink-0",
|
|
9
|
+
"data-testid": "assistant-composer-footer",
|
|
10
|
+
children: /* @__PURE__ */ i("div", {
|
|
11
|
+
className: "flex flex-wrap items-center justify-center gap-x-2 gap-y-0.5 text-center [&_p]:max-w-full [&_p]:text-xs [&_p]:leading-4",
|
|
12
|
+
"data-testid": "assistant-composer-footer-content",
|
|
13
|
+
children: [/* @__PURE__ */ r(e, {}), a]
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export { a as AssistantCompactFooter };
|