@gemboss/ui 0.68.0 → 0.70.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.
- package/CHANGELOG.md +166 -5
- package/README.md +89 -9
- package/catalog/editor.html +10 -8
- package/catalog/index.html +615 -564
- package/gemboss-ui.css +3 -3
- package/package.json +6 -2
- package/parts/components.css +1 -1
- package/parts/core.css +1 -1
- package/parts/shell.css +1 -1
- package/src/assistant/attachments.tsx +486 -0
- package/src/assistant/chat-cards.tsx +343 -0
- package/src/assistant/chat.tsx +113 -16
- package/src/assistant/composer-menus.tsx +251 -0
- package/src/assistant/engine.tsx +5 -1
- package/src/assistant/host.tsx +8 -11
- package/src/assistant/index.ts +10 -1
- package/src/assistant-chat.css +1 -1
- package/src/assistant-plain.js +1 -1
- package/src/assistant.css +1 -1
- package/src/auth-field.css +1 -1
- package/src/auth.tsx +4 -2
- package/src/chat-attachments.css +1 -0
- package/src/chat-cards.css +1 -0
- package/src/chat-composer-menus.css +1 -0
- package/src/chat-composer.css +1 -1
- package/src/chat-plain.js +5 -5
- package/src/chat-voice.css +1 -1
- package/src/chat.css +1 -1
- package/src/collections.tsx +8 -1
- package/src/editor/controls.tsx +51 -10
- package/src/editor/field-frame.tsx +4 -10
- package/src/editor/index.ts +2 -4
- package/src/editor/inspector-frame.tsx +143 -32
- package/src/editor/items-field.tsx +8 -3
- package/src/editor/items.ts +30 -6
- package/src/editor/panel.tsx +4 -5
- package/src/editor-inspector-frame.css +1 -1
- package/src/editor-media.css +1 -0
- package/src/editor-plain.js +1 -1
- package/src/editor-rail.css +1 -1
- package/src/editor.css +1 -1
- package/src/email-editor/editor.tsx +96 -69
- package/src/email-editor.css +1 -1
- package/src/gem-at-work.css +1 -1
- package/src/gem-at-work.ts +177 -33
- package/src/gem-holo.css +1 -1
- package/src/icons.tsx +42 -0
- package/src/index-table-extras.css +1 -0
- package/src/index-table.tsx +37 -16
- package/src/menu.tsx +11 -4
- package/src/narration.css +1 -1
- package/src/selection.tsx +22 -12
- package/src/editor/chips.tsx +0 -24
- package/src/editor-chips.css +0 -1
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WHAT CAN APPEAR IN THE CHAT STREAM, BESIDE WORDS — @gemboss/ui (11/11/2026, Chris on the UI/UX canvas, board ChatKit "kho thành phần":
|
|
5
|
+
* "sưu tầm từ code và bổ sung kho các element/component sẽ xuất hiện trong khung chat … để còn tái sử dụng ở những chỗ khác", then
|
|
6
|
+
* "code kỹ cái khung chat … update cho tất cả các service theo gemboss ui").
|
|
7
|
+
*
|
|
8
|
+
* Until now the admin drew these in its own files (components/chat: ChatActions, DecideThing, TurnTextChanges, ChatPageBands, the
|
|
9
|
+
* feedback row and the choices inside GemChat), so no other surface could show a card, a poll or a change list the same way. They are
|
|
10
|
+
* the kit's now, grown from that code: same class names where the admin's sheet, its tests and its gates already name them
|
|
11
|
+
* (`gemboss-ec-*`), one new generic card (`gb-chat-card`) the result, the preview and any surface's own card are built on.
|
|
12
|
+
*
|
|
13
|
+
* The parts, as the board numbers them:
|
|
14
|
+
* ChatCard a thing the turn made or is making: picture, tag, title, one line, a bar while it runs, a note, buttons (10–12).
|
|
15
|
+
* ChatChoices the answer's choices: plain chips (05) or a poll with "Gem's pick" and "Something else" (06).
|
|
16
|
+
* ChatDecide the question waiting over the message box (07), with ChatThing for what it is about.
|
|
17
|
+
* ChatTextChanges the words a turn rewrote: old struck, new under it (14).
|
|
18
|
+
* ChatPageBands a page's sections as bars (13).
|
|
19
|
+
* ChatCta buttons that go somewhere the chat cannot do the work (16).
|
|
20
|
+
* ChatFeedback under a finished answer: helpful, not helpful, copy (22).
|
|
21
|
+
*
|
|
22
|
+
* Icons come from the kit's set only (<Icon>): no ✕ ⌖ 👍 → text glyphs, no Polaris icons (other services cannot use those).
|
|
23
|
+
* Every word a button says is English by default (Chris 03/10/2026: the chrome is English), and each part takes its words as props.
|
|
24
|
+
*/
|
|
25
|
+
// Its own sheet, and the two that draw parts it shares with the chat body: chips and the poll's touch size (chat.css), the waiting box
|
|
26
|
+
// (assistant-chat.css). A surface that imports ChatChoices or ChatDecide alone gets them styled (review: chat.tsx may be tree-shaken away).
|
|
27
|
+
import "../chat.css";
|
|
28
|
+
import "../assistant-chat.css";
|
|
29
|
+
import "../chat-cards.css";
|
|
30
|
+
import React, { useEffect, useRef, useState, type ReactNode } from "react";
|
|
31
|
+
import { Icon, type IconName } from "../icons";
|
|
32
|
+
import { copyText } from "./engine";
|
|
33
|
+
|
|
34
|
+
const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
|
|
35
|
+
|
|
36
|
+
// ── The card ───────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
/** What a card's tag says about it: an answer (iris), a change made (green), a job running or waiting (the brand's soft). */
|
|
39
|
+
export type ChatCardTone = "answer" | "change" | "job";
|
|
40
|
+
export interface ChatCardTag { label: ReactNode; tone?: ChatCardTone }
|
|
41
|
+
|
|
42
|
+
export interface ChatCardProps {
|
|
43
|
+
/** What it is: "New section: FAQ", "A new theme for your store". */
|
|
44
|
+
title: ReactNode;
|
|
45
|
+
/** One quiet line under the title: where it lives, its state ("Product page · Draft"). */
|
|
46
|
+
meta?: ReactNode;
|
|
47
|
+
/** A picture on the left: an <img>, a page poster, a button around one. Sized by the surface; the slot only places it. */
|
|
48
|
+
thumb?: ReactNode;
|
|
49
|
+
/** Or a kit icon in a 40px tile (a test, an inbox item). Ignored when `thumb` is given. */
|
|
50
|
+
icon?: IconName;
|
|
51
|
+
/** A small pill over the title: "Building…", "Draft · not live yet", "Changed". */
|
|
52
|
+
tag?: ChatCardTag;
|
|
53
|
+
/** 0–100: a bar under the title, only while there is one to show (a job running). Absent: no bar. */
|
|
54
|
+
pct?: number | null;
|
|
55
|
+
/** The bar's name for a screen reader (default "Progress"). */
|
|
56
|
+
pctLabel?: string;
|
|
57
|
+
/** A line under everything else (a reassurance, an undo outcome). */
|
|
58
|
+
note?: ReactNode;
|
|
59
|
+
/** Its buttons: ChatCardButton, or anything a surface needs there. */
|
|
60
|
+
actions?: ReactNode;
|
|
61
|
+
/** It is still being made: says so to a screen reader (aria-busy) and quietens the card. */
|
|
62
|
+
busy?: boolean;
|
|
63
|
+
className?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** A thing the turn made or is making (the board's job card, change card and result, one shape). */
|
|
67
|
+
export function ChatCard({ title, meta, thumb, icon, tag, pct, pctLabel, note, actions, busy, className }: ChatCardProps) {
|
|
68
|
+
const bar = typeof pct === "number" && Number.isFinite(pct) ? Math.min(100, Math.max(0, pct)) : null;
|
|
69
|
+
return (
|
|
70
|
+
<div className={cx("gb-chat-card", busy && "is-busy", className)} aria-busy={busy || undefined}>
|
|
71
|
+
{thumb ? <div className="gb-chat-card-thumb">{thumb}</div>
|
|
72
|
+
: icon ? <span className="gb-chat-card-icon" aria-hidden="true"><Icon name={icon} /></span> : null}
|
|
73
|
+
<div className="gb-chat-card-body">
|
|
74
|
+
{tag ? <span className="gb-chat-card-tag" data-tone={tag.tone ?? "answer"}>{tag.label}</span> : null}
|
|
75
|
+
<span className="gb-chat-card-title">{title}</span>
|
|
76
|
+
{meta ? <span className="gb-chat-card-meta">{meta}</span> : null}
|
|
77
|
+
{bar !== null ? (
|
|
78
|
+
<span className="gb-chat-card-bar" role="progressbar" aria-label={pctLabel ?? "Progress"} aria-valuemin={0} aria-valuemax={100} aria-valuenow={Math.round(bar)}>
|
|
79
|
+
<span style={{ width: `${bar}%` }} />
|
|
80
|
+
</span>
|
|
81
|
+
) : null}
|
|
82
|
+
{note ? <span className="gb-chat-card-note">{note}</span> : null}
|
|
83
|
+
{actions ? <div className="gb-chat-card-actions">{actions}</div> : null}
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** A card's button: a link-weight action ("Open", "Open editor"); `primary` in the brand's colour with an arrow, the rest muted. */
|
|
90
|
+
export function ChatCardButton({ children, onPress, primary, disabled, label, title }: {
|
|
91
|
+
children: ReactNode; onPress: () => void; primary?: boolean; disabled?: boolean;
|
|
92
|
+
/** An accessible name when the words alone are not enough. */
|
|
93
|
+
label?: string; title?: string;
|
|
94
|
+
}) {
|
|
95
|
+
return (
|
|
96
|
+
<button type="button" className={cx("gb-chat-card-btn", primary && "is-primary")} onClick={onPress} disabled={disabled} aria-label={label} title={title}>
|
|
97
|
+
{children}{primary ? <Icon name="chevronRight" size={16} /> : null}
|
|
98
|
+
</button>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// ── Choices ────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
103
|
+
|
|
104
|
+
/** One choice: its words, or words with a line under them, Gem's pick, a picture (a product's photo). */
|
|
105
|
+
export type ChatChoiceItem = string | { label: string; hint?: ReactNode; recommended?: boolean; picture?: ReactNode };
|
|
106
|
+
|
|
107
|
+
const isRich = (o: ChatChoiceItem) => typeof o !== "string" && Boolean(o.hint || o.recommended || o.picture);
|
|
108
|
+
/** A choice's words. Read through the union, not the caller's `T`: narrowing a generic on `typeof` leaves `T & string`, whose `.label` tsc rejects. */
|
|
109
|
+
const labelOf = (o: ChatChoiceItem): string => (typeof o === "string" ? o : o.label);
|
|
110
|
+
|
|
111
|
+
export interface ChatChoicesProps<T extends ChatChoiceItem> {
|
|
112
|
+
options: readonly T[];
|
|
113
|
+
onChoose: (option: T) => void;
|
|
114
|
+
/** A turn is running: every choice off (pressed now it would land in the middle of it). */
|
|
115
|
+
busy?: boolean;
|
|
116
|
+
/** Which choices are cards (a hint, Gem's pick, a picture): the rest are chips. Any card makes the list a poll, a column where the
|
|
117
|
+
* chips sit among the cards. Default: a choice with a hint, a pick or a picture. */
|
|
118
|
+
rich?: (option: T) => boolean;
|
|
119
|
+
/** A choice's picture, read by the surface (a product's photo by its id). Wins over the choice's own `picture`. */
|
|
120
|
+
pictureOf?: (option: T, index: number) => ReactNode;
|
|
121
|
+
/** A choice's line under its words, read by the surface (a product's price before its hint). Wins over the choice's own `hint`;
|
|
122
|
+
* null/undefined falls back to it, as `pictureOf` does. */
|
|
123
|
+
hintOf?: (option: T, index: number) => ReactNode;
|
|
124
|
+
/** The pill on the recommended choice (default "Gem's pick"). */
|
|
125
|
+
pickLabel?: string;
|
|
126
|
+
/** The poll's last row, the way out when none fits: "Something else · Type it below"; pressing it puts the person in the box. A poll
|
|
127
|
+
* only (a chip row is two words; the box is right under it). Absent: no row. */
|
|
128
|
+
other?: { onPick: () => void; label?: string; hint?: string };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** The answer's choices (the board's 05 and 06). Pressing one is the surface's: it sends it, or does what the choice says. */
|
|
132
|
+
export function ChatChoices<T extends ChatChoiceItem>({ options, onChoose, busy, rich, pictureOf, hintOf, pickLabel = "Gem's pick", other }: ChatChoicesProps<T>) {
|
|
133
|
+
if (!options.length) return null;
|
|
134
|
+
const isCard = rich ?? isRich;
|
|
135
|
+
const poll = options.some(isCard);
|
|
136
|
+
if (!poll) {
|
|
137
|
+
return (
|
|
138
|
+
<div className="gemboss-ec-chips">
|
|
139
|
+
{options.map((o, i) => (
|
|
140
|
+
<button key={i} type="button" className="gemboss-ec-chip" disabled={busy} onClick={() => onChoose(o)}>{labelOf(o)}</button>
|
|
141
|
+
))}
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
return (
|
|
146
|
+
<div className="gemboss-ec-poll">
|
|
147
|
+
{options.map((o, i) => {
|
|
148
|
+
if (!isCard(o)) return <button key={i} type="button" className="gemboss-ec-chip" disabled={busy} onClick={() => onChoose(o)}>{labelOf(o)}</button>;
|
|
149
|
+
const c: ChatChoiceItem = o;
|
|
150
|
+
const picture = pictureOf?.(o, i) ?? (typeof c === "string" ? null : c.picture);
|
|
151
|
+
const hint = hintOf?.(o, i) ?? (typeof c === "string" ? null : c.hint);
|
|
152
|
+
const pick = typeof c !== "string" && c.recommended;
|
|
153
|
+
return (
|
|
154
|
+
<button key={i} type="button" className="gemboss-ec-opt" disabled={busy} onClick={() => onChoose(o)}>
|
|
155
|
+
{picture ? <span className="gemboss-ec-opt-pic" aria-hidden="true">{picture}</span> : null}
|
|
156
|
+
<span className="gemboss-ec-opt-col">
|
|
157
|
+
<span className="gemboss-ec-opt-label">{labelOf(c)}</span>
|
|
158
|
+
{hint ? <span className="gemboss-ec-opt-hint">{hint}</span> : null}
|
|
159
|
+
</span>
|
|
160
|
+
{pick ? <span className="gemboss-ec-opt-rec">{pickLabel}</span> : null}
|
|
161
|
+
</button>
|
|
162
|
+
);
|
|
163
|
+
})}
|
|
164
|
+
{other ? (
|
|
165
|
+
<button type="button" className="gemboss-ec-opt gemboss-ec-opt-other" disabled={busy} onClick={other.onPick}>
|
|
166
|
+
<span className="gemboss-ec-opt-col">
|
|
167
|
+
<span className="gemboss-ec-opt-label">{other.label ?? "Something else"}</span>
|
|
168
|
+
<span className="gemboss-ec-opt-hint">{other.hint ?? "Type it below"}</span>
|
|
169
|
+
</span>
|
|
170
|
+
</button>
|
|
171
|
+
) : null}
|
|
172
|
+
</div>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// ── The question waiting on the person ─────────────────────────────────────────────────────────────────────────────────────
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The last answer's question, over the message box while it waits (the board's 07): a line that says so, what it is about (ChatThing),
|
|
180
|
+
* the question in bold, then the choices the surface puts in it (ChatChoices). Its look is the kit's `.gemboss-ec-decide`
|
|
181
|
+
* (assistant-chat.css, 0.49).
|
|
182
|
+
*/
|
|
183
|
+
export function ChatDecide({ label, thing, question, children }: { label: string; thing?: ReactNode; question?: ReactNode; children?: ReactNode }) {
|
|
184
|
+
return (
|
|
185
|
+
<div className="gemboss-ec-decide" role="group" aria-label={label}>
|
|
186
|
+
<span className="gemboss-ec-decide-label">{label}</span>
|
|
187
|
+
{thing}
|
|
188
|
+
{question ? <b className="gb-chat-question">{question}</b> : null}
|
|
189
|
+
{children}
|
|
190
|
+
</div>
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** What a waiting question is about: its picture, its name, one line (a page's poster and status, a product's photo and price). */
|
|
195
|
+
export function ChatThing({ picture, name, meta }: { picture?: ReactNode; name: ReactNode; meta?: ReactNode }) {
|
|
196
|
+
return (
|
|
197
|
+
<div className="gb-chat-thing">
|
|
198
|
+
{picture ? <span className="gb-chat-thing-pic">{picture}</span> : null}
|
|
199
|
+
<span className="gb-chat-thing-col">
|
|
200
|
+
<b className="gb-chat-thing-name">{name}</b>
|
|
201
|
+
{meta ? <span className="gb-chat-thing-meta">{meta}</span> : null}
|
|
202
|
+
</span>
|
|
203
|
+
</div>
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// ── The words a turn rewrote ───────────────────────────────────────────────────────────────────────────────────────────────
|
|
208
|
+
|
|
209
|
+
export interface ChatTextChange { before: ReactNode; after: ReactNode; /** Where it is on the page ("Hero · heading"). */ where?: ReactNode }
|
|
210
|
+
|
|
211
|
+
/** The lines a turn rewrote (the board's 14): where, the old words struck, the new ones under them. Nothing when there are none. */
|
|
212
|
+
export function ChatTextChanges({ changes, wasLabel = "Was: ", nowLabel = "Now: " }: { changes: readonly ChatTextChange[]; wasLabel?: string; nowLabel?: string }) {
|
|
213
|
+
if (!changes.length) return null;
|
|
214
|
+
return (
|
|
215
|
+
<div className="gemboss-ec-textchanges" data-turn-text-changes="">
|
|
216
|
+
{changes.map((c, k) => (
|
|
217
|
+
<div key={k} className="gemboss-ec-textchange">
|
|
218
|
+
{c.where ? <span className="gemboss-ec-textchange-where">{c.where}</span> : null}
|
|
219
|
+
<del className="gemboss-ec-textchange-was"><span className="ui-sr-only">{wasLabel}</span>{c.before}</del>
|
|
220
|
+
<ins className="gemboss-ec-textchange-now"><span className="ui-sr-only">{nowLabel}</span>{c.after}</ins>
|
|
221
|
+
</div>
|
|
222
|
+
))}
|
|
223
|
+
</div>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// ── A page's sections as bars ──────────────────────────────────────────────────────────────────────────────────────────────
|
|
228
|
+
|
|
229
|
+
export interface ChatPageBand {
|
|
230
|
+
label: ReactNode;
|
|
231
|
+
/** 0–100, or null when it was not measured (drawn "—", no bar). */
|
|
232
|
+
pct: number | null;
|
|
233
|
+
/** How strong the bar is drawn, 0–1 (one hue at a few strengths; default full). */
|
|
234
|
+
strength?: number;
|
|
235
|
+
/** A line of its own under the bar, in the danger colour ("14 frustrated clicks"). */
|
|
236
|
+
alert?: ReactNode;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* A page's sections as bars under an answer about it (the board's 13; the admin's reach card): the page, what the numbers are, one
|
|
241
|
+
* bar per section, what is left out, and one button to the full view. Every word is the surface's.
|
|
242
|
+
*/
|
|
243
|
+
export function ChatPageBands({ page, caption, notes, bands, more, openLabel, onOpen }: {
|
|
244
|
+
page: ReactNode; caption?: ReactNode; notes?: ReactNode[]; bands: readonly ChatPageBand[]; more?: ReactNode;
|
|
245
|
+
openLabel?: string; onOpen?: () => void;
|
|
246
|
+
}) {
|
|
247
|
+
return (
|
|
248
|
+
<div className="gemboss-ec-pagecard">
|
|
249
|
+
<div className="gemboss-ec-pagecard-head">
|
|
250
|
+
<span className="gemboss-ec-pagecard-page">{page}</span>
|
|
251
|
+
{caption ? <span className="gemboss-ec-pagecard-caption">{caption}</span> : null}
|
|
252
|
+
</div>
|
|
253
|
+
{(notes ?? []).filter(Boolean).map((n, i) => <div key={i} className="gemboss-ec-pagecard-note">{n}</div>)}
|
|
254
|
+
<ul className="gemboss-ec-pagecard-bands">
|
|
255
|
+
{bands.map((b, i) => {
|
|
256
|
+
const pct = b.pct === null ? null : Math.round(Math.min(100, Math.max(0, b.pct)));
|
|
257
|
+
return (
|
|
258
|
+
<li key={i} className="gemboss-ec-pagecard-band">
|
|
259
|
+
<span className="gemboss-ec-pagecard-label">{b.label}</span>
|
|
260
|
+
<span className="gemboss-ec-pagecard-value"><span className="gemboss-ec-pagecard-pct">{pct === null ? "—" : `${pct}%`}</span></span>
|
|
261
|
+
<span className="gemboss-ec-pagecard-track" aria-hidden="true">
|
|
262
|
+
{pct !== null ? <span className="gemboss-ec-pagecard-fill" style={{ width: `${Math.max(2, pct)}%`, opacity: b.strength ?? 1 }} /> : null}
|
|
263
|
+
</span>
|
|
264
|
+
{b.alert ? <span className="gemboss-ec-pagecard-stuck">{b.alert}</span> : null}
|
|
265
|
+
</li>
|
|
266
|
+
);
|
|
267
|
+
})}
|
|
268
|
+
</ul>
|
|
269
|
+
{more ? <div className="gemboss-ec-pagecard-more">{more}</div> : null}
|
|
270
|
+
{openLabel && onOpen ? <button type="button" className="gemboss-ec-pagecard-open" onClick={onOpen}>{openLabel}</button> : null}
|
|
271
|
+
</div>
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// ── Buttons that go somewhere else ─────────────────────────────────────────────────────────────────────────────────────────
|
|
276
|
+
|
|
277
|
+
export interface ChatCtaAction {
|
|
278
|
+
label: ReactNode;
|
|
279
|
+
onPress: () => void;
|
|
280
|
+
/** The one to take: filled, with an arrow. The rest are outlined. */
|
|
281
|
+
primary?: boolean;
|
|
282
|
+
disabled?: boolean;
|
|
283
|
+
/** Why it is off, or what it opens. */
|
|
284
|
+
title?: string;
|
|
285
|
+
key?: string;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/** Buttons under an answer that lead to the screen where the work is done (the board's 16). They wrap; each grows with its words. */
|
|
289
|
+
export function ChatCta({ actions, className }: { actions: readonly ChatCtaAction[]; className?: string }) {
|
|
290
|
+
if (!actions.length) return null;
|
|
291
|
+
return (
|
|
292
|
+
<div className={cx("gemboss-ec-cta", className)}>
|
|
293
|
+
{actions.map((a, i) => (
|
|
294
|
+
<button key={a.key ?? i} type="button" className={cx("gemboss-ec-cta-btn", a.primary ? "primary" : "ghost")} disabled={a.disabled} title={a.title} onClick={a.onPress}>
|
|
295
|
+
{a.label}{a.primary ? <Icon name="chevronRight" size={16} className="gemboss-ec-cta-arrow" /> : null}
|
|
296
|
+
</button>
|
|
297
|
+
))}
|
|
298
|
+
</div>
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// ── Under a finished answer ────────────────────────────────────────────────────────────────────────────────────────────────
|
|
303
|
+
|
|
304
|
+
export type ChatRating = "up" | "down";
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Under a finished answer (the board's 22): Helpful, Not helpful, Copy. A rating is given once (both buttons off after, the one given
|
|
308
|
+
* shown pressed); a surface that keeps no ratings leaves `onRate` out and only Copy is drawn. Copy says "Copied" to a screen reader.
|
|
309
|
+
*/
|
|
310
|
+
export function ChatFeedback({ rating, onRate, copyText: text, labels }: {
|
|
311
|
+
rating?: ChatRating | null;
|
|
312
|
+
onRate?: (rating: ChatRating) => void;
|
|
313
|
+
copyText?: string;
|
|
314
|
+
labels?: { up?: string; down?: string; copy?: string; copied?: string };
|
|
315
|
+
}) {
|
|
316
|
+
const [copied, setCopied] = useState(false);
|
|
317
|
+
const timer = useRef<number | undefined>(undefined);
|
|
318
|
+
useEffect(() => () => window.clearTimeout(timer.current), []);
|
|
319
|
+
if (!onRate && !text) return null;
|
|
320
|
+
const L = { up: "Helpful", down: "Not helpful", copy: "Copy", copied: "Copied", ...labels };
|
|
321
|
+
const rate = (r: ChatRating) => (
|
|
322
|
+
<button type="button" className={cx("gemboss-ec-fb-btn", rating === r && "on")} aria-label={r === "up" ? L.up : L.down} title={r === "up" ? L.up : L.down}
|
|
323
|
+
aria-pressed={rating === r} disabled={Boolean(rating)} onClick={() => onRate?.(r)}>
|
|
324
|
+
<Icon name={r === "up" ? "thumbsUp" : "thumbsDown"} size={16} />
|
|
325
|
+
</button>
|
|
326
|
+
);
|
|
327
|
+
return (
|
|
328
|
+
<div className="gemboss-ec-fb">
|
|
329
|
+
{onRate ? <>{rate("up")}{rate("down")}</> : null}
|
|
330
|
+
{text ? (
|
|
331
|
+
<button type="button" className={cx("gemboss-ec-fb-btn", copied && "on")} aria-label={L.copy} title={L.copy} onClick={async () => {
|
|
332
|
+
if (!(await copyText(text))) return;
|
|
333
|
+
setCopied(true);
|
|
334
|
+
window.clearTimeout(timer.current);
|
|
335
|
+
timer.current = window.setTimeout(() => setCopied(false), 1500);
|
|
336
|
+
}}>
|
|
337
|
+
<Icon name={copied ? "check" : "copy"} size={16} />
|
|
338
|
+
</button>
|
|
339
|
+
) : null}
|
|
340
|
+
{text ? <span className="ui-sr-only" role="status">{copied ? L.copied : ""}</span> : null}
|
|
341
|
+
</div>
|
|
342
|
+
);
|
|
343
|
+
}
|
package/src/assistant/chat.tsx
CHANGED
|
@@ -24,17 +24,21 @@
|
|
|
24
24
|
import "../chat.css";
|
|
25
25
|
import "../chat-composer.css";
|
|
26
26
|
import "../chat-voice.css"; // the composer's microphone (`voice`), its own entry: the bundle chat-composer.css sits in is frozen
|
|
27
|
+
import "../chat-composer-menus.css"; // "+" and ✦ and the line over the box they speak on (0.70.0), its own entry for the same reason
|
|
27
28
|
import "../assistant-chat.css";
|
|
28
29
|
import "../assistant-engine.css"; // BridgeNotice and the engine chip's density rules (engine.tsx brings it too)
|
|
29
30
|
import React, {
|
|
30
|
-
createContext, Fragment, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState,
|
|
31
|
+
createContext, Fragment, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState,
|
|
31
32
|
type ClipboardEventHandler, type KeyboardEventHandler, type ReactNode, type Ref, type RefObject,
|
|
32
33
|
} from "react";
|
|
33
34
|
import { BridgeNotice, copyText } from "./engine";
|
|
35
|
+
import { ComposerAiMenu, useComposerAdd, type ChatComposerAdd, type ChatComposerAi } from "./composer-menus";
|
|
34
36
|
import { DICTATION_NOTE, useDictation } from "./dictation";
|
|
35
37
|
import { EngineMark } from "./engine-mark";
|
|
36
38
|
import { isEngineMarkId } from "./engine-mark-art";
|
|
37
39
|
import { CODE_FOLD_LINES, linkTarget, parseBlocks, parseInline, type Block, type ImageHost } from "./chat-markdown";
|
|
40
|
+
import { GemHolo } from "../gem-holo";
|
|
41
|
+
import { Icon, type IconName } from "../icons";
|
|
38
42
|
|
|
39
43
|
const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
|
|
40
44
|
const useBeforePaint = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
@@ -332,6 +336,26 @@ const THINK_CLASS = { running: "gemboss-narr-row thinking running", ok: "gemboss
|
|
|
332
336
|
const TRACE_CLASS = { running: "gemboss-narr-row trace running", ok: "gemboss-narr-row trace ok", failed: "gemboss-narr-row trace failed" } as const;
|
|
333
337
|
const STEER_CLASS = { running: "gemboss-narr-row steer running", ok: "gemboss-narr-row steer ok", failed: "gemboss-narr-row steer failed" } as const;
|
|
334
338
|
|
|
339
|
+
/**
|
|
340
|
+
* THE MARK AT THE START OF A ROW (11/11/2026, Chris: "đổi icon các thứ cho đồng bộ"; canvas board ChatKit): from the GemBoss
|
|
341
|
+
* set, not ✓ ✕ · ✳ ❯ ⏺ typed as text in a font that drew each at its own size and weight. Done `check`, failed `close`, running
|
|
342
|
+
* or a call `dot` (static: the heartbeat under the turn is the only thing that moves), a thought `sparkle`, the user's own line
|
|
343
|
+
* typed into a running turn `chevronRight`, a plan's step `square` / `squareCheck`. The admin's NarrationTimeline draws its
|
|
344
|
+
* rows with this too, so every chat in the fleet marks a step the same way.
|
|
345
|
+
*/
|
|
346
|
+
export type ChatStepMarkKind = "step" | "thinking" | "trace" | "steer" | "plan";
|
|
347
|
+
export function chatStepMarkIcon(kind: ChatStepMarkKind, state: "running" | "ok" | "failed" | "paused" | "open" | "done"): IconName {
|
|
348
|
+
if (kind === "thinking") return "sparkle";
|
|
349
|
+
if (kind === "steer") return "chevronRight";
|
|
350
|
+
if (kind === "plan") return state === "done" || state === "ok" ? "squareCheck" : "square";
|
|
351
|
+
if (state === "failed") return "close";
|
|
352
|
+
if (state === "ok" || state === "done") return kind === "trace" ? "dot" : "check";
|
|
353
|
+
return "dot";
|
|
354
|
+
}
|
|
355
|
+
export function ChatStepMark({ kind = "step", state = "ok", className }: { kind?: ChatStepMarkKind; state?: "running" | "ok" | "failed" | "paused" | "open" | "done"; className?: string }) {
|
|
356
|
+
return <span className={cx("gemboss-narr-dot", className)} aria-hidden="true"><Icon name={chatStepMarkIcon(kind, state)} size={12} /></span>;
|
|
357
|
+
}
|
|
358
|
+
|
|
335
359
|
/** What the assistant did on the way to its answer, one row per step. */
|
|
336
360
|
export function ChatSteps({ steps, label }: { steps: readonly ChatStep[]; label?: string }) {
|
|
337
361
|
const L = useLabels();
|
|
@@ -343,7 +367,7 @@ export function ChatSteps({ steps, label }: { steps: readonly ChatStep[]; label?
|
|
|
343
367
|
if (s.kind === "thinking") {
|
|
344
368
|
return (
|
|
345
369
|
<li key={s.id} className={THINK_CLASS[state]}>
|
|
346
|
-
<
|
|
370
|
+
<ChatStepMark kind="thinking" state={state} />
|
|
347
371
|
{state === "running" || !s.detail ? (
|
|
348
372
|
<span className="gemboss-narr-text gemboss-narr-thinking-live">{s.label || L.thinking}</span>
|
|
349
373
|
) : (
|
|
@@ -358,7 +382,7 @@ export function ChatSteps({ steps, label }: { steps: readonly ChatStep[]; label?
|
|
|
358
382
|
if (s.kind === "steer") {
|
|
359
383
|
return (
|
|
360
384
|
<li key={s.id} className={STEER_CLASS[state]}>
|
|
361
|
-
<
|
|
385
|
+
<ChatStepMark kind="steer" state={state} />
|
|
362
386
|
<span className="gemboss-narr-text gemboss-narr-steer">{s.label}</span>
|
|
363
387
|
</li>
|
|
364
388
|
);
|
|
@@ -366,7 +390,7 @@ export function ChatSteps({ steps, label }: { steps: readonly ChatStep[]; label?
|
|
|
366
390
|
if (s.kind === "trace") {
|
|
367
391
|
return (
|
|
368
392
|
<li key={s.id} className={TRACE_CLASS[state]} title={s.error || undefined}>
|
|
369
|
-
<
|
|
393
|
+
<ChatStepMark kind="trace" state={state} />
|
|
370
394
|
{s.detail ? (
|
|
371
395
|
<details className="gemboss-narr-trace">
|
|
372
396
|
<summary><code>{s.label}</code></summary>
|
|
@@ -380,7 +404,7 @@ export function ChatSteps({ steps, label }: { steps: readonly ChatStep[]; label?
|
|
|
380
404
|
<li key={s.id} className={STEP_CLASS[state]} title={s.error || undefined}>
|
|
381
405
|
{s.engine && isEngineMarkId(s.engine)
|
|
382
406
|
? <span className="gemboss-narr-dot gemboss-narr-dot-engine"><EngineMark engine={s.engine} /></span>
|
|
383
|
-
: <
|
|
407
|
+
: <ChatStepMark state={state} />}
|
|
384
408
|
<span className="gemboss-narr-text">{s.label}{s.target ? <span className="gb-chat-target"> {s.target}</span> : null}</span>
|
|
385
409
|
</li>
|
|
386
410
|
);
|
|
@@ -392,7 +416,8 @@ export function ChatSteps({ steps, label }: { steps: readonly ChatStep[]; label?
|
|
|
392
416
|
// ── Working, the heartbeat ─────────────────────────────────────────────────────────────────────────────────────────────
|
|
393
417
|
|
|
394
418
|
/**
|
|
395
|
-
* The one thing that moves while a turn runs and nothing is written yet:
|
|
419
|
+
* The one thing that moves while a turn runs and nothing is written yet: Gem's hologram on the star's old beat (the admin's
|
|
420
|
+
* since 25/10, every surface's since 11/11/2026; it was a pulsing ✳), a verb that changes every 2s, the
|
|
396
421
|
* seconds (and tokens, when known). For a screen reader it says its label ONCE (role="status"): the clock and the verbs
|
|
397
422
|
* are hidden from it, or it would announce every second.
|
|
398
423
|
*/
|
|
@@ -414,7 +439,7 @@ export function ChatPending({ verbs, tokens, compact, label }: { verbs?: readonl
|
|
|
414
439
|
return (
|
|
415
440
|
<div className="gemboss-ec-pending" role="status">
|
|
416
441
|
<span className="gemboss-assistant-sronly">{label ?? list[0]}</span>
|
|
417
|
-
<
|
|
442
|
+
<GemHolo size={14} busy className="gemboss-ec-pending-star" />
|
|
418
443
|
{!compact ? <span className="gemboss-ec-pending-verb" key={idx} aria-hidden="true">{list[idx % list.length]}…</span> : null}
|
|
419
444
|
<span className="gemboss-ec-pending-meta" aria-hidden="true">{tokens && tokens > 0 ? `${tokens} token${tokens === 1 ? "" : "s"} · ` : ""}{elapsed}s</span>
|
|
420
445
|
</div>
|
|
@@ -612,12 +637,38 @@ export interface ChatComposerProps {
|
|
|
612
637
|
placeholder?: string;
|
|
613
638
|
/** The text box's accessible name (default "Message"). */
|
|
614
639
|
label?: string;
|
|
615
|
-
/**
|
|
640
|
+
/**
|
|
641
|
+
* "+" (0.70.0, canvas board ChatComposer): what can go with the message, at the start of the toolbar. Each row is drawn only
|
|
642
|
+
* when it has something to do (./composer-menus.tsx). It replaces the paperclip a host drew in `tools`.
|
|
643
|
+
*/
|
|
644
|
+
add?: ChatComposerAdd | null;
|
|
645
|
+
/**
|
|
646
|
+
* ✦ (0.70.0): which AI answers (the engine choice, published to Settings › AI & engines as the chip did) and how far it goes
|
|
647
|
+
* (the work modes), then "All AI settings…". It replaces the engine chip and the work-mode select a host put in `leading`.
|
|
648
|
+
*/
|
|
649
|
+
ai?: ChatComposerAi | null;
|
|
650
|
+
/** The chip strip, after "+" and ✦. Chips only (density reads it as chips). Since 0.70.0 no admin chat puts one here. */
|
|
616
651
|
leading?: ReactNode;
|
|
617
|
-
/** Tools that are not chips
|
|
652
|
+
/** Tools that are not chips, before the microphone. The paperclip lives in `add` since 0.70.0. */
|
|
618
653
|
tools?: ReactNode;
|
|
619
654
|
/** Full-width rows above the text box (a pending attachment). */
|
|
620
655
|
top?: ReactNode;
|
|
656
|
+
/** Full-width rows under the text box, above the toolbar (what each link or file was taken for). 0.70.0. */
|
|
657
|
+
under?: ReactNode;
|
|
658
|
+
/**
|
|
659
|
+
* A microphone the HOST drives (0.70.0): its own listening (the Composer's "said" line) or a press that opens another box
|
|
660
|
+
* listening (Home's line). Drawn as `voice`'s button, in its place; ignored when `voice` is given.
|
|
661
|
+
*/
|
|
662
|
+
mic?: { pressed?: boolean; onPress: () => void; label?: string; title?: string; disabled?: boolean } | null;
|
|
663
|
+
/** The send button's name, when it does more than send ("Read it", "Draft the funnel"). 0.70.0. */
|
|
664
|
+
sendLabel?: string;
|
|
665
|
+
/** Why send is off (its tooltip and description), or what it will do. 0.70.0. */
|
|
666
|
+
sendTitle?: string;
|
|
667
|
+
/** Focus the text box when it mounts (a dialog that opens to type). 0.70.0. */
|
|
668
|
+
autoFocus?: boolean;
|
|
669
|
+
/** False: Enter is a new line and ⌘/Ctrl+Enter sends (a box that starts a job or leaves the page, where a half-written line must
|
|
670
|
+
* not go: the Composer dialog, Tell Gem about your store). Default true: Enter sends, as in every chat. 0.70.0. */
|
|
671
|
+
enterSends?: boolean;
|
|
621
672
|
/**
|
|
622
673
|
* SPEAK INSTEAD OF TYPING (B15-voice, 08/11/2026): the browser's own speech to text, into this box (./dictation.ts). A mic
|
|
623
674
|
* after the tools, what is said written into the box as it is said and editable, a line over the box while it listens (and the
|
|
@@ -713,6 +764,21 @@ export function ChatComposer(p: ChatComposerProps) {
|
|
|
713
764
|
// What is sent is what the box shows: a session still listening stops first, so nothing lands after the message left.
|
|
714
765
|
const send = () => { if (canSend) { cancelVoice(); p.onSend(p.value); } };
|
|
715
766
|
const showStop = Boolean(p.busy && p.onStop);
|
|
767
|
+
// A sentence from the "+" menu for the line over the box (the clipboard had no picture). It goes when the seller types.
|
|
768
|
+
const [addNote, setAddNote] = useState<string | null>(null);
|
|
769
|
+
const sendWhyId = useId();
|
|
770
|
+
// The host's own microphone, drawn as the composer's (`mic`); with `voice` given it is ignored, whether the browser can listen
|
|
771
|
+
// or not (a host that asked for the composer's own mic did not ask for its own where that one is missing).
|
|
772
|
+
const hostMic = !p.voice && p.mic ? p.mic : null;
|
|
773
|
+
// What a ✦ switch was refused with ("Wait for the current answer to finish"): the list closed on the click, so it is said here,
|
|
774
|
+
// until the seller types (then it is old news; opening ✦ again clears it at the surface).
|
|
775
|
+
const [problemRead, setProblemRead] = useState<ReactNode>(null);
|
|
776
|
+
const aiProblem = p.ai?.engine?.problem && p.ai.engine.problem !== problemRead ? p.ai.engine.problem : null;
|
|
777
|
+
// The surface cleared it (✦ opened again): the next refusal is news again, even with the same words.
|
|
778
|
+
const surfaceProblem = p.ai?.engine?.problem ?? null;
|
|
779
|
+
useEffect(() => { if (!surfaceProblem) setProblemRead(null); }, [surfaceProblem]);
|
|
780
|
+
const addParts = useComposerAdd(p.add, p.disabled, setAddNote);
|
|
781
|
+
const hasLead = Boolean(p.add || p.ai || p.leading);
|
|
716
782
|
|
|
717
783
|
return (
|
|
718
784
|
<DensityContext.Provider value={density}>
|
|
@@ -727,29 +793,54 @@ export function ChatComposer(p: ChatComposerProps) {
|
|
|
727
793
|
) : voice.problem ? <span className="gemboss-ec-voice-problem">{voice.problem}</span> : null}
|
|
728
794
|
</p>
|
|
729
795
|
) : null}
|
|
796
|
+
{p.add || p.ai ? (
|
|
797
|
+
<p className="gemboss-ec-addnote" role="status">
|
|
798
|
+
{addNote ?? (aiProblem ? <span className="gemboss-ec-addnote-problem">{aiProblem}</span> : "")}
|
|
799
|
+
</p>
|
|
800
|
+
) : null}
|
|
730
801
|
<textarea
|
|
731
802
|
ref={ref as Ref<HTMLTextAreaElement>}
|
|
732
803
|
value={p.value}
|
|
733
804
|
rows={p.rows ?? 1}
|
|
734
805
|
maxLength={p.maxLength}
|
|
735
806
|
disabled={p.disabled}
|
|
807
|
+
autoFocus={p.autoFocus}
|
|
736
808
|
aria-label={p.label ?? L.message}
|
|
737
809
|
placeholder={p.placeholder}
|
|
738
810
|
// The seller typing while it listens stops it at once (their edit is the box; nothing more lands in it).
|
|
739
|
-
onChange={(e) => { cancelVoice(); p.onChange(e.target.value); }}
|
|
811
|
+
onChange={(e) => { cancelVoice(); if (addNote) setAddNote(null); if (aiProblem) setProblemRead(aiProblem); p.onChange(e.target.value); }}
|
|
740
812
|
onPaste={p.onPaste}
|
|
741
813
|
onKeyDown={(e) => {
|
|
742
814
|
p.onKeyDown?.(e);
|
|
743
815
|
if (e.defaultPrevented) return;
|
|
744
816
|
// Not mid-composition: Enter there picks the IME's candidate (Vietnamese Telex, Chinese pinyin), it does not send.
|
|
745
|
-
if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && e.keyCode !== 229
|
|
817
|
+
if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && e.keyCode !== 229 && (p.enterSends !== false || e.metaKey || e.ctrlKey)) {
|
|
818
|
+
e.preventDefault(); send();
|
|
819
|
+
}
|
|
746
820
|
}}
|
|
747
821
|
/>
|
|
822
|
+
{p.under}
|
|
823
|
+
{addParts.inputs}
|
|
748
824
|
<div className="gemboss-ec-toolbar">
|
|
749
|
-
<div className="gemboss-ec-toolbar-lead">
|
|
750
|
-
|
|
825
|
+
<div className="gemboss-ec-toolbar-lead">
|
|
826
|
+
{hasLead ? (
|
|
827
|
+
<>
|
|
828
|
+
{addParts.menu}
|
|
829
|
+
{p.ai ? <ComposerAiMenu ai={p.ai} disabled={p.disabled} /> : null}
|
|
830
|
+
{p.leading}
|
|
831
|
+
</>
|
|
832
|
+
) : null}
|
|
833
|
+
</div>
|
|
834
|
+
{p.tools || voice.supported || hostMic ? (
|
|
751
835
|
<div className="gemboss-ec-toolbar-tools">
|
|
752
836
|
{p.tools}
|
|
837
|
+
{hostMic ? (
|
|
838
|
+
<button type="button" className="gemboss-ec-mic" aria-pressed={hostMic.pressed ?? false} aria-label={hostMic.label ?? L.speak}
|
|
839
|
+
title={hostMic.title ?? (hostMic.pressed ? L.stopListening : `${hostMic.label ?? L.speak}. ${DICTATION_NOTE}`)}
|
|
840
|
+
disabled={p.disabled || hostMic.disabled || undefined} onClick={hostMic.onPress}>
|
|
841
|
+
<MicIcon />
|
|
842
|
+
</button>
|
|
843
|
+
) : null}
|
|
753
844
|
{voice.supported ? (
|
|
754
845
|
// One label, its state in aria-pressed (a toggle that also renamed itself would be read as two buttons). The note
|
|
755
846
|
// rides in the tooltip, and on the line above the box each time it listens.
|
|
@@ -769,10 +860,12 @@ export function ChatComposer(p: ChatComposerProps) {
|
|
|
769
860
|
<svg viewBox="0 0 12 12" aria-hidden="true" focusable="false"><rect x="1" y="1" width="10" height="10" rx="2" /></svg>
|
|
770
861
|
</button>
|
|
771
862
|
) : (
|
|
772
|
-
<button key="send" type="submit" disabled={!canSend} aria-label={L.send} title={
|
|
863
|
+
<button key="send" type="submit" disabled={!canSend} aria-label={p.sendLabel ?? L.send} title={p.sendTitle ?? p.sendLabel ?? L.send}
|
|
864
|
+
aria-describedby={p.sendTitle ? sendWhyId : undefined} onClick={(e) => { e.preventDefault(); send(); }}>
|
|
773
865
|
<SendIcon />
|
|
774
866
|
</button>
|
|
775
867
|
)}
|
|
868
|
+
{p.sendTitle && !showStop ? <span id={sendWhyId} className="ui-sr-only">{p.sendTitle}</span> : null}
|
|
776
869
|
</div>
|
|
777
870
|
</div>
|
|
778
871
|
</DensityContext.Provider>
|
|
@@ -846,8 +939,12 @@ export interface AssistantChatProps extends Omit<ChatMarkdownProps, "text"> {
|
|
|
846
939
|
/** More starter groups under the first ("Or ask about partners in the radar:"). */
|
|
847
940
|
moreStarters?: readonly ChatStarter[];
|
|
848
941
|
moreStartersTitle?: ReactNode;
|
|
849
|
-
/** The engine picker element (and any other chip) for the composer's chip strip. */
|
|
942
|
+
/** The engine picker element (and any other chip) for the composer's chip strip. Prefer `ai` (0.70.0): the ✦ menu. */
|
|
850
943
|
engine?: ReactNode;
|
|
944
|
+
/** The composer's "+" menu (ChatComposer `add`). */
|
|
945
|
+
add?: ChatComposerProps["add"];
|
|
946
|
+
/** The composer's ✦ menu (ChatComposer `ai`). */
|
|
947
|
+
ai?: ChatComposerProps["ai"];
|
|
851
948
|
/** Tools beside the chips (`ChatAttach`). */
|
|
852
949
|
tools?: ReactNode;
|
|
853
950
|
/** The composer's microphone (ChatComposer `voice`). */
|
|
@@ -967,7 +1064,7 @@ export function AssistantChat(p: AssistantChatProps) {
|
|
|
967
1064
|
value={draft} onChange={setDraft} onSend={send}
|
|
968
1065
|
busy={p.busy} onStop={p.onStop} sendWhileBusy={p.sendWhileBusy}
|
|
969
1066
|
placeholder={p.placeholder} label={p.inputLabel} maxLength={p.maxLength}
|
|
970
|
-
leading={p.engine} tools={p.tools} voice={p.voice} top={p.composerTop} status={p.composerStatus}
|
|
1067
|
+
add={p.add} ai={p.ai} leading={p.engine} tools={p.tools} voice={p.voice} top={p.composerTop} status={p.composerStatus}
|
|
971
1068
|
textareaRef={inputRef} onKeyDown={p.onComposerKeyDown} onPaste={p.onComposerPaste}
|
|
972
1069
|
/>
|
|
973
1070
|
</div>
|