@burdenoff/fe-libs 2026.1117.2 → 2026.1117.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/shared/assistant/history/historyControls.d.ts +5 -0
- package/dist/shared/assistant/history/historyControls.js +9 -5
- package/dist/shared/assistant/home/AssistantHomeActions.d.ts +37 -0
- package/dist/shared/assistant/home/AssistantHomeActions.js +68 -0
- package/dist/shared/assistant/home/AssistantHomeComposer.d.ts +36 -0
- package/dist/shared/assistant/home/AssistantHomeComposer.js +85 -0
- package/dist/shared/assistant/home/AssistantHomeHistory.d.ts +106 -0
- package/dist/shared/assistant/home/AssistantHomeHistory.js +499 -0
- package/dist/shared/assistant/home/AssistantHomePage.d.ts +67 -0
- package/dist/shared/assistant/home/AssistantHomePage.js +78 -0
- package/dist/shared/assistant/home/AssistantHomeStart.d.ts +171 -0
- package/dist/shared/assistant/home/AssistantHomeStart.js +224 -0
- package/dist/shared/assistant/home/assistantHomeChat.d.ts +47 -0
- package/dist/shared/assistant/home/assistantHomeChat.js +49 -0
- package/dist/shared/assistant/home/assistantHomeHistoryRows.d.ts +93 -0
- package/dist/shared/assistant/home/assistantHomeHistoryRows.js +113 -0
- package/dist/shared/assistant/home/assistantHomeRoutes.d.ts +49 -0
- package/dist/shared/assistant/home/assistantHomeRoutes.js +48 -0
- package/dist/shared/assistant/home/assistantHomeTopBar.d.ts +4 -0
- package/dist/shared/assistant/home/assistantHomeTopBar.js +10 -0
- package/dist/shared/assistant/home/useAssistantHomeHistoryRows.d.ts +46 -0
- package/dist/shared/assistant/home/useAssistantHomeHistoryRows.js +120 -0
- package/dist/shared/assistant/home.d.ts +19 -0
- package/dist/shared/assistant/home.js +11 -0
- package/dist/shared/assistant/index.d.ts +10 -0
- package/dist/shared/assistant/ui/AssistantConversationList.js +44 -48
- package/dist/shared-assistant.js +222 -212
- package/package.json +1 -1
|
@@ -78,6 +78,11 @@ export interface AssistantHistoryRowControls {
|
|
|
78
78
|
export declare function resolveRowControls(conversation: Pick<Conversation, 'messages'> | null, header: AssistantHistoryHeader | null, pending?: readonly AssistantHistoryPendingUpdate[]): AssistantHistoryRowControls;
|
|
79
79
|
/** The list's default: every conversation that is not archived. */
|
|
80
80
|
export declare const DEFAULT_HISTORY_LIST_FILTER: Readonly<AssistantHistoryConversationFilter>;
|
|
81
|
+
/**
|
|
82
|
+
* ★★ BOFF-8159: every conversation, archived ones too: the list while the server lacks the
|
|
83
|
+
* controls (no filters, no Archived view to find an archived chat in), as it was before them.
|
|
84
|
+
*/
|
|
85
|
+
export declare const ALL_HISTORY_LIST_FILTER: Readonly<AssistantHistoryConversationFilter>;
|
|
81
86
|
/**
|
|
82
87
|
* Does a row pass the filter — the server's rule, applied here to what the
|
|
83
88
|
* device holds: CHAT means it holds a typed person turn, VOICE a spoken one,
|
|
@@ -67,22 +67,26 @@ var p = {
|
|
|
67
67
|
channel: "ANY",
|
|
68
68
|
pinned: null,
|
|
69
69
|
archived: "EXCLUDE"
|
|
70
|
+
}, m = {
|
|
71
|
+
channel: "ANY",
|
|
72
|
+
pinned: null,
|
|
73
|
+
archived: "INCLUDE"
|
|
70
74
|
};
|
|
71
|
-
function
|
|
75
|
+
function h(e, t = p) {
|
|
72
76
|
let n = t.archived ?? "EXCLUDE";
|
|
73
77
|
if (n === "EXCLUDE" && e.archivedAt !== null || n === "ONLY" && e.archivedAt === null || t.pinned === !0 && e.pinnedAt === null || t.pinned === !1 && e.pinnedAt !== null) return !1;
|
|
74
78
|
let r = u(e.channel), i = t.channel ?? "ANY";
|
|
75
79
|
return !(i === "CHAT" && !r.typed || i === "VOICE" && !r.spoken);
|
|
76
80
|
}
|
|
77
|
-
function
|
|
81
|
+
function g(e) {
|
|
78
82
|
if (!e) return "";
|
|
79
83
|
let t = e.pinned === !0 ? "pinned" : e.pinned === !1 ? "unpinned" : "any";
|
|
80
84
|
return `${e.channel ?? "ANY"}|${t}|${e.archived ?? "EXCLUDE"}`;
|
|
81
85
|
}
|
|
82
|
-
function
|
|
86
|
+
function _(e) {
|
|
83
87
|
return (e.channel ?? "ANY") === "ANY" && (e.pinned ?? null) === null && (e.archived ?? "EXCLUDE") === "EXCLUDE";
|
|
84
88
|
}
|
|
85
|
-
function
|
|
89
|
+
function v(e) {
|
|
86
90
|
return e.archived === "ONLY" ? "archived" : e.pinned === !0 ? "pinned" : e.channel === "VOICE" ? "voice" : e.channel === "CHAT" ? "chat" : null;
|
|
87
91
|
}
|
|
88
|
-
export { p as DEFAULT_HISTORY_LIST_FILTER, t as HISTORY_TITLE_MAX_CODE_POINTS, e as MAX_PINNED, r as clampToCodePoints, s as coalesceUpdatePatch, i as codePointLength, a as collapseHistoryText,
|
|
92
|
+
export { m as ALL_HISTORY_LIST_FILTER, p as DEFAULT_HISTORY_LIST_FILTER, t as HISTORY_TITLE_MAX_CODE_POINTS, e as MAX_PINNED, r as clampToCodePoints, s as coalesceUpdatePatch, i as codePointLength, a as collapseHistoryText, v as historyFilterEmptyKind, g as historyFilterKey, _ as isDefaultHistoryFilter, c as isValidUpdatePatch, l as localChannelOf, h as matchesHistoryFilter, o as normaliseHistoryTitle, d as pendingUpdatesByConversation, f as resolveRowControls };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** The actions' words, already in the reader's language. */
|
|
3
|
+
export interface AssistantHomeActionsLabels {
|
|
4
|
+
/** "History": the way from a chat to the list of chats. */
|
|
5
|
+
history: string;
|
|
6
|
+
/** "New chat". */
|
|
7
|
+
newChat: string;
|
|
8
|
+
}
|
|
9
|
+
/** What a host gives the page's actions wherever they are drawn. */
|
|
10
|
+
export interface AssistantHomeActionsContent {
|
|
11
|
+
labels: AssistantHomeActionsLabels;
|
|
12
|
+
/**
|
|
13
|
+
* The host's own controls after History and New chat (say, a suggestions inbox and the page's
|
|
14
|
+
* tour trigger). Desktop only: a phone shell's own top bar carries them.
|
|
15
|
+
*/
|
|
16
|
+
extras?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export interface AssistantHomeActionsProps extends AssistantHomeActionsContent {
|
|
19
|
+
/** History: the way from a chat to the list of chats. */
|
|
20
|
+
history?: boolean;
|
|
21
|
+
/** New chat: from a chat, or from History. */
|
|
22
|
+
newChat?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The actions themselves, with no row of their own: in a chat they go in the assistant's page bar
|
|
26
|
+
* (`<AssistantHomeActions history newChat … />` as `AssistantPageHost` `actions`); the start page
|
|
27
|
+
* and History put them in `AssistantHomeActionsBar`. The wrapper wraps, as the bar's slot asks, so
|
|
28
|
+
* a narrow bar puts them on another line instead of over ⋯.
|
|
29
|
+
*/
|
|
30
|
+
export declare function AssistantHomeActions({ history, newChat, labels, extras, }: AssistantHomeActionsProps): import('react').JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* The actions in a row of their own, for a view the page bar is not drawn over: the start page (the
|
|
33
|
+
* first row of its hero, under the hero's glow) and History (above its list). The bar's own row, so
|
|
34
|
+
* they sit where a chat's bar puts them. Without History or New chat the row holds only the
|
|
35
|
+
* desktop-only host controls, so a phone does not draw it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function AssistantHomeActionsBar(props: AssistantHomeActionsProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Button as e } from "../../../ui/button.js";
|
|
2
|
+
import { Tooltip as t, TooltipContent as n, TooltipTrigger as r } from "../../../ui/tooltip.js";
|
|
3
|
+
import { useAssistantStore as i } from "../store.js";
|
|
4
|
+
import { ASSISTANT_PAGE_BAR_LABEL as a, ASSISTANT_PAGE_BAR_LABELLED_BUTTON as o, ASSISTANT_PAGE_BAR_ROW as s } from "../ui/compact/AssistantPageBar.js";
|
|
5
|
+
import { assistantHomeOpenChatIsNew as c, assistantHomeReusableOpenChat as l, useAssistantHomeNewChat as u } from "./assistantHomeChat.js";
|
|
6
|
+
import { useAssistantHomeChatShown as d, useAssistantHomeTab as f } from "./assistantHomeRoutes.js";
|
|
7
|
+
import { History as p, Plus as m } from "lucide-react";
|
|
8
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
|
+
// src/shared/assistant/home/AssistantHomeActions.tsx
|
|
10
|
+
function _({ label: i, icon: s, testId: c, onClick: l }) {
|
|
11
|
+
return /* @__PURE__ */ g(t, { children: [/* @__PURE__ */ h(r, {
|
|
12
|
+
asChild: !0,
|
|
13
|
+
children: /* @__PURE__ */ g(e, {
|
|
14
|
+
type: "button",
|
|
15
|
+
variant: "outline",
|
|
16
|
+
size: "sm",
|
|
17
|
+
className: o,
|
|
18
|
+
"data-testid": c,
|
|
19
|
+
onClick: l,
|
|
20
|
+
children: [s, /* @__PURE__ */ h("span", {
|
|
21
|
+
className: a,
|
|
22
|
+
children: i
|
|
23
|
+
})]
|
|
24
|
+
})
|
|
25
|
+
}), /* @__PURE__ */ h(n, { children: i })] });
|
|
26
|
+
}
|
|
27
|
+
function v({ history: e = !1, newChat: t = !1, labels: n, extras: r }) {
|
|
28
|
+
let { setTab: a } = f(), o = d(), s = u();
|
|
29
|
+
return /* @__PURE__ */ g("div", {
|
|
30
|
+
className: "flex flex-wrap items-center justify-end gap-1.5",
|
|
31
|
+
"data-testid": "assistant-home-actions",
|
|
32
|
+
children: [
|
|
33
|
+
e ? /* @__PURE__ */ h(_, {
|
|
34
|
+
label: n.history,
|
|
35
|
+
icon: /* @__PURE__ */ h(p, {
|
|
36
|
+
className: "size-4 text-accent-glow",
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
}),
|
|
39
|
+
testId: "assistant-home-history",
|
|
40
|
+
onClick: () => a("history")
|
|
41
|
+
}) : null,
|
|
42
|
+
t ? /* @__PURE__ */ h(_, {
|
|
43
|
+
label: n.newChat,
|
|
44
|
+
icon: /* @__PURE__ */ h(m, {
|
|
45
|
+
className: "size-4 text-accent-glow",
|
|
46
|
+
"aria-hidden": "true"
|
|
47
|
+
}),
|
|
48
|
+
testId: "shell-new-chat",
|
|
49
|
+
onClick: () => {
|
|
50
|
+
(!c() || o && l() === null) && (i.getState().setActiveConversation(null), s()), a("chat", { dropPrompt: !0 });
|
|
51
|
+
}
|
|
52
|
+
}) : null,
|
|
53
|
+
/* @__PURE__ */ h("span", {
|
|
54
|
+
className: "hidden md:contents",
|
|
55
|
+
children: r
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function y(e) {
|
|
61
|
+
let t = e.history === !0 || e.newChat === !0;
|
|
62
|
+
return /* @__PURE__ */ h("div", {
|
|
63
|
+
className: `${t ? "flex" : "hidden md:flex"} ${s}`,
|
|
64
|
+
"data-testid": "assistant-home-actions-bar",
|
|
65
|
+
children: /* @__PURE__ */ h(v, { ...e })
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export { v as AssistantHomeActions, y as AssistantHomeActionsBar };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { AssistantHomeIcon } from './AssistantHomeStart';
|
|
3
|
+
/** One choice of the intent toggle. */
|
|
4
|
+
export interface AssistantHomeComposerIntent<I extends string> {
|
|
5
|
+
value: I;
|
|
6
|
+
label: string;
|
|
7
|
+
icon: AssistantHomeIcon;
|
|
8
|
+
}
|
|
9
|
+
/** The box's words, already in the reader's language. */
|
|
10
|
+
export interface AssistantHomeComposerLabels {
|
|
11
|
+
/** The box's placeholder and name. */
|
|
12
|
+
placeholder: string;
|
|
13
|
+
/** The attach button's name and tooltip ("Attach files in the assistant"). */
|
|
14
|
+
attach: string;
|
|
15
|
+
/** The intent toggle's name ("What to do"). */
|
|
16
|
+
intents: string;
|
|
17
|
+
/** "Enter to send". */
|
|
18
|
+
enterToSend: string;
|
|
19
|
+
/** The send button's name. */
|
|
20
|
+
send: string;
|
|
21
|
+
}
|
|
22
|
+
export interface AssistantHomeComposerProps<I extends string> {
|
|
23
|
+
labels: AssistantHomeComposerLabels;
|
|
24
|
+
intents: readonly AssistantHomeComposerIntent<I>[];
|
|
25
|
+
intent: I;
|
|
26
|
+
onIntentChange: (intent: I) => void;
|
|
27
|
+
/** Send the draft. Only called with non-blank text. */
|
|
28
|
+
onSend: (text: string) => void;
|
|
29
|
+
/** Open the assistant to attach files (the overlay owns attachments). */
|
|
30
|
+
onAttach: () => void;
|
|
31
|
+
/** The text the box starts with (never sent on its own). */
|
|
32
|
+
initialDraft?: string;
|
|
33
|
+
/** The text box, say to focus it. */
|
|
34
|
+
ref?: Ref<HTMLTextAreaElement>;
|
|
35
|
+
}
|
|
36
|
+
export declare function AssistantHomeComposer<I extends string>({ labels, intents, intent, onIntentChange, onSend, onAttach, initialDraft, ref, }: AssistantHomeComposerProps<I>): import('react').JSX.Element;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Button as e } from "../../../ui/button.js";
|
|
2
|
+
import { Tooltip as t, TooltipContent as n, TooltipTrigger as r } from "../../../ui/tooltip.js";
|
|
3
|
+
import { useId as i, useState as a } from "react";
|
|
4
|
+
import { ArrowUp as o, Paperclip as s } from "lucide-react";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
// src/shared/assistant/home/AssistantHomeComposer.tsx
|
|
7
|
+
var u = "inline-flex h-7 items-center gap-1.5 rounded-button px-2.5 text-body-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring", d = `${u} bg-accent-soft text-text-primary`, f = `${u} text-text-secondary hover:bg-bg-sunken hover:text-text-primary`;
|
|
8
|
+
function p({ labels: u, intents: p, intent: m, onIntentChange: h, onSend: g, onAttach: _, initialDraft: v, ref: y }) {
|
|
9
|
+
let [b, x] = a(v ?? ""), S = i(), C = b.trim().length > 0, w = () => {
|
|
10
|
+
let e = b.trim();
|
|
11
|
+
e && (g(e), x(""));
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ l("form", {
|
|
14
|
+
className: "w-full rounded-card border border-border-subtle bg-bg-elevated shadow-card focus-within:ring-2 focus-within:ring-focus-ring",
|
|
15
|
+
onSubmit: (e) => {
|
|
16
|
+
e.preventDefault(), w();
|
|
17
|
+
},
|
|
18
|
+
children: [/* @__PURE__ */ c("textarea", {
|
|
19
|
+
ref: y,
|
|
20
|
+
value: b,
|
|
21
|
+
onChange: (e) => x(e.target.value),
|
|
22
|
+
onKeyDown: (e) => {
|
|
23
|
+
e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(), w());
|
|
24
|
+
},
|
|
25
|
+
placeholder: u.placeholder,
|
|
26
|
+
"aria-label": u.placeholder,
|
|
27
|
+
"aria-describedby": S,
|
|
28
|
+
rows: 2,
|
|
29
|
+
className: "block w-full resize-none bg-transparent px-4 pt-4 pb-2 text-body-md text-text-primary placeholder:text-text-placeholder focus:outline-none"
|
|
30
|
+
}), /* @__PURE__ */ l("div", {
|
|
31
|
+
className: "flex items-center gap-2 px-3 pb-3",
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(r, {
|
|
34
|
+
asChild: !0,
|
|
35
|
+
children: /* @__PURE__ */ c(e, {
|
|
36
|
+
type: "button",
|
|
37
|
+
variant: "ghost",
|
|
38
|
+
size: "icon-sm",
|
|
39
|
+
"aria-label": u.attach,
|
|
40
|
+
onClick: _,
|
|
41
|
+
children: /* @__PURE__ */ c(s, {
|
|
42
|
+
className: "size-4",
|
|
43
|
+
"aria-hidden": "true"
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
}), /* @__PURE__ */ c(n, { children: u.attach })] }),
|
|
47
|
+
/* @__PURE__ */ c("div", {
|
|
48
|
+
role: "group",
|
|
49
|
+
"aria-label": u.intents,
|
|
50
|
+
className: "inline-flex items-center gap-0.5 rounded-button bg-bg-sunken p-0.5",
|
|
51
|
+
children: p.map((e) => {
|
|
52
|
+
let t = m === e.value, n = e.icon;
|
|
53
|
+
return /* @__PURE__ */ l("button", {
|
|
54
|
+
type: "button",
|
|
55
|
+
"aria-pressed": t,
|
|
56
|
+
className: t ? d : f,
|
|
57
|
+
onClick: () => h(e.value),
|
|
58
|
+
children: [/* @__PURE__ */ c(n, {
|
|
59
|
+
className: t ? "size-3.5 text-accent-primary" : "size-3.5",
|
|
60
|
+
"aria-hidden": "true"
|
|
61
|
+
}), e.label]
|
|
62
|
+
}, e.value);
|
|
63
|
+
})
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ c("span", {
|
|
66
|
+
id: S,
|
|
67
|
+
className: "ms-auto hidden text-caption text-text-muted sm:inline",
|
|
68
|
+
children: u.enterToSend
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ c(e, {
|
|
71
|
+
type: "submit",
|
|
72
|
+
size: "icon",
|
|
73
|
+
className: "ms-auto rounded-pill sm:ms-0",
|
|
74
|
+
disabled: !C,
|
|
75
|
+
"aria-label": u.send,
|
|
76
|
+
children: /* @__PURE__ */ c(o, {
|
|
77
|
+
className: "size-4",
|
|
78
|
+
"aria-hidden": "true"
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
export { p as AssistantHomeComposer };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { AssistantHomeHistoryFilter, AssistantHomeHistoryRow } from './assistantHomeHistoryRows';
|
|
2
|
+
import { AssistantHomeIcon } from './AssistantHomeStart';
|
|
3
|
+
import { AssistantHomeHistoryRowsState } from './useAssistantHomeHistoryRows';
|
|
4
|
+
/** The view's words, already in the reader's language. */
|
|
5
|
+
export interface AssistantHomeHistoryLabels {
|
|
6
|
+
/** The title over the list ("History"). */
|
|
7
|
+
title: string;
|
|
8
|
+
/** The search box's placeholder and name ("Search your chats"). */
|
|
9
|
+
search: string;
|
|
10
|
+
/** The pills' group name ("Filter chats"). */
|
|
11
|
+
filters: string;
|
|
12
|
+
/** The first pill ("All"). */
|
|
13
|
+
all: string;
|
|
14
|
+
/** The Pinned pill, and a pinned row's pin. */
|
|
15
|
+
pinned: string;
|
|
16
|
+
/** The Voice pill, and a spoken chat's badge. */
|
|
17
|
+
voice: string;
|
|
18
|
+
/** The Typed pill. */
|
|
19
|
+
typed: string;
|
|
20
|
+
/** The Archived pill, and an archived row's badge. */
|
|
21
|
+
archived: string;
|
|
22
|
+
/** A chat both typed and spoken ("Chat + voice"). */
|
|
23
|
+
mixed: string;
|
|
24
|
+
today: string;
|
|
25
|
+
yesterday: string;
|
|
26
|
+
thisWeek: string;
|
|
27
|
+
older: string;
|
|
28
|
+
/** No chats at all ("Your chats with the assistant will show up here."). */
|
|
29
|
+
empty: string;
|
|
30
|
+
emptyPinned: string;
|
|
31
|
+
emptyVoice: string;
|
|
32
|
+
emptyTyped: string;
|
|
33
|
+
emptyArchived: string;
|
|
34
|
+
/** A search or kind with no match ("No chats match."). */
|
|
35
|
+
noMatches: string;
|
|
36
|
+
/** Under an empty list with nothing filtered ("Start a chat"). */
|
|
37
|
+
startChat: string;
|
|
38
|
+
showMore: string;
|
|
39
|
+
showOlder: string;
|
|
40
|
+
searchTooShort: string;
|
|
41
|
+
searching: string;
|
|
42
|
+
searchBusy: string;
|
|
43
|
+
searchFailed: string;
|
|
44
|
+
/** A refused pin: "You can pin up to {{limit}} chats…". */
|
|
45
|
+
pinLimit: (limit: number) => string;
|
|
46
|
+
/** What an untitled chat is called. */
|
|
47
|
+
untitled: string;
|
|
48
|
+
/** "12 messages" (and "1 message"). */
|
|
49
|
+
messages: (count: number) => string;
|
|
50
|
+
/** "3 spoken" (and "1 spoken"). */
|
|
51
|
+
spoken: (count: number) => string;
|
|
52
|
+
/** The row menu's name: "Actions for {{title}}". */
|
|
53
|
+
actionsFor: (title: string) => string;
|
|
54
|
+
rename: string;
|
|
55
|
+
pin: string;
|
|
56
|
+
unpin: string;
|
|
57
|
+
archive: string;
|
|
58
|
+
unarchive: string;
|
|
59
|
+
delete: string;
|
|
60
|
+
renameTitle: string;
|
|
61
|
+
renameBody: string;
|
|
62
|
+
renameField: string;
|
|
63
|
+
cancel: string;
|
|
64
|
+
save: string;
|
|
65
|
+
deleteTitle: string;
|
|
66
|
+
deleteBody: string;
|
|
67
|
+
deleteConfirm: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* One of the product's kinds of chat: its pill, the words under a row, and the row's icon. A kind's
|
|
71
|
+
* `value` is never `all` or one of the engine's pills (`pinned`, `voice`, `typed`, `archived`).
|
|
72
|
+
*/
|
|
73
|
+
export interface AssistantHomeHistoryKind<K extends string> {
|
|
74
|
+
value: K;
|
|
75
|
+
/** The pill ("Built a workflow"). */
|
|
76
|
+
filterLabel: string;
|
|
77
|
+
/** Under a row's title ("Built a workflow", "Question"). */
|
|
78
|
+
rowLabel: string;
|
|
79
|
+
icon: AssistantHomeIcon;
|
|
80
|
+
}
|
|
81
|
+
/** The product's own link in a row's menu (say, the workflow the chat built). */
|
|
82
|
+
export interface AssistantHomeHistoryRowLink<R> {
|
|
83
|
+
label: string;
|
|
84
|
+
icon: AssistantHomeIcon;
|
|
85
|
+
/** The row's link, or null for none (the item is then left out). */
|
|
86
|
+
pathOf: (row: R) => string | null;
|
|
87
|
+
}
|
|
88
|
+
export interface AssistantHomeHistoryProps<K extends string, R extends AssistantHomeHistoryRow<K>> {
|
|
89
|
+
labels: AssistantHomeHistoryLabels;
|
|
90
|
+
/** The product's kinds, as pills after All. None: no kind pills. */
|
|
91
|
+
kinds?: readonly AssistantHomeHistoryKind<K>[];
|
|
92
|
+
/** For the rows' times (the app's locale, never the browser's). */
|
|
93
|
+
locale: string;
|
|
94
|
+
/** The rows and their controls for `query` and `filter` (`useAssistantHomeHistoryRows`). */
|
|
95
|
+
history: AssistantHomeHistoryRowsState<R>;
|
|
96
|
+
query: string;
|
|
97
|
+
onQueryChange: (query: string) => void;
|
|
98
|
+
filter: AssistantHomeHistoryFilter<K>;
|
|
99
|
+
onFilterChange: (filter: AssistantHomeHistoryFilter<K>) => void;
|
|
100
|
+
/** Open a chat (by its history key). */
|
|
101
|
+
onOpen: (key: string) => void;
|
|
102
|
+
/** "Start a chat", under an empty list. */
|
|
103
|
+
onStart: () => void;
|
|
104
|
+
rowLink?: AssistantHomeHistoryRowLink<R>;
|
|
105
|
+
}
|
|
106
|
+
export declare function AssistantHomeHistory<K extends string, R extends AssistantHomeHistoryRow<K>>({ labels, kinds, locale, history, query, onQueryChange, filter, onFilterChange, onOpen, onStart, rowLink, }: AssistantHomeHistoryProps<K, R>): import('react').JSX.Element;
|