@burdenoff/fe-libs 2026.1117.3 → 2026.1117.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/i18nManifest.d.ts +21 -1
- package/dist/shared/assistant/i18nManifest.js +22 -2
- package/dist/shared/assistant/index.d.ts +8 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.js +195 -194
- package/dist/shared/assistant/ui/AssistantChatArea.js +1339 -1332
- package/dist/shared/assistant/ui/compact/AssistantLanguagePill.d.ts +12 -0
- package/dist/shared/assistant/ui/compact/AssistantLanguagePill.js +13 -14
- package/dist/shared/assistant/ui/compact/AssistantWindowHeader.d.ts +8 -2
- package/dist/shared/assistant/ui/compact/AssistantWindowHeader.js +45 -39
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcome.d.ts +44 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcome.js +110 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeCard.d.ts +29 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeCard.js +84 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeHero.d.ts +15 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeHero.js +64 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeSuggestions.d.ts +12 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeSuggestions.js +31 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeTips.d.ts +9 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeTips.js +37 -0
- package/dist/shared/assistant/ui/compact/windowTitle.d.ts +15 -0
- package/dist/shared/assistant/ui/compact/windowTitle.js +13 -0
- package/dist/shared/assistant/ui/compact/windowWelcome.d.ts +136 -0
- package/dist/shared/assistant/ui/compact/windowWelcome.js +119 -0
- package/dist/shared/assistant/ui/compact/windowWelcomeHooks.d.ts +49 -0
- package/dist/shared/assistant/ui/compact/windowWelcomeHooks.js +70 -0
- package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.d.ts +3 -1
- package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.js +27 -26
- package/dist/shared/assistant/ui/useVoiceSession.js +312 -301
- package/dist/shared/assistant/voice/handsFree.d.ts +16 -0
- package/dist/shared/assistant/voice/handsFree.js +2 -2
- package/dist/shared/assistant/voice/handsfree/audioTrackTransport.js +1 -0
- package/dist/shared/assistant/voice/handsfree/backendStreamTransport.d.ts +11 -0
- package/dist/shared/assistant/voice/handsfree/backendStreamTransport.js +118 -63
- package/dist/shared/assistant/voice/handsfree/bargeIn.d.ts +20 -1
- package/dist/shared/assistant/voice/handsfree/bargeIn.js +3 -3
- package/dist/shared/assistant/voice/handsfree/handsFreeController.d.ts +10 -1
- package/dist/shared/assistant/voice/handsfree/handsFreeController.js +103 -83
- package/dist/shared/assistant/voice/handsfree/sttTransport.d.ts +20 -0
- package/dist/shared/assistant/voice/handsfree/useHandsFreeInterrupt.d.ts +8 -0
- package/dist/shared/assistant/voice/handsfree/useHandsFreeInterrupt.js +31 -26
- package/dist/shared/assistant/voice/handsfree/webSpeechTransport.js +1 -0
- package/dist/shared-assistant.js +399 -391
- package/package.json +2 -1
- package/src/shared/tokens/tokens.css +523 -0
|
@@ -25,5 +25,17 @@ export interface AssistantLanguagePillProps {
|
|
|
25
25
|
* ★ While voice is live the pill is `aria-disabled`, not `disabled`: it stays in
|
|
26
26
|
* the Tab order, so a keyboard or screen-reader user reaches it and hears why
|
|
27
27
|
* (`aria-describedby`), and it cannot open.
|
|
28
|
+
*
|
|
29
|
+
* ★ BOFF-15066: a ghost button that SHOWS the short code ("EN"), with the glyph
|
|
30
|
+
* and a chevron from 24rem up and the code alone below it (the viewport, for the
|
|
31
|
+
* header's reason). It no longer grows (`flex-1` squeezed the window's name), and
|
|
32
|
+
* its NAME is still the full language, with the code it shows (WCAG 2.5.3:
|
|
33
|
+
* "Language: தமிழ் (TA)" contains the visible "TA"). Its menu is anchored to the
|
|
34
|
+
* header strip's end, so it stays inside the panel now that the button sits near
|
|
35
|
+
* the end.
|
|
36
|
+
*
|
|
37
|
+
* ★ So its PARENT must be positioned (`relative`): the menu is `absolute` and
|
|
38
|
+
* takes the nearest positioned ancestor as its box. `AssistantWindowHeader`'s
|
|
39
|
+
* strip is; a new host without one would anchor the menu to a distant ancestor.
|
|
28
40
|
*/
|
|
29
41
|
export declare const AssistantLanguagePill: FC<AssistantLanguagePillProps>;
|
|
@@ -30,12 +30,12 @@ var g = ({ voiceLive: g }) => {
|
|
|
30
30
|
};
|
|
31
31
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
32
32
|
}, [S]);
|
|
33
|
-
let A = _("window.language", "Language"), j = _("window.languageLocked", "Change the language after you end voice"),
|
|
33
|
+
let A = _("window.language", "Language"), j = (x.input.code.split("-")[0] ?? x.input.code).toUpperCase(), M = `${A}: ${x.input.label} (${j})`, N = _("window.languageLocked", "Change the language after you end voice"), P = !i(b) && x.reply.code !== x.input.code ? x.reply.label : null, F = (e) => {
|
|
34
34
|
C(!1), e && T.current?.focus({ preventScroll: !0 });
|
|
35
35
|
};
|
|
36
36
|
return /* @__PURE__ */ h("div", {
|
|
37
37
|
ref: w,
|
|
38
|
-
className: "
|
|
38
|
+
className: "shrink-0",
|
|
39
39
|
"data-testid": "assistant-window-language-root",
|
|
40
40
|
children: [
|
|
41
41
|
/* @__PURE__ */ h("button", {
|
|
@@ -44,26 +44,25 @@ var g = ({ voiceLive: g }) => {
|
|
|
44
44
|
onClick: () => {
|
|
45
45
|
g || C((e) => !e);
|
|
46
46
|
},
|
|
47
|
-
className: `flex h-10
|
|
47
|
+
className: `flex h-10 shrink-0 items-center gap-1 rounded-button px-1.5 text-[13px] font-semibold tracking-[0.02em] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${g ? "cursor-default text-text-muted" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"}`,
|
|
48
48
|
"aria-expanded": S,
|
|
49
49
|
"aria-controls": S ? E : void 0,
|
|
50
50
|
"aria-disabled": g ? "true" : void 0,
|
|
51
51
|
"aria-describedby": g ? D : void 0,
|
|
52
|
-
"aria-label":
|
|
53
|
-
title: g ?
|
|
52
|
+
"aria-label": M,
|
|
53
|
+
title: g ? N : M,
|
|
54
54
|
"data-testid": "assistant-window-language",
|
|
55
55
|
children: [
|
|
56
56
|
/* @__PURE__ */ m(p, {
|
|
57
|
-
className: "size-4 shrink-0",
|
|
57
|
+
className: "size-4 shrink-0 max-[23.99rem]:hidden",
|
|
58
58
|
"aria-hidden": "true"
|
|
59
59
|
}),
|
|
60
60
|
/* @__PURE__ */ m("span", {
|
|
61
|
-
className: "min-w-0 truncate",
|
|
62
61
|
"data-testid": "assistant-window-language-name",
|
|
63
|
-
children:
|
|
62
|
+
children: j
|
|
64
63
|
}),
|
|
65
64
|
/* @__PURE__ */ m(f, {
|
|
66
|
-
className: "size-
|
|
65
|
+
className: "size-3.5 shrink-0 max-[23.99rem]:hidden",
|
|
67
66
|
"aria-hidden": "true"
|
|
68
67
|
})
|
|
69
68
|
]
|
|
@@ -72,22 +71,22 @@ var g = ({ voiceLive: g }) => {
|
|
|
72
71
|
id: D,
|
|
73
72
|
className: "sr-only",
|
|
74
73
|
"data-testid": "assistant-window-language-reason",
|
|
75
|
-
children:
|
|
74
|
+
children: N
|
|
76
75
|
}) : null,
|
|
77
76
|
S ? /* @__PURE__ */ m(e, {
|
|
78
77
|
onDismiss: () => {
|
|
79
|
-
|
|
78
|
+
F(!0);
|
|
80
79
|
},
|
|
81
80
|
children: /* @__PURE__ */ h("div", {
|
|
82
81
|
id: E,
|
|
83
82
|
role: "group",
|
|
84
83
|
"aria-label": A,
|
|
85
|
-
className: "absolute
|
|
84
|
+
className: "absolute end-2 top-full z-30 mt-1 w-72 max-w-[calc(100%-1rem)] overflow-hidden rounded-card border border-border-default bg-bg-elevated py-1 shadow-[var(--shadow-overlay)]",
|
|
86
85
|
"data-testid": "assistant-window-language-menu",
|
|
87
|
-
children: [/* @__PURE__ */ m(o, { inputOnly: !0 }),
|
|
86
|
+
children: [/* @__PURE__ */ m(o, { inputOnly: !0 }), P === null ? null : /* @__PURE__ */ m("p", {
|
|
88
87
|
className: "px-3 py-2 text-xs text-text-muted",
|
|
89
88
|
"data-testid": "assistant-window-language-pinned",
|
|
90
|
-
children: _("window.languagePinned", "Replies in {{language}} — change in full assistant", { language:
|
|
89
|
+
children: _("window.languagePinned", "Replies in {{language}} — change in full assistant", { language: P })
|
|
91
90
|
})]
|
|
92
91
|
})
|
|
93
92
|
}) : null
|
|
@@ -10,9 +10,15 @@ export interface AssistantWindowHeaderProps {
|
|
|
10
10
|
onMinimize: () => void;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* The Quick assistant window's header strip (BOFF-10178 Slice 3, BOFF-10180 S6):
|
|
13
|
+
* The Quick assistant window's header strip (BOFF-10178 Slice 3, BOFF-10180 S6, BOFF-15066):
|
|
14
14
|
*
|
|
15
|
-
* `[✦]
|
|
15
|
+
* `[✦] FluidGrids Assistant ………… [文A EN ▾] [Open full assistant] [Minimize]`
|
|
16
|
+
*
|
|
17
|
+
* ★ BOFF-15066 (operator-approved "Side slide" design, 17 Nov): 52 px tall over a subtle rule, the duo brand tile, the
|
|
18
|
+
* product's own name in full, and the language as a ghost button with its short code. The name is fitted beside the
|
|
19
|
+
* language button and both controls (15 px, else 14, else 13 px; the tile 26 px below 24rem): measured in Chromium, all of
|
|
20
|
+
* "FluidGrids/HealthyBowl/VibeControls/BigConsole Assistant" fit whole at 320 and 360 px
|
|
21
|
+
* (`scripts/assistant-welcome-browser-run.mjs`); `truncate`, with the full name as the tooltip, is only the last resort.
|
|
16
22
|
*
|
|
17
23
|
* ★ No view toggle: Chat | Avatar is the pill above the composer (`AssistantViewSwitch`), in the window and the full panel alike, and
|
|
18
24
|
* Slice 5's Chat | Voice toggle is gone with the Voice view (voice starts from the composer's wave button, as in the full panel).
|
|
@@ -1,62 +1,68 @@
|
|
|
1
1
|
import { useAssistantTr as e } from "../../i18n.js";
|
|
2
2
|
import { AssistantLanguagePill as t } from "./AssistantLanguagePill.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { fitAssistantWindowTitle as n, useAssistantWindowTitle as r } from "./windowTitle.js";
|
|
4
|
+
import { useLayoutEffect as i, useRef as a } from "react";
|
|
5
|
+
import { Minus as o, PanelRight as s, Sparkles as c } from "lucide-react";
|
|
6
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
5
7
|
// src/shared/assistant/ui/compact/AssistantWindowHeader.tsx
|
|
6
|
-
var
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
var d = "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)]", f = "text-text-secondary hover:bg-bg-sunken hover:text-text-primary", p = ({ voiceLive: p, avatarOn: m, onOpenFull: h, onMinimize: g }) => {
|
|
9
|
+
let _ = e(), v = r(), y = a(null);
|
|
10
|
+
i(() => {
|
|
11
|
+
let e = y.current;
|
|
12
|
+
if (!e) return;
|
|
13
|
+
let t = () => n(e);
|
|
14
|
+
if (t(), typeof ResizeObserver > "u" || !e.parentElement) return;
|
|
15
|
+
let r = new ResizeObserver(t);
|
|
16
|
+
return r.observe(e.parentElement), () => r.disconnect();
|
|
17
|
+
}, [v]);
|
|
18
|
+
let b = _("window.openFull", "Open full assistant"), x = m ? _("window.openFullAvatarStays", "Open full assistant (the avatar stays on)") : b, S = m && p ? _("window.minimizeEndsAvatarAndVoice", "Minimize (turns off the avatar and ends voice)") : m ? _("window.minimizeTurnsOffAvatar", "Minimize (turns off the avatar)") : p ? _("window.minimizeEndsVoice", "Minimize (ends voice)") : _("window.minimize", "Minimize");
|
|
19
|
+
return /* @__PURE__ */ u("div", {
|
|
20
|
+
className: "relative flex h-[3.25rem] shrink-0 items-center gap-0.5 border-b border-border-subtle py-1.5 pe-1.5 ps-2.5",
|
|
10
21
|
"data-testid": "assistant-window-header",
|
|
11
22
|
"data-presentation": "compact",
|
|
12
23
|
"data-surface": "window",
|
|
13
24
|
children: [
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
className: "flex min-w-0 flex-1 items-center gap-
|
|
16
|
-
children: [/* @__PURE__ */
|
|
17
|
-
className: "flex size-
|
|
25
|
+
/* @__PURE__ */ u("div", {
|
|
26
|
+
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
27
|
+
children: [/* @__PURE__ */ l("span", {
|
|
28
|
+
className: "boff-accent-tile boff-accent-tile--duo flex size-7 shrink-0 items-center justify-center rounded-lg max-[23.99rem]:size-[1.625rem]",
|
|
18
29
|
"aria-hidden": "true",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"aria-hidden": "true",
|
|
28
|
-
className: "hidden max-[23.99rem]:inline",
|
|
29
|
-
"data-testid": "assistant-window-title-short",
|
|
30
|
-
children: p("window.titleShort", "Quick")
|
|
31
|
-
})]
|
|
30
|
+
"data-testid": "assistant-window-mark",
|
|
31
|
+
children: /* @__PURE__ */ l(c, { className: "boff-twinkle size-4" })
|
|
32
|
+
}), /* @__PURE__ */ l("h2", {
|
|
33
|
+
ref: y,
|
|
34
|
+
className: "m-0 min-w-0 truncate text-[15px] font-semibold leading-5 tracking-[-0.012em] text-text-primary data-[tight]:text-sm data-[tighter]:text-[13px]",
|
|
35
|
+
title: v,
|
|
36
|
+
"data-testid": "assistant-window-title",
|
|
37
|
+
children: v
|
|
32
38
|
})]
|
|
33
39
|
}),
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ l(t, { voiceLive: p }),
|
|
41
|
+
/* @__PURE__ */ l("button", {
|
|
36
42
|
type: "button",
|
|
37
|
-
onClick: () =>
|
|
38
|
-
className: `${
|
|
39
|
-
"aria-label":
|
|
40
|
-
title:
|
|
43
|
+
onClick: () => h(),
|
|
44
|
+
className: `${d} ${f}`,
|
|
45
|
+
"aria-label": x,
|
|
46
|
+
title: b,
|
|
41
47
|
"data-testid": "assistant-open-full",
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
className: "size-
|
|
48
|
+
children: /* @__PURE__ */ l(s, {
|
|
49
|
+
className: "size-[1.125rem]",
|
|
44
50
|
"aria-hidden": "true"
|
|
45
51
|
})
|
|
46
52
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ l("button", {
|
|
48
54
|
type: "button",
|
|
49
|
-
onClick:
|
|
50
|
-
className: `${
|
|
51
|
-
"aria-label":
|
|
52
|
-
title:
|
|
55
|
+
onClick: g,
|
|
56
|
+
className: `${d} ${f}`,
|
|
57
|
+
"aria-label": S,
|
|
58
|
+
title: S,
|
|
53
59
|
"data-testid": "assistant-minimize",
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
className: "size-
|
|
60
|
+
children: /* @__PURE__ */ l(o, {
|
|
61
|
+
className: "size-[1.125rem]",
|
|
56
62
|
"aria-hidden": "true"
|
|
57
63
|
})
|
|
58
64
|
})
|
|
59
65
|
]
|
|
60
66
|
});
|
|
61
67
|
};
|
|
62
|
-
export {
|
|
68
|
+
export { p as AssistantWindowHeader };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { AssistantIntent } from '../../autoRouting';
|
|
3
|
+
import { AssistantMode } from '../../types';
|
|
4
|
+
export interface AssistantWindowWelcomeProps {
|
|
5
|
+
/** The active mode (Auto's conversations are in its read mode). */
|
|
6
|
+
mode: AssistantMode;
|
|
7
|
+
/** Auto is in effect for this conversation: the chat area's `autoActive && mode === AUTO_READ_MODE`. */
|
|
8
|
+
auto: boolean;
|
|
9
|
+
/** The composer offers the voice conversation here (the same test that gives it its wave button). */
|
|
10
|
+
voiceOffered: boolean;
|
|
11
|
+
/** The Chat | Avatar switch is offered in this panel. */
|
|
12
|
+
avatarOffered: boolean;
|
|
13
|
+
/** A chip was picked: its DISPLAYED words, and (Auto only) the list it came from. */
|
|
14
|
+
onSuggestionClick: (suggestion: string, intent?: AssistantIntent) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The compact assistant's welcome (BOFF-15066): the operator-approved "Side slide" (design2/final-a).
|
|
18
|
+
* A time-of-day greeting with the person's first name over a soft two-hue glow, a line saying what
|
|
19
|
+
* the assistant can do here, and up to three tall cards side by side (Ask, Make a change, Tips). One
|
|
20
|
+
* card is always open; tapping a closed strip slides it wide while the open one folds into a strip.
|
|
21
|
+
*
|
|
22
|
+
* ★ COMPACT ONLY, and never on a page: the chat area renders it where `AssistantEmptyState` was, for
|
|
23
|
+
* `compact && !pageLayout` (the Quick window and the full compact panel). Classic and the page keep the
|
|
24
|
+
* empty state, untouched.
|
|
25
|
+
*
|
|
26
|
+
* ★ SAME ROUTING AS BEFORE. A chip sends its DISPLAYED (translated) words, and in Auto the list it came
|
|
27
|
+
* from (`intent`), through the chat area's own `handleSuggestionClick`, exactly as the empty state's
|
|
28
|
+
* chips did; only where the chips are drawn changed (`welcomeCards`).
|
|
29
|
+
*
|
|
30
|
+
* ★ NOTHING THAT IS NOT THERE. A card with nothing in it is not drawn (one card is no accordion, just its
|
|
31
|
+
* list); the approval is said only for a mode that holds each change for it; each Tips line only where
|
|
32
|
+
* its feature is (`welcomeTips`); "Connect a source" keeps its place in the first content card, by the
|
|
33
|
+
* same availability predicate as the attach menu's.
|
|
34
|
+
*
|
|
35
|
+
* ★ APG ACCORDION, horizontal. Each header is a button with `aria-expanded` and `aria-controls` (the open
|
|
36
|
+
* one `aria-disabled`: one card is always open); each panel a region labelled by its header, `inert`
|
|
37
|
+
* while closed. Arrows, Home and End move between headers; Enter and Space open (the button's own).
|
|
38
|
+
*
|
|
39
|
+
* ★ MOTION from the tokens only (tokens.css `boff-welcome-*`): the slide is `flex-grow`, the open content
|
|
40
|
+
* is laid out at its final width so the slide reveals it and never reflows it, the icon tile glides and
|
|
41
|
+
* never fades, so no card is ever an empty block mid-slide. All of it is instant under reduced motion
|
|
42
|
+
* (`usePrefersReducedMotion`: the OS setting AND the app's own), via `data-still`.
|
|
43
|
+
*/
|
|
44
|
+
export declare const AssistantWindowWelcome: FC<AssistantWindowWelcomeProps>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { useAssistantTr as e } from "../../i18n.js";
|
|
2
|
+
import { useAssistantPageLabel as t, useAssistantProduct as n } from "../../product.js";
|
|
3
|
+
import { assistantPageLabelKey as r, translateProductCopy as i } from "../../productCopy.js";
|
|
4
|
+
import { hasConnectSource as a, useAssistantConnectSource as o } from "../composer/connectSource.js";
|
|
5
|
+
import { usePrefersReducedMotion as s } from "../usePrefersReducedMotion.js";
|
|
6
|
+
import { AssistantConnectSourceItem as c } from "../composer/AssistantConnectSourceItem.js";
|
|
7
|
+
import { WelcomeCard as l } from "./AssistantWindowWelcomeCard.js";
|
|
8
|
+
import { WelcomeHero as u } from "./AssistantWindowWelcomeHero.js";
|
|
9
|
+
import { WelcomeSuggestionList as d } from "./AssistantWindowWelcomeSuggestions.js";
|
|
10
|
+
import { WelcomeTipsBody as f } from "./AssistantWindowWelcomeTips.js";
|
|
11
|
+
import { welcomeCards as p, welcomeTips as m } from "./windowWelcome.js";
|
|
12
|
+
import { useWelcomeAccordion as h, useWelcomeFit as g, useWelcomeGestureGuard as _ } from "./windowWelcomeHooks.js";
|
|
13
|
+
import { useRef as v } from "react";
|
|
14
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
15
|
+
// src/shared/assistant/ui/compact/AssistantWindowWelcome.tsx
|
|
16
|
+
function S({ tr: e, cards: t, page: n, changeWaits: r, tips: i, canConnectSource: a, onSuggestionClick: o }) {
|
|
17
|
+
let s = t.ask ? "ask" : t.change ? "change" : null, l = (e) => a ? /* @__PURE__ */ b("li", {
|
|
18
|
+
className: "boff-welcome-in",
|
|
19
|
+
"data-step": e + 1,
|
|
20
|
+
children: /* @__PURE__ */ b(c, { presentation: "card" })
|
|
21
|
+
}) : null, u = [];
|
|
22
|
+
return t.ask && u.push({
|
|
23
|
+
key: "ask",
|
|
24
|
+
label: n ? e("welcome.askAbout", "Ask about “{{page}}”", { page: n }) : e("welcome.ask", "Ask a question"),
|
|
25
|
+
body: /* @__PURE__ */ b(d, {
|
|
26
|
+
list: t.ask,
|
|
27
|
+
source: s === "ask" ? l(t.ask.length) : null,
|
|
28
|
+
onSuggestionClick: o
|
|
29
|
+
})
|
|
30
|
+
}), t.change && u.push({
|
|
31
|
+
key: "change",
|
|
32
|
+
label: e("welcome.change", "Make a change"),
|
|
33
|
+
body: /* @__PURE__ */ x(y, { children: [r ? /* @__PURE__ */ b("p", {
|
|
34
|
+
className: "sr-only",
|
|
35
|
+
children: e("welcome.approval", "Each change waits for your approval.")
|
|
36
|
+
}) : null, /* @__PURE__ */ b(d, {
|
|
37
|
+
list: t.change,
|
|
38
|
+
source: s === "change" ? l(t.change.length) : null,
|
|
39
|
+
onSuggestionClick: o
|
|
40
|
+
})] })
|
|
41
|
+
}), u.push({
|
|
42
|
+
key: "tips",
|
|
43
|
+
label: e("welcome.tips", "Tips"),
|
|
44
|
+
body: /* @__PURE__ */ b(f, {
|
|
45
|
+
tips: i,
|
|
46
|
+
source: s === null ? l(i.length) : null
|
|
47
|
+
})
|
|
48
|
+
}), u;
|
|
49
|
+
}
|
|
50
|
+
var C = ({ mode: c, auto: d, voiceOffered: f, avatarOffered: y, onSuggestionClick: C }) => {
|
|
51
|
+
let w = e(), { modes: T } = n(), E = t(), D = s(), O = a(o()), k = p({
|
|
52
|
+
modes: T,
|
|
53
|
+
mode: c,
|
|
54
|
+
auto: d
|
|
55
|
+
}), A = k.change !== null && k.waitsForApproval, j = m({
|
|
56
|
+
changeWaits: A,
|
|
57
|
+
voiceOffered: f,
|
|
58
|
+
avatarOffered: y
|
|
59
|
+
}), M = E ? i(w, r(E), E) : null, N = S({
|
|
60
|
+
tr: w,
|
|
61
|
+
cards: k,
|
|
62
|
+
page: M,
|
|
63
|
+
changeWaits: A,
|
|
64
|
+
tips: j,
|
|
65
|
+
canConnectSource: O,
|
|
66
|
+
onSuggestionClick: C
|
|
67
|
+
}), P = N.map((e) => e.key), F = v(null), I = v(null), L = _(F), R = h(P, L), z = g({
|
|
68
|
+
rowRef: F,
|
|
69
|
+
welcomeRef: I,
|
|
70
|
+
keys: P,
|
|
71
|
+
cards: k,
|
|
72
|
+
tips: j,
|
|
73
|
+
canConnectSource: O,
|
|
74
|
+
page: M,
|
|
75
|
+
tr: w
|
|
76
|
+
}), { open: B, single: V } = R;
|
|
77
|
+
return /* @__PURE__ */ b("div", {
|
|
78
|
+
ref: I,
|
|
79
|
+
className: "boff-welcome",
|
|
80
|
+
"data-testid": "assistant-window-welcome",
|
|
81
|
+
"data-open": B,
|
|
82
|
+
"data-approval": B === "change" && A ? "" : void 0,
|
|
83
|
+
"data-strips": N.length - 1,
|
|
84
|
+
"data-still": D ? "" : void 0,
|
|
85
|
+
children: /* @__PURE__ */ x("div", {
|
|
86
|
+
className: "boff-welcome-body",
|
|
87
|
+
children: [/* @__PURE__ */ b(u, {
|
|
88
|
+
page: M,
|
|
89
|
+
hasChange: k.change !== null,
|
|
90
|
+
changeWaits: A
|
|
91
|
+
}), /* @__PURE__ */ b("div", {
|
|
92
|
+
ref: F,
|
|
93
|
+
className: "boff-welcome-row",
|
|
94
|
+
children: N.map((e, t) => /* @__PURE__ */ b(l, {
|
|
95
|
+
spec: e,
|
|
96
|
+
index: t,
|
|
97
|
+
single: V,
|
|
98
|
+
isOpen: V || e.key === B,
|
|
99
|
+
headId: R.headId(e.key),
|
|
100
|
+
panelId: R.panelId(e.key),
|
|
101
|
+
setHead: R.setHead,
|
|
102
|
+
setInner: z,
|
|
103
|
+
onHeadClick: R.onHeadClick(e.key),
|
|
104
|
+
onHeadKeyDown: R.onHeadKeyDown(t)
|
|
105
|
+
}, e.key))
|
|
106
|
+
})]
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
export { C as AssistantWindowWelcome };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FC, KeyboardEvent, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { WelcomeCardKey } from './windowWelcome';
|
|
3
|
+
/** One card as the welcome draws it: which card, its name, and what its panel holds. */
|
|
4
|
+
export interface WelcomeCardSpec {
|
|
5
|
+
readonly key: WelcomeCardKey;
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly body: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface WelcomeCardProps {
|
|
10
|
+
spec: WelcomeCardSpec;
|
|
11
|
+
/** Its place in the row (0-based): the entrance delay and the header keys' index. */
|
|
12
|
+
index: number;
|
|
13
|
+
/** The only card drawn: no button and no region, just its tile, title and list. */
|
|
14
|
+
single: boolean;
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
headId: string;
|
|
17
|
+
panelId: string;
|
|
18
|
+
setHead: (key: WelcomeCardKey, node: HTMLButtonElement | null) => void;
|
|
19
|
+
/** The content box's ref, for the fit (`useWelcomeFit`). */
|
|
20
|
+
setInner: (key: WelcomeCardKey, node: HTMLDivElement | null) => void;
|
|
21
|
+
onHeadClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
22
|
+
onHeadKeyDown: (event: KeyboardEvent<HTMLButtonElement>) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* One welcome card: its header (the accordion button, or just the tile for a single card) and its panel,
|
|
26
|
+
* a region labelled by its header and `inert` while closed. The content is laid out at the open width, so
|
|
27
|
+
* the slide reveals it and never reflows it.
|
|
28
|
+
*/
|
|
29
|
+
export declare const WelcomeCard: FC<WelcomeCardProps>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ChevronsRight as e, Lightbulb as t, MessageSquareText as n, Zap as r } from "lucide-react";
|
|
2
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
3
|
+
// src/shared/assistant/ui/compact/AssistantWindowWelcomeCard.tsx
|
|
4
|
+
var o = {
|
|
5
|
+
ask: n,
|
|
6
|
+
change: r,
|
|
7
|
+
tips: t
|
|
8
|
+
}, s = ({ spec: t, index: n, single: r, isOpen: s, headId: c, panelId: l, setHead: u, setInner: d, onHeadClick: f, onHeadKeyDown: p }) => {
|
|
9
|
+
let m = o[t.key], h = /* @__PURE__ */ a("div", {
|
|
10
|
+
ref: (e) => {
|
|
11
|
+
d(t.key, e);
|
|
12
|
+
},
|
|
13
|
+
className: "boff-welcome-inner",
|
|
14
|
+
children: [/* @__PURE__ */ i("div", {
|
|
15
|
+
className: "boff-welcome-top boff-welcome-in",
|
|
16
|
+
"data-step": "0",
|
|
17
|
+
"aria-hidden": !r || void 0,
|
|
18
|
+
children: i(r ? "h3" : "span", {
|
|
19
|
+
className: "boff-welcome-title",
|
|
20
|
+
children: t.label
|
|
21
|
+
})
|
|
22
|
+
}), t.body]
|
|
23
|
+
});
|
|
24
|
+
return /* @__PURE__ */ a("div", {
|
|
25
|
+
className: `boff-welcome-card boff-welcome-card--${t.key} boff-rise boff-delay-${n + 2}`,
|
|
26
|
+
"data-welcome-card": t.key,
|
|
27
|
+
"data-open": s ? "" : void 0,
|
|
28
|
+
"data-single": r ? "" : void 0,
|
|
29
|
+
"data-testid": `assistant-welcome-card-${t.key}`,
|
|
30
|
+
children: [r ? /* @__PURE__ */ i("span", {
|
|
31
|
+
className: "boff-welcome-tile",
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
children: /* @__PURE__ */ i(m, { className: "size-4" })
|
|
34
|
+
}) : /* @__PURE__ */ i("h3", {
|
|
35
|
+
className: "boff-welcome-h",
|
|
36
|
+
children: /* @__PURE__ */ a("button", {
|
|
37
|
+
ref: (e) => {
|
|
38
|
+
u(t.key, e);
|
|
39
|
+
},
|
|
40
|
+
type: "button",
|
|
41
|
+
id: c,
|
|
42
|
+
className: "boff-welcome-head",
|
|
43
|
+
"aria-expanded": s,
|
|
44
|
+
"aria-controls": l,
|
|
45
|
+
"aria-disabled": s ? "true" : void 0,
|
|
46
|
+
onClick: f,
|
|
47
|
+
onKeyDown: p,
|
|
48
|
+
"data-testid": `assistant-welcome-head-${t.key}`,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ i("span", {
|
|
51
|
+
className: "boff-welcome-tile",
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
children: /* @__PURE__ */ i(m, { className: "size-4" })
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ i("span", {
|
|
56
|
+
className: "boff-welcome-label",
|
|
57
|
+
children: /* @__PURE__ */ i("span", {
|
|
58
|
+
className: "boff-welcome-vt",
|
|
59
|
+
children: t.label
|
|
60
|
+
})
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ i("span", {
|
|
63
|
+
className: "boff-welcome-cue",
|
|
64
|
+
"aria-hidden": "true",
|
|
65
|
+
children: /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(e, { className: "size-3.5" }) })
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
})
|
|
69
|
+
}), r ? /* @__PURE__ */ i("div", {
|
|
70
|
+
className: "boff-welcome-panel",
|
|
71
|
+
"data-testid": `assistant-welcome-panel-${t.key}`,
|
|
72
|
+
children: h
|
|
73
|
+
}) : /* @__PURE__ */ i("div", {
|
|
74
|
+
className: "boff-welcome-panel",
|
|
75
|
+
id: l,
|
|
76
|
+
role: "region",
|
|
77
|
+
"aria-labelledby": c,
|
|
78
|
+
inert: !s,
|
|
79
|
+
"data-testid": `assistant-welcome-panel-${t.key}`,
|
|
80
|
+
children: h
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
export { s as WelcomeCard };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface WelcomeHeroProps {
|
|
3
|
+
/** The page's translated label, when the host names one. */
|
|
4
|
+
page: string | null;
|
|
5
|
+
/** The Make a change card shows. */
|
|
6
|
+
hasChange: boolean;
|
|
7
|
+
/** ...and its mode holds each change for approval: only then is the approval said (the pill). */
|
|
8
|
+
changeWaits: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The welcome's top (BOFF-15066): a time-of-day greeting with the person's first name over a soft two-hue
|
|
12
|
+
* glow, a line saying what the assistant can do here, and (only where the mode holds each change for it)
|
|
13
|
+
* the approval pill. The pill is hidden from the accessibility tree: the Make a change card says it.
|
|
14
|
+
*/
|
|
15
|
+
export declare const WelcomeHero: FC<WelcomeHeroProps>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useSafeAuth as e } from "../../../providers/shell/AuthProvider.js";
|
|
2
|
+
import { useAssistantTr as t } from "../../i18n.js";
|
|
3
|
+
import { welcomeDayPart as n, welcomeFirstName as r } from "./windowWelcome.js";
|
|
4
|
+
import { useState as i } from "react";
|
|
5
|
+
import { Moon as a, ShieldCheck as o, Sun as s, Sunrise as c } from "lucide-react";
|
|
6
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
// src/shared/assistant/ui/compact/AssistantWindowWelcomeHero.tsx
|
|
8
|
+
var f = {
|
|
9
|
+
morning: c,
|
|
10
|
+
afternoon: s,
|
|
11
|
+
evening: a
|
|
12
|
+
}, p = "";
|
|
13
|
+
function m(e, t, n) {
|
|
14
|
+
if (n === null) return t === "morning" ? e("welcome.morning", "Good morning") : t === "afternoon" ? e("welcome.afternoon", "Good afternoon") : e("welcome.evening", "Good evening");
|
|
15
|
+
let r = { name: p }, i = t === "morning" ? e("welcome.morningName", "Good morning, {{name}}", r) : t === "afternoon" ? e("welcome.afternoonName", "Good afternoon, {{name}}", r) : e("welcome.eveningName", "Good evening, {{name}}", r), a = i.indexOf(p), [o, s] = a < 0 ? [`${i} `, ""] : [i.slice(0, a), i.slice(a + 1)];
|
|
16
|
+
return /* @__PURE__ */ d(l, { children: [
|
|
17
|
+
o,
|
|
18
|
+
/* @__PURE__ */ u("span", {
|
|
19
|
+
className: "boff-welcome-name",
|
|
20
|
+
"data-testid": "assistant-welcome-name",
|
|
21
|
+
children: n
|
|
22
|
+
}),
|
|
23
|
+
s
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
function h(e, t, n) {
|
|
27
|
+
return t ? n ? e("welcome.subPageChange", "Ask about “{{page}}”, or let me change something.", { page: t }) : e("welcome.subPage", "Ask me about “{{page}}”.", { page: t }) : n ? e("welcome.subChange", "Ask a question, or let me change something.") : e("welcome.sub", "Ask me anything.");
|
|
28
|
+
}
|
|
29
|
+
var g = ({ page: a, hasChange: s, changeWaits: c }) => {
|
|
30
|
+
let l = t(), p = e()?.user ?? null, [g] = i(() => n((/* @__PURE__ */ new Date()).getHours())), _ = r(p), v = f[g];
|
|
31
|
+
return /* @__PURE__ */ d("div", {
|
|
32
|
+
className: "boff-welcome-hero boff-rise",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ u("div", {
|
|
35
|
+
className: "boff-welcome-glow",
|
|
36
|
+
"aria-hidden": "true",
|
|
37
|
+
children: /* @__PURE__ */ u("div", { className: "boff-welcome-mesh boff-mesh-duo" })
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ d("p", {
|
|
40
|
+
className: "boff-welcome-hi",
|
|
41
|
+
"data-testid": "assistant-welcome-greeting",
|
|
42
|
+
children: [/* @__PURE__ */ u(v, {
|
|
43
|
+
className: "boff-welcome-time boff-twinkle",
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
"data-day-part": g
|
|
46
|
+
}), /* @__PURE__ */ u("span", { children: m(l, g, _) })]
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ d("div", {
|
|
49
|
+
className: "boff-welcome-line",
|
|
50
|
+
children: [/* @__PURE__ */ u("p", {
|
|
51
|
+
className: "boff-welcome-sub",
|
|
52
|
+
"data-testid": "assistant-welcome-subline",
|
|
53
|
+
children: h(l, a, s)
|
|
54
|
+
}), c ? /* @__PURE__ */ d("p", {
|
|
55
|
+
className: "boff-welcome-ok",
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
"data-testid": "assistant-welcome-approval",
|
|
58
|
+
children: [/* @__PURE__ */ u(o, { className: "size-3.5" }), l("welcome.approval", "Each change waits for your approval.")]
|
|
59
|
+
}) : null]
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
export { g as WelcomeHero };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { AssistantIntent } from '../../autoRouting';
|
|
3
|
+
import { WelcomeSuggestion } from './windowWelcome';
|
|
4
|
+
export interface WelcomeSuggestionListProps {
|
|
5
|
+
list: readonly WelcomeSuggestion[];
|
|
6
|
+
/** "Connect a source", in the first content card only: the list's last row. */
|
|
7
|
+
source: ReactNode;
|
|
8
|
+
/** A chip was picked: its DISPLAYED words, and (Auto only) the list it came from. */
|
|
9
|
+
onSuggestionClick: (suggestion: string, intent?: AssistantIntent) => void;
|
|
10
|
+
}
|
|
11
|
+
/** An Ask or Make a change card's chips: each sends its DISPLAYED (translated) words. */
|
|
12
|
+
export declare const WelcomeSuggestionList: FC<WelcomeSuggestionListProps>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useAssistantTr as e } from "../../i18n.js";
|
|
2
|
+
import { assistantSuggestionKey as t, translateProductCopy as n } from "../../productCopy.js";
|
|
3
|
+
import { ArrowUpRight as r } from "lucide-react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
// src/shared/assistant/ui/compact/AssistantWindowWelcomeSuggestions.tsx
|
|
6
|
+
var o = ({ list: o, source: s, onSuggestionClick: c }) => {
|
|
7
|
+
let l = e();
|
|
8
|
+
return /* @__PURE__ */ a("ul", {
|
|
9
|
+
className: "boff-welcome-list",
|
|
10
|
+
children: [o.map((e, o) => {
|
|
11
|
+
let s = n(l, t(e.sourceMode, e.text), e.text);
|
|
12
|
+
return /* @__PURE__ */ i("li", {
|
|
13
|
+
className: "boff-welcome-in",
|
|
14
|
+
"data-step": o + 1,
|
|
15
|
+
...o > 0 ? { "data-welcome-fit": "" } : {},
|
|
16
|
+
children: /* @__PURE__ */ a("button", {
|
|
17
|
+
type: "button",
|
|
18
|
+
onClick: () => c(s, e.intent),
|
|
19
|
+
className: "boff-welcome-chip boff-gloss-card",
|
|
20
|
+
"data-testid": "assistant-suggestion",
|
|
21
|
+
"data-intent": e.intent,
|
|
22
|
+
children: [/* @__PURE__ */ i(r, {
|
|
23
|
+
className: "boff-welcome-go",
|
|
24
|
+
"aria-hidden": "true"
|
|
25
|
+
}), s]
|
|
26
|
+
})
|
|
27
|
+
}, e.text);
|
|
28
|
+
}), s]
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export { o as WelcomeSuggestionList };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { WelcomeTip } from './windowWelcome';
|
|
3
|
+
export interface WelcomeTipsBodyProps {
|
|
4
|
+
tips: readonly WelcomeTip[];
|
|
5
|
+
/** "Connect a source", only when no content card shows: its own list after the tips. */
|
|
6
|
+
source: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** The Tips card's lines, each only where its feature is (`welcomeTips`). */
|
|
9
|
+
export declare const WelcomeTipsBody: FC<WelcomeTipsBodyProps>;
|