@burdenoff/fe-libs 2026.1119.5 → 2026.1119.6
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/chrome/HeaderThemeSwitcher.js +1 -1
- package/dist/chrome/ThemePreferences.js +16 -16
- package/dist/chrome/appearance/AppearanceColourSection.d.ts +17 -0
- package/dist/chrome/appearance/AppearanceColourSection.js +337 -0
- package/dist/chrome/appearance/AppearanceDisplaySection.d.ts +7 -0
- package/dist/chrome/appearance/AppearanceDisplaySection.js +137 -0
- package/dist/chrome/appearance/AppearanceModeDepth.d.ts +11 -0
- package/dist/chrome/appearance/AppearanceModeDepth.js +158 -0
- package/dist/chrome/appearance/AppearancePreferences.d.ts +13 -0
- package/dist/chrome/appearance/AppearancePreferences.js +308 -0
- package/dist/chrome/appearance/AppearancePreview.d.ts +23 -0
- package/dist/chrome/appearance/AppearancePreview.js +218 -0
- package/dist/chrome/appearance/AppearanceThemeSection.d.ts +14 -0
- package/dist/chrome/appearance/AppearanceThemeSection.js +162 -0
- package/dist/chrome/appearance/ColourPanel.d.ts +37 -0
- package/dist/chrome/appearance/ColourPanel.js +264 -0
- package/dist/chrome/appearance/ThemeDialog.d.ts +21 -0
- package/dist/chrome/appearance/ThemeDialog.js +378 -0
- package/dist/chrome/appearance/appearanceShared.d.ts +24 -0
- package/dist/chrome/appearance/appearanceShared.js +46 -0
- package/dist/chrome/appearance/appearanceUi.d.ts +49 -0
- package/dist/chrome/appearance/appearanceUi.js +98 -0
- package/dist/chrome/appearance/useAppearanceLabels.d.ts +181 -0
- package/dist/chrome/appearance/useAppearanceLabels.js +259 -0
- package/dist/chrome/index.d.ts +1 -0
- package/dist/chrome/shell/ShellSidebar.js +2 -0
- package/dist/chrome/shellLabelManifest.d.ts +6 -0
- package/dist/chrome.js +26 -25
- package/dist/platform-pages/AppearanceSettingsPage.d.ts +11 -1
- package/dist/platform-pages/AppearanceSettingsPage.js +15 -8
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +346 -345
- package/dist/shared/backgrounds/useBackgroundColors.js +3 -2
- package/dist/shared/providers/AppShellProvider.d.ts +20 -1
- package/dist/shared/providers/AppShellProvider.js +230 -222
- package/dist/shared/providers/shell/PaletteThemeProvider.d.ts +13 -0
- package/dist/shared/providers/shell/PaletteThemeProvider.js +366 -0
- package/dist/shared/providers/shell/ThemeProvider.d.ts +9 -76
- package/dist/shared/providers/shell/ThemeProvider.js +63 -55
- package/dist/shared/providers/shell/appearance/colour.d.ts +29 -0
- package/dist/shared/providers/shell/appearance/colour.js +79 -0
- package/dist/shared/providers/shell/appearance/contrastFix.d.ts +70 -0
- package/dist/shared/providers/shell/appearance/contrastFix.js +117 -0
- package/dist/shared/providers/shell/appearance/index.d.ts +9 -0
- package/dist/shared/providers/shell/appearance/model.d.ts +68 -0
- package/dist/shared/providers/shell/appearance/model.js +92 -0
- package/dist/shared/providers/shell/appearance/operations.d.ts +70 -0
- package/dist/shared/providers/shell/appearance/operations.js +160 -0
- package/dist/shared/providers/shell/appearance/palettes.d.ts +111 -0
- package/dist/shared/providers/shell/appearance/palettes.js +460 -0
- package/dist/shared/providers/shell/appearance/storage.d.ts +39 -0
- package/dist/shared/providers/shell/appearance/storage.js +186 -0
- package/dist/shared/providers/shell/appearance/tokens.d.ts +5 -0
- package/dist/shared/providers/shell/appearance/tokens.js +43 -0
- package/dist/shared/providers/shell/appearance/types.d.ts +80 -0
- package/dist/shared/providers/shell/appearance/types.js +28 -0
- package/dist/shared/providers/shell/index.d.ts +1 -1
- package/dist/shared/providers/shell/responsiveDisplaySettings.d.ts +27 -0
- package/dist/shared/providers/shell/responsiveDisplaySettings.js +6 -0
- package/dist/shared/providers/shell/themeContext.d.ts +162 -0
- package/dist/shared/providers/shell/themeContext.js +4 -0
- package/dist/shell-native/system-bars.d.ts +5 -1
- package/dist/shell-native/system-bars.js +1 -1
- package/dist/ui/dropdown-menu.js +2 -0
- package/dist/ui/popover.js +1 -0
- package/dist/ui/select.js +1 -0
- package/package.json +1 -1
- package/src/shared/tokens/build/themes.css +266 -0
- package/src/shared/tokens/display-settings.css +569 -0
- package/src/shared/tokens/tokens.css +4 -0
|
@@ -24,139 +24,139 @@ import { AssistantModeMenu as ye } from "./AssistantModeMenu.js";
|
|
|
24
24
|
import { AssistantViewSwitchRow as be } from "../compact/AssistantViewSwitchRow.js";
|
|
25
25
|
import { compactEnterSends as xe, isImeComposingEnter as Se } from "./imeEnter.js";
|
|
26
26
|
import { PAGE_COLUMN as Ce, useAssistantPageBox as we, useAssistantPageLayout as Te, useAssistantTallBox as Ee } from "../assistantPageLayout.js";
|
|
27
|
-
import { useCallback as s, useEffect as c, useId as
|
|
28
|
-
import { ArrowUp as
|
|
29
|
-
import { Fragment as
|
|
27
|
+
import { useCallback as s, useEffect as c, useId as l, useLayoutEffect as De, useMemo as Oe, useRef as u, useState as d } from "react";
|
|
28
|
+
import { ArrowUp as ke, Loader2 as f, Square as Ae } from "lucide-react";
|
|
29
|
+
import { Fragment as je, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
30
30
|
// src/shared/assistant/ui/composer/AssistantComposer.tsx
|
|
31
|
-
var
|
|
32
|
-
function
|
|
31
|
+
var Me = 200;
|
|
32
|
+
function Ne(e) {
|
|
33
33
|
if (!e) return !1;
|
|
34
34
|
let t = e.ownerDocument.activeElement;
|
|
35
35
|
return !t || t === e.ownerDocument.body ? !1 : e.contains(t) ? !0 : e.closest("[data-assistant-panel]")?.contains(t) ?? !1;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
let
|
|
37
|
+
var Pe = ({ children: e }) => e(l()), Fe = ({ writeAccessDenied: l = !1, onSend: Fe, disabled: Ie = !1, readOnly: Le = !1, placeholder: Re, mode: ze, availableModes: Be, attachmentCharsPerFile: Ve, onModeChange: He, auto: Ue, onStartVoiceSession: h, onDraftStart: We, onDraftChange: Ge, suspendDictation: Ke = !1, entrance: qe = !1, onVoiceStateChange: Je, presentation: Ye = "classic", turnInFlight: g = !1, onStop: Xe, turnId: Ze, modeDisabledReason: Qe = null, inputRef: _, aboveCard: $e, viewSwitch: et, modeReadOnly: v = !1, voiceSessionActive: y = !1, concealed: tt = !1 }) => {
|
|
38
|
+
let b = r(), nt = Te(), x = we(), rt = Ee(), { locale: S } = n(), C = Ie || Le, w = Ye === "compact", T = u(null), it = s((e) => {
|
|
39
|
+
T.current = e, typeof _ == "function" ? _(e) : _ && (_.current = e);
|
|
40
|
+
}, [_]), [E, D] = d(""), [O, at] = d(!1), [k, ot] = d(!1), st = u(!1), [A, j] = d(null), [ct, M] = d(null), [N, P] = d(null), [lt, ut] = d(g);
|
|
41
|
+
lt === g ? N !== null && g && Ze != null && Ze !== N && P(null) : (ut(g), g ? (M(null), P(null)) : N !== null && (M(N), P(null)));
|
|
42
|
+
let dt = u(!1), F = u(null), ft = u(!1), pt = u(!1), mt = u(null), I = u(!1), L = u(0), { attachments: R, isBusy: ht, preparingCount: gt, sendBlocker: _t, rejection: vt, addFiles: z, remove: yt, retry: bt, clear: xt, clearRejection: St, canAddMore: Ct, commit: wt, cancelCommit: Tt } = te({ perFileChars: Ve }), B = E.trim() !== "" || R.length > 0, Et = u(!1), V = u(!1);
|
|
43
43
|
c(() => {
|
|
44
|
-
|
|
45
|
-
}, [
|
|
46
|
-
|
|
47
|
-
text:
|
|
48
|
-
hasAttachments:
|
|
49
|
-
dictated:
|
|
44
|
+
B && !Et.current ? (Et.current = !0, We?.()) : B || (Et.current = !1);
|
|
45
|
+
}, [B, We]), c(() => {
|
|
46
|
+
B || (V.current = !1), Ge?.({
|
|
47
|
+
text: E,
|
|
48
|
+
hasAttachments: R.length > 0,
|
|
49
|
+
dictated: V.current
|
|
50
50
|
});
|
|
51
51
|
}, [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
E,
|
|
53
|
+
R.length,
|
|
54
|
+
B,
|
|
55
|
+
Ge
|
|
56
56
|
]);
|
|
57
|
-
let
|
|
58
|
-
|
|
59
|
-
}, []),
|
|
60
|
-
onFinalize: (e) =>
|
|
61
|
-
onEnded: () =>
|
|
62
|
-
language:
|
|
63
|
-
deviceId:
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
}, []),
|
|
67
|
-
enabled:
|
|
68
|
-
voice:
|
|
69
|
-
text:
|
|
70
|
-
setText:
|
|
71
|
-
textareaRef:
|
|
72
|
-
markDictated:
|
|
73
|
-
deviceId:
|
|
74
|
-
}),
|
|
57
|
+
let H = s((e) => {
|
|
58
|
+
V.current = !0, D((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
|
|
59
|
+
}, []), Dt = a((e) => e.assistantLanguage), Ot = Oe(() => ee(Dt, S), [Dt, S]), kt = u(H), At = u(() => void 0), jt = a((e) => e.micDeviceId), U = o({
|
|
60
|
+
onFinalize: (e) => kt.current(e),
|
|
61
|
+
onEnded: () => At.current(),
|
|
62
|
+
language: Ot.tag,
|
|
63
|
+
deviceId: jt
|
|
64
|
+
}), Mt = s(() => {
|
|
65
|
+
V.current = !0;
|
|
66
|
+
}, []), W = pe({
|
|
67
|
+
enabled: w,
|
|
68
|
+
voice: U,
|
|
69
|
+
text: E,
|
|
70
|
+
setText: D,
|
|
71
|
+
textareaRef: T,
|
|
72
|
+
markDictated: Mt,
|
|
73
|
+
deviceId: jt
|
|
74
|
+
}), Nt = W.addFinal;
|
|
75
75
|
c(() => {
|
|
76
|
-
|
|
76
|
+
kt.current = w ? Nt : H;
|
|
77
77
|
}, [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
w,
|
|
79
|
+
Nt,
|
|
80
|
+
H
|
|
81
81
|
]);
|
|
82
|
-
let
|
|
82
|
+
let Pt = W.recogniserEnded;
|
|
83
83
|
c(() => {
|
|
84
|
-
|
|
85
|
-
}, [
|
|
86
|
-
let
|
|
84
|
+
At.current = w ? Pt : () => void 0;
|
|
85
|
+
}, [w, Pt]);
|
|
86
|
+
let G = U.isActive, Ft = U.interim, It = U.stop, Lt = W.keepAndStop;
|
|
87
87
|
c(() => {
|
|
88
|
-
|
|
88
|
+
Ke && G && (w ? Lt() : (Ft.trim() !== "" && H(Ft.trim()), It()));
|
|
89
89
|
}, [
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
Ke,
|
|
91
|
+
G,
|
|
92
|
+
Ft,
|
|
92
93
|
It,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
Rt
|
|
94
|
+
H,
|
|
95
|
+
w,
|
|
96
|
+
Lt
|
|
97
97
|
]), c(() => {
|
|
98
|
-
|
|
99
|
-
committing:
|
|
100
|
-
dictating:
|
|
98
|
+
Je?.({
|
|
99
|
+
committing: k,
|
|
100
|
+
dictating: G
|
|
101
101
|
});
|
|
102
102
|
}, [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
Je,
|
|
104
|
+
k,
|
|
105
|
+
G
|
|
106
106
|
]);
|
|
107
|
-
let
|
|
108
|
-
|
|
109
|
-
let t =
|
|
107
|
+
let Rt = se((e) => e.pending), zt = Rt ? b("askAbout.placeholder", "Ask about {{name}}…", { name: Rt.label }) : Re ?? b("composer.placeholder", "Ask me anything…"), Bt = se((e) => e.focusRequested), Vt = (e) => {
|
|
108
|
+
D(e), requestAnimationFrame(() => {
|
|
109
|
+
let t = T.current;
|
|
110
110
|
t && (t.focus({ preventScroll: !0 }), t.setSelectionRange(e.length, e.length));
|
|
111
111
|
});
|
|
112
112
|
};
|
|
113
113
|
c(() => {
|
|
114
|
-
if (!
|
|
115
|
-
let e =
|
|
114
|
+
if (!Bt || C) return;
|
|
115
|
+
let e = T.current;
|
|
116
116
|
e && (e.focus({ preventScroll: !0 }), se.getState().actions.composerFocused());
|
|
117
|
-
}, [
|
|
118
|
-
let
|
|
119
|
-
|
|
120
|
-
let
|
|
121
|
-
c(() => (
|
|
122
|
-
|
|
117
|
+
}, [Bt, C]);
|
|
118
|
+
let K = E.trim(), q = ne(R), Ht = R.filter((e) => e.status === "error"), J = (K.length > 0 || q.length > 0) && !C && !k && _t === null, Ut = q.some((e) => !(e.fileId && e.downloadUrl) && !e.inlineOnly), Wt = u(C);
|
|
119
|
+
Wt.current = C;
|
|
120
|
+
let Y = u(!0);
|
|
121
|
+
c(() => (Y.current = !0, () => {
|
|
122
|
+
Y.current = !1;
|
|
123
123
|
}), []);
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
let e =
|
|
127
|
-
e && !
|
|
124
|
+
let Gt = w && rt ? qe ? "start" : "chat" : null, X = w && U.isSupported && !y && W.phase !== "idle";
|
|
125
|
+
De(() => {
|
|
126
|
+
let e = T.current;
|
|
127
|
+
e && !X && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, Me)}px`);
|
|
128
128
|
}, [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
E,
|
|
130
|
+
Gt,
|
|
131
|
+
X
|
|
132
132
|
]);
|
|
133
|
-
let
|
|
134
|
-
if (!
|
|
135
|
-
|
|
136
|
-
let e =
|
|
137
|
-
|
|
138
|
-
let t =
|
|
139
|
-
if (!
|
|
140
|
-
|
|
133
|
+
let Z = s(async () => {
|
|
134
|
+
if (!J || st.current) return;
|
|
135
|
+
U.isActive && U.stop();
|
|
136
|
+
let e = E.trim();
|
|
137
|
+
j(null);
|
|
138
|
+
let t = w && Ne(mt.current);
|
|
139
|
+
if (!Ut) {
|
|
140
|
+
I.current = t, Fe(e, q), D(""), xt();
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
let n = a.getState().activeConversationId;
|
|
144
|
-
|
|
144
|
+
st.current = !0, ot(!0);
|
|
145
145
|
try {
|
|
146
|
-
let r = await
|
|
147
|
-
if (!
|
|
146
|
+
let r = await wt();
|
|
147
|
+
if (!Y.current) {
|
|
148
148
|
r.ok && await r.rollback();
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
151
|
if (!r.ok) {
|
|
152
|
-
r.cancelled ||
|
|
152
|
+
r.cancelled || j({
|
|
153
153
|
kind: "failed",
|
|
154
154
|
failures: r.failures
|
|
155
155
|
});
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
-
if (
|
|
159
|
-
await r.rollback(),
|
|
158
|
+
if (Wt.current) {
|
|
159
|
+
await r.rollback(), Y.current && j({
|
|
160
160
|
kind: "busy",
|
|
161
161
|
failures: []
|
|
162
162
|
});
|
|
@@ -164,355 +164,356 @@ var Fe = ({ children: e }) => e(De()), m = ({ writeAccessDenied: De = !1, onSend
|
|
|
164
164
|
}
|
|
165
165
|
let i = a.getState();
|
|
166
166
|
if (i.activeConversationId !== n || n !== null && !i.conversations.some((e) => e.id === n)) {
|
|
167
|
-
await r.rollback(),
|
|
167
|
+
await r.rollback(), Y.current && j({
|
|
168
168
|
kind: "moved",
|
|
169
169
|
failures: []
|
|
170
170
|
});
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
|
|
173
|
+
I.current = t, Fe(e, ne(r.attachments)), r.handedOver(), D(""), xt();
|
|
174
174
|
} finally {
|
|
175
|
-
|
|
175
|
+
st.current = !1, Y.current && ot(!1);
|
|
176
176
|
}
|
|
177
177
|
}, [
|
|
178
|
+
J,
|
|
179
|
+
Ut,
|
|
180
|
+
wt,
|
|
181
|
+
Fe,
|
|
182
|
+
E,
|
|
178
183
|
q,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
C
|
|
187
|
-
]), qt = s(() => {
|
|
188
|
-
Et(), w.current?.focus();
|
|
189
|
-
}, [Et]), Z = s(() => {
|
|
190
|
-
Gt.current ? ft.current = !0 : w.current?.focus();
|
|
184
|
+
xt,
|
|
185
|
+
U,
|
|
186
|
+
w
|
|
187
|
+
]), Kt = s(() => {
|
|
188
|
+
Tt(), T.current?.focus();
|
|
189
|
+
}, [Tt]), qt = s(() => {
|
|
190
|
+
Wt.current ? dt.current = !0 : T.current?.focus();
|
|
191
191
|
}, []), Jt = s(() => {
|
|
192
|
-
if (
|
|
193
|
-
let e =
|
|
194
|
-
e !== null && (
|
|
195
|
-
}, [
|
|
192
|
+
if (pt.current) return;
|
|
193
|
+
let e = Xe?.() ?? null;
|
|
194
|
+
e !== null && (pt.current = !0, P(e)), qt();
|
|
195
|
+
}, [Xe, qt]);
|
|
196
196
|
c(() => {
|
|
197
|
-
!
|
|
198
|
-
}, [
|
|
197
|
+
!C && dt.current && (dt.current = !1, T.current?.focus());
|
|
198
|
+
}, [C]);
|
|
199
199
|
let Yt = s((e) => {
|
|
200
200
|
if (e !== null) {
|
|
201
|
-
|
|
201
|
+
F.current = e;
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
|
-
let t =
|
|
205
|
-
|
|
206
|
-
}, []), Q =
|
|
207
|
-
|
|
208
|
-
!Q &&
|
|
209
|
-
}, [Q,
|
|
210
|
-
|
|
211
|
-
}, [
|
|
204
|
+
let t = F.current;
|
|
205
|
+
F.current = null, t !== null && t.ownerDocument.activeElement === t && (ft.current = !0);
|
|
206
|
+
}, []), Q = w && g && Xe !== void 0;
|
|
207
|
+
De(() => {
|
|
208
|
+
!Q && ft.current && (ft.current = !1, qt());
|
|
209
|
+
}, [Q, qt]), c(() => {
|
|
210
|
+
N === null && (pt.current = !1);
|
|
211
|
+
}, [N]), De(() => {
|
|
212
212
|
if (!Q) return;
|
|
213
|
-
let e =
|
|
214
|
-
if (
|
|
215
|
-
let t =
|
|
213
|
+
let e = I.current;
|
|
214
|
+
if (I.current = !1, !e) return;
|
|
215
|
+
let t = F.current;
|
|
216
216
|
if (t === null) return;
|
|
217
217
|
let n = t.ownerDocument, r = n.activeElement;
|
|
218
|
-
(r === null || r === n.body || r ===
|
|
218
|
+
(r === null || r === n.body || r === T.current) && t.focus({ preventScroll: !0 });
|
|
219
219
|
}, [Q]);
|
|
220
220
|
let Xt = s((e) => {
|
|
221
|
-
|
|
221
|
+
D(e), M(null);
|
|
222
222
|
}, []);
|
|
223
223
|
c(() => {
|
|
224
|
-
|
|
225
|
-
}, [
|
|
224
|
+
j(null);
|
|
225
|
+
}, [R.length]);
|
|
226
226
|
let Zt = (t) => {
|
|
227
|
-
if (t.kind === "busy") return
|
|
228
|
-
if (t.kind === "moved") return
|
|
227
|
+
if (t.kind === "busy") return b("attachments.saveBusy", "The assistant started another reply, so nothing was sent. Your message and files are still here.");
|
|
228
|
+
if (t.kind === "moved") return b("attachments.saveMoved", "You switched conversations while the files were being saved, so nothing was sent. Your message and files are still here.");
|
|
229
229
|
let { failures: n } = t;
|
|
230
|
-
if (n.some((e) => e.code === re.editorAccessRequired)) return e(
|
|
231
|
-
if (n.some((e) => e.code === re.quotaExceeded || e.code === re.quotaNotProvisioned)) return `${
|
|
232
|
-
let r = n[0], i =
|
|
233
|
-
return `${n.length <= 1 ?
|
|
230
|
+
if (n.some((e) => e.code === re.editorAccessRequired)) return e(b, S);
|
|
231
|
+
if (n.some((e) => e.code === re.quotaExceeded || e.code === re.quotaNotProvisioned)) return `${b("attachments.quotaFull", "File storage is full or not set up for this workspace, so the attachments couldn't be saved. Nothing was sent.")} ${b("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
|
|
232
|
+
let r = n[0], i = R.find((e) => e.id === r?.id)?.filename ?? "";
|
|
233
|
+
return `${n.length <= 1 ? b("attachments.saveFailedOne", "{{name}} couldn't be saved, so nothing was sent.", { name: i }) : b("attachments.saveFailedMany", "{{count}} attachments couldn't be saved, so nothing was sent.", { count: n.length })} ${b("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
|
|
234
234
|
}, Qt = s((e) => {
|
|
235
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(),
|
|
236
|
-
}, [
|
|
237
|
-
e.key === "Escape" ? Se(e) && e.stopPropagation() : xe(e) && (e.preventDefault(),
|
|
238
|
-
}, [
|
|
235
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Z());
|
|
236
|
+
}, [Z]), $t = s((e) => {
|
|
237
|
+
e.key === "Escape" ? Se(e) && e.stopPropagation() : xe(e) && (e.preventDefault(), M(null), Z());
|
|
238
|
+
}, [Z]), en = s((e) => {
|
|
239
239
|
let t = Array.from(e.clipboardData?.files ?? []);
|
|
240
|
-
t.length !== 0 && (e.preventDefault(),
|
|
241
|
-
}, [
|
|
242
|
-
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (
|
|
240
|
+
t.length !== 0 && (e.preventDefault(), z(t));
|
|
241
|
+
}, [z]), tn = s((e) => {
|
|
242
|
+
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (L.current += 1, at(!0));
|
|
243
243
|
}, []), nn = s(() => {
|
|
244
|
-
|
|
244
|
+
L.current = Math.max(0, L.current - 1), L.current === 0 && at(!1);
|
|
245
245
|
}, []), rn = s((e) => {
|
|
246
246
|
Array.from(e.dataTransfer?.types ?? []).includes("Files") && e.preventDefault();
|
|
247
247
|
}, []), an = s((e) => {
|
|
248
|
-
e.preventDefault(),
|
|
249
|
-
}, [
|
|
248
|
+
e.preventDefault(), L.current = 0, at(!1), z(e.dataTransfer?.files ?? null);
|
|
249
|
+
}, [z]), on = (e) => {
|
|
250
250
|
switch (e) {
|
|
251
|
-
case "too-many": return
|
|
252
|
-
case "too-large": return
|
|
253
|
-
case "empty": return
|
|
254
|
-
case "unreadable": return
|
|
255
|
-
case "unsupported-image": return
|
|
256
|
-
case "too-large-to-save": return
|
|
251
|
+
case "too-many": return b("attachments.tooMany", "You can attach up to {{max}} files per message.", { max: 5 });
|
|
252
|
+
case "too-large": return b("attachments.tooLarge", "That file is larger than 10 MB.");
|
|
253
|
+
case "empty": return b("attachments.empty", "That file is empty.");
|
|
254
|
+
case "unreadable": return b("attachments.unreadable", "That file could not be read.");
|
|
255
|
+
case "unsupported-image": return b("attachments.unsupportedImage", "This device can't read that image format, so it can't be resized to send. Save it as JPEG and try again.");
|
|
256
|
+
case "too-large-to-save": return b("attachments.tooLargeToSave", "That file is over 5 MB, so it can't be saved to Files, and no text could be read from it.");
|
|
257
257
|
}
|
|
258
258
|
}, $ = (() => {
|
|
259
|
-
switch (
|
|
260
|
-
case "not-allowed": return
|
|
261
|
-
case "audio-capture": return
|
|
262
|
-
case "network": return
|
|
263
|
-
case "language-not-supported": return
|
|
264
|
-
case "unknown": return
|
|
259
|
+
switch (U.error) {
|
|
260
|
+
case "not-allowed": return b("voice.denied", "Microphone access is blocked. Allow it in your browser settings to dictate.");
|
|
261
|
+
case "audio-capture": return b("voice.noMic", "No microphone was found.");
|
|
262
|
+
case "network": return b("voice.network", "Speech recognition is offline right now.");
|
|
263
|
+
case "language-not-supported": return b("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language: i(U.language, S) });
|
|
264
|
+
case "unknown": return b("voice.failed", "Dictation stopped unexpectedly.");
|
|
265
265
|
default: return null;
|
|
266
266
|
}
|
|
267
|
-
})(), sn = (e, n, r = !1) =>
|
|
268
|
-
onDismiss:
|
|
269
|
-
children: /* @__PURE__ */
|
|
267
|
+
})(), sn = (e, n, r = !1) => k ? /* @__PURE__ */ p(t, {
|
|
268
|
+
onDismiss: Kt,
|
|
269
|
+
children: /* @__PURE__ */ m("p", {
|
|
270
270
|
className: "flex items-center justify-center gap-2 text-text-muted",
|
|
271
271
|
"data-testid": "assistant-commit-status",
|
|
272
272
|
children: [
|
|
273
|
-
/* @__PURE__ */ f
|
|
273
|
+
/* @__PURE__ */ p(f, {
|
|
274
274
|
className: "size-3 motion-safe:animate-spin",
|
|
275
275
|
"aria-hidden": "true"
|
|
276
276
|
}),
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ p("span", { children: b("attachments.saving", "Saving your attachments…") }),
|
|
278
|
+
/* @__PURE__ */ p("button", {
|
|
279
279
|
type: "button",
|
|
280
|
-
onClick:
|
|
280
|
+
onClick: Kt,
|
|
281
281
|
className: "rounded text-text-primary underline underline-offset-2 hover:text-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
282
282
|
"data-testid": "assistant-commit-cancel",
|
|
283
|
-
children:
|
|
283
|
+
children: b("attachments.cancelSaving", "Cancel")
|
|
284
284
|
})
|
|
285
285
|
]
|
|
286
286
|
})
|
|
287
|
-
}) :
|
|
287
|
+
}) : A ? /* @__PURE__ */ p("p", {
|
|
288
288
|
className: "text-status-error-text",
|
|
289
289
|
role: "alert",
|
|
290
290
|
"data-testid": "assistant-commit-failed",
|
|
291
|
-
children: Zt(
|
|
292
|
-
}) : !r &&
|
|
291
|
+
children: Zt(A)
|
|
292
|
+
}) : !r && U.isStarting && !U.isListening ? /* @__PURE__ */ p("p", {
|
|
293
293
|
className: "text-text-muted",
|
|
294
294
|
"data-testid": "assistant-voice-starting",
|
|
295
|
-
children:
|
|
296
|
-
}) : !r &&
|
|
295
|
+
children: b("voice.starting", "Starting the microphone…")
|
|
296
|
+
}) : !r && U.isListening ? /* @__PURE__ */ m("p", {
|
|
297
297
|
className: "text-status-error-text",
|
|
298
298
|
"data-testid": "assistant-voice-status",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
300
|
-
}) : $ ? /* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ p(le, {}), U.interim || b("voice.listening", "Listening… speak now, tap the square to stop")]
|
|
300
|
+
}) : $ ? /* @__PURE__ */ p("p", {
|
|
301
301
|
className: "text-status-error-text",
|
|
302
302
|
"data-testid": "assistant-voice-error",
|
|
303
303
|
children: $
|
|
304
|
-
}) :
|
|
304
|
+
}) : vt ? /* @__PURE__ */ p("button", {
|
|
305
305
|
type: "button",
|
|
306
|
-
onClick:
|
|
306
|
+
onClick: St,
|
|
307
307
|
className: "text-status-error-text underline-offset-2 hover:underline",
|
|
308
308
|
"data-testid": "assistant-attachment-rejection",
|
|
309
|
-
children: on(
|
|
310
|
-
}) :
|
|
309
|
+
children: on(vt)
|
|
310
|
+
}) : _t === "failed" ? /* @__PURE__ */ p("p", {
|
|
311
311
|
className: "text-status-error-text",
|
|
312
312
|
"data-testid": "assistant-attachment-blocked",
|
|
313
|
-
children:
|
|
314
|
-
}) : n ? /* @__PURE__ */
|
|
313
|
+
children: Ht.length === 1 ? b("attachments.blockedOne", "{{name}} didn't upload. Retry or remove it before sending.", { name: Ht[0].filename }) : b("attachments.blockedMany", "{{count}} attachments didn't upload. Retry or remove them before sending.", { count: Ht.length })
|
|
314
|
+
}) : n ? /* @__PURE__ */ p("p", {
|
|
315
315
|
className: "text-text-muted",
|
|
316
316
|
"data-testid": "assistant-stopping-status",
|
|
317
|
-
children:
|
|
318
|
-
}) : e ? /* @__PURE__ */
|
|
317
|
+
children: b("composer.stopping", "Stopping the reply…")
|
|
318
|
+
}) : e ? /* @__PURE__ */ p("p", {
|
|
319
319
|
className: "text-text-muted",
|
|
320
320
|
"data-testid": "assistant-stop-status",
|
|
321
|
-
children:
|
|
322
|
-
}) : /* @__PURE__ */
|
|
321
|
+
children: b("composer.stopped", "Reply stopped.")
|
|
322
|
+
}) : /* @__PURE__ */ p("p", {
|
|
323
323
|
className: "text-text-muted",
|
|
324
|
-
children:
|
|
324
|
+
children: b("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
|
|
325
325
|
});
|
|
326
|
-
if (
|
|
327
|
-
let e =
|
|
328
|
-
return /* @__PURE__ */
|
|
329
|
-
ref:
|
|
330
|
-
className: `${
|
|
326
|
+
if (w) {
|
|
327
|
+
let e = h !== void 0 && K.length === 0 && R.length === 0 && !U.isActive, n = b("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach"), r = U.error === "not-allowed" || U.error === "audio-capture", i = !!(k || A || $ || vt || _t === "failed" || ct !== null || N !== null), ee = W.nothingHeard && !i, a = fe(Gt), o = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-elevated)]";
|
|
328
|
+
return /* @__PURE__ */ p(Pe, { children: (te) => /* @__PURE__ */ m("div", {
|
|
329
|
+
ref: mt,
|
|
330
|
+
className: `${nt ? `flex-shrink-0 px-3 pt-1.5 ${Ce}` : "flex-shrink-0 px-3 pt-1.5"}${tt ? " hidden" : ""}`,
|
|
331
331
|
children: [
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
voiceLive:
|
|
335
|
-
children:
|
|
332
|
+
$e,
|
|
333
|
+
et ? /* @__PURE__ */ p(be, {
|
|
334
|
+
voiceLive: y,
|
|
335
|
+
children: et
|
|
336
336
|
}) : null,
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
className: i || ee ||
|
|
337
|
+
/* @__PURE__ */ m("div", {
|
|
338
|
+
className: i || ee || l ? "mb-1.5 px-1 text-center text-xs" : "",
|
|
339
339
|
"aria-live": "polite",
|
|
340
340
|
"data-testid": "assistant-composer-status",
|
|
341
341
|
children: [
|
|
342
|
-
|
|
342
|
+
l ? /* @__PURE__ */ p("p", {
|
|
343
343
|
className: "text-status-warning",
|
|
344
344
|
"data-testid": "assistant-write-access-warning",
|
|
345
|
-
children:
|
|
345
|
+
children: b("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
|
|
346
346
|
}) : null,
|
|
347
|
-
r && $ && !
|
|
347
|
+
r && $ && !k && !A ? /* @__PURE__ */ p(ge, {
|
|
348
348
|
message: $,
|
|
349
349
|
onTryAgain: () => {
|
|
350
|
-
|
|
350
|
+
U.clearError(), W.start();
|
|
351
351
|
}
|
|
352
|
-
}) : ee ? /* @__PURE__ */
|
|
352
|
+
}) : ee ? /* @__PURE__ */ p("p", {
|
|
353
353
|
className: "text-text-secondary",
|
|
354
354
|
"data-testid": "assistant-dictation-nothing-heard",
|
|
355
|
-
children:
|
|
356
|
-
}) : i ? sn(
|
|
357
|
-
|
|
355
|
+
children: b("dictation.nothingHeard", "Nothing was heard. Check the microphone and try again.")
|
|
356
|
+
}) : i ? sn(ct !== null, N !== null, !0) : null,
|
|
357
|
+
X && U.isListening ? /* @__PURE__ */ p("span", {
|
|
358
358
|
className: "sr-only",
|
|
359
359
|
"data-testid": "assistant-dictation-announced",
|
|
360
|
-
children:
|
|
360
|
+
children: b("voiceSession.listening", "Listening…")
|
|
361
361
|
}) : null
|
|
362
362
|
]
|
|
363
363
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ p("p", {
|
|
365
365
|
id: te,
|
|
366
366
|
hidden: !0,
|
|
367
367
|
"data-testid": "assistant-composer-hint",
|
|
368
368
|
children: n
|
|
369
369
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ m("div", {
|
|
371
371
|
onDragEnter: tn,
|
|
372
372
|
onDragLeave: nn,
|
|
373
373
|
onDragOver: rn,
|
|
374
374
|
onDrop: an,
|
|
375
|
-
className: `flex flex-col rounded-3xl border transition-colors ${
|
|
376
|
-
hearing:
|
|
377
|
-
quiet: Le ||
|
|
378
|
-
entrance:
|
|
375
|
+
className: `flex flex-col rounded-3xl border transition-colors ${X && W.phase === "listening" ? "border-status-warning-bg ring-1 ring-status-warning-bg" : "focus-within:border-[var(--color-focus-ring)] focus-within:ring-1 focus-within:ring-[var(--color-focus-ring)]"} ${v ? "bg-bg-surface" : "bg-bg-elevated"} ${X && W.phase !== "transcribing" ? "" : O ? "border-dashed border-[var(--color-focus-ring)]" : "border-[var(--color-text-muted)]"} ${de(x, {
|
|
376
|
+
hearing: X && W.phase === "listening",
|
|
377
|
+
quiet: Le || v || O,
|
|
378
|
+
entrance: qe
|
|
379
379
|
})}`,
|
|
380
|
-
"data-dictating":
|
|
380
|
+
"data-dictating": X ? W.phase : void 0,
|
|
381
381
|
"data-testid": "assistant-composer",
|
|
382
382
|
"data-presentation": "compact",
|
|
383
|
+
"data-glass-surface": v ? "" : "elevated",
|
|
383
384
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ p("div", {
|
|
385
386
|
className: "px-3 pt-3 empty:hidden",
|
|
386
|
-
children: /* @__PURE__ */
|
|
387
|
-
disabled:
|
|
388
|
-
showSuggestions:
|
|
389
|
-
onSuggest:
|
|
390
|
-
}), /* @__PURE__ */
|
|
391
|
-
attachments:
|
|
392
|
-
onRemove:
|
|
393
|
-
onRetry:
|
|
394
|
-
disabled:
|
|
395
|
-
preparingCount:
|
|
387
|
+
children: /* @__PURE__ */ m(je, { children: [/* @__PURE__ */ p(oe, {
|
|
388
|
+
disabled: k,
|
|
389
|
+
showSuggestions: K.length === 0,
|
|
390
|
+
onSuggest: Vt
|
|
391
|
+
}), /* @__PURE__ */ p(ae, {
|
|
392
|
+
attachments: R,
|
|
393
|
+
onRemove: yt,
|
|
394
|
+
onRetry: bt,
|
|
395
|
+
disabled: C || k,
|
|
396
|
+
preparingCount: gt
|
|
396
397
|
})] })
|
|
397
398
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
ref:
|
|
400
|
-
value:
|
|
399
|
+
/* @__PURE__ */ p("textarea", {
|
|
400
|
+
ref: it,
|
|
401
|
+
value: E,
|
|
401
402
|
onChange: (e) => Xt(e.target.value),
|
|
402
403
|
onKeyDown: $t,
|
|
403
404
|
onPaste: en,
|
|
404
|
-
disabled:
|
|
405
|
-
readOnly:
|
|
406
|
-
"aria-busy":
|
|
407
|
-
placeholder:
|
|
405
|
+
disabled: C,
|
|
406
|
+
readOnly: k,
|
|
407
|
+
"aria-busy": k || void 0,
|
|
408
|
+
placeholder: O ? b("composer.dropHere", "Drop files to attach") : zt,
|
|
408
409
|
rows: 1,
|
|
409
|
-
className: `scrollbar-slim scrollbar-box ${a.minHeight} w-[calc(100%-0.375rem)] resize-none bg-transparent pb-1 pe-2.5 ps-4 ${a.paddingTop} text-base ${a.lineHeight} text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50${
|
|
410
|
+
className: `scrollbar-slim scrollbar-box ${a.minHeight} w-[calc(100%-0.375rem)] resize-none bg-transparent pb-1 pe-2.5 ps-4 ${a.paddingTop} text-base ${a.lineHeight} text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50${X ? " hidden" : ""}`,
|
|
410
411
|
"aria-describedby": te,
|
|
411
412
|
title: n,
|
|
412
|
-
"aria-label":
|
|
413
|
+
"aria-label": b("chatInput.ariaLabel", "Message input"),
|
|
413
414
|
"data-testid": "assistant-input"
|
|
414
415
|
}),
|
|
415
|
-
|
|
416
|
-
size:
|
|
417
|
-
phase:
|
|
418
|
-
before:
|
|
419
|
-
take:
|
|
420
|
-
interim:
|
|
421
|
-
after:
|
|
416
|
+
X ? /* @__PURE__ */ p(he, {
|
|
417
|
+
size: Gt,
|
|
418
|
+
phase: W.phase,
|
|
419
|
+
before: W.before,
|
|
420
|
+
take: W.take,
|
|
421
|
+
interim: W.interim,
|
|
422
|
+
after: W.after
|
|
422
423
|
}) : null,
|
|
423
|
-
|
|
424
|
-
phase:
|
|
425
|
-
seconds:
|
|
426
|
-
level:
|
|
427
|
-
onCancel:
|
|
428
|
-
onFinish:
|
|
424
|
+
X ? W.phase === "transcribing" ? /* @__PURE__ */ p(me, {
|
|
425
|
+
phase: W.phase,
|
|
426
|
+
seconds: W.seconds,
|
|
427
|
+
level: W.level,
|
|
428
|
+
onCancel: W.cancel,
|
|
429
|
+
onFinish: W.finish,
|
|
429
430
|
focusRing: o
|
|
430
|
-
}) : /* @__PURE__ */
|
|
431
|
-
onDismiss:
|
|
432
|
-
children: /* @__PURE__ */
|
|
431
|
+
}) : /* @__PURE__ */ p(t, {
|
|
432
|
+
onDismiss: W.cancel,
|
|
433
|
+
children: /* @__PURE__ */ p("div", {
|
|
433
434
|
className: "contents",
|
|
434
|
-
children: /* @__PURE__ */
|
|
435
|
-
phase:
|
|
436
|
-
seconds:
|
|
437
|
-
level:
|
|
438
|
-
onCancel:
|
|
439
|
-
onFinish:
|
|
435
|
+
children: /* @__PURE__ */ p(me, {
|
|
436
|
+
phase: W.phase,
|
|
437
|
+
seconds: W.seconds,
|
|
438
|
+
level: W.level,
|
|
439
|
+
onCancel: W.cancel,
|
|
440
|
+
onFinish: W.finish,
|
|
440
441
|
focusRing: o
|
|
441
442
|
})
|
|
442
443
|
})
|
|
443
|
-
}) : /* @__PURE__ */
|
|
444
|
+
}) : /* @__PURE__ */ m("div", {
|
|
444
445
|
className: "flex flex-nowrap items-center gap-1 px-1.5 pb-1.5 pt-1",
|
|
445
446
|
"data-testid": "assistant-composer-controls",
|
|
446
447
|
children: [
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
onFiles:
|
|
449
|
-
canAddMore:
|
|
450
|
-
disabled:
|
|
448
|
+
/* @__PURE__ */ p(ie, {
|
|
449
|
+
onFiles: z,
|
|
450
|
+
canAddMore: Ct,
|
|
451
|
+
disabled: C || k,
|
|
451
452
|
compact: !0,
|
|
452
453
|
capMenuHeight: !0
|
|
453
454
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ p(ye, {
|
|
455
456
|
chip: !0,
|
|
456
|
-
readOnly:
|
|
457
|
+
readOnly: v,
|
|
457
458
|
mode: ze,
|
|
458
|
-
availableModes:
|
|
459
|
-
onModeChange:
|
|
460
|
-
auto:
|
|
461
|
-
disabled:
|
|
462
|
-
disabledReason:
|
|
459
|
+
availableModes: Be,
|
|
460
|
+
onModeChange: He,
|
|
461
|
+
auto: Ue,
|
|
462
|
+
disabled: C || k,
|
|
463
|
+
disabledReason: N === null ? g ? "replying" : Qe ?? "busy" : "busy"
|
|
463
464
|
}),
|
|
464
|
-
|
|
465
|
+
x && r ? /* @__PURE__ */ p("span", {
|
|
465
466
|
className: "ms-1 hidden min-w-0 truncate text-xs text-text-secondary sm:block",
|
|
466
467
|
"data-testid": "assistant-mic-summary",
|
|
467
|
-
children:
|
|
468
|
+
children: b("dictation.noMicrophone", "No microphone available")
|
|
468
469
|
}) : null,
|
|
469
|
-
/* @__PURE__ */
|
|
470
|
-
|
|
471
|
-
onDictate:
|
|
470
|
+
/* @__PURE__ */ p("div", { className: "min-w-0 flex-1" }),
|
|
471
|
+
U.isSupported && !y ? x ? /* @__PURE__ */ p(_e, {
|
|
472
|
+
onDictate: W.start,
|
|
472
473
|
blocked: r,
|
|
473
|
-
disabled:
|
|
474
|
-
}) : /* @__PURE__ */
|
|
474
|
+
disabled: C || k
|
|
475
|
+
}) : /* @__PURE__ */ p(ce, {
|
|
475
476
|
compact: !0,
|
|
476
|
-
isListening:
|
|
477
|
-
isStarting:
|
|
478
|
-
onToggle:
|
|
479
|
-
disabled:
|
|
477
|
+
isListening: U.isListening,
|
|
478
|
+
isStarting: U.isStarting,
|
|
479
|
+
onToggle: W.start,
|
|
480
|
+
disabled: C || k
|
|
480
481
|
}) : null,
|
|
481
|
-
Q ? /* @__PURE__ */
|
|
482
|
+
Q ? /* @__PURE__ */ p("button", {
|
|
482
483
|
ref: Yt,
|
|
483
484
|
type: "button",
|
|
484
485
|
onClick: Jt,
|
|
485
|
-
className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover ${o} ${
|
|
486
|
-
"aria-label":
|
|
487
|
-
title:
|
|
488
|
-
"aria-disabled":
|
|
489
|
-
"aria-busy":
|
|
486
|
+
className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover ${o} ${N === null ? "" : "cursor-default opacity-60"}`,
|
|
487
|
+
"aria-label": N === null ? b("composer.stop", "Stop the reply") : b("composer.stopping", "Stopping the reply…"),
|
|
488
|
+
title: N === null ? b("composer.stop", "Stop the reply") : b("composer.stopping", "Stopping the reply…"),
|
|
489
|
+
"aria-disabled": N === null ? void 0 : "true",
|
|
490
|
+
"aria-busy": N === null ? void 0 : "true",
|
|
490
491
|
"data-testid": "assistant-stop",
|
|
491
|
-
children:
|
|
492
|
+
children: N === null ? /* @__PURE__ */ p(Ae, {
|
|
492
493
|
className: "size-4 fill-current",
|
|
493
494
|
"aria-hidden": "true"
|
|
494
|
-
}) : /* @__PURE__ */ f
|
|
495
|
+
}) : /* @__PURE__ */ p(f, {
|
|
495
496
|
className: "size-4 motion-safe:animate-spin",
|
|
496
497
|
"aria-hidden": "true"
|
|
497
498
|
})
|
|
498
|
-
}) : e && !(
|
|
499
|
+
}) : e && !(x && r) ? /* @__PURE__ */ p(ue, {
|
|
499
500
|
compact: !0,
|
|
500
|
-
invisible:
|
|
501
|
-
onStart:
|
|
502
|
-
disabled:
|
|
503
|
-
}) : /* @__PURE__ */
|
|
501
|
+
invisible: y,
|
|
502
|
+
onStart: h,
|
|
503
|
+
disabled: C || k
|
|
504
|
+
}) : /* @__PURE__ */ p("button", {
|
|
504
505
|
type: "button",
|
|
505
506
|
onClick: () => {
|
|
506
|
-
|
|
507
|
+
M(null), Z();
|
|
507
508
|
},
|
|
508
|
-
disabled: !
|
|
509
|
-
className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${o} ${
|
|
510
|
-
"aria-label":
|
|
509
|
+
disabled: !J,
|
|
510
|
+
className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${o} ${J ? "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover" : "bg-[var(--color-bg-disabled)] text-[var(--color-text-disabled)]"}`,
|
|
511
|
+
"aria-label": b("chatInput.send", "Send message"),
|
|
511
512
|
"data-testid": "assistant-send",
|
|
512
|
-
children: Ie ||
|
|
513
|
+
children: Ie || ht || k ? /* @__PURE__ */ p(f, {
|
|
513
514
|
className: "size-5 motion-safe:animate-spin",
|
|
514
515
|
"aria-hidden": "true"
|
|
515
|
-
}) : /* @__PURE__ */
|
|
516
|
+
}) : /* @__PURE__ */ p(ke, {
|
|
516
517
|
className: "size-5",
|
|
517
518
|
"aria-hidden": "true"
|
|
518
519
|
})
|
|
@@ -524,90 +525,90 @@ var Fe = ({ children: e }) => e(De()), m = ({ writeAccessDenied: De = !1, onSend
|
|
|
524
525
|
]
|
|
525
526
|
}) });
|
|
526
527
|
}
|
|
527
|
-
return /* @__PURE__ */
|
|
528
|
+
return /* @__PURE__ */ m("div", {
|
|
528
529
|
className: "flex-shrink-0 px-3 pb-3 pt-1.5",
|
|
529
530
|
children: [
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ m("div", {
|
|
531
532
|
onDragEnter: tn,
|
|
532
533
|
onDragLeave: nn,
|
|
533
534
|
onDragOver: rn,
|
|
534
535
|
onDrop: an,
|
|
535
|
-
className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${
|
|
536
|
+
className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${O ? "border-action-primary-bg border-dashed bg-action-primary-bg/5" : "border-border-default bg-bg-sunken"}`,
|
|
536
537
|
"data-testid": "assistant-composer",
|
|
537
538
|
children: [
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
disabled:
|
|
540
|
-
showSuggestions:
|
|
541
|
-
onSuggest:
|
|
542
|
-
}), /* @__PURE__ */
|
|
543
|
-
attachments:
|
|
544
|
-
onRemove:
|
|
545
|
-
onRetry:
|
|
546
|
-
disabled:
|
|
547
|
-
preparingCount:
|
|
539
|
+
/* @__PURE__ */ m(je, { children: [/* @__PURE__ */ p(oe, {
|
|
540
|
+
disabled: k,
|
|
541
|
+
showSuggestions: K.length === 0,
|
|
542
|
+
onSuggest: Vt
|
|
543
|
+
}), /* @__PURE__ */ p(ae, {
|
|
544
|
+
attachments: R,
|
|
545
|
+
onRemove: yt,
|
|
546
|
+
onRetry: bt,
|
|
547
|
+
disabled: C || k,
|
|
548
|
+
preparingCount: gt
|
|
548
549
|
})] }),
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ m("div", {
|
|
550
551
|
className: "flex items-end gap-2",
|
|
551
552
|
children: [
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
onFiles:
|
|
554
|
-
canAddMore:
|
|
555
|
-
disabled:
|
|
553
|
+
/* @__PURE__ */ p(ie, {
|
|
554
|
+
onFiles: z,
|
|
555
|
+
canAddMore: Ct,
|
|
556
|
+
disabled: C || k,
|
|
556
557
|
showLabel: !0
|
|
557
558
|
}),
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
ref:
|
|
560
|
-
value:
|
|
561
|
-
onChange: (e) =>
|
|
559
|
+
/* @__PURE__ */ p("textarea", {
|
|
560
|
+
ref: T,
|
|
561
|
+
value: E,
|
|
562
|
+
onChange: (e) => D(e.target.value),
|
|
562
563
|
onKeyDown: Qt,
|
|
563
564
|
onPaste: en,
|
|
564
|
-
disabled:
|
|
565
|
-
readOnly:
|
|
566
|
-
"aria-busy":
|
|
567
|
-
placeholder:
|
|
565
|
+
disabled: C,
|
|
566
|
+
readOnly: k,
|
|
567
|
+
"aria-busy": k || void 0,
|
|
568
|
+
placeholder: O ? b("composer.dropHere", "Drop files to attach") : zt,
|
|
568
569
|
rows: 1,
|
|
569
570
|
className: "min-h-[36px] flex-1 resize-none self-center bg-transparent px-1 py-2 text-[15px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50",
|
|
570
|
-
"aria-label":
|
|
571
|
+
"aria-label": b("chatInput.ariaLabel", "Message input"),
|
|
571
572
|
"data-testid": "assistant-input"
|
|
572
573
|
}),
|
|
573
|
-
|
|
574
|
-
isListening:
|
|
575
|
-
isStarting:
|
|
576
|
-
onToggle:
|
|
577
|
-
disabled:
|
|
574
|
+
U.isSupported && /* @__PURE__ */ p(ce, {
|
|
575
|
+
isListening: U.isListening,
|
|
576
|
+
isStarting: U.isStarting,
|
|
577
|
+
onToggle: U.toggle,
|
|
578
|
+
disabled: C || k
|
|
578
579
|
}),
|
|
579
|
-
|
|
580
|
-
onStart:
|
|
581
|
-
disabled:
|
|
582
|
-
}) : /* @__PURE__ */
|
|
580
|
+
h && K.length === 0 && R.length === 0 && !U.isActive ? /* @__PURE__ */ p(ue, {
|
|
581
|
+
onStart: h,
|
|
582
|
+
disabled: C || k
|
|
583
|
+
}) : /* @__PURE__ */ p("button", {
|
|
583
584
|
type: "button",
|
|
584
|
-
onClick: () => void
|
|
585
|
-
disabled: !
|
|
586
|
-
className: `flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${
|
|
587
|
-
"aria-label":
|
|
585
|
+
onClick: () => void Z(),
|
|
586
|
+
disabled: !J,
|
|
587
|
+
className: `flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${J ? "bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover" : "bg-bg-elevated text-text-muted"}`,
|
|
588
|
+
"aria-label": b("chatInput.send", "Send message"),
|
|
588
589
|
"data-testid": "assistant-send",
|
|
589
|
-
children: Ie ||
|
|
590
|
+
children: Ie || ht || k ? /* @__PURE__ */ p(f, { className: "size-4 motion-safe:animate-spin" }) : /* @__PURE__ */ p(ke, { className: "size-4" })
|
|
590
591
|
})
|
|
591
592
|
]
|
|
592
593
|
}),
|
|
593
|
-
(
|
|
594
|
+
(Be.length > 1 || Be.some((e) => e.writeCapable)) && /* @__PURE__ */ p("div", {
|
|
594
595
|
className: "mt-2 px-0.5",
|
|
595
|
-
children: /* @__PURE__ */
|
|
596
|
+
children: /* @__PURE__ */ p(ve, {
|
|
596
597
|
mode: ze,
|
|
597
|
-
availableModes:
|
|
598
|
-
onModeChange:
|
|
599
|
-
disabled:
|
|
600
|
-
auto:
|
|
598
|
+
availableModes: Be,
|
|
599
|
+
onModeChange: He,
|
|
600
|
+
disabled: C || k,
|
|
601
|
+
auto: Ue
|
|
601
602
|
})
|
|
602
603
|
})
|
|
603
604
|
]
|
|
604
605
|
}),
|
|
605
|
-
|
|
606
|
+
l ? /* @__PURE__ */ p("p", {
|
|
606
607
|
className: "mt-1.5 px-1 text-center text-[11px] text-status-warning",
|
|
607
608
|
"data-testid": "assistant-write-access-warning",
|
|
608
|
-
children:
|
|
609
|
+
children: b("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
|
|
609
610
|
}) : null,
|
|
610
|
-
/* @__PURE__ */
|
|
611
|
+
/* @__PURE__ */ p("div", {
|
|
611
612
|
className: "mt-1.5 px-1 text-center text-[11px]",
|
|
612
613
|
"aria-live": "polite",
|
|
613
614
|
children: sn(!1, !1)
|
|
@@ -615,4 +616,4 @@ var Fe = ({ children: e }) => e(De()), m = ({ writeAccessDenied: De = !1, onSend
|
|
|
615
616
|
]
|
|
616
617
|
});
|
|
617
618
|
};
|
|
618
|
-
export {
|
|
619
|
+
export { Fe as AssistantComposer };
|