@burdenoff/fe-libs 2026.1116.1 → 2026.1116.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chrome/Tabs.js +4 -0
- package/dist/shared/assistant/history/useHistoryRowControls.d.ts +16 -0
- package/dist/shared/assistant/history/useHistoryRowControls.js +38 -14
- package/dist/shared/assistant/i18nManifest.d.ts +9 -0
- package/dist/shared/assistant/i18nManifest.js +9 -0
- package/dist/shared/assistant/index.d.ts +2 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +16 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.js +247 -223
- package/dist/shared/assistant/ui/AssistantChatArea.js +1355 -1347
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +6 -0
- package/dist/shared/assistant/ui/AssistantOverlay.js +4 -2
- package/dist/shared/assistant/ui/AssistantPageHost.d.ts +14 -1
- package/dist/shared/assistant/ui/AssistantPageHost.js +32 -19
- package/dist/shared/assistant/ui/AssistantRenameConversationDialog.d.ts +33 -0
- package/dist/shared/assistant/ui/AssistantRenameConversationDialog.js +70 -0
- package/dist/shared/assistant/ui/assistantPageBar.d.ts +33 -0
- package/dist/shared/assistant/ui/assistantPageBar.js +53 -0
- package/dist/shared/assistant/ui/assistantPageLayout.d.ts +20 -0
- package/dist/shared/assistant/ui/assistantPageLayout.js +10 -2
- package/dist/shared/assistant/ui/assistantPageStart.d.ts +17 -0
- package/dist/shared/assistant/ui/assistantPageStart.js +7 -4
- package/dist/shared/assistant/ui/compact/AssistantConversationMenu.d.ts +30 -0
- package/dist/shared/assistant/ui/compact/AssistantConversationMenu.js +174 -53
- package/dist/shared/assistant/ui/compact/AssistantPageBar.d.ts +19 -0
- package/dist/shared/assistant/ui/compact/AssistantPageBar.js +24 -19
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +2 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +347 -340
- package/dist/shared/assistant/ui/composer/AssistantDictation.d.ts +5 -0
- package/dist/shared/assistant/ui/composer/AssistantDictation.js +41 -40
- package/dist/shared/assistant/ui/composer/pageBoxClass.d.ts +28 -1
- package/dist/shared/assistant/ui/composer/pageBoxClass.js +17 -1
- package/dist/shared/assistant/ui/conversationDeleteDialog.d.ts +14 -4
- package/dist/shared/assistant/ui/conversationDeleteDialog.js +7 -6
- package/dist/shared/assistant/ui/voice/AssistantVoiceSessionButton.js +1 -1
- package/dist/shared/assistant/ui/voice/LiveWaveform.js +1 -1
- package/dist/shared-assistant.js +256 -254
- package/dist/ui/aurora-background.js +1 -0
- package/dist/ui/badge.d.ts +5 -0
- package/dist/ui/badge.js +2 -0
- package/dist/ui/card.d.ts +6 -0
- package/dist/ui/card.js +8 -0
- package/dist/ui/emphasis-panel.js +1 -0
- package/dist/ui/empty-state.js +4 -0
- package/dist/ui/glass-card.d.ts +9 -0
- package/dist/ui/glass-card.js +5 -0
- package/dist/ui/icon-tile.d.ts +19 -0
- package/dist/ui/icon-tile.js +21 -0
- package/dist/ui/illustration.d.ts +4 -0
- package/dist/ui/illustration.js +4 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/input.js +1 -0
- package/dist/ui/page-tabs.js +2 -0
- package/dist/ui/responsive-table.js +3 -0
- package/dist/ui/select.js +2 -0
- package/dist/ui/table.js +9 -0
- package/dist/ui/textarea.js +1 -0
- package/dist/ui.js +16 -15
- package/package.json +2 -1
- package/src/shared/tokens/depth.css +760 -0
- package/src/shared/tokens/tokens.css +6 -0
|
@@ -98,6 +98,12 @@ export interface AssistantOverlayContextValue {
|
|
|
98
98
|
pageHosted?: boolean;
|
|
99
99
|
/** BOFF-13461: the stable root the panel renders into (with `pageSurface` only). */
|
|
100
100
|
pagePanelRoot?: HTMLElement | null;
|
|
101
|
+
/**
|
|
102
|
+
* BOFF-15028: the mounted page host that shows the panel now (the newest one), or null when none
|
|
103
|
+
* does. A host compares it with its own element, so only the host holding the panel puts its
|
|
104
|
+
* controls in the panel's bar. With `pageSurface` only.
|
|
105
|
+
*/
|
|
106
|
+
activePageHost?: HTMLElement | null;
|
|
101
107
|
/**
|
|
102
108
|
* BOFF-13461: the latest request for the hosted panel to take focus: a host
|
|
103
109
|
* that mounted (`force` false: only where focus was dropped) or a request to
|
|
@@ -273,7 +273,8 @@ function q({ keyPrefix: e, quota: t, presentation: n = "classic", pageSurface: r
|
|
|
273
273
|
registerPageHost: ie,
|
|
274
274
|
pageHosted: ae,
|
|
275
275
|
pagePanelRoot: c,
|
|
276
|
-
pageFocusRequest: ne
|
|
276
|
+
pageFocusRequest: ne,
|
|
277
|
+
activePageHost: u
|
|
277
278
|
} : {}
|
|
278
279
|
}), [
|
|
279
280
|
h,
|
|
@@ -301,7 +302,8 @@ function q({ keyPrefix: e, quota: t, presentation: n = "classic", pageSurface: r
|
|
|
301
302
|
c,
|
|
302
303
|
ie,
|
|
303
304
|
ae,
|
|
304
|
-
ne
|
|
305
|
+
ne,
|
|
306
|
+
u
|
|
305
307
|
]);
|
|
306
308
|
return /* @__PURE__ */ P(L.Provider, {
|
|
307
309
|
value: Ue,
|
|
@@ -21,5 +21,18 @@ export interface AssistantPageHostProps {
|
|
|
21
21
|
* layout) over the kept chat, for a settings page (BOFF-13461: Settings › Assistant).
|
|
22
22
|
*/
|
|
23
23
|
view?: 'chat' | 'settings';
|
|
24
|
+
/**
|
|
25
|
+
* BOFF-15028: the page's own controls for a chat (say, History and New chat), at the top right of
|
|
26
|
+
* the assistant's bar, before the preview toggle and ⋯. The bar then shows wherever the page's
|
|
27
|
+
* start content does not (a chat, or one still loading or that failed to load); ⋯ only over a
|
|
28
|
+
* chat with messages. Give them as siblings, or in a wrapper that wraps, so a narrow bar can wrap
|
|
29
|
+
* them. Absent: the bar as before.
|
|
30
|
+
*/
|
|
31
|
+
actions?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* BOFF-15028: ⋯ in the assistant's bar also offers Rename, Pin or Unpin, and Delete chat for the
|
|
34
|
+
* open chat (Delete asks first, and leaves the page on a new chat). Absent or false: ⋯ as before.
|
|
35
|
+
*/
|
|
36
|
+
manageChat?: boolean;
|
|
24
37
|
}
|
|
25
|
-
export declare function AssistantPageHost({ className, fallback, start, view, }: AssistantPageHostProps): import('react').JSX.Element;
|
|
38
|
+
export declare function AssistantPageHost({ className, fallback, start, view, actions, manageChat, }: AssistantPageHostProps): import('react').JSX.Element;
|
|
@@ -2,27 +2,40 @@ import { cn as e } from "../../../shared-utils.js";
|
|
|
2
2
|
import { useAssistantOverlayOrNull as t } from "./AssistantOverlay.js";
|
|
3
3
|
import { offerAssistantPageStart as n, useAssistantPageStartSlot as r } from "./assistantPageStart.js";
|
|
4
4
|
import { offerAssistantPageSettings as i } from "./assistantPageSettings.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useAssistantPageBarOffers as a } from "./assistantPageBar.js";
|
|
6
|
+
import { useCallback as o, useEffect as s, useState as c } from "react";
|
|
7
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
import { createPortal as f } from "react-dom";
|
|
8
9
|
// src/shared/assistant/ui/AssistantPageHost.tsx
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
function p({ className: p, fallback: m = null, start: h, view: g = "chat", actions: _, manageChat: v = !1 }) {
|
|
11
|
+
let y = t(), b = y?.registerPageHost, x = b !== void 0 && h !== void 0 && g === "chat";
|
|
12
|
+
s(() => x ? n() : void 0, [x]);
|
|
13
|
+
let S = b !== void 0 && g === "settings";
|
|
14
|
+
s(() => S ? i() : void 0, [S]);
|
|
15
|
+
let C = r("above"), w = r("below"), [T, E] = c(null), D = a({
|
|
16
|
+
overlay: y,
|
|
17
|
+
hostElement: T,
|
|
18
|
+
actions: _,
|
|
19
|
+
manageChat: v,
|
|
20
|
+
view: g
|
|
21
|
+
}), O = o((e) => {
|
|
22
|
+
if (!e || !b) return;
|
|
23
|
+
E(e);
|
|
24
|
+
let t = b(e);
|
|
25
|
+
return () => {
|
|
26
|
+
t(), E((t) => t === e ? null : t);
|
|
27
|
+
};
|
|
28
|
+
}, [b]);
|
|
29
|
+
return b ? /* @__PURE__ */ d(l, { children: [
|
|
30
|
+
/* @__PURE__ */ u("div", {
|
|
31
|
+
ref: O,
|
|
32
|
+
className: e("flex min-h-0 flex-col", p),
|
|
21
33
|
"data-testid": "assistant-page-host",
|
|
22
34
|
"data-assistant-page-host": ""
|
|
23
35
|
}),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
x && C && h?.above ? f(h.above, C) : null,
|
|
37
|
+
x && w && h?.below ? f(h.below, w) : null,
|
|
38
|
+
D ? f(_, D) : null
|
|
39
|
+
] }) : /* @__PURE__ */ u(l, { children: m });
|
|
27
40
|
}
|
|
28
|
-
export {
|
|
41
|
+
export { p as AssistantPageHost };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* "Rename chat" (BOFF-15028): ⋯ → Rename on a page that lets ⋯ manage the chat
|
|
4
|
+
* (`AssistantPageHost` `manageChat`).
|
|
5
|
+
*
|
|
6
|
+
* ★ The History list's rules for a title: at most 80 code points (the server's
|
|
7
|
+
* limit, not UTF-16 units, which `maxLength` would count: a Tamil letter or an
|
|
8
|
+
* emoji would be cut wrong). What is typed or pasted past it is cut here, and a
|
|
9
|
+
* quiet hint says why, in a live region that is present before it speaks. A
|
|
10
|
+
* blank title is never saved.
|
|
11
|
+
*
|
|
12
|
+
* ★ A form, so Enter in the field saves and an input method's Enter (which
|
|
13
|
+
* commits a candidate) never does: the browser's implicit submission waits for
|
|
14
|
+
* the composition. Esc, the overlay and the close button only close it.
|
|
15
|
+
*
|
|
16
|
+
* ★ Focus starts in the field with its text selected, so typing replaces the
|
|
17
|
+
* title. `ModalShell` hands focus back to what opened it on close (the page's ⋯,
|
|
18
|
+
* which the menu focuses before it opens this).
|
|
19
|
+
*
|
|
20
|
+
* ★ Presentational: it reports the title. Which conversation, and the rename
|
|
21
|
+
* itself (the store's `renameConversation`, which normalises the title and syncs
|
|
22
|
+
* it with history on), are the caller's.
|
|
23
|
+
*/
|
|
24
|
+
export interface AssistantRenameConversationDialogProps {
|
|
25
|
+
open: boolean;
|
|
26
|
+
/** The chat's title now: the field starts from it, cut to the title limit. */
|
|
27
|
+
title: string;
|
|
28
|
+
/** Save was pressed (or Enter) with a title that is not blank. */
|
|
29
|
+
onSave: (title: string) => void;
|
|
30
|
+
/** Cancel, Esc, the overlay or the close button: nothing is renamed. */
|
|
31
|
+
onDismiss: () => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const AssistantRenameConversationDialog: FC<AssistantRenameConversationDialogProps>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Button as e } from "../../../ui/button.js";
|
|
2
|
+
import { Input as t } from "../../../ui/input.js";
|
|
3
|
+
import { ModalShell as n } from "../../../ui/modal-shell.js";
|
|
4
|
+
import { clampToCodePoints as r, codePointLength as i } from "../history/historyControls.js";
|
|
5
|
+
import { useAssistantTr as a } from "../i18n.js";
|
|
6
|
+
import { useId as o, useRef as s, useState as c } from "react";
|
|
7
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
// src/shared/assistant/ui/AssistantRenameConversationDialog.tsx
|
|
9
|
+
var f = ({ open: f, title: p, onSave: m, onDismiss: h }) => {
|
|
10
|
+
let g = a(), _ = o(), v = o(), y = o(), b = s(null), [x, S] = c(() => r(p, 80)), [C, w] = c(!1), T = x.trim() === "", E = (e) => {
|
|
11
|
+
S(r(e, 80)), w(i(e) > 80);
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ u(n, {
|
|
14
|
+
open: f,
|
|
15
|
+
onClose: h,
|
|
16
|
+
onOpenAutoFocus: (e) => {
|
|
17
|
+
let t = b.current;
|
|
18
|
+
t && (e.preventDefault(), t.focus(), t.select());
|
|
19
|
+
},
|
|
20
|
+
testId: "assistant-rename-conversation-dialog",
|
|
21
|
+
size: "sm",
|
|
22
|
+
title: g("renameConversation.title", "Rename chat"),
|
|
23
|
+
description: g("renameConversation.body", "Give this chat a name you’ll recognise."),
|
|
24
|
+
footer: /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(e, {
|
|
25
|
+
type: "button",
|
|
26
|
+
variant: "outline",
|
|
27
|
+
onClick: h,
|
|
28
|
+
"data-testid": "assistant-rename-conversation-cancel",
|
|
29
|
+
children: g("renameConversation.cancel", "Cancel")
|
|
30
|
+
}), /* @__PURE__ */ u(e, {
|
|
31
|
+
type: "submit",
|
|
32
|
+
form: _,
|
|
33
|
+
disabled: T,
|
|
34
|
+
"data-testid": "assistant-rename-conversation-save",
|
|
35
|
+
children: g("renameConversation.save", "Save")
|
|
36
|
+
})] }),
|
|
37
|
+
children: /* @__PURE__ */ d("form", {
|
|
38
|
+
id: _,
|
|
39
|
+
onSubmit: (e) => {
|
|
40
|
+
e.preventDefault(), T || m(x);
|
|
41
|
+
},
|
|
42
|
+
className: "flex flex-col gap-1.5",
|
|
43
|
+
"data-testid": "assistant-rename-conversation-form",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ u("label", {
|
|
46
|
+
htmlFor: v,
|
|
47
|
+
className: "text-sm font-medium text-text-primary",
|
|
48
|
+
children: g("renameConversation.label", "Chat name")
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ u(t, {
|
|
51
|
+
ref: b,
|
|
52
|
+
id: v,
|
|
53
|
+
value: x,
|
|
54
|
+
onChange: (e) => E(e.target.value),
|
|
55
|
+
autoComplete: "off",
|
|
56
|
+
"aria-describedby": y,
|
|
57
|
+
"data-testid": "assistant-rename-conversation-input"
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ u("p", {
|
|
60
|
+
id: y,
|
|
61
|
+
role: "status",
|
|
62
|
+
className: "min-h-4 text-xs text-text-muted",
|
|
63
|
+
"data-testid": "assistant-rename-conversation-hint",
|
|
64
|
+
children: C ? g("conversations.titleLimit", "Titles are up to {{limit}} characters", { limit: 80 }) : ""
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
export { f as AssistantRenameConversationDialog };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { AssistantOverlayContextValue } from './AssistantOverlay';
|
|
3
|
+
/** True while a mounted page offers controls for the bar: the bar then draws their slot. */
|
|
4
|
+
export declare function useAssistantPageBarActionsOffered(): boolean;
|
|
5
|
+
/** True while a mounted page lets ⋯ rename, pin and delete the open chat. */
|
|
6
|
+
export declare function useAssistantPageChatManaged(): boolean;
|
|
7
|
+
export interface AssistantPageBarActionsSlotProps {
|
|
8
|
+
className: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Where the page's controls go: drawn by the assistant's page bar (`AssistantPageBar`) while a page
|
|
12
|
+
* offers them. A product never draws it; it hands its controls to `AssistantPageHost` `actions`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const AssistantPageBarActionsSlot: FC<AssistantPageBarActionsSlotProps>;
|
|
15
|
+
export interface AssistantPageBarOffersOptions {
|
|
16
|
+
/** The overlay above the host (`useAssistantOverlayOrNull()`): it names the host holding the panel. */
|
|
17
|
+
overlay: Pick<AssistantOverlayContextValue, 'activePageHost' | 'registerPageHost'> | null;
|
|
18
|
+
/** The host's own element, once attached. */
|
|
19
|
+
hostElement: HTMLElement | null;
|
|
20
|
+
/** The page's controls (`AssistantPageHost` `actions`). */
|
|
21
|
+
actions: ReactNode;
|
|
22
|
+
/** ⋯ manages the chat (`AssistantPageHost` `manageChat`). */
|
|
23
|
+
manageChat: boolean;
|
|
24
|
+
/** What the host shows: the bar's offers are for a chat only. */
|
|
25
|
+
view: 'chat' | 'settings';
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* `AssistantPageHost`'s offers for the bar: its controls and ⋯'s chat actions, held only while its
|
|
29
|
+
* element is the one holding the panel (`activePageHost`), so two mounted hosts never fill the one
|
|
30
|
+
* bar twice. Returns where to render the controls (a portal into the bar's slot), or null while
|
|
31
|
+
* they are not offered or the bar draws no slot.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useAssistantPageBarOffers({ overlay, hostElement, actions, manageChat, view, }: AssistantPageBarOffersOptions): HTMLElement | null;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useEffect as e, useSyncExternalStore as t } from "react";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
// src/shared/assistant/ui/assistantPageBar.tsx
|
|
4
|
+
var r = {
|
|
5
|
+
actionOffers: 0,
|
|
6
|
+
manageOffers: 0,
|
|
7
|
+
slot: null
|
|
8
|
+
}, i = /* @__PURE__ */ new Set();
|
|
9
|
+
function a(e) {
|
|
10
|
+
r = {
|
|
11
|
+
...r,
|
|
12
|
+
...e
|
|
13
|
+
};
|
|
14
|
+
for (let e of [...i]) e();
|
|
15
|
+
}
|
|
16
|
+
function o(e) {
|
|
17
|
+
return i.add(e), () => {
|
|
18
|
+
i.delete(e);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function s(e) {
|
|
22
|
+
let t = (t) => a(e === "actions" ? { actionOffers: r.actionOffers + t } : { manageOffers: r.manageOffers + t });
|
|
23
|
+
t(1);
|
|
24
|
+
let n = !1;
|
|
25
|
+
return () => {
|
|
26
|
+
n || (n = !0, t(-1));
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function c(e) {
|
|
30
|
+
if (e) return r.slot !== e && a({ slot: e }), () => {
|
|
31
|
+
r.slot === e && a({ slot: null });
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function l() {
|
|
35
|
+
return t(o, () => r.actionOffers > 0, () => !1);
|
|
36
|
+
}
|
|
37
|
+
function u() {
|
|
38
|
+
return t(o, () => r.manageOffers > 0, () => !1);
|
|
39
|
+
}
|
|
40
|
+
var d = ({ className: e }) => /* @__PURE__ */ n("div", {
|
|
41
|
+
ref: c,
|
|
42
|
+
className: e,
|
|
43
|
+
"data-testid": "assistant-page-bar-actions"
|
|
44
|
+
});
|
|
45
|
+
function f({ overlay: n, hostElement: i, actions: a, manageChat: c, view: l }) {
|
|
46
|
+
let u = i !== null && n?.registerPageHost !== void 0 && n.activePageHost === i && l === "chat", d = u && a != null && a !== !1;
|
|
47
|
+
e(() => d ? s("actions") : void 0, [d]);
|
|
48
|
+
let f = u && c;
|
|
49
|
+
e(() => f ? s("manage") : void 0, [f]);
|
|
50
|
+
let p = t(o, () => r.slot, () => null);
|
|
51
|
+
return d ? p : null;
|
|
52
|
+
}
|
|
53
|
+
export { d as AssistantPageBarActionsSlot, l as useAssistantPageBarActionsOffered, f as useAssistantPageBarOffers, u as useAssistantPageChatManaged };
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
export declare const AssistantPageLayoutContext: import('react').Context<boolean>;
|
|
2
2
|
/** True inside a panel laid out as a page. */
|
|
3
3
|
export declare function useAssistantPageLayout(): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* BOFF-15025: which message box the composer draws.
|
|
6
|
+
* - `panel`: the side panel's box, every product's default.
|
|
7
|
+
* - `page`: the page's box (BOFF-14753): the glow, the voice button's breathing ring, and the
|
|
8
|
+
* microphone with its ▾ (microphone and language options).
|
|
9
|
+
* - `tall`: the page's box, taller (M1): about four lines on a new chat, about three in a chat.
|
|
10
|
+
*
|
|
11
|
+
* The panel provides it from its own opt-ins (`AIAssistantPanelProps.tallBox`, `pageBox`). Only the
|
|
12
|
+
* BOX: a side panel that uses the page's box (M3) keeps its header, its Chat | Avatar switch and its
|
|
13
|
+
* Avatar view, which the page layout above would take away.
|
|
14
|
+
*/
|
|
15
|
+
export type AssistantMessageBox = 'panel' | 'page' | 'tall';
|
|
16
|
+
export declare const AssistantMessageBoxContext: import('react').Context<AssistantMessageBox>;
|
|
17
|
+
/**
|
|
18
|
+
* True when the composer draws the page's box: inside a page layout (as before), or in a side panel
|
|
19
|
+
* that opted into the page's box (BOFF-15025, M3).
|
|
20
|
+
*/
|
|
21
|
+
export declare function useAssistantPageBox(): boolean;
|
|
22
|
+
/** True when the page's box is also taller (BOFF-15025, M1). Only ever with the opt-in. */
|
|
23
|
+
export declare function useAssistantTallBox(): boolean;
|
|
4
24
|
/** The page's one column (48rem), for an element that sits in it. */
|
|
5
25
|
export declare const PAGE_COLUMN = "mx-auto w-full max-w-[48rem]";
|
|
6
26
|
/**
|
|
@@ -4,5 +4,13 @@ var n = e(!1);
|
|
|
4
4
|
function r() {
|
|
5
5
|
return t(n);
|
|
6
6
|
}
|
|
7
|
-
var i =
|
|
8
|
-
|
|
7
|
+
var i = e("panel");
|
|
8
|
+
function a() {
|
|
9
|
+
let e = t(n), r = t(i);
|
|
10
|
+
return e || r !== "panel";
|
|
11
|
+
}
|
|
12
|
+
function o() {
|
|
13
|
+
return t(i) === "tall";
|
|
14
|
+
}
|
|
15
|
+
var s = "mx-auto w-full max-w-[48rem]", c = "px-[max(0.75rem,calc((100%_-_46.5rem)/2))]", l = "px-[max(0rem,calc((100%_-_48rem)/2))]";
|
|
16
|
+
export { i as AssistantMessageBoxContext, n as AssistantPageLayoutContext, s as PAGE_COLUMN, c as PAGE_SCROLL_GUTTER, l as PAGE_VIEW_GUTTER, a as useAssistantPageBox, r as useAssistantPageLayout, o as useAssistantTallBox };
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
export type AssistantPageStartSlot = 'above' | 'below';
|
|
2
2
|
/** A page offers start content while it is mounted. Returns the release (idempotent). */
|
|
3
3
|
export declare function offerAssistantPageStart(): () => void;
|
|
4
|
+
/** The open chat, as far as whether a page's start content shows for it. */
|
|
5
|
+
export interface AssistantPageStartChat {
|
|
6
|
+
/** Nothing in its thread yet. */
|
|
7
|
+
empty: boolean;
|
|
8
|
+
/** Its messages are being read from the server, or reading them failed. */
|
|
9
|
+
historyPending: boolean;
|
|
10
|
+
/** Older messages lie before what is loaded (`sync.hasOlder`). */
|
|
11
|
+
hasOlder: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Whether a page's start content shows for the open chat (a page offers it): only where the empty
|
|
15
|
+
* state would, a chat with nothing in it, never over a history load, a failure or older messages.
|
|
16
|
+
* ★ ONE rule for both sides: the chat area draws the start content on it, and (BOFF-15028) the
|
|
17
|
+
* page's bar shows wherever it does not, so a page's controls (in its start content, or in the
|
|
18
|
+
* bar) are always on screen.
|
|
19
|
+
*/
|
|
20
|
+
export declare function assistantPageStartShows(chat: AssistantPageStartChat): boolean;
|
|
4
21
|
/** True while a mounted page offers start content. */
|
|
5
22
|
export declare function useAssistantPageStartOffered(): boolean;
|
|
6
23
|
/** Where the page's start content goes: the chat area's slot, or null while none is drawn. */
|
|
@@ -24,13 +24,16 @@ function a() {
|
|
|
24
24
|
e || (e = !0, r({ offers: t.offers - 1 }));
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function o() {
|
|
27
|
+
function o(e) {
|
|
28
|
+
return e.empty && !e.historyPending && !e.hasOlder;
|
|
29
|
+
}
|
|
30
|
+
function s() {
|
|
28
31
|
return e(i, () => t.offers > 0, () => !1);
|
|
29
32
|
}
|
|
30
|
-
function
|
|
33
|
+
function c(n) {
|
|
31
34
|
return e(i, () => t[n], () => null);
|
|
32
35
|
}
|
|
33
|
-
function
|
|
36
|
+
function l(e, n) {
|
|
34
37
|
t[e] !== n && r(e === "above" ? { above: n } : { below: n });
|
|
35
38
|
}
|
|
36
|
-
export { a as offerAssistantPageStart,
|
|
39
|
+
export { o as assistantPageStartShows, a as offerAssistantPageStart, l as setAssistantPageStartSlot, s as useAssistantPageStartOffered, c as useAssistantPageStartSlot };
|
|
@@ -3,6 +3,24 @@ export interface AssistantConversationMenuProps {
|
|
|
3
3
|
open: boolean;
|
|
4
4
|
onOpenChange: (open: boolean) => void;
|
|
5
5
|
triggerRef?: Ref<HTMLButtonElement>;
|
|
6
|
+
/**
|
|
7
|
+
* BOFF-15028: also Rename, Pin or Unpin, and Delete chat for the open conversation, the actions
|
|
8
|
+
* the History list has. The panel passes it for the page's ⋯ only, where the hosting page asks
|
|
9
|
+
* for it (`AssistantPageHost` `manageChat`). Absent or false: the menu exactly as before.
|
|
10
|
+
*/
|
|
11
|
+
manage?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* BOFF-15028 (with `manage`): runs once a Delete is confirmed, just before the chat is deleted.
|
|
14
|
+
* The panel opens a new chat here, so the page is left on a new chat.
|
|
15
|
+
*/
|
|
16
|
+
onDeleteConfirmed?: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* BOFF-15028: how ⋯ looks. `bar`: the look of the page's controls beside it in the page's bar
|
|
19
|
+
* (bordered, `ASSISTANT_PAGE_BAR_ICON_BUTTON`), tinted while its menu is open; the panel asks for
|
|
20
|
+
* it while the hosting page offers controls (`AssistantPageHost` `actions`). `icon` (default):
|
|
21
|
+
* the bare icon of before.
|
|
22
|
+
*/
|
|
23
|
+
triggerLook?: 'icon' | 'bar';
|
|
6
24
|
}
|
|
7
25
|
/**
|
|
8
26
|
* The ⋯ conversation menu of the compact header (F3): what can be done with
|
|
@@ -25,5 +43,17 @@ export interface AssistantConversationMenuProps {
|
|
|
25
43
|
* the transcript opens through the `assistant.transcript` control the chat
|
|
26
44
|
* area registers, the one a typed or spoken "show the transcript" runs, which
|
|
27
45
|
* stays unregistered while a voice session or the Avatar tab is on.
|
|
46
|
+
*
|
|
47
|
+
* ★★ BOFF-15028 (`manage`, the page's ⋯ only): Rename, Pin or Unpin, then the
|
|
48
|
+
* exports and the transcript, then Delete chat, each through the action the
|
|
49
|
+
* History list uses:
|
|
50
|
+
* - Rename opens "Rename chat" and saves through the store's
|
|
51
|
+
* `renameConversation` (normalised, and synced with history on);
|
|
52
|
+
* - Pin or Unpin is `assistantHistory.updateConversation`, offered exactly
|
|
53
|
+
* where the list offers it (`useHistoryPinFor`); a pin the server refuses
|
|
54
|
+
* for its cap is said on the page (the chat area's pin-limit notice);
|
|
55
|
+
* - Delete chat opens the panel's Delete confirmation (the one the typed
|
|
56
|
+
* "delete this conversation" opens: Cancel first, Delete armed after a
|
|
57
|
+
* moment, a person's click only), then `onDeleteConfirmed`, then the delete.
|
|
28
58
|
*/
|
|
29
59
|
export declare const AssistantConversationMenu: FC<AssistantConversationMenuProps>;
|