@burdenoff/fe-libs 2026.926.5 → 2026.927.2
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/conversation.d.ts +91 -3
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/gatewayClient.d.ts +15 -0
- package/dist/shared/assistant/gatewayClient.d.ts.map +1 -1
- package/dist/shared/assistant/gatewayClient.js +1 -1
- package/dist/shared/assistant/guardedStorage.d.ts +4 -2
- package/dist/shared/assistant/guardedStorage.d.ts.map +1 -1
- package/dist/shared/assistant/guardedStorage.js +1 -1
- package/dist/shared/assistant/history/historyApi.d.ts +38 -0
- package/dist/shared/assistant/history/historyApi.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyApi.js +153 -0
- package/dist/shared/assistant/history/historyEngine.d.ts +96 -0
- package/dist/shared/assistant/history/historyEngine.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyEngine.js +774 -0
- package/dist/shared/assistant/history/historyErrors.d.ts +72 -0
- package/dist/shared/assistant/history/historyErrors.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyErrors.js +74 -0
- package/dist/shared/assistant/history/historyList.d.ts +115 -0
- package/dist/shared/assistant/history/historyList.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyList.js +116 -0
- package/dist/shared/assistant/history/historyMapping.d.ts +65 -0
- package/dist/shared/assistant/history/historyMapping.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyMapping.js +383 -0
- package/dist/shared/assistant/history/historyMerge.d.ts +65 -0
- package/dist/shared/assistant/history/historyMerge.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyMerge.js +97 -0
- package/dist/shared/assistant/history/historyOperations.d.ts +24 -0
- package/dist/shared/assistant/history/historyOperations.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyOperations.js +125 -0
- package/dist/shared/assistant/history/historyResume.d.ts +56 -0
- package/dist/shared/assistant/history/historyResume.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyResume.js +55 -0
- package/dist/shared/assistant/history/historyStatus.d.ts +76 -0
- package/dist/shared/assistant/history/historyStatus.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyStatus.js +47 -0
- package/dist/shared/assistant/history/historyStore.d.ts +192 -0
- package/dist/shared/assistant/history/historyStore.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyStore.js +503 -0
- package/dist/shared/assistant/history/historyTimestamps.d.ts +11 -0
- package/dist/shared/assistant/history/historyTimestamps.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyTimestamps.js +9 -0
- package/dist/shared/assistant/history/historyTypes.d.ts +256 -0
- package/dist/shared/assistant/history/historyTypes.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyTypes.js +20 -0
- package/dist/shared/assistant/history/profileBoundStorage.d.ts +36 -0
- package/dist/shared/assistant/history/profileBoundStorage.d.ts.map +1 -0
- package/dist/shared/assistant/history/profileBoundStorage.js +74 -0
- package/dist/shared/assistant/history/stampRegistry.d.ts +84 -0
- package/dist/shared/assistant/history/stampRegistry.d.ts.map +1 -0
- package/dist/shared/assistant/history/stampRegistry.js +58 -0
- package/dist/shared/assistant/history/useAssistantServerHistory.d.ts +18 -0
- package/dist/shared/assistant/history/useAssistantServerHistory.d.ts.map +1 -0
- package/dist/shared/assistant/history/useAssistantServerHistory.js +12 -0
- package/dist/shared/assistant/i18nManifest.d.ts +18 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +18 -0
- package/dist/shared/assistant/index.d.ts +16 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/liveTurns.d.ts +7 -0
- package/dist/shared/assistant/liveTurns.d.ts.map +1 -1
- package/dist/shared/assistant/liveTurns.js +35 -32
- package/dist/shared/assistant/spokenTurns.d.ts +20 -0
- package/dist/shared/assistant/spokenTurns.d.ts.map +1 -1
- package/dist/shared/assistant/spokenTurns.js +13 -8
- package/dist/shared/assistant/store.d.ts +35 -1
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +93 -24
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +16 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AIAssistantPanel.js +63 -60
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +730 -672
- package/dist/shared/assistant/ui/AssistantConversationList.d.ts +17 -0
- package/dist/shared/assistant/ui/AssistantConversationList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantConversationList.js +324 -145
- package/dist/shared/assistant/ui/AssistantHistoryNotices.d.ts +36 -0
- package/dist/shared/assistant/ui/AssistantHistoryNotices.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantHistoryNotices.js +103 -0
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +4 -0
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantOverlay.js +97 -94
- package/dist/shared/assistant/ui/AssistantSpokenTurnsNotice.d.ts +5 -3
- package/dist/shared/assistant/ui/AssistantSpokenTurnsNotice.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +6 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +54 -54
- package/dist/shared/assistant/ui/voice/VoiceTranscriptDrawer.d.ts +9 -0
- package/dist/shared/assistant/ui/voice/VoiceTranscriptDrawer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/VoiceTranscriptDrawer.js +37 -32
- package/dist/shared/assistant/voice/turnVisibility.d.ts +7 -5
- package/dist/shared/assistant/voice/turnVisibility.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceTranscript.d.ts +3 -2
- package/dist/shared/assistant/voice/voiceTranscript.d.ts.map +1 -1
- package/dist/shared-assistant.js +153 -137
- package/package.json +1 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useAssistantTr as e } from "../i18n.js";
|
|
2
|
+
import { AlertTriangle as t, History as n, Loader2 as r, Lock as i, Trash2 as a, X as o } from "lucide-react";
|
|
3
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
|
+
//#region src/shared/assistant/ui/AssistantHistoryNotices.tsx
|
|
5
|
+
var l = ({ state: t, onRetry: n, compact: i = !1 }) => {
|
|
6
|
+
let a = e(), o = i ? "mx-3 mb-2 flex items-center justify-center gap-2 text-xs" : "flex flex-1 flex-col items-center justify-center gap-2 px-4 text-center text-xs";
|
|
7
|
+
return t === "loading" ? /* @__PURE__ */ c("div", {
|
|
8
|
+
role: "status",
|
|
9
|
+
className: `${o} text-text-muted`,
|
|
10
|
+
"data-testid": "assistant-history-loading",
|
|
11
|
+
children: [/* @__PURE__ */ s(r, {
|
|
12
|
+
className: "size-4 motion-safe:animate-spin",
|
|
13
|
+
"aria-hidden": "true"
|
|
14
|
+
}), /* @__PURE__ */ s("span", { children: a("history.loading", "Loading conversation…") })]
|
|
15
|
+
}) : /* @__PURE__ */ c("div", {
|
|
16
|
+
role: "alert",
|
|
17
|
+
className: `${o} text-text-secondary`,
|
|
18
|
+
"data-testid": "assistant-history-load-failed",
|
|
19
|
+
children: [/* @__PURE__ */ s("span", { children: a("history.loadFailed", "Couldn't load this conversation.") }), /* @__PURE__ */ s("button", {
|
|
20
|
+
type: "button",
|
|
21
|
+
onClick: n,
|
|
22
|
+
className: "rounded-md px-2 py-1 font-medium text-action-primary-bg transition-colors hover:bg-bg-elevated focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
23
|
+
"data-testid": "assistant-history-retry-load",
|
|
24
|
+
children: a("history.tryAgain", "Try again")
|
|
25
|
+
})]
|
|
26
|
+
});
|
|
27
|
+
}, u = ({ onShowEarlier: t, disabled: r = !1 }) => {
|
|
28
|
+
let i = e();
|
|
29
|
+
return /* @__PURE__ */ c("button", {
|
|
30
|
+
type: "button",
|
|
31
|
+
onClick: t,
|
|
32
|
+
disabled: r,
|
|
33
|
+
className: "mx-auto mt-2 flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-action-primary-bg transition-colors hover:bg-bg-elevated focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50",
|
|
34
|
+
"data-testid": "assistant-history-show-earlier",
|
|
35
|
+
children: [/* @__PURE__ */ s(n, {
|
|
36
|
+
className: "size-3.5",
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
}), i("history.showEarlier", "Show earlier messages")]
|
|
39
|
+
});
|
|
40
|
+
}, d = ({ onStartNew: t }) => {
|
|
41
|
+
let n = e();
|
|
42
|
+
return /* @__PURE__ */ c("div", {
|
|
43
|
+
className: "mx-3 mb-2 flex items-start gap-2 rounded-lg border border-border-default bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
|
|
44
|
+
"data-testid": "assistant-history-read-only",
|
|
45
|
+
children: [/* @__PURE__ */ s(i, {
|
|
46
|
+
className: "mt-0.5 size-3.5 flex-shrink-0",
|
|
47
|
+
"aria-hidden": "true"
|
|
48
|
+
}), /* @__PURE__ */ c("div", {
|
|
49
|
+
className: "min-w-0 flex-1",
|
|
50
|
+
children: [/* @__PURE__ */ s("p", { children: n("history.legacyReadOnly", "This conversation was saved by an earlier version of the assistant. You can read it, but it can't be continued.") }), /* @__PURE__ */ s("button", {
|
|
51
|
+
type: "button",
|
|
52
|
+
onClick: t,
|
|
53
|
+
className: "mt-1 font-medium text-action-primary-bg hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
54
|
+
"data-testid": "assistant-history-start-new",
|
|
55
|
+
children: n("conversations.startNew", "Start a new conversation")
|
|
56
|
+
})]
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
}, f = ({ onDismiss: t }) => {
|
|
60
|
+
let n = e();
|
|
61
|
+
return /* @__PURE__ */ c("div", {
|
|
62
|
+
role: "status",
|
|
63
|
+
className: "flex items-center gap-2 border-b border-border-subtle bg-bg-sunken/60 px-3 py-2 text-xs text-text-secondary",
|
|
64
|
+
"data-testid": "assistant-history-deleted-elsewhere",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ s(a, {
|
|
67
|
+
className: "size-3.5 flex-shrink-0",
|
|
68
|
+
"aria-hidden": "true"
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ s("span", {
|
|
71
|
+
className: "min-w-0 flex-1",
|
|
72
|
+
children: n("history.deletedElsewhere", "The conversation you had open was deleted on another device.")
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ s("button", {
|
|
75
|
+
type: "button",
|
|
76
|
+
onClick: t,
|
|
77
|
+
className: "flex-shrink-0 rounded-md p-1 transition-colors hover:bg-bg-elevated focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
78
|
+
"aria-label": n("history.dismiss", "Dismiss"),
|
|
79
|
+
"data-testid": "assistant-history-dismiss-deleted",
|
|
80
|
+
children: /* @__PURE__ */ s(o, {
|
|
81
|
+
className: "size-3.5",
|
|
82
|
+
"aria-hidden": "true"
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
});
|
|
87
|
+
}, p = () => {
|
|
88
|
+
let n = e();
|
|
89
|
+
return /* @__PURE__ */ c("div", {
|
|
90
|
+
role: "alert",
|
|
91
|
+
className: "flex items-start gap-2 border-b border-border-subtle bg-bg-sunken/60 px-3 py-2 text-xs text-text-secondary",
|
|
92
|
+
"data-testid": "assistant-history-delete-not-saved",
|
|
93
|
+
children: [/* @__PURE__ */ s(t, {
|
|
94
|
+
className: "mt-0.5 size-3.5 flex-shrink-0",
|
|
95
|
+
"aria-hidden": "true"
|
|
96
|
+
}), /* @__PURE__ */ s("span", {
|
|
97
|
+
className: "min-w-0 flex-1",
|
|
98
|
+
children: n("history.deleteNotSaved", "This device's storage is full, so that delete isn't saved here yet. Keep this page open until it reaches the server.")
|
|
99
|
+
})]
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
export { f as AssistantHistoryDeletedNotice, l as AssistantHistoryLoadState, d as AssistantHistoryReadOnlyBanner, u as AssistantHistoryShowEarlier, p as AssistantHistoryUnsavedDeleteNotice };
|
|
@@ -87,6 +87,10 @@ export interface AssistantOverlayProps {
|
|
|
87
87
|
* is closed (BOFF-7367). A `renderPanel` wrapper that hands its panel the
|
|
88
88
|
* same controller should pass it here too; one it passes only to its panel is
|
|
89
89
|
* bridged by that panel, for that panel's lifetime.
|
|
90
|
+
*
|
|
91
|
+
* ★★ `serverHistory` likewise (BOFF-7335): held on HERE, so the history a
|
|
92
|
+
* closed panel's turns and deletes queued keeps going out, and a reopened
|
|
93
|
+
* panel finds the list already current.
|
|
90
94
|
*/
|
|
91
95
|
panelProps?: Omit<AIAssistantPanelProps, keyof AssistantOverlayPanelProps>;
|
|
92
96
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantOverlay.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAUL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantOverlay.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAUL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAK1C,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAmBL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,oBAAoB,CAAC;CAC5B;AAID,uEAAuE;AACvE,wBAAgB,yBAAyB,IAAI,4BAA4B,GAAG,IAAI,CAE/E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AA6BD;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,WAAW,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,GACnD,IAAI,CAaN;AAID,MAAM,WAAW,6BAA6B;IAC5C;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;KACtD,CAAC;IACF,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE,6BAA6B,2CAkE/B;AAED,mDAAmD;AACnD,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAED,MAAM,WAAW,qBAAqB;IACpC,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,0BAA0B,CAAC,CAAC;IAC3E;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,SAAS,CAAC;IAC/D;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kFAAkF;IAClF,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,kEAAkE;IAClE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAOD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,kDAI5D"}
|
|
@@ -2,169 +2,172 @@ import { useAssistantTr as e } from "../i18n.js";
|
|
|
2
2
|
import { quotaExhaustedEventName as t } from "../quota.js";
|
|
3
3
|
import { assistantPanelOwnsEscape as n } from "./panelOverlays.js";
|
|
4
4
|
import { AssistantPreviewBridgeHost as r } from "../preview/bridgeHost.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { useAssistantServerHistory as i } from "../history/useAssistantServerHistory.js";
|
|
6
|
+
import { AIAssistantPanel as a } from "./AIAssistantPanel.js";
|
|
7
|
+
import { ASSISTANT_DOCK_WIDTH_VAR as o, ASSISTANT_OVERLAY_DESKTOP_QUERY as s, ASSISTANT_OVERLAY_TOP_VAR as c, aboveAssistantBottomChrome as l, assistantOverlayClassName as u, assistantOverlayEscapeAction as d, assistantOverlayKeys as f, assistantQuotaKindOf as p, createAssistantNavigate as m, isAssistantToggleShortcut as h, nextAssistantOpenState as g, publishedAssistantDockWidth as _, readAssistantOverlayFlag as v, requestedAssistantOpenState as y, writeAssistantOverlayFlag as b } from "./assistantOverlayState.js";
|
|
8
|
+
import { createContext as x, useCallback as S, useContext as C, useEffect as w, useMemo as T, useRef as E, useState as D, useSyncExternalStore as O } from "react";
|
|
9
|
+
import { Sparkles as k } from "lucide-react";
|
|
10
|
+
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
10
11
|
//#region src/shared/assistant/ui/AssistantOverlay.tsx
|
|
11
|
-
var
|
|
12
|
-
function M() {
|
|
13
|
-
return S(j);
|
|
14
|
-
}
|
|
12
|
+
var M = x(null);
|
|
15
13
|
function N() {
|
|
16
|
-
return
|
|
14
|
+
return C(M);
|
|
15
|
+
}
|
|
16
|
+
function P() {
|
|
17
|
+
return C(M)?.dockWidthPx ?? 0;
|
|
17
18
|
}
|
|
18
|
-
var
|
|
19
|
-
function
|
|
19
|
+
var F = () => typeof window > "u" ? void 0 : window.sessionStorage, I = () => typeof window > "u" ? void 0 : window.localStorage;
|
|
20
|
+
function L(e) {
|
|
20
21
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
|
|
21
|
-
let t = window.matchMedia(
|
|
22
|
+
let t = window.matchMedia(s);
|
|
22
23
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
+
function R() {
|
|
25
26
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(min-width: 640px)").matches;
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
28
|
+
function z() {
|
|
29
|
+
return O(L, R, () => !1);
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
let r =
|
|
32
|
-
|
|
31
|
+
function B(e, n) {
|
|
32
|
+
let r = E(n);
|
|
33
|
+
w(() => {
|
|
33
34
|
r.current = n;
|
|
34
|
-
}, [n]),
|
|
35
|
+
}, [n]), w(() => {
|
|
35
36
|
if (!e || typeof window > "u") return;
|
|
36
|
-
let n = t(e), i = (e) => r.current(
|
|
37
|
+
let n = t(e), i = (e) => r.current(p(e), e);
|
|
37
38
|
return window.addEventListener(n, i), () => window.removeEventListener(n, i);
|
|
38
39
|
}, [e]);
|
|
39
40
|
}
|
|
40
|
-
var
|
|
41
|
-
function
|
|
42
|
-
let r =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, [r.openStorageKey, i]),
|
|
46
|
-
|
|
47
|
-
}, [r.dockStorageKey, s]),
|
|
41
|
+
var V = () => {};
|
|
42
|
+
function H({ keyPrefix: e, quota: t, children: n }) {
|
|
43
|
+
let r = T(() => f(e), [e]), [i, a] = D(() => v(F, r.openStorageKey)), [s, c] = D(() => v(I, r.dockStorageKey)), l = S(() => a(!0), []), u = S(() => a(!1), []), d = S(() => a((e) => !e), []), p = S(() => c((e) => !e), []);
|
|
44
|
+
w(() => {
|
|
45
|
+
b(F, r.openStorageKey, i);
|
|
46
|
+
}, [r.openStorageKey, i]), w(() => {
|
|
47
|
+
b(I, r.dockStorageKey, s);
|
|
48
|
+
}, [r.dockStorageKey, s]), w(() => {
|
|
48
49
|
if (typeof window > "u") return;
|
|
49
50
|
let e = (e) => {
|
|
50
|
-
let t =
|
|
51
|
-
|
|
51
|
+
let t = y(e);
|
|
52
|
+
a((e) => g(e, t));
|
|
52
53
|
};
|
|
53
54
|
return window.addEventListener(r.toggleEvent, e), () => window.removeEventListener(r.toggleEvent, e);
|
|
54
|
-
}, [r.toggleEvent]),
|
|
55
|
+
}, [r.toggleEvent]), w(() => {
|
|
55
56
|
if (typeof document > "u") return;
|
|
56
57
|
let e = (e) => {
|
|
57
|
-
|
|
58
|
+
h(e) && (e.preventDefault(), a((e) => !e));
|
|
58
59
|
};
|
|
59
60
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
60
|
-
}, []),
|
|
61
|
-
let
|
|
61
|
+
}, []), B(t?.product ?? null, t?.onExhausted ?? V);
|
|
62
|
+
let m = _({
|
|
62
63
|
isOpen: i,
|
|
63
64
|
docked: s,
|
|
64
|
-
isDesktop:
|
|
65
|
+
isDesktop: z()
|
|
65
66
|
});
|
|
66
|
-
|
|
67
|
+
w(() => {
|
|
67
68
|
if (typeof document > "u") return;
|
|
68
69
|
let e = document.documentElement.style;
|
|
69
|
-
return e.setProperty(
|
|
70
|
-
e.removeProperty(
|
|
70
|
+
return e.setProperty(o, `${m}px`), () => {
|
|
71
|
+
e.removeProperty(o);
|
|
71
72
|
};
|
|
72
|
-
}, [
|
|
73
|
-
let
|
|
73
|
+
}, [m]);
|
|
74
|
+
let x = T(() => ({
|
|
74
75
|
isOpen: i,
|
|
75
76
|
open: l,
|
|
76
77
|
close: u,
|
|
77
|
-
toggle:
|
|
78
|
+
toggle: d,
|
|
78
79
|
docked: s,
|
|
79
80
|
toggleDock: p,
|
|
80
|
-
dockWidthPx:
|
|
81
|
+
dockWidthPx: m,
|
|
81
82
|
keys: r
|
|
82
83
|
}), [
|
|
83
84
|
i,
|
|
84
85
|
l,
|
|
85
86
|
u,
|
|
86
|
-
|
|
87
|
+
d,
|
|
87
88
|
s,
|
|
88
89
|
p,
|
|
89
|
-
|
|
90
|
+
m,
|
|
90
91
|
r
|
|
91
92
|
]);
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
value:
|
|
93
|
+
return /* @__PURE__ */ A(M.Provider, {
|
|
94
|
+
value: x,
|
|
94
95
|
children: n
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
|
-
var
|
|
98
|
+
var U = (e, t) => /* @__PURE__ */ A(a, {
|
|
98
99
|
...e,
|
|
99
100
|
...t
|
|
100
101
|
});
|
|
101
|
-
function
|
|
102
|
-
let t =
|
|
103
|
-
return t ? /* @__PURE__ */
|
|
102
|
+
function W(e) {
|
|
103
|
+
let t = N();
|
|
104
|
+
return t ? /* @__PURE__ */ A(G, {
|
|
104
105
|
state: t,
|
|
105
106
|
...e
|
|
106
107
|
}) : null;
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
-
let { isOpen:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
function G({ state: t, panelId: a = "ai-assistant", panelProps: o, renderPanel: s, navigate: f, isShellLessTarget: p, topOffsetPx: h = 56, launcherIcon: g, launcherBottomInset: _ = "1.5rem", showLauncher: v = !0 }) {
|
|
110
|
+
let { isOpen: y, close: b, toggle: x, docked: S, toggleDock: C } = t, E = e();
|
|
111
|
+
i(o?.serverHistory === !0);
|
|
112
|
+
let [O, M] = D(!1), N = T(() => f ? m({
|
|
113
|
+
navigate: f,
|
|
114
|
+
isShellLessTarget: p,
|
|
115
|
+
isDesktop: R,
|
|
116
|
+
collapseSheet: () => M(!1),
|
|
114
117
|
openInNewTab: (e) => window.open(e, "_blank", "noopener,noreferrer")
|
|
115
|
-
}) : void 0, [
|
|
116
|
-
|
|
117
|
-
if (!
|
|
118
|
+
}) : void 0, [f, p]);
|
|
119
|
+
w(() => {
|
|
120
|
+
if (!y) return;
|
|
118
121
|
let e = (e) => {
|
|
119
|
-
|
|
122
|
+
d({
|
|
120
123
|
key: e.key,
|
|
121
|
-
isOpen:
|
|
124
|
+
isOpen: y,
|
|
122
125
|
dialogOpen: document.querySelector("[role=\"dialog\"],[role=\"alertdialog\"],dialog[open]") !== null,
|
|
123
126
|
panelOwnsEscape: n()
|
|
124
|
-
}) === "close" && (e.preventDefault(),
|
|
127
|
+
}) === "close" && (e.preventDefault(), b());
|
|
125
128
|
};
|
|
126
129
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
127
|
-
}, [
|
|
128
|
-
let
|
|
129
|
-
panelId:
|
|
130
|
+
}, [y, b]);
|
|
131
|
+
let P = {
|
|
132
|
+
panelId: a,
|
|
130
133
|
visible: !0,
|
|
131
|
-
onClose:
|
|
132
|
-
docked:
|
|
133
|
-
onToggleDock:
|
|
134
|
-
onNavigate:
|
|
135
|
-
},
|
|
136
|
-
return /* @__PURE__ */
|
|
137
|
-
preview:
|
|
138
|
-
children: [
|
|
139
|
-
className:
|
|
140
|
-
expanded:
|
|
141
|
-
docked:
|
|
134
|
+
onClose: b,
|
|
135
|
+
docked: S,
|
|
136
|
+
onToggleDock: C,
|
|
137
|
+
onNavigate: N
|
|
138
|
+
}, F = E("overlay.launcher", "AI Assistant"), I = { [c]: `${h}px` };
|
|
139
|
+
return /* @__PURE__ */ j(r, {
|
|
140
|
+
preview: o?.preview,
|
|
141
|
+
children: [y && /* @__PURE__ */ j("div", {
|
|
142
|
+
className: u({
|
|
143
|
+
expanded: O,
|
|
144
|
+
docked: S
|
|
142
145
|
}),
|
|
143
|
-
style:
|
|
146
|
+
style: I,
|
|
144
147
|
"data-testid": "assistant-overlay",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ A("button", {
|
|
146
149
|
type: "button",
|
|
147
|
-
onClick: () =>
|
|
150
|
+
onClick: () => M((e) => !e),
|
|
148
151
|
className: "flex w-full shrink-0 justify-center pt-2 pb-1 sm:hidden",
|
|
149
|
-
"aria-label":
|
|
150
|
-
"aria-expanded":
|
|
152
|
+
"aria-label": O ? E("sheet.collapse", "Shrink the assistant") : E("sheet.expand", "Expand the assistant"),
|
|
153
|
+
"aria-expanded": O,
|
|
151
154
|
"data-testid": "assistant-sheet-handle",
|
|
152
|
-
children: /* @__PURE__ */
|
|
153
|
-
}), /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ A("span", { className: "h-1.5 w-10 rounded-full bg-border-strong" })
|
|
156
|
+
}), /* @__PURE__ */ A("div", {
|
|
154
157
|
className: "flex min-h-0 flex-1 flex-col",
|
|
155
|
-
children:
|
|
158
|
+
children: s ? s(P) : U(o, P)
|
|
156
159
|
})]
|
|
157
|
-
}),
|
|
160
|
+
}), v && /* @__PURE__ */ A("button", {
|
|
158
161
|
type: "button",
|
|
159
|
-
onClick:
|
|
160
|
-
title:
|
|
161
|
-
"aria-label":
|
|
162
|
+
onClick: x,
|
|
163
|
+
title: E("overlay.launcherTitle", "AI Assistant ({{shortcut}})", { shortcut: "Ctrl+Shift+A" }),
|
|
164
|
+
"aria-label": F,
|
|
162
165
|
"aria-haspopup": "dialog",
|
|
163
|
-
"aria-expanded":
|
|
166
|
+
"aria-expanded": y,
|
|
164
167
|
"data-testid": "assistant-fab",
|
|
165
|
-
style: { bottom:
|
|
166
|
-
className: "fixed right-6 z-30 size-14 items-center justify-center rounded-full border border-border-strong bg-[var(--color-accent-soft)] text-action-primary-bg shadow-float transition-colors duration-200 hover:border-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] cursor-pointer " + (
|
|
167
|
-
children:
|
|
168
|
+
style: { bottom: l(_) },
|
|
169
|
+
className: "fixed right-6 z-30 size-14 items-center justify-center rounded-full border border-border-strong bg-[var(--color-accent-soft)] text-action-primary-bg shadow-float transition-colors duration-200 hover:border-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] cursor-pointer " + (y ? "hidden sm:inline-flex" : "inline-flex"),
|
|
170
|
+
children: g ?? /* @__PURE__ */ A(k, {
|
|
168
171
|
className: "size-6",
|
|
169
172
|
"aria-hidden": "true"
|
|
170
173
|
})
|
|
@@ -172,4 +175,4 @@ function W({ state: t, panelId: i = "ai-assistant", panelProps: a, renderPanel:
|
|
|
172
175
|
});
|
|
173
176
|
}
|
|
174
177
|
//#endregion
|
|
175
|
-
export {
|
|
178
|
+
export { W as AssistantOverlay, H as AssistantOverlayProvider, P as useAssistantDockWidth, N as useAssistantOverlayOrNull, B as useAssistantQuotaExhausted };
|
|
@@ -8,9 +8,11 @@ interface Props {
|
|
|
8
8
|
* "You said things here that this thread is not showing you."
|
|
9
9
|
*
|
|
10
10
|
* ★ The assistant and the typed thread share ONE backend session, and the
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* model's memory IS that session — the client replays no history into it. The
|
|
12
|
+
* one exception (BOFF-7335) is a NEW session in a conversation saved to server
|
|
13
|
+
* history, which is handed a framed digest of the saved exchanges, spoken ones
|
|
14
|
+
* included (`resumeContextFor`). Either way a spoken turn is in the model's
|
|
15
|
+
* context, whether or not the chat panel draws it. Hiding those turns without saying so produced the worst
|
|
14
16
|
* possible combination: replies that open "as I mentioned about your urea dose"
|
|
15
17
|
* with no such message anywhere on screen, and an Export button on a chat that
|
|
16
18
|
* looks empty.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantSpokenTurnsNotice.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantSpokenTurnsNotice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,UAAU,KAAK;IACb,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED
|
|
1
|
+
{"version":3,"file":"AssistantSpokenTurnsNotice.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantSpokenTurnsNotice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,UAAU,KAAK;IACb,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,0BAA0B,EAAE,EAAE,CAAC,KAAK,CA0ChD,CAAC"}
|
|
@@ -17,6 +17,12 @@ interface Props {
|
|
|
17
17
|
onSend: (message: string, attachments: AssistantAttachment[]) => void;
|
|
18
18
|
/** True while a turn is in-flight (assistant busy) — disables send + shows the spinner. */
|
|
19
19
|
disabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Nothing can be sent into this conversation at all (BOFF-7335: one saved
|
|
22
|
+
* before server history). Everything is disabled as by `disabled`, but it is
|
|
23
|
+
* not BUSY, so no spinner claims something is on its way.
|
|
24
|
+
*/
|
|
25
|
+
readOnly?: boolean;
|
|
20
26
|
placeholder?: string;
|
|
21
27
|
mode: AssistantMode;
|
|
22
28
|
/** Role-filtered list of modes the user may pick. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantComposer.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/composer/AssistantComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQjD,OAAO,EAGL,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AAEjC,UAAU,KAAK;IACb;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,KAAK,IAAI,CAAC;IACtE,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,qDAAqD;IACrD,cAAc,EAAE,mBAAmB,EAAE,CAAC;IACtC;;;;;;;;;;OAUG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,YAAY,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,qFAAqF;IACrF,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"AssistantComposer.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/composer/AssistantComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQjD,OAAO,EAGL,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AAEjC,UAAU,KAAK;IACb;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,KAAK,IAAI,CAAC;IACtE,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,qDAAqD;IACrD,cAAc,EAAE,mBAAmB,EAAE,CAAC;IACtC;;;;;;;;;;OAUG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,YAAY,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,qFAAqF;IACrF,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,KAAK,CA+avC,CAAC"}
|
|
@@ -15,44 +15,44 @@ import { useCallback as l, useEffect as ie, useLayoutEffect as u, useMemo as d,
|
|
|
15
15
|
import { ArrowUp as m, Loader2 as h } from "lucide-react";
|
|
16
16
|
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
17
17
|
//#region src/shared/assistant/ui/composer/AssistantComposer.tsx
|
|
18
|
-
var v = 200, y = ({ writeAccessDenied: y = !1, onSend: b, disabled: x = !1,
|
|
19
|
-
let T = ee(), { locale: E } = e(), D = f(null), [
|
|
18
|
+
var v = 200, y = ({ writeAccessDenied: y = !1, onSend: b, disabled: x = !1, readOnly: ae = !1, placeholder: oe, mode: se, availableModes: S, attachmentCharsPerFile: ce, onModeChange: le, auto: ue, onStartVoiceSession: C, onDraftStart: w }) => {
|
|
19
|
+
let T = ee(), { locale: E } = e(), D = x || ae, O = f(null), [k, A] = p(""), [j, M] = p(!1), N = f(0), { attachments: P, isBusy: F, preparingCount: I, sendBlocker: L, rejection: R, addFiles: z, remove: B, retry: V, clear: H, clearRejection: de, canAddMore: fe } = re({ perFileChars: ce }), U = k.trim() !== "" || P.length > 0, W = f(!1);
|
|
20
20
|
ie(() => {
|
|
21
21
|
U && !W.current ? (W.current = !0, w?.()) : U || (W.current = !1);
|
|
22
22
|
}, [U, w]);
|
|
23
|
-
let
|
|
24
|
-
|
|
23
|
+
let pe = l((e) => {
|
|
24
|
+
A((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
|
|
25
25
|
}, []), G = a((e) => e.assistantLanguage), K = t({
|
|
26
|
-
onFinalize:
|
|
26
|
+
onFinalize: pe,
|
|
27
27
|
language: d(() => r(G, E), [G, E]).tag
|
|
28
|
-
}),
|
|
28
|
+
}), me = oe ?? T("composer.placeholder", "Ask me anything…"), q = k.trim(), J = i(P), Y = P.filter((e) => e.status === "error"), X = (q.length > 0 || J.length > 0) && !D && L === null;
|
|
29
29
|
u(() => {
|
|
30
|
-
let e =
|
|
30
|
+
let e = O.current;
|
|
31
31
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, v)}px`);
|
|
32
|
-
}, [
|
|
32
|
+
}, [k]);
|
|
33
33
|
let Z = l(() => {
|
|
34
|
-
X && (K.isActive && K.stop(), b(
|
|
34
|
+
X && (K.isActive && K.stop(), b(k.trim(), J), A(""), H());
|
|
35
35
|
}, [
|
|
36
36
|
X,
|
|
37
37
|
b,
|
|
38
|
-
|
|
38
|
+
k,
|
|
39
39
|
J,
|
|
40
|
-
|
|
40
|
+
H,
|
|
41
41
|
K
|
|
42
|
-
]),
|
|
42
|
+
]), he = l((e) => {
|
|
43
43
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Z());
|
|
44
|
-
}, [Z]),
|
|
44
|
+
}, [Z]), ge = l((e) => {
|
|
45
45
|
let t = Array.from(e.clipboardData?.files ?? []);
|
|
46
|
-
t.length !== 0 && (e.preventDefault(),
|
|
47
|
-
}, [
|
|
48
|
-
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (
|
|
49
|
-
}, []),
|
|
50
|
-
|
|
51
|
-
}, []),
|
|
46
|
+
t.length !== 0 && (e.preventDefault(), z(t));
|
|
47
|
+
}, [z]), _e = l((e) => {
|
|
48
|
+
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (N.current += 1, M(!0));
|
|
49
|
+
}, []), Q = l(() => {
|
|
50
|
+
N.current = Math.max(0, N.current - 1), N.current === 0 && M(!1);
|
|
51
|
+
}, []), ve = l((e) => {
|
|
52
52
|
Array.from(e.dataTransfer?.types ?? []).includes("Files") && e.preventDefault();
|
|
53
|
-
}, []),
|
|
54
|
-
e.preventDefault(),
|
|
55
|
-
}, [
|
|
53
|
+
}, []), ye = l((e) => {
|
|
54
|
+
e.preventDefault(), N.current = 0, M(!1), z(e.dataTransfer?.files ?? null);
|
|
55
|
+
}, [z]), be = (e) => {
|
|
56
56
|
switch (e) {
|
|
57
57
|
case "too-many": return T("attachments.tooMany", "You can attach up to {{max}} files per message.", { max: 5 });
|
|
58
58
|
case "too-large": return T("attachments.tooLarge", "That file is larger than 10 MB.");
|
|
@@ -74,36 +74,36 @@ var v = 200, y = ({ writeAccessDenied: y = !1, onSend: b, disabled: x = !1, plac
|
|
|
74
74
|
className: "flex-shrink-0 px-3 pb-3 pt-1.5",
|
|
75
75
|
children: [
|
|
76
76
|
/* @__PURE__ */ _("div", {
|
|
77
|
-
onDragEnter:
|
|
78
|
-
onDragLeave:
|
|
79
|
-
onDragOver:
|
|
80
|
-
onDrop:
|
|
81
|
-
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 ${
|
|
77
|
+
onDragEnter: _e,
|
|
78
|
+
onDragLeave: Q,
|
|
79
|
+
onDragOver: ve,
|
|
80
|
+
onDrop: ye,
|
|
81
|
+
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 ${j ? "border-action-primary-bg border-dashed bg-action-primary-bg/5" : "border-border-default bg-bg-sunken"}`,
|
|
82
82
|
"data-testid": "assistant-composer",
|
|
83
83
|
children: [
|
|
84
84
|
/* @__PURE__ */ g(s, {
|
|
85
|
-
attachments:
|
|
86
|
-
onRemove:
|
|
87
|
-
onRetry:
|
|
88
|
-
disabled:
|
|
89
|
-
preparingCount:
|
|
85
|
+
attachments: P,
|
|
86
|
+
onRemove: B,
|
|
87
|
+
onRetry: V,
|
|
88
|
+
disabled: D,
|
|
89
|
+
preparingCount: I
|
|
90
90
|
}),
|
|
91
91
|
/* @__PURE__ */ _("div", {
|
|
92
92
|
className: "flex items-end gap-2",
|
|
93
93
|
children: [
|
|
94
94
|
/* @__PURE__ */ g(o, {
|
|
95
|
-
onFiles:
|
|
96
|
-
canAddMore:
|
|
97
|
-
disabled:
|
|
95
|
+
onFiles: z,
|
|
96
|
+
canAddMore: fe,
|
|
97
|
+
disabled: D
|
|
98
98
|
}),
|
|
99
99
|
/* @__PURE__ */ g("textarea", {
|
|
100
|
-
ref:
|
|
101
|
-
value:
|
|
102
|
-
onChange: (e) =>
|
|
103
|
-
onKeyDown:
|
|
104
|
-
onPaste:
|
|
105
|
-
disabled:
|
|
106
|
-
placeholder:
|
|
100
|
+
ref: O,
|
|
101
|
+
value: k,
|
|
102
|
+
onChange: (e) => A(e.target.value),
|
|
103
|
+
onKeyDown: he,
|
|
104
|
+
onPaste: ge,
|
|
105
|
+
disabled: D,
|
|
106
|
+
placeholder: j ? T("composer.dropHere", "Drop files to attach") : me,
|
|
107
107
|
rows: 1,
|
|
108
108
|
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",
|
|
109
109
|
"aria-label": T("chatInput.ariaLabel", "Message input"),
|
|
@@ -113,11 +113,11 @@ var v = 200, y = ({ writeAccessDenied: y = !1, onSend: b, disabled: x = !1, plac
|
|
|
113
113
|
isListening: K.isListening,
|
|
114
114
|
isStarting: K.isStarting,
|
|
115
115
|
onToggle: K.toggle,
|
|
116
|
-
disabled:
|
|
116
|
+
disabled: D
|
|
117
117
|
}),
|
|
118
|
-
C && q.length === 0 &&
|
|
118
|
+
C && q.length === 0 && P.length === 0 && !K.isActive ? /* @__PURE__ */ g(ne, {
|
|
119
119
|
onStart: C,
|
|
120
|
-
disabled:
|
|
120
|
+
disabled: D
|
|
121
121
|
}) : /* @__PURE__ */ g("button", {
|
|
122
122
|
type: "button",
|
|
123
123
|
onClick: Z,
|
|
@@ -125,18 +125,18 @@ var v = 200, y = ({ writeAccessDenied: y = !1, onSend: b, disabled: x = !1, plac
|
|
|
125
125
|
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 ${X ? "bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover" : "bg-bg-elevated text-text-muted"}`,
|
|
126
126
|
"aria-label": T("chatInput.send", "Send message"),
|
|
127
127
|
"data-testid": "assistant-send",
|
|
128
|
-
children: x ||
|
|
128
|
+
children: x || F ? /* @__PURE__ */ g(h, { className: "size-4 motion-safe:animate-spin" }) : /* @__PURE__ */ g(m, { className: "size-4" })
|
|
129
129
|
})
|
|
130
130
|
]
|
|
131
131
|
}),
|
|
132
132
|
S.length > 1 && /* @__PURE__ */ g("div", {
|
|
133
133
|
className: "mt-2 px-0.5",
|
|
134
134
|
children: /* @__PURE__ */ g(c, {
|
|
135
|
-
mode:
|
|
135
|
+
mode: se,
|
|
136
136
|
availableModes: S,
|
|
137
|
-
onModeChange:
|
|
138
|
-
disabled:
|
|
139
|
-
auto:
|
|
137
|
+
onModeChange: le,
|
|
138
|
+
disabled: D,
|
|
139
|
+
auto: ue
|
|
140
140
|
})
|
|
141
141
|
})
|
|
142
142
|
]
|
|
@@ -161,13 +161,13 @@ var v = 200, y = ({ writeAccessDenied: y = !1, onSend: b, disabled: x = !1, plac
|
|
|
161
161
|
className: "text-status-error-text",
|
|
162
162
|
"data-testid": "assistant-voice-error",
|
|
163
163
|
children: $
|
|
164
|
-
}) :
|
|
164
|
+
}) : R ? /* @__PURE__ */ g("button", {
|
|
165
165
|
type: "button",
|
|
166
|
-
onClick:
|
|
166
|
+
onClick: de,
|
|
167
167
|
className: "text-status-error-text underline-offset-2 hover:underline",
|
|
168
168
|
"data-testid": "assistant-attachment-rejection",
|
|
169
|
-
children:
|
|
170
|
-
}) :
|
|
169
|
+
children: be(R)
|
|
170
|
+
}) : L === "failed" ? /* @__PURE__ */ g("p", {
|
|
171
171
|
className: "text-status-error-text",
|
|
172
172
|
"data-testid": "assistant-attachment-blocked",
|
|
173
173
|
children: Y.length === 1 ? T("attachments.blockedOne", "{{name}} didn't upload. Retry or remove it before sending.", { name: Y[0].filename }) : T("attachments.blockedMany", "{{count}} attachments didn't upload. Retry or remove them before sending.", { count: Y.length })
|