@burdenoff/fe-libs 2026.1114.10 → 2026.1114.12
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/index.d.ts +3 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.js +227 -227
- package/dist/shared/assistant/ui/AssistantPageHost.d.ts +6 -1
- package/dist/shared/assistant/ui/AssistantPageHost.js +20 -17
- package/dist/shared/assistant/ui/assistantPageSettings.d.ts +4 -0
- package/dist/shared/assistant/ui/assistantPageSettings.js +22 -0
- package/dist/shared/assistant/ui/compact/AssistantMenuView.js +119 -144
- package/dist/shared/assistant/ui/compact/AssistantPageBar.d.ts +1 -5
- package/dist/shared/assistant/ui/compact/AssistantPageBar.js +19 -37
- package/dist/shared/assistant/ui/compact/AssistantPanelLayoutField.d.ts +8 -0
- package/dist/shared/assistant/ui/compact/AssistantPanelLayoutField.js +39 -0
- package/dist/shared/assistant/ui/compact/AssistantSettingsView.d.ts +10 -0
- package/dist/shared/assistant/ui/compact/AssistantSettingsView.js +50 -0
- package/dist/shared/proactive/transport.js +4 -0
- package/dist/shared-assistant.js +67 -64
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useSyncExternalStore as e } from "react";
|
|
2
|
+
// src/shared/assistant/ui/assistantPageSettings.ts
|
|
3
|
+
var t = 0, n = /* @__PURE__ */ new Set();
|
|
4
|
+
function r() {
|
|
5
|
+
for (let e of [...n]) e();
|
|
6
|
+
}
|
|
7
|
+
function i(e) {
|
|
8
|
+
return n.add(e), () => {
|
|
9
|
+
n.delete(e);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function a() {
|
|
13
|
+
t += 1, r();
|
|
14
|
+
let e = !1;
|
|
15
|
+
return () => {
|
|
16
|
+
e || (e = !0, --t, r());
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function o() {
|
|
20
|
+
return e(i, () => t > 0, () => !1);
|
|
21
|
+
}
|
|
22
|
+
export { a as offerAssistantPageSettings, o as useAssistantPageSettings };
|
|
@@ -5,184 +5,185 @@ 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
|
|
8
|
+
import { resolveLanguagePair as ee } from "../../voice/languagePair.js";
|
|
9
|
+
import { AssistantConversationList as te } from "../AssistantConversationList.js";
|
|
10
|
+
import { assistantModeOptionName as s } from "../composer/AssistantModeMenu.js";
|
|
11
11
|
import { useOverlayFocus as c } from "../useOverlayFocus.js";
|
|
12
|
-
import { fieldOwnsEscape as l, menuViewEscape as u, recentConversations as
|
|
13
|
-
import { useAssistantNavigate as
|
|
14
|
-
import { AssistantVoiceLanguageSettings as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
12
|
+
import { fieldOwnsEscape as l, menuViewEscape as u, recentConversations as ne } from "./compactChrome.js";
|
|
13
|
+
import { useAssistantNavigate as re } from "../AssistantMarkdownRenderer.js";
|
|
14
|
+
import { AssistantVoiceLanguageSettings as ie } from "./AssistantVoiceLanguageSettings.js";
|
|
15
|
+
import { AssistantPanelLayoutField as ae } from "./AssistantPanelLayoutField.js";
|
|
16
|
+
import { PAGE_VIEW_GUTTER as oe, useAssistantPageLayout as d } from "../assistantPageLayout.js";
|
|
17
|
+
import { useEffect as f, useLayoutEffect as p, useMemo as se, useRef as m, useState as h } from "react";
|
|
18
|
+
import { ArrowLeft as g, ChevronRight as _, History as ce, Languages as le, Plus as ue, UserRound as de, X as v } from "lucide-react";
|
|
19
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
19
20
|
// src/shared/assistant/ui/compact/AssistantMenuView.tsx
|
|
20
|
-
var
|
|
21
|
+
var S = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", C = `flex size-10 shrink-0 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary ${S}`, w = `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 ${S} focus-visible:ring-inset`, fe = typeof document > "u" ? f : p, T = ({ icon: e, label: t, trailing: n, onClick: r, buttonRef: i, testId: a, describedBy: o }) => /* @__PURE__ */ x("button", {
|
|
21
22
|
ref: i,
|
|
22
23
|
type: "button",
|
|
23
24
|
onClick: r,
|
|
24
|
-
className:
|
|
25
|
+
className: w,
|
|
25
26
|
"aria-describedby": o,
|
|
26
27
|
"data-testid": a,
|
|
27
28
|
children: [
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ b("span", {
|
|
29
30
|
className: "flex size-5 shrink-0 items-center justify-center text-text-secondary",
|
|
30
31
|
children: e
|
|
31
32
|
}),
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ b("span", {
|
|
33
34
|
className: "min-w-0 flex-1 truncate",
|
|
34
35
|
children: t
|
|
35
36
|
}),
|
|
36
37
|
n
|
|
37
38
|
]
|
|
38
|
-
}),
|
|
39
|
+
}), E = ({ id: e, children: t }) => /* @__PURE__ */ b("h3", {
|
|
39
40
|
id: e,
|
|
40
41
|
className: "px-4 pb-1 pt-4 text-xs font-semibold uppercase tracking-wide text-text-muted",
|
|
41
42
|
children: t
|
|
42
|
-
}),
|
|
43
|
+
}), pe = ({ title: e, tr: t, onBack: n, backRef: r }) => /* @__PURE__ */ x("div", {
|
|
43
44
|
className: "flex items-center gap-1 border-b border-border-default bg-bg-elevated px-2 py-2",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
45
|
+
children: [/* @__PURE__ */ b("button", {
|
|
45
46
|
ref: r,
|
|
46
47
|
type: "button",
|
|
47
48
|
onClick: n,
|
|
48
|
-
className:
|
|
49
|
+
className: C,
|
|
49
50
|
"aria-label": t("menuView.back", "Back"),
|
|
50
51
|
"data-testid": "assistant-menu-subview-back",
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ b(g, {
|
|
52
53
|
className: "size-5",
|
|
53
54
|
"aria-hidden": "true"
|
|
54
55
|
})
|
|
55
|
-
}), /* @__PURE__ */
|
|
56
|
+
}), /* @__PURE__ */ b("h2", {
|
|
56
57
|
className: "min-w-0 flex-1 truncate text-base font-semibold text-text-primary",
|
|
57
58
|
children: e
|
|
58
59
|
})]
|
|
59
|
-
}),
|
|
60
|
-
let
|
|
61
|
-
B === "avatar" && !
|
|
62
|
-
let ve =
|
|
60
|
+
}), D = ({ id: f, onClose: p, onRequestClosePanel: D, onNewConversation: me, AvatarSettings: O, initialView: k = "root", docked: A, onToggleDock: j }) => {
|
|
61
|
+
let M = n(), N = d(), { locale: P } = t(), { modes: F } = a(), { conversations: I, activeConversationId: L, assistantLanguage: R, replyLanguage: z, setActiveConversation: he, setMode: ge } = o(), _e = i((e) => e.product !== null), [B, V] = h(k === "avatar" && O ? "avatar" : "root");
|
|
62
|
+
B === "avatar" && !O && V("root");
|
|
63
|
+
let ve = re(), H = m(null), U = m(null), ye = c("assistant-menu"), W = m(null), G = m(null), K = m(null), q = m(null), J = m(k === "avatar" ? "avatar" : "back"), Y = (e) => {
|
|
63
64
|
J.current = e, V(e);
|
|
64
65
|
}, X = () => V("root");
|
|
65
|
-
|
|
66
|
+
fe(() => {
|
|
66
67
|
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"));
|
|
67
68
|
}, [B]);
|
|
68
|
-
let Z =
|
|
69
|
-
if (_e) r.openConversation(e, { modes:
|
|
69
|
+
let Z = se(() => ne(I), [I]), be = M("history.untitled", "Untitled conversation"), xe = (e) => {
|
|
70
|
+
if (_e) r.openConversation(e, { modes: F });
|
|
70
71
|
else {
|
|
71
|
-
let t =
|
|
72
|
+
let t = I.find((t) => t.id === e);
|
|
72
73
|
he(e), t && ge(t.mode);
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
-
}, Se =
|
|
76
|
-
return /* @__PURE__ */
|
|
75
|
+
p();
|
|
76
|
+
}, Se = ee(R, z, P).input.label, Q = `${f}-settings`, $ = `${f}-recent`;
|
|
77
|
+
return /* @__PURE__ */ b(e, {
|
|
77
78
|
onDismiss: () => {
|
|
78
|
-
B === "history" && l(document.activeElement) || (u(B) === "back" ? X() :
|
|
79
|
+
B === "history" && l(document.activeElement) || (u(B) === "back" ? X() : p());
|
|
79
80
|
},
|
|
80
|
-
children: /* @__PURE__ */
|
|
81
|
+
children: /* @__PURE__ */ b("div", {
|
|
81
82
|
ref: ye,
|
|
82
|
-
id:
|
|
83
|
+
id: f,
|
|
83
84
|
tabIndex: -1,
|
|
84
85
|
role: "region",
|
|
85
|
-
"aria-label":
|
|
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${
|
|
86
|
+
"aria-label": M("menuView.title", "Assistant menu"),
|
|
87
|
+
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${N ? ` ${oe}` : ""}`,
|
|
87
88
|
"data-testid": "assistant-menu-view",
|
|
88
89
|
"data-menu-view": B,
|
|
89
|
-
children: B === "root" ? /* @__PURE__ */
|
|
90
|
+
children: B === "root" ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("div", {
|
|
90
91
|
className: "flex items-center gap-1 border-b border-border-default bg-bg-elevated px-2 py-2",
|
|
91
92
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ x("button", {
|
|
93
94
|
ref: W,
|
|
94
95
|
type: "button",
|
|
95
|
-
onClick:
|
|
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 ${
|
|
96
|
+
onClick: p,
|
|
97
|
+
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 ${S}`,
|
|
97
98
|
"data-testid": "assistant-menu-back",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ b(g, {
|
|
99
100
|
className: "size-5",
|
|
100
101
|
"aria-hidden": "true"
|
|
101
|
-
}),
|
|
102
|
+
}), M("menuView.backToConversation", "Back to conversation")]
|
|
102
103
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ b("h2", {
|
|
104
105
|
className: "sr-only",
|
|
105
|
-
children:
|
|
106
|
+
children: M("menuView.title", "Assistant menu")
|
|
106
107
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
108
|
+
/* @__PURE__ */ b("span", { className: "flex-1" }),
|
|
109
|
+
D ? /* @__PURE__ */ b("button", {
|
|
109
110
|
type: "button",
|
|
110
|
-
onClick:
|
|
111
|
-
className:
|
|
112
|
-
"aria-label":
|
|
111
|
+
onClick: D,
|
|
112
|
+
className: C,
|
|
113
|
+
"aria-label": M("header.close", "Close assistant"),
|
|
113
114
|
"data-testid": "assistant-menu-close",
|
|
114
|
-
children: /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ b(v, {
|
|
115
116
|
className: "size-5",
|
|
116
117
|
"aria-hidden": "true"
|
|
117
118
|
})
|
|
118
119
|
}) : null
|
|
119
120
|
]
|
|
120
|
-
}), /* @__PURE__ */
|
|
121
|
+
}), /* @__PURE__ */ x("div", {
|
|
121
122
|
className: "scrollbar-slim min-h-0 flex-1 overflow-y-auto pb-2",
|
|
122
123
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ x("button", {
|
|
124
125
|
type: "button",
|
|
125
|
-
onClick:
|
|
126
|
-
className: `${
|
|
126
|
+
onClick: me,
|
|
127
|
+
className: `${w} mt-2`,
|
|
127
128
|
"aria-keyshortcuts": "Control+Shift+N Meta+Shift+N",
|
|
128
129
|
"data-testid": "assistant-new-conversation",
|
|
129
130
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ b("span", {
|
|
131
132
|
className: "flex size-5 shrink-0 items-center justify-center text-text-secondary",
|
|
132
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ b(ue, {
|
|
133
134
|
className: "size-5",
|
|
134
135
|
"aria-hidden": "true"
|
|
135
136
|
})
|
|
136
137
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ b("span", {
|
|
138
139
|
className: "min-w-0 flex-1 truncate",
|
|
139
|
-
children:
|
|
140
|
+
children: M("header.newConversation", "New conversation")
|
|
140
141
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ b("kbd", {
|
|
142
143
|
className: "shrink-0 text-xs text-text-muted",
|
|
143
144
|
children: "Ctrl+Shift+N"
|
|
144
145
|
})
|
|
145
146
|
]
|
|
146
147
|
}),
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ x("section", {
|
|
148
149
|
"aria-labelledby": $,
|
|
149
150
|
"data-testid": "assistant-menu-recent",
|
|
150
151
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ b(E, {
|
|
152
153
|
id: $,
|
|
153
|
-
children:
|
|
154
|
+
children: M("menuView.recent", "Recent")
|
|
154
155
|
}),
|
|
155
|
-
Z.length === 0 ? /* @__PURE__ */
|
|
156
|
+
Z.length === 0 ? /* @__PURE__ */ b("p", {
|
|
156
157
|
className: "px-4 py-2 text-sm text-text-muted",
|
|
157
|
-
children:
|
|
158
|
-
}) : /* @__PURE__ */
|
|
159
|
-
let t =
|
|
160
|
-
return /* @__PURE__ */
|
|
158
|
+
children: M("conversations.empty", "No conversations yet")
|
|
159
|
+
}) : /* @__PURE__ */ b("ul", { children: Z.map((e) => {
|
|
160
|
+
let t = F.find((t) => t.id === e.mode);
|
|
161
|
+
return /* @__PURE__ */ b("li", { children: /* @__PURE__ */ b("button", {
|
|
161
162
|
type: "button",
|
|
162
163
|
onClick: () => xe(e.id),
|
|
163
|
-
className: `${
|
|
164
|
-
"aria-current": e.id ===
|
|
164
|
+
className: `${w} ${e.id === L ? "bg-bg-elevated" : ""}`,
|
|
165
|
+
"aria-current": e.id === L ? "true" : void 0,
|
|
165
166
|
"data-testid": "assistant-menu-recent-row",
|
|
166
|
-
children: /* @__PURE__ */
|
|
167
|
+
children: /* @__PURE__ */ x("span", {
|
|
167
168
|
className: "min-w-0 flex-1",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ b("span", {
|
|
169
170
|
className: "block truncate",
|
|
170
171
|
children: e.title || be
|
|
171
|
-
}), t ? /* @__PURE__ */
|
|
172
|
+
}), t ? /* @__PURE__ */ b("span", {
|
|
172
173
|
className: "block truncate text-xs text-text-muted",
|
|
173
|
-
children:
|
|
174
|
+
children: s(M, t)
|
|
174
175
|
}) : null]
|
|
175
176
|
})
|
|
176
177
|
}) }, e.id);
|
|
177
178
|
}) }),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ b(T, {
|
|
179
180
|
buttonRef: q,
|
|
180
|
-
icon: /* @__PURE__ */
|
|
181
|
+
icon: /* @__PURE__ */ b(ce, {
|
|
181
182
|
className: "size-5",
|
|
182
183
|
"aria-hidden": "true"
|
|
183
184
|
}),
|
|
184
|
-
label:
|
|
185
|
-
trailing: /* @__PURE__ */
|
|
185
|
+
label: M("menuView.viewAllHistory", "View all history"),
|
|
186
|
+
trailing: /* @__PURE__ */ b(_, {
|
|
186
187
|
className: "size-4 text-text-muted",
|
|
187
188
|
"aria-hidden": "true"
|
|
188
189
|
}),
|
|
@@ -191,38 +192,38 @@ var C = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color
|
|
|
191
192
|
})
|
|
192
193
|
]
|
|
193
194
|
}),
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ x("section", {
|
|
195
196
|
"aria-labelledby": Q,
|
|
196
197
|
"data-testid": "assistant-menu-settings",
|
|
197
198
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ b(E, {
|
|
199
200
|
id: Q,
|
|
200
|
-
children:
|
|
201
|
+
children: M("menuView.settings", "Settings")
|
|
201
202
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ b(T, {
|
|
203
204
|
buttonRef: K,
|
|
204
|
-
icon: /* @__PURE__ */
|
|
205
|
+
icon: /* @__PURE__ */ b(le, {
|
|
205
206
|
className: "size-5",
|
|
206
207
|
"aria-hidden": "true"
|
|
207
208
|
}),
|
|
208
|
-
label:
|
|
209
|
-
trailing: /* @__PURE__ */
|
|
209
|
+
label: M("menuView.voiceLanguage", "Voice & language"),
|
|
210
|
+
trailing: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
|
|
210
211
|
className: "max-w-[40%] truncate text-xs text-text-muted",
|
|
211
212
|
children: Se
|
|
212
|
-
}), /* @__PURE__ */
|
|
213
|
+
}), /* @__PURE__ */ b(_, {
|
|
213
214
|
className: "size-4 shrink-0 text-text-muted",
|
|
214
215
|
"aria-hidden": "true"
|
|
215
216
|
})] }),
|
|
216
217
|
onClick: () => Y("voice-language"),
|
|
217
218
|
testId: "assistant-menu-voice-language-row"
|
|
218
219
|
}),
|
|
219
|
-
|
|
220
|
-
icon: /* @__PURE__ */
|
|
220
|
+
O ? /* @__PURE__ */ b(T, {
|
|
221
|
+
icon: /* @__PURE__ */ b(de, {
|
|
221
222
|
className: "size-5",
|
|
222
223
|
"aria-hidden": "true"
|
|
223
224
|
}),
|
|
224
|
-
label:
|
|
225
|
-
trailing: /* @__PURE__ */
|
|
225
|
+
label: M("menuView.avatar", "Avatar"),
|
|
226
|
+
trailing: /* @__PURE__ */ b(_, {
|
|
226
227
|
className: "size-4 text-text-muted",
|
|
227
228
|
"aria-hidden": "true"
|
|
228
229
|
}),
|
|
@@ -230,97 +231,71 @@ var C = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color
|
|
|
230
231
|
onClick: () => Y("avatar"),
|
|
231
232
|
testId: "assistant-menu-avatar-row"
|
|
232
233
|
}) : null,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
className: "flex items-center gap-3 py-1 text-sm text-text-primary",
|
|
238
|
-
children: [/* @__PURE__ */ x(v, {
|
|
239
|
-
className: "size-5 shrink-0 text-text-secondary",
|
|
240
|
-
"aria-hidden": "true"
|
|
241
|
-
}), N("menuView.panelLayout", "Panel layout")]
|
|
242
|
-
}), [[
|
|
243
|
-
!0,
|
|
244
|
-
N("menuView.layoutDocked", "Docked side panel"),
|
|
245
|
-
"docked"
|
|
246
|
-
], [
|
|
247
|
-
!1,
|
|
248
|
-
N("menuView.layoutFloating", "Floating window"),
|
|
249
|
-
"floating"
|
|
250
|
-
]].map(([e, t, n]) => /* @__PURE__ */ S("label", {
|
|
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)]",
|
|
252
|
-
children: [/* @__PURE__ */ x("input", {
|
|
253
|
-
type: "radio",
|
|
254
|
-
name: `${p}-layout`,
|
|
255
|
-
checked: !!j === e,
|
|
256
|
-
onChange: () => {
|
|
257
|
-
!!j !== e && M();
|
|
258
|
-
},
|
|
259
|
-
className: "size-4 accent-current",
|
|
260
|
-
"data-testid": `assistant-panel-layout-${n}`
|
|
261
|
-
}), t]
|
|
262
|
-
}, n))]
|
|
234
|
+
j ? /* @__PURE__ */ b(ae, {
|
|
235
|
+
groupName: `${f}-layout`,
|
|
236
|
+
docked: A,
|
|
237
|
+
onToggleDock: j
|
|
263
238
|
}) : null
|
|
264
239
|
]
|
|
265
240
|
})
|
|
266
241
|
]
|
|
267
|
-
})] }) : B === "avatar" &&
|
|
242
|
+
})] }) : B === "avatar" && O ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("div", {
|
|
268
243
|
className: "flex shrink-0 items-center gap-1 border-b border-border-default bg-bg-elevated px-1 py-2",
|
|
269
244
|
children: [
|
|
270
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ b("button", {
|
|
271
246
|
type: "button",
|
|
272
247
|
onClick: X,
|
|
273
|
-
className: `${
|
|
274
|
-
"aria-label":
|
|
248
|
+
className: `${C} size-11`,
|
|
249
|
+
"aria-label": M("menuView.back", "Back"),
|
|
275
250
|
"data-testid": "assistant-menu-subview-back",
|
|
276
|
-
children: /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ b(g, {
|
|
277
252
|
className: "size-5",
|
|
278
253
|
"aria-hidden": "true"
|
|
279
254
|
})
|
|
280
255
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ x("div", {
|
|
282
257
|
className: "min-w-0 flex-1",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
258
|
+
children: [/* @__PURE__ */ b("p", {
|
|
284
259
|
className: "text-xs text-text-secondary",
|
|
285
|
-
children:
|
|
286
|
-
}), /* @__PURE__ */
|
|
260
|
+
children: M("menuView.settings", "Settings")
|
|
261
|
+
}), /* @__PURE__ */ b("h2", {
|
|
287
262
|
ref: H,
|
|
288
263
|
tabIndex: -1,
|
|
289
264
|
className: "text-base font-semibold text-text-primary outline-none",
|
|
290
265
|
"data-testid": "assistant-avatar-settings-heading",
|
|
291
|
-
children:
|
|
266
|
+
children: M("menuView.avatar", "Avatar")
|
|
292
267
|
})]
|
|
293
268
|
}),
|
|
294
|
-
|
|
269
|
+
D ? /* @__PURE__ */ b("button", {
|
|
295
270
|
type: "button",
|
|
296
|
-
onClick:
|
|
297
|
-
className: `${
|
|
298
|
-
"aria-label":
|
|
271
|
+
onClick: D,
|
|
272
|
+
className: `${C} size-11`,
|
|
273
|
+
"aria-label": M("header.close", "Close assistant"),
|
|
299
274
|
"data-testid": "assistant-avatar-settings-close",
|
|
300
|
-
children: /* @__PURE__ */
|
|
275
|
+
children: /* @__PURE__ */ b(v, {
|
|
301
276
|
className: "size-5",
|
|
302
277
|
"aria-hidden": "true"
|
|
303
278
|
})
|
|
304
279
|
}) : null
|
|
305
280
|
]
|
|
306
|
-
}), /* @__PURE__ */
|
|
281
|
+
}), /* @__PURE__ */ b("div", {
|
|
307
282
|
className: "scrollbar-slim min-h-0 min-w-0 flex-1 overflow-y-auto",
|
|
308
283
|
"data-testid": "assistant-avatar-settings-scroll",
|
|
309
|
-
children: /* @__PURE__ */
|
|
310
|
-
})] }) : B === "voice-language" ? /* @__PURE__ */
|
|
311
|
-
title:
|
|
312
|
-
tr:
|
|
284
|
+
children: /* @__PURE__ */ b(O, { navigate: ve })
|
|
285
|
+
})] }) : B === "voice-language" ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(pe, {
|
|
286
|
+
title: M("menuView.voiceLanguage", "Voice & language"),
|
|
287
|
+
tr: M,
|
|
313
288
|
onBack: X,
|
|
314
289
|
backRef: G
|
|
315
|
-
}), /* @__PURE__ */
|
|
290
|
+
}), /* @__PURE__ */ b("div", {
|
|
316
291
|
className: "scrollbar-slim min-h-0 flex-1 overflow-y-auto",
|
|
317
|
-
children: /* @__PURE__ */
|
|
318
|
-
})] }) : /* @__PURE__ */
|
|
292
|
+
children: /* @__PURE__ */ b(ie, {})
|
|
293
|
+
})] }) : /* @__PURE__ */ b(te, {
|
|
319
294
|
presentation: "compact",
|
|
320
295
|
onBack: X,
|
|
321
|
-
onDone:
|
|
296
|
+
onDone: p
|
|
322
297
|
})
|
|
323
298
|
})
|
|
324
299
|
});
|
|
325
300
|
};
|
|
326
|
-
export {
|
|
301
|
+
export { D as AssistantMenuView };
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { FC, ReactNode
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
export interface AssistantPageBarProps {
|
|
3
|
-
menuOpen: boolean;
|
|
4
|
-
menuViewId?: string;
|
|
5
|
-
onOpenMenu: () => void;
|
|
6
|
-
menuButtonRef?: Ref<HTMLButtonElement>;
|
|
7
3
|
conversationMenu: ReactNode;
|
|
8
4
|
onTogglePreview?: () => void;
|
|
9
5
|
previewOpen?: boolean;
|
|
@@ -1,45 +1,27 @@
|
|
|
1
1
|
import { useAssistantTr as e } from "../../i18n.js";
|
|
2
2
|
import { useAssistantPreview as t } from "../../preview/context.js";
|
|
3
3
|
import { hasAssistantPreviewSurface as n } from "../../preview/types.js";
|
|
4
|
-
import { Eye as r
|
|
5
|
-
import { jsx as
|
|
4
|
+
import { Eye as r } from "lucide-react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
// src/shared/assistant/ui/compact/AssistantPageBar.tsx
|
|
7
|
-
var
|
|
8
|
-
let
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
className: "flex min-h-
|
|
7
|
+
var o = "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)]", s = "text-text-secondary hover:bg-bg-sunken hover:text-text-primary", c = "bg-action-primary-bg/15 text-action-primary-bg", l = ({ conversationMenu: l, onTogglePreview: u, previewOpen: d }) => {
|
|
8
|
+
let f = e(), p = t();
|
|
9
|
+
return /* @__PURE__ */ a("div", {
|
|
10
|
+
className: "flex min-h-12 shrink-0 items-center justify-end gap-1 px-2 py-1 sm:px-3",
|
|
11
11
|
"data-testid": "assistant-page-bar",
|
|
12
12
|
"data-presentation": "page",
|
|
13
|
-
children: [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"aria-hidden": "true"
|
|
26
|
-
})
|
|
27
|
-
}),
|
|
28
|
-
/* @__PURE__ */ a("span", { className: "flex-1" }),
|
|
29
|
-
n(v) && h ? /* @__PURE__ */ a("button", {
|
|
30
|
-
type: "button",
|
|
31
|
-
onClick: h,
|
|
32
|
-
className: `${s} ${g ? l : c}`,
|
|
33
|
-
"aria-label": v.label ?? _("header.preview", "Preview"),
|
|
34
|
-
"aria-pressed": !!g,
|
|
35
|
-
"data-testid": "assistant-toggle-preview",
|
|
36
|
-
children: /* @__PURE__ */ a(r, {
|
|
37
|
-
className: "size-5",
|
|
38
|
-
"aria-hidden": "true"
|
|
39
|
-
})
|
|
40
|
-
}) : null,
|
|
41
|
-
m
|
|
42
|
-
]
|
|
13
|
+
children: [n(p) && u ? /* @__PURE__ */ i("button", {
|
|
14
|
+
type: "button",
|
|
15
|
+
onClick: u,
|
|
16
|
+
className: `${o} ${d ? c : s}`,
|
|
17
|
+
"aria-label": p.label ?? f("header.preview", "Preview"),
|
|
18
|
+
"aria-pressed": !!d,
|
|
19
|
+
"data-testid": "assistant-toggle-preview",
|
|
20
|
+
children: /* @__PURE__ */ i(r, {
|
|
21
|
+
className: "size-5",
|
|
22
|
+
"aria-hidden": "true"
|
|
23
|
+
})
|
|
24
|
+
}) : null, l]
|
|
43
25
|
});
|
|
44
26
|
};
|
|
45
|
-
export {
|
|
27
|
+
export { l as AssistantPageBar };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface AssistantPanelLayoutFieldProps {
|
|
3
|
+
/** The radio group's name: unique per instance. */
|
|
4
|
+
readonly groupName: string;
|
|
5
|
+
readonly docked: boolean | undefined;
|
|
6
|
+
readonly onToggleDock: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const AssistantPanelLayoutField: FC<AssistantPanelLayoutFieldProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useAssistantTr as e } from "../../i18n.js";
|
|
2
|
+
import { PanelRight as t } from "lucide-react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
// src/shared/assistant/ui/compact/AssistantPanelLayoutField.tsx
|
|
5
|
+
var i = ({ groupName: i, docked: a, onToggleDock: o }) => {
|
|
6
|
+
let s = e();
|
|
7
|
+
return /* @__PURE__ */ r("fieldset", {
|
|
8
|
+
className: "hidden min-w-0 border-0 px-4 py-2 sm:block",
|
|
9
|
+
"data-testid": "assistant-menu-panel-layout",
|
|
10
|
+
children: [/* @__PURE__ */ r("legend", {
|
|
11
|
+
className: "flex items-center gap-3 py-1 text-sm text-text-primary",
|
|
12
|
+
children: [/* @__PURE__ */ n(t, {
|
|
13
|
+
className: "size-5 shrink-0 text-text-secondary",
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
}), s("menuView.panelLayout", "Panel layout")]
|
|
16
|
+
}), [[
|
|
17
|
+
!0,
|
|
18
|
+
s("menuView.layoutDocked", "Docked side panel"),
|
|
19
|
+
"docked"
|
|
20
|
+
], [
|
|
21
|
+
!1,
|
|
22
|
+
s("menuView.layoutFloating", "Floating window"),
|
|
23
|
+
"floating"
|
|
24
|
+
]].map(([e, t, s]) => /* @__PURE__ */ r("label", {
|
|
25
|
+
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)]",
|
|
26
|
+
children: [/* @__PURE__ */ n("input", {
|
|
27
|
+
type: "radio",
|
|
28
|
+
name: i,
|
|
29
|
+
checked: !!a === e,
|
|
30
|
+
onChange: () => {
|
|
31
|
+
!!a !== e && o();
|
|
32
|
+
},
|
|
33
|
+
className: "size-4 accent-current",
|
|
34
|
+
"data-testid": `assistant-panel-layout-${s}`
|
|
35
|
+
}), t]
|
|
36
|
+
}, s))]
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
export { i as AssistantPanelLayoutField };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentType, FC } from 'react';
|
|
2
|
+
import { LiveAvatarSettingsViewProps } from '../assistantLiveAvatarSeam';
|
|
3
|
+
export interface AssistantSettingsViewProps {
|
|
4
|
+
/** The avatar's settings, where the avatar is offered. */
|
|
5
|
+
readonly AvatarSettings?: ComponentType<LiveAvatarSettingsViewProps>;
|
|
6
|
+
/** The side panel's layout, where the product offers a choice. */
|
|
7
|
+
readonly docked?: boolean;
|
|
8
|
+
readonly onToggleDock?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const AssistantSettingsView: FC<AssistantSettingsViewProps>;
|