@ciridae/ui 2.86.0 → 2.87.0
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.
|
@@ -101,7 +101,7 @@ export type ChatLogAssistantMessage = ChatLogMessageFields & {
|
|
|
101
101
|
*/
|
|
102
102
|
question?: ChatMessageQuestion;
|
|
103
103
|
};
|
|
104
|
-
/** One entry of the chat, oldest first. */
|
|
104
|
+
/** One entry of the chat, oldest first, drawn in the order the source gives them. */
|
|
105
105
|
export type ChatLogItem = ChatLogUserMessage | ChatLogAssistantMessage
|
|
106
106
|
/** A line about the chat, such as how an earlier turn ended. */
|
|
107
107
|
| {
|
|
@@ -110,6 +110,29 @@ export type ChatLogItem = ChatLogUserMessage | ChatLogAssistantMessage
|
|
|
110
110
|
kind: "line";
|
|
111
111
|
text: ReactNode;
|
|
112
112
|
tone?: ChatSystemLineProps["tone"];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* A row the app draws itself, such as a call held in the chat with its transcript to expand.
|
|
116
|
+
* The timeline gives `content` the column's full width, as wide as its widest bubble, and draws
|
|
117
|
+
* nothing around it; it scrolls, pages, takes its day's heading and ends a sender's run as a
|
|
118
|
+
* line does.
|
|
119
|
+
*
|
|
120
|
+
* The app places it among `items` by its `at`; the kit draws them in the order given and never
|
|
121
|
+
* sorts. A row belongs to the page whose messages' times hold its `at`, and the oldest page
|
|
122
|
+
* (`olderItems` `none`) takes every earlier row.
|
|
123
|
+
*
|
|
124
|
+
* Rows far from the view are not on the page: keep what the row's content changes, such as
|
|
125
|
+
* whether it is expanded, in the app by the item's `id`, not in the content's own state.
|
|
126
|
+
*
|
|
127
|
+
* A row within one screen of the newest item that grows, such as a transcript the person opens,
|
|
128
|
+
* keeps the timeline's foot where it was, as a reply that grows does: the row's top, and the
|
|
129
|
+
* control the person pressed, move up by what it grew.
|
|
130
|
+
*/
|
|
131
|
+
| {
|
|
132
|
+
id: ChatItemId;
|
|
133
|
+
at: EpochMilliseconds;
|
|
134
|
+
kind: "app_row";
|
|
135
|
+
content: ReactNode;
|
|
113
136
|
};
|
|
114
137
|
/** Why the person's message did not send (`message`, where known), and `retry`, which sends it again. */
|
|
115
138
|
export type ChatMessageSendFailure = {
|
|
@@ -63,6 +63,11 @@ export type ChatTimelineEntry = {
|
|
|
63
63
|
text: ReactNode;
|
|
64
64
|
tone?: ChatSystemLineProps["tone"];
|
|
65
65
|
}
|
|
66
|
+
/** A row the app draws itself, centered as wide as the widest bubble; see `ChatLogItem`. */
|
|
67
|
+
| {
|
|
68
|
+
kind: "app_row";
|
|
69
|
+
content: ReactNode;
|
|
70
|
+
}
|
|
66
71
|
/**
|
|
67
72
|
* The agent's typing dots, the timeline's last entry, where its reply will appear: a bubble of
|
|
68
73
|
* three dots on its side, named for `agent` to screen readers. See `ChatTypingDots`. They arriving or
|
|
@@ -202,6 +202,15 @@ const messageBubbleSlot = css({
|
|
|
202
202
|
"[data-shown] > &": { transformOrigin: "top right", _rtl: { transformOrigin: "top left" } },
|
|
203
203
|
},
|
|
204
204
|
});
|
|
205
|
+
/* A row the app draws itself: centered, as wide as the widest bubble, with nothing drawn around it. */
|
|
206
|
+
const appRow = css({
|
|
207
|
+
alignSelf: "center",
|
|
208
|
+
width: "full",
|
|
209
|
+
minWidth: "0",
|
|
210
|
+
maxWidth: "[min(token(sizes.chat.bubble), token(sizes.chat.messageBubble))]",
|
|
211
|
+
// A jump focuses it; the keyboard sees the ring a message's bubble takes.
|
|
212
|
+
_focusVisible: { focusRing: "outer" },
|
|
213
|
+
});
|
|
205
214
|
/* A message's files after its text, each a bubble of its own on the message's side. */
|
|
206
215
|
const messageFileList = css({
|
|
207
216
|
display: "flex",
|
|
@@ -438,6 +447,11 @@ export function ChatTimeline({ entries, agent, firstUnread, olderItems, newerIte
|
|
|
438
447
|
// timeline opens with one already in it.
|
|
439
448
|
role: entry.tone === "error" && !wasEntryPresentAtFirstDraw(entry.id) ? "alert" : undefined, "data-timeline-item": "", children: entry.text }, entry.id));
|
|
440
449
|
}
|
|
450
|
+
if (entry.kind === "app_row") {
|
|
451
|
+
return (_jsx("div", { className: appRow, "data-timeline-item": "", "data-entry-id": entry.id,
|
|
452
|
+
// A jump to it, as to a message, focuses it, so a screen reader reads it next.
|
|
453
|
+
tabIndex: -1, children: entry.content }, entry.id));
|
|
454
|
+
}
|
|
441
455
|
if (entry.kind === "typing_dots") {
|
|
442
456
|
return (_jsx("div", { "data-timeline-item": "", "data-entry-id": entry.id, "data-side": "other", children: _jsx(ChatTypingDots, { agent: entry.agent }) }, entry.id));
|
|
443
457
|
}
|
|
@@ -465,6 +465,8 @@ function buildTimeline({ labels, agent, source: { items, turnState, newerItems,
|
|
|
465
465
|
}
|
|
466
466
|
case "line":
|
|
467
467
|
return { kind: "line", id: item.id, at: item.at, text: item.text, tone: item.tone };
|
|
468
|
+
case "app_row":
|
|
469
|
+
return { kind: "app_row", id: item.id, at: item.at, content: item.content };
|
|
468
470
|
}
|
|
469
471
|
}
|
|
470
472
|
/**
|
|
@@ -3663,6 +3663,14 @@
|
|
|
3663
3663
|
resize: horizontal;
|
|
3664
3664
|
}
|
|
3665
3665
|
|
|
3666
|
+
.cg_layout\.tightGap {
|
|
3667
|
+
column-gap: var(--spacing-layout\.tight-gap);
|
|
3668
|
+
}
|
|
3669
|
+
|
|
3670
|
+
.justify-self_stretch {
|
|
3671
|
+
justify-self: stretch;
|
|
3672
|
+
}
|
|
3673
|
+
|
|
3666
3674
|
.ps_layout\.clusterGap {
|
|
3667
3675
|
padding-inline-start: var(--spacing-layout\.cluster-gap);
|
|
3668
3676
|
}
|
|
@@ -10610,6 +10618,10 @@
|
|
|
10610
10618
|
flex-shrink: 0;
|
|
10611
10619
|
}
|
|
10612
10620
|
|
|
10621
|
+
.\[\&_b\]\:c_fg\.label b {
|
|
10622
|
+
color: var(--colors-fg\.label);
|
|
10623
|
+
}
|
|
10624
|
+
|
|
10613
10625
|
.\[\&_\>_div\]\:d_flex > div {
|
|
10614
10626
|
display: flex;
|
|
10615
10627
|
}
|