@burdenoff/fe-libs 2026.1114.3 → 2026.1114.5
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/ui/AIAssistantPanel.js +149 -156
- package/dist/shared/assistant/ui/AssistantChatArea.js +0 -1
- package/dist/shared/assistant/ui/assistantPageLayout.d.ts +1 -1
- package/dist/shared/assistant/ui/avatar/AssistantCompactAvatar.d.ts +0 -6
- package/dist/shared/assistant/ui/avatar/AssistantCompactAvatar.js +71 -77
- package/dist/shared/assistant/ui/compact/AssistantPageBar.d.ts +0 -2
- package/dist/shared/assistant/ui/compact/AssistantPageBar.js +9 -10
- package/dist/shared/assistant/ui/compact/AssistantViewSwitch.d.ts +0 -5
- package/dist/shared/assistant/ui/compact/AssistantViewSwitch.js +11 -11
- package/dist/shared/graphql/client.js +188 -185
- package/dist/shared/graphql/links/sse-link.d.ts +16 -0
- package/dist/shared/graphql/links/sse-link.js +37 -27
- package/dist/shared/utils/backendErrors.js +1 -1
- package/package.json +1 -1
|
@@ -7,120 +7,114 @@ import { clearReplyRequests as a } from "../../speech/replySpeechRequests.js";
|
|
|
7
7
|
import { AvatarCompactAskBox as o } from "./AvatarCompactAskBox.js";
|
|
8
8
|
import { AvatarTabLastExchange as s } from "./AvatarTabLastExchange.js";
|
|
9
9
|
import { useAvatarTabExchange as c } from "./avatarTabExchange.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
|
+
import { useEffect as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
|
|
11
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
12
|
// src/shared/assistant/ui/avatar/AssistantCompactAvatar.tsx
|
|
14
|
-
var
|
|
15
|
-
function
|
|
13
|
+
var h = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
function g() {
|
|
16
15
|
if (typeof document > "u") return !1;
|
|
17
16
|
let e = document.activeElement;
|
|
18
17
|
return e === null || e === document.body || !e.isConnected || e.hasAttribute("data-assistant-panel");
|
|
19
18
|
}
|
|
20
|
-
var
|
|
19
|
+
var _ = ({ state: e, restored: t }) => {
|
|
21
20
|
let n = i(), r = e === "thinking" ? n.askThinking : e === "not-spoken" ? n.askNotSpoken : e === "cut" ? n.askCut : e === "not-heard" ? n.askNotHeard : e === "failed" ? t ? n.askFailed : n.askFailedInChat : "";
|
|
22
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ p("p", {
|
|
23
22
|
className: "sr-only",
|
|
24
23
|
"aria-live": "polite",
|
|
25
24
|
"aria-atomic": "true",
|
|
26
25
|
"data-testid": "assistant-avatar-tab-ask-live",
|
|
27
26
|
children: r
|
|
28
27
|
});
|
|
29
|
-
},
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(
|
|
28
|
+
}, v = ({ tab: i, CompactView: v, ids: y, compact: b, shown: x, voice: S, mute: C, ask: w, footer: T }) => {
|
|
29
|
+
let E = d(null), D = d(null), O = e(), k = b.surface === "window", A = n(y);
|
|
30
|
+
u(() => (h.set(i, (h.get(i) ?? 0) + 1), i.setOpen(!0, { compact: !0 }), () => {
|
|
31
|
+
h.set(i, (h.get(i) ?? 1) - 1), queueMicrotask(() => {
|
|
32
|
+
(h.get(i) ?? 0) > 0 || (i.setOpen(!1), a());
|
|
34
33
|
});
|
|
35
34
|
}), [i]);
|
|
36
|
-
let
|
|
35
|
+
let j = d(null), M = b.focusRequest ?? 0, N = d(M);
|
|
36
|
+
l(() => {
|
|
37
|
+
N.current !== M && (N.current = M, (E.current ?? j.current ?? document.getElementById(A.avatarTab))?.focus({ preventScroll: !0 }));
|
|
38
|
+
}, [M, A.avatarTab]);
|
|
39
|
+
let P = d(S.live);
|
|
40
|
+
l(() => {
|
|
41
|
+
let e = P.current;
|
|
42
|
+
P.current = S.live, e && !S.live && g() && (D.current ?? E.current)?.focus();
|
|
43
|
+
}, [S.live]);
|
|
44
|
+
let F = c(w?.last ?? null, w?.navigatingReplyId ?? null), I = S.live ? void 0 : w, [L, R] = f(null), z = F?.state === "failed" ? F.exchange.replyId : null, B = F?.question ?? "", V = w?.draft;
|
|
37
45
|
u(() => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
b.avatarTab,
|
|
43
|
-
D
|
|
44
|
-
]);
|
|
45
|
-
let I = f(C.live);
|
|
46
|
-
u(() => {
|
|
47
|
-
let e = I.current;
|
|
48
|
-
I.current = C.live, e && !C.live && _() && (k.current ?? O.current)?.focus();
|
|
49
|
-
}, [C.live]);
|
|
50
|
-
let L = c(T?.last ?? null, T?.navigatingReplyId ?? null), R = C.live ? void 0 : T, [z, B] = p(null), V = L?.state === "failed" ? L.exchange.replyId : null, H = L?.question ?? "", U = T?.draft;
|
|
51
|
-
d(() => {
|
|
52
|
-
if (V === null || U === void 0 || z?.replyId === V) return;
|
|
53
|
-
let e = U.get().trim() === "";
|
|
54
|
-
e && U.set(H), B({
|
|
55
|
-
replyId: V,
|
|
46
|
+
if (z === null || V === void 0 || L?.replyId === z) return;
|
|
47
|
+
let e = V.get().trim() === "";
|
|
48
|
+
e && V.set(B), R({
|
|
49
|
+
replyId: z,
|
|
56
50
|
restored: e
|
|
57
51
|
});
|
|
58
52
|
}, [
|
|
53
|
+
z,
|
|
54
|
+
B,
|
|
59
55
|
V,
|
|
60
|
-
|
|
61
|
-
U,
|
|
62
|
-
z
|
|
56
|
+
L
|
|
63
57
|
]);
|
|
64
|
-
let
|
|
65
|
-
...
|
|
66
|
-
...
|
|
67
|
-
open:
|
|
68
|
-
toggle: () =>
|
|
58
|
+
let H = L === null || L.replyId !== z || L.restored, [U, W] = f(null), G = U ?? !k, K = {
|
|
59
|
+
...C ? { mute: C } : {},
|
|
60
|
+
...I ? { transcript: {
|
|
61
|
+
open: G,
|
|
62
|
+
toggle: () => W(!G)
|
|
69
63
|
} } : {}
|
|
70
64
|
};
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
className: `absolute inset-0 z-[5] flex flex-col ${
|
|
65
|
+
return /* @__PURE__ */ m("div", {
|
|
66
|
+
className: `absolute inset-0 z-[5] flex flex-col ${k ? "bg-bg-elevated" : "bg-bg-surface"}`,
|
|
73
67
|
"data-testid": "assistant-avatar-tab",
|
|
74
68
|
"data-presentation": "compact",
|
|
75
|
-
"data-surface":
|
|
69
|
+
"data-surface": b.surface,
|
|
76
70
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ m("div", {
|
|
78
72
|
role: "tabpanel",
|
|
79
|
-
id:
|
|
80
|
-
"aria-labelledby":
|
|
73
|
+
id: y.avatarPanel,
|
|
74
|
+
"aria-labelledby": A.avatarTab,
|
|
81
75
|
className: "flex min-h-0 flex-1 flex-col",
|
|
82
76
|
"data-testid": "assistant-avatar-tab-column",
|
|
83
|
-
children: [/* @__PURE__ */
|
|
84
|
-
shown:
|
|
85
|
-
voice:
|
|
86
|
-
leaveHintId:
|
|
87
|
-
surface:
|
|
88
|
-
onOpenSettings:
|
|
89
|
-
navigate:
|
|
90
|
-
controls:
|
|
91
|
-
switchRef:
|
|
92
|
-
}),
|
|
77
|
+
children: [/* @__PURE__ */ p(v, {
|
|
78
|
+
shown: x,
|
|
79
|
+
voice: S,
|
|
80
|
+
leaveHintId: y.leaveHint,
|
|
81
|
+
surface: b.surface,
|
|
82
|
+
onOpenSettings: b.openSettings,
|
|
83
|
+
navigate: O,
|
|
84
|
+
controls: K,
|
|
85
|
+
switchRef: j
|
|
86
|
+
}), I && G ? /* @__PURE__ */ p("div", {
|
|
93
87
|
className: "max-h-[40%] shrink-0 overflow-y-auto px-4 pb-1",
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
-
view:
|
|
88
|
+
children: /* @__PURE__ */ p(s, {
|
|
89
|
+
view: F,
|
|
96
90
|
invite: !1,
|
|
97
|
-
restored:
|
|
98
|
-
focusAfterStop:
|
|
99
|
-
},
|
|
91
|
+
restored: H,
|
|
92
|
+
focusAfterStop: E
|
|
93
|
+
}, F?.exchange.replyId ?? "none")
|
|
100
94
|
}) : null]
|
|
101
95
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
voiceLive:
|
|
104
|
-
children:
|
|
105
|
-
selected:
|
|
106
|
-
onSelect:
|
|
107
|
-
ids:
|
|
96
|
+
/* @__PURE__ */ p(r, {
|
|
97
|
+
voiceLive: S.live,
|
|
98
|
+
children: /* @__PURE__ */ p(t, {
|
|
99
|
+
selected: b.view,
|
|
100
|
+
onSelect: b.selectView,
|
|
101
|
+
ids: y,
|
|
108
102
|
instance: "avatar"
|
|
109
103
|
})
|
|
110
104
|
}),
|
|
111
|
-
|
|
112
|
-
ask:
|
|
113
|
-
inputRef:
|
|
114
|
-
voice:
|
|
115
|
-
waveRef:
|
|
116
|
-
windowSurface:
|
|
105
|
+
I ? /* @__PURE__ */ p(o, {
|
|
106
|
+
ask: I,
|
|
107
|
+
inputRef: E,
|
|
108
|
+
voice: S,
|
|
109
|
+
waveRef: D,
|
|
110
|
+
windowSurface: k
|
|
117
111
|
}) : null,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
state:
|
|
121
|
-
restored:
|
|
112
|
+
T,
|
|
113
|
+
w ? /* @__PURE__ */ p(_, {
|
|
114
|
+
state: F?.state ?? null,
|
|
115
|
+
restored: H
|
|
122
116
|
}) : null
|
|
123
117
|
]
|
|
124
118
|
});
|
|
125
119
|
};
|
|
126
|
-
export {
|
|
120
|
+
export { v as AssistantCompactAvatar };
|
|
@@ -4,8 +4,6 @@ export interface AssistantPageBarProps {
|
|
|
4
4
|
menuViewId?: string;
|
|
5
5
|
onOpenMenu: () => void;
|
|
6
6
|
menuButtonRef?: Ref<HTMLButtonElement>;
|
|
7
|
-
/** The Chat | Avatar switch, or nothing where the avatar is not offered. */
|
|
8
|
-
viewSwitch?: ReactNode;
|
|
9
7
|
conversationMenu: ReactNode;
|
|
10
8
|
onTogglePreview?: () => void;
|
|
11
9
|
previewOpen?: boolean;
|
|
@@ -4,8 +4,8 @@ import { hasAssistantPreviewSurface as n } from "../../preview/types.js";
|
|
|
4
4
|
import { Eye as r, Menu as i } from "lucide-react";
|
|
5
5
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
6
|
// src/shared/assistant/ui/compact/AssistantPageBar.tsx
|
|
7
|
-
var s = "flex size-10 shrink-0 items-center justify-center rounded-button transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", c = "text-text-secondary hover:bg-bg-sunken hover:text-text-primary", l = "bg-action-primary-bg/15 text-action-primary-bg", u = ({ menuOpen: u, menuViewId: d, onOpenMenu: f, menuButtonRef: p,
|
|
8
|
-
let
|
|
7
|
+
var s = "flex size-10 shrink-0 items-center justify-center rounded-button transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", c = "text-text-secondary hover:bg-bg-sunken hover:text-text-primary", l = "bg-action-primary-bg/15 text-action-primary-bg", u = ({ menuOpen: u, menuViewId: d, onOpenMenu: f, menuButtonRef: p, conversationMenu: m, onTogglePreview: h, previewOpen: g }) => {
|
|
8
|
+
let _ = e(), v = t();
|
|
9
9
|
return /* @__PURE__ */ o("div", {
|
|
10
10
|
className: "flex min-h-14 shrink-0 items-center gap-1 px-2 py-2 sm:px-3",
|
|
11
11
|
"data-testid": "assistant-page-bar",
|
|
@@ -16,7 +16,7 @@ var s = "flex size-10 shrink-0 items-center justify-center rounded-button transi
|
|
|
16
16
|
type: "button",
|
|
17
17
|
onClick: f,
|
|
18
18
|
className: `${s} ${c}`,
|
|
19
|
-
"aria-label":
|
|
19
|
+
"aria-label": _("header.menu", "Assistant menu"),
|
|
20
20
|
"aria-expanded": u,
|
|
21
21
|
"aria-controls": u ? d : void 0,
|
|
22
22
|
"data-testid": "assistant-menu",
|
|
@@ -25,21 +25,20 @@ var s = "flex size-10 shrink-0 items-center justify-center rounded-button transi
|
|
|
25
25
|
"aria-hidden": "true"
|
|
26
26
|
})
|
|
27
27
|
}),
|
|
28
|
-
m ?? null,
|
|
29
28
|
/* @__PURE__ */ a("span", { className: "flex-1" }),
|
|
30
|
-
n(
|
|
29
|
+
n(v) && h ? /* @__PURE__ */ a("button", {
|
|
31
30
|
type: "button",
|
|
32
|
-
onClick:
|
|
33
|
-
className: `${s} ${
|
|
34
|
-
"aria-label":
|
|
35
|
-
"aria-pressed": !!
|
|
31
|
+
onClick: h,
|
|
32
|
+
className: `${s} ${g ? l : c}`,
|
|
33
|
+
"aria-label": v.label ?? _("header.preview", "Preview"),
|
|
34
|
+
"aria-pressed": !!g,
|
|
36
35
|
"data-testid": "assistant-toggle-preview",
|
|
37
36
|
children: /* @__PURE__ */ a(r, {
|
|
38
37
|
className: "size-5",
|
|
39
38
|
"aria-hidden": "true"
|
|
40
39
|
})
|
|
41
40
|
}) : null,
|
|
42
|
-
|
|
41
|
+
m
|
|
43
42
|
]
|
|
44
43
|
});
|
|
45
44
|
};
|
|
@@ -14,10 +14,5 @@ export interface AssistantViewSwitchProps {
|
|
|
14
14
|
readonly ids: LiveAvatarTabIds;
|
|
15
15
|
/** Where this instance sits: the composer (`chat`), or inside the Avatar view (`avatar`, ids with a suffix). */
|
|
16
16
|
readonly instance: 'chat' | 'avatar';
|
|
17
|
-
/**
|
|
18
|
-
* BOFF-13461: `bar` is the page's bar (`AssistantPageBar`), where it is the one instance (`chat` ids) and needs no row of its own.
|
|
19
|
-
* Absent or `row`: the centred row above the composer, as before.
|
|
20
|
-
*/
|
|
21
|
-
readonly placement?: 'row' | 'bar';
|
|
22
17
|
}
|
|
23
18
|
export declare const AssistantViewSwitch: FC<AssistantViewSwitchProps>;
|
|
@@ -11,17 +11,17 @@ function s(e) {
|
|
|
11
11
|
avatarTab: `${e.avatarTab}${o}`
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
var c = ["chat", "avatar"], l = "inline-flex h-11 min-w-24 items-center justify-center rounded-full px-5 text-base font-semibold transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] sm:h-10 sm:min-w-[5.75rem] sm:text-[15px]", u = ({ selected: o, onSelect: u, ids: d, instance: f
|
|
15
|
-
let
|
|
14
|
+
var c = ["chat", "avatar"], l = "inline-flex h-11 min-w-24 items-center justify-center rounded-full px-5 text-base font-semibold transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] sm:h-10 sm:min-w-[5.75rem] sm:text-[15px]", u = ({ selected: o, onSelect: u, ids: d, instance: f }) => {
|
|
15
|
+
let p = e(), m = n(r()), h = i({}), g = f === "avatar" ? s(d) : d, _ = o === "avatar" && m, v = (e, n) => {
|
|
16
16
|
let r = getComputedStyle(e.currentTarget).direction === "rtl", i = t(e.key, c, n, r), a = c.find((e) => e === i);
|
|
17
|
-
a !== void 0 && (e.preventDefault(),
|
|
17
|
+
a !== void 0 && (e.preventDefault(), h.current[a]?.focus());
|
|
18
18
|
};
|
|
19
19
|
return /* @__PURE__ */ a("div", {
|
|
20
|
-
className:
|
|
20
|
+
className: "flex shrink-0 justify-center px-3 pb-2.5 pt-1",
|
|
21
21
|
"data-testid": `assistant-view-switch-row-${f}`,
|
|
22
22
|
children: /* @__PURE__ */ a("div", {
|
|
23
23
|
role: "tablist",
|
|
24
|
-
"aria-label":
|
|
24
|
+
"aria-label": p.tabsLabel,
|
|
25
25
|
className: "inline-flex gap-0.5 rounded-full border border-action-primary-bg/45 bg-[var(--color-accent-soft)] p-1",
|
|
26
26
|
"data-testid": "assistant-view-switch",
|
|
27
27
|
"data-instance": f,
|
|
@@ -29,23 +29,23 @@ var c = ["chat", "avatar"], l = "inline-flex h-11 min-w-24 items-center justify-
|
|
|
29
29
|
let t = e === o, n = e === "chat";
|
|
30
30
|
return /* @__PURE__ */ a("button", {
|
|
31
31
|
ref: (t) => {
|
|
32
|
-
|
|
32
|
+
h.current[e] = t;
|
|
33
33
|
},
|
|
34
34
|
type: "button",
|
|
35
35
|
role: "tab",
|
|
36
|
-
id: n ?
|
|
36
|
+
id: n ? g.chatTab : g.avatarTab,
|
|
37
37
|
"aria-selected": t,
|
|
38
38
|
"aria-controls": n ? d.chatPanel : d.avatarPanel,
|
|
39
|
-
"aria-describedby": n &&
|
|
40
|
-
title: n &&
|
|
39
|
+
"aria-describedby": n && _ ? d.leaveHint : void 0,
|
|
40
|
+
title: n && _ ? p.tabLeaveHint : void 0,
|
|
41
41
|
tabIndex: t ? 0 : -1,
|
|
42
42
|
onClick: () => {
|
|
43
43
|
t || u(e);
|
|
44
44
|
},
|
|
45
|
-
onKeyDown: (t) =>
|
|
45
|
+
onKeyDown: (t) => v(t, e),
|
|
46
46
|
className: `${l} ${t ? "bg-bg-sunken text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
|
|
47
47
|
"data-testid": n ? "assistant-view-chat" : "assistant-view-avatar",
|
|
48
|
-
children: n ?
|
|
48
|
+
children: n ? p.tabChat : p.tabAvatar
|
|
49
49
|
}, e);
|
|
50
50
|
})
|
|
51
51
|
})
|