@vinaverse/react-native 0.1.0-alpha.4 → 0.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -0
- package/dist/index.cjs +854 -129
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +337 -90
- package/dist/index.d.ts +337 -90
- package/dist/index.js +808 -132
- package/dist/index.js.map +1 -1
- package/package.json +68 -8
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { GreetingStorage } from '@vinaverse/react/agent';
|
|
2
|
+
export { AgentRuntimeProvider, GreetingStorage, UseAgentConversation, UseAgentLauncher, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus } from '@vinaverse/react/agent';
|
|
1
3
|
import * as react from 'react';
|
|
2
4
|
import { ComponentType, ReactElement, ReactNode, RefObject } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
+
import * as _vinaverse_client_conversation from '@vinaverse/client/conversation';
|
|
6
|
+
import { MessageItem, Welcome as Welcome$1, TimelineItem, CardItem, HeldCard, Question, ProposalOutcome, ConversationStore, SystemItem } from '@vinaverse/client/conversation';
|
|
7
|
+
import { ReadCard, AgentCardTarget, AgentKey, AgentPlace, AgentFailureReason, AgentRating } from '@vinaverse/client/agent';
|
|
5
8
|
import { ImageProps, StyleProp, ViewStyle } from 'react-native';
|
|
6
|
-
import {
|
|
9
|
+
import { CopyOverrides } from '@vinaverse/react';
|
|
10
|
+
import { Colors, radius, space, ColorScheme, font, motion, size } from '@vinaverse/tokens';
|
|
7
11
|
|
|
8
12
|
interface HeaderProps {
|
|
9
13
|
readonly name: string;
|
|
@@ -90,9 +94,13 @@ declare function CardFrame(props: {
|
|
|
90
94
|
}): react.JSX.Element;
|
|
91
95
|
/** A rating in millionths as the locale writes it, one decimal: 4.8, or 4,8 in Spanish and Portuguese. */
|
|
92
96
|
declare function ratingText(valuePpm: number, locale: string | undefined): string;
|
|
97
|
+
/** A photo the image policy allows: https, and from one of its hosts when it names them. */
|
|
98
|
+
declare function allowedImage(url: string | undefined, hosts: readonly string[] | undefined): string | null;
|
|
93
99
|
|
|
94
100
|
interface CardProps {
|
|
95
101
|
readonly card: HeldCard;
|
|
102
|
+
/** The card read once for drawing, every field checked (`readCard`): kind, target, photo, rating, price, group, links. */
|
|
103
|
+
readonly read: ReadCard | null;
|
|
96
104
|
/** A proposal being decided: draw its buttons busy. */
|
|
97
105
|
readonly busy: boolean;
|
|
98
106
|
/** Restored after a restart: draw it as it was, taking no answer or action. */
|
|
@@ -131,91 +139,6 @@ declare function TimeSlotsCard(props: Omit<CardProps, 'Default'>): react.JSX.Ele
|
|
|
131
139
|
|
|
132
140
|
declare const ActivityLine: react.NamedExoticComponent<object>;
|
|
133
141
|
|
|
134
|
-
declare const Avatar: react.NamedExoticComponent<{
|
|
135
|
-
readonly name: string;
|
|
136
|
-
readonly uri: string | null;
|
|
137
|
-
readonly person?: boolean;
|
|
138
|
-
}>;
|
|
139
|
-
|
|
140
|
-
interface ButtonProps {
|
|
141
|
-
readonly label: string;
|
|
142
|
-
readonly onPress: () => void;
|
|
143
|
-
readonly variant?: 'primary' | 'secondary' | 'text';
|
|
144
|
-
readonly disabled?: boolean;
|
|
145
|
-
readonly busy?: boolean;
|
|
146
|
-
/** A role other than a button: `radio` and `checkbox` for choices. */
|
|
147
|
-
readonly role?: 'button' | 'radio' | 'checkbox' | 'link';
|
|
148
|
-
readonly selected?: boolean;
|
|
149
|
-
readonly hint?: string;
|
|
150
|
-
readonly children?: ReactNode;
|
|
151
|
-
readonly testID?: string;
|
|
152
|
-
}
|
|
153
|
-
declare const Button: react.NamedExoticComponent<ButtonProps>;
|
|
154
|
-
|
|
155
|
-
declare function DefaultHeader(props: Omit<HeaderProps, 'Default'>): react.JSX.Element;
|
|
156
|
-
declare const ChatHeader: react.NamedExoticComponent<object>;
|
|
157
|
-
|
|
158
|
-
declare const ChatSkeleton: react.NamedExoticComponent<object>;
|
|
159
|
-
|
|
160
|
-
declare function DefaultComposer(props: Omit<ComposerProps, 'Default'>): react.JSX.Element;
|
|
161
|
-
declare const Composer: react.NamedExoticComponent<{
|
|
162
|
-
readonly onError?: (error: unknown) => void;
|
|
163
|
-
}>;
|
|
164
|
-
|
|
165
|
-
declare const DisclosureBar: react.NamedExoticComponent<object>;
|
|
166
|
-
|
|
167
|
-
/** The tenant's failure action as a button, or nothing when there is none. */
|
|
168
|
-
declare function FailureActionButton(props: {
|
|
169
|
-
readonly state: FailureState;
|
|
170
|
-
}): ReactNode;
|
|
171
|
-
|
|
172
|
-
declare function DefaultBubble(props: Omit<MessageBubbleProps, 'Default'>): react.JSX.Element;
|
|
173
|
-
declare const MessageBubble: react.NamedExoticComponent<{
|
|
174
|
-
readonly item: MessageItem;
|
|
175
|
-
/** The first of a run from the same author: its label is shown. */
|
|
176
|
-
readonly showAuthor: boolean;
|
|
177
|
-
}>;
|
|
178
|
-
/** The reply streaming now: the only cell that re-renders as the text arrives. */
|
|
179
|
-
declare const StreamingBubble: react.NamedExoticComponent<{
|
|
180
|
-
readonly item: MessageItem;
|
|
181
|
-
readonly showAuthor: boolean;
|
|
182
|
-
}>;
|
|
183
|
-
|
|
184
|
-
/** Rows of one kind recycle together. */
|
|
185
|
-
declare function itemType(item: TimelineItem): string;
|
|
186
|
-
/**
|
|
187
|
-
* Runs of two or more consecutive cards with one carousel group (`group.layout: carousel`, the same `group.id`): by
|
|
188
|
-
* the first card's key, and the keys of the cards the run draws after it. A run equal to the previous one is the
|
|
189
|
-
* same array, so its row does not render again.
|
|
190
|
-
*/
|
|
191
|
-
declare function carousels(items: readonly TimelineItem[], previous: ReadonlyMap<string, readonly CardItem[]>): {
|
|
192
|
-
runs: Map<string, readonly CardItem[]>;
|
|
193
|
-
inside: Set<string>;
|
|
194
|
-
};
|
|
195
|
-
declare const Row: react.NamedExoticComponent<{
|
|
196
|
-
readonly item: TimelineItem;
|
|
197
|
-
readonly showAuthor: boolean;
|
|
198
|
-
/** The carousel this card starts (`components.CardGroup`). */
|
|
199
|
-
readonly run?: readonly CardItem[] | undefined;
|
|
200
|
-
/** A card a carousel earlier in the list draws. */
|
|
201
|
-
readonly inside?: boolean;
|
|
202
|
-
}>;
|
|
203
|
-
declare const MessageList: react.NamedExoticComponent<object>;
|
|
204
|
-
|
|
205
|
-
declare const StatusBanner: react.NamedExoticComponent<object>;
|
|
206
|
-
/** The kit's own "Couldn't connect." banner: try again, and the tenant's failure action when there is one. */
|
|
207
|
-
declare function DefaultUnavailable(props: {
|
|
208
|
-
readonly state: FailureState;
|
|
209
|
-
}): ReactNode;
|
|
210
|
-
|
|
211
|
-
declare const SystemRow: react.NamedExoticComponent<{
|
|
212
|
-
readonly item: SystemItem;
|
|
213
|
-
}>;
|
|
214
|
-
/** The kit's own failed-turn row: "Something went wrong.", and the tenant's failure action when there is one. */
|
|
215
|
-
declare function DefaultTurnFailed(props: {
|
|
216
|
-
readonly state: FailureState;
|
|
217
|
-
}): ReactNode;
|
|
218
|
-
|
|
219
142
|
type ProposalDecision = 'confirm' | 'decline';
|
|
220
143
|
/** What the kit asks of the tenant's app. Only `onProposal` and `onOpenLink` are needed for the cards that use them. */
|
|
221
144
|
interface ChatHandlers {
|
|
@@ -242,6 +165,28 @@ interface ChatHandlers {
|
|
|
242
165
|
readonly failureAction?: FailureAction;
|
|
243
166
|
/** Development warnings: a theme that is hard to read, copy that says "assistant". */
|
|
244
167
|
readonly onWarning?: (message: string) => void;
|
|
168
|
+
/**
|
|
169
|
+
* The person tapped a card about something of yours (its `ref`: a professional, a space, a booking): open its page
|
|
170
|
+
* with your router. Without it, only the card's own actions open anything.
|
|
171
|
+
*/
|
|
172
|
+
readonly onOpenTarget?: (target: AgentCardTarget, card: HeldCard) => void;
|
|
173
|
+
/** Card photos arrive: fetch them ahead with your image library (`Image.prefetch`), so the cards draw at once. */
|
|
174
|
+
readonly prefetchImage?: (url: string) => void;
|
|
175
|
+
/** Reads a line to a screen reader (a finished reply, the launcher's greeting). Default: the platform's. */
|
|
176
|
+
readonly announce?: (text: string) => void;
|
|
177
|
+
/** A chip was tapped (a welcome chip, a starter, the suggestion); its message is sent as the person's own. */
|
|
178
|
+
readonly onChip?: (chip: Chip) => void;
|
|
179
|
+
}
|
|
180
|
+
/** Which card photos are drawn, in what frame, and what stands in for one that is not. */
|
|
181
|
+
interface ImagePolicy {
|
|
182
|
+
/** Hosts a photo may come from (exact names); default any https host. */
|
|
183
|
+
readonly hosts?: readonly string[];
|
|
184
|
+
/** Width / height of a listing's photo frame. Default 1.6 (16:10). */
|
|
185
|
+
readonly aspectRatio?: number;
|
|
186
|
+
/** What stands in for a missing, refused or failed photo. Default the name's monogram. */
|
|
187
|
+
readonly Placeholder?: ComponentType<{
|
|
188
|
+
readonly title: string;
|
|
189
|
+
}>;
|
|
245
190
|
}
|
|
246
191
|
/** Parts a tenant can replace. Each gets the default's props and the default itself (`Default`), to wrap it. */
|
|
247
192
|
interface ChatSlots {
|
|
@@ -274,7 +219,12 @@ interface ChatContextValue {
|
|
|
274
219
|
readonly failureAction: {
|
|
275
220
|
readonly label: string | undefined;
|
|
276
221
|
} | null;
|
|
222
|
+
/** Chips for an empty conversation when the session brings no welcome. */
|
|
223
|
+
readonly starters: readonly Chip[] | undefined;
|
|
224
|
+
readonly imagePolicy: ImagePolicy | undefined;
|
|
277
225
|
}
|
|
226
|
+
/** A tap target that sends `message` as the person's own text (a welcome chip, a starter, a suggestion). */
|
|
227
|
+
type Chip = Welcome$1['chips'][number];
|
|
278
228
|
/** The conversation, handlers and slots; only inside `VinaverseChat` (or `VinaverseChatProvider`). */
|
|
279
229
|
declare function useChat(): ChatContextValue;
|
|
280
230
|
|
|
@@ -334,13 +284,310 @@ interface VinaverseChatProps extends ChatHandlers {
|
|
|
334
284
|
*/
|
|
335
285
|
readonly keyboardBehavior?: 'padding' | 'height' | 'position' | 'none';
|
|
336
286
|
readonly style?: StyleProp<ViewStyle>;
|
|
287
|
+
/** Chips for an empty conversation when the session brings no welcome (`Session.welcome` comes first). Keep stable. */
|
|
288
|
+
readonly starters?: readonly Chip[];
|
|
289
|
+
/** Which card photos are drawn, their frame, and what stands in for one that is not. Keep stable. */
|
|
290
|
+
readonly imagePolicy?: ImagePolicy;
|
|
291
|
+
/** One chip above the composer: a question about where the person now is (`AgentChat` offers it when they moved). */
|
|
292
|
+
readonly suggestion?: Chip | null;
|
|
293
|
+
/** Drawn under the composer, inside the kit's providers (`AgentChat`'s thumbs and footer). */
|
|
294
|
+
readonly footer?: ReactNode;
|
|
337
295
|
}
|
|
338
296
|
/** The providers alone, for a tenant composing its own layout from the exported parts. */
|
|
339
|
-
declare function VinaverseChatProvider(props: Omit<VinaverseChatProps, 'hideHeader' | 'keyboardVerticalOffset' | 'keyboardBehavior' | 'style'> & {
|
|
297
|
+
declare function VinaverseChatProvider(props: Omit<VinaverseChatProps, 'hideHeader' | 'keyboardVerticalOffset' | 'keyboardBehavior' | 'style' | 'suggestion' | 'footer'> & {
|
|
340
298
|
readonly children?: ReactNode;
|
|
341
299
|
}): ReactNode;
|
|
342
300
|
declare function VinaverseChat(props: VinaverseChatProps): ReactNode;
|
|
343
301
|
|
|
302
|
+
interface AgentEndedProps {
|
|
303
|
+
readonly onStartNew: () => void;
|
|
304
|
+
/** The API's code (`conversation_not_found`, `conversation_expired`), when it gave one. */
|
|
305
|
+
readonly code: string | null;
|
|
306
|
+
}
|
|
307
|
+
/** No agent here: switched off for this tenant, mode or person, or the backend refused the session. */
|
|
308
|
+
interface AgentUnavailableScreenProps {
|
|
309
|
+
/** Why: `off`, `auth`, `invalid_session`, … */
|
|
310
|
+
readonly reason: AgentFailureReason | null;
|
|
311
|
+
readonly code: string | null;
|
|
312
|
+
/** A person instead (the chat's `onContact`); absent when the app gave none. */
|
|
313
|
+
readonly onContact: (() => void) | undefined;
|
|
314
|
+
/** Ask again (after a sign-in, or the agent switched back on). */
|
|
315
|
+
readonly onRetry: () => void;
|
|
316
|
+
}
|
|
317
|
+
interface AgentUnreachableProps {
|
|
318
|
+
readonly onRetry: () => void;
|
|
319
|
+
/** Why: `network`, `server`, `rate_limited`, … */
|
|
320
|
+
readonly reason: AgentFailureReason | null;
|
|
321
|
+
}
|
|
322
|
+
/** A slot gets the kit's own part as `Default`, to wrap rather than rewrite. */
|
|
323
|
+
type Slot$1<P> = ComponentType<P & {
|
|
324
|
+
readonly Default: ComponentType<P>;
|
|
325
|
+
}>;
|
|
326
|
+
interface AgentFooterProps {
|
|
327
|
+
/** The newest whole reply's turn, to rate; null when there is none. */
|
|
328
|
+
readonly turnId: string | null;
|
|
329
|
+
readonly rating: AgentRating | undefined;
|
|
330
|
+
readonly onRate: (rating: AgentRating) => void;
|
|
331
|
+
readonly onOpenPrivacy: (() => void) | undefined;
|
|
332
|
+
}
|
|
333
|
+
interface AgentChatSlots extends ChatSlots {
|
|
334
|
+
readonly Ended?: Slot$1<AgentEndedProps>;
|
|
335
|
+
readonly Unreachable?: Slot$1<AgentUnreachableProps>;
|
|
336
|
+
/**
|
|
337
|
+
* The whole screen when there is no agent (off, or the session refused). Not `Unavailable`: that is the chat's own
|
|
338
|
+
* "couldn't connect" banner, still drawn for a session that drops.
|
|
339
|
+
*/
|
|
340
|
+
readonly UnavailableScreen?: Slot$1<AgentUnavailableScreenProps>;
|
|
341
|
+
/** Under the composer; null hides it. Default: thumbs on the newest whole reply, and the privacy link. */
|
|
342
|
+
readonly Footer?: Slot$1<AgentFooterProps> | null;
|
|
343
|
+
}
|
|
344
|
+
interface AgentChatProps extends Omit<VinaverseChatProps, 'conversation' | 'components' | 'suggestion' | 'footer'> {
|
|
345
|
+
/** Whose conversation: one per person, mode, business and thread. */
|
|
346
|
+
readonly agentKey: AgentKey;
|
|
347
|
+
/** Where the person asks from, told to the agent as a session opens. */
|
|
348
|
+
readonly place?: AgentPlace | null;
|
|
349
|
+
readonly entryPoint?: string | null;
|
|
350
|
+
/** The question about this place, offered when the session was told another one (`moved`). */
|
|
351
|
+
readonly askAbout?: string | null;
|
|
352
|
+
/** A person: offered on a failed turn, "couldn't connect" and no agent. */
|
|
353
|
+
readonly onContact?: () => void;
|
|
354
|
+
readonly onOpenPrivacy?: () => void;
|
|
355
|
+
/** The agent's name until the session or the status gives one. */
|
|
356
|
+
readonly agentName?: string;
|
|
357
|
+
/**
|
|
358
|
+
* A first question for a flow that asks for itself (setting a business up): a chip the person taps, offered until they
|
|
359
|
+
* say anything. Never sent in their name: what the transcript shows as theirs, they typed or tapped.
|
|
360
|
+
*/
|
|
361
|
+
readonly opener?: Chip | null;
|
|
362
|
+
readonly components?: AgentChatSlots;
|
|
363
|
+
}
|
|
364
|
+
declare function AgentChat(props: AgentChatProps): ReactNode;
|
|
365
|
+
/** The newest reply when it came whole (not cut off, not a refusal): the one to rate. */
|
|
366
|
+
declare function newestWholeReply(view: {
|
|
367
|
+
readonly items: readonly _vinaverse_client_conversation.TimelineItem[];
|
|
368
|
+
}): string | null;
|
|
369
|
+
/** The conversation is over: a new one starts only when the person asks. */
|
|
370
|
+
declare function DefaultEnded(props: AgentEndedProps): ReactNode;
|
|
371
|
+
/** No agent here: says so, and offers a person when the app has one. */
|
|
372
|
+
declare function DefaultUnavailableScreen(props: AgentUnavailableScreenProps): ReactNode;
|
|
373
|
+
/** The app's backend could not be reached, after its tries: try again. */
|
|
374
|
+
declare function DefaultUnreachable(props: AgentUnreachableProps): ReactNode;
|
|
375
|
+
/** Thumbs on the newest whole reply (thanks once given), and the privacy link. */
|
|
376
|
+
declare function AgentFooter(props: AgentFooterProps): ReactNode;
|
|
377
|
+
|
|
378
|
+
/** The launcher's button side, in dp. */
|
|
379
|
+
declare const LAUNCHER_SIZE = 56;
|
|
380
|
+
/** The launcher's look: a ring around the button, its shadow, the bubble's tail toward it. */
|
|
381
|
+
interface LauncherAppearance {
|
|
382
|
+
/** Default none. */
|
|
383
|
+
readonly ring?: {
|
|
384
|
+
readonly color: string;
|
|
385
|
+
readonly width: number;
|
|
386
|
+
} | null;
|
|
387
|
+
/** Default true. */
|
|
388
|
+
readonly shadow?: boolean;
|
|
389
|
+
/** Default true. */
|
|
390
|
+
readonly tail?: boolean;
|
|
391
|
+
}
|
|
392
|
+
/** Where it floats: the screen's edge, its distance from the bottom (above a tab bar) and from the side. */
|
|
393
|
+
interface LauncherPlacement {
|
|
394
|
+
/** Default `right`. */
|
|
395
|
+
readonly edge?: 'left' | 'right';
|
|
396
|
+
/** Default 16. */
|
|
397
|
+
readonly bottom?: number;
|
|
398
|
+
/** Default 16. */
|
|
399
|
+
readonly inset?: number;
|
|
400
|
+
}
|
|
401
|
+
interface LauncherButtonProps {
|
|
402
|
+
readonly label: string;
|
|
403
|
+
readonly name: string;
|
|
404
|
+
readonly onPress: () => void;
|
|
405
|
+
readonly Mark: ComponentType<{
|
|
406
|
+
readonly size: number;
|
|
407
|
+
readonly color: string;
|
|
408
|
+
}> | undefined;
|
|
409
|
+
readonly ring: {
|
|
410
|
+
readonly color: string;
|
|
411
|
+
readonly width: number;
|
|
412
|
+
} | null;
|
|
413
|
+
readonly shadow: boolean;
|
|
414
|
+
}
|
|
415
|
+
interface LauncherGreetingProps {
|
|
416
|
+
readonly text: string;
|
|
417
|
+
readonly closeLabel: string;
|
|
418
|
+
readonly onOpen: () => void;
|
|
419
|
+
readonly onClose: () => void;
|
|
420
|
+
readonly tail: boolean;
|
|
421
|
+
readonly edge: 'left' | 'right';
|
|
422
|
+
}
|
|
423
|
+
/** How the button and the bubble come in; `reducedMotion` when the person asked for none. */
|
|
424
|
+
interface LauncherEntranceProps {
|
|
425
|
+
readonly part: 'button' | 'greeting';
|
|
426
|
+
readonly reducedMotion: boolean;
|
|
427
|
+
readonly children: ReactNode;
|
|
428
|
+
}
|
|
429
|
+
type Slot<P> = ComponentType<P & {
|
|
430
|
+
readonly Default: ComponentType<P>;
|
|
431
|
+
}>;
|
|
432
|
+
/** Where the person opened the agent from: the app's route, and the mode. */
|
|
433
|
+
interface LauncherContext {
|
|
434
|
+
readonly route: string | null;
|
|
435
|
+
readonly mode: string;
|
|
436
|
+
}
|
|
437
|
+
interface AgentLauncherProps {
|
|
438
|
+
readonly subject: string | null;
|
|
439
|
+
readonly mode: string;
|
|
440
|
+
readonly onOpen: (from: LauncherContext) => void;
|
|
441
|
+
/** The app's current route; with `routes`, the launcher shows only on those. */
|
|
442
|
+
readonly route?: string | null;
|
|
443
|
+
readonly routes?: readonly string[];
|
|
444
|
+
/** The app says step aside (a sheet is up, a map with its own cards…). */
|
|
445
|
+
readonly hidden?: boolean;
|
|
446
|
+
/** Hidden while the keyboard is up. Default true. */
|
|
447
|
+
readonly hideWithKeyboard?: boolean;
|
|
448
|
+
/** Where it remembers the greeting was shown (the app's preferences store); default: for this launch only. */
|
|
449
|
+
readonly storage?: GreetingStorage;
|
|
450
|
+
/** The storage's key for a person and mode (a record the app already keeps); default `greetedKey`. */
|
|
451
|
+
readonly storageKey?: (subject: string | null, mode: string) => string;
|
|
452
|
+
/** The greeting's words, or by mode; default the copy's `launcherGreeting`. */
|
|
453
|
+
readonly greeting?: string | ((mode: string) => string);
|
|
454
|
+
/** How long after showing the greeting appears. Default 1200 ms. */
|
|
455
|
+
readonly delayMs?: number;
|
|
456
|
+
/** The app's brand mark inside the button; default the agent name's first letter. */
|
|
457
|
+
readonly Mark?: ComponentType<{
|
|
458
|
+
readonly size: number;
|
|
459
|
+
readonly color: string;
|
|
460
|
+
}>;
|
|
461
|
+
/** Reads the greeting to a screen reader as it appears. Default: the platform's. */
|
|
462
|
+
readonly announce?: (text: string) => void;
|
|
463
|
+
readonly components?: {
|
|
464
|
+
readonly Button?: Slot<LauncherButtonProps>;
|
|
465
|
+
readonly Greeting?: Slot<LauncherGreetingProps>;
|
|
466
|
+
/** Default: a short fade and scale; none with reduced motion. */
|
|
467
|
+
readonly Entrance?: Slot<LauncherEntranceProps>;
|
|
468
|
+
};
|
|
469
|
+
readonly appearance?: LauncherAppearance;
|
|
470
|
+
/** Where it floats over the app's screens; `style` comes after it, for anything else. */
|
|
471
|
+
readonly placement?: LauncherPlacement;
|
|
472
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
473
|
+
/** As on the chat: the person's locale, the app's words, theme and color scheme. */
|
|
474
|
+
readonly locale?: string;
|
|
475
|
+
readonly copy?: CopyOverrides;
|
|
476
|
+
readonly theme?: ThemeOverrides;
|
|
477
|
+
readonly colorScheme?: ColorSchemeSetting;
|
|
478
|
+
}
|
|
479
|
+
declare function AgentLauncher(props: AgentLauncherProps): ReactNode;
|
|
480
|
+
/** Whether the keyboard is up. */
|
|
481
|
+
declare function useKeyboardShown(): boolean;
|
|
482
|
+
/** The kit's entrance: a short fade and scale up; none when the person asked for reduced motion. */
|
|
483
|
+
declare function LauncherEntrance(props: LauncherEntranceProps): ReactNode;
|
|
484
|
+
/** The kit's greeting bubble: the words (a tap opens the agent), a close button, and a tail toward the button. */
|
|
485
|
+
declare function LauncherGreeting(props: LauncherGreetingProps): ReactNode;
|
|
486
|
+
/** The kit's round button: the app's mark, else the agent name's first letter; its ring and shadow as asked. */
|
|
487
|
+
declare function LauncherButton(props: LauncherButtonProps): ReactNode;
|
|
488
|
+
|
|
489
|
+
interface AskAboutRowProps {
|
|
490
|
+
/** "Ask Example Agent about Riley Sample". */
|
|
491
|
+
readonly title: string;
|
|
492
|
+
readonly body?: string;
|
|
493
|
+
readonly onPress: () => void;
|
|
494
|
+
/** The app's brand mark at the row's start; default the agent name's first letter. */
|
|
495
|
+
readonly Mark?: ComponentType<{
|
|
496
|
+
readonly size: number;
|
|
497
|
+
readonly color: string;
|
|
498
|
+
}>;
|
|
499
|
+
readonly locale?: string;
|
|
500
|
+
readonly copy?: CopyOverrides;
|
|
501
|
+
readonly theme?: ThemeOverrides;
|
|
502
|
+
readonly colorScheme?: ColorSchemeSetting;
|
|
503
|
+
}
|
|
504
|
+
declare function AskAboutRow(props: AskAboutRowProps): ReactNode;
|
|
505
|
+
|
|
506
|
+
declare const Avatar: react.NamedExoticComponent<{
|
|
507
|
+
readonly name: string;
|
|
508
|
+
readonly uri: string | null;
|
|
509
|
+
readonly person?: boolean;
|
|
510
|
+
}>;
|
|
511
|
+
|
|
512
|
+
interface ButtonProps {
|
|
513
|
+
readonly label: string;
|
|
514
|
+
readonly onPress: () => void;
|
|
515
|
+
readonly variant?: 'primary' | 'secondary' | 'text';
|
|
516
|
+
readonly disabled?: boolean;
|
|
517
|
+
readonly busy?: boolean;
|
|
518
|
+
/** A role other than a button: `radio` and `checkbox` for choices. */
|
|
519
|
+
readonly role?: 'button' | 'radio' | 'checkbox' | 'link';
|
|
520
|
+
readonly selected?: boolean;
|
|
521
|
+
readonly hint?: string;
|
|
522
|
+
readonly children?: ReactNode;
|
|
523
|
+
readonly testID?: string;
|
|
524
|
+
}
|
|
525
|
+
declare const Button: react.NamedExoticComponent<ButtonProps>;
|
|
526
|
+
|
|
527
|
+
declare function DefaultHeader(props: Omit<HeaderProps, 'Default'>): react.JSX.Element;
|
|
528
|
+
declare const ChatHeader: react.NamedExoticComponent<object>;
|
|
529
|
+
|
|
530
|
+
declare const ChatSkeleton: react.NamedExoticComponent<object>;
|
|
531
|
+
|
|
532
|
+
declare function DefaultComposer(props: Omit<ComposerProps, 'Default'>): react.JSX.Element;
|
|
533
|
+
declare const Composer: react.NamedExoticComponent<{
|
|
534
|
+
readonly onError?: (error: unknown) => void;
|
|
535
|
+
}>;
|
|
536
|
+
|
|
537
|
+
declare const DisclosureBar: react.NamedExoticComponent<object>;
|
|
538
|
+
|
|
539
|
+
/** The tenant's failure action as a button, or nothing when there is none. */
|
|
540
|
+
declare function FailureActionButton(props: {
|
|
541
|
+
readonly state: FailureState;
|
|
542
|
+
}): ReactNode;
|
|
543
|
+
|
|
544
|
+
declare function DefaultBubble(props: Omit<MessageBubbleProps, 'Default'>): react.JSX.Element;
|
|
545
|
+
declare const MessageBubble: react.NamedExoticComponent<{
|
|
546
|
+
readonly item: MessageItem;
|
|
547
|
+
/** The first of a run from the same author: its label is shown. */
|
|
548
|
+
readonly showAuthor: boolean;
|
|
549
|
+
}>;
|
|
550
|
+
/** The reply streaming now: the only cell that re-renders as the text arrives. */
|
|
551
|
+
declare const StreamingBubble: react.NamedExoticComponent<{
|
|
552
|
+
readonly item: MessageItem;
|
|
553
|
+
readonly showAuthor: boolean;
|
|
554
|
+
}>;
|
|
555
|
+
|
|
556
|
+
/** Rows of one kind recycle together. */
|
|
557
|
+
declare function itemType(item: TimelineItem): string;
|
|
558
|
+
/**
|
|
559
|
+
* Runs of two or more consecutive cards with one carousel group (`group.layout: carousel`, the same `group.id`): by
|
|
560
|
+
* the first card's key, and the keys of the cards the run draws after it. A run equal to the previous one is the
|
|
561
|
+
* same array, so its row does not render again.
|
|
562
|
+
*/
|
|
563
|
+
declare function carousels(items: readonly TimelineItem[], previous: ReadonlyMap<string, readonly CardItem[]>): {
|
|
564
|
+
runs: Map<string, readonly CardItem[]>;
|
|
565
|
+
inside: Set<string>;
|
|
566
|
+
};
|
|
567
|
+
declare const Row: react.NamedExoticComponent<{
|
|
568
|
+
readonly item: TimelineItem;
|
|
569
|
+
readonly showAuthor: boolean;
|
|
570
|
+
/** The carousel this card starts (`components.CardGroup`). */
|
|
571
|
+
readonly run?: readonly CardItem[] | undefined;
|
|
572
|
+
/** A card a carousel earlier in the list draws. */
|
|
573
|
+
readonly inside?: boolean;
|
|
574
|
+
}>;
|
|
575
|
+
declare const MessageList: react.NamedExoticComponent<object>;
|
|
576
|
+
|
|
577
|
+
declare const StatusBanner: react.NamedExoticComponent<object>;
|
|
578
|
+
/** The kit's own "Couldn't connect." banner: try again, and the tenant's failure action when there is one. */
|
|
579
|
+
declare function DefaultUnavailable(props: {
|
|
580
|
+
readonly state: FailureState;
|
|
581
|
+
}): ReactNode;
|
|
582
|
+
|
|
583
|
+
declare const SystemRow: react.NamedExoticComponent<{
|
|
584
|
+
readonly item: SystemItem;
|
|
585
|
+
}>;
|
|
586
|
+
/** The kit's own failed-turn row: "Something went wrong.", and the tenant's failure action when there is one. */
|
|
587
|
+
declare function DefaultTurnFailed(props: {
|
|
588
|
+
readonly state: FailureState;
|
|
589
|
+
}): ReactNode;
|
|
590
|
+
|
|
344
591
|
declare const Welcome: react.NamedExoticComponent<{
|
|
345
592
|
readonly welcome: Welcome$1;
|
|
346
593
|
readonly onChip: (message: string) => void;
|
|
@@ -357,4 +604,4 @@ declare function useReducedMotion(): boolean;
|
|
|
357
604
|
/** Reads a line to a screen reader, without moving focus. */
|
|
358
605
|
declare function announce(text: string): void;
|
|
359
606
|
|
|
360
|
-
export { ActivityLine, Avatar, Button, type ButtonProps, CardActions, CardCarousel, CardFrame, type CardGroupProps, type CardProps, CardView, type ChatHandlers, ChatHeader, ChatSkeleton, type ChatSlots, type ColorSchemeSetting, Composer, type ComposerProps, DefaultBubble, DefaultComposer, DefaultHeader, DefaultTurnFailed, DefaultUnavailable, DisclosureBar, type EmptyStateProps, type FailureAction, FailureActionButton, type FailureProps, type FailureState, type HeaderProps, InfoCard, type LifecycleTarget, LinksCard, type ListProps, ListingCard, MessageBubble, type MessageBubbleProps, MessageList, NextStepCard, ProposalCard, type ProposalDecision, QuestionCard, Row, StatusBanner, StreamingBubble, SystemRow, type Theme, type ThemeOverrides, ThemeProvider, TimeSlotsCard, VinaverseChat, type VinaverseChatProps, VinaverseChatProvider, Welcome, announce, answerText, carousels, createTheme, defaultCard, fieldText, itemType, monogram, ratingText, themeProblems, useChat, useNativeLifecycle, useReducedMotion, useTheme };
|
|
607
|
+
export { ActivityLine, AgentChat, type AgentChatProps, type AgentChatSlots, type AgentEndedProps, AgentFooter, type AgentFooterProps, AgentLauncher, type AgentLauncherProps, type AgentUnavailableScreenProps, type AgentUnreachableProps, AskAboutRow, type AskAboutRowProps, Avatar, Button, type ButtonProps, CardActions, CardCarousel, CardFrame, type CardGroupProps, type CardProps, CardView, type ChatHandlers, ChatHeader, ChatSkeleton, type ChatSlots, type Chip, type ColorSchemeSetting, Composer, type ComposerProps, DefaultBubble, DefaultComposer, DefaultEnded, DefaultHeader, DefaultTurnFailed, DefaultUnavailable, DefaultUnavailableScreen, DefaultUnreachable, DisclosureBar, type EmptyStateProps, type FailureAction, FailureActionButton, type FailureProps, type FailureState, type HeaderProps, type ImagePolicy, InfoCard, LAUNCHER_SIZE, type LauncherAppearance, LauncherButton, type LauncherButtonProps, type LauncherContext, LauncherEntrance, type LauncherEntranceProps, LauncherGreeting, type LauncherGreetingProps, type LauncherPlacement, type LifecycleTarget, LinksCard, type ListProps, ListingCard, MessageBubble, type MessageBubbleProps, MessageList, NextStepCard, ProposalCard, type ProposalDecision, QuestionCard, Row, StatusBanner, StreamingBubble, SystemRow, type Theme, type ThemeOverrides, ThemeProvider, TimeSlotsCard, VinaverseChat, type VinaverseChatProps, VinaverseChatProvider, Welcome, allowedImage, announce, answerText, carousels, createTheme, defaultCard, fieldText, itemType, monogram, newestWholeReply, ratingText, themeProblems, useChat, useKeyboardShown, useNativeLifecycle, useReducedMotion, useTheme };
|