@burdenoff/fe-libs 2026.1029.10 → 2026.1030.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/assistant/i18nManifest.d.ts +22 -0
- package/dist/shared/assistant/i18nManifest.js +22 -0
- package/dist/shared/assistant/index.d.ts +6 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +26 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.js +197 -160
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts +33 -0
- package/dist/shared/assistant/ui/AssistantChatArea.js +1463 -1397
- package/dist/shared/assistant/ui/AssistantLanguageMenu.d.ts +9 -1
- package/dist/shared/assistant/ui/AssistantLanguageMenu.js +22 -22
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +91 -3
- package/dist/shared/assistant/ui/AssistantOverlay.js +347 -127
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts +224 -0
- package/dist/shared/assistant/ui/assistantOverlayState.js +116 -29
- package/dist/shared/assistant/ui/compact/AssistantConversationMenu.js +53 -52
- package/dist/shared/assistant/ui/compact/AssistantDiscardDraftDialog.js +3 -4
- package/dist/shared/assistant/ui/compact/AssistantLanguagePill.d.ts +29 -0
- package/dist/shared/assistant/ui/compact/AssistantLanguagePill.js +98 -0
- package/dist/shared/assistant/ui/compact/AssistantVoiceReady.d.ts +31 -0
- package/dist/shared/assistant/ui/compact/AssistantVoiceReady.js +41 -0
- package/dist/shared/assistant/ui/compact/AssistantWaitingChangeRow.d.ts +6 -0
- package/dist/shared/assistant/ui/compact/AssistantWaitingChangeRow.js +5 -5
- package/dist/shared/assistant/ui/compact/AssistantWindowHeader.d.ts +36 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowHeader.js +68 -0
- package/dist/shared/assistant/ui/compact/windowView.d.ts +50 -0
- package/dist/shared/assistant/ui/compact/windowView.js +31 -0
- package/dist/shared/assistant/ui/composer/AssistantAttachmentButton.d.ts +8 -0
- package/dist/shared/assistant/ui/composer/AssistantAttachmentButton.js +34 -34
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +6 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +92 -90
- package/dist/shared/assistant/ui/composer/AssistantModeMenu.d.ts +6 -0
- package/dist/shared/assistant/ui/composer/AssistantModeMenu.js +83 -83
- package/dist/shared/assistant/ui/useAssistantVisualViewport.d.ts +3 -0
- package/dist/shared/assistant/ui/useAssistantVisualViewport.js +24 -0
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +31 -0
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +270 -166
- package/dist/shared/assistant/ui/voice/VoiceStage.d.ts +8 -0
- package/dist/shared/assistant/ui/voice/VoiceStage.js +10 -10
- package/dist/shared/assistant/voice/voiceStartedCue.d.ts +11 -0
- package/dist/shared/assistant/voice/voiceStartedCue.js +7 -0
- package/dist/shared-assistant.js +266 -260
- package/dist/ui/modal-shell.d.ts +6 -1
- package/dist/ui/modal-shell.js +7 -6
- package/package.json +1 -1
|
@@ -548,6 +548,7 @@ export declare const ASSISTANT_I18N_LITERAL_COPY: {
|
|
|
548
548
|
readonly 'offer.notAvailable': "{{page}} isn't in your menu right now.";
|
|
549
549
|
readonly 'offer.open': "Open {{page}}";
|
|
550
550
|
readonly 'overlay.launcher': "AI Assistant";
|
|
551
|
+
readonly 'overlay.launcherQuick': "Open quick assistant";
|
|
551
552
|
readonly 'overlay.launcherTitle': "AI Assistant ({{shortcut}})";
|
|
552
553
|
readonly 'panel.ariaLabel': "AI Assistant";
|
|
553
554
|
readonly 'pendingWrite.approve': "Approve this change";
|
|
@@ -659,8 +660,29 @@ export declare const ASSISTANT_I18N_LITERAL_COPY: {
|
|
|
659
660
|
readonly 'voiceSession.transcriptTitle': "Voice transcript";
|
|
660
661
|
readonly 'voiceSession.unmute': "Turn the microphone on";
|
|
661
662
|
readonly 'waitingChange.review': "Review";
|
|
663
|
+
readonly 'waitingChange.reviewInFull': "Review in full assistant";
|
|
662
664
|
readonly 'waitingChange.reviewLabel': "Review the change waiting for your approval";
|
|
663
665
|
readonly 'waitingChange.status': "{{count}} change(s) waiting for your approval";
|
|
666
|
+
readonly 'window.endVoice': "End voice";
|
|
667
|
+
readonly 'window.hideTranscript': "Hide transcript";
|
|
668
|
+
readonly 'window.language': "Language";
|
|
669
|
+
readonly 'window.languageLocked': "Change the language after you end voice";
|
|
670
|
+
readonly 'window.languagePinned': "Replies in {{language}} — change in full assistant";
|
|
671
|
+
readonly 'window.minimize': "Minimize";
|
|
672
|
+
readonly 'window.minimizeEndsVoice': "Minimize (ends voice)";
|
|
673
|
+
readonly 'window.mute': "Mute";
|
|
674
|
+
readonly 'window.openFull': "Open full assistant";
|
|
675
|
+
readonly 'window.showTranscript': "Show transcript";
|
|
676
|
+
readonly 'window.startVoice': "Start voice";
|
|
677
|
+
readonly 'window.stopSpeaking': "Stop speaking";
|
|
678
|
+
readonly 'window.title': "Quick assistant";
|
|
679
|
+
readonly 'window.unmute': "Unmute";
|
|
680
|
+
readonly 'window.view': "View";
|
|
681
|
+
readonly 'window.viewChat': "Chat";
|
|
682
|
+
readonly 'window.viewVoice': "Voice";
|
|
683
|
+
readonly 'window.voiceReadyStatus': "The microphone starts only when you press Start voice.";
|
|
684
|
+
readonly 'window.voiceReadyTitle': "Talk to the assistant";
|
|
685
|
+
readonly 'window.voiceStartedCue': "Started a voice conversation. Your chat is in History.";
|
|
664
686
|
readonly 'writeConsent.body': "In {{mode}} mode the assistant can read AND change your data — creating records, logging activity, updating details, and more, on your behalf.";
|
|
665
687
|
readonly 'writeConsent.cancel': "Stay in {{mode}}";
|
|
666
688
|
readonly 'writeConsent.confirm': "Enable {{mode}}";
|
|
@@ -441,6 +441,7 @@ var g = {
|
|
|
441
441
|
"offer.notAvailable": "{{page}} isn't in your menu right now.",
|
|
442
442
|
"offer.open": "Open {{page}}",
|
|
443
443
|
"overlay.launcher": "AI Assistant",
|
|
444
|
+
"overlay.launcherQuick": "Open quick assistant",
|
|
444
445
|
"overlay.launcherTitle": "AI Assistant ({{shortcut}})",
|
|
445
446
|
"panel.ariaLabel": "AI Assistant",
|
|
446
447
|
"pendingWrite.approve": "Approve this change",
|
|
@@ -552,8 +553,29 @@ var g = {
|
|
|
552
553
|
"voiceSession.transcriptTitle": "Voice transcript",
|
|
553
554
|
"voiceSession.unmute": "Turn the microphone on",
|
|
554
555
|
"waitingChange.review": "Review",
|
|
556
|
+
"waitingChange.reviewInFull": "Review in full assistant",
|
|
555
557
|
"waitingChange.reviewLabel": "Review the change waiting for your approval",
|
|
556
558
|
"waitingChange.status": "{{count}} change(s) waiting for your approval",
|
|
559
|
+
"window.endVoice": "End voice",
|
|
560
|
+
"window.hideTranscript": "Hide transcript",
|
|
561
|
+
"window.language": "Language",
|
|
562
|
+
"window.languageLocked": "Change the language after you end voice",
|
|
563
|
+
"window.languagePinned": "Replies in {{language}} — change in full assistant",
|
|
564
|
+
"window.minimize": "Minimize",
|
|
565
|
+
"window.minimizeEndsVoice": "Minimize (ends voice)",
|
|
566
|
+
"window.mute": "Mute",
|
|
567
|
+
"window.openFull": "Open full assistant",
|
|
568
|
+
"window.showTranscript": "Show transcript",
|
|
569
|
+
"window.startVoice": "Start voice",
|
|
570
|
+
"window.stopSpeaking": "Stop speaking",
|
|
571
|
+
"window.title": "Quick assistant",
|
|
572
|
+
"window.unmute": "Unmute",
|
|
573
|
+
"window.view": "View",
|
|
574
|
+
"window.viewChat": "Chat",
|
|
575
|
+
"window.viewVoice": "Voice",
|
|
576
|
+
"window.voiceReadyStatus": "The microphone starts only when you press Start voice.",
|
|
577
|
+
"window.voiceReadyTitle": "Talk to the assistant",
|
|
578
|
+
"window.voiceStartedCue": "Started a voice conversation. Your chat is in History.",
|
|
557
579
|
"writeConsent.body": "In {{mode}} mode the assistant can read AND change your data — creating records, logging activity, updating details, and more, on your behalf.",
|
|
558
580
|
"writeConsent.cancel": "Stay in {{mode}}",
|
|
559
581
|
"writeConsent.confirm": "Enable {{mode}}",
|
|
@@ -84,6 +84,7 @@ export * from './voice/captionText';
|
|
|
84
84
|
export * from './voice/languagePair';
|
|
85
85
|
export * from './voice/languages';
|
|
86
86
|
export * from './voice/voiceReopen';
|
|
87
|
+
export * from './voice/voiceStartedCue';
|
|
87
88
|
export * from './pendingWrite';
|
|
88
89
|
export * from './liveTurns';
|
|
89
90
|
export * from './images';
|
|
@@ -380,4 +381,9 @@ export * from './ui/compact/AssistantDiscardDraftDialog';
|
|
|
380
381
|
export * from './ui/compact/AssistantMenuView';
|
|
381
382
|
export * from './ui/compact/AssistantVoiceLanguageSettings';
|
|
382
383
|
export * from './ui/compact/AssistantWaitingChangeRow';
|
|
384
|
+
export * from './ui/compact/AssistantWindowHeader';
|
|
385
|
+
export * from './ui/compact/AssistantLanguagePill';
|
|
386
|
+
export * from './ui/compact/AssistantVoiceReady';
|
|
387
|
+
export * from './ui/compact/windowView';
|
|
388
|
+
export * from './ui/useAssistantVisualViewport';
|
|
383
389
|
export * from './ui/compact/waitingChange';
|
|
@@ -5,6 +5,7 @@ import { AssistantNavigate } from './AssistantMarkdownRenderer';
|
|
|
5
5
|
import { AssistantLiveAvatarSeam } from './assistantLiveAvatarSeam';
|
|
6
6
|
import { AssistantPreviewController } from '../preview/types';
|
|
7
7
|
import { AssistantPresentation } from './composer/AssistantComposer';
|
|
8
|
+
import { AssistantSurface, AssistantWindowView } from './assistantOverlayState';
|
|
8
9
|
export type AIAssistantPanelProps = PanelProps & {
|
|
9
10
|
/** When provided, renders a dock/float toggle in the header. */
|
|
10
11
|
docked?: boolean;
|
|
@@ -124,6 +125,31 @@ export type AIAssistantPanelProps = PanelProps & {
|
|
|
124
125
|
* without a host that honours it the control would do nothing.
|
|
125
126
|
*/
|
|
126
127
|
onExpandedChange?: (expanded: boolean) => void;
|
|
128
|
+
/**
|
|
129
|
+
* BOFF-10178 (compact only): which surface the overlay is showing this ONE
|
|
130
|
+
* panel in. `window` is the Quick assistant: a slim header (Open full
|
|
131
|
+
* assistant, Minimize) in place of the full header, no ☰ view, no Expand, no
|
|
132
|
+
* Avatar tab. `panel` or absent is the full assistant. The chat area and the
|
|
133
|
+
* composer are the same instance either way, so a draft, its attachments and
|
|
134
|
+
* a turn in flight survive the switch.
|
|
135
|
+
*/
|
|
136
|
+
surface?: AssistantSurface;
|
|
137
|
+
/** Compact window: switch to the full assistant. Same instance, nothing re-sent. */
|
|
138
|
+
onOpenFull?: () => void;
|
|
139
|
+
/**
|
|
140
|
+
* Compact window: hide the window and keep it mounted (the overlay then passes
|
|
141
|
+
* `visible={false}`). The window has no Close (CW-M), so this is also what
|
|
142
|
+
* Escape does there: it never asks to discard a draft the hidden window keeps.
|
|
143
|
+
*/
|
|
144
|
+
onMinimize?: () => void;
|
|
145
|
+
/**
|
|
146
|
+
* BOFF-10180 (compact window only): the window's LAST USED view (CW-V), or
|
|
147
|
+
* null when none was ever chosen. The first time the window opens on Voice
|
|
148
|
+
* where voice is available here, else on Chat.
|
|
149
|
+
*/
|
|
150
|
+
windowView?: AssistantWindowView | null;
|
|
151
|
+
/** Compact window: the person chose Chat or Voice, so the host remembers it. */
|
|
152
|
+
onWindowViewChange?: (view: AssistantWindowView) => void;
|
|
127
153
|
};
|
|
128
154
|
/**
|
|
129
155
|
* The panel.
|
|
@@ -29,239 +29,276 @@ import { AssistantCompactHeader as Pe } from "./compact/AssistantCompactHeader.j
|
|
|
29
29
|
import { AssistantConversationMenu as Fe } from "./compact/AssistantConversationMenu.js";
|
|
30
30
|
import { AssistantDiscardDraftDialog as Ie } from "./compact/AssistantDiscardDraftDialog.js";
|
|
31
31
|
import { AssistantMenuView as Le } from "./compact/AssistantMenuView.js";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
32
|
+
import { AssistantWindowHeader as Re } from "./compact/AssistantWindowHeader.js";
|
|
33
|
+
import { WINDOW_VOICE_IDLE as ze, useAssistantWindowView as Be } from "./compact/windowView.js";
|
|
34
|
+
import { useCallback as n, useEffect as r, useId as Ve, useMemo as i, useRef as a, useState as o } from "react";
|
|
35
|
+
import { Fragment as He, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
34
36
|
//#region src/shared/assistant/ui/AIAssistantPanel.tsx
|
|
35
|
-
var l = ({ onClose: l, visible: u, docked:
|
|
36
|
-
let
|
|
37
|
-
Te(
|
|
38
|
-
let [
|
|
39
|
-
|
|
40
|
-
let
|
|
41
|
-
me(_e(
|
|
42
|
-
let
|
|
43
|
-
e(
|
|
44
|
-
let { conversations:
|
|
45
|
-
|
|
46
|
-
let
|
|
37
|
+
var Ue = { backgroundColor: "var(--color-bg-elevated)" }, l = ({ onClose: l, visible: u, docked: We, onToggleDock: d, writeAccess: Ge, onNavigate: Ke, isShellLessTarget: qe, connectSourceHref: Je, onConnectSource: Ye, preview: f, liveAvatar: p, presentation: m, onExpandedChange: h, surface: g, onOpenFull: Xe, onMinimize: _, windowView: Ze, onWindowViewChange: Qe, serverHistory: $e = !1 }) => {
|
|
38
|
+
let v = te(), et = de(p);
|
|
39
|
+
Te($e);
|
|
40
|
+
let [tt, y] = o(!1), b = ge(f);
|
|
41
|
+
tt && !b && y(!1);
|
|
42
|
+
let x = tt && b;
|
|
43
|
+
me(_e(f, ve()));
|
|
44
|
+
let S = a(null);
|
|
45
|
+
e(S);
|
|
46
|
+
let { conversations: nt, activeConversationId: rt, conversationListOpen: C, setConversationListOpen: w, createConversation: T } = ne(), E = m === "compact", D = E && g === "window", [it, O] = o(!1), k = a(!1);
|
|
47
|
+
it && (!E || D || C || x) && O(!1);
|
|
48
|
+
let A = E && it, [at, ot] = o(!1), j = je(E && !D && h !== void 0), [M, st] = o(!1), N = j && M;
|
|
47
49
|
r(() => {
|
|
48
|
-
M && !j && (
|
|
50
|
+
M && !j && (st(!1), h?.(!1));
|
|
49
51
|
}, [
|
|
50
52
|
M,
|
|
51
53
|
j,
|
|
52
|
-
|
|
54
|
+
h
|
|
53
55
|
]);
|
|
54
|
-
let
|
|
55
|
-
let e = !
|
|
56
|
-
|
|
57
|
-
},
|
|
56
|
+
let ct = () => {
|
|
57
|
+
let e = !N;
|
|
58
|
+
st(e), h?.(e);
|
|
59
|
+
}, lt = a(!1), ut = a(h);
|
|
58
60
|
r(() => {
|
|
59
|
-
|
|
61
|
+
lt.current = N, ut.current = h;
|
|
60
62
|
}), r(() => () => {
|
|
61
|
-
|
|
63
|
+
lt.current && ut.current?.(!1);
|
|
62
64
|
}, []);
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
let
|
|
66
|
-
chatTab: `${
|
|
67
|
-
avatarTab: `${
|
|
68
|
-
chatPanel: `${
|
|
69
|
-
avatarPanel: `${
|
|
70
|
-
leaveHint: `${
|
|
71
|
-
} : null, [
|
|
72
|
-
|
|
73
|
-
}, []),
|
|
74
|
-
open:
|
|
75
|
-
close:
|
|
76
|
-
ids:
|
|
77
|
-
covered:
|
|
78
|
-
setReplyEscape:
|
|
65
|
+
let P = C || x || A, F = p?.tab, dt = fe(F), [I, L] = o(!1);
|
|
66
|
+
I && (!F || u === !1 || D) && L(!1);
|
|
67
|
+
let R = F !== void 0 && (dt || I), z = Ve(), ft = Ve(), B = i(() => R ? {
|
|
68
|
+
chatTab: `${z}-chat-tab`,
|
|
69
|
+
avatarTab: `${z}-avatar-tab`,
|
|
70
|
+
chatPanel: `${z}-chat-panel`,
|
|
71
|
+
avatarPanel: `${z}-avatar-panel`,
|
|
72
|
+
leaveHint: `${z}-avatar-leave`
|
|
73
|
+
} : null, [R, z]), pt = n(() => L(!1), []), V = a(null), mt = n((e) => {
|
|
74
|
+
V.current = e;
|
|
75
|
+
}, []), ht = i(() => ({
|
|
76
|
+
open: I,
|
|
77
|
+
close: pt,
|
|
78
|
+
ids: B,
|
|
79
|
+
covered: P,
|
|
80
|
+
setReplyEscape: mt
|
|
79
81
|
}), [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
]),
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
historyOpen:
|
|
89
|
-
previewOpen:
|
|
90
|
-
avatarOpen:
|
|
91
|
-
}) ?? (
|
|
82
|
+
I,
|
|
83
|
+
pt,
|
|
84
|
+
B,
|
|
85
|
+
P,
|
|
86
|
+
mt
|
|
87
|
+
]), gt = (e) => L(e === "avatar"), _t = () => {
|
|
88
|
+
O(!1), gt("avatar"), k.current = !0;
|
|
89
|
+
}, vt = oe({
|
|
90
|
+
historyOpen: C,
|
|
91
|
+
previewOpen: x,
|
|
92
|
+
avatarOpen: I
|
|
93
|
+
}) ?? (A ? "menu" : null), H = (e) => {
|
|
92
94
|
let t = ce({
|
|
93
|
-
historyOpen:
|
|
94
|
-
previewOpen:
|
|
95
|
+
historyOpen: C,
|
|
96
|
+
previewOpen: x
|
|
95
97
|
}, e);
|
|
96
|
-
|
|
98
|
+
w(t.historyOpen), y(t.previewOpen);
|
|
97
99
|
};
|
|
98
|
-
t("assistant.history", i(() => ({ run: () =>
|
|
100
|
+
t("assistant.history", i(() => ({ run: () => C ? { status: "already" } : (w(!0), y(!1), { status: "done" }) }), [C, w])), t("assistant.preview", i(() => b ? {
|
|
99
101
|
surface: "panel",
|
|
100
|
-
run: () =>
|
|
101
|
-
close: () =>
|
|
102
|
+
run: () => x ? { status: "already" } : (w(!1), y(!0), { status: "done" }),
|
|
103
|
+
close: () => x ? (y(!1), { status: "done" }) : { status: "already" }
|
|
102
104
|
} : null, [
|
|
103
|
-
y,
|
|
104
105
|
b,
|
|
105
|
-
|
|
106
|
+
x,
|
|
107
|
+
w
|
|
106
108
|
]));
|
|
107
|
-
let
|
|
108
|
-
Oe(
|
|
109
|
-
let
|
|
110
|
-
|
|
111
|
-
}, []),
|
|
112
|
-
compact:
|
|
113
|
-
unsent:
|
|
114
|
-
confirmed:
|
|
115
|
-
}) === "close" ? !1 : (
|
|
109
|
+
let yt = nt.find((e) => e.id === rt);
|
|
110
|
+
Oe(yt?.backendSessionId ?? null, yt?.mode ?? null, u ?? !0), Ee(u ?? !0);
|
|
111
|
+
let bt = ee(u !== !1), U = Ne(), W = a(!1), xt = n((e) => {
|
|
112
|
+
W.current = e;
|
|
113
|
+
}, []), G = a(!1), [St, K] = o(!1), q = n(() => Ae({
|
|
114
|
+
compact: E,
|
|
115
|
+
unsent: W.current,
|
|
116
|
+
confirmed: G.current
|
|
117
|
+
}) === "close" ? !1 : (K(!0), !0), [E]);
|
|
116
118
|
r(() => {
|
|
117
|
-
if (!(!
|
|
119
|
+
if (!(!E || !U)) return U(q);
|
|
118
120
|
}, [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
E,
|
|
122
|
+
U,
|
|
123
|
+
q
|
|
122
124
|
]);
|
|
123
|
-
let
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
let J = n(() => {
|
|
126
|
+
if (D && _) {
|
|
127
|
+
_();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
q() || l();
|
|
131
|
+
}, [
|
|
132
|
+
D,
|
|
133
|
+
_,
|
|
134
|
+
q,
|
|
135
|
+
l
|
|
136
|
+
]), Ct = () => {
|
|
137
|
+
G.current = !0, W.current = !1, K(!1);
|
|
127
138
|
try {
|
|
128
139
|
l();
|
|
129
140
|
} finally {
|
|
130
|
-
|
|
141
|
+
G.current = !1;
|
|
131
142
|
}
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
}, [w,
|
|
135
|
-
|
|
136
|
-
}, []),
|
|
143
|
+
}, Y = a(null), wt = a(null), Tt = a(null), Et = n(() => O(!1), []), [Dt, X] = o(0), Ot = n(() => {
|
|
144
|
+
T(), O(!1), w(!1), X((e) => e + 1);
|
|
145
|
+
}, [T, w]), [Z, kt] = o(ze), At = n((e) => {
|
|
146
|
+
kt((t) => t.available === e.available && t.live === e.live ? t : e);
|
|
147
|
+
}, []), Q = Be({
|
|
148
|
+
stored: Ze ?? null,
|
|
149
|
+
onRemember: Qe,
|
|
150
|
+
voice: Z
|
|
151
|
+
}), jt = n((e) => {
|
|
152
|
+
Xe?.(), !Z.live && e?.review !== !0 && X((e) => e + 1);
|
|
153
|
+
}, [Xe, Z.live]), $ = Q.remember, Mt = n(() => $("chat"), [$]), Nt = n(() => {
|
|
154
|
+
$("chat"), X((e) => e + 1);
|
|
155
|
+
}, [$]), Pt = n(() => {
|
|
156
|
+
O(!1), ot(!0);
|
|
157
|
+
}, []), Ft = a(!1);
|
|
137
158
|
return r(() => {
|
|
138
|
-
if (
|
|
159
|
+
if (Ft.current && !A) {
|
|
139
160
|
let e = document.activeElement;
|
|
140
|
-
(!e || e === document.body || e ===
|
|
161
|
+
(!e || e === document.body || e === S.current) && wt.current?.focus({ preventScroll: !0 });
|
|
141
162
|
}
|
|
142
|
-
|
|
143
|
-
}, [
|
|
144
|
-
|
|
145
|
-
}, [
|
|
146
|
-
!
|
|
147
|
-
}, [
|
|
148
|
-
panelRef:
|
|
149
|
-
inputRef:
|
|
150
|
-
onNewConversation:
|
|
151
|
-
onOpenConversationMenu:
|
|
163
|
+
Ft.current = A;
|
|
164
|
+
}, [A]), r(() => {
|
|
165
|
+
Dt > 0 && Y.current?.focus({ preventScroll: !0 });
|
|
166
|
+
}, [Dt]), r(() => {
|
|
167
|
+
!k.current || !I || !B || (k.current = !1, document.getElementById(B.avatarTab)?.focus({ preventScroll: !0 }));
|
|
168
|
+
}, [I, B]), ke({
|
|
169
|
+
panelRef: S,
|
|
170
|
+
inputRef: E ? Y : void 0,
|
|
171
|
+
onNewConversation: E ? Ot : void 0,
|
|
172
|
+
onOpenConversationMenu: E && !D ? Pt : void 0,
|
|
152
173
|
onClose: () => {
|
|
153
174
|
let e = se({
|
|
154
|
-
historyOpen:
|
|
155
|
-
previewOpen:
|
|
156
|
-
avatarOpen:
|
|
157
|
-
tabReplySpeaking:
|
|
175
|
+
historyOpen: C,
|
|
176
|
+
previewOpen: x,
|
|
177
|
+
avatarOpen: I,
|
|
178
|
+
tabReplySpeaking: V.current !== null
|
|
158
179
|
});
|
|
159
180
|
if (e === "overlay") {
|
|
160
|
-
|
|
181
|
+
w(!1), y(!1);
|
|
161
182
|
return;
|
|
162
183
|
}
|
|
163
184
|
if (e === "tab-reply") {
|
|
164
|
-
|
|
185
|
+
V.current?.();
|
|
165
186
|
return;
|
|
166
187
|
}
|
|
167
188
|
if (e === "tab") {
|
|
168
|
-
|
|
189
|
+
L(!1), B && document.getElementById(B.chatTab)?.focus();
|
|
169
190
|
return;
|
|
170
191
|
}
|
|
171
|
-
if (
|
|
172
|
-
|
|
192
|
+
if (A) {
|
|
193
|
+
O(!1);
|
|
173
194
|
return;
|
|
174
195
|
}
|
|
175
|
-
|
|
196
|
+
J();
|
|
176
197
|
}
|
|
177
198
|
}), /* @__PURE__ */ s(re, {
|
|
178
199
|
visible: u ?? !0,
|
|
179
|
-
engine:
|
|
200
|
+
engine: et,
|
|
180
201
|
children: /* @__PURE__ */ s(le, {
|
|
181
|
-
value:
|
|
202
|
+
value: p,
|
|
182
203
|
children: /* @__PURE__ */ s(ue.Provider, {
|
|
183
|
-
value:
|
|
204
|
+
value: ht,
|
|
184
205
|
children: /* @__PURE__ */ s(pe, {
|
|
185
|
-
value:
|
|
206
|
+
value: f,
|
|
186
207
|
children: /* @__PURE__ */ s(we, {
|
|
187
|
-
navigate:
|
|
188
|
-
isShellLessTarget:
|
|
208
|
+
navigate: Ke,
|
|
209
|
+
isShellLessTarget: qe,
|
|
189
210
|
children: /* @__PURE__ */ s(he, {
|
|
190
|
-
value:
|
|
191
|
-
onOpen:
|
|
211
|
+
value: Je,
|
|
212
|
+
onOpen: Ye,
|
|
192
213
|
children: /* @__PURE__ */ s(Se, { children: /* @__PURE__ */ s(Ce, { children: /* @__PURE__ */ c("div", {
|
|
193
|
-
ref:
|
|
214
|
+
ref: S,
|
|
194
215
|
className: "relative flex h-full w-full flex-col bg-bg-surface",
|
|
216
|
+
style: D ? Ue : void 0,
|
|
195
217
|
role: "complementary",
|
|
196
|
-
"aria-label":
|
|
218
|
+
"aria-label": D ? v("window.title", "Quick assistant") : v("panel.ariaLabel", "AI Assistant"),
|
|
197
219
|
"data-testid": "ai-assistant-panel",
|
|
198
220
|
[ae]: "",
|
|
199
|
-
...
|
|
200
|
-
...
|
|
221
|
+
...vt ? { [ie]: vt } : {},
|
|
222
|
+
...E ? {
|
|
201
223
|
"data-presentation": "compact",
|
|
202
|
-
...
|
|
224
|
+
...g ? { "data-assistant-surface": g } : {},
|
|
225
|
+
...N ? { "data-assistant-expanded": "" } : {}
|
|
203
226
|
} : {},
|
|
204
227
|
tabIndex: -1,
|
|
205
228
|
children: [
|
|
206
229
|
/* @__PURE__ */ c("div", {
|
|
207
230
|
className: "contents",
|
|
208
|
-
inert:
|
|
209
|
-
children: [
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
231
|
+
inert: P || void 0,
|
|
232
|
+
children: [E ? /* @__PURE__ */ c(He, { children: [D ? /* @__PURE__ */ s(Re, {
|
|
233
|
+
view: Q.view,
|
|
234
|
+
onSelectView: Q.select,
|
|
235
|
+
voiceLive: Z.live,
|
|
236
|
+
onOpenFull: jt,
|
|
237
|
+
onMinimize: () => _?.()
|
|
238
|
+
}) : /* @__PURE__ */ s(Pe, {
|
|
239
|
+
contextLabel: bt,
|
|
240
|
+
menuOpen: A,
|
|
241
|
+
menuViewId: ft,
|
|
242
|
+
onOpenMenu: () => O(!0),
|
|
243
|
+
menuButtonRef: wt,
|
|
215
244
|
conversationMenu: /* @__PURE__ */ s(Fe, {
|
|
216
|
-
open:
|
|
217
|
-
onOpenChange:
|
|
218
|
-
triggerRef:
|
|
245
|
+
open: at,
|
|
246
|
+
onOpenChange: ot,
|
|
247
|
+
triggerRef: Tt
|
|
219
248
|
}),
|
|
220
249
|
expandOffered: j,
|
|
221
|
-
expanded:
|
|
222
|
-
onToggleExpanded:
|
|
223
|
-
onTogglePreview: () =>
|
|
224
|
-
previewOpen:
|
|
225
|
-
onClose:
|
|
250
|
+
expanded: N,
|
|
251
|
+
onToggleExpanded: ct,
|
|
252
|
+
onTogglePreview: () => H("preview"),
|
|
253
|
+
previewOpen: x,
|
|
254
|
+
onClose: J
|
|
226
255
|
}), /* @__PURE__ */ s(Ie, {
|
|
227
|
-
open:
|
|
228
|
-
onKeep: () =>
|
|
229
|
-
onDiscard:
|
|
256
|
+
open: St,
|
|
257
|
+
onKeep: () => K(!1),
|
|
258
|
+
onDiscard: Ct
|
|
230
259
|
})] }) : /* @__PURE__ */ s(be, {
|
|
231
|
-
contextLabel:
|
|
232
|
-
onNewConversation: () =>
|
|
233
|
-
onOpenHistory: () =>
|
|
234
|
-
historyOpen:
|
|
235
|
-
onTogglePreview: () =>
|
|
236
|
-
previewOpen:
|
|
260
|
+
contextLabel: bt,
|
|
261
|
+
onNewConversation: () => T(),
|
|
262
|
+
onOpenHistory: () => H("history"),
|
|
263
|
+
historyOpen: C,
|
|
264
|
+
onTogglePreview: () => H("preview"),
|
|
265
|
+
previewOpen: x,
|
|
237
266
|
onClose: l,
|
|
238
|
-
docked:
|
|
239
|
-
onToggleDock:
|
|
240
|
-
}),
|
|
241
|
-
selected:
|
|
242
|
-
onSelect:
|
|
243
|
-
ids:
|
|
267
|
+
docked: We,
|
|
268
|
+
onToggleDock: d
|
|
269
|
+
}), B && !D ? /* @__PURE__ */ s(De, {
|
|
270
|
+
selected: I ? "avatar" : "chat",
|
|
271
|
+
onSelect: gt,
|
|
272
|
+
ids: B
|
|
244
273
|
}) : null]
|
|
245
274
|
}),
|
|
246
|
-
|
|
247
|
-
id:
|
|
248
|
-
onClose:
|
|
249
|
-
onRequestClosePanel:
|
|
250
|
-
onNewConversation:
|
|
251
|
-
onOpenAvatar:
|
|
252
|
-
docked:
|
|
253
|
-
onToggleDock:
|
|
275
|
+
C ? /* @__PURE__ */ s(xe, { presentation: m }) : A ? /* @__PURE__ */ s(Le, {
|
|
276
|
+
id: ft,
|
|
277
|
+
onClose: Et,
|
|
278
|
+
onRequestClosePanel: J,
|
|
279
|
+
onNewConversation: Ot,
|
|
280
|
+
onOpenAvatar: R ? _t : void 0,
|
|
281
|
+
docked: We,
|
|
282
|
+
onToggleDock: d
|
|
254
283
|
}) : null,
|
|
255
|
-
|
|
284
|
+
x && /* @__PURE__ */ s(ye, { onClose: () => y(!1) }),
|
|
256
285
|
/* @__PURE__ */ s("div", {
|
|
257
286
|
className: "contents",
|
|
258
|
-
inert:
|
|
287
|
+
inert: P || void 0,
|
|
259
288
|
children: /* @__PURE__ */ s(Me, {
|
|
260
289
|
visible: u ?? !0,
|
|
261
|
-
writeAccess:
|
|
262
|
-
presentation:
|
|
263
|
-
inputRef:
|
|
264
|
-
onDraftDirtyChange:
|
|
290
|
+
writeAccess: Ge,
|
|
291
|
+
presentation: m,
|
|
292
|
+
inputRef: E ? Y : void 0,
|
|
293
|
+
onDraftDirtyChange: E ? xt : void 0,
|
|
294
|
+
...D ? {
|
|
295
|
+
surface: g,
|
|
296
|
+
windowView: Q.view,
|
|
297
|
+
onWindowVoiceChange: At,
|
|
298
|
+
onOpenFull: jt,
|
|
299
|
+
onContinuedInChat: Nt,
|
|
300
|
+
onShowChat: Mt
|
|
301
|
+
} : {}
|
|
265
302
|
})
|
|
266
303
|
})
|
|
267
304
|
]
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { FC, Ref } from 'react';
|
|
2
2
|
import { AssistantPresentation } from './composer/AssistantComposer';
|
|
3
|
+
import { WindowVoiceState } from './compact/windowView';
|
|
4
|
+
import { AssistantSurface, AssistantWindowView } from './assistantOverlayState';
|
|
3
5
|
import { WorkspaceWriteAccess } from '../useWorkspaceWriteAccess';
|
|
4
6
|
/**
|
|
5
7
|
* `visible` is false when the host HIDES the panel without unmounting it, which
|
|
@@ -40,5 +42,36 @@ export interface AssistantChatAreaProps {
|
|
|
40
42
|
* lifting it. Absent: nothing is reported.
|
|
41
43
|
*/
|
|
42
44
|
onDraftDirtyChange?: (dirty: boolean) => void;
|
|
45
|
+
/**
|
|
46
|
+
* BOFF-10180 (compact only): which surface the overlay shows the panel in. With
|
|
47
|
+
* `window`, this chat area is the Quick assistant window's: its view follows
|
|
48
|
+
* `windowView`, voice is reported through `onWindowVoiceChange`, and the waiting
|
|
49
|
+
* change's button opens the full assistant. Absent, in the full panel and in
|
|
50
|
+
* classic, nothing below is reached.
|
|
51
|
+
*/
|
|
52
|
+
surface?: AssistantSurface;
|
|
53
|
+
/** Window only: Chat (the conversation and its composer) or Voice (the stage). */
|
|
54
|
+
windowView?: AssistantWindowView;
|
|
55
|
+
/**
|
|
56
|
+
* Window only: told whether voice can start here and whether a session is live.
|
|
57
|
+
* The header's toggle, the language pill and Minimize's "(ends voice)" read it.
|
|
58
|
+
*/
|
|
59
|
+
onWindowVoiceChange?: (state: WindowVoiceState) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Window only: "Review in full assistant" — the same instance, shown as the full panel.
|
|
62
|
+
* `review: true` says the person is going to a waiting change, so the panel leaves the
|
|
63
|
+
* message box alone and this chat area focuses the card.
|
|
64
|
+
*/
|
|
65
|
+
onOpenFull?: (options?: {
|
|
66
|
+
review?: boolean;
|
|
67
|
+
}) => void;
|
|
68
|
+
/** Window only: told when Continue in chat has written its note and ended voice. */
|
|
69
|
+
onContinuedInChat?: () => void;
|
|
70
|
+
/**
|
|
71
|
+
* Window only: a turn started while the Voice view hides the thread (a typed message
|
|
72
|
+
* sent from the box under the stage), so the window must show Chat: its reply is in
|
|
73
|
+
* the thread.
|
|
74
|
+
*/
|
|
75
|
+
onShowChat?: () => void;
|
|
43
76
|
}
|
|
44
77
|
export declare const AssistantChatArea: FC<AssistantChatAreaProps>;
|